<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help weight transfer script in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12637321#M1440</link>
    <description>&lt;P&gt;Edit. Solved.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Sep 2024 16:21:35 GMT</pubDate>
    <dc:creator>davinwest72</dc:creator>
    <dc:date>2024-09-02T16:21:35Z</dc:date>
    <item>
      <title>Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12628615#M1428</link>
      <description>&lt;P&gt;Edit. Solved.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 16:17:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12628615#M1428</guid>
      <dc:creator>davinwest72</dc:creator>
      <dc:date>2024-09-02T16:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634148#M1429</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15173228"&gt;@davinwest72&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Version gmax, which is exactly like 3dsmax4.2 ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Are you a time traveler? An ancient artifact hunter?&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":astonished_face:"&gt;😲&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Discreet 3dsmax 4&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Magma&lt;/TD&gt;&lt;TD&gt;2000&lt;/TD&gt;&lt;TD&gt;&lt;A title="Windows 98" href="https://en.wikipedia.org/wiki/Windows_98" target="_blank" rel="noopener"&gt;Windows 98&lt;/A&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A title="Windows ME" href="https://en.wikipedia.org/wiki/Windows_ME" target="_blank" rel="noopener"&gt;Windows ME&lt;/A&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A title="Windows 2000" href="https://en.wikipedia.org/wiki/Windows_2000" target="_blank" rel="noopener"&gt;Windows 2000&lt;/A&gt;&lt;A href="https://en.wikipedia.org/wiki/Autodesk_3ds_Max#cite_note-6" target="_blank" rel="noopener"&gt;[6]&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or maybe 3D Studio?&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="denisTMaxDoctor_1-1710226858976.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1335987iEA325409193C8048/image-size/medium?v=v2&amp;amp;px=400" role="button" title="denisTMaxDoctor_1-1710226858976.png" alt="denisTMaxDoctor_1-1710226858976.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well...&amp;nbsp;Do you want to make it good or easy? Good skin wrapping is a pretty complicated algorithm. What kind of meshes do you want to wrap?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 07:06:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634148#M1429</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-03-12T07:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634317#M1430</link>
      <description>&lt;P&gt;Edit. Solved.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 16:24:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634317#M1430</guid>
      <dc:creator>davinwest72</dc:creator>
      <dc:date>2024-09-02T16:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634361#M1431</link>
      <description>&lt;P&gt;Is there no way to convert the data to a more recent version of MAX and, using something like OBJ, import it back in after skin wrapping?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 08:58:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634361#M1431</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-03-12T08:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634371#M1432</link>
      <description>&lt;P&gt;I'm also concerned about the MAXScript version... at the beginning of the 2000s it was pretty far from up to date, skinning support was very limited, and I'm not sure if skinops have been introduced yet.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 09:03:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634371#M1432</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-03-12T09:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634379#M1433</link>
      <description>&lt;P&gt;Skin wrapping based on the distance between vertices is very coarse. A much better result is given by a "face-based" algorithm. Both requires a lot of time and memory for large meshes, and something like a Kd-tree search engine is needed to speed it up... This is quite a heavy task for older versions assuming MAXScript implementation.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 09:11:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634379#M1433</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-03-12T09:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634384#M1434</link>
      <description>&lt;P&gt;Edit. Solved.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 16:25:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634384#M1434</guid>
      <dc:creator>davinwest72</dc:creator>
      <dc:date>2024-09-02T16:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634409#M1435</link>
      <description>&lt;P&gt;I've been writing scripts for MAX for 25 years now... I'm not saying that what you're trying to do is completely impossible, but I see good reasons to look for alternative solutions.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 09:29:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634409#M1435</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-03-12T09:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634427#M1436</link>
      <description>&lt;P&gt;Edit. Solved.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 16:20:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634427#M1436</guid>
      <dc:creator>davinwest72</dc:creator>
      <dc:date>2024-09-02T16:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634454#M1437</link>
      <description>&lt;PRE&gt;local boneIndices = for k = 1 to k - 1 where boneWeights[k] &amp;gt; 0 collect k&lt;/PRE&gt;&lt;P&gt;this is wrong for sure...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the typical number of vertices in the source and target meshes?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 09:49:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12634454#M1437</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-03-12T09:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12636857#M1438</link>
      <description>&lt;P&gt;Edit. Solved.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 16:21:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12636857#M1438</guid>
      <dc:creator>davinwest72</dc:creator>
      <dc:date>2024-09-02T16:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12637269#M1439</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15173228"&gt;@davinwest72&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I will reconfigure the line. The source mesh typically has about 400 verts. Target mesh will match or sometimes double that amount.&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;These are small meshes. You can do it the way you do it. There's no need for any clever "acceleration".&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 09:29:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12637269#M1439</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-03-13T09:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12637321#M1440</link>
      <description>&lt;P&gt;Edit. Solved.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 16:21:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12637321#M1440</guid>
      <dc:creator>davinwest72</dc:creator>
      <dc:date>2024-09-02T16:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12638848#M1441</link>
      <description>&lt;P&gt;I understand that you're interested in learning how to write scripts. Unfortunately, I don't have the time to explain everything in detail, but I can show you two basic functions that I used in one of my tools. If you take the time to understand them, you'll be able to advance your learning on your own.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's worth mentioning that your current code isn't too far off from working properly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, are you ready to learn these functions?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 20:12:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12638848#M1441</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-03-13T20:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12638994#M1442</link>
      <description>&lt;P&gt;Edit. Solved.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 16:22:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12638994#M1442</guid>
      <dc:creator>davinwest72</dc:creator>
      <dc:date>2024-09-02T16:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12639622#M1443</link>
      <description>&lt;LI-CODE lang="general"&gt;fn copySkinData node = 
(
	sk = node.modifiers[skin]
	if iskindof sk Skin do
	(
		max modify mode
		modpanel.setcurrentobject sk
		num = skinops.getnumberbones sk
		bones = for k=1 to num collect 
		(
			skinops.getbonename sk k 0
		)
		weights = for k=1 to skinops.getnumbervertices sk collect
		(
			num = skinops.getvertexweightcount sk k 
			
			_bones = #()
			_names = #()
			_weights = #()
			
			for i=1 to num do
			(
				id = skinops.getvertexweightboneid sk k i
				name = skinops.getbonename sk id 0
				weight = skinops.getvertexweight sk k i
				
				append _bones id 
				append _names name
				append _weights weight 
			)
			
			#(k, _bones, _names, _weights)
		)
		
		#(bones, weights)
	)
)

fn pasteSkinData node data = 
(
	sk = node.modifiers[skin]
	if iskindof sk Skin do
	(
		max modify mode
		modpanel.setcurrentobject sk
		
		bones = data[1]
		num = bones.count
		for k=1 to num do
		(
			if isvalidnode (bone = getnodebyname bones[k]) do 
			(
				skinops.addbone sk bone 1
			)
		)
		skinOps.Invalidate sk 1
		
		weights = data[2]
		num = weights.count
		for k=1 to num do
		(
			_d = weights[k]
			
			_bones = for b in _d[3] collect (finditem bones b)
			skinops.replacevertexweights sk k _bones _d[4]    
		)
		#(skinops.getnumberbones sk, skinops.getnumbervertices sk)
	)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you create a map for the source and target vertices, these two functions will suffice for the skin transfer.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 06:12:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12639622#M1443</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-03-14T06:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12640007#M1444</link>
      <description>&lt;PRE&gt;Edit. Solved.&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Sep 2024 16:22:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12640007#M1444</guid>
      <dc:creator>davinwest72</dc:creator>
      <dc:date>2024-09-02T16:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12640116#M1445</link>
      <description>&lt;LI-CODE lang="general"&gt;fn mapNearestVerts source target = 
(
	fn findNearest p verts = 
	(
		dist = distance p verts[1]
		n = 1
		for k=2 to verts.count where (d = distance p verts[k]) &amp;lt; dist do
		(
			dist = d
			n = k
		)
		n
	)
	
	source_mesh = snapshotasmesh source
	target_mesh = snapshotasmesh target
	
	source_map = #()
	numv = source_map.count = source_mesh.numverts
	
	target_verts = for v=1 to target_mesh.numverts collect (getvert target_mesh v)
	
	for v=1 to numv do source_map[v] = findNearest (getvert source_mesh v) target_verts 
	source_map
)


delete objects

s = geoSphere name:#source radius:25 segs:12 wirecolor:green
t = sphere name:#target radius:25 segs:32 wirecolor:orange


source_map = 
(
	format "source:% target:%\n" (s.mesh.numverts) (t.mesh.numverts)

	t0 = timestamp()
	h0 = heapfree
	
	mm = mapNearestVerts s t

	format "\ttime:% heap:% count:%\n" (timestamp() - t0) (h0 - heapfree) source_map.count
	
	mm
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 14 Mar 2024 10:25:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12640116#M1445</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-03-14T10:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12640129#M1446</link>
      <description>&lt;P&gt;This example shows that we are good with source and target meshes of size ~1.5K and ~0.5K vertices.&lt;/P&gt;&lt;P&gt;You can play around with the number of segments to see how it affects performance&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 10:31:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12640129#M1446</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-03-14T10:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help weight transfer script</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12640138#M1447</link>
      <description>&lt;P&gt;If we copy from high-res to low-res, no problem here.... but mostly we need to copy from low-res to high-res. In this case, there is a problem because we can't do it well without averaging several near vertices.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 10:37:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/help-weight-transfer-script/m-p/12640138#M1447</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-03-14T10:37:57Z</dc:date>
    </item>
  </channel>
</rss>

