-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.py
694 lines (544 loc) · 23.6 KB
/
ui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
import os
import json
import bpy
from bpy_extras.io_utils import ImportHelper
from . import utility
from . import utility_presets_setup as Presets
from . import bl_info
from . import utility_import
class MCFG_MT_TemplatesNodeScript(bpy.types.Menu):
# Description string
'''Node script templates menu'''
# Mandatory variables
bl_label = "Custom node script"
# Standard functions
def draw(self,context):
layout = self.layout
templateDir = os.path.join(os.path.dirname(os.path.realpath(__file__)),"templates")
templatesFile = open(os.path.join(templateDir,"templates.json"),"r")
templates = json.load(templatesFile)
templatesFile.close()
if len(templates) == 0:
layout.lable(text="No templates are available")
return
for key in templates.keys():
name = templates.get(key).get("name")
path = templates.get(key).get("file")
layout.operator('text.open',text=name).filepath = os.path.join(templateDir,path)
class MCFG_MT_TemplatesSetupPresets(bpy.types.Menu):
# Description string
'''Node setup templates menu'''
# Mandatory variables
bl_label = "Setup preset"
# Standard functions
def draw(self,context):
layout = self.layout
presets = Presets.PresetDefinitions()
for preset in presets:
layout.operator('text.open',text=preset.get("name")).filepath = preset.get("path")
class MCFG_GT_ModelSelectionItem(bpy.types.PropertyGroup):
# Description string
'''Model selection list item'''
# Properties
name: bpy.props.StringProperty(
name = "Name",
description = "Selection name",
default = "Untitled selection"
)
include: bpy.props.BoolProperty(
name = "Include",
description = "",
default = False
)
class MCFG_GT_NodeSetupPresetItem(bpy.types.PropertyGroup):
# Description string
'''Setup preset list item'''
# Properties
name: bpy.props.StringProperty(
name = "Name",
description = "Name of the preset",
default = "Untitled preset"
)
desc: bpy.props.StringProperty(
name = "Description",
description = "Description of the preset",
default = ""
)
custom: bpy.props.BoolProperty(
name = "Custom",
description = "Whether the preset is custom or built-in",
default = False
)
path: bpy.props.StringProperty(
name = "Path",
description = "Path to preset file",
default = ""
)
class MCFG_UL_ModelSelectionList(bpy.types.UIList):
# Description string
'''Model selection list'''
# Standard functions
def draw_item(self,context,layout,data,item,icon,active_data,active_propname,index):
if self.layout_type in {'DEFAULT','COMPACT'}:
layout.prop(item,"include",text = "")
layout.label(text=item.name)
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
layout.prop(item,"include",text = "")
layout.label(text=item.name)
class MCFG_UL_NodeSetupPresetList(bpy.types.UIList):
# Description string
'''Node setup preset list'''
# Standard functions
def draw_item(self,context,layout,data,item,icon,active_data,active_propname,index):
icon = 'OUTLINER_OB_GROUP_INSTANCE'
if item.custom:
icon = 'FILE_FOLDER'
if self.layout_type in {'DEFAULT','COMPACT'}:
layout.label(text=item.name,icon=icon)
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
layout.label(text=item.name,icon=icon)
class MCFG_OT_NewConfig(bpy.types.Operator):
# Description string
'''Create new model config node tree'''
# Mandatory variables
bl_label = "New Config"
bl_idname = "mcfg.newconfig"
# Standard functions
@classmethod
def poll(cls, context):
return context.space_data.type == 'NODE_EDITOR' and context.space_data.tree_type == 'MCFG_N_Tree'
def execute(self,context):
editorSpace = context.space_data
newTree = bpy.data.node_groups.new("Model Config",'MCFG_N_Tree')
newTree.use_fake_user = True
editorSpace.node_tree = newTree
return {'FINISHED'}
class MCFG_OT_BonesFromModel(bpy.types.Operator):
# Description string
'''Create bones from model selections'''
# Mandatory variables
bl_label = "Bones"
bl_idname = "mcfg.bonesfrommodel"
# Standard functions
@classmethod
def poll(cls, context):
isNodeTree = context.space_data.type == "NODE_EDITOR" and context.space_data.tree_type == "MCFG_N_Tree"
hasSelected = len(bpy.context.selected_objects) == 1 and bpy.context.selected_objects[0].type == 'MESH'
return (isNodeTree and hasSelected)
def draw(self,context):
layout = self.layout
layout.template_list("MCFG_UL_ModelSelectionList","SelectionList",context.scene,"MCFG_SP_ModelSelectionList",context.scene,"MCFG_SP_ModelSelectionListIndex")
layout.prop(context.scene,"MCFG_SP_ModelSelectionListListNode")
def execute(self,context):
utility.CreateBoneNodes(self,context)
return {'FINISHED'}
def invoke(self,context,event):
selectedObject = bpy.context.selected_objects[0]
bpy.context.scene.MCFG_SP_ModelSelectionList.clear()
# populate list with vertex groups from selected mesh
for group in selectedObject.vertex_groups:
newItem = bpy.context.scene.MCFG_SP_ModelSelectionList.add()
newItem.name = group.name
return context.window_manager.invoke_props_dialog(self)
class MCFG_OT_SectionsFromModel(bpy.types.Operator):
# Description string
'''Create sections from model selections'''
# Mandatory variables
bl_label = "Sections"
bl_idname = "mcfg.sectionsfrommodel"
# Standard functions
@classmethod
def poll(cls, context):
isNodeTree = context.space_data.type == "NODE_EDITOR" and context.space_data.tree_type == "MCFG_N_Tree"
hasSelected = len(bpy.context.selected_objects) == 1 and bpy.context.selected_objects[0].type == 'MESH'
return (isNodeTree and hasSelected)
def draw(self,context):
layout = self.layout
layout.template_list("MCFG_UL_ModelSelectionList","SelectionList",context.scene,"MCFG_SP_ModelSelectionList",context.scene,"MCFG_SP_ModelSelectionListIndex")
def execute(self,context):
utility.CreateSectionNodes(self,context)
return {'FINISHED'}
def invoke(self,context,event):
selectedObject = bpy.context.selected_objects[0]
bpy.context.scene.MCFG_SP_ModelSelectionList.clear()
# populate list with vertex groups from selected mesh
for group in selectedObject.vertex_groups:
newItem = bpy.context.scene.MCFG_SP_ModelSelectionList.add()
newItem.name = group.name
return context.window_manager.invoke_props_dialog(self)
class MCFG_OT_ReportBox(bpy.types.Operator):
# Description string
'''Info report pop-up'''
# Mandatory variables
bl_label = "Report"
bl_idname = "mcfg.reportbox"
# Operator properties
report: bpy.props.StringProperty (
name = "Report info",
description = "Pop-up text to display",
default = ""
)
# Standard functions
def draw(self,context):
layout = self.layout
sections = self.report.split("|")
for section in sections:
box = layout.box()
for line in section.split(","):
box.label(text=line)
def execute(self,context):
return {'FINISHED'}
def invoke(self,context,event):
return context.window_manager.invoke_props_dialog(self)
class MCFG_OT_Import(bpy.types.Operator,ImportHelper):
# Description string
"""Import model.cfg and create nodes"""
# Mandatory variables
bl_idname = "mcfg.import"
bl_label = "Import config"
# Custom properties
filter_glob: bpy.props.StringProperty(
default = '*.cfg',
options = {'HIDDEN'}
)
# Standard functions
@classmethod
def poll(cls, context):
isNodeTree = context.space_data.type == "NODE_EDITOR" and context.space_data.tree_type == "MCFG_N_Tree"
hasArmaTools = os.path.isdir(bpy.context.preferences.addons[__package__].preferences.armaToolsFolder)
return isNodeTree and hasArmaTools
def execute(self,context):
if os.path.split(self.filepath)[1] != "model.cfg":
utility.ShowInfoBox("Selected file is not model config","Error",'ERROR')
return {'FINISHED'}
utility_import.ImportFile(self,context)
return {'FINISHED'}
class MCFG_OT_Export(bpy.types.Operator):
# Description string
"""Export node setup to model.cfg format"""
# Mandatory variables
bl_idname = "mcfg.export"
bl_label = "Export config"
# Standard functions
@classmethod
def poll(cls, context):
return context.space_data.type == "NODE_EDITOR" and context.space_data.tree_type == "MCFG_N_Tree"
def execute(self,context):
utility.ExportFile(self,context)
return {'FINISHED'}
class MCFG_OT_Validate(bpy.types.Operator):
# Description string
"""Validate the processed node setup data"""
# Mandatory variables
bl_idname = "mcfg.validate"
bl_label = "Validate setup"
# Standard functions
@classmethod
def poll(cls, context):
return context.space_data.type == "NODE_EDITOR" and context.space_data.tree_type == "MCFG_N_Tree"
def execute(self,context):
utility.ExportFile(self,context,False)
return {'FINISHED'}
class MCFG_OT_LoadPresets(bpy.types.Operator):
# Description string
"""Load node setup presets"""
# Mandatory variables
bl_idname = "mcfg.loadpresets"
bl_label = "Load/Reload presets"
# Standard functions
@classmethod
def poll(cls, context):
return context.space_data.type == "NODE_EDITOR" and context.space_data.tree_type == "MCFG_N_Tree"
def execute(self,context):
Presets.ReloadPresets()
return {'FINISHED'}
class MCFG_OT_InsertPreset(bpy.types.Operator):
# Description string
"""Insert node setup preset into current node tree"""
# Mandatory variables
bl_idname = "mcfg.addpreset"
bl_label = "Insert preset"
# Standard functions
@classmethod
def poll(cls, context):
return context.space_data.type == "NODE_EDITOR" and context.space_data.tree_type == "MCFG_N_Tree"
def execute(self,context):
Presets.ReloadPresets()
if context.scene.MCFG_SP_PresetListIndex not in range(len(context.scene.MCFG_SP_PresetList)):
return {'FINISHED'}
preset = context.scene.MCFG_SP_PresetList[context.scene.MCFG_SP_PresetListIndex]
if not os.path.isfile(preset.get("path")):
utility.ShowInfoBox("Preset not found","Error",'ERROR')
return {'FINISHED'}
Presets.InsertPreset(self,context,preset.get("path"))
return {'FINISHED'}
class MCFG_OT_CreatePreset(bpy.types.Operator):
# Description string
"""Create node setup preset from current node tree"""
# Mandatory variables
bl_idname = "mcfg.createpreset"
bl_label = "New custom preset"
# Standard functions
@classmethod
def poll(cls, context):
isNodeTree = context.space_data.type == "NODE_EDITOR" and context.space_data.tree_type == "MCFG_N_Tree"
hasFolder = os.path.isdir(bpy.context.preferences.addons[__package__].preferences.customSetupPresets)
return (isNodeTree and hasFolder)
def draw(self,context):
layout = self.layout
layout.prop(context.scene,"MCFG_SP_PresetName")
layout.prop(context.scene,"MCFG_SP_PresetDesc")
def execute(self,context):
Presets.CreatePreset(self,context)
Presets.ReloadPresets()
return {'FINISHED'}
def invoke(self,context,event):
Presets.ReloadPresets()
context.scene.MCFG_SP_PresetName = "Untitled preset"
context.scene.MCFG_SP_PresetDesc = ""
if len(context.space_data.node_tree.nodes) == 0:
utility.ShowInfoBox("There are no nodes in the tree","Info",'INFO')
return {'FINISHED'}
for link in context.space_data.node_tree.links:
if not link.is_valid:
utility.ShowInfoBox("There are invalid links in the tree","Error",'ERROR')
return {'FINISHED'}
return context.window_manager.invoke_props_dialog(self)
class MCFG_OT_DeletePreset(bpy.types.Operator):
# Description string
"""Delete selected preset"""
# Mandatory variables
bl_idname = "mcfg.deletepreset"
bl_label = "Delete custom preset"
# Standard functions
@classmethod
def poll(cls, context):
isNodeTree = context.space_data.type == "NODE_EDITOR" and context.space_data.tree_type == "MCFG_N_Tree"
hasFolder = os.path.isdir(bpy.context.preferences.addons[__package__].preferences.customSetupPresets)
return (isNodeTree and hasFolder)
preset: bpy.props.StringProperty(
name = "Preset",
description = "",
default = ""
)
def draw(self,context):
layout = self.layout
layout.label(text="Are you sure you want to delete this preset?")
layout.label(text=self.preset)
def execute(self,context):
path = context.scene.MCFG_SP_PresetList[context.scene.MCFG_SP_PresetListIndex].path
Presets.DeletePreset(path)
return {'FINISHED'}
def invoke(self,context,event):
Presets.ReloadPresets()
selectionIndex = context.scene.MCFG_SP_PresetListIndex
if selectionIndex not in range(len(context.scene.MCFG_SP_PresetList)):
return {'FINISHED'}
path = context.scene.MCFG_SP_PresetList[selectionIndex].path
if not os.path.isfile(path):
utility.ShowInfoBox("Preset not found","Error",'ERROR')
return {'FINISHED'}
preset = Presets.ReadPresetFile(path)
if not preset.get("custom"):
utility.ShowInfoBox("Built-in presets cannot be deleted","Info",'INFO')
return {'FINISHED'}
self.preset = "Name: " + preset.get("name")
return context.window_manager.invoke_props_dialog(self)
class MCFG_OT_Inspect(bpy.types.Operator):
# Description string
"""Print the output data of the inspected nodes to the system console"""
# Mandatory variables
bl_idname = "mcfg.inspect"
bl_label = "Inspect data"
# Standard functions
@classmethod
def poll(cls, context):
return context.space_data.type == "NODE_EDITOR" and context.space_data.tree_type == "MCFG_N_Tree"
def execute(self,context):
utility.InspectData(self,context)
return {'FINISHED'}
class MCFG_PT_Tools(bpy.types.Panel):
# Description string
'''Tools panel section'''
# Mandatory variables
bl_label = "Tools"
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
bl_category = "Model config"
# Standard functions
@classmethod
def poll(cls, context):
return context.space_data.type == 'NODE_EDITOR' and context.space_data.tree_type == 'MCFG_N_Tree'
def draw(self, context):
tree = context.space_data.node_tree
if tree:
layout = self.layout
box = layout.box()
box.label(text="Mesh:")
box.operator('mcfg.bonesfrommodel', icon = 'BONE_DATA',text="Bones from model")
box.operator('mcfg.sectionsfrommodel', icon = 'MESH_DATA',text="Sections from model")
layout.separator()
box = layout.box()
box.label(text="Inspection:")
box.operator('mcfg.inspect', icon = 'VIEWZOOM')
class MCFG_PT_Import(bpy.types.Panel):
# Description string
'''Import panel section'''
# Mandatory variables
bl_label = "Import"
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
bl_category = "Model config"
# Standard functions
@classmethod
def poll(cls, context):
return context.space_data.type == 'NODE_EDITOR' and context.space_data.tree_type == 'MCFG_N_Tree'
def draw_header(self,context):
layout = self.layout
row = layout.row(align=True)
row.operator("wm.url_open", text="", icon='HELP').url = "https://github.com/MrClock8163/BlenderModelCfgEditor/wiki/Import"
def draw(self, context):
layout = self.layout
row = layout.row()
row.alert = os.path.isdir(bpy.context.preferences.addons[__package__].preferences.armaToolsFolder)
row.label(text="Read the documentation",icon='ERROR')
box = layout.box()
box.label(text="Detect presets:")
row = box.row(align=True)
row.prop(context.scene,"MCFG_SP_ImportPredefSkeleton",toggle=True)
row.prop(context.scene,"MCFG_SP_ImportPredefModel",toggle=True)
box.label(text="Links:")
box.prop(context.scene,"MCFG_SP_ImportLinkDepth",expand=True)
box.label(text="Data:")
box.prop(context.scene,"MCFG_SP_ImportDepth",expand=True)
box.label(text="Expressions:")
box.prop(context.scene,"MCFG_SP_ImportExpressions",expand=True)
layout.operator('mcfg.import', icon = 'IMPORT')
box.enabled = os.path.isdir(bpy.context.preferences.addons[__package__].preferences.armaToolsFolder)
class MCFG_PT_Export(bpy.types.Panel):
# Description string
'''Export panel section'''
# Mandatory variables
bl_label = "Export"
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
bl_category = "Model config"
# Standard functions
@classmethod
def poll(cls, context):
return context.space_data.type == 'NODE_EDITOR' and context.space_data.tree_type == 'MCFG_N_Tree'
def draw_header(self,context):
layout = self.layout
row = layout.row(align=True)
row.operator("wm.url_open", text="", icon='HELP').url = "https://github.com/MrClock8163/BlenderModelCfgEditor/wiki/Validation-and-export"
def draw(self, context):
tree = context.space_data.node_tree
if tree:
layout = self.layout
layout.operator('mcfg.validate', icon = 'CHECKMARK')
layout.separator()
box = layout.box()
box.label(text="Settings:")
row = box.row(align=True)
row.alert = not os.path.isdir(context.scene.MCFG_SP_ExportDir)
row.label(text="Directory:")
row.prop(context.scene,"MCFG_SP_ExportDir",text="")
row = box.row(align=True)
col = row.column(align=True)
col.alert = context.scene.MCFG_SP_IgnoreErrors
col.prop(context.scene,"MCFG_SP_IgnoreErrors",toggle=True)
col = row.column(align=True)
col.prop(context.scene,"MCFG_SP_OpenFile",toggle=True)
layout.operator('mcfg.export', icon = 'EXPORT')
class MCFG_PT_Presets(bpy.types.Panel):
# Description string
'''Preset panel section'''
# Mandatory variables
bl_label = "Presets"
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
bl_category = "Model config"
# Standard functions
@classmethod
def poll(cls, context):
return context.space_data.type == 'NODE_EDITOR' and context.space_data.tree_type == 'MCFG_N_Tree'
def draw_header(self,context):
layout = self.layout
row = layout.row(align=True)
row.operator("wm.url_open", text="", icon='HELP').url = "https://github.com/MrClock8163/BlenderModelCfgEditor/wiki/Node-setup-presets"
def draw(self, context):
tree = context.space_data.node_tree
if tree:
layout = self.layout
layout.template_list("MCFG_UL_NodeSetupPresetList","NodePresetList",context.scene,"MCFG_SP_PresetList",context.scene,"MCFG_SP_PresetListIndex")
column_flow = layout.column_flow(columns = 4,align=True)
column_flow.operator('mcfg.addpreset', icon = 'PASTEDOWN',text = "")
column_flow.operator('mcfg.loadpresets', icon = 'FILE_REFRESH',text = "")
column_flow.operator('mcfg.createpreset', icon = 'ADD',text = "")
column_flow.operator('mcfg.deletepreset', icon = 'REMOVE',text = "")
selectionIndex = context.scene.MCFG_SP_PresetListIndex
if selectionIndex in range(len(context.scene.MCFG_SP_PresetList)):
row = layout.row()
item = context.scene.MCFG_SP_PresetList[selectionIndex]
row.prop(item,"desc",text="")
row.enabled = False
return
class MCFG_PT_Docs(bpy.types.Panel):
# Description string
'''Documentation panel section'''
# Mandatory variables
bl_label = "Documentation"
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
bl_category = "Model config"
# Standard functions
@classmethod
def poll(cls, context):
return context.space_data.type == 'NODE_EDITOR' and context.space_data.tree_type == 'MCFG_N_Tree'
def draw(self, context):
layout = self.layout
wiki = layout.operator('wm.url_open', text = "Open addon wiki",icon='URL')
wiki.url = bl_info.get("doc_url")
layout.separator()
box = layout.box()
box.label(text="Node documentation")
op = box.operator('wm.url_open', text = "Open",icon='HELP')
if len(context.selected_nodes) != 1:
box.enabled = False
return
else:
doc_url = context.selected_nodes[0].doc_url
if doc_url == "":
box.enabled = False
return
else:
op.url = doc_url
# Replace node editor header to include custom operators
def draw_header(self,context):
if context.space_data.type == 'NODE_EDITOR' and context.space_data.tree_type == 'MCFG_N_Tree' and context.space_data.node_tree is not None:
layout = self.layout
layout.separator()
layout.operator('mcfg.validate', icon = 'CHECKMARK', text = "")
layout.prop(context.scene,"MCFG_SP_ExportDir",text = "")
layout.operator('mcfg.export', icon = 'EXPORT', text = "")
# Add addon related templates to the script templates menu
def draw_menu(self,context):
layout = self.layout
layout.separator()
layout.label(text="Arma 3 model config editor")
layout.menu("MCFG_MT_TemplatesNodeScript")
layout.menu("MCFG_MT_TemplatesSetupPresets")
# Original node editor header draw function
# orig_node_header = bpy.types.NODE_HT_header.draw
def draw_header_override(self,context): # THIS STILL NEEDS TO BE LOOKED INTO REGARDING ADDON CONFLICTS
from bl_ui.space_node import NODE_MT_editor_menus
if context.space_data.type != 'NODE_EDITOR' or context.space_data.tree_type != 'MCFG_N_Tree':
orig_node_header(self,context)
return
self.layout.template_header()
NODE_MT_editor_menus.draw_collapsible(context,self.layout)
self.layout.separator_spacer()
self.layout.template_ID(context.space_data,"node_tree",new="mcfg.newconfig",open="mcfg.import")
self.layout.separator_spacer()