PDA

View Full Version : API: compute problems


Starrider
09-15-2006, 03:05 PM
hello!
i am currently programming a locator node which has several attributes. if i change them, the locator should do the compute method, update some internal attributes and draw accordingly to the new data.
the problem is, that the locator doesn't compute anything as long as i haven't connected something to one of its output-attributes (and made the necessary attributeAffects). it seems to me as if only DAG objects would be allowed to start the graph evaluation. is that right or did i get something wrong.
how could i do something like (in stupid code):
attributeAffects(inputValue, COMPUTE_AND_DRAW);
i tried the MPxNode::setDependentsDirty(...) method, which didn't help. i used an additional boolean attribute (like bInputValueChanged) which didn't help as long it wasn't visible in my attribute editor or connected to another node.
anyone knows how to get this to work?
would be great!

Starrider
09-17-2006, 05:02 PM
ok i got told how that works:

as soon as you query any plug in the draw-method which is affected by a dirty plug the draw method will automatically execute the compute-method for that plug.

so that's what i did:
1. added a bMyPlugChanged hidden attribute
2. added attributeAffects( myAttribute, bMyPlugChangedAttribute)
3. queried the bMyPlugChanged attribute in the draw-method

if i change myAttribute in the AE of my locator node, the locator get's redrawn and the draw method starts compute for the bMyPlugChanged.

CGTalk Moderation
09-17-2006, 05:02 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.