MotionBuilder Forum
Welcome to Autodesk’s MotionBuilder Forums. Share your knowledge, ask questions, and explore popular MotionBuilder topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MB2012 Simple Python Bugs

1 REPLY 1
Reply
Message 1 of 2
PDWhiting
205 Views, 1 Reply

MB2012 Simple Python Bugs

Hey all... now is it just me or is MB2012's Python unable to cope with simple if statements anymore? Using this code (simplified for this post) I'm altering what my code does based on the version:

Version = "2012"

if Version == "2009" or "2011":
print "Older"
if Version == "2012":
print "Newer"


However, instead of this printing only "Newer" as you'd expect, it goes through both if statements and prints both pieces of text.

Am I missing something... all versions up-till now have coped with this bit of code?
1 REPLY 1
Message 2 of 2
Jacques.LIAO
in reply to: PDWhiting

I would use the code like this


Version = "2012"

if Version == "2009" or Version == "2011":
print "Older"
if Version == "2012":
print "Newer"
Jacques LIAO
Freelancer / Consultant programmer for MotionBuilder and Virtual production

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report