10 October 2006, 09:08 PM
Would this be possible?
select the object so its in the modify panel
look for and disable 'skin' modifier
root=the base object underneath all the mods
root.AffectPivotPointOnly=true -- here's the kicker - does this exist? Anybody know?
reset the root.pivot point - I'm not sure how thats done, I'd like to see an example...
reactivate the 'skin' mod
repeat and rinse
10 October 2006, 04:57 PM
Ok, it seems my transform reset code was not an issue at all, but more my lack of understanding how Skin works.
As previously stated, my animators want to be able to take a selection of an existing heirarchy, and for each object in the selection, unlink it from both its parents and children, copy the skin modifier, reset the transforms, re-apply the skin, and the relink it into its original heirarchy. However, when I do all of these steps, my skin weights are not correct.
Here's a walk through of what the script does:
-Walk the selection, collecting all the objects that have skin on them, and then recording the bones associated with that skin modifier.
-Using Skin Utilites, I extract the skin data. This creates a "SkinData" copy of the original.
-I then delete the skin modifier from the stack.
-I then walk the selection again, testing each object for parent's and children. I record both and de-link the object.
-the transform on the object is reset using resetXform()
-the stack is collapsed
-using the previously collected data, I re-link the object and all its children properly.
-I walk the list of object that had Skin on them
-and reset the xforms on the SkinData copies of the object
-and collapse the stack of the SKinData copies.
-a new skin modifier is added to the original object
-the list of bones are added to the modifier
-the original and its SkinData are selected and SkinUtils.ImportSkinDataNoDialog is executed to replace the skin data onto the now resetXformed object.
However, after all this, the re-applied skin data is wrong. :/
Am I missing something obvious? Thanks in advace.
11 November 2006, 08:32 PM
I'm not a programmer, but I think you should look into saving skin weights/envelope (Advanced Parameters / Save) , delete the skin modifier, adding a new skin modifier after all your code business is done and then importing your skin weights/envelope again. Then you'll get a fresh start for the skin modifier. I assume your bones are in T-pose matching up with the mesh? This would help alot if you want a new skin modifier to work. ;)
You might also want to look at the 'Always Deform' check box under 'Advanced Parameters' in the skin modifier. This resets your weights to preferred 'Ref. Frame' ... Just mentioning it.
11 November 2006, 08:32 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.