This is not an answer to the question, but I thought I'd post a
relevant discovery we made here, with the hope that it might help
someone else out if they run into a similar issue. We found
cmds.parent to be horribly inefficient when doing a large batch of
re-parenting. We have a system that uses callbacks to monitor our
shape library, and in this system we clean up a scene every time it is
loaded. This means we're doing a fair amount of re-parenting, though
for the slowdown that we encountered, the slowdown seemed
disproportionately large: we did tests that topped out at around 400
shapes being parented. this resulted in execution times approaching
some number of minutes. We switched over to api calls and there was a
precipitous drop in execution times: 5-10 seconds tops. It does make
some sense, and I don't think this means you have to use the api to do
all parenting, but in certain situations it may help.

Also of note: we have run into some performance issues using cmds.file
to open files. The mel call works fine, and so does the api, so we use
the api call to open files now.

We are currently running Maya2009 32 bit PC.

-Judah

On Thu, Apr 22, 2010 at 11:26 AM, shawnpatapoff <[email protected]> wrote:
> Is there anyway around Maya selecting the object that you're parenting
> when using setParent? Ideally I would like to do this:
>
> a = ls(createNode('transform', ss=True))
> b = ls(createNode('transform', ss=True))
>
> b[0].setParent(a)
>
> without 'b' being reselected.
> I can of course clear the selection if I need to. Would be nice if
> there was a hook in setParent(ss=True)
>
> Cheers,
> Shawn
>
> --
> http://groups.google.com/group/python_inside_maya

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to