insert ScriptJob


#1

is there a way to insert a scriptJob in a saved file scene like that if l have 20 animator owrking on that scene l will nto have to pass on all pc to run that scriptJob
thx :slight_smile:


#2

you can’t save a scriptJob with a scene as such, but you can create a mel command that gets executed when the scene is loaded.

if you create a script node, and make it so it loads before the scene is loaded, (this is done in the expression editor - or you can create one through mel) you can make a scriptjob load when the scene is opened.


#3

let me quote the online-docs:
>
Run MEL commands whenever a scene is opened or closed
[i]A script node lets you attach a MEL script to a scene, and have the script run whenever the scene is opened (loaded from disk) or closed (when the user opens another scene file or starts a new scene).

Refer to the MEL and expressions guide for information on script nodes.

Search for: Script Nodes[/i]
<

HIH
s.


#4

Hey Mac, do you actually use script nodes? For what? I´ve actually never had the need to attach scripts to scenes…but sure, it could be useful for happy little do-ers.


#5

some nice script job examples:

when rendering, you exchange lowres with highres models, change smoothing values of objects, exchange lowres with highres textures and so on.
it is quite handy to use them like that.

parts of it could be done with pre and post render mels in the globals as well, but by far not that good to control.

especially since the script jobs reside in the scene file when saved.

cheers

alexx


#6

Ah, yeah, that´s pretty cool. You mean script node I assume. I didn´t think script jobs were saved between Maya sessions…


#7

hmm…

good question to be honest.
i think what i described is a scripts job as well…
but certainly i am unsure right now

cheers

alexx


#8

Thx Guy for the tip :wink:


#9

dave: yeah I do use scriptJobs. I use them for my zooTriggered script, and an autosave script. zooTriggered, the scriptJob just monitors selections, while the autosave one is again triggered by obejct selection to increment a global variable counter.

oh, I also use them in my zooBodgeK script, which matches and keys an fk heirarchy to an IK joint chain - this is a really useful script for animating FK. sometimes its just easier to pose an arm using fk - but you just don’t want to use ik…

i also use em heaps to update parts of UIs - but UI updating scriptJobs are always parented to the window, so they’re killed whenever you close that window.

they’re pretty cool.

Originally posted by dwalden74
You mean script node I assume. I didn´t think script jobs were saved between Maya sessions…
no, you’re right, scriptJobs aren’t saved between sessions, but the original question was how can you get a scriptJob to save between sessions. and my answer was, if you save the scriptJob load command in a scriptNode…

alexx - exchanging models upon render uses a scriptNode, not a job. pre and post render mel is just another interface to a scriptNode. So whether you use a custom made scriptNode, or just enter a command in the pre-render command, they’re both using scriptNodes to get the job done. :wink:


#10

yeah I do use scriptJobs.

I was talking about script nodes though. … I thought your zooTriggered and zooBodge stuff used scriptJobs? Maybe they use both…whatever, it´s cool.


#11

dave: sorry man… early morning. :wink:

i use scriptnodes for my zooRemind script, which is pretty super simple… it just pops up a window to whoever opens the scene to remind them to do stuff. its good for leaving comments in a scene for animators to read when they next come back to it, or to tell people new stuff about a rig when changes are made.


#12

Good idea Mac about the reminder :wink:


#13

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.