Forum: Poser Python Scripting


Subject: Moving morphs between different figures

Cage opened this issue on Dec 20, 2006 · 1232 posts


Cage posted Sun, 18 February 2007 at 11:26 PM

Hokay.  I've fixed everything you specified.

I'm still struggling with UV seams, though.  To be able to split and weld texverts, which is necessary to approach conversion effectively, I have to work with a copy of the target geometry.  Simply making a new prop from the target geom won't work, because that still suffers the texvert limitations, and any changes to the new prop via Python get carried back to the original actor, because of Python's object linking.  So I can either create a new geometry using the Numeric stuff and NewGeometry(), or work with OBJ files.

The NewGeometry approach is fairly fast, but I can't seem to avoid a RAM leak in the process.  With V1-V3, I invariably have a loss of at least 20 MB of memory.  As far as I can tell, this is just an effect of using the PoserPython geometry creation methods with such a large mesh.

With the OBJ approach, I can either write my own OBJ file, patching in the new vt and f line data, or I can export an OBJ, then read it back and patch in the changes.  The first approach seems a lot like recreating the wheel, and I'd have to do a lot of extra organizing to maintain the groups and materials assignments (not to mention the normals).  So I've tried the latter method.  This works, but it's slow and the RAM takes an even larger hit while processing the OBJ.  It freed up at the end, but while processing I lost 150 MB of RAM, and the process took 20 minutes.  (And don't get me started on the PPy documentation.  The exportCallback option is wholly undocumented.  Sheesh.)  I can presumably remedy the RAM hit somewhat by using a buffer with the read-write process, but I'm not sure that will help at all with the speed.

All in all, I have to say this exposes a whole new area where PoserPython was just not well thought out.  It should allow access to all sorts of geometry data and methods which are simply omitted.  They've only given us bare-bones access to most things.  Frustrating.  It's a poor craftsman who blames his tools, blah blah, etc.  But, jeez.  The tools could use some work.

But anyway.  I'm working on it.  I hope to have another update tomorrow, which should at least clean up the UV transfer enough to make it fairly easy to clean up the seams in UV Mapper.

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.  He apologizes for this.  He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.  His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.