Notifications
Clear all
[Closed] Controller Condition issue
Mar 28, 2012 2:35 pm
I created a plugin, to which I want to add a simple if condition, but it’s not working on MAX 2012.
Here’s my script:
if $.pos.controller != path_constraint then messageBox "Apply Path Constraint";
In both cases, when I have a path_constraint applied to my position controller or not he’s sending me the message “Apply Path Constraint”. :banghead:
4 Replies
Mar 28, 2012 2:35 pm
Would something like this work?
if not (isKindOf $.pos.controller path_constraint) do messageBox "Apply Path Constraint"
1 Reply
Mar 28, 2012 2:35 pm
isKindOf compares the class of the first parameter to the second parameter, and returns true if they’re the same.
Another way to write it would have been :
if (classof $.pos.controller == path_constraint) then messageBox "Apply Path Constraint"
isKindOf kinda uses classOf to return its value.
Mar 28, 2012 2:35 pm
isKindOf also compares the second parameter with the superClass of the first so:
isKindOf $ light
would return true if you have any kind light selected.