Forum: Poser Python Scripting


Subject: Apply a graphic (Image Map) to the 'diffuse color'

timarender opened this issue on Jul 13, 2012 ยท 4 posts


millighost posted Fri, 13 July 2012 at 8:42 AM

It should roughly look like this:

import poser

scene = poser.Scene ()

use the currently selected actor

actor = scene.CurrentActor ()

use the first material that is there:

material = actor.Materials ()[0]

manipulate the shader tree...

shader = material.ShaderTree ()

create a new image map

image_map = shader.CreateNode (poser.kNodeTypeCodeIMAGEMAP)

set the path of the image_map

path_input = image_map.InputByInternalName ("Image_Source")
path_input.SetString ("d:my_image.png")

connect the nodes

surface = shader.NodeByInternalName ("PoserSurface")
shader.AttachTreeNodes (surface, "Diffuse_Color", image_map)