Forum: Poser Python Scripting


Subject: remove a slice from bottom of a prop..??

dennisharoldsen opened this issue on Apr 08, 2008 · 32 posts


Cage posted Fri, 11 April 2008 at 11:12 PM

Okay, I skimmed your post before - I'm on dialup and often racing to post before I'm kicked offline unexpectedly - and now I see what you meant by a slowdown.

I did some timing tests, and the slow part of the process is this line:

scene.LoadLibraryPose(path)

Unfortunately, there's no way to optimize that part of the script.  So this exposes a limitation of using geometry insertion poses this way, at least with large geometries.  When I developed the poses, I was using them to swap out single body parts, as an alternative to geom-swapping dials, which I've never found agreeable.  The process of inserting a geometry via a pose is really a hack, not supported formally by Poser, and it's trying to chew on a lot when applying one which uses a large geometry, so it's really not surprising that it slows down a great deal.

The process can be sped up for runs in which the necessary group already exists by adding a condition in the run() function.

if not "SpecialAddGroup" in prop.Geometry().Groups(): # All of this inserts a group - and is potentially slow.
        tempfig = 0
        if len(scene.Figures()) == 0: # No figures in scene, so load our blank proxy .cr2
            proxy = make_proxy()
            tempfig = 1   
        filename = export_obj(prop,1)
        savePose(prop,filename)
        if tempfig:
            scene.DeleteCurrentFigure() # Remove the proxy

There are certainly better approaches to adding a group.  The script could read back the .obj it saves, importing it directly using the imexporter options.  That wouldn't be hard to do.

I need to move back to handling TDMT now, however.  LOL  I've been avoiding a problem there which I haven't been able to solve....  This latest addition to this script was kind of a proof-of-concept for the possibilities of geom insertion poses.  This approach allows groups to be added to the geometry and it allows original groups to be retained in the spawned prop, but there are definite limitations, the slowdown being perhaps the foremost....

===========================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.