View Full Version : what does "%node" mean?

05 May 2007, 07:41 AM
In some of the commands in the script editor produced by the user manipulated things I found out that %node statement?

Does any of you mean what that %node mean, something like current node may be?

Melis :)

05 May 2007, 09:37 PM
In MEL, and most other scripting/programming languages, "%" is the modulus operator. It returns the remainder of a division. For example 7 % 3 would return 1, this is because 7/3 is two with a remainder of 1. 8 % 4 = 0, 7 % 4 = 3, and so on.

It should also be noted that it works with float values, not just integers. For example, 78.4 % 2.3 = 0.2.

It is something you might not need to use that often, but it sure does come in handy when you do.

05 May 2007, 09:35 AM
In this case this is no modulo operator. %node acts as a placeholder. I came in touch with this once writing a script that deals with shading nodes. Take a look into the createRenderNode.mel (located in mayaX.X/scripts/others) to get an idea how this is used.


CGTalk Moderation
05 May 2007, 09:35 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.