Console Bits: Action – create nodes and list their attributes

First manually add an action node to a batch schematic, then select it and run the console script

action nodes attributes

code:

import flame

# Use the currently selected Action Batch node
action = flame.batch.current_node.get_value()

# AVAILABLE NODES in action
print "-"*30
print "Available action node types: "

for n in action.node_types:
    print n
    #action.create_node(n)

# CREATE SOME NODES (a bunch of different ones)
myCamera = action.create_node("Camera 3D")
myLight = action.create_node("Light")
myShadow = action.create_node("Shadow Cast")
myGeom = action.import_fbx("/opt/Autodesk/presets/2019.2.pr95/models/FBX/Hypershade_Teapot.fbx", cameras = False, lights = False) 
myShader = action.create_node("Shader")
myIBL = action.create_node("IBL")
myMatchbox = action.create_node("Matchbox")

# PRINTS FOUND NODE'S ATTRIBUTES
print " "
print "-"*30
for node in action.nodes:
    print str(node.type) + ': ' + str(node.attributes)

# Organize schematic
action.organize()

Leave a Reply