CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
Thread Tools Search this Thread Display Modes
Old 03-20-2013, 03:40 PM   #1
New Member
Join Date: Mar 2013
Posts: 2

I was wondering if someone could code me a maxscript or point me in the correct direction. I want to save vertices on bones in a txt file in this format:

*SKIN_VERTEX_DATA 850 { *VERTEX 0 1 { *BONE "Bone03" 1.0000000 } *VERTEX 1 2 { *BONE "Bone03" 1.0000000 *BONE "Bone02" 0.0000000 }

It would be greatly appreciated.

Last edited by ayrphixa : 09-16-2013 at 11:05 PM.
Old 03-24-2013, 02:45 PM   #2
martinez's Avatar
Juan Martinez
Verse, Inc
Dallas, USA
Join Date: Feb 2002
Posts: 207
Send a message via ICQ to martinez Send a message via AIM to martinez
I had a script that did almost exactly this, I edited a little to give that output. You may need to edit it some more since you format was a little ambiguous.

( --BOOKMARK SOME FUNCTIONS GetVertexWeightCount = skinOps.GetVertexWeightCount GetVertexWeight = skinOps.GetVertexWeight GetVertexWeightBoneID = skinOps.GetVertexWeightBoneID GetBoneName = skinOps.GetBoneName --FUNCTION TO EXPORT SKIN WEIGHTS fn saveSkin obj = ( --SELECT THIS OBJECT objskin = modPanel.setCurrentObject objskin --START A STREAM createms = "" as stringstream --GET NUMBER OF VERTS numVerts = getNumVerts obj.mesh format "*SKIN_VERTEX_DATA % {\n" numVerts to:createms --LOOP THROUGH VERTS 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 --CREATE A FILE ON DISK AND SAVE IT skinFile = createFile ("$temp\\" + + ".txt") format "%" (createms as string) to:skinFile close skinFile ) for obj in selection do ( if isProperty obj #skin do saveSkin obj ) )
Juan Martinez | Blog | Animator
Old 03-24-2013, 05:43 PM   #3
New Member
Join Date: Mar 2013
Posts: 2
I must thank you deeply, for it is perfect.
Old 03-24-2013, 05:43 PM   #4
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,479
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 03:28 AM.

Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.