PDA

View Full Version : object to execute a script?


stickyblue
12-01-2003, 05:35 AM
hey

is there any way to execute a mel script or a command whenever i select an object ?

sbp
12-01-2003, 08:23 AM
I think scriptJob may be what you want, but it's better if you look it up in the docs. It's a bit of a thicket to explain.

stickyblue
12-01-2003, 09:52 AM
awesome ,thanks a lot , i ll check it out asap

mark_wilkins
12-01-2003, 07:28 PM
Yes, a scriptjob is the way to do this, however you should know that they can slow down everything in the environment. You should try it to see whether you notice, but if it's bad, consider whether there might be another alternative.

-- Mark

Doogie
12-02-2003, 06:31 AM
I just recently ended up using one, here's the code I used. I know of the issues, but I did it anyway. Just make sure you attach it to something so it's not running when your not using it (like kill with scene or with a window)

int $pfSimpleScriptJobNum = `scriptJob -killWithScene -e "SelectionChanged" "checkSimpleSelection()"`;

global proc checkSimpleSelection()
{
string $sel[]=`ls -sl`;
if(!strcmp($sel[0], "polyChar"))
{
print "workin\n";
pfCharGUI();
}
}

stickyblue
12-03-2003, 03:35 AM
i see , im gonna try it , thank you very much you all

CGTalk Moderation
01-16-2006, 08:00 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.