PDA

View Full Version : embed scriptJob into a scene


jaydru
02-07-2011, 02:31 PM
ok so i have a scriptJob helping my rig work, but it seems that when i pass that on to someone else, or reboot maya and load the scene that it doesnt save the scriptJob with it, what do i do here?

edit im looking at scriptNodes in the docs, looks promising

Robert Bateman
02-07-2011, 04:05 PM
edit im looking at scriptNodes in the docs, looks promising

Yup, just make sure you've tested that scriptNode to death before passing it on to someone else. Get it wrong and you might have trouble fixing the file again....

tonytouch
02-08-2011, 01:39 PM
you can simply edit your scriptNodes , from within the "expression editor" ... just filter for "scriptNodes"

Robert Bateman
02-08-2011, 04:22 PM
you can simply edit your scriptNodes , from within the "expression editor" ... just filter for "scriptNodes"

Sometimes, but not always. Don't run this script if you have work you want to keep! It will spit out a file "C:/foo.mb". I suspect you'll find it harder to edit the script node in that file than you thought :surprised


// create our script node
scriptNode -beforeScript "deleteUI $gMainWindow;" -n foo;
setAttr foo.scriptType 1;

// save to some file.
file -rn "C:/foo.mb";
file -save;

// now let's see what happens when we open the file....
file -open "C:/foo.mb";


Yes it's a very contrived example, although I have seen much worse on the odd occasion!

Moral of the story: Exercise caution when using script nodes!

(To fix this, yes could just disable script nodes on load! The only problem is that if someone gets the file from you, it may take them a day or two for them to figure out why it won't load!)

CGTalk Moderation
02-08-2011, 04:22 PM
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.