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.
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.
