Sat, Oct 5, 6:11 AM CDT

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: align nodes in P5?


jancory ( ) posted Tue, 21 February 2006 at 9:33 AM · edited Sat, 05 October 2024 at 3:04 AM

is there a P5 python script to align nodes? i downloaded a P6 version but don't know how to modify it into P5 (if it can even be modified)
here's the P6 version i have:

import poser

def align(mat):
scene = poser.Scene()
tree = mat.ShaderTree()
root = tree.Node(0)

for node in tree.Nodes():
if (node == root):
continue
(x,y) = node.Location()

node.SetLocation((x-x%220)+11, y)
tree.UpdatePreview()

mats = poser.Scene().WacroMaterials()
if (mats == None):
poser.DialogSimple.MessageBox(

"Please select a material first.")
else:
for mat in mats:
align(mat)

Message edited on: 02/21/2006 09:34


lost in the wilderness

Poser 13, Poser11,  Win7Pro 64, now with 24GB ram

ooh! i guess i can add my new render(only) machine!  Win11, I7, RTX 3060 12GB

 My Freebies



svdl ( ) posted Tue, 21 February 2006 at 10:00 AM

Alas, not so. Poser 5 Python does not support the material room. You can have Python align the nodes by reading the mt5 text file, altering the node locations and writing them back to file. That's the best that P5 Python can do.

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff


jancory ( ) posted Tue, 21 February 2006 at 10:04 AM

how do i do that? (or is that just edit the values by hand?)


lost in the wilderness

Poser 13, Poser11,  Win7Pro 64, now with 24GB ram

ooh! i guess i can add my new render(only) machine!  Win11, I7, RTX 3060 12GB

 My Freebies



svdl ( ) posted Tue, 21 February 2006 at 10:13 AM

The workaround is complicated. First, your Python script must open a .mt5 file for reading. Not too difficult, it's a plain text file. Second, your script must read in the file, line by line, examine the line for a node location, store the line in a data structure, and if it's a line designating a node location, mark it. When all the lines have been processed, you can calculate the new node positions, alter the lines in your data structure, and then write out the data structure to a (new) .mt5 file. And I'm not even sure whether P5 Python can load a material from the library... In short - quite a lot of work.

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff


jancory ( ) posted Tue, 21 February 2006 at 10:49 AM

thank you---not that i understand that either! i think i'll just try editing the nodes pos locations by hand.....arrgghhh


lost in the wilderness

Poser 13, Poser11,  Win7Pro 64, now with 24GB ram

ooh! i guess i can add my new render(only) machine!  Win11, I7, RTX 3060 12GB

 My Freebies



Angelouscuitry ( ) posted Sun, 22 April 2007 at 3:55 PM

Where did you DL the original script from?


nruddock ( ) posted Sun, 22 April 2007 at 4:34 PM

Attached Link: http://www.stewreo.de/poser/

> Quote - Where did you DL the original script from?

It was probably the script by stewer called "align_Nodes.py".
Link is to his Poser page, where you can download the script.


Angelouscuitry ( ) posted Sun, 22 April 2007 at 5:09 PM

:tt2:


Cage ( ) posted Sun, 22 April 2007 at 11:34 PM

*"is there a P5 python script to align nodes?"

*The "fix materials node coordinates" Python script on the scripts page in my sigline tries to be a standalone which will do pretty much what svdl outlines.  Not brilliant code, but perhaps it can help....

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


Angelouscuitry ( ) posted Mon, 23 April 2007 at 12:23 AM

Thanks, Cage! 

Wow, the Master Cage Page! 

:woot:


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.