Notifications
Clear all

[Closed] Copy weight table

So here you can see how original character model from the game look like:

So what? I can draw as many such pictures as I like. And even more weirder! I see here that you use Editable Mesh geometry for skinning. Must I believe in it too?

It’s a joke… relax. But when I ask about any proving I mean you have to show me the documentation where it’s required. What you show me is a someone’s bad job. You don’t have to copy it if it’s not required. I’m in this businesses for many years, and I can’t believe in such weird requirement as linking the skeleton root to its ‘logical’ dependent.

ok… but I promised. So:

  1. select the skin mesh
  2. go to the modifier panel
  3. right mouse click on Skin modifier and Cut it
  4. link skeleton root to the mesh
  5. go back to the modifier panel and paste with RC menu the skin modifier back.

good luck…

if you want to do it via MXS it can be something like this:

	fn storeSkinWeights node = 
	(
		sk = node.modifiers[skin]
		if iskindof sk Skin do
		(
			max modify mode
			modpanel.setcurrentobject sk
			num = skinops.getnumberbones sk
			weights = for k=1 to skinops.getnumbervertices sk collect
			(
				num = skinops.getvertexweightcount sk k 
				
				bb = #()
				ww = #()
				
				for i=1 to num do
				(
					b = skinops.getvertexweightboneid sk k i
					w = skinops.getvertexweight sk k i
					
					append bb b 
					append ww w 
				)			
				#(bb, ww)
			)
		)
	)

	fn restoreSkinWeights node weights = 
	(
		sk = node.modifiers[skin]
		if iskindof sk Skin do
		(
			max modify mode
			modpanel.setcurrentobject sk
			
			num = weights.count
			for k=1 to num do
			(
				bb = weights[k][1]
				ww = weights[k][2]
				
				skinops.replacevertexweights sk k bb ww    
			)
			#(num, skinops.getnumbervertices sk)
		)
	)

	fn reparentSkinRoot node root = 
	(
		local weights = storeSkinWeights node
		local sk = node.modifiers[skin]
		deletemodifier node sk
		root.parent = node
		addmodifier node sk
		restoreSkinWeights node weights
	)

/* using :
 	reparentSkinRoot <skin_mesh_geometry> <skeleton_root>
*/

You are a man of a word, something I really respect. To be honest, this is more or less exactly what I was doing, exept I use copy and then delete instead of cut. I was triing to reproduce exactly this solution in maxscript, but looks like it´s not posible. I tried to reproduce the steps by using that recorder, but nothing usefull was produced by recorder. Specially the lines recorder produced for the paste comand are a bit strange. Really greatfull for your solution.

unfortunately the modpanel Cut/Copy/Paste/PasteInstance methods are not exposed to MXS

Page 3 / 3