Controller Condition issue

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  03 March 2012
Controller Condition issue

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".
__________________

Robert Pashayan
3D Artist

available for Fulltime and Freelance
My Portfolio
 
  03 March 2012
Would something like this work?
if not (isKindOf $.pos.controller path_constraint) do messageBox "Apply Path Constraint"
 
  03 March 2012
Originally Posted by Raytracer05: Would something like this work?
if not (isKindOf $.pos.controller path_constraint) do messageBox "Apply Path Constraint"


Thank you very much, Yeah that works
What the isKindOf do ?
__________________

Robert Pashayan
3D Artist

available for Fulltime and Freelance
My Portfolio
 
  03 March 2012
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.
 
  03 March 2012
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.
 
  03 March 2012
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:08 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.