Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The need to repeat Maxscript commands in order for them to work

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Anonymous
683 Views, 1 Reply

The need to repeat Maxscript commands in order for them to work

I don't remember this being a problem until recently, but lately I've been finding that when I am running scripts I will have to run them twice in order for the intended outcome I'm looking for. It's as if the first time I run it it's getting ignored. I've attached an example of this weird behavior to this message- this screenshot is just a simple change of the coordinate system, but as you'll see in what gets printed out, I need to make calls multiple times to switch back and forth from local to world. Anyone know why this could be happening? 

1 REPLY 1
Message 2 of 2
Swordslayer
in reply to: Anonymous

It works as expected, quoting from the reference:

 

  • All the set constructs are expressions that yield the context setting that was in force at the time the new context was set.
  • This allows you to simulate the standard nested forms of these constructs by storing the old context in a variable and using that to restore the context later.

 

oc = set coordsys parent -- remember old coordsys
rotate $foo (quat 30 z_axis)
...
set coordsys oc -- restore it 

 

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

Post to forums  

Autodesk Design & Make Report