[Closed] align pivot to uv
Hi, I’m looking for a solution to a problem: I have imported a tree into my scene with all leaves as individual meshes. Now I’m trying to align the pivots to the base of each indiviual leaf. Problem is, they don’t share the same amount of edges, so I cannot say align pivot to some edge and get the orientation from the corresponding face. So i figured the only common property of all leaves is the uv-layout. But I’m not sure how to access the uv coordinates and translate them into worldspace coordinates. That’s what I need to achieve, though. A script that aligns the pivot of an object to a coordinate from within it’s uv mapping. I have an image attached to clarify even more.
If someone could give me a hint into the right direction or a script snippet that would be really great.
David
Oh and HAPPY NEW YEARS everyone
here is a scenario to anyone who wants to practice in math:
- convert uv pos in bary coordinates of first map face of object’s trimesh
- convert bary to node space coord sys using first face of object’s trimesh to get local pos of the pivot
- transform local pos to world space and apply to pivot
I would go with the maxscript help file aligning uv map to face tutorial and then move it to the geometry minimum/maximum, +/- the center or which ever applies, to the leaf geometry.
-Eric
guess it’s no easy task, hum :-D. But i really need a solution.
Doesn’t the “how do i align pivot” algorithm go the wrong direction? It is the way to go as soon as i have found the desired position of the gizmo and would like to align it to a face. Or am i missing something?