BaiLong

BaiLong

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Is setprimattrib() a deferred function? April 5, 2019, 1:10 p.m.

Hello,

I'm trying to set a primitive attribute in a detail wrangle, using
setprimattrib()
.
For whatever reason the function is not executed at runtime, but after the whole wrangle.

Saying:
prim(0, "primvariable", i);
setprimattrib(0, "primvariable", i, primvalue, "set");
prim(0, "primvariable", i);

returns the same value for both
prim()
calls, instead of returning the new value on the second call.

Is this expected? I'm quite sure it's at least not desired.

I also include an example file. This is from a more complex thing I'm trying to solve, where I write a value onto different prims if they meet certain criteria. Therefor I can't do it in two wrangles or in a primitive wrangle.

Thanks for any help or pointers!

PS: I tried in h16.5 and h17. I'm running on linux so the
printf()
calls just output something to the terminal.

Python script to change operator type Nov. 19, 2015, 5:12 p.m.

Oh wow, that was easy! ops:

I wasn't thinking of looking in the API for the operations on Node. I only looked at NodeType…

Thanks so much!!!

Python script to change operator type Nov. 19, 2015, 2:58 p.m.

Hi,

I would like to use python to run whatever functions are executed when you use the righ click menu > “Change Type…” on a Node. Because I have to do it on a number of nodes.

Does anyone have an idea how to change the operator type of a node?

That's what I have so far:
changeNodes =
objs = hou.root().recursiveGlob('*', hou.nodeTypeFilter.Obj)
for o in objs:
if o.type().name() == ‘nodeType_A’:
changeNodes.append(o)
for c in changeNodes:
#change nodeType to ‘nodeType_B’
#Keep name
#Keep Parameters

Any ideas? If there is a way to just get whatever code is run when I use the “Change Type…” that would already be of huge help!

Thanks a lot!

–Markus