papillon68 opened this issue on Nov 19, 2010 · 24 posts
RobynsVeil posted Fri, 13 January 2012 at 11:35 PM
Quote - Yay! getting somewhere. I did this:
import poser
scn = poser.Scene()
figs = scn.Figures()
acts = scn.Actors()
for fig in figs:
print fig.Name()
mats = fig.Materials()
if mats:
for mat in mats:
tree = mat.ShaderTree()
node = tree.NodeByInternalName("PoserSurface")
if node:
print node
i = node.InputByInternalName("Diffuse_Value")
i.SetFloat(0.8)
tree.UpdatePreview()With apologies to the originator of this fine script, I've changed a variable name and put in a print statement, which was quite revelatory:
Charlotte
<ShaderNode object at 0x00000000384D06A8>
<ShaderNode object at 0x00000000384D0690>
<ShaderNode object at 0x00000000384D06D8>
CitySwan_Hair_V4
<ShaderNode object at 0x00000000384D06C0>
<ShaderNode object at 0x00000000384D0678>
<ShaderNode object at 0x00000000384D0690>
<ShaderNode object at 0x00000000384D06D8>
ChurchNull
<ShaderNode object at 0x00000000384D06C0>
GROUND
Traceback (most recent call last):
File "C:Program FilesSmith MicroPoser Pro 2012RuntimePythonposerScriptsScriptsMenuUtilitySetDiffuseValueZeroPointEight.py", line 28, in
i = n.InputByInternalName("Diffuse_Value")
AttributeError: 'NoneType' object has no attribute 'InputByInternalName'Now I know on which object/figure/whatever things appear to be hiccuping on: the GROUND prop. I think. Or was it ChurchNull? I'm guessing ChurchNull is a sort-of null object that acts as a "figure container" for the rest of the church bits. Something to parent to. It only has a preview mat zone.
ETA: never mind: think I've sorted it...
Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2
Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand]