PDA

View Full Version : Problem with ScriptJob.


Zexell
04-22-2008, 08:37 AM
There is a small problem with ScriptJob. I was tried to realize something like functionality Lightwave. An opportunity the minimal forces to edit mesh, as it's shown in gif.
http://img88.imageshack.us/img88/9599/polypokedf0.gif (http://imageshack.us)
There ia a code:

//create selection set from selected faces
string $newSet1 = `sets`;
select -r $newSet1;

//kill edges inside of selected faces
ConvertSelectionToContainedEdges;
polyDelEdge -cv true -ch 0 `ls -sl`;

//select selection set
select -r $newSet1;

//add polypoke and lock some axis
performPolyPoke 0;
string $poked[] = `ls -sl -o "polyPoke*"`;
string $str1 = "setAttr -lock on " + $poked[0] + ".localTranslateX";
string $str2 = "setAttr -lock on " + $poked[0] + ".localTranslateY";
eval $str1;
eval $str2;

//create procedure to
global proc delSELset(string $name)
{
select -r -ne $name;
doDelete;
}

//Initialization event of changing polypoke
int $jobNum = `scriptJob -killWithScene -runOnce true -event "SelectionChanged" delSELset($newSet1)`;

Gives out such mistake: // Error: line 28: Invalid object or value: set1 //
It is necessary to remove selectionSet $newSet1 after work with polypoke.
Help please.

GiantG
04-22-2008, 03:52 PM
You forgot some brackets at the end:

int $jobNum = `scriptJob -killWithScene -runOnce true -event "SelectionChanged" (delSELset($newSet1))`;

Zexell
04-22-2008, 04:14 PM
Thanks a lot it works. But it's not that I wished to do.
I want to realize:
1. Select faces on mesh
2. Press a button
3. Script deletes all edges inside (not losing focus selestion)
4. Script does polypoke to all chosen faces (polypoke with locked two axes)
And the most important: should work in one pass, not separately, it means, not 2 times press a button, or not 2 different buttons.
How I can do it?

CGTalk Moderation
04-22-2008, 04:14 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.