calinmatney
04-19-2006, 07:21 PM
Ok I got one question answered but now I have another so I've got a script that I can run to connect edge rings with a set number of loops - CSMultiLoopSplit5; or CSMultiLoopSplit10; and so on and so forth, 5 or 10 being the number of loops.
What would be really helpfull is to have just CSMultiLoopSplit; set to a hotkey and have a window pop up and ask you how many loops you want.
I did a search and came up with a few things but nothing helpfull to someone with no MEL skills at all. So if anybody with scripting skills has a spare moment I would be eternaly gratefull... At least for a little bit, if they could modify this script to bring up a window like I said.
----------------------------------------------------------------------------
global proc CSmultiLoopSplit (float $numSplits)
{
string $shape[] = `listRelatives -p`;
string $edge[] = `filterExpand -sm 32`;
if (size($edge)!=1) { warning "select single edge to do multiSplit on, multi multiLoopSplit not supported"; return;}
int $edgeNum[] = `polyEvaluate -e $shape[0]`;
PolyConvertToRingAndSplit;
int $edgeNumPost[] = `polyEvaluate -e $shape[0]`;
int $edgeStep = $edgeNumPost[0] - $edgeNum[0];
string $polSplt[] = `listConnections -type polySplitRing $shape[0]`;
setAttr ($polSplt[0]+".weight") (1/($numSplits+1));
string $mulSplit = `rename $polSplt[0] multiSplit`;
// addAttr -ln "splits" -at long -min 2 -smx 30 -dv $numSplits $mulSplit;
//scriptJob -ac ($mulSplit+".splits") ("CSmultiLoopSplitChangeCallback "+$mulSplit +" " +$shape[0]+" " + $edgeNum[0] + " " + $edgeStep);
for ($i = 1; $i < $numSplits; $i++)
{
select -r ($shape[0] + ".e["+($edgeNum[0] + ($edgeStep*($i-1)))+"]");
PolyConvertToRingAndSplit;
string $polSplt[] = `listConnections -type polySplitRing $shape[0]`;
setAttr ($polSplt[0]+".weight") (1/($numSplits-($i-1)));
rename $polSplt[0] ($mulSplit+ "_" + ($i+1));
}
}
----------------------------------------------------------------------------
Again, any help would be much appreciated
Thx
CTM
What would be really helpfull is to have just CSMultiLoopSplit; set to a hotkey and have a window pop up and ask you how many loops you want.
I did a search and came up with a few things but nothing helpfull to someone with no MEL skills at all. So if anybody with scripting skills has a spare moment I would be eternaly gratefull... At least for a little bit, if they could modify this script to bring up a window like I said.
----------------------------------------------------------------------------
global proc CSmultiLoopSplit (float $numSplits)
{
string $shape[] = `listRelatives -p`;
string $edge[] = `filterExpand -sm 32`;
if (size($edge)!=1) { warning "select single edge to do multiSplit on, multi multiLoopSplit not supported"; return;}
int $edgeNum[] = `polyEvaluate -e $shape[0]`;
PolyConvertToRingAndSplit;
int $edgeNumPost[] = `polyEvaluate -e $shape[0]`;
int $edgeStep = $edgeNumPost[0] - $edgeNum[0];
string $polSplt[] = `listConnections -type polySplitRing $shape[0]`;
setAttr ($polSplt[0]+".weight") (1/($numSplits+1));
string $mulSplit = `rename $polSplt[0] multiSplit`;
// addAttr -ln "splits" -at long -min 2 -smx 30 -dv $numSplits $mulSplit;
//scriptJob -ac ($mulSplit+".splits") ("CSmultiLoopSplitChangeCallback "+$mulSplit +" " +$shape[0]+" " + $edgeNum[0] + " " + $edgeStep);
for ($i = 1; $i < $numSplits; $i++)
{
select -r ($shape[0] + ".e["+($edgeNum[0] + ($edgeStep*($i-1)))+"]");
PolyConvertToRingAndSplit;
string $polSplt[] = `listConnections -type polySplitRing $shape[0]`;
setAttr ($polSplt[0]+".weight") (1/($numSplits-($i-1)));
rename $polSplt[0] ($mulSplit+ "_" + ($i+1));
}
}
----------------------------------------------------------------------------
Again, any help would be much appreciated
Thx
CTM
