nfredman opened this issue on Mar 15, 2013 · 6 posts
nfredman posted Fri, 15 March 2013 at 11:48 AM
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 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