Vincent Balmori

venator87

About Me

EXPERTISE
VFX Artist
INDUSTRY
Gamedev

Connect

LOCATION
United States
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Setting varmaps with python Aug. 31, 2014, 11:43 p.m.

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?

Setting varmaps with python Aug. 31, 2014, 9:01 p.m.

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):

OperationFailed: The attempted operation failed.
No attribute with this name exists
for attr in attr_list:
name = attr.name()
geo.setGlobalAttribValue(name, name.upper() )

Setting varmaps with python Aug. 26, 2014, 12:30 a.m.

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()