PDA

View Full Version : making a node evaluate every frame


ndeboar
09-21-2008, 07:22 PM
Hey!

I am currently writing a maya plugin in the Python API. I’m creating a new node to communicate with serial devices (it’s for a motion control project).

It’s all working at the moment, but the node only evaluates when I move to a new frame manually, not when I hit play/scrub the timeline (which I really need todo).

I’m using the sineNode demo provided as my basis:
http://www.autodesk.com/us/maya/docs/Maya85/DeveloperResources/Using_the_Maya_Python_API.html

If I connect a value to the input attribute of the sine node, it only evaluates like above. Grr!! Any ideas?

Cheers,

Nick Deboar
www.nickdeboar.com

jdj
09-22-2008, 08:15 AM
Suggestion: Try creating an attribute connected to the scene time and then add an attribute dependency between the time input and the output(s) via attributeAffects. Ought to do the trick - otherwise the node is not time-aware and can only react upon changed states of the other inputs. That it evaluates when you move the time slider manually is probably just a lucky coincidence.

Cheers
/ Daniel

ndeboar
09-22-2008, 10:13 AM
Cheers Dan, ill give it a crack tonight (at work atm :surprised )

--edit--

By golly it works.

Made a new attribute (sine.t), plugged time1.outTime into that, set sine.t to affect sine.output, and dada, updates every frame.



Nick

CGTalk Moderation
09-22-2008, 10:13 AM
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.