When I make the following changes, it works for me:

import pymel.core as pm

selected = pm.ls (selection = True)if len(selected) == 1:
    pm.warning('Must select 2 or more objects...');elif len(selected) >= 2:
    selected.reverse()
    sel_end = selected[0]
    sel_child = selected[1:]
    pm.parent(sel_child, sel_end, a=True) # <-- absolute
    for allObjects in sel_child:
        pm.makeIdentity(allObjects, a = True, t = True, r = True, s = True)
        findShape = pm.listRelatives(allObjects, s = True, ad = True)
        pm.select(d = True)
        pm.parent(findShape, sel_end, a = True, s = True) # <-- absolute
        pm.delete(allObjects)
        pm.select()

​

Justin

On Wed, Sep 28, 2016 at 4:49 PM vilkdage <[email protected]> wrote:

> Sure.
> If you were to run a script on objects with surface you will notice that
> they do not move from where they were. Their shapes has been parented and
> now they move as one object while staying in different positions in the
> world.
>
> On the other hand, curves children jumps into place where their parent is.
> That is a problem as I want them not to move from their original position.
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/7b4156e7-d17d-40b6-83fc-946807232c8b%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1c7TPWg0uY5dJpOR%2BP_hmvxBm6VUVmrRnpYLWu1zkk5Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to