Forum: Poser Python Scripting


Subject: Scripted Shader Node Animation

Iuvenis_Scriptor opened this issue on May 08, 2022 ยท 19 posts


Iuvenis_Scriptor posted Mon, 09 May 2022 at 12:45 PM

Thanks for all the suggestions, guys!  Alas, it has so far been to no avail.  With a temporary focus on just animating the right node inputs and getting the corresponding dials to appear (i.e. no renaming yet), my code now looks like this:


import poser
scene = poser.Scene()
character = scene.CurrentFigure()
actor = character.Actor("Body")
materials = actor.Materials()
main = ["SkinHead","SkinLimbs","SkinTorso","Iris","Fingernails","Teeth","Gums","Tongue"]
for (material,zone) in [(mat,mat.Name()) for mat in materials if mat.Name() in main]:
    nodes = (material.ShaderTree()).Nodes()
    for node in [element for element in nodes if " || " in element.Name()]:
        label,numbers = (node.Name()).split(" || ",1)
        indices = [int(number) for number in numbers.split("_")]
        name = node.InternalName()
        print("\t"+label)
        for index in indices:
            input = node.Input(index)
            print("\t\t"+input.Name())
            input.SetAnimated(1)
scene.DrawAll()


The same problem persists.  The node inputs display as animated (with the white key symbol) in the Material Room, but the Parameters palette in the Pose Room remains barren, which means the dials are most likely not being created, and any attempt to rename them is doomed to fail.