diff options
22 files changed, 148 insertions, 120 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/utils_languages_menu.py b/release/scripts/modules/bl_i18n_utils/utils_languages_menu.py index 789b1315659..24255d9be61 100755 --- a/release/scripts/modules/bl_i18n_utils/utils_languages_menu.py +++ b/release/scripts/modules/bl_i18n_utils/utils_languages_menu.py @@ -35,6 +35,7 @@ FLAG_MESSAGES = { FORBIDDEN: "Explicitly forbidden!", } + def gen_menu_file(stats, settings): # Generate languages file used by Blender's i18n system. # First, match all entries in LANGUAGES to a lang in stats, if possible! diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py index ec3891e8d76..ab35d774719 100644 --- a/release/scripts/modules/bpy/utils.py +++ b/release/scripts/modules/bpy/utils.py @@ -507,7 +507,8 @@ def keyconfig_set(filepath, report=None): report({'ERROR'}, error_msg) print(error_msg) - kc_new = next(chain(iter(kc for kc in keyconfigs if kc not in keyconfigs_old), (None,))) + kc_new = next(chain(iter(kc for kc in keyconfigs + if kc not in keyconfigs_old), (None,))) if kc_new is None: if report is not None: report({'ERROR'}, "Failed to load keymap %r" % filepath) diff --git a/release/scripts/modules/console/complete_namespace.py b/release/scripts/modules/console/complete_namespace.py index 31e4f3cf225..74406d5e002 100644 --- a/release/scripts/modules/console/complete_namespace.py +++ b/release/scripts/modules/console/complete_namespace.py @@ -110,7 +110,7 @@ def complete_indices(word, namespace, obj=None, base=None): # dictionary type matches = ['%s[%r]' % (base, key) for key in sorted(obj.keys())] else: - # list type, + # list type matches = ['%s[%d]' % (base, idx) for idx in range(obj_len)] if word != base: matches = [match for match in matches if match.startswith(word)] diff --git a/release/scripts/modules/nodeitems_utils.py b/release/scripts/modules/nodeitems_utils.py index 2114a64e416..7418452b039 100644 --- a/release/scripts/modules/nodeitems_utils.py +++ b/release/scripts/modules/nodeitems_utils.py @@ -42,6 +42,7 @@ class NodeCategory(): yield item self.items = items_gen + class NodeItem(): def __init__(self, nodetype, label=None, settings={}, poll=None): self.nodetype = nodetype @@ -81,6 +82,7 @@ class NodeItemCustom(): _node_categories = {} + def register_node_categories(identifier, cat_list): if identifier in _node_categories: raise KeyError("Node categories list '%s' already registered" % identifier) @@ -97,21 +99,21 @@ def register_node_categories(identifier, cat_list): menu_types = [] panel_types = [] for cat in cat_list: - menu_type = type("NODE_MT_category_"+cat.identifier, (bpy.types.Menu,), { - "bl_space_type" : 'NODE_EDITOR', - "bl_label" : cat.name, - "category" : cat, - "poll" : cat.poll, - "draw" : draw_node_item, + menu_type = type("NODE_MT_category_" + cat.identifier, (bpy.types.Menu,), { + "bl_space_type": 'NODE_EDITOR', + "bl_label": cat.name, + "category": cat, + "poll": cat.poll, + "draw": draw_node_item, }) - panel_type = type("NODE_PT_category_"+cat.identifier, (bpy.types.Panel,), { - "bl_space_type" : 'NODE_EDITOR', - "bl_region_type" : 'TOOLS', - "bl_label" : cat.name, - "bl_options" : {'DEFAULT_CLOSED'}, - "category" : cat, - "poll" : cat.poll, - "draw" : draw_node_item, + panel_type = type("NODE_PT_category_" + cat.identifier, (bpy.types.Panel,), { + "bl_space_type": 'NODE_EDITOR', + "bl_region_type": 'TOOLS', + "bl_label": cat.name, + "bl_options": {'DEFAULT_CLOSED'}, + "category": cat, + "poll": cat.poll, + "draw": draw_node_item, }) menu_types.append(menu_type) @@ -166,4 +168,3 @@ def unregister_node_categories(identifier=None): for cat_types in _node_categories.values(): unregister_node_cat_types(cat_types) _node_categories.clear() - diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py index 943eed74b1d..ed20cb22297 100644 --- a/release/scripts/startup/bl_operators/anim.py +++ b/release/scripts/startup/bl_operators/anim.py @@ -261,8 +261,8 @@ class ClearUselessActions(Operator): for action in bpy.data.actions: # if only user is "fake" user... - if ((self.only_unused is False) or - (action.use_fake_user and action.users == 1)): + if ((self.only_unused is False) or + (action.use_fake_user and action.users == 1)): # if it has F-Curves, then it's a "action library" # (i.e. walk, wave, jump, etc.) diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py index c9ce38e1c6f..a28c9bafe49 100644 --- a/release/scripts/startup/bl_operators/node.py +++ b/release/scripts/startup/bl_operators/node.py @@ -18,9 +18,17 @@ # <pep8-80 compliant> -import bpy, nodeitems_utils -from bpy.types import Operator, PropertyGroup -from bpy.props import BoolProperty, CollectionProperty, EnumProperty, IntProperty, StringProperty +import bpy +import nodeitems_utils +from bpy.types import (Operator, + PropertyGroup, + ) +from bpy.props import (BoolProperty, + CollectionProperty, + EnumProperty, + IntProperty, + StringProperty, + ) class NodeSetting(PropertyGroup): @@ -30,6 +38,7 @@ class NodeSetting(PropertyGroup): default="", ) + # Base class for node 'Add' operators class NodeAddOperator(): @@ -80,12 +89,12 @@ class NodeAddOperator(): for setting in self.settings: # XXX catch exceptions here? value = eval(setting.value) - + try: setattr(node, setting.name, value) except AttributeError as e: - self.report({'ERROR_INVALID_INPUT'}, "Node has no attribute "+setting.name) - print (str(e)) + self.report({'ERROR_INVALID_INPUT'}, "Node has no attribute " + setting.name) + print(str(e)) # Continue despite invalid attribute if space.use_hidden_preview: @@ -198,7 +207,7 @@ class NODE_OT_add_search(NodeAddOperator, Operator): # no need to keep self._enum_item_hack.clear() - + if item: # apply settings from the node item for setting in item.settings.items(): diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index ed0943ac2e0..05dfd882180 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -30,7 +30,9 @@ class AddPresetBase(): - preset_subdir """ # bl_idname = "script.preset_base_add" # bl_label = "Add a Python Preset" - bl_options = {'REGISTER', 'INTERNAL'} # only because invoke_props_popup requires. Also do not add to search menu. + + # only because invoke_props_popup requires. Also do not add to search menu. + bl_options = {'REGISTER', 'INTERNAL'} name = StringProperty( name="Name", diff --git a/release/scripts/startup/bl_operators/vertexpaint_dirt.py b/release/scripts/startup/bl_operators/vertexpaint_dirt.py index fbca4e1ac73..345d8d4d3a1 100644 --- a/release/scripts/startup/bl_operators/vertexpaint_dirt.py +++ b/release/scripts/startup/bl_operators/vertexpaint_dirt.py @@ -23,6 +23,7 @@ # Contributor(s): Keith "Wahooney" Boshoff, Campbell Barton + def applyVertexDirt(me, blur_iterations, blur_strength, clamp_dirt, clamp_clean, dirt_only): from mathutils import Vector from math import acos diff --git a/release/scripts/startup/bl_operators/view3d.py b/release/scripts/startup/bl_operators/view3d.py index cfdb5dbe677..e0b5526e220 100644 --- a/release/scripts/startup/bl_operators/view3d.py +++ b/release/scripts/startup/bl_operators/view3d.py @@ -138,7 +138,7 @@ class VIEW3D_OT_select_or_deselect_all(Operator): x = event.mouse_region_x y = event.mouse_region_y - if self.extend == False and self.toggle == False and self.deselect == False: + if self.extend is False and self.toggle is False and self.deselect is False: active_object = context.active_object if active_object: diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index fba7672e846..5cb7a44267a 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -1180,6 +1180,7 @@ class WM_OT_keyconfig_activate(Operator): else: return {'CANCELLED'} + class WM_OT_appconfig_default(Operator): bl_idname = "wm.appconfig_default" bl_label = "Default Application Configuration" @@ -1574,8 +1575,9 @@ class WM_OT_addon_enable(Operator): def execute(self, context): import addon_utils - + err_str = "" + def err_cb(): import traceback nonlocal err_str @@ -1618,6 +1620,7 @@ class WM_OT_addon_disable(Operator): import addon_utils err_str = "" + def err_cb(): import traceback nonlocal err_str diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 6f4ffbf3616..89e90618383 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -120,7 +120,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): def BEVEL(self, layout, ob, md): split = layout.split() - + col = split.column() col.prop(md, "width") col.prop(md, "segments") @@ -982,26 +982,26 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): def VERTEX_WEIGHT_EDIT(self, layout, ob, md): split = layout.split() - + col = split.column() col.label(text="Vertex Group:") col.prop_search(md, "vertex_group", ob, "vertex_groups", text="") col.label(text="Default Weight:") col.prop(md, "default_weight", text="") - + col = split.column() col.prop(md, "use_add") sub = col.column() sub.active = md.use_add sub.prop(md, "add_threshold") - + col = col.column() col.prop(md, "use_remove") sub = col.column() sub.active = md.use_remove sub.prop(md, "remove_threshold") - + layout.separator() layout.prop(md, "falloff_type") @@ -1047,20 +1047,20 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col = split.column() col.label(text="Target Object:") col.prop(md, "target", text="") - + split = layout.split() - + col = split.column() col.label(text="Distance:") col.prop(md, "proximity_mode", text="") if md.proximity_mode == 'GEOMETRY': col.row().prop(md, "proximity_geometry") - + col = split.column() col.label() col.prop(md, "min_dist") col.prop(md, "max_dist") - + layout.separator() layout.prop(md, "falloff_type") @@ -1070,25 +1070,25 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): def SKIN(self, layout, ob, md): layout.operator("object.skin_armature_create", text="Create Armature") - + layout.separator() - + col = layout.column(align=True) col.prop(md, "branch_smoothing") col.prop(md, "use_smooth_shade") - + split = layout.split() - + col = split.column() col.label(text="Selected Vertices:") sub = col.column(align=True) sub.operator("object.skin_loose_mark_clear", text="Mark Loose").action = 'MARK' sub.operator("object.skin_loose_mark_clear", text="Clear Loose").action = 'CLEAR' - + sub = col.column() sub.operator("object.skin_root_mark", text="Mark Root") sub.operator("object.skin_radii_equalize", text="Equalize Radii") - + col = split.column() col.label(text="Symmetry Axes:") col.prop(md, "use_x_symmetry") diff --git a/release/scripts/startup/bl_ui/properties_freestyle.py b/release/scripts/startup/bl_ui/properties_freestyle.py index 96321eded50..eec753e1d04 100644 --- a/release/scripts/startup/bl_ui/properties_freestyle.py +++ b/release/scripts/startup/bl_ui/properties_freestyle.py @@ -47,7 +47,7 @@ class RENDER_PT_freestyle(RenderFreestyleButtonsPanel, Panel): def draw(self, context): layout = self.layout - + rd = context.scene.render layout.active = rd.use_freestyle @@ -55,7 +55,7 @@ class RENDER_PT_freestyle(RenderFreestyleButtonsPanel, Panel): row = layout.row() row.label(text="Line Thickness:") row.prop(rd, "line_thickness_mode", expand=True) - + if (rd.line_thickness_mode == 'ABSOLUTE'): layout.prop(rd, "line_thickness") @@ -65,7 +65,7 @@ class RENDER_PT_freestyle(RenderFreestyleButtonsPanel, Panel): # Render layer properties - + class RenderLayerFreestyleButtonsPanel(): bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' @@ -77,7 +77,7 @@ class RenderLayerFreestyleButtonsPanel(): scene = context.scene rd = context.scene.render with_freestyle = bpy.app.build_options.freestyle - + return (scene and with_freestyle and rd.use_freestyle and rd.layers.active and(scene.render.engine in cls.COMPAT_ENGINES)) @@ -119,28 +119,28 @@ class RENDERLAYER_PT_freestyle(RenderLayerFreestyleButtonsPanel, Panel): def draw(self, context): layout = self.layout - + rd = context.scene.render rl = rd.layers.active freestyle = rl.freestyle_settings layout.active = rl.use_freestyle - + layout.prop(freestyle, "mode", text="Control mode") layout.label(text="Edge Detection Options:") - + split = layout.split() - + col = split.column() col.prop(freestyle, "crease_angle") col.prop(freestyle, "use_culling") col.prop(freestyle, "use_advanced_options") - + col = split.column() col.prop(freestyle, "use_smoothness") if freestyle.mode == 'SCRIPT': col.prop(freestyle, "use_material_boundaries") - + # Advanced options are hidden by default to warn new users if freestyle.use_advanced_options: if freestyle.mode == 'SCRIPT': @@ -184,7 +184,7 @@ class RENDERLAYER_PT_freestyle_lineset(RenderLayerFreestyleEditorButtonsPanel, P def draw(self, context): layout = self.layout - + rd = context.scene.render rl = rd.layers.active freestyle = rl.freestyle_settings @@ -233,14 +233,14 @@ class RENDERLAYER_PT_freestyle_lineset(RenderLayerFreestyleEditorButtonsPanel, P row.prop(lineset, "edge_type_combination", expand=True) split = col.split() - + sub = split.column() self.draw_edge_type_buttons(sub, lineset, "silhouette") self.draw_edge_type_buttons(sub, lineset, "border") self.draw_edge_type_buttons(sub, lineset, "contour") self.draw_edge_type_buttons(sub, lineset, "suggestive_contour") self.draw_edge_type_buttons(sub, lineset, "ridge_valley") - + sub = split.column() self.draw_edge_type_buttons(sub, lineset, "crease") self.draw_edge_type_buttons(sub, lineset, "edge_mark") @@ -518,7 +518,7 @@ class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel, def draw(self, context): layout = self.layout - + rd = context.scene.render rl = rd.layers.active lineset = rl.freestyle_settings.linesets.active diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index 48cfb6f816a..38e49853454 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -643,7 +643,7 @@ class WORLD_PT_game_physics(WorldButtonsPanel, Panel): sub.prop(gs, "deactivation_angular_threshold", text="Angular Threshold") sub = col.row() sub.prop(gs, "deactivation_time", text="Time") - + col = layout.column() col.prop(gs, "use_occlusion_culling", text="Occlusion Culling") sub = col.column() diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py index 1392d21cf15..1fc61b7714e 100644 --- a/release/scripts/startup/bl_ui/properties_physics_fluid.py +++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py @@ -67,10 +67,10 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel): # odd formatting here so translation script can extract string layout.operator("fluid.bake", text=iface_("Bake (Req. Memory: %s)") % fluid.memory_estimate, translate=False, icon='MOD_FLUIDSIM') - + if bpy.app.build_options.openmp: layout.prop(fluid, "threads", text="Simulation Threads") - + split = layout.split() col = split.column() diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index 904667eb976..799c109ae0c 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -78,6 +78,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel): _frame_rate_args_prev = None _preset_class = None + @staticmethod def _draw_framerate_label(*args): # avoids re-creating text string each draw @@ -85,7 +86,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel): return RENDER_PT_dimensions._frame_rate_ret fps, fps_base, preset_label = args - + if fps_base == 1.0: fps_rate = round(fps) else: diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index 46ffe6bb68a..5048a93d565 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -336,7 +336,8 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel): col.prop(settings, "use_keyframe_selection") col = layout.column(align=True) - col.active = not settings.use_tripod_solver and not settings.use_keyframe_selection + col.active = (not settings.use_tripod_solver and + not settings.use_keyframe_selection) col.prop(tracking_object, "keyframe_a") col.prop(tracking_object, "keyframe_b") @@ -408,7 +409,7 @@ class CLIP_PT_tools_orientation(CLIP_PT_reconstruction_panel, Panel): layout.separator() col = layout.column() - row = col.row(align=True); + row = col.row(align=True) row.operator("clip.set_scale") row.operator("clip.apply_solution_scale", text="Apply Scale") col.prop(settings, "distance") diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index fd0f6dbc6fd..eb0d9c5082d 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -756,7 +756,6 @@ class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel): sub.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA') - class IMAGE_PT_tools_mask_texture(BrushButtonsPanel, Panel): bl_label = "Texture Mask" bl_options = {'DEFAULT_CLOSED'} @@ -783,7 +782,7 @@ class IMAGE_PT_tools_mask_texture(BrushButtonsPanel, Panel): row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF') else: row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON') - + sub = row.row() sub.prop(brush, "mask_overlay_alpha", text="Alpha") sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA') @@ -901,7 +900,7 @@ class IMAGE_PT_tools_brush_appearance(BrushButtonsPanel, Panel): return col = layout.column() - col.prop(toolsettings, "show_brush"); + col.prop(toolsettings, "show_brush") col = col.column() col.prop(brush, "cursor_color_add", text="") diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 91eeb3d07b4..da41f9c6bef 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -131,7 +131,7 @@ class NODE_MT_view(Menu): layout.operator("node.properties", icon='MENU_PANEL') layout.operator("node.toolbar", icon='MENU_PANEL') - + layout.separator() layout.operator("view2d.zoom_in") diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 7cd8cb8fb7c..54387f10a8d 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -1171,12 +1171,12 @@ class USERPREF_PT_addons(Panel): continue # check if addon should be visible with current filters - if ((filter == "All") or - (filter == info["category"]) or - (filter == "Enabled" and is_enabled) or - (filter == "Disabled" and not is_enabled) or - (filter == "User" and (mod.__file__.startswith((scripts_addons_folder, userpref_addons_folder)))) - ): + if ((filter == "All") or + (filter == info["category"]) or + (filter == "Enabled" and is_enabled) or + (filter == "Disabled" and not is_enabled) or + (filter == "User" and (mod.__file__.startswith((scripts_addons_folder, userpref_addons_folder)))) + ): if search and search not in info["name"].lower(): if info["author"]: diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 3dedfac103a..5e2095354e7 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -238,8 +238,10 @@ class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base): layout.separator() obj = context.object - if (obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and - obj.data.draw_type in {'BBONE', 'ENVELOPE'}): + if (obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and + obj.data.draw_type in {'BBONE', 'ENVELOPE'} + ): + layout.operator("transform.transform", text="Scale Envelope/BBone").mode = 'BONE_SIZE' if context.edit_object and context.edit_object.type == 'ARMATURE': @@ -989,7 +991,7 @@ class VIEW3D_MT_object_specials(Menu): props.data_path_item = "data.size_y" props.header_text = "Lamp Size Y: %.3f" - elif lamp.type in {'SPOT', 'POINT', 'SUN'}: + elif lamp.type in {'SPOT', 'POINT', 'SUN'}: props = layout.operator("wm.context_modal_mouse", text="Size") props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.shadow_soft_size" diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index a892a91d505..7bc6d476a4b 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -563,7 +563,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): row = col.row(align=True) ups = toolsettings.unified_paint_settings - if ((ups.use_unified_size and ups.use_locked_size) or + if ((ups.use_unified_size and ups.use_locked_size) or ((not ups.use_unified_size) and brush.use_locked_size)): self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED') self.prop_unified_size(row, context, brush, "unprojected_radius", slider=True, text="Radius") @@ -681,7 +681,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF') else: row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON') - + sub = row.row() sub.prop(brush, "cursor_overlay_alpha", text="Alpha") sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA') @@ -714,17 +714,16 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): col = layout.column(align=True) col.label(text="Overlay:") - row = col.row() + row = col.row() if brush.use_cursor_overlay: row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF') else: row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON') - + sub = row.row() sub.prop(brush, "cursor_overlay_alpha", text="Alpha") sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA') - # Weight Paint Mode # elif context.weight_paint_object and brush: layout.prop(toolsettings, "use_auto_normalize", text="Auto Normalize") @@ -776,7 +775,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF') else: row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON') - + sub = row.row() sub.prop(brush, "cursor_overlay_alpha", text="Alpha") sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA') @@ -816,7 +815,7 @@ class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel): row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF') else: row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON') - + sub = row.row() sub.prop(brush, "texture_overlay_alpha", text="Alpha") sub.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA') @@ -843,7 +842,7 @@ class VIEW3D_PT_tools_mask_texture(View3DPanel, Panel): col.template_ID_preview(brush, "mask_texture", new="texture.new", rows=3, cols=8) brush_mask_texture_settings(col, brush) - + col = layout.column(align=True) col.active = brush.brush_capabilities.has_overlay col.label(text="Overlay:") @@ -854,7 +853,7 @@ class VIEW3D_PT_tools_mask_texture(View3DPanel, Panel): row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF') else: row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON') - + sub = row.row() sub.prop(brush, "mask_overlay_alpha", text="Alpha") sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA') @@ -1083,7 +1082,7 @@ class VIEW3D_PT_tools_brush_appearance(Panel, View3DPaintPanel): return col = layout.column() - col.prop(settings, "show_brush"); + col.prop(settings, "show_brush") col = col.column() col.active = settings.show_brush diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index fe9e06301f3..af966fa106e 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -27,19 +27,22 @@ from nodeitems_utils import NodeCategory, NodeItem, NodeItemCustom class CompositorNodeCategory(NodeCategory): @classmethod def poll(cls, context): - return context.space_data.tree_type == 'CompositorNodeTree' + return (context.space_data.tree_type == 'CompositorNodeTree') + class ShaderNewNodeCategory(NodeCategory): @classmethod def poll(cls, context): - return context.space_data.tree_type == 'ShaderNodeTree' and \ - context.scene.render.use_shading_nodes + return (context.space_data.tree_type == 'ShaderNodeTree' and + context.scene.render.use_shading_nodes) + class ShaderOldNodeCategory(NodeCategory): @classmethod def poll(cls, context): - return context.space_data.tree_type == 'ShaderNodeTree' and \ - not context.scene.render.use_shading_nodes + return (context.space_data.tree_type == 'ShaderNodeTree' and + not context.scene.render.use_shading_nodes) + class TextureNodeCategory(NodeCategory): @classmethod @@ -54,10 +57,12 @@ def group_make_draw(self, layout, context): # maps node tree type to group node type node_tree_group_type = { - 'CompositorNodeTree' : 'CompositorNodeGroup', - 'ShaderNodeTree' : 'ShaderNodeGroup', - 'TextureNodeTree' : 'TextureNodeGroup', + 'CompositorNodeTree': 'CompositorNodeGroup', + 'ShaderNodeTree': 'ShaderNodeGroup', + 'TextureNodeTree': 'TextureNodeGroup', } + + # generic node group items generator for shader, compositor and texture node groups def node_group_items(context): space = context.space_data @@ -86,7 +91,10 @@ def node_group_items(context): if contains_group(group, ntree): continue - yield NodeItem(node_tree_group_type[group.bl_idname], group.name, { "node_tree" : "bpy.data.node_groups[%r]" % group.name }) + yield NodeItem(node_tree_group_type[group.bl_idname], + group.name, + {"node_tree": "bpy.data.node_groups[%r]" % group.name}) + # only show input/output nodes inside node groups def group_input_output_item_poll(context): @@ -231,8 +239,8 @@ shader_node_categories = [ ] compositor_node_categories = [ - # Compositor Nodes - CompositorNodeCategory("CMP_INPUT", "Input", items = [ + # Compositor Nodes + CompositorNodeCategory("CMP_INPUT", "Input", items=[ NodeItem("CompositorNodeRLayers"), NodeItem("CompositorNodeImage"), NodeItem("CompositorNodeMovieClip"), @@ -245,7 +253,7 @@ compositor_node_categories = [ NodeItem("CompositorNodeTrackPos"), NodeItem("NodeGroupInput", poll=group_input_output_item_poll), ]), - CompositorNodeCategory("CMP_OUTPUT", "Output", items = [ + CompositorNodeCategory("CMP_OUTPUT", "Output", items=[ NodeItem("CompositorNodeComposite"), NodeItem("CompositorNodeViewer"), NodeItem("CompositorNodeSplitViewer"), @@ -253,7 +261,7 @@ compositor_node_categories = [ NodeItem("CompositorNodeLevels"), NodeItem("NodeGroupOutput", poll=group_input_output_item_poll), ]), - CompositorNodeCategory("CMP_OP_COLOR", "Color", items = [ + CompositorNodeCategory("CMP_OP_COLOR", "Color", items=[ NodeItem("CompositorNodeMixRGB"), NodeItem("CompositorNodeAlphaOver"), NodeItem("CompositorNodeInvert"), @@ -267,7 +275,7 @@ compositor_node_categories = [ NodeItem("CompositorNodeTonemap"), NodeItem("CompositorNodeZcombine"), ]), - CompositorNodeCategory("CMP_CONVERTOR", "Converter", items = [ + CompositorNodeCategory("CMP_CONVERTOR", "Converter", items=[ NodeItem("CompositorNodeMath"), NodeItem("CompositorNodeValToRGB"), NodeItem("CompositorNodeSetAlpha"), @@ -283,7 +291,7 @@ compositor_node_categories = [ NodeItem("CompositorNodeSepYCCA"), NodeItem("CompositorNodeCombYCCA"), ]), - CompositorNodeCategory("CMP_OP_FILTER", "Filter", items = [ + CompositorNodeCategory("CMP_OP_FILTER", "Filter", items=[ NodeItem("CompositorNodeBlur"), NodeItem("CompositorNodeBilateralblur"), NodeItem("CompositorNodeDilateErode"), @@ -297,14 +305,14 @@ compositor_node_categories = [ NodeItem("CompositorNodeDBlur"), NodeItem("CompositorNodePixelate"), ]), - CompositorNodeCategory("CMP_OP_VECTOR", "Vector", items = [ + CompositorNodeCategory("CMP_OP_VECTOR", "Vector", items=[ NodeItem("CompositorNodeNormal"), NodeItem("CompositorNodeMapValue"), NodeItem("CompositorNodeMapRange"), NodeItem("CompositorNodeNormalize"), NodeItem("CompositorNodeCurveVec"), ]), - CompositorNodeCategory("CMP_MATTE", "Matte", items = [ + CompositorNodeCategory("CMP_MATTE", "Matte", items=[ NodeItem("CompositorNodeKeying"), NodeItem("CompositorNodeKeyingScreen"), NodeItem("CompositorNodeChannelMatte"), @@ -318,7 +326,7 @@ compositor_node_categories = [ NodeItem("CompositorNodeColorMatte"), NodeItem("CompositorNodeDoubleEdgeMask"), ]), - CompositorNodeCategory("CMP_DISTORT", "Distort", items = [ + CompositorNodeCategory("CMP_DISTORT", "Distort", items=[ NodeItem("CompositorNodeScale"), NodeItem("CompositorNodeLensdist"), NodeItem("CompositorNodeMovieDistortion"), @@ -332,7 +340,7 @@ compositor_node_categories = [ NodeItem("CompositorNodeStabilize"), ]), CompositorNodeCategory("CMP_GROUP", "Group", items=node_group_items), - CompositorNodeCategory("CMP_LAYOUT", "Layout", items = [ + CompositorNodeCategory("CMP_LAYOUT", "Layout", items=[ NodeItem("NodeFrame"), NodeItem("NodeReroute"), NodeItem("CompositorNodeSwitch"), @@ -341,19 +349,19 @@ compositor_node_categories = [ texture_node_categories = [ # Texture Nodes - TextureNodeCategory("TEX_INPUT", "Input", items = [ + TextureNodeCategory("TEX_INPUT", "Input", items=[ NodeItem("TextureNodeCurveTime"), NodeItem("TextureNodeCoordinates"), NodeItem("TextureNodeTexture"), NodeItem("TextureNodeImage"), NodeItem("NodeGroupInput", poll=group_input_output_item_poll), ]), - TextureNodeCategory("TEX_OUTPUT", "Output", items = [ + TextureNodeCategory("TEX_OUTPUT", "Output", items=[ NodeItem("TextureNodeOutput"), NodeItem("TextureNodeViewer"), NodeItem("NodeGroupOutput", poll=group_input_output_item_poll), ]), - TextureNodeCategory("TEX_OP_COLOR", "Color", items = [ + TextureNodeCategory("TEX_OP_COLOR", "Color", items=[ NodeItem("TextureNodeMixRGB"), NodeItem("TextureNodeCurveRGB"), NodeItem("TextureNodeInvert"), @@ -361,11 +369,11 @@ texture_node_categories = [ NodeItem("TextureNodeCompose"), NodeItem("TextureNodeDecompose"), ]), - TextureNodeCategory("TEX_PATTERN", "Pattern", items = [ + TextureNodeCategory("TEX_PATTERN", "Pattern", items=[ NodeItem("TextureNodeChecker"), NodeItem("TextureNodeBricks"), ]), - TextureNodeCategory("TEX_TEXTURE", "Textures", items = [ + TextureNodeCategory("TEX_TEXTURE", "Textures", items=[ NodeItem("TextureNodeTexNoise"), NodeItem("TextureNodeTexDistNoise"), NodeItem("TextureNodeTexClouds"), @@ -377,20 +385,20 @@ texture_node_categories = [ NodeItem("TextureNodeTexMusgrave"), NodeItem("TextureNodeTexStucci"), ]), - TextureNodeCategory("TEX_CONVERTOR", "Converter", items = [ + TextureNodeCategory("TEX_CONVERTOR", "Converter", items=[ NodeItem("TextureNodeMath"), NodeItem("TextureNodeValToRGB"), NodeItem("TextureNodeRGBToBW"), NodeItem("TextureNodeValToNor"), NodeItem("TextureNodeDistance"), ]), - TextureNodeCategory("TEX_DISTORT", "Distort", items = [ + TextureNodeCategory("TEX_DISTORT", "Distort", items=[ NodeItem("TextureNodeScale"), NodeItem("TextureNodeTranslate"), NodeItem("TextureNodeRotate"), ]), TextureNodeCategory("TEX_GROUP", "Group", items=node_group_items), - TextureNodeCategory("TEX_LAYOUT", "Layout", items = [ + TextureNodeCategory("TEX_LAYOUT", "Layout", items=[ NodeItem("NodeFrame"), NodeItem("NodeReroute"), ]), @@ -398,15 +406,15 @@ texture_node_categories = [ def register(): - nodeitems_utils.register_node_categories("SHADER", shader_node_categories) - nodeitems_utils.register_node_categories("COMPOSITING", compositor_node_categories) - nodeitems_utils.register_node_categories("TEXTURE", texture_node_categories) + nodeitems_utils.register_node_categories('SHADER', shader_node_categories) + nodeitems_utils.register_node_categories('COMPOSITING', compositor_node_categories) + nodeitems_utils.register_node_categories('TEXTURE', texture_node_categories) def unregister(): - nodeitems_utils.unregister_node_categories("SHADER") - nodeitems_utils.unregister_node_categories("COMPOSITING") - nodeitems_utils.unregister_node_categories("TEXTURE") + nodeitems_utils.unregister_node_categories('SHADER') + nodeitems_utils.unregister_node_categories('COMPOSITING') + nodeitems_utils.unregister_node_categories('TEXTURE') if __name__ == "__main__": |