Post #2038:
wh
š Metadata
- Author: roaoao
- Date: 2019-03-15 15:47:43
- Type:
answer - Quality Score: 8/10
- Reply to: post_02037
- Replies (1): post_02049
š·ļø Tags
pie-menu python-scripting intermediate solved
āļø Related PME Features
- 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']