Forum: Poser - OFFICIAL


Subject: any python gurus about?

Fugazi1968 opened this issue on Apr 28, 2013 · 3 posts


Fugazi1968 posted Sun, 28 April 2013 at 2:51 PM

I am working on a little script to add a node or two into a material setup and have come across something that has my head aching.

With the diffuse color it works.

diffCol = root.InputByInternalName("Diffuse_Color")
nodeindiff = diffCol.InNode();

but I cant get it working for Alternate Diffuse

altDif = root.InputByInternalName("Alternate_Diffuse")
nodeindiff = altDif.InNode();

Whether I have a node plugged in or not, it returns an error:

AttributeError: 'NoneType' object has no attribute 'InNode'

It's of course possible that the alternate diffuse doesn't have an InNode method.  I'm not especially familiar with the Poser Object Model, but it seems logical that if Diffuse Color has it, then the Alt would have it too.

Any ideas? or is there another way I can identify the node plugged into Alt Diffuse.

Many thanks

John.

Fugazi (without the aid of a safety net)

https://www.facebook.com/Fugazi3D


millighost posted Sun, 28 April 2013 at 3:26 PM

The internal name of the alternate diffuse input is "AlternateDiffuse", not "Alternate_Diffuse". The function InputByInternalName() returns None if it does not find the name, so it fails when you try to access the InNode() function.


Fugazi1968 posted Sun, 28 April 2013 at 3:40 PM

Quote - The internal name of the alternate diffuse input is "AlternateDiffuse", not "Alternate_Diffuse". The function InputByInternalName() returns None if it does not find the name, so it fails when you try to access the InNode() function.

Thanks Millighost, you are a star.  I looked all over and never considered I'd got that wrong.

Many thanks

John

Fugazi (without the aid of a safety net)

https://www.facebook.com/Fugazi3D