I’m trying to find all of the non-inherited attributes of a compositor mix rgb node (api page), and have the below code, but I’m not getting the results I expected.
using dir() returns attributes of all ancestors as well as the current type. How can I find those that are declared only in the CompositorNodeMixRGB class (‘use_alpha’, ‘blend_type’ and ‘use_clamp’) ?
import types
def get_non_inherited_props(scene_name,node_name):
scene = bpy.data.scenes[scene_name]
nodes = scene.node_tree.nodes
node = nodes[node_name]
print('\nresult from dir()\n')
print(dir(node))
print('\nresult from __dict__\n')
for name,item in type(node).__dict__.items():
print(name)
results:
result from dir()
['__doc__', '__module__', '__slots__', 'bl_description', 'bl_height_default', 'bl_height_max', 'bl_height_min', 'bl_icon', 'bl_idname', 'bl_label', 'bl_rna', 'bl_static_type', 'bl_width_default', 'bl_width_max', 'bl_width_min', 'blend_type', 'color', 'dimensions', 'draw_buttons', 'draw_buttons_ext', 'height', 'hide', 'input_template', 'inputs', 'internal_links', 'is_registered_node_type', 'label', 'location', 'mute', 'name', 'output_template', 'outputs', 'parent', 'poll', 'poll_instance', 'rna_type', 'select', 'show_options', 'show_preview', 'show_texture', 'socket_value_update', 'tag_need_exec', 'type', 'update', 'use_alpha', 'use_clamp', 'use_custom_color', 'width', 'width_hidden']
result from __dict__
__module__
__slots__
__doc__
bl_rna
is_registered_node_type
input_template
output_template