Keith opened this issue on Apr 22, 2016 ยท 3 posts
Keith posted Fri, 22 April 2016 at 11:24 AM
I have a script which adds an image node to the bump/displacement nodes and sets the values, which works perfectly fine. What I can't get it to do is set the gamma on the image node to 1 and the filtering to crisp. Yes, I know there are scripts which will do that for me (and I have them), but I'd like to incorporate it into the script itself so I don't need to do the additional step.
3dcheapskate posted Sat, 23 April 2016 at 12:38 AM
This script will give you the internal name and value for every input in every node in your shader tree (edited version of a PrintShaderTree.py from the old (now defunct) DAZ forum archive):
import poser
tree = poser.Scene().CurrentMaterial().ShaderTree()
for n in tree.Nodes():
print 'nNode ',n.Name()
for i in n.Inputs():
print '- ',i.Name(),'(Internal name=',i.InternalName(),', value=', str(i.Value())
I''m running Poser 9 at present so I used that script to get the Filtering parameters for you - it has internal name 'Filtering' and the numeric values are None = 1, Fast = 2, Quality = 3, and Crisp = 4
You can run the script to get the gamma details (Poser 9 doesn't have gamma)
As far as I know PoserPython doesn't have built-in enumerations fro the drop-downs in material room nodes, but I'm fairly sure that they're integer values in order starting at 1 for the top item in the list
To set the filtering value of node 'n' to Crisp you'd simply do:
n.InputByInternalName('Filtering').SetFloat(4.0)
The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.
Keith posted Sat, 23 April 2016 at 12:38 PM
Thank you.