Using EvalDeferred commands in sequence

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
  10 October 2005
Using EvalDeferred commands in sequence

I am trying to do a script where I wanna use several eval deffered command in sequence to run several differet scripts. Trick is that they have to happen in the correct order.

sending the commands like this gets inconsistant results:

evalDeferred $cmd1;
evalDeferred $cmd2;
evalDeferred $cmd3;
evalDeferred $cmd4;

It usually ends up running the commands in this order.

cmd2
cmd1
cmd3
cmd4

which is not what I would expect. Is there anyway to make sure these all run in the correct order that I sent the commands in?

-Charles
__________________
Charles R. Anderson
Lead Animator/Character TD
Airtight Games
 
  10 October 2005
Post

You might want to try wrapping your sequence of a command in a procedure, then executing that procedure.

global proc cmds()
 {
 	 cmd1;
 	 cmd2;
 	 etc...
 }
 
 global proc stuff()
 {
 	 // Do some stuff
 	evalDeferred("cmds");
 }
 


or alternatively, you can build a semicolon list of sequential commands, and then execute them:

global proc stuff()
{
	 evalDeferred($cmd1 + ";" + $cmd2 + ";" + etc);
}


or you could probably get away with using just eval statements. Those usually behave pretty well and execute in order. I find myself very rarely having to use evalDeferred.
 
  10 October 2005
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 09:37 AM.


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