it still offsets, but what I found that works is if i run this script
first:
import pymel.core as pm
selected = pm.ls(sl=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:]
locator = pm.spaceLocator()
constraint = pm.parentConstraint(sel_end, locator)
pm.delete(constraint)
piv = pm.xform (locator, piv=True, q=True, ws=True)
pm.parent(sel_child, sel_end)
for allObjects in sel_child:
pm.xform(allObjects, ws=True, piv=(piv[0], piv[1], piv[2]))
pm.makeIdentity(allObjects, a = True, t = True, r = True, s = True)
pm.delete(locator)
pm.select(selected)
and without deselecting anything I run this part:
for allObjects in sel_child:
findShape = pm.listRelatives(allObjects, s = True, ad = True)
pm.select(d = True)
pm.parent(findShape, sel_end, r = True, s = True)
pm.delete(allObjects)
pm.select()
I have no idea why I can't combine these two parts, but it works and curves
maintain offset.
--
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/737d661c-c6d6-40c5-8ca2-38a6f9193769%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.