Forum: Poser - OFFICIAL


Subject: Any python gurus around?

Fugazi1968 opened this issue on Nov 17, 2012 · 4 posts


Fugazi1968 posted Sat, 17 November 2012 at 4:28 AM

Hi Guys

I'm just looking into pythin scripting and have come up against a brick wall.

I've been working on setting up materials and have managed to create and attach nodes, but have so far been unable to work out how to set the value for Gradient_Mode on the root surface.

If anyone has any ideas you'd make me a very happy man indeed :)

Many thanks

John.

Fugazi (without the aid of a safety net)

https://www.facebook.com/Fugazi3D


Snarlygribbly posted Sat, 17 November 2012 at 5:01 AM

I don't have Poser available at the moment, but something like this should work

import poser
mat = poser.Scene().CurrentMaterial() # Or whatever ...
rootnode = mat.ShaderTree().Node(0)
mode = 2.0 # mode can be 1.0, 2.0 or 3.0
rootnode.InputByInternalName("Gradient_Mode").SetFloat(mode)
mat.ShaderTree().UpdatePreview()

 

 

Free stuff @ https://poser.cobrablade.net/


Fugazi1968 posted Sat, 17 November 2012 at 5:08 AM

Cheers Snarlygribbly, I shall give it a go and let you know :)

John.

Fugazi (without the aid of a safety net)

https://www.facebook.com/Fugazi3D


Fugazi1968 posted Sat, 17 November 2012 at 5:20 AM

Snarly you are a hero, worked first time.  I'd have never figured that one out :) 

Many thanks, for relieving my headache and putting a grin on my face.

John

 

Fugazi (without the aid of a safety net)

https://www.facebook.com/Fugazi3D