検索 - User list
Full Version: Setting "Input Prims" in Python
Root » Solaris and Karma » Setting "Input Prims" in Python
OmerShapira
When modifying a LOP prim in python, I'd like to be able to communicate that change to other nodes downstream, so they can use `lopinputprim('.', 0)`as their input.

Python nodes don't auto-detect changes in “input prims”.

Here's an example:
from pxr import Sdf
node = hou.pwd()
stage = node.editableStage()

prim_path = node.inputPrims(0)[0]
prim = stage.GetPrimAtPath(prim_path)
prim.CreateAttribute("primvars:__TEST", Sdf.ValueTypeNames.Int, True, Sdf.VariabilityUniform).Set(42)

a node querying the input prim downstream will have no indication it's there.

(houdini 18.0.287)
rafal
You mean something like hou.pwd().setLastModifiedPrims()?
OmerShapira
yup, definitely that

Thanks!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB