• Welcome to the Community Forums at HiveWire 3D! Please note that the user name you choose for our forum will be displayed to the public. Our store was closed as January 4, 2021. You can find HiveWire 3D and Lisa's Botanicals products, as well as many of our Contributing Artists, at Renderosity. This thread lists where many are now selling their products. Renderosity is generously putting products which were purchased at HiveWire 3D and are now sold at their store into customer accounts by gifting them. This is not an overnight process so please be patient, if you have already emailed them about this. If you have NOT emailed them, please see the 2nd post in this thread for instructions on what you need to do

Setting a Poser Surface Node to use SuperFly

Gadget Girl

Extraordinary
Contributing Artist
So I posted this in they python forum at RDNA as well, but I'm not sure how alive that forum is anymore, so I figured I'd give a shot at trying here as well, and maybe livening up this sub forum.

I'm trying to create a script that takes a material set up for FireFly, and creates a new SuperFly Poser Surface Node for it. For a while now I've had several little scripts I've run that change the FireFly mat to render better in SuperFly, but they 'break' the Firefly mat because there is still just one surface node.

I've got this so far:

Code:
import poser

scene = poser.Scene()
fig = scene.CurrentFigure()
mats = fig.Materials()

def CreateSFNode(mat):
    #define the Shader Tree for this mat
    sTree = mat.ShaderTree()
    #set variable to easily track the original Poser Surface Node for later use
    ffRoot = sTree.Node(0)
    #ffRoot.RendererRootNode(0)
    #Create a new Poser Surface node that will be for Superfly
    sfRoot = sTree.CreateNode(poser.kNodeTypeCodePOSERSURFACE)
    sTree.setRendererRootNode(sfRoot,0)
def MyApp():
    print mats[0].Name()
    CreateSFNode(mats[0])

    #for m in mats:
    #    CreateSFNode(m)

MyApp()


Here's the error I get:
sTree.setRendererRootNode(sfRoot,0)
AttributeError: setRendererRootNode


So I'm sure I'm passing the wrong thing into setRendererRootNode, but I can't seem to figure out what I *should* be passing in. The Poser Python documentation says this:

SetRendererRootNode
Explanation
Set output node for desired renderer.
Arguments
None
Syntax
<NoneType> SetRendererRootNode(<ShaderNodeType> node, <EnumType> renderer)

But no variation I've tried so far has worked.
 

Gadget Girl

Extraordinary
Contributing Artist
SetRendererRootNode. Upper S. UpperCamelCase in Poser.

Ah thank you! I should have known. When nothing else makes sense, check for punctuation and capitalization.

Actually there's a second error I found once I fixed the capitalization, even though it contradicts with the Poser Python guide says. Instead of:

sTree.SetRendererRootNode(sfRoot,0)

it needed to be:

sTree.SetRendererRootNode(0,sfRoot)

Of course oddly, I can set the node to use Firefly, but not to use SuperFly. Which, I can still make everything work, it's just weird (or it means that SuperFly has some magical enumerator they won't tell me about).
 

Gadget Girl

Extraordinary
Contributing Artist
Of course oddly, I can set the node to use Firefly, but not to use SuperFly. Which, I can still make everything work, it's just weird (or it means that SuperFly has some magical enumerator they won't tell me about).

ARRRGGG! :devil" So I was wrong again. Or write about the documentation being wrong, but wrong about what was happening. Anyway, I figured out how to set things correctly:

Code:
sTree.SetRendererRootNode(poser.kRenderEngineCodeSUPERFLY, sfRoot)

Because not only is the documentation wrong about the order you pass in the arguments, it's wrong about the type of variable.

I'm going to go play Tomb Raider until Poser starts being nice to me again.:cry:
 
Top