Hi guys, I have made a script that is supposed to find the difference between the position of every vertex in a first mesh and a second mesh.
The goal is to automatically select for morpher the vertex that require vertex color to white and with a Ctrl+i the black vertex color.
Currently the script work with simple mesh like cube, but when I try with more complex mesh, it didn't work.
maybe it's because array are limited ?
Thx for your help.
- sM1 = #()
- sM2 = #()
- cV1 = #()
- cV2 = #()
- aDV = #()
- pCb1 = #()
- pCb2 = #()
- sPO1 = #()
- sPO2 = #()
- aDV as array
- rollout pick_box_test "Pick Meshes"
- (
- pickbutton chooseit1 "Pick Mesh 1" width:140
- on chooseit1 picked obj do
- if obj != undefined do
- (
- sPO1 = obj.pos
- obj.pos = [0,0,0]
- chooseit1.text = obj.name
- sM1 = obj
- pCb1 = true
-
- )
- pickbutton chooseit2 "Pick Mesh 2" width:140
- on chooseit2 picked obj do
- if obj != undefined do
- (
- sPO2 = obj.pos
- obj.pos = [0,0,0]
- chooseit2.text = obj.name
- sM2 = obj
- pCb2 = true
- if pCb1 and pCB2 do
- if sM1.verts.count == sM1.verts.count do
- for i=1 to sM1.verts.count do
- (
- sM1.selectedVerts = #{i}
- cV1 = sM1.verts[i].pos
- cV2 = sM2.verts[i].pos
- if cV1 != cV2 do appendIfUnique aDV i
- )
- sM1.pos = sPO1
- sM2.pos = sPO2
- sM1.selectedVerts = aDV
- )
- )
- createDialog pick_box_test
Replies
And read this: Comparing float values, by Swordslayer.
And make all variables from the first 11 rows local.