PDA

View Full Version : expressions verse Maya nodes


a3dmonkey
08-20-2003, 08:04 PM
I've been working with Maya nodes and expression to create various rigging tools for myself. I've generally found the built in Maya nodes to be slightly faster than any given expression I've written.

so all I really know is

Maya nodes
_________________

faster

Expressions
_________________

slower

I'm wondering what other differences people have found when using one or the other. What advantages and disadvantages have you seen for each?

I'm also wondering which activates first? The expressions I've written update as the frame is changed and the expression is called upon. While I have no real clue as to how Maya nodes are called? Are they always active? Or do they update on a per frame basis similar to expressions? Saddly I have no time to experiment and figure this out currently. I'm "guessing" Nodes are always funtioning and just pass along infomation as its created. Does anyone out there know know how these nodes are called by Maya?

Thankx,

Michael

PS: a previous posts on this

http://www.cgtalk.com/showthread.php?s=&threadid=67661&highlight=maya+nodes

Rudity
08-20-2003, 10:25 PM
I've pretty much gotten by on the same thinking that you have.
Expressions are slower than nodes..

I'm pretty sure that the expressions are slower because they do evaluate every frame.

Like you, I dont know how the nodes evaluate. But they're part of the API so Alias has the coded for speed I'm guessing. (not a programmer)
So ya, I'm curios now that you've asked this question too.

loked
08-20-2003, 10:39 PM
The speed of things will vary depending on what you're doing, but for one object driving another, using the same animation curve is probably the fastest method. So if you wanted to get sphere2 to move exactly the same as sphere1, just connect sphere1's animation curve to sphere2.

Second to that would be a direct connection like through the connection editor and thirdly would be a math node like a multiplyDivide node. Then would be expressions and lastly constraints.

Sometimes using expressions can be faster than math nodes, it all just depends on what your scene is like.

I'm definitely no expert on this type of thing though. I'm sure Mark Wilkins of Jason Schleifer could give you a better answer on this type of thing:thumbsup:


later:wavey:
loked

rokandic
08-21-2003, 05:47 PM
I'm also wondering which activates first? The expressions I've written update as the frame is changed and the expression is called upon. While I have no real clue as to how Maya nodes are called? Are they always active? Or do they update on a per frame basis similar to expressions? Saddly I have no time to experiment and figure this out currently. I'm "guessing" Nodes are always funtioning and just pass along infomation as its created. Does anyone out there know know how these nodes are called by Maya?

Expressions are executed when any of its input attribute changes. It executes at least once per frame, because expressions are connected to time node by default.

As to which one is faster it depends on the scene as loked already pointed out.

Lets say you got 300 characters controlled by one expression node. If you change one attribute of one character all 300 characters data would be recalculated which would be very slow. If you had one node network per character, by changing the attribute only the nodes in the network would be recalculated which means other characters data wouldn't be calculated (unless you would force some kind of dependancy between characters).

Different example would be when you have huge node networks of simple nodes (like multiply/divide, plus/minus) and you have a bunch of them just to get one value out. You can usually easily replace all those with only one expression node and in most cases it will be faster and easier to control too, plus you save yourself from scene clutter.


-rok

CGTalk Moderation
01-15-2006, 10: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.