ScriptSpot home

Copy/Paste Skin Modifier via Max Script

Downloads

  • Version 1Listed version

    Listing updated

3ds Max compatibility
Unknown
Community compatibilityNo compatibility reports yet

No reports yet for the available releases.

Community reviewsNo reviews yet.

Listing details

Version
1
Author’s update date
Listing created
How compatibility works

Compatibility comes from the author’s supported range or requirements in the original listing. A tested version records what the author tried.

“2020 unconfirmed” in the catalog means support for 3ds Max 2020 is still unknown.

Community reports record successful tests on specific releases.

Posted by

lutteral

Credited author: Martin Lutteral

More by this author

Description

I recently discovered that copying a skin modifier via maxscript (using addmodifier) doesn't set the weights correctly, so I wrote a function to transfer the weights from one mesh to another. (they need to have the same topology though)
Some other scripts out there won't work because at some point autodesk decided to change the way that the skin's bone table is indexed, and they would need a lookup table with the bone names to convert the old index to the new one. *sight It seems I fixed it.

The script defines a data structure used to gather the weight table of the source object, and a function. I didn't create any interface but you could easily create one to wrap it around.

the usage of the function is pretty simple:

xCopySkin [node source] [node target]

node source: the source object, must have a skin modifier applied (or you'll get an error)
node target: the target object, if the topology is not the same you'll get unexpected results

Enjoy!

Comments (2)
SuperTrampy

Having difficulties... Help!?

Hi lutteral, thanks for writing this script was about to give up on this one! I'm having a couple of issues with it though.

GetBoneNamebyListID

was depreciated for max 2015 by the looks of things so I've had to replace:

boneName = skinOps.GetBoneNamebyListID theSkin boneID 0

With:

boneName = skinOps.GetBoneIDByListID theSkin boneID

but now I'm getting this error:

-- Runtime error: Bone ID out of range: 0

Any thoughts? Thanks in advance!

Reply to SuperTrampy
Milan Saffek

replace boneName = skinOps.GetBoneNamebyListID theSkin boneID 0 with: boneName = skinOps.GetBoneName theSkin boneID 0 and it will start to work.. (tested in Max 2016) cheers, Milan Saffek