Post #2038: wh

šŸ“‹ Metadata

šŸ·ļø Tags

pie-menu python-scripting intermediate solved

  • Pie Menu Editor
  • Python Scripting
  • Custom Operators

šŸ’¬ Content

whinton:

roaoao:

[operator(L, "pme.exec", text=ng.name, icon='CHECKBOX_HLT' if C.space_data.node_tree == ng else 'CHECKBOX_DEHLT', cmd="C.space_data.node_tree = D.node_groups['%s']" % ng.name) for ng in D.node_groups]

i’m wondering if there is a way to describe a condition so that only animation nodes node groups art called up.

Try to add this condition:

if ng.bl_idname == 'an_AnimationNodeTree'

Final code:

[operator(L, "pme.exec", text=ng.name, icon='CHECKBOX_HLT' if C.space_data.node_tree == ng else 'CHECKBOX_DEHLT', cmd="C.space_data.node_tree = D.node_groups['%s']" % ng.name) for ng in D.node_groups if ng.bl_idname == 'an_AnimationNodeTree']

šŸ”— View on Blender Artists