Re: [Maya-Python] Re: Listing textures from selected objects

2011-03-20 Thread Alexander Mirgorodsky
Hi Martin! I think is what I understood You. Below I give snipets from my render-toolkit code. It only extracts because this toolkit complikated and renderman-aimed. But I hope it will come across you on the right ideas. So if we really want geting info from selected obj then: 1. Getting list

[Maya-Python] Re: Listing textures from selected objects

2011-03-20 Thread PyInUrEye
This is cool. Thanks for sharing. I have a tool that does it in mel and I've been meaning to convert it to python for a while now. I shall try this soon and post anything worth while. Nice work. On Mar 20, 6:06 am, Alexander Mirgorodsky amir...@gmail.com wrote: Hi Martin! I think is what I

[Maya-Python] random selection algorithm help?

2011-03-20 Thread Ling
Hey guys: Need some algorithm help if possible.. Say I have 1000 points in a sorted list, and I want to select a given portion of the points in the list, for example, 70% of it. Don't need to be perfectly accurate, but the 70% have to be pretty much evenly distributed among the 1000 points.

[Maya-Python] Re: random selection algorithm help?

2011-03-20 Thread Michiel Duvekot
cmds.polySelectConstraint(mode=3, type=0x0001, random=True, randomratio=0.7) On Mar 20, 4:51 pm, Ling howandw...@gmail.com wrote: Hey guys:   Need some algorithm help if possible..   Say I have 1000 points in a sorted list, and I want to select a given portion of the points in the list,

Re: [Maya-Python] random selection algorithm help?

2011-03-20 Thread Viktoras
if you're going for probability based percentage, then just do that: import random def randomPercentage(data,percentage): for i in data: if random.random()percentage: yield i print list(randomPercentage(selectedList,0.7)) also, another very short answer would be

Re: [Maya-Python] random selection algorithm help?

2011-03-20 Thread Ofer Koren
Use random.sample: from random import sample items = range(100) sample(items, 3) [5, 61, 70] sample(items, 3) [49, 73, 69] sample(items, 3) [64, 77, 30] sample(items, 3) [3, 54, 59] sample(items, 3) [55, 36, 31] - Ofer www.mrbroken.com On Mon, Mar 21, 2011 at 1:41 AM, Viktoras

[Maya-Python] Re: Adding up child rotations

2011-03-20 Thread t
OK! Due to further research, it seems that matching rotations of different rotation orders is a mathmatical imposibility; http://en.wikipedia.org/wiki/Rotation_(mathematics) So, the question now is; What would be the scripted plugin code to do 'relative' additive rotations on one transform from