PDA

View Full Version : API: NodeTree (example: polyCube..)


AyaKoshigaya
11-13-2004, 10:48 PM
Hi,

i have a little problem... :)
I wanna build a little Node Tree...

first node should be something like a "polyCube" node.. let's name it "startNode".. this node should have an Integer Attribute named "MyAttribute" with the Value 5.

Now this node is connected to a second node "myModifier".. this has a input Attribute "inputValue" and an output "outputValue".. both are Integer... Now I connect startNode.MyAttribute with myModifier.inputValue .. the myModifier node changes the Integer to 10 in his ComputeMethod and outputs it to outputValue..

this is connected to my node "endNode"... and the endnode should draw a Vertex at 10,10,10...

It sounds easy.. but it's annoying me...

I can try whatever I want... the connectionChain won't work...

If I change the MyAttribute value from 5 to 6 or something the ComputeMethod isn't called again... I can use getAttr myModifier.outputValue.. then the startNode and myModifier ComputeMethods are called...

What have I to do..??

I've used these classes for my nodes:
startNode: MPxNode (initalised with MPxNode::kDependNode)
myModifier: MPxNode (initalised with MPxNode::kDependNode)
endNode: MPxSurfaceShape

I also tried to use a MPxLocatorNode for the endNode.. but didn't work either...

So does anyone know what to do???

Au'revoir,
Aya~

sbp
11-14-2004, 06:36 AM
Check out the cvColorNode in your samples (based on a locator node) for the draw specifically.

During screen refresh, the dg decides it has to call draw for surfaceShapeUI or locator nodes. In the draw routine, the plugs are queried, found dirty, and compute is called. In your example, using a locator node as the third node, with a draw routine that examines an input plug that's connected to your modifier node's output would get your nodes computed.

AyaKoshigaya
11-14-2004, 06:55 AM
Hi,

thanks :)
But before I try this... I remembered I need to render my drawings too... so I can't use a MPxLocatorShape cause it won't render.. any idea? :)

Au'revoir,
Aya~

CGTalk Moderation
01-19-2006, 09:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.