Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2025 Feb 05 6:41 am)
Well, I usually work on several scripts at the same time. And now some of them are nearing completion. So the appearance of several scripts is not surprising. Another one in the making, which will make morphs out of magnets (and optionally save the figure, create INJ/REM poses, the whole kaboodle). The magnet-to-morph code is functional, it just needs a GUI plus cleanup code.
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
Cool. Nothing wrong with a bit of hard work!
That's a great script idea. I was thinking of doing that one myself after the one I am working on now.
I may as well just wait to see if you are working on something before I even try anymore ;-)
I just finished a script to transfer morph values from one figure to another. I needed it for something I am currently working on. I haven't decided whether to release it, or even if anyone would find it useful.
Right now, I am working on a script to copy morph values from one side of a figure to the other, so that only one side has to be morphed, then the other side can be made symmetric automatically. This is part of the current project I am working on too.
These may have been done already, I don't know, but sometimes it's easier for me to just write my own code, my own way.
So what else do you have in your bag of tricks?
Hmm, nothing much at the moment. There's an old script using Tkinter that'll clean up the walking motion of a figure after applying the Walk Designer, it's called WalkThisWayV2. Will drop the figure onto the selected surface(s) and reduce/eliminate foot slippage when walking. It's not perfect, the hip motion tends to get jerky. And I have added some functionality to two of ockhams scripts: DeleteProps and DeleteFigs. I'm planning to write a script that easily hides/unhides multiple figures. I'm also working on a very precise DropToSurface script. Lots of mathematics to make it work right, and lots of headaches to let it have adequate performance. Bounding boxes, intersection algorithms, you name it. Tough, but if I can get it to work, very useful. Ah well. Something to keep me out of trouble, I guess.
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
Test with M3
Here is the end of the message
........................
Creating morph target on lFoot
Creating morph target on lToe
Creating Full Body morph
Restoring IK for Figure 2
Done
Saving INJ Yvon to library
Writing INJ for actor Hip
Writing INJ for actor Abdomen
Writing INJ for actor Chest
Writing INJ for actor Neck
Writing INJ for actor Head
Head
Traceback (most recent call last):
File "", line 662, in ?
File "", line 578, in SaveINJREM
AttributeError: 'NoneType' object has no attribute 'MorphTargetDelta
and the end of the message using M2
............................
Writing INJ for actor Left Collar
Writing INJ for actor Left Shoulder
Writing INJ for actor Left Forearm
Writing INJ for actor Left Hand
Writing INJ for actor Left Thumb 1
Writing INJ for actor lThumb2
lThumb2
Traceback (most recent call last):
File "", line 662, in ?
File "", line 578, in SaveINJREM
AttributeError: 'NoneType' object has no attribute 'MorphTargetDelta
I am left with left hand fingers as props
The new figure is saved & seems to work properly
Only Inj injector is created and only the upper part of the body is morphed
Thumbnail is not created
Any suggestion ?
Interesting. The hide/unhide shouldn't be too hard. Just flip the SetOnOff switch for each figure. What are you going to do, put checkboxes in for who the user wants to hide? The DropToSurface sounds very intriguing. I think you would make a lot of people happy with that script. I'm planning on working on a Render Passes script next. I haven't tried out the one that comes with Poser, but I quickly glanced over the code, and I think it only deals with lights, rendering a pass for each one. I'm thinking more along the lines of turning off figures in a scene, rendering with only one figure, then cycling through each one, then rendering the shadows without any figures in the scene. I figure then all of them can be composited and make a nice postworked image. I figured I would take a look at the wishlist and see if there was anything anyone wanted as well.
@Adavyss: I think I figured out what happened. The obj file you imported may have had a different number of vertices in the head than the original head geometry. That will cause the SpawnTargetFromGeometry method to fail silently. No morph will be created. Or maybe you haven't morphed his head at all. In that case, the SpawnTargetFromGeometry method might also refuse to create a morph target. I've updated the script, it now will pass over bodyparts that don't have the new morph channel. You can redownload the updated script from the link in post #1.
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
I've tested the updated version with M2 & M3 and it works perfectely well appart from the 4 fingers & thumb of the left hand which are left behind at the end of the process.
Very nice script.
I noticed that the object and CR2 are in the same folder. Would it be possible to send the object in the geometry folder as it offers more flexibility to move or rename the CR2 folder ?
Would it be possible to include the INJ/REM after the morph name instead of before in order to have the 2 related injectors next to each other in the folder ?
Would it be possible to include the thumb creation process into SpawnCharacterP6.py ?
That business with fingers and thumb is strange. They SHOULD have been deleted after running the script. I'll see what I can find out. As for the .OBJ question, I can do better than that. Since morph data only exist in the CR2, it's better to make the CR2 point back to the original OBJ. Which is not too hard to do (asking the geomFileName from the original figure, and replacing the correct lines in the CR2 is fairly easy - as long as you're not working with compressed files, that is!) I might have to figure out how to handle compressed files. As it is now, the script can only deal with uncompressed files.
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
"They SHOULD have been deleted"
That's what I suspected, but whatever Character I use they are still there
"it's better to make the CR2 point back to the original OBJ"
That's true, I'm pretty slow sometimes.
"the script can only deal with uncompressed files"
I don't know about the others but it's perfect for me. Once decompressed, I never bother to compress them again.
Bedtime here
Thanks for your time
No toes hurt. I just never have used the gzip module yet, I'll need to learn it.
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
Of course. The script remembers most of the render settings, including dimensions. I'll just have to add a few more settings to the data structure.
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
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.
Attached Link: http://svdlinden.xs4all.nl/poserstuff/downloads/morphfromobjp6.zip
A new script. Especially useful for ZBrushers.If you ZBrush a geometry and want to turn it into a morph, there's a lot of manual work - importing the ZBrushed object, spawning props, saving out the individual props, loading morph targets onto all figure parts, setting an FBM, and let's not forget the hassle of creating a nice INJ/REM pose pair.
This script will eliminate almost all manual work. It's fully functional, but still in beta.
Give it a try, and give me some feedback on how to improve it.
By the way, the script will detect the presence of PBM_CC injection channels in the figure. If they're present, the user will be asked to select one. If not, the user will be asked to define a new morph channel name.
I might change the script to automatically construct the morph channel name from the morph name (stripping whitespace).
Forgot to add: P6 SR2 required. Will not work on earlier editions of Poser.
Message edited on: 03/30/2006 10:31
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter
My gallery My freestuff