API - Get and set translate info on same node during compute() in custom node

API - Get and set translate info on same node during compute() in custom node

Anonymous
Not applicable
497 Views
1 Reply
Message 1 of 2

API - Get and set translate info on same node during compute() in custom node

Anonymous
Not applicable

I want it to be something like a constraint. One input object will be the "driver". The others (an array, compound, whatever I find suitable) will change their position as "driven". 

 

To do this, my custom node input should be the driver and the driven translate nodes..

On the compute() method I change the input translations using the driver translation too. Then I must modify the driven nodes connecting them to the outputs as well to modify their translation!

 

That creates a cycle that Maya doesn't like and I'm not really sure if this is the way to go.

What should I do if I want to query and modify information of a connected node at the same time in a custom node?

 

0 Likes
498 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

I found an example (simpleEmitter) in the C++ API examples... and it does an unexpected thing:   It gathers info from the plugs in the output "from the previous frame"... and then applies changes and stores the data on them again.

 

Isn't this supposed to be done, as a recommendation in the API documentation?   I thought queried info should ALWAYS come from the input plugs.

0 Likes