Forum: Poser Python Scripting


Subject: Morphs: copying and mirroring

unrealblue opened this issue on Mar 04, 2020 ยท 30 posts


unrealblue posted Thu, 12 March 2020 at 11:29 PM

Now my brain really hurts.

I'll have to go through that after some coffee.

I went back to basics and thought about what I was doing. And came away NOT understanding unimeshinfo. I thought I did. I thought you got 3 parts that made sense. A kind of convenience geometry that was little more than the contact of each actor.geometry.vertices. And, indeed len(unimesh.geometry.vertices) = sum(len(actor_vertex_map)) which would make sense if each vertex in actor.geometry results in a vertex in unimesh geometry. But if that held, then [unimesh.geometry.vertex_indices].sort() should = sum([actor_vertex_map]).sort() and it doesn't. Some of the unimesh vertex indices are missing from the mappings, and some are doubled. How can a unimesh vertex NOT have come from an actor vertex???? If they all come from actor vertices, where did the mapping go????

Hmm... I suppose I can just sum the actor meshes myself. I think that would work for my purposes. Fundamentally, for each actor vertex, I need to know the mirror vertex (regardless to the actor(s) it's in). If I have a map of vertex to mirror_vertex, then I'm just reading parm.morphdelta from vertex and writing new_parm.morphdelta to mirror_vertex.

I get (a bit) what you're doing. But I'm missing the "prove the mesh is symmetric (to precision) logic" and the resulting vertex to mirror_vertex mapping. Which is the essential goal of this.