Wed, Jan 22, 8:51 AM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2025 Jan 22 5:13 am)



Subject: Python script for specularity?


Ghostofmacbeth ( ) posted Tue, 17 March 2009 at 12:36 PM · edited Wed, 22 January 2025 at 8:51 AM

I am wondering if there is a python script to turn the specularity to 0. Thanks



PhilC ( ) posted Tue, 17 March 2009 at 1:17 PM

For all materials in a figure?

# script to set specularity to zero<br></br>
# for all materials in a figure

import poser<br></br>
scene = poser.Scene()<br></br>
fig = scene.CurrentFigure()<br></br>
materials = fig.Materials()

for mat in materials:<br></br>
    root = mat.ShaderTree().Node(0)<br></br>
    nodeInput = root.Inputs()[3] # specularity<br></br>
    nodeInput.SetFloat(0.000)<br></br>
    mat.ShaderTree().UpdatePreview()<br></br>
   <br></br>
scene.DrawAll()


Ghostofmacbeth ( ) posted Tue, 17 March 2009 at 1:24 PM

Thanks!!



Ghostofmacbeth ( ) posted Tue, 17 March 2009 at 1:51 PM

This works great for figures but I also have this issue with props. Any way to change that? Thanks



PhilC ( ) posted Tue, 17 March 2009 at 2:00 PM

Use:-

actor = scene.CurrentActor()
materials = actor.Materials()

You can add error checking lines to ensure that it is a prop that is selected, or in the first one to ensure it is a figure. Otherwise just be careful about what is currently selected before running the script.


Ghostofmacbeth ( ) posted Tue, 17 March 2009 at 4:31 PM

Thanks a ton!!



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.