engino opened this issue on Apr 24, 2020 · 8 posts
structure posted Sat, 25 April 2020 at 12:04 AM Forum Coordinator
to change your diffuse colors quickly try this
# -*- coding: utf-8 -*-
# ©copyright structure 2001 - 2020
# ================================
import poser
import wx
scene = poser.Scene()
materials = scene.CurrentFigure().Materials()
import wx.lib.agw.cubecolourdialog as CCD
#----------------------------------------------------------------------
def colorDialog():
"""
This is mostly from the wxPython Demo!
"""
dialog = wx.ColourDialog(None)
# Ensure the full colour dialog is displayed,
# not the abbreviated version.
dialog.GetColourData().SetChooseFull(True)
if dialog.ShowModal() == wx.ID_OK:
data = dialog.GetColourData()
return (data.GetColour().Get())
dialog.Destroy()
#----------------------------------------------------------------------
def RGBToPoserCol(rgb):return tuple([x/255.0 for x in rgb]) #courtesy of Snarlygribbly
#----------------------------------------------------------------------
r,g,b = RGBToPoserCol( colorDialog() )
for material in materials:
tree = material.ShaderTree()
nodes = tree.Nodes()
for node in nodes:
if node.IsRoot() and not node.Type() == "CyclesSurface":
inputs = node.Inputs()
i = inputs[0]
i.SetColor( r, g, b )
tree.UpdatePreview()
Locked Out