View Full Version : Invalid time unit on bakeResults ????

05-04-2004, 03:14 PM
Hello out there :

Im trying to execute bakeResults:

string $time = ("\"" + $init + ":" + $end + "\"" ) ;

Having time ( string ):

$time = "0:170"

So I execute bakeResults on that time:

bakeResults -simulation true -t $time -sampleBy 2 ... -shape false $selection;

Getting this error message:

// Error: line 1: Invalid time unit: "0:170" //

But if I specify on the command:

bakeResults -simulation true -t "0:170" -sampleBy 2 ... -shape false $selection;

And the bake goes on.....
Any idea about why ??

05-04-2004, 05:14 PM
Hi javier-

yea, Ive seen this a lot when dealing with keyframes, keytangents etc via MEL. At the moment I cant remember what exactly the reason was, but I know that the solution is to create your command as a string, then evaluate that string:

eval ("bakeResults -simulation true -t " + $time + " -sampleBy 2 ... -shape false " + $selection);

this should do it for you.


05-04-2004, 05:18 PM
Sure! I just fixed it with eval.

Thank you so much !!

CGTalk Moderation
01-18-2006, 04:00 AM
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.