Re: [Maya-Python] Get selection by selection order?

2010-01-21 Thread Paul Molodowitch
Unfortunately, maya does not save selection order information for components... which means if you want to know selection order, you'll have to install a callback which gets triggered on selection change, and keep track of it yourself. Kind of a pain, but it's the only way to do it I know of... -

Re: [Maya-Python] Re: PyMEL 1.0.0 Beta

2010-01-21 Thread Ian Jones
Sure can On Thu, Jan 21, 2010 at 6:21 PM, Chad Dombrova wrote: > ian, can you provide some instructions on how to set this up that we can > include in the docs? > > On Thu, Jan 21, 2010 at 4:51 PM, Ian Jones wrote: >> >> Drew, >> >> What I've been doing is using sitecustomize to inject pymel to

Re: [Maya-Python] Re: PyMEL 1.0.0 Beta

2010-01-21 Thread Chad Dombrova
ian, can you provide some instructions on how to set this up that we can include in the docs? On Thu, Jan 21, 2010 at 4:51 PM, Ian Jones wrote: > Drew, > > What I've been doing is using sitecustomize to inject pymel to the > front of the python path at startup. The `downside` is that pymel > sh

[Maya-Python] Re: Maya UI - I'm sure it's easy once one knows how.

2010-01-21 Thread AK Eric
Hey, nice! Mystery solved ;) On Jan 21, 3:04 pm, damon shelton wrote: > sorry, y = i not y == i > > On Thu, Jan 21, 2010 at 3:02 PM, damon shelton wrote: > > > Eric, > > here is how you can handle the looping lambda issue > > set one of your lamdas (eg. y in this case to equal the argument) > >

Re: [Maya-Python] Re: getBoundingBox() bug?

2010-01-21 Thread Subbu.Add
Thanks for sharing your views after testing or resolving the problem. Subbu -- http://groups.google.com/group/python_inside_maya

Re: [Maya-Python] Re: PyMEL 1.0.0 Beta

2010-01-21 Thread Ian Jones
Drew, What I've been doing is using sitecustomize to inject pymel to the front of the python path at startup. The `downside` is that pymel shows up in the python path universally but some of the utils that are included I've been learning/finding great use for in other places. The Path class in par

Re: [Maya-Python] Re: Maya UI - I'm sure it's easy once one knows how.

2010-01-21 Thread damon shelton
sorry, y = i not y == i On Thu, Jan 21, 2010 at 3:02 PM, damon shelton wrote: > Eric, > here is how you can handle the looping lambda issue > set one of your lamdas (eg. y in this case to equal the argument) > > > import maya.cmds as cmds > > class lambdaLoop(): > def __init__(self, values =

Re: [Maya-Python] Re: Maya UI - I'm sure it's easy once one knows how.

2010-01-21 Thread damon shelton
Eric, here is how you can handle the looping lambda issue set one of your lamdas (eg. y in this case to equal the argument) import maya.cmds as cmds class lambdaLoop(): def __init__(self, values = ['a', 'b', 'c']): self.window = 'lambdaLoop_win' self.vals = values def Win

[Maya-Python] Re: Maya UI - I'm sure it's easy once one knows how.

2010-01-21 Thread AK Eric
Yeh, you know, lambdas work often, but not always. I've found that if I have a procedurally generated UI... say, looping to make a lot of buttons, and each should have some unique argument passed into the executed command, lambda will assign the same args to every button (bad), but functools.parti

[Maya-Python] Re: Maya UI - I'm sure it's easy once one knows how.

2010-01-21 Thread ryant
I guess you can use a lambda also which I didnt know Eric. I gave you a seventh solution to put on your site. Ryan Character TD www.rtrowbridge.com/blog NaughtyDog Inc. On Jan 21, 1:25 pm, ryant wrote: > I have not seen it posted so I thought I would mention there are other > options for passing

[Maya-Python] Re: Maya UI - I'm sure it's easy once one knows how.

2010-01-21 Thread ryant
I have not seen it posted so I thought I would mention there are other options for passing callable functions as well. You can use a partial function to create a callable function to a command. Example: from functools import partial def myfunc(does, some=1, stuff='test'): print does

[Maya-Python] Re: PyMEL 1.0.0 Beta

2010-01-21 Thread Drew
Hi Chad, Thanks to you and Jason for helping me out here. Do you know if .pth files can have env variables in them? Our pymel install location will vary from project to project (all project data is lumped under a project specific directory), so if i do hack the maya install it would be great if

[Maya-Python] Get selection by selection order?

2010-01-21 Thread Sune
What's an easy and reliable way to gather a list of selected verts, ordered by selection order? I had a look at the scriptCtx, but this seems more complex than it need to be :-) Also the verts are already selected, before my tools is run. Cheers, Sune P.s. I use PyMel -- http://groups.google.co

[Maya-Python] Re: getBoundingBox() bug?

2010-01-21 Thread pjrich
Resolved - I was setting visibility keyframes, and in some circumstances they were being set before the bb check, and I was using boundingBox instead of boundingBoxInvisible. I didn't know what a bb of an invisible object looked like, but after two days of watching them scroll by I'll never forget

[Maya-Python] Re: Maya UI - I'm sure it's easy once one knows how.

2010-01-21 Thread AK Eric
Just to add a bit more: The below block of code is one I just stick on my shelf, and drag it down to the script editor any time I want to start a new window. Like Seth, I just modified it to add a button to close the window as well. The finicky bit are button commands, or any command executed fr

[Maya-Python] Re: getBoundingBox() bug?

2010-01-21 Thread pjrich
I spoke too soon, it does it with xform as well. I'm trying to narrow down the cases where it happens, if I learn anything more I'll post it. P On Jan 21, 10:42 am, pjrich wrote: > Yep, a plain xform doesn't have the same trouble. At the moment I'm > doing a lot of sub-optimal repeated querys, s

Re: [Maya-Python] Class or not?

2010-01-21 Thread David Moulder
Anyone use "*class factories*" or the new "*metaclass*" paradigm? I'm doing something in python, pretty core data stuff and I think I've coded something that would have been easier if I'd known about the concept of class factories instead of using sub classing. Is it something you do often as pyt

[Maya-Python] Re: getBoundingBox() bug?

2010-01-21 Thread pjrich
Yep, a plain xform doesn't have the same trouble. At the moment I'm doing a lot of sub-optimal repeated querys, so it's probably an unlikely use case, but it's working. I probably just overheated the wrapper. Thanks! P On Jan 20, 11:30 pm, Chad Dombrova wrote: > i just double-checked the pymel c

Re: [Maya-Python] How do I enable the mental ray globals?

2010-01-21 Thread Sylvain Berger
There is a command to force the creation of all the mental ray nodes in the scene. Something like miCreateDefaultNodes, I don`t have Maya on this computer, but if you enable all the command logging in the script editor and open the mental ray settings in a new scene you should see these command ou

[Maya-Python] How do I enable the mental ray globals?

2010-01-21 Thread Geoff Hecht
Hey all, I'm making a script which relies heavily on mental ray. I'm using pymel (which helps a lot with mental ray commands), but I hit a problem when I try to customize any of the render quality settings. For example: if pluginInfo("Mayatomr", query=True, loaded=True) != 1 : loadPlugi