Forum: Poser Python Scripting


Subject: Script that fixes vertex order - testers welcome

odf opened this issue on Dec 06, 2021 ยท 14 posts


odf posted Mon, 06 December 2021 at 9:33 PM

Okay, it seems I've got some working code for fixing vertex orders in morph targets. Typical example: I export a character's head from Poser, spend a few hours reshaping it in Blender, and then realize I haven't checked "keep vertex order" when importing. Now with my script, I can still apply the morph by reconstructing the correct order, even if the mesh shape has changed drastically so that simple distance-based methods don't work.

If anyone is keen on trying it out, the code can be found at https://github.com/odf/pydeltamesh. Look for tags v0.9.0 and v0.9.0_py27 for the Python-3-only version (with type annotations) and the backported one that works in both Python 2 and Python 3, respectively. If you're unfamiliar with git or the github interface, let me know and I'll post some instructions.

There's a stand-alone script "applyMorph" that takes two OBJ files and produces a new OBJ file as output, and there's the core "match" module that can be used by other scripts, for example a fancy Python-based Poser morph loader. I haven't tested it with Poser yet (and probably won't any time soon), so if there are any problems, let me know. SciPy is used at one point, which I think may not be available in Poser versions before 12? If that's a problem, let me know and I'll come up with a workaround. Other than that, only Numpy is required. For a usage example, just check applyMorph.py.

At the moment the mesh must be a manifold. Adding support for non-manifold meshes (e.g. certain kinds of garment) will be my next mission.

-- I'm not mad at you, just Westphalian.