Console Bits: Batch Nodes: print values per attribute

Selected a node a print: the actual value of each attribute, limits, type …


import flame

mynode = flame.batch.current_node.get_value()

print '******** ', mynode.name, ' ********'
print ''

# mynode_attr will be a list
mynode_attr = mynode.attributes

# sort the list
mynode_attr.sort()

# print Value, Type and Limits (or options) for each attribute
for attr in mynode_attr:
print attr + ":", getattr(mynode, attr).get_value()
print "Attribute's Type: ", type(getattr(mynode, attr).get_value())
print getattr(mynode, attr).values
print ''

'''
Example of prints:
******** 'node1' ********

after_range: No Media
Attribute's Type: <type 'str'>
('Repeat Last', 'No Media', 'Use Black', 'Use White', 'No Offset', 'Loop', 'Ping Pong +', 'Ping Pong')

before_range: No Media
Attribute's Type: <type 'str'>
('Repeat First', 'No Media', 'Use Black', 'Use White', 'No Offset', 'Loop', 'Ping Pong +', 'Ping Pong')

bypass: False
Attribute's Type: <type 'bool'>
(True, False)

collapsed: True
Attribute's Type: <type 'bool'>
(True, False)

hide_input: False
Attribute's Type: <type 'bool'>
(True, False)

hide_output: False
Attribute's Type: <type 'bool'>
(True, False)

input_amount: 1
Attribute's Type: <type 'int'>
(1, 20000)

input_selection: 0
Attribute's Type: <type 'int'>
(0, 19999)

name: node1
Attribute's Type: <type 'str'>
None

note:
Attribute's Type: <type 'str'>
None

note_collapsed: True
Attribute's Type: <type 'bool'>
(True, False)

pos_x: -1149
Attribute's Type: <type 'int'>
(-2147483647, 2147483647)

pos_y: 45
Attribute's Type: <type 'int'>
(-2147483647, 2147483647)

range_active: False
Attribute's Type: <type 'bool'>
(True, False)

range_end: 100
Attribute's Type: <type 'int'>
(-2147483647, 2147483647)

range_start: 1
Attribute's Type: <type 'int'>
(-2147483647, 2147483647)

selected: False
Attribute's Type: <type 'bool'>
(True, False)

timing_offset: 0
Attribute's Type: <type 'int'>
(-20000000, 20000000)

type: MUX
Attribute's Type: <type 'str'>
None
'''

Leave a Reply