📋 Metadata
- Author: roaoao
- Date: 2019-03-15 15:47:43
- Type:
answer - Reply to: post_02037
- Replies (1): post_02049
💬 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']