Thu, Nov 14, 3:45 AM CST

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 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: Poser Python Wish List


c1rcle ( ) posted Sun, 08 December 2002 at 7:24 AM

I second that :( it's still missing important parts even after sr2.1


mountainmaster ( ) posted Sun, 12 January 2003 at 10:21 AM

A script for Poser 5 that checks a scene for bumpmap textures connected to the Gradient_Bump node, if they are .bum files leaves them there, if they are .jpg's connects them to the Bump node. Also an option to divide the original value by a value to be specified. This is necessary because the effect is much stronger in the Bump node (about 4 to 10 times depending on the bumpmap). Getting sick and tired of doing that manually after applying MAT poses. Would that be possible?


iggy23 ( ) posted Wed, 15 January 2003 at 5:52 AM

a script for Vic3 that automatically uninjects all unused morphs. example: you load v3, inject all head morphs and all body morphs. then get to work on a character. when you are finished, you may have only used a handful of the morph dials. you could then run a script that uninjects (or hides) all morph dials that have a value of 0 (ie are unused). then you could save the character with just the used morphs. don't know if its possible, but it would be handy.. and if you could write it before i buy vic3 at the end of the month that would be even better.... kidding... ;)


andygraph ( ) posted Thu, 16 January 2003 at 6:57 AM

"Modelmap" python script: would be a python script for create real (modify of mesh) displacement, on any body part or on all body character from texture UV mapped !! for create the personal morph targets ;-) for Macintosh and pc Andygraph


who3d ( ) posted Wed, 19 March 2003 at 11:18 AM

How about a python script (if one that I can't find doesn't already exist) to save all props in a nominated folder? Or to go one better - to "spawn props" from an object (usually an imported .OBJ in my case) and then delete it, and save all the props in a nominated folder? Using object name as the file name, obviously, and experting as .OBJ files...


Odiemanc ( ) posted Sun, 23 March 2003 at 7:04 AM

My M2 Morphs Collection.cr2 is 90MBs. As I get into a .pz3 I get closer or farther from certain sets of MTs. A Python to delete the MTs I'm not using, all those at 0, would be useful. It it could provide the option to do any part individually an entire figure, or scene! I think it would make for a great timesaver. The process this would replace would be to Combine All Morphs, in Morph Manger, and then delete all others. I've asked the author of MM4, Mr. X, to add this to the application, a couple of times, but havn't heard back from him. We may still see it from the application, he's taken my ideas up before, allthough we may need to remind him some. Hey how come Ockham still is'nt in this thread? Admin. should entice him in here for sure. He is another community member that has donated much of his time to my theories. Thanks for all of the support, hopefully we can all make our character scenes transfer a bit faster this now.


smokingbevel ( ) posted Mon, 31 March 2003 at 2:49 AM

If such is yet unavailable, or scarcely available, or barely obtainable, I may make an attempt at implementing solutions to the following reoccuring problems:

customized automatic figure(character/geom) recreation from "static", "character-specific" morphs, w/ retention of "dynamic", "actionable" morphs;
quick configurable smart-poly (lod) reduction;
reasonable partially-complete solution to unacceptable directory structure mishandling;

Any advice, suggestions, criticisms, sources, or other submissions may be welcome.

note: dehitch, freeware in java, which smart scans a given prop, character, hand, hair, etc., file, and returns an editable external reference list, is partially complete...(user options for portion which recursively searches and/or modifies external reference paths for dependant files, in selected directories are somewhat undef)

-sb


Odiemanc ( ) posted Mon, 31 March 2003 at 3:33 AM

smokingbevel - I like your Customized Automatic Figure Recreation idea. I just posted a request in this forum for such a utility, that would Spawn/Combine Morphs and/but then turn around and delete all others(Save facial Expressions, etc.)


FishNose ( ) posted Mon, 28 April 2003 at 7:31 AM

I could really use a variation on the 'Lights Out' script - one that allows me to specify which lights (or which range of lights) to delete, rather than every single one. :] Fish


ockham ( ) posted Tue, 29 April 2003 at 12:38 AM

I just added 'Delete' to my big light panel script, which includes a selector list. It's in freestuff/utilities under "P5 and P4 Light Changer" or some such.

My python page
My ShareCG freebies


FishNose ( ) posted Wed, 30 April 2003 at 4:28 AM

Wowee! Thanks, I'm off - :] Fish


ockham ( ) posted Wed, 30 April 2003 at 9:07 AM

Maybe somebody should start a Wish List part 2 that would be easier to spot new entries.......

My python page
My ShareCG freebies


paupert ( ) posted Tue, 20 May 2003 at 2:19 PM

not only a wish > a dream The title: MIDI2poser I have sean some works between Python and MIDI protocol and one to send MIDI to blender. It' ll be a wpndrefull thing to convert MIDI information to poser parameter or data. Imagine move a potentioeter to move a part of a figure or also synchronise racvtion to a musical part.. I know well MID, a little poser and nothing in python developpemnt. may be anybody could wrtite this project... paupert@yahoo.com


solly ( ) posted Mon, 01 September 2003 at 5:47 PM

How about a script that would allow selected body
parts to join an inverse kenetic chain? Lock a hand,
pull the whole figure, and the chest or abs will bend
rather than pull the hand out of position.


JeffH ( ) posted Wed, 03 September 2003 at 11:16 PM

You know turn all the material shaders to texture maps when exporting the model from Poser 5.

Or bake them without exporting..who knows.

Can this be done?

This is something I would pay for in the RMP.

-Jeff


DominiqueB ( ) posted Tue, 16 September 2003 at 7:27 AM

While struggling with modelling body morphs for a piece of M3 clothing, I started thinking about how much easier it is to fit a garment on a character that is spawned with magnets since you apply the magnets to the garments and voila. I then started wondering if the process couldn't be reversed engineered so to speak. Could morphs which I believe are just vertice offset information be translated back into magnets which could then be saved and applied to the garments eliminating the need to model all these morphs into the garments?

Dominique Digital Cats Media


pack ( ) posted Wed, 01 October 2003 at 10:15 PM

I am hoping to export Poses from within any particular Poses folder (make folder name optional/choosable from a menu of existing Pose folders, or a path name)) from in the Pose library, & export the Pose sequence as a bvh file. Perhaps with a couple frames in between each pose to avoid confusing Poser with too fast of changes.. Also using linear interpolation. The idea is to make the 10,000 or so cool poses available to other 3d animation programs, via the bvh format. regards, pack


numanoid ( ) posted Sat, 04 October 2003 at 7:41 PM

Not sure if this is useful or in the right forum, but I have been experimenting and dicovered the following. If you apply the walk designer, and you get a spastic leg jerk in some frames, the way to fix this is as following: Turn on IK, set shin side to side to 0, then select thigh side to side and turn the dial, it doesn't matter how far you turn it, becuase the IK prevents it changing, and then turn off IK again. The spastic leg jerk is then gone. The problem is you have to do this fooevery frame in which the leg jerk or twitch happens. Is there an easier way to fix this, or has someone written a script to fix this.


ockham ( ) posted Fri, 10 October 2003 at 11:18 AM

file_157786.jpg

Here's a quickie that should do the job. It acts only at current frame, so you would find the frame where the jerk happens and activate the script. I rigged it to include both left and right sides; if you need to have separate left-only and right-only scripts, you can just duplicate the file and eliminate the L and R stuff respectively. I think you know the drill for downloading the attached MESSAGE####: rename to something.py before using.

My python page
My ShareCG freebies


numanoid ( ) posted Fri, 10 October 2003 at 5:44 PM

Thank you. Very much appreciated.


Trawler ( ) posted Thu, 08 January 2004 at 12:39 PM

I've done a little bit of C++ and Java programming, but I don't know much about Poser or Python yet. So I have a question... I've been thinking about a pseudo-crowd-generator script for Poser. I think I can imagine the logic, but I'm not sure that Poser would allow me to do such a thing. My basic idea is to place one character in a scene with a specific walk path. Then the script would copy the figure a preset number of times, randomly altering the scale of each within a certain range, and alter their xTran and zTran randomly to spread them around. It would also copy the walk paths with the same off-sets as the figures. What I'd like to do is have a collection of similar figures, like men in battle armor, running across the screen.

What do you think? Sound absolutely crazy!!??

If anyone has any thoughts I'd value your opinions before I begin trying to tackle something like this.

Thanks!


ockham ( ) posted Thu, 08 January 2004 at 1:09 PM

file_157787.jpg

Sure. Making multiple figures, and randomly modifying their scale is easy. You'd have to begin by setting up your figure complete with its clothing, and saving the entire package as a CR2. Let's assume you made such a figure, and stored it under Characters with the name Package.cr2. The walk-path would be more complicated, but still straightforward. Assuming you've given the "original" figure a walk animation, the script would set up a list of all relevant parameters on the original, then copy them to the other figures for each frame. The attached text file contains a fake script that should give you a starting point on the first part. I haven't tested it, but it should come close to working.

My python page
My ShareCG freebies


Connatic ( ) posted Sun, 18 January 2004 at 10:07 AM

I wish there was a script to globally decrease or increase all shadow values for all the lights in a scene, preferably having the ability to enter the percentage of change in a field.


ockham ( ) posted Sun, 18 January 2004 at 12:33 PM

Attached Link: http://ockhamsbungalow.com/Python/ShadPercent.zip

I suspect this has been done before, but here's a quickie.

My python page
My ShareCG freebies


Connatic ( ) posted Sun, 18 January 2004 at 12:56 PM

Thanks, Ockham!


shadownet ( ) posted Tue, 20 January 2004 at 4:50 PM

I'd like a script that did all my work for me so I could just lay in the bed, drink beer, and watch reruns of reruns of Gillians Island on tv. But I would settle for a script that saved the settings of any/all magnets (include base and zone settings) in use on a figure as a Pose file (with all channel info, like scale settings, etc., stored.) So I did not have to keep hacking the pp2 files. :O]


ockham ( ) posted Tue, 20 January 2004 at 4:55 PM

How about a script that lays in your bed and drinks your beer while you do all the work? The magnet settings would run into an obstacle. Python can read the parameter dials (channels) of magnets, bases, and zones, but the settings like falloff graphs and "affected parts" are not available.

My python page
My ShareCG freebies


shadownet ( ) posted Tue, 20 January 2004 at 5:13 PM

That script you mentioned, it already exists. It is called "The Wife" I can get away with saying that, being single. Now you know why I am single. Bummer on the mag script, but thanks for letting me know it is not doable. I can, alas, abandon hope and return to the merry art of hacking the files in a text editor. :O)


ockham ( ) posted Tue, 20 January 2004 at 5:26 PM

I had a wife like that at one time. Now you know why I'm single! Magnets and joints are two important areas where Poser just won't let Python do very much.

My python page
My ShareCG freebies


shadownet ( ) posted Tue, 20 January 2004 at 5:42 PM

Well there goes script wish number 2, a python to tweak jp settings on conforming clothing so that I do not have to spend hours, sometimes days, fiddling around trying to get the widest range and overall best pose settings possible.


ockham ( ) posted Wed, 21 January 2004 at 5:58 PM

file_157790.jpg

Here it is, as an attached text file. I think it's self-explanatory. Get your magnets set up; activate the script; hit Go. It pops up a file dialog for your specific directory runtime/libraries/pose/!MAT-Pose Enter a name. When you hit OK, the pose file is saved. As I mentioned in IM, Poser doesn't like the taste of the resulting file, and gives an "invalid Poser file" error, but it applies the scale and other parameters anyway!

My python page
My ShareCG freebies


shadownet ( ) posted Wed, 21 January 2004 at 6:28 PM

Thank you lots!


telezine ( ) posted Fri, 23 January 2004 at 4:32 AM

Basically an extension of the delete lights scripts we all know and love. I can get it to load a specific lightset by path/name, but I want to be asked for the name so I can choose without having to edit the script every time. (1) Delete all lights (2) prompt user for light file to load (3) load chosen light file The reason I load lights this way is because I have a ton of light files that Poser has munged up so that shadowcams are absent for some/all lights. Conversely, a Py script to process a directory of light files to repair the missing shadowcams would also be nice.


ockham ( ) posted Fri, 23 January 2004 at 12:10 PM

First idea is easy. Coming up in a few minutes. The repair of missing lights is impossible, unless you can identify exactly how the shadowcams are messed. If you can spot, say, three lines in the LT2 file that are always missing, then a mechanical edit might be possible, but I can't imagine how Python could do the detective work to find different kinds of errors!

My python page
My ShareCG freebies


ockham ( ) posted Fri, 23 January 2004 at 12:29 PM

Okay, for what it's worth, here it is. Take the attached text file and rename it to ReplaceLights.py, then see if it helps!

My python page
My ShareCG freebies


telezine ( ) posted Sat, 24 January 2004 at 4:28 PM

Nope. Poser refuses to save shadowmaps in light files, so only modifying the file itself or saving a new one manually behind Poser's back will work. I really want to strangle the numbskull responsible for this "feature"...


ockham ( ) posted Sat, 24 January 2004 at 4:34 PM

I'm not surprised that it doesn't work! It was worth a try, though.

My python page
My ShareCG freebies


Connatic ( ) posted Sat, 24 January 2004 at 5:58 PM

I raytrace my shadows. The shadowmaps/cams are unwieldy, consume vast resources, and are unpredictable compared to raytrace shadows. Set optimally, raytrace is actually faster to render.


telezine ( ) posted Sun, 25 January 2004 at 2:00 AM

Thank you Ockham, you're a real gem :) I wonder if perhaps taking advantage of the script-within-a-preset trick might work here? Save a blank light set that calls a light-creating Python script to do the actual placing of lights in the scene. No way for Poser to screw that up (fingers crossed). Connatic: Unfortunately, I need soft shadows. I agree with you about the shadowcams being unwieldy, but since I use them only when I need soft shadows, they don't really consume a lot of resources. I am actually glad that Poser's raytrace lights don't support soft shadows, because that would require a humongous amount of resources.


Connatic ( ) posted Mon, 26 January 2004 at 12:17 PM

Is this possible? Maybe several scripts revolving about the same idea - to switch off/on the "Smooth Polygons" selector for the objects, not the single one in the render options. so, "Off/On" Global for every figure/prop in the scene, and maybe "Off/On" Individual for every part of the selected Figure/Prop. I generally use the RenderOption to smooth, but then I only want my Human Figures to be smoothed, so I must manually uncheck the box for each part of each figure and prop. This can lead to scores of repetitious scrolling/clicking. A total pain in the butt, as Poser by default checks this box.


ockham ( ) posted Tue, 27 January 2004 at 8:31 AM

Attached Link: http://ockhamsbungalow.com/Python/SmoothOnOff.zip

(We discussed this by email. I'm posting the result here for others.)

My python page
My ShareCG freebies


Connatic ( ) posted Tue, 27 January 2004 at 6:48 PM

Ockham, The script SmoothOnOff works wonderfully! It will be a great help to all P5 users. Thanks.


shadownet ( ) posted Sun, 08 February 2004 at 5:38 PM

@Ockham, just curious, having played around with your very cool group2morph script, I am wondering... Is it possible to have a python script that (1) either could match up the body groups in a figure with an ungrouped mesh - say a catsuit by getting the grouping tool to select polygons in the same general region on the mesh to a specific group. I.E. rCollar group on V2 to corresponding polygons on cat suit to make a rCollar group on Catsuit where known existed. Or (2) if that is not possible - which it probably is not - is it possible to have a script that would mirror my set up, say on the right side of a figure, i.e rCollar to lCollar, rThigh to lThigh, etc., so that if I used the grouping tool to make body groups on one side, it would duplicate these to the polygons on the other side? Yeah my techno jargon sucks, but hopefully you understand what I am asking.


ockham ( ) posted Sun, 08 February 2004 at 9:25 PM

The first is certainly possible but the results will be uneven. It would depend on how closely the source and target meshes match. If the catsuit is "sparse", the mechanical selection of nearest vertices will leave a lot to be desired. If the target is already somewhat similar to the source, it should work well. (I don't mean that the meshes are the same, just that they should have similar density.) The second is something I was already wishing for (sort of subliminally) every time I use the G2M tool. Thank you for putting it into words so I can make it work! But again it will depend on the quality of the mesh. If the mesh is not pretty nearly symmetrical, the mirror will be cracked!

My python page
My ShareCG freebies


shadownet ( ) posted Sun, 08 February 2004 at 9:41 PM

Ockham, well even if it is not perfect, and I have to go back an tweak the groups a bit, it would be a great time saver. Also, your G2M tool has some great potential and I am really looking forward to seeing what all you can find to make it do. Rob


ockham ( ) posted Sun, 08 February 2004 at 9:53 PM

Tweaking: Okay, that makes sense. Correcting a few is still easier than trying to find a thousand, in the red-black world of the grouping tool!

My python page
My ShareCG freebies


shadownet ( ) posted Sun, 08 February 2004 at 10:40 PM

ditto!


Virus ( ) posted Mon, 26 April 2004 at 1:24 AM

A script that allows you to make an object to follow a path? Not like the walk designer that it just can be used in x and z axis, this scripts needs to allow you to use the y axis? Guess this could be cool :) Thanks

SAL9000 - Hello Dr. Chandra, Will I've dream?


Puntomaus ( ) posted Tue, 27 April 2004 at 2:46 AM

A script for P5 that automatically disconnects the bump maps from the gradient node and plugs then into the bump node - maybe with an entry field for changing the bump value or something that already changes the values to the approbiate bump value (ie 1 at gradient channel to 0.05 for the bump channel). It is a pain to do all of this manually in the material room.

Every organisation rests upon a mountain of secrets ~ Julian Assange


msg24_7 ( ) posted Tue, 27 April 2004 at 4:32 AM

@Puntomaus You can do that using MatPoseEdit. ( http://koti.mbnet.fi/~ilaripih/MPEHome/ ) There is an option to convert P4 Mat Poses to P5 Mat Poses, even in batch mode. As far as I remember you can change the settings for the bump channel as well. Just remeber to back up your pz2 files ;-)

Yesterday's the past, tomorrow's the future, but today is a gift. That's why it's called the present.


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.