Vincent Balmori
venator87
About Me
専門知識
VFX Artist
業界:
Gamedev
Connect
LOCATION
United States
ウェブサイト
Houdini Engine
Availability
Not Specified
Recent Forum Posts
Setting varmaps with python 2014年8月31日23:43
Awesome thank you! I learned a lot from looking at that code.
Update: So the only part of the code I'm not fully clear about is the `for attrib in attribs`. So you are accessing the ‘attribs’ module and setting the ‘attrib’ values or is that a For-Loop? I tried looking through the Help browser for something like that, but with no luck.
Also, the way it is formatted by being positioned at the end of that line is something I haven't seen before, so I'm wondering what it does in a Python context?
Update: So the only part of the code I'm not fully clear about is the `for attrib in attribs`. So you are accessing the ‘attribs’ module and setting the ‘attrib’ values or is that a For-Loop? I tried looking through the Help browser for something like that, but with no luck.
Also, the way it is formatted by being positioned at the end of that line is something I haven't seen before, so I'm wondering what it does in a Python context?
Setting varmaps with python 2014年8月31日21:01
Thank you, but for this in particular I'm trying to see how I can do it in Python.
The function I'm trying out to set up the local variables/varmaps is `.setGlobal Attributes()`, but mainly the latter. I thought I thought I understood this function, but every time I execute I get his error when I MMB. So I would like to know if I'm using this function correctly (the scene is attached below):
name = attr.name()
geo.setGlobalAttribValue(name, name.upper() )
The function I'm trying out to set up the local variables/varmaps is `.setGlobal Attributes()`, but mainly the latter. I thought I thought I understood this function, but every time I execute I get his error when I MMB. So I would like to know if I'm using this function correctly (the scene is attached below):
OperationFailed: The attempted operation failed.for attr in attr_list:
No attribute with this name exists
name = attr.name()
geo.setGlobalAttribValue(name, name.upper() )
Setting varmaps with python 2014年8月26日0:30
I’ve been learning on how to use Python for Houdini and I’m trying to create a Python Sop Operator that gets the attributes and creates a Local Variable/varmap for each of them, as some Sop nodes don’t do that automatically. So far, I’ve been able to figure out how to query in the geo with their attributes as seen below. However I’m now a little stuck in figuring out how to get those very attributes and create varmaps from them. In particular, I’m looking for what functions I can use to help with that.
# This code is called when instances of this SOP cook.
node = hou.pwd()
geo = node.geometry()
# Query the geo:
if geo.points():
point_list = geo.points()
if geo.prims():
prim_list = geo.prims()
# This code is called when instances of this SOP cook.
node = hou.pwd()
geo = node.geometry()
# Query the geo:
if geo.points():
point_list = geo.points()
if geo.prims():
prim_list = geo.prims()