Fri, Nov 22, 7:30 AM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Nov 21 6:06 am)



Subject: any python gurus about?


Fugazi1968 ( ) posted Sun, 28 April 2013 at 2:51 PM · edited Mon, 11 November 2024 at 9:20 AM

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


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.