Group filter expression(python) attribcreate problem
3982 5 2-
- AledLloyd
- Member
- 5 posts
- Joined: Oct. 2008
- Offline
Hi All,
I'm a beginner with Houdini and have been following some excellent peter quint Houdini tutorials. In one he uses an added variable to drive the group filter expression. I've converted the hscript to python but am having problems accessing the newly created “myvar”. The code
if hou.lvar(“TZ”) <= 0.0:
return 1
else:
return 0
works fine, but
if hou.lvar(“myvar”) <= 0.0:
return 1
else:
return 0
does not (“myvar” being an attribute added to the object using the attribcreate node).
Thanks in advance for any suggestions.
:?
I'm a beginner with Houdini and have been following some excellent peter quint Houdini tutorials. In one he uses an added variable to drive the group filter expression. I've converted the hscript to python but am having problems accessing the newly created “myvar”. The code
if hou.lvar(“TZ”) <= 0.0:
return 1
else:
return 0
works fine, but
if hou.lvar(“myvar”) <= 0.0:
return 1
else:
return 0
does not (“myvar” being an attribute added to the object using the attribcreate node).
Thanks in advance for any suggestions.
:?
-
- awong
- Member
- 818 posts
- Joined: Sept. 2013
- Offline
-
- AledLloyd
- Member
- 5 posts
- Joined: Oct. 2008
- Offline
-
- awong
- Member
- 818 posts
- Joined: Sept. 2013
- Offline
-
- AledLloyd
- Member
- 5 posts
- Joined: Oct. 2008
- Offline
Hi, I checked your file and it does work, although the Detail/Var in the geometry spread sheet have changed places……but, it still does not work in the original file. I also started a fresh scene and just created a basic sphere and attribcreate and I'm having the same problem. I've attached a ‘about Houdini info file’ for your refrence.
Thanks for your advice and patience
Thanks for your advice and patience
-
- awong
- Member
- 818 posts
- Joined: Sept. 2013
- Offline
Ah, I should have realized you were using Houdini 15. In Houdini 15.0, the attribcreate SOP no longer create the local variable by default(because we want to favor the @attrname syntax). So you'd need to manually create it if you want to use local variable. This can be done by simply checking the “Local Variable” checkbox.
Andrew / アンドリュー
-
- Quick Links


ops: . I've tried renaming the var to MYVAR and still no luck. I'm also unable to locate the Detail/Varmap sheet that displays the variable name change.