Newer
Older
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
for ident, type, rna_name in shaders_input_nodes_props:
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
class NWSwitchShadersOutputSubmenu(Menu, NWBase):
bl_idname = "NODE_MT_nw_switch_shaders_output_submenu"
bl_label = "Output"
def draw(self, context):
layout = self.layout
for ident, type, rna_name in shaders_output_nodes_props:
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
class NWSwitchShadersShaderSubmenu(Menu, NWBase):
bl_idname = "NODE_MT_nw_switch_shaders_shader_submenu"
bl_label = "Shader"
def draw(self, context):
layout = self.layout
for ident, type, rna_name in shaders_shader_nodes_props:
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
class NWSwitchShadersTextureSubmenu(Menu, NWBase):
bl_idname = "NODE_MT_nw_switch_shaders_texture_submenu"
bl_label = "Texture"
def draw(self, context):
layout = self.layout
for ident, type, rna_name in shaders_texture_nodes_props:
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
class NWSwitchShadersColorSubmenu(Menu, NWBase):
bl_idname = "NODE_MT_nw_switch_shaders_color_submenu"
bl_label = "Color"
def draw(self, context):
layout = self.layout
for ident, type, rna_name in shaders_color_nodes_props:
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
class NWSwitchShadersVectorSubmenu(Menu, NWBase):
bl_idname = "NODE_MT_nw_switch_shaders_vector_submenu"
bl_label = "Vector"
def draw(self, context):
layout = self.layout
for ident, type, rna_name in shaders_vector_nodes_props:
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
class NWSwitchShadersConverterSubmenu(Menu, NWBase):
bl_idname = "NODE_MT_nw_switch_shaders_converter_submenu"
bl_label = "Converter"
def draw(self, context):
layout = self.layout
for ident, type, rna_name in shaders_converter_nodes_props:
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
class NWSwitchShadersLayoutSubmenu(Menu, NWBase):
bl_idname = "NODE_MT_nw_switch_shaders_layout_submenu"
bl_label = "Layout"
def draw(self, context):
layout = self.layout
for ident, type, rna_name in shaders_layout_nodes_props:
if type != 'FRAME':
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
class NWSwitchCompoInputSubmenu(Menu, NWBase):
bl_idname = "NODE_MT_nw_switch_compo_input_submenu"
bl_label = "Input"
def draw(self, context):
layout = self.layout
for ident, type, rna_name in compo_input_nodes_props:
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
class NWSwitchCompoOutputSubmenu(Menu, NWBase):
bl_idname = "NODE_MT_nw_switch_compo_output_submenu"
bl_label = "Output"
def draw(self, context):
layout = self.layout
for ident, type, rna_name in compo_output_nodes_props:
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
class NWSwitchCompoColorSubmenu(Menu, NWBase):
bl_idname = "NODE_MT_nw_switch_compo_color_submenu"
bl_label = "Color"
def draw(self, context):
layout = self.layout
for ident, type, rna_name in compo_color_nodes_props:
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
class NWSwitchCompoConverterSubmenu(Menu, NWBase):
bl_idname = "NODE_MT_nw_switch_compo_converter_submenu"
bl_label = "Converter"
def draw(self, context):
layout = self.layout
for ident, type, rna_name in compo_converter_nodes_props:
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
class NWSwitchCompoFilterSubmenu(Menu, NWBase):
bl_idname = "NODE_MT_nw_switch_compo_filter_submenu"
bl_label = "Filter"
def draw(self, context):
layout = self.layout
for ident, type, rna_name in compo_filter_nodes_props:
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
class NWSwitchCompoVectorSubmenu(Menu, NWBase):
bl_idname = "NODE_MT_nw_switch_compo_vector_submenu"
bl_label = "Vector"
def draw(self, context):
layout = self.layout
for ident, type, rna_name in compo_vector_nodes_props:
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
class NWSwitchCompoMatteSubmenu(Menu, NWBase):
bl_idname = "NODE_MT_nw_switch_compo_matte_submenu"
bl_label = "Matte"
def draw(self, context):
layout = self.layout
for ident, type, rna_name in compo_matte_nodes_props:
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
class NWSwitchCompoDistortSubmenu(Menu, NWBase):
bl_idname = "NODE_MT_nw_switch_compo_distort_submenu"
bl_label = "Distort"
def draw(self, context):
layout = self.layout
for ident, type, rna_name in compo_distort_nodes_props:
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
class NWSwitchCompoLayoutSubmenu(Menu, NWBase):
bl_idname = "NODE_MT_nw_switch_compo_layout_submenu"
bl_label = "Layout"
def draw(self, context):
layout = self.layout
for ident, type, rna_name in compo_layout_nodes_props:
if type != 'FRAME':
props = layout.operator(NWSwitchNodeType.bl_idname, text=rna_name)
props.to_type = ident
#
# APPENDAGES TO EXISTING UI
#
def select_parent_children_buttons(self, context):
layout = self.layout
layout.operator(NWSelectParentChildren.bl_idname, text="Select frame's members (children)").option = 'CHILD'
layout.operator(NWSelectParentChildren.bl_idname, text="Select parent frame").option = 'PARENT'
def attr_nodes_menu_func(self, context):
col = self.layout.column(align=True)
col.menu("NODE_MT_nw_node_uvs_menu")
col.menu("NODE_MT_nw_node_vertex_color_menu")
col.separator()
def bgreset_menu_func(self, context):
self.layout.operator(NWResetBG.bl_idname)
# REGISTER/UNREGISTER CLASSES AND KEYMAP ITEMS
# kmi_defs entry: (identifier, key, CTRL, SHIFT, ALT, props, nice name)
# props entry: (property name, property value)
kmi_defs = (
# MERGE NODES
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
# NWMergeNodes with Ctrl (AUTO).
(NWMergeNodes.bl_idname, 'NUMPAD_0', True, False, False,
(('mode', 'MIX'), ('merge_type', 'AUTO'),), "Merge Nodes (Automatic)"),
(NWMergeNodes.bl_idname, 'ZERO', True, False, False,
(('mode', 'MIX'), ('merge_type', 'AUTO'),), "Merge Nodes (Automatic)"),
(NWMergeNodes.bl_idname, 'NUMPAD_PLUS', True, False, False,
(('mode', 'ADD'), ('merge_type', 'AUTO'),), "Merge Nodes (Add)"),
(NWMergeNodes.bl_idname, 'EQUAL', True, False, False,
(('mode', 'ADD'), ('merge_type', 'AUTO'),), "Merge Nodes (Add)"),
(NWMergeNodes.bl_idname, 'NUMPAD_ASTERIX', True, False, False,
(('mode', 'MULTIPLY'), ('merge_type', 'AUTO'),), "Merge Nodes (Multiply)"),
(NWMergeNodes.bl_idname, 'EIGHT', True, False, False,
(('mode', 'MULTIPLY'), ('merge_type', 'AUTO'),), "Merge Nodes (Multiply)"),
(NWMergeNodes.bl_idname, 'NUMPAD_MINUS', True, False, False,
(('mode', 'SUBTRACT'), ('merge_type', 'AUTO'),), "Merge Nodes (Subtract)"),
(NWMergeNodes.bl_idname, 'MINUS', True, False, False,
(('mode', 'SUBTRACT'), ('merge_type', 'AUTO'),), "Merge Nodes (Subtract)"),
(NWMergeNodes.bl_idname, 'NUMPAD_SLASH', True, False, False,
(('mode', 'DIVIDE'), ('merge_type', 'AUTO'),), "Merge Nodes (Divide)"),
(NWMergeNodes.bl_idname, 'SLASH', True, False, False,
(('mode', 'DIVIDE'), ('merge_type', 'AUTO'),), "Merge Nodes (Divide)"),
(NWMergeNodes.bl_idname, 'COMMA', True, False, False,
(('mode', 'LESS_THAN'), ('merge_type', 'MATH'),), "Merge Nodes (Less than)"),
(NWMergeNodes.bl_idname, 'PERIOD', True, False, False,
(('mode', 'GREATER_THAN'), ('merge_type', 'MATH'),), "Merge Nodes (Greater than)"),
# NWMergeNodes with Ctrl Alt (MIX)
(NWMergeNodes.bl_idname, 'NUMPAD_0', True, False, True,
(('mode', 'MIX'), ('merge_type', 'MIX'),), "Merge Nodes (Color, Mix)"),
(NWMergeNodes.bl_idname, 'ZERO', True, False, True,
(('mode', 'MIX'), ('merge_type', 'MIX'),), "Merge Nodes (Color, Mix)"),
(NWMergeNodes.bl_idname, 'NUMPAD_PLUS', True, False, True,
(('mode', 'ADD'), ('merge_type', 'MIX'),), "Merge Nodes (Color, Add)"),
(NWMergeNodes.bl_idname, 'EQUAL', True, False, True,
(('mode', 'ADD'), ('merge_type', 'MIX'),), "Merge Nodes (Color, Add)"),
(NWMergeNodes.bl_idname, 'NUMPAD_ASTERIX', True, False, True,
(('mode', 'MULTIPLY'), ('merge_type', 'MIX'),), "Merge Nodes (Color, Multiply)"),
(NWMergeNodes.bl_idname, 'EIGHT', True, False, True,
(('mode', 'MULTIPLY'), ('merge_type', 'MIX'),), "Merge Nodes (Color, Multiply)"),
(NWMergeNodes.bl_idname, 'NUMPAD_MINUS', True, False, True,
(('mode', 'SUBTRACT'), ('merge_type', 'MIX'),), "Merge Nodes (Color, Subtract)"),
(NWMergeNodes.bl_idname, 'MINUS', True, False, True,
(('mode', 'SUBTRACT'), ('merge_type', 'MIX'),), "Merge Nodes (Color, Subtract)"),
(NWMergeNodes.bl_idname, 'NUMPAD_SLASH', True, False, True,
(('mode', 'DIVIDE'), ('merge_type', 'MIX'),), "Merge Nodes (Color, Divide)"),
(NWMergeNodes.bl_idname, 'SLASH', True, False, True,
(('mode', 'DIVIDE'), ('merge_type', 'MIX'),), "Merge Nodes (Color, Divide)"),
# NWMergeNodes with Ctrl Shift (MATH)
(NWMergeNodes.bl_idname, 'NUMPAD_PLUS', True, True, False,
(('mode', 'ADD'), ('merge_type', 'MATH'),), "Merge Nodes (Math, Add)"),
(NWMergeNodes.bl_idname, 'EQUAL', True, True, False,
(('mode', 'ADD'), ('merge_type', 'MATH'),), "Merge Nodes (Math, Add)"),
(NWMergeNodes.bl_idname, 'NUMPAD_ASTERIX', True, True, False,
(('mode', 'MULTIPLY'), ('merge_type', 'MATH'),), "Merge Nodes (Math, Multiply)"),
(NWMergeNodes.bl_idname, 'EIGHT', True, True, False,
(('mode', 'MULTIPLY'), ('merge_type', 'MATH'),), "Merge Nodes (Math, Multiply)"),
(NWMergeNodes.bl_idname, 'NUMPAD_MINUS', True, True, False,
(('mode', 'SUBTRACT'), ('merge_type', 'MATH'),), "Merge Nodes (Math, Subtract)"),
(NWMergeNodes.bl_idname, 'MINUS', True, True, False,
(('mode', 'SUBTRACT'), ('merge_type', 'MATH'),), "Merge Nodes (Math, Subtract)"),
(NWMergeNodes.bl_idname, 'NUMPAD_SLASH', True, True, False,
(('mode', 'DIVIDE'), ('merge_type', 'MATH'),), "Merge Nodes (Math, Divide)"),
(NWMergeNodes.bl_idname, 'SLASH', True, True, False,
(('mode', 'DIVIDE'), ('merge_type', 'MATH'),), "Merge Nodes (Math, Divide)"),
(NWMergeNodes.bl_idname, 'COMMA', True, True, False,
(('mode', 'LESS_THAN'), ('merge_type', 'MATH'),), "Merge Nodes (Math, Less than)"),
(NWMergeNodes.bl_idname, 'PERIOD', True, True, False,
(('mode', 'GREATER_THAN'), ('merge_type', 'MATH'),), "Merge Nodes (Math, Greater than)"),
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
# NWBatchChangeNodes with Alt
(NWBatchChangeNodes.bl_idname, 'NUMPAD_0', False, False, True,
(('blend_type', 'MIX'), ('operation', 'CURRENT'),), "Batch change blend type (Mix)"),
(NWBatchChangeNodes.bl_idname, 'ZERO', False, False, True,
(('blend_type', 'MIX'), ('operation', 'CURRENT'),), "Batch change blend type (Mix)"),
(NWBatchChangeNodes.bl_idname, 'NUMPAD_PLUS', False, False, True,
(('blend_type', 'ADD'), ('operation', 'ADD'),), "Batch change blend type (Add)"),
(NWBatchChangeNodes.bl_idname, 'EQUAL', False, False, True,
(('blend_type', 'ADD'), ('operation', 'ADD'),), "Batch change blend type (Add)"),
(NWBatchChangeNodes.bl_idname, 'NUMPAD_ASTERIX', False, False, True,
(('blend_type', 'MULTIPLY'), ('operation', 'MULTIPLY'),), "Batch change blend type (Multiply)"),
(NWBatchChangeNodes.bl_idname, 'EIGHT', False, False, True,
(('blend_type', 'MULTIPLY'), ('operation', 'MULTIPLY'),), "Batch change blend type (Multiply)"),
(NWBatchChangeNodes.bl_idname, 'NUMPAD_MINUS', False, False, True,
(('blend_type', 'SUBTRACT'), ('operation', 'SUBTRACT'),), "Batch change blend type (Subtract)"),
(NWBatchChangeNodes.bl_idname, 'MINUS', False, False, True,
(('blend_type', 'SUBTRACT'), ('operation', 'SUBTRACT'),), "Batch change blend type (Subtract)"),
(NWBatchChangeNodes.bl_idname, 'NUMPAD_SLASH', False, False, True,
(('blend_type', 'DIVIDE'), ('operation', 'DIVIDE'),), "Batch change blend type (Divide)"),
(NWBatchChangeNodes.bl_idname, 'SLASH', False, False, True,
(('blend_type', 'DIVIDE'), ('operation', 'DIVIDE'),), "Batch change blend type (Divide)"),
(NWBatchChangeNodes.bl_idname, 'COMMA', False, False, True,
(('blend_type', 'CURRENT'), ('operation', 'LESS_THAN'),), "Batch change blend type (Current)"),
(NWBatchChangeNodes.bl_idname, 'PERIOD', False, False, True,
(('blend_type', 'CURRENT'), ('operation', 'GREATER_THAN'),), "Batch change blend type (Current)"),
(NWBatchChangeNodes.bl_idname, 'DOWN_ARROW', False, False, True,
(('blend_type', 'NEXT'), ('operation', 'NEXT'),), "Batch change blend type (Next)"),
(NWBatchChangeNodes.bl_idname, 'UP_ARROW', False, False, True,
(('blend_type', 'PREV'), ('operation', 'PREV'),), "Batch change blend type (Previous)"),
# Don't use names, don't replace links (K)
(NWLinkActiveToSelected.bl_idname, 'K', False, False, False,
(('replace', False), ('use_node_name', False), ('use_outputs_names', False),), "Link active to selected (Don't replace links)"),
# Don't use names, replace links (Shift K)
(NWLinkActiveToSelected.bl_idname, 'K', False, True, False,
(('replace', True), ('use_node_name', False), ('use_outputs_names', False),), "Link active to selected (Replace links)"),
# Use node name, don't replace links (')
(NWLinkActiveToSelected.bl_idname, 'QUOTE', False, False, False,
(('replace', False), ('use_node_name', True), ('use_outputs_names', False),), "Link active to selected (Don't replace links, node names)"),
# Use node name, replace links (Shift ')
(NWLinkActiveToSelected.bl_idname, 'QUOTE', False, True, False,
(('replace', True), ('use_node_name', True), ('use_outputs_names', False),), "Link active to selected (Replace links, node names)"),
# Don't use names, don't replace links (;)
(NWLinkActiveToSelected.bl_idname, 'SEMI_COLON', False, False, False,
(('replace', False), ('use_node_name', False), ('use_outputs_names', True),), "Link active to selected (Don't replace links, output names)"),
# Don't use names, replace links (')
(NWLinkActiveToSelected.bl_idname, 'SEMI_COLON', False, True, False,
(('replace', True), ('use_node_name', False), ('use_outputs_names', True),), "Link active to selected (Replace links, output names)"),
(NWChangeMixFactor.bl_idname, 'LEFT_ARROW', False, False, True, (('option', -0.1),), "Reduce Mix Factor by 0.1"),
(NWChangeMixFactor.bl_idname, 'RIGHT_ARROW', False, False, True, (('option', 0.1),), "Increase Mix Factor by 0.1"),
(NWChangeMixFactor.bl_idname, 'LEFT_ARROW', False, True, True, (('option', -0.01),), "Reduce Mix Factor by 0.01"),
(NWChangeMixFactor.bl_idname, 'RIGHT_ARROW', False, True, True, (('option', 0.01),), "Increase Mix Factor by 0.01"),
(NWChangeMixFactor.bl_idname, 'LEFT_ARROW', True, True, True, (('option', 0.0),), "Set Mix Factor to 0.0"),
(NWChangeMixFactor.bl_idname, 'RIGHT_ARROW', True, True, True, (('option', 1.0),), "Set Mix Factor to 1.0"),
(NWChangeMixFactor.bl_idname, 'NUMPAD_0', True, True, True, (('option', 0.0),), "Set Mix Factor to 0.0"),
(NWChangeMixFactor.bl_idname, 'ZERO', True, True, True, (('option', 0.0),), "Set Mix Factor to 0.0"),
(NWChangeMixFactor.bl_idname, 'NUMPAD_1', True, True, True, (('option', 1.0),), "Mix Factor to 1.0"),
(NWChangeMixFactor.bl_idname, 'ONE', True, True, True, (('option', 1.0),), "Set Mix Factor to 1.0"),
(NWClearLabel.bl_idname, 'L', False, False, True, (('option', False),), "Clear node labels"),
# MODIFY LABEL (Alt Shift L)
(NWModifyLabels.bl_idname, 'L', False, True, True, None, "Modify node labels"),
# Copy Label from active to selected
(NWCopyLabel.bl_idname, 'V', False, True, False, (('option', 'FROM_ACTIVE'),), "Copy label from active to selected"),
(NWDetachOutputs.bl_idname, 'D', False, True, True, None, "Detach outputs"),
(NWLinkToOutputNode.bl_idname, 'O', False, False, False, None, "Link to output node"),
# SELECT PARENT/CHILDREN
# Select Children
(NWSelectParentChildren.bl_idname, 'RIGHT_BRACKET', False, False, False, (('option', 'CHILD'),), "Select children"),
(NWSelectParentChildren.bl_idname, 'LEFT_BRACKET', False, False, False, (('option', 'PARENT'),), "Select Parent"),
Bartek Skorupa
committed
# Add Texture Setup
(NWAddTextureSetup.bl_idname, 'T', True, False, False, None, "Add texture setup"),
# Reset backdrop
(NWResetBG.bl_idname, 'Z', False, False, False, None, "Reset backdrop image zoom"),
# Delete unused
(NWDeleteUnused.bl_idname, 'X', False, False, True, None, "Delete unused nodes"),
# Frame Seleted
(NWFrameSelected.bl_idname, 'P', False, True, False, None, "Frame selected nodes"),
# Swap Outputs
(NWSwapOutputs.bl_idname, 'S', False, False, True, None, "Swap Outputs"),
# Emission Viewer
(NWEmissionViewer.bl_idname, 'LEFTMOUSE', True, True, False, None, "Connect to Cycles Viewer node"),
# Reload Images
(NWReloadImages.bl_idname, 'R', False, False, True, None, "Reload images"),
# Lazy Mix
(NWLazyMix.bl_idname, 'RIGHTMOUSE', False, False, True, None, "Lazy Mix"),
# Lazy Connect
(NWLazyConnect.bl_idname, 'RIGHTMOUSE', True, False, False, None, "Lazy Connect"),
# Lazy Connect with Menu
(NWLazyConnect.bl_idname, 'RIGHTMOUSE', True, True, False, (('with_menu', True),), "Lazy Connect with Socket Menu"),
('wm.call_menu', 'SPACE', True, False, False, (('name', NodeWranglerMenu.bl_idname),), "Node Wranger menu"),
('wm.call_menu', 'SLASH', False, False, False, (('name', NWAddReroutesMenu.bl_idname),), "Add Reroutes menu"),
('wm.call_menu', 'NUMPAD_SLASH', False, False, False, (('name', NWAddReroutesMenu.bl_idname),), "Add Reroutes menu"),
('wm.call_menu', 'EQUAL', False, True, False, (('name', NWNodeAlignMenu.bl_idname),), "Node alignment menu"),
('wm.call_menu', 'BACK_SLASH', False, False, False, (('name', NWLinkActiveToSelectedMenu.bl_idname),), "Link active to selected (menu)"),
('wm.call_menu', 'C', False, True, False, (('name', NWCopyToSelectedMenu.bl_idname),), "Copy to selected (menu)"),
('wm.call_menu', 'S', False, True, False, (('name', NWSwitchNodeTypeMenu.bl_idname),), "Switch node type menu"),
)
# props
bpy.types.Scene.NWBusyDrawing = StringProperty(
name="Busy Drawing!",
default="",
description="An internal property used to store only the first mouse position")
bpy.types.Scene.NWLazySource = StringProperty(
name="Lazy Source!",
default="x",
description="An internal property used to store the first node in a Lazy Connect operation")
bpy.types.Scene.NWLazyTarget = StringProperty(
name="Lazy Target!",
default="x",
description="An internal property used to store the last node in a Lazy Connect operation")
bpy.types.Scene.NWSourceSocket = IntProperty(
name="Source Socket!",
default=0,
description="An internal property used to store the source socket in a Lazy Connect operation")
bpy.utils.register_module(__name__)
# keymaps
km = bpy.context.window_manager.keyconfigs.addon.keymaps.new(name='Node Editor', space_type="NODE_EDITOR")
for (identifier, key, CTRL, SHIFT, ALT, props, nicename) in kmi_defs:
kmi = km.keymap_items.new(identifier, key, 'PRESS', ctrl=CTRL, shift=SHIFT, alt=ALT)
if props:
for prop, value in props:
setattr(kmi.properties, prop, value)
addon_keymaps.append((km, kmi))
# menu items
bpy.types.NODE_MT_select.append(select_parent_children_buttons)
bpy.types.NODE_MT_category_SH_NEW_INPUT.prepend(attr_nodes_menu_func)
bpy.types.NODE_PT_category_SH_NEW_INPUT.prepend(attr_nodes_menu_func)
bpy.types.NODE_PT_backdrop.append(bgreset_menu_func)
def unregister():
# props
del bpy.types.Scene.NWBusyDrawing
del bpy.types.Scene.NWLazySource
del bpy.types.Scene.NWLazyTarget
del bpy.types.Scene.NWSourceSocket
bpy.utils.unregister_module(__name__)
# keymaps
for km, kmi in addon_keymaps:
km.keymap_items.remove(kmi)
addon_keymaps.clear()
# menuitems
bpy.types.NODE_MT_select.remove(select_parent_children_buttons)
bpy.types.NODE_MT_category_SH_NEW_INPUT.remove(attr_nodes_menu_func)
bpy.types.NODE_PT_category_SH_NEW_INPUT.remove(attr_nodes_menu_func)
bpy.types.NODE_PT_backdrop.remove(bgreset_menu_func)
if __name__ == "__main__":
register()