PDA

View Full Version : To Edge Loop and Bevel


phix314
10-21-2008, 12:23 AM
I find myself doing this a lot, and I'd like to exercise my MEL skills by making a procedure out of this. I don't have too much mel experience, so I think the main reason I'm struggling with this is because I don't know what the exact commands are that I need.



proc loopBevel(){
SelectEdgeLoop;
polySelectEdges edgeLoopOrBorder;

string $selection[] = `ls -sl -type "float3"`;
for($object in $selection){

string $objectType = `objectType $object`;
print ("Object Selected: " + $object + "\n");
//polyBevel Here
}

}

loopBevel();



This works fine on border edges, but on interior edge loops (such as a loop through the center of a cylinder), it bevels all crazy. Upon manual selection, it shows that the edges are pCylinder.e[105], pCylinder.e[107], pCylinder.e[109], pCylinder.e[111], etc... odd numbers instead of a simple .e[100:110].

Also, I'm sure theres a better way of seeing if the object selected is a poly component as opposed to checking if it's a "float3" (came to be by ls -showType).

ewerybody
10-22-2008, 11:44 PM
Hi! If you immediately execute the stuff you actually don't need to define a proc and execute it right after. Thats not necessary.

And getting components is most convinient with polyListComponentConversion. I love that command :]
for edges its just: polyListComponentConversion -te;

then: SelectEdgeLoop; and polySelectEdges edgeLoopOrBorder;?!?!? Do you need both commands? Seems they all do the same. If you are unsure about border edge or not:
proc int isBorderEdge(string $edge)
{
int $n = size(ls("-fl",(polyListComponentConversion("-fe","-tf",$edge))));
return (!($n - 1));
} This handy one is from Nathan Roberts!
You give it an edge and it returns 1 if its a border one.

And you need to do the bevel in a loop? I'm quite sure the command would work on the whole ring, wouldn't it? So you could do

{
if (size($egdeSelection))
{
....
}
}

CGTalk Moderation
10-22-2008, 11:44 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.