Filter: Safe | Mon, Jun 29, 10:53 AM CDT

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Lobo3433, Staff Forum Coordinators: Anim8dtoon

Poser Python Scripting F.A.Q (Last Updated: 2026 Apr 22 10:09 am)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: WIP: Poser <-> Blender Bridge


  • 1
  • 2
false1 ( ) posted Tue, 04 February 2020 at 1:49 PM · edited Tue, 04 February 2020 at 1:50 PM

adp001 posted at 2:46PM Tue, 04 February 2020 - #4379012

I know there is a problem with OSX. Apple does not use standards while handle UI-buttons. And the old wxPython version in Poser has no workaround. I can't work on a fix, because I use Linux and Win, not OSX. So I'm not able to do something.

But the script is more a prof of concept anyway. So someone with OSX may do an interface.

That's cool. It's functional and consistent from my limited tests. The inability to morph a modified character has been a huge hole in my workflow. I'll just have to copy this post so I can remember my steps. Thanks again.

________________________________

My Website

My YouTube channel


Zaycrow ( ) posted Mon, 10 February 2020 at 12:51 AM

I noticed the script export everything. Also the parts that are hidden in figures. Is there a way to export so the parts that are hidden doesn't get exported? Like the RhinoExport.py that Smith Micro use to have on their site.



adp001 ( ) posted Mon, 10 February 2020 at 7:03 PM

Zaycrow posted at 1:47AM Tue, 11 February 2020 - #4379717

I noticed the script export everything. Also the parts that are hidden in figures. Is there a way to export so the parts that are hidden doesn't get exported? Like the RhinoExport.py that Smith Micro use to have on their site.

RhinoExport does a simple object export, if I see it right.

If you want something not exported, delete it. As long as it is there, it influences vertex-numbering. What this script does depends hardly on vertex-orders. A simple thing like not exporting something means destroying anything. To avoid that, a complicated process is required what makes this simple script big, complicated and error-prone.

But maybe anyone comes out with an easy to implement idea. For me the script does what I need it to do and I'm busy with other things more important for me.

But if anyone feels called: Don't hold back.




FVerbaas ( ) posted Tue, 11 February 2020 at 9:38 AM
Forum Coordinator

The method I use to filter out internals is to select by material. For avatars for garment development I just use the skin material for body, head, limbs and maybe lips. Alternative is to define a facet group. Then you can add or remove as you like.


RAMWorks ( ) posted Fri, 21 February 2020 at 9:20 AM

I'm interested in this script but looked on your downloads page and wasn't sure which it was if it's posted there. I'm not good at writing code so I'll wait to download any until your done with this one.

I'm from DAZ Studio but have been working a little bit with Poses's La'Femme and L'Homme and really like both of them but I'm more of an underdog sort of guy, I like supporting the male figures (or shapes, which ever! LOL).

I work primarily with ZBrush as my program of choice to create stuff in (clothing, props and morphs mostly) and while I know there is a built in ZBrush bridge in Poser now I've had some niggles with it. So I wanted a way to export a workable OBJ file of L'Homme but since he's just a morph of La'Femme there is no OBJ, just a PMD and I've found no way to make that happen.

There are issues when I export L'Homme from Poser and import him into ZBrush via their importer. I've created some morphs, saved that out as a new morph target and then in Poser, Poser wants to import it as a prop so I'm guessing the export from Poser does something to the mesh ... something I have no idea how to fix so it's basically useless.

I have a thread here at 'Rosity around L'Homme and they pointed me to your project here.

Hope it works out as I need this!

Thanks so much Richard

---Wolff On The Prowl---

My Store is HERE

My Freebies are HERE  


adp001 ( ) posted Fri, 21 February 2020 at 11:55 AM

Last version is this:

http://adp.spdns.org/FullbodyMorphs_wx4.py.zip

If you are not on a Mac the script should work fine. With Macs there is something with the UI. Poser's wxPython implementation (a really old one) has problems with some UI elements (if used like in this script).




RAMWorks ( ) posted Fri, 21 February 2020 at 12:57 PM

Cool, I'll download that when I get home from work. Thanks so much!

---Wolff On The Prowl---

My Store is HERE

My Freebies are HERE  


adp001 ( ) posted Fri, 21 February 2020 at 1:14 PM

RAMWolff posted at 8:12PM Fri, 21 February 2020 - #4381298

Cool, I'll download that when I get home from work. Thanks so much!

This script supports no Sub-D currently. Seems this is important for you.




RAMWorks ( ) posted Fri, 21 February 2020 at 4:07 PM

When dealing with Genesis 8 for DAZ I always make sure the figures Sub D is set to the lowest when making morphs so that's no worry for me.

---Wolff On The Prowl---

My Store is HERE

My Freebies are HERE  


adp001 ( ) posted Fri, 21 February 2020 at 4:17 PM

RAMWolff posted at 11:14PM Fri, 21 February 2020 - #4381329

When dealing with Genesis 8 for DAZ I always make sure the figures Sub D is set to the lowest when making morphs so that's no worry for me.

Same here. I see no reason for hi-res morphs. Actually, a morph is nothing more than a displacement map on a hires mesh. So: subdivide and use a displacement-map if needed :)




RAMWorks ( ) posted Fri, 21 February 2020 at 9:36 PM

WOW, just lowered the Sub D to 0 and his hips popped out as in looking more feminized. Very strange. Don't get that with Genesis, I just get more blocky looking mesh when close up. The only area that's the give away is the ears, those get a bit blocky but I have to say I'm impressed in how well this figure is designed with the amount of attention that went into making sure it's smoothed nicely even with the zeroed out Sub D. I even zeroed out the Sub D for Render

---Wolff On The Prowl---

My Store is HERE

My Freebies are HERE  


RAMWorks ( ) posted Fri, 21 February 2020 at 9:38 PM

What is "Force Legacy Welding" ?

---Wolff On The Prowl---

My Store is HERE

My Freebies are HERE  


RAMWorks ( ) posted Sat, 22 February 2020 at 9:58 AM

OK, not sure where to put this script to make it show up in Poser. I have it currently here:

C:Program FilesPoser SoftwarePoser 11RuntimePythonposerScripts

Didn't show up!

Help?

---Wolff On The Prowl---

My Store is HERE

My Freebies are HERE  


RAMWorks ( ) posted Sun, 23 February 2020 at 12:18 PM · edited Sun, 23 February 2020 at 12:20 PM

OK, using the script via import the script via the File> Run Python Script. So that's nice. Figured out something but still would love to see it in the Scripts drop down menu!

So I'm having a little issue with this. Exported L'Homme via your script, opened him up in ZBrush and did a test morph, saved it out as an OBJ and used the import button to bring the morph in. What it seems to have done is unhooked all the other morphs I've managed to make like my "Masculine Hip Position" morph. I made a morph called "Chest Larger". Interestingly enough the one morph that seems operational is the face morph I made, so that seems odd to me.

So then I had two morphs operational, the face morph and the Chest Larger morph. So then I went back and undid the steps in ZBrush, back to the original version your py script exported for me. I then recreated the Masculine Hip Position morph, exported that, named it and used that button to bring it in. It seemed to overwrite the Chest Larger morph but strangely enough the Masculine Hip Position morph was loaded into the Chest Larger morph channel. Very strange to me.

Can you set up the script to create a new channel for each morph imported? I don't know any other way around this! YIKES!

---Wolff On The Prowl---

My Store is HERE

My Freebies are HERE  


FVerbaas ( ) posted Sun, 23 February 2020 at 1:44 PM · edited Sun, 23 February 2020 at 1:45 PM
Forum Coordinator

Put it in (a subfolder of) this location:

C:Program FilesPoser SoftwarePoser 11RuntimePythonposerScriptsScriptsMenu


adp001 ( ) posted Sun, 23 February 2020 at 2:55 PM

The script gives you the difference of what you exported from Poser (including poses, dialed in morphs, weightmaps in action, etc) and the work you did actually in you modeller.

If you output a figure with a morph dialed in, this morph is visible in Z-Brush, but will not be part of the new imported morph. The reason for that is being able to make morphs based on another already existing morph/deformations.

Starting from a base figure: Do morph one. Name it "One". Don't export again from Poser, don't change "morphname" until you are satisfied with the imported morph. For the next step name your morph "Two" (change morphname). Export the figure from Poser with morph One dialed in. Make your modifications in ZBrush as in part one. You will see the effect from morph One in ZBrush, but it will not be part of the new exported morph. The next export-result imported into Poser is only what you modified in the second step.

This process does not take care of deformations cased on poses (PCM, weightmap) or dialed in other morphs. Your new morph is exactly the result from the exported figure (Poser's export) minus your export from the modeller.

This way you are able to create a set of morphs in an external modeller and each morph plays nicely with the other morphs.

If you plan to make a complete "full-bodymorph" (that is one with one single name) part by part, use the same Poser-exported mesh on each session.

Name of the new import channel is always what you typed in into "morphname".

On import into Poser each vertex is checked if it differs from the exported mesh this new import is based on. If yes (even minimal), a morphchannel is created inside the actor this vertex belongs to. So, if you find a morphchannel in an actor unexpectedly, check your modifications made in your modeller.

I have no plans to work further on this script as long as it does what I need it to do. It's kind of a proof-of-concept for me. It's free code. Anyone can take it and make it work for non-programmers or extend/mofiy it for special cases.

For the "real thing" we need a module inside the modeller. The Poser side has too mutch restrictions. This is the case why my next step is developing a modul for Blender. A direct-connection based on RPC, reflecting anything important from Poser in Blender – nearly in realtime. And it will work fine with Poser2014 and lower :)




emjay247 ( ) posted Sun, 23 February 2020 at 4:31 PM

"This is the case why my next step is developing a modul for Blender. A direct-connection based on RPC, reflecting anything important from Poser in Blender – nearly in realtime. And it will work fine with Poser2014 and lower :)"

That would be amazing!


bantha ( ) posted Thu, 27 February 2020 at 8:18 AM

Just a thought, when thinking about vertex order - would it possible to reconstruct the vertex order using the uv-coordinated of the model, as an option? Usually, you don't change the uv-coordinates when morphing a figure. That way you could even use parts of the mesh for morphing and still restore the vertex order.

Is this idea usable in any way?

Great work, by the way. Very impressive.


A ship in port is safe; but that is not what ships are built for.
Sail out to sea and do new things.
-"Amazing Grace" Hopper

Avatar image of me done by Chidori


adp001 ( ) posted Thu, 27 February 2020 at 2:48 PM

bantha posted at 9:35PM Thu, 27 February 2020 - #4381962

Just a thought, when thinking about vertex order - would it possible to reconstruct the vertex order using the uv-coordinated of the model, as an option? Usually, you don't change the uv-coordinates when morphing a figure. That way you could even use parts of the mesh for morphing and still restore the vertex order.

Is this idea usable in any way?

Great work, by the way. Very impressive.

I'm thinking about a welding-function in Python. Maybe based on a KdTree. I'm testing it at the moment. Because I'm not so familar with KdTree's I have to experiment a bit. This planed function will create a database at the end. So it must only run once per figure (as long as the database is reachable). Having that makes a lot more things possible. Especially support for cloth-creation.




unrealblue ( ) posted Mon, 01 March 2021 at 9:34 PM

No output. No errors, no output.

Nuts. I was messing around with poser morphs in blender and came upon this script. Well, 3 scripts:

  • PoMo18012020_10.zip
  • FullbodyMorphs_wx3.py.zip
  • FullbodyMorphs_wx4.py.zip

Poser 12 on a Mac (Mojave). I tried them all. The GUI looks the same in each (more or less). My desktop (~/Desktop) is the path (import and export).

Figure is selected. Click export, nothing happens. No output file. No error. I haven't had time to go trace through the code. I thought maybe there's a "no duh" something I'm missing.

Cheers


adp001 ( ) posted Tue, 02 March 2021 at 11:48 AM

Sorry, I'm late.

Did an update to OBJ_ImExporter today. With a little help file.

Untested in P12: OBJ_ImExport.zip




adp001 ( ) posted Tue, 02 March 2021 at 11:51 AM

OBJ_ImExport is based on Posers Python Script Menu. I think this is better than WX Python for several reasons.

Best use: Unzip all contained files to a seperate directory (Poser can reach and work with), then start "Main.py" from Poser.




unrealblue ( ) posted Tue, 02 March 2021 at 9:46 PM · edited Tue, 02 March 2021 at 9:48 PM

I was wondering...

I'm doing some scripting in support of morphs. I've found, "mesh shaping" is easier (for the greater part) in Blender. I want to go back and forth between them.

There is the export posed+morphed obj from Poser. Fine. Over in Blender, I import it, keeping the vert order the same. Again, fine. But, for multiple-actor meshes, of course this doesn't produce a mesh I can conveniently sculpt: breaks at actor boundaries. What I need is a form of "glue" in Blender. I thought of a way to accomplish this:

Effectively, I need a duplicate mesh that has been run through "merge" with a low enough threshold. In un-scaled form, this is about 0.000001 or so. In any case, to "connect" those two meshes, I need isupplemental data. I need a map of new vert to old vert. Each new vert would have one (or more) id's of old verts. After morphing, you would "apply to old mesh" which would simply take the position of each new vert, and push that to the indexed verts. Viola. Then export that original mesh, with new positions that come from sculpting a blender "uni-mesh". Then, in Poser you could simply "load full body morph". It really only cares about vert index and new position.

Right?

To make the map, it could (inefficiently/naively) be done by iterating through each new mesh vert, and find each old vert position that is the same (within the tolerance of the merge). A list (new vert id's) of lists (old vert id's). No holes. Each new vert would be one or more old vert.

Wouldn't have to care anything about details of the Poser mesh. All we're doing is translating that into a Blender unimesh, map new verts to old verts, moving the new verts around, then taking those positions reverse translated back to the Poser mesh, which is exported then imported by poser.

An effective "weld" by using the weld feature in Blender, with additional data of "for each point, which old point(s) are represented by this point"

Or am I being too naive, here?


unrealblue ( ) posted Tue, 02 March 2021 at 9:59 PM

I realize the effect could be called a "soft merge" or "reversible merge", and might be useful for other things. You could use a similar effect for sculpting multiple objects as a combine mesh, complete with everything you can do in sculpting (except re-topo, of course) and take the sculpt result back out to the original mesh(es). In this case, the lookup data needs to also include the mesh id. Each "unimesh" vert would have a list of original mesh_id.vert_id.

I must be up the wrong tree. This seems like something obvious enough someone would make it :o


adp001 ( ) posted Wed, 03 March 2021 at 5:55 AM

If I understand your text correctly (English is not my native language) then you describe pretty much what the script "ImExport.py" does.

The current Poser figure, which consists of individual "Actors", is combined into a Unimesh and exported (morphed and posed) as an OBJ file.

This Unimesh can be edited in Blender with all the tools available there. Afterwards, from Blender, it is saved again as an OBJ file (necessarily under a different name).

The script in Poser takes the two saved meshes (OBJ files saved from Poser and Blender) and creates a difference from them. The result, the difference, is the "Unimesh Morph". The Unimesh Morph is then decomposed and saved into the affected Actors as a Morph.

What did I get wrong?




adp001 ( ) posted Wed, 03 March 2021 at 6:05 AM

Maybe it will help me understand if you write down a real example. Something you would like to achieve. Is it about making clothes?




unrealblue ( ) posted Wed, 03 March 2021 at 4:45 PM

Ah, then it exists! What you describe is, effectively, what I mean.

It sounds like the script you mention does more or less the same thing I want, all in the Poser side. Assuming it works on a mac, I could use this immediately.

(long description follows)

For me, clothes. But I imagine that it would be anywhere you wanted to create morphs in Blender that cross actor boundaries. You have to have a "uni-mesh" for sculpt in Blender to work (you don't need it for vert editing, so long as you're careful in the selection of verts.)

Example: A simple leotard for La Femme

Untitled.png

The mesh is symmetric, which makes it easier since I wrote a script that mirrors all the JCMs on one side to the other

For this one, a lot of weight map work had to be done at the legs as the movement of close fitting cloth mesh is very different than the HR cloth donor mesh when the openings are right at a joint like the thigh/hip)

A manual looked something like this:

In Poser:

  • Pose the figure and it's conformed clothing
  • Export as OBJ (without welding, keeping bend and JCMs mesh effects)

In Blender:

  • Import the OBJ (keeping vert order).
  • Copy the Object
  • Weld the new Object into a "uni-mesh"
  • Create a map between original Object and welded new Object: new_mesh.vert <-> [old_mesh.vert...]
  • Sculpt the uni-mesh
  • Use the map to apply the uni-mesh back onto the original mesh, diffing.
  • Export the changed original Object back as an OBJ (keeping morph targets)

In Poser

  • Load Full Body Morph
  • If this is to replace a JCM, delete the old, name this as the old.

Obviously scripting on the Poser side makes this easier, even with "uni-mesh-ification" being in Blender.

First, the Poser script can export the entire series of poses necessary for all the JCMs, as a stack of OBJs.

Second, It can rewrite the all the JCMs on import of a stack of OBJs. Either creating new or editing existing. Combined with the mirror JCMs script, it could create the other side's JCMs.

Part of the reason I thought "Blender script" for "uni-mesh-ification" is that this has utility outside of Poser. There are times where I have multiple meshes/objects and I want to sculpt them together, while keeping them as different meshes. I want common vertices "glued" together, for sculpting.

Sorry for the length of that :)


adp001 ( ) posted Wed, 03 March 2021 at 6:41 PM

thoennes posted at 6:39PM Wed, 03 March 2021 - #4414206

It sounds like the script you mention does more or less the same thing I want, all in the Poser side. Assuming it works on a mac, I could use this immediately.

Then just try it. I don't have a Mac and I don't use Poser 12. So it up to you to test it :)




adp001 ( ) posted Wed, 03 March 2021 at 6:52 PM

thoennes posted at 6:51PM Wed, 03 March 2021 - #4414206

It sounds like the script you mention does more or less the same thing I want, all in the Poser side.

Doing it in Poser has the advantage that it can be used with most modellers. Not only with Blender.




unrealblue ( ) posted Sat, 06 March 2021 at 3:14 AM

Tried the script. The Poser menu stuff doesn't work. Commented them out and just called the export and import on their own. They work. The wx dialogs work. I had to change a single thing (python3 map returns map object; wrapped in in a list) Exported fine (Poser12 on MacOS Mojave), imported in Blender (2.91.2). Sculpted. Exported that out, imported, named the morph and it worked fine.

Sweet thanks. I'll sort the Poser menu.


adp001 ( ) posted Sat, 06 March 2021 at 8:20 AM

Thanks for testing.

The mapping error can be easily fixed.

if sys.version_info.major > 2:
    basestring = str
    map = lambda a, b: [a(_b) for _b in b]

I'll update the script accordingly.

For the Script-Button: Don't know how to start searching why it will not work.

I think a simple wxPython Dialog is the best solution for the moment. I'll make one today.




unrealblue ( ) posted Sat, 06 March 2021 at 3:28 PM

adp001 posted at 3:11PM Sat, 06 March 2021 - #4414391

Thanks for testing.

The mapping error can be easily fixed.

if sys.version_info.major > 2:
    basestring = str
    map = lambda a, b: [a(_b) for _b in b]

I'll update the script accordingly.

For the Script-Button: Don't know how to start searching why it will not work.

I think a simple wxPython Dialog is the best solution for the moment. I'll make one today.

No worries!

I was lazy and just used list() right in the code rather than a lambda function dependent on the version. You're much more meticulous than me :D


unrealblue ( ) posted Sat, 06 March 2021 at 7:57 PM · edited Sat, 06 March 2021 at 7:58 PM

OK, I just modified (slightly) the FullbodyMorphs_wx4.py script.

Again, Poser 12 on MacOS Mojave.

Changes I had to make:

  • the logic that got filenames for import and export did not join the filename (no path) with the path. The code properly set the config with the path, but then used ONLY the plain filename and no path (which keeps using the Poser 12 App directory since, no path). I changed it so that the path and filename were joined. Same thing happened on import; same fix. Very minor.

I did not look into wx (yet) to see if maybe the API had changed such that it was splitting those two things up, in previous versions or other platforms.

  • the map (as noted before) needed to force the map object returned by map() in python 3, into the expected list. I added the map= lamda function as per above.

Those minor changes being made, the script ran without error. So far I've only tested it for simple case: Clothing conformed to figure. Figure posed. Exported. Posed clothing sculpted in Blender 2.91.2. Exported back out. Scales at 1. vertex order maintained. No re-topo happening in sculpt. Imported as a new morph. The FBM works exactly as expected. It correctly implemented the morph, subtracting the "effective morph" the pose causes. This should be super useful for constructing JCMs.

awesome!

This script is going to be an important part of clothing creation workflow using Blender :)

Next, I'm going to try a complete (single) JCM creation workflow using this script.


unrealblue ( ) posted Sat, 06 March 2021 at 8:14 PM

weird, it won't let me edit all the mistakes in the last post.


adp001 ( ) posted Sun, 07 March 2021 at 11:58 AM

Ok, I made an update with a WX Dialog. This one should work with Mac and with Python 3 (P12 untested, because I don't have it).

Bildschirmfoto vom 2021-03-07 18-53-24.png

Download: Click here




adp001 ( ) posted Sun, 07 March 2021 at 12:06 PM · edited Sun, 07 March 2021 at 12:08 PM

"Scale": Used for im- and export. find out what your modeller needs (blender works fine with 10).

"Silent IM-/Export": Don't ask for filenames. Uses the same file name as last time (if a filename is known already).

"Create Masterbutton" does nothing at the moment.

"Export Groups": Will create groupnames (actor names) in the OBJ file. Blender can use this to create vertexgroups.

"Export UV info": Saves Material und UV-Textures if checked.

"Copy Imagefiles": Creates copies of the texturefiles in the path the exported object resides (so your modeller can find it).




adp001 ( ) posted Sun, 07 March 2021 at 12:10 PM

Unzip into a seperate Directory and start WxMain.py




unrealblue ( ) posted Sun, 07 March 2021 at 3:05 PM

It works!

Thank you.

I don't have the modules on my PATH or installed anywhere Poser can find them and it took me a second to realize that this needed the other module :)

This is Poser 12 on MacOS Mojave.

Super useful script. Now, if I can just nail down a good JCM workflow :D


adp001 ( ) posted Sun, 07 March 2021 at 3:24 PM

Oh – I forgot to remove a lib not used anymore (at least for now).

Download update




adp001 ( ) posted Sun, 12 September 2021 at 9:18 AM

Newest version is now here:

https://www.renderosity.com/rr/mod/forumpro/?thread_id=2955142




RAMWorks ( ) posted Tue, 28 December 2021 at 1:41 PM

This looks amazing.  I really could use something like this now that I'm adopting Blender and work from Poser.  I'm on Windows 11 and using Blender 3.X

---Wolff On The Prowl---

My Store is HERE

My Freebies are HERE  


  • 1
  • 2

Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.