end life
Unten fehlt offenbar eine schließende Klammer.Quote:
When i try running the script in 3ds max, i'm getting a comile error:
[Only registered and activated users can see links. Click Here To Register...]
Need to load a mesh + bones first and add the name in the script?
thx
(
GetVertexWeightCount = skinOps.GetVertexWeightCount
GetVertexWeight = skinOps.GetVertexWeight
GetVertexWeightBoneID = skinOps.GetVertexWeightBoneID
GetBoneName = skinOps.GetBoneName
--FUNCTION
fn saveSkin obj =
(
objskin = obj.skin
modPanel.setCurrentObject objskin
createms = "" as stringstream
numVerts = getNumVerts obj.mesh
format "*SKIN_VERTEX_DATA % {\n" numVerts to:createms
for v = 1 to numVerts do
(
--GET THE WEIGHTS
weights = #()
_bones = #()
for b = 1 to GetVertexWeightCount objskin v do
(
append weights (weight = GetVertexWeight objskin v b)
append _bones (_bone = (GetBoneName objskin (GetVertexWeightBoneID objskin v b) 1))
)
--PRINT THE WEIGHTS
numBones = _bones.count
format "\t*VERTEX % % {\n" (v-1) numBones to:createms
for n = 1 to numBones do
(
format "\t\t*BONE \t\"%\" \t%\n" _bones[n] weights[n] to:createms
)
format "\t}\n" to:createms
)
format "}\n" numVerts to:createms
--SAVE
skinFile = createFile ("C:\\" + obj.name + ".txt")
format "%" (createms as string) to:skinFile
close skinFile
)
for obj in selection do
(
if isProperty obj #skin do saveSkin obj
)