I have this in mel but I need this in python 

ConvertSelectionToEdges;
PolySelectConvert 2;
PolySelectConstraint -m 2;
PolySelectConstraint -r true;
PolySelectConstraint -rr 0.20;
polySelectSp -loop;

in this polySelectSp -loop; is not selecting edge loop properly it skips 
few edge loops and stuck in the middle

can anyone help me to convert this in python or can I have same kind of 
script where I can select random edge loops

On Monday, June 1, 2020 at 5:46:45 PM UTC+5:30, Vishal Kadam wrote:
>
> thanks but it selects only one random edge
>
> On Monday, June 1, 2020 at 1:26:41 PM UTC+5:30, MichaelEden wrote:
>>
>> # import random module, documentation is here:
>> # https://docs.python.org/3/library/random.html
>> import random
>>
>> # select the object
>> selection = cmds.ls(sl=True)[0]
>> # calculate how many edges this object have
>> maxRandomValue = cmds.polyEvaluate(edge=True)
>>
>> # select the random edges of the object selected
>> cmds.select("{}.e[{}]".format(selection, 
>> random.randint(0,maxRandomValue)))
>>
>> # print
>> print "{} is selected".format(cmds.ls(sl=True)[0])
>>
>>
>> hopefully it helps. cheers. 
>>
>>
>> On Monday, June 1, 2020 at 4:38:03 PM UTC+9, Vishal Kadam wrote:
>>>
>>> Hello,
>>>
>>> can anyone help me, I want to select random edges using python script, 
>>> as we do that from polygon selection constraint on edges then adjusting the 
>>> count using ratio value
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/c92ca232-faf5-4011-b9cd-606a49e4524b%40googlegroups.com.

Reply via email to