Mon, Nov 25, 8:56 PM 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: Very specific script request


nfredman ( ) posted Fri, 15 March 2013 at 11:48 AM · edited Wed, 20 November 2024 at 4:05 PM

Hello -

I'm looking for a very specific script that will apply a transparency to a material...for a specific object for two specific material zones. This would be a minor part of a commercial product, but I would likely use it over and over. I want to get this product submitted in the next two weeks, so I need a fairly speedy turnaround.

I have scripted Python, but not for Poser...

The psuedocode would run something like this, I expect:

Import poser
Specify path and image file for transmap
Are we working on the right prop item? If so, then:
--for materal one, set transparency map, transparency parameters, and specularity parameters as well as setting alt spec color to black
--for material two, set transparency parameters and specularity parameters as well as setting alt spec color to black
If not the right prop:
--Give error message and exit

I'm finding some of the methods in the manual, but I need help with synatx. If anyone would not mind doing me a solid, I would happily trade for a free copy of the upcoming product or other barter. Please contact me through sitemail, if you would--or post a reply here, your choice.

Many thanks in advance!


structure ( ) posted Sun, 17 March 2013 at 9:50 AM · edited Sun, 17 March 2013 at 9:57 AM
Forum Coordinator

#import poser

scene = poser.Scene()
fig=scene.CurrentFigure()
act=scene.CurrentActor()
mat=scene.CurrentMaterial()
tree=mat.ShaderTree()

#Work on the PoserSurface Node
n = tree.NodeByInternalName("PoserSurface")

#     I am no expert but for specular use the following

#------------------------------------------------------
#Specular Color
i = n.InputByInternalName("Highlight_Color")
i.SetColor(0.0, 0.0, 0.0)
#Specular Value
i = n.InputByInternalName("Highlight_Value")
i.SetFloat(1)
#Highlight Size
i = n.InputByInternalName("Roughness")
i.SetFloat(0.3)
#------------------------------------------------------

#           And for transparency

#------------------------------------------------------
#Transparency
i = n.InputByInternalName("Transparency_Max")
i.SetFloat(0)
#Transparency Edge
i = n.InputByInternalName("Transparency_Min")
i.SetFloat(0)
#Transparency falloff
i = n.InputByInternalName("Transparency_Falloff")
i.SetFloat(0.6)
#------------------------------------------------------

Locked Out


nfredman ( ) posted Sun, 17 March 2013 at 10:27 AM

OMG! You're wonderful!  I can really use this! Thank you thank you thank you. You get a free product for this. :D


structure ( ) posted Sun, 17 March 2013 at 10:35 AM
Forum Coordinator

You are most welcome :) -

I am just now finishing cataloguing the real names of the posersurface nodes and trying to give examples of how to use them -

I find the methods manual is good, if you have a little prior knowledge of python (and of course python WITH poser , not so much for a newbie o.O

Locked Out


nfredman ( ) posted Sun, 17 March 2013 at 3:42 PM

I found a lovely 400+ tutorial book by PhilC. It's excellent--and might save you some work! Not free, but worth it. I've had my nose in it since yesterday.

Besides, PhilC's tutorial are always droll. :)


structure ( ) posted Sun, 17 March 2013 at 3:44 PM
Forum Coordinator

thanks for that _ I will check it out when funding permits :)

Locked Out


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.