- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I am very new to Python API. I'm trying to create and advanced sine wave node. The way I currently have it set up for the outputs is there is a main overall "outputs" compound attr (not an array), which branches off to several compound attrs ("output1", "output2", etc.), and each of those attributes has x,y,z. The math all seems to be working, but it doesn't apply it to all of the outputs. It just applies all of the values to the main "outputs" attr which sets it to "output1". None of the other output attrs work, but I know the math is correct using print statements. I also have the attributeAffects running so every input affects every output down to the x,y,z. Why is the compute() not setting values for the other outputs? Below is an abbreviated version of the code. I tried using the setDependentsDirty method but it wasn't working. Any help would be greatly appreciated.
def compute(self, plug, dataBlock):
# sine math execution
if ( dpPlug == sineNode.outputs or (plug.isChild() and plug.parent() == sineNode.outputs )):
# math blah blah
# dataHandle.setFloat( ctrl1X )
# dataHandle.setFloat( ctrl1Y )
# dataHandle.setFloat( ctrl1Z )
# dataHandle.setFloat( ctrl2X )
# dataHandle.setFloat( ctrl2Y )
# dataHandle.setFloat( ctrl2Z )
dataBlock.setClean( plug )
Solved! Go to Solution.