[Closed] thePainterInterface problem
Hi,
I have a problem with thePainterInterface interface,
I want to create a UV poly rotation on UVWUnwrap modificator with paint interface by clicking the face and dragging to rotate it. (We need this to rotate the hair handles)
The problem is that all meshes are editable poly and the thePainterInterface.getCustomHitFaceData returns the faceIndex from editableMesh (Triangle index) and can’t use that data for UVWUnwrap or at least editablePoly
is there any possibility to convert the triMesh index to polygon index? or to tell thePainterInterface to return polyFace index?
to divide the index by 2 its not a solution as mesh can contain faces with one triangle or more than 2
Thanks
convert mesh face to mesh verts, mesh verts to poly (or unwrap_uvw face)
did that, but I need to shrink the selection because its selecting the neighbor faces too
and one more problem with shrinking will be that having an triangle ID on the face with 3+ triangles and converting in faces by triangle -> vertex -> face will not get all the nearest faces of the face so I can detect the central face,
needs a different approach
that’s right. just shrink the selection…
there is meshop.getpolysusingface method… use it to get all poly’s verts.
getPolyUsingFace doesn’t work or at least needs fine tuning of angle threshold that can be incorrect in some cases after vertex manipulation,
also about shrinking I wrote the problem with it, as it doesn’t select all the nearest faces (described in previous post)
and even if I’ll get all the nearest faces (don’t know how) I didn’t see a function for selection shrinking in UVW_Unwrap modifier, maybe just by checking the face with all the edges sharing with the other faces… but again this method could work only when all the nearest faces are selected which wouldn’t be in case of triangle -> vertex -> face
Here is a representation of the problem
you can see the face (with blue line around it) that I need to select
the triangle returned from paint interface (marked with red) and the near faces after tri – vertex – face operation (marked with yellow)
From this picture you can see that I cannot recognize the selected face from this because:
- I don’t have a central face
- All the faces shares the same proprieties (shares the vertices)
on solution that goes in mind is to loop thru selection and see which face have all the selected vertex, but all this transformation and looping will have a big impact on performance
fn getPolyByMeshIndex node face show:on =
(
local mesh = node.mesh
polys = meshop.getpolysusingface mesh face
vv = meshop.getvertsusingface mesh polys
faces = meshop.getfacesusingvert mesh vv
verts = meshop.getvertsusingface mesh faces
delete mesh
epolys = (polyop.getfacesusingvert node vv) - (polyop.getfacesusingvert node (verts - vv))
if show do node.selectedfaces = epolys
epolys
)