Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)
Well, I've had a little more time to play with it and here's a little more detail on my problem... Basically, when you export a .obj file from Poser, you have 2 options: 1. export the mesh as it exists already on your drive (no morphs, no joint-induced changes) or... 2. export the mesh with morph changes, but also with joint-induced changes. ...which one you get, depends on the 'As Morph Target' option being checked or not. So, now suppose you want to export StephyP, with some morphs applied - let's say the Muscular full-body morph, for example - so that you can load that into a modeller to create Muscular morphs in some clothing you've created for her. So, you load up Sp3, zero the joint rotations, dial up the Muscular morph and export the .obj and you're good to go, right? Wrong :). And this is where my problem is. First off, through some mechanism/values I have yet to find, her legs will be skewed to her right because she's "rigged". This is a tiny displacement and different amounts can be found when comparing the thighs, shins, feet, etc. but causes troubles if the clothing item is meant to be a very tight-fitting item (like stockings or a catsuit). Secondly, Sp3's .cr2 file is bugged to begin with - it has some non-zero X center (or center of rotation) values in it, causing skewing in the upper body parts as well (the hip comes out exactly centered, the abdomen is off, the chest is off, the neck is off, the head is off... all by different amounts). You can see some of these errors by loading Sp3 in as above, then importing her mesh - they won't occupy the same space. So, what I really want is NOT exactly what you see in Poser (a morphed, but 'rig-errored' model), what I want is the file-based .obj file vertices (no rig-induced errors, no posing rotations or translations), but with whatever morphs I have dialed in applied to it. - Keith
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.
Oh and BTW, part of the confusion (bug?) is, to get a 'morphed' output model, you have to have "As Morph Target" UNCHECKED. If you check it, you just get the model with no morphs (or transformations of any type) applied. I think this is a bug.. I'll have to go do more testing in P5 and P4, but it seems like it used to work correctly.
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.
I could see where there might be problems if there is a default rotation being applied when exporting - there very well could be something locked in the cr2 - I don't know. I've always worked on the .obj rather than the cr2 because problems can creep in. Often I'll load the whole mesh and then on export select options 4 and 6: preserve groups and as morph target. Guess this doesn't help at all. BTW Spanki, STOMP is brilliant. Thats for that. I've been using it to mirror morphs from one limb to another, when MTmirror doesn't work right.
.
A Python method for doing this would be great. Meanwhile, I would use John Wind's Compose utility which can do just this, although it's a bit long winded and you'd soon tire of it if you had a lot of morphs to do. Sorry not to contribute much, but this is partially a bookmark so I'll be notified if anyone comes up with the goods (ebots permitting).
Good tip, but I never found my way around Compose and I think it might have trouble reading P6 files (?). At any rate, since there didn't seem to be an existing Python solution to this issue, I decided to get my Python feet wet and managed to come up with something that works... mostly. The current script just bakes the currently dialed in morphs to the figure's geometry, so when you export the mesh (as morph target), it includes the morphs, but none of the rig-induced errors (yay!). There are a few ways I could refine this process, but having never programmed Python, I'm not quite sure how to do some (very simple) things I need to do in order to implement the changes I have in mind. In particular, I want to create a (boolean type) array of a runtime-determined size -> 'numVerts', initialize the values to zero and be able set and later check values in that array. If someone could fill me in with a quickie example of that, that would be great. For example: . . . numVerts = geom.NumVertices() myboolarray = ?? # <-- how do I allocate a simple array of 'numVert' size and set all the values to zero? ...I assume once that's done, I can later just: myboolarray[i] = 1 ...to set values and... if( not myboolarray[i] ) do_something_here() ...to test for values, but I'm just unclear on allocating the array to start with. - Keith
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.
Nevermind... I found some info on the Numeric Python library and managed to figure it out... working on refining the script now.
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.
Interesting. Thanks, Spanki!
FREEBIES! | My Gallery | My Store | My FB | Tumblr |
You just can't put the words "Poserites" and "happy" in the same sentence - didn't you know that? LaurieA
Using Poser since 2002. Currently at Version 11.1 - Win 10.
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.
Here's what I want to do... - load a .obj or prop - morph it using Poser Magnets - export an .obj file with those morphs applied. ...in other words, I want to be able to export the model as it is currently being displayed in Poser. I think the best approach might be to use the default model vertex info, then add any deltas from any currently dialed morphs (I can manually create morphs from the magnets before running the script). Does anything like this exist already? Thanks, - Keith
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.