[Closed] Problems with meshOp.DetachFace
Hey Andreas, still working at this time eh?
I haven’t tested this yet but I think this may work.
Assuming the pivot point is the centerpoint of all the vertices; the average of all positions:
obj = FW_MotherObject
x_array = 0
y_array = 0
z_array = 0
counter = 0
faces = getFaceSelection obj as array
for face in faces do
(
verts = meshOp.getVertUsingFace obj face
for vert in verts do
(
x = (getVert obj vert).x
y = (getVert obj vert).y
z = (getVert obj vert).z
x_array += x
y_array += y
z_array += z
counter += 1
)
)
pivot_point3 =
#((x_array / counter),(y_array / counter),(z_array / counter))
[font=Verdana]
What this does is it loops through all the faces, collects the vert integers, loops those integers to collect point3 data. In the end it’ll average out the data so that you should have your pivot point point3 position.
Hope this helps, good luck!
- Rens
[/font]
Thanks for the help Rens, i will look at it.
Yea I made a misstake when I created the new object to rebuild the detached mesh into. I forgot to use the same pos as the old object, so it got slightly offset. And I thought that the detach always did this.
/Andreas