diff options
Diffstat (limited to 'release')
21 files changed, 291 insertions, 230 deletions
diff --git a/release/darwin/blender.app/Contents/Info.plist b/release/darwin/blender.app/Contents/Info.plist index 0649a2075cd..92e8d8cc761 100644 --- a/release/darwin/blender.app/Contents/Info.plist +++ b/release/darwin/blender.app/Contents/Info.plist @@ -2,6 +2,8 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> + <key>LSMinimumSystemVersion</key> + <string>10.9.0</string> <key>CFBundleDocumentTypes</key> <array> <dict> @@ -47,5 +49,7 @@ <string>NSApplication</string> <key>NSHighResolutionCapable</key> <true/> + <key>NSSupportsAutomaticGraphicsSwitching</key> + <true/> </dict> </plist> diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py index c48f03c133d..83d3b2066b4 100644 --- a/release/scripts/modules/bpy_extras/object_utils.py +++ b/release/scripts/modules/bpy_extras/object_utils.py @@ -103,9 +103,9 @@ def add_object_align_init(context, operator): return location * rotation -def object_data_add(context, obdata, operator=None, use_active_layer=True, name=None): +def object_data_add(context, obdata, operator=None, name=None): """ - Add an object using the view context and preference to to initialize the + Add an object using the view context and preference to initialize the location, rotation and layer. :arg context: The context to use. @@ -117,52 +117,31 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True, name= :arg name: Optional name :type name: string :return: the newly created object in the scene. - :rtype: :class:`bpy.types.ObjectBase` + :rtype: :class:`bpy.types.Object` """ scene = context.scene + layer = context.render_layer + layer_collection = context.layer_collection - # ugh, could be made nicer - for ob in scene.objects: - ob.select = False + if not layer_collection: + # when there is no collection linked to this render_layer create one + scene_collection = scene.master_collection.collections.new("") + layer_collection = layer.collections.link(scene_collection) + else: + scene_collection = layer_collection.collection + + bpy.ops.object.select_all(action='DESELECT') if name is None: name = "Object" if obdata is None else obdata.name obj_new = bpy.data.objects.new(name, obdata) - - base = scene.objects.link(obj_new) - base.select = True - - v3d = None - if context.space_data and context.space_data.type == 'VIEW_3D': - v3d = context.space_data - - if v3d and v3d.local_view: - base.layers_from_view(context.space_data) - - if operator is not None and any(operator.layers): - base.layers = operator.layers - else: - if use_active_layer: - if v3d and v3d.local_view: - base.layers[scene.active_layer] = True - else: - if v3d and not v3d.lock_camera_and_layers: - base.layers = [True if i == v3d.active_layer - else False for i in range(len(v3d.layers))] - else: - base.layers = [True if i == scene.active_layer - else False for i in range(len(scene.layers))] - else: - if v3d: - base.layers_from_view(context.space_data) - - if operator is not None: - operator.layers = base.layers + scene_collection.objects.link(obj_new) + obj_new.select_set(action='SELECT') obj_new.matrix_world = add_object_align_init(context, operator) - obj_act = scene.objects.active + obj_act = layer.objects.active # XXX # caused because entering edit-mode does not add a empty undo slot! @@ -174,8 +153,8 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True, name= _obdata = bpy.data.meshes.new(name) obj_act = bpy.data.objects.new(_obdata.name, _obdata) obj_act.matrix_world = obj_new.matrix_world - scene.objects.link(obj_act) - scene.objects.active = obj_act + scene_collection.objects.link(obj_act) + layer.objects.active = obj_act bpy.ops.object.mode_set(mode='EDIT') # need empty undo step bpy.ops.ed.undo_push(message="Enter Editmode") @@ -185,7 +164,7 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True, name= bpy.ops.mesh.select_all(action='DESELECT') bpy.ops.object.mode_set(mode='OBJECT') - obj_act.select = True + obj_act.select_set(action='SELECT') scene.update() # apply location # scene.objects.active = obj_new @@ -200,16 +179,14 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True, name= bpy.ops.object.join() # join into the active. if obdata: bpy.data.meshes.remove(obdata) - # base is freed, set to active object - base = scene.object_bases.active bpy.ops.object.mode_set(mode='EDIT') else: - scene.objects.active = obj_new + layer.objects.active = obj_new if context.user_preferences.edit.use_enter_edit_mode: bpy.ops.object.mode_set(mode='EDIT') - return base + return obj_new class AddObjectHelper: @@ -230,12 +207,6 @@ class AddObjectHelper: name="Rotation", subtype='EULER', ) - layers = BoolVectorProperty( - name="Layers", - size=20, - subtype='LAYER', - options={'HIDDEN', 'SKIP_SAVE'}, - ) @classmethod def poll(self, context): diff --git a/release/scripts/presets/keyconfig/3dsmax.py b/release/scripts/presets/keyconfig/3dsmax.py index 6d05ff6982c..09c6704df1f 100644 --- a/release/scripts/presets/keyconfig/3dsmax.py +++ b/release/scripts/presets/keyconfig/3dsmax.py @@ -7,7 +7,7 @@ kc = wm.keyconfigs.new('3dsmax') # Map Window km = kc.keymaps.new('Window', space_type='EMPTY', region_type='WINDOW', modal=False) -kmi = km.keymap_items.new('wm.window_duplicate', 'W', 'PRESS', ctrl=True, alt=True) +kmi = km.keymap_items.new('wm.window_new', 'W', 'PRESS', ctrl=True, alt=True) kmi = km.keymap_items.new('wm.read_homefile', 'N', 'PRESS', ctrl=True) kmi = km.keymap_items.new('wm.save_homefile', 'U', 'PRESS', ctrl=True) kmi = km.keymap_items.new('wm.call_menu', 'O', 'PRESS', shift=True, ctrl=True) @@ -330,7 +330,6 @@ kmi = km.keymap_items.new('object.hide_view_set', 'H', 'PRESS', shift=True) kmi.properties.unselected = True kmi = km.keymap_items.new('object.hide_render_clear', 'H', 'PRESS', ctrl=True, alt=True) kmi = km.keymap_items.new('object.hide_render_set', 'H', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('object.move_to_layer', 'M', 'PRESS') kmi = km.keymap_items.new('object.delete', 'X', 'PRESS') kmi.properties.use_global = False kmi = km.keymap_items.new('object.delete', 'X', 'PRESS', shift=True) diff --git a/release/scripts/presets/keyconfig/maya.py b/release/scripts/presets/keyconfig/maya.py index 53129593a59..194b9b3c283 100644 --- a/release/scripts/presets/keyconfig/maya.py +++ b/release/scripts/presets/keyconfig/maya.py @@ -8,7 +8,7 @@ kc = wm.keyconfigs.new(os.path.splitext(os.path.basename(__file__))[0]) # Map Window km = kc.keymaps.new('Window', space_type='EMPTY', region_type='WINDOW', modal=False) -kmi = km.keymap_items.new('wm.window_duplicate', 'W', 'PRESS', ctrl=True, alt=True) +kmi = km.keymap_items.new('wm.window_new', 'W', 'PRESS', ctrl=True, alt=True) kmi = km.keymap_items.new('wm.read_homefile', 'N', 'PRESS', ctrl=True) kmi = km.keymap_items.new('wm.save_homefile', 'U', 'PRESS', ctrl=True) kmi = km.keymap_items.new('wm.call_menu', 'O', 'PRESS', shift=True, ctrl=True) @@ -384,7 +384,6 @@ kmi = km.keymap_items.new('object.hide_view_clear', 'H', 'PRESS', shift=True, ct kmi = km.keymap_items.new('object.hide_view_set', 'H', 'PRESS', ctrl=True) kmi = km.keymap_items.new('object.hide_view_set', 'H', 'PRESS', alt=True) kmi.properties.unselected = True -kmi = km.keymap_items.new('object.move_to_layer', 'M', 'PRESS') kmi = km.keymap_items.new('object.delete', 'BACK_SPACE', 'PRESS') kmi = km.keymap_items.new('object.delete', 'DEL', 'PRESS') kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True) diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py index e52d577b900..6747bfec1fb 100644 --- a/release/scripts/startup/bl_operators/clip.py +++ b/release/scripts/startup/bl_operators/clip.py @@ -235,7 +235,7 @@ class CLIP_OT_track_to_empty(Operator): ob = None ob = bpy.data.objects.new(name=track.name, object_data=None) - ob.select = True + ob.select_set(action='SELECT') context.scene.objects.link(ob) context.scene.objects.active = ob @@ -509,7 +509,7 @@ object's movement caused by this constraint""" # XXX, should probably use context.selected_editable_objects # since selected objects can be from a lib or in hidden layer! for ob in scene.objects: - if ob.select: + if ob.select_set(action='SELECT'): self._bake_object(scene, ob) return {'FINISHED'} diff --git a/release/scripts/startup/bl_operators/freestyle.py b/release/scripts/startup/bl_operators/freestyle.py index 2e46160aeeb..4cee1abf15f 100644 --- a/release/scripts/startup/bl_operators/freestyle.py +++ b/release/scripts/startup/bl_operators/freestyle.py @@ -104,7 +104,7 @@ class SCENE_OT_freestyle_fill_range_by_selection(bpy.types.Operator): m.range_max = max_dist return {'FINISHED'} # Find selected mesh objects - selection = [ob for ob in scene.objects if ob.select and ob.type == 'MESH' and ob.name != ref.name] + selection = [ob for ob in scene.objects if ob.select_get() and ob.type == 'MESH' and ob.name != source.name] if selection: # Compute the min/max distance from the reference to mesh vertices min_dist = sys.float_info.max diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py index 3a42d8d2e78..b730e866323 100644 --- a/release/scripts/startup/bl_operators/object.py +++ b/release/scripts/startup/bl_operators/object.py @@ -81,16 +81,18 @@ class SelectPattern(Operator): # Can be pose bones or objects for item in items: if pattern_match(item.name, self.pattern): - item.select = True # hrmf, perhaps there should be a utility function for this. if is_ebone: + item.select = True item.select_head = True item.select_tail = True if item.use_connect: item_parent = item.parent if item_parent is not None: item_parent.select_tail = True + else: + item.select_set(action='SELECT') return {'FINISHED'} @@ -136,7 +138,7 @@ class SelectCamera(Operator): bpy.ops.object.select_all(action='DESELECT') scene.objects.active = camera camera.hide = False - camera.select = True + camera.select_set(action='SELECT') return {'FINISHED'} return {'CANCELLED'} @@ -202,7 +204,7 @@ class SelectHierarchy(Operator): bpy.ops.object.select_all(action='DESELECT') for obj in select_new: - obj.select = True + obj.select_set(action='SELECT') scene.objects.active = act_new return {'FINISHED'} @@ -644,8 +646,8 @@ class MakeDupliFace(Operator): ob_new.use_dupli_faces_scale = True ob_new.dupli_faces_scale = 1.0 / SCALE_FAC - ob_inst.select = True - ob_new.select = True + ob_inst.select_set(action='SELECT') + ob_new.select_set(action='SELECT') def execute(self, context): self._main(context) @@ -664,7 +666,7 @@ class IsolateTypeRender(Operator): for obj in context.visible_objects: - if obj.select: + if obj.select_get(): obj.hide_render = False else: if obj.type == act_type: @@ -1029,8 +1031,8 @@ class LodGenerate(Operator): for level in ob.lod_levels[1:]: level.object.hide = level.object.hide_render = True - lod.select = False - ob.select = True + lod.select_set(action='DESELECT') + ob.select_set(action='SELECT') scene.objects.active = ob return {'FINISHED'} diff --git a/release/scripts/startup/bl_operators/rigidbody.py b/release/scripts/startup/bl_operators/rigidbody.py index 6792d525683..e10a2a2915e 100644 --- a/release/scripts/startup/bl_operators/rigidbody.py +++ b/release/scripts/startup/bl_operators/rigidbody.py @@ -65,7 +65,7 @@ class CopyRigidbodySettings(Operator): # deselect all but mesh objects for o in context.selected_objects: if o.type != 'MESH': - o.select = False + o.select_set(action='DESELECT') elif o.rigid_body is None: # Add rigidbody to object! scene.objects.active = o @@ -127,7 +127,7 @@ class BakeToKeyframes(Operator): # filter objects selection for obj in context.selected_objects: if not obj.rigid_body or obj.rigid_body.type != 'ACTIVE': - obj.select = False + obj.select_set(action='DESELECT') objects = context.selected_objects @@ -260,7 +260,7 @@ class ConnectRigidBodies(Operator): ob.location = loc context.scene.objects.link(ob) context.scene.objects.active = ob - ob.select = True + ob.select_set(action='SELECT') bpy.ops.rigidbody.constraint_add() con_obj = context.active_object @@ -305,7 +305,7 @@ class ConnectRigidBodies(Operator): # restore selection bpy.ops.object.select_all(action='DESELECT') for obj in objects: - obj.select = True + obj.select_set(action='SELECT') scene.objects.active = obj_act return {'FINISHED'} else: diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 5b609605cee..c5772101df8 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -28,6 +28,7 @@ if "bpy" in locals(): _modules = [ "properties_animviz", + "properties_collection", "properties_constraint", "properties_data_armature", "properties_data_bone", diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py new file mode 100644 index 00000000000..c1e2b00966c --- /dev/null +++ b/release/scripts/startup/bl_ui/properties_collection.py @@ -0,0 +1,125 @@ +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +# <pep8 compliant> +import bpy +from bpy.types import Panel + + +class CollectionButtonsPanel: + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "collection" + + +class COLLECTION_PT_context_collection(CollectionButtonsPanel, Panel): + bl_label = "" + bl_options = {'HIDE_HEADER'} + + def draw(self, context): + layout = self.layout + space = context.space_data + + collection = context.layer_collection + name = collection.name + if name == 'Master Collection': + layout.label(text=name, icon='COLLAPSEMENU') + else: + layout.prop(collection, "name", text="", icon='COLLAPSEMENU') + + +class COLLECTION_PT_clay_settings(CollectionButtonsPanel, Panel): + bl_label = "Render Settings" + COMPAT_ENGINES = {'BLENDER_CLAY'} + + @classmethod + def poll(cls, context): + scene = context.scene + return scene and (scene.render.engine in cls.COMPAT_ENGINES) + + def draw(self, context): + layout = self.layout + scene_props = context.scene.collection_properties['BLENDER_CLAY'] + collection = context.layer_collection + collection_props = collection.engine_overrides['BLENDER_CLAY'] + + col = layout.column() + col.template_override_property(collection_props, scene_props, "matcap_icon", custom_template="icon_view") + col.template_override_property(collection_props, scene_props, "matcap_rotation") + col.template_override_property(collection_props, scene_props, "matcap_hue") + col.template_override_property(collection_props, scene_props, "matcap_saturation") + col.template_override_property(collection_props, scene_props, "matcap_value") + col.template_override_property(collection_props, scene_props, "ssao_factor_cavity") + col.template_override_property(collection_props, scene_props, "ssao_factor_edge") + col.template_override_property(collection_props, scene_props, "ssao_distance") + col.template_override_property(collection_props, scene_props, "ssao_attenuation") + + +class COLLECTION_PT_object_mode_settings(CollectionButtonsPanel, Panel): + bl_label = "Object Mode Settings" + + @classmethod + def poll(cls, context): + ob = context.object + return ob and (ob.mode == 'OBJECT') + + def draw(self, context): + layout = self.layout + scene_props = context.scene.collection_properties['ObjectMode'] + collection = context.layer_collection + collection_props = collection.engine_overrides['ObjectMode'] + + col = layout.column() + col.template_override_property(collection_props, scene_props, "show_wire") + col.template_override_property(collection_props, scene_props, "show_backface_culling") + + +class COLLECTION_PT_edit_mode_settings(CollectionButtonsPanel, Panel): + bl_label = "Edit Mode Settings" + + @classmethod + def poll(cls, context): + ob = context.object + return ob and (ob.mode == 'EDIT') + + def draw(self, context): + layout = self.layout + scene_props = context.scene.collection_properties['EditMode'] + collection = context.layer_collection + collection_props = collection.engine_overrides['EditMode'] + + col = layout.column() + col.template_override_property(collection_props, scene_props, "show_occlude_wire") + col.template_override_property(collection_props, scene_props, "backwire_opacity") + col.template_override_property(collection_props, scene_props, "face_normals_show") + col.template_override_property(collection_props, scene_props, "vert_normals_show") + col.template_override_property(collection_props, scene_props, "loop_normals_show") + col.template_override_property(collection_props, scene_props, "normals_length") + + +classes = ( + COLLECTION_PT_context_collection, + COLLECTION_PT_clay_settings, + COLLECTION_PT_object_mode_settings, + COLLECTION_PT_edit_mode_settings, +) + +if __name__ == "__main__": # only for live edit. + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py index 101062095c4..edab1c5b22f 100644 --- a/release/scripts/startup/bl_ui/properties_data_camera.py +++ b/release/scripts/startup/bl_ui/properties_data_camera.py @@ -37,7 +37,7 @@ class CAMERA_MT_presets(Menu): bl_label = "Camera Presets" preset_subdir = "camera" preset_operator = "script.execute_preset" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} draw = Menu.draw_preset @@ -45,14 +45,14 @@ class SAFE_AREAS_MT_presets(Menu): bl_label = "Camera Presets" preset_subdir = "safe_areas" preset_operator = "script.execute_preset" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} draw = Menu.draw_preset class DATA_PT_context_camera(CameraButtonsPanel, Panel): bl_label = "" bl_options = {'HIDE_HEADER'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} def draw(self, context): layout = self.layout @@ -72,7 +72,7 @@ class DATA_PT_context_camera(CameraButtonsPanel, Panel): class DATA_PT_lens(CameraButtonsPanel, Panel): bl_label = "Lens" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} def draw(self, context): layout = self.layout @@ -183,7 +183,7 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel): class DATA_PT_camera(CameraButtonsPanel, Panel): bl_label = "Camera" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} def draw(self, context): layout = self.layout @@ -217,7 +217,7 @@ class DATA_PT_camera(CameraButtonsPanel, Panel): class DATA_PT_camera_dof(CameraButtonsPanel, Panel): bl_label = "Depth of Field" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} def draw(self, context): layout = self.layout @@ -247,7 +247,7 @@ class DATA_PT_camera_dof(CameraButtonsPanel, Panel): class DATA_PT_camera_display(CameraButtonsPanel, Panel): bl_label = "Display" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} def draw(self, context): layout = self.layout @@ -277,7 +277,7 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel): class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel): bl_label = "Safe Areas" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} def draw_header(self, context): cam = context.camera @@ -293,7 +293,7 @@ class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel): class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} _context_path = "object.data" _property_type = bpy.types.Camera diff --git a/release/scripts/startup/bl_ui/properties_data_lamp.py b/release/scripts/startup/bl_ui/properties_data_lamp.py index f913ef51381..31ad299f924 100644 --- a/release/scripts/startup/bl_ui/properties_data_lamp.py +++ b/release/scripts/startup/bl_ui/properties_data_lamp.py @@ -26,7 +26,7 @@ class LAMP_MT_sunsky_presets(Menu): bl_label = "Sun & Sky Presets" preset_subdir = "sunsky" preset_operator = "script.execute_preset" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'} draw = Menu.draw_preset @@ -44,7 +44,7 @@ class DataButtonsPanel: class DATA_PT_context_lamp(DataButtonsPanel, Panel): bl_label = "" bl_options = {'HIDE_HEADER'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -68,7 +68,7 @@ class DATA_PT_context_lamp(DataButtonsPanel, Panel): class DATA_PT_preview(DataButtonsPanel, Panel): bl_label = "Preview" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'} def draw(self, context): self.layout.template_preview(context.lamp) @@ -76,7 +76,7 @@ class DATA_PT_preview(DataButtonsPanel, Panel): class DATA_PT_lamp(DataButtonsPanel, Panel): bl_label = "Lamp" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -96,6 +96,7 @@ class DATA_PT_lamp(DataButtonsPanel, Panel): sub.label(text="Falloff:") sub.prop(lamp, "falloff_type", text="") sub.prop(lamp, "distance") + sub.prop(lamp, "shadow_soft_size", text="Radius") if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED': col.label(text="Attenuation Factors:") @@ -312,7 +313,7 @@ class DATA_PT_shadow(DataButtonsPanel, Panel): class DATA_PT_area(DataButtonsPanel, Panel): bl_label = "Area Shape" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -338,7 +339,7 @@ class DATA_PT_area(DataButtonsPanel, Panel): class DATA_PT_spot(DataButtonsPanel, Panel): bl_label = "Spot Shape" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -374,7 +375,7 @@ class DATA_PT_spot(DataButtonsPanel, Panel): class DATA_PT_falloff_curve(DataButtonsPanel, Panel): bl_label = "Falloff Curve" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -390,7 +391,7 @@ class DATA_PT_falloff_curve(DataButtonsPanel, Panel): class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'} _context_path = "object.data" _property_type = bpy.types.Lamp diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index de55b4152ba..3e90eacd547 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -24,7 +24,7 @@ from rna_prop_ui import PropertyPanel class MESH_MT_vertex_group_specials(Menu): bl_label = "Vertex Group Specials" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} def draw(self, context): layout = self.layout @@ -48,7 +48,7 @@ class MESH_MT_vertex_group_specials(Menu): class MESH_MT_shape_key_specials(Menu): bl_label = "Shape Key Specials" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} def draw(self, context): layout = self.layout @@ -126,7 +126,7 @@ class MeshButtonsPanel: class DATA_PT_context_mesh(MeshButtonsPanel, Panel): bl_label = "" bl_options = {'HIDE_HEADER'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} def draw(self, context): layout = self.layout @@ -143,7 +143,7 @@ class DATA_PT_context_mesh(MeshButtonsPanel, Panel): class DATA_PT_normals(MeshButtonsPanel, Panel): bl_label = "Normals" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} def draw(self, context): layout = self.layout @@ -164,7 +164,7 @@ class DATA_PT_normals(MeshButtonsPanel, Panel): class DATA_PT_texture_space(MeshButtonsPanel, Panel): bl_label = "Texture Space" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} def draw(self, context): layout = self.layout @@ -183,7 +183,7 @@ class DATA_PT_texture_space(MeshButtonsPanel, Panel): class DATA_PT_vertex_groups(MeshButtonsPanel, Panel): bl_label = "Vertex Groups" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} @classmethod def poll(cls, context): @@ -229,7 +229,7 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, Panel): class DATA_PT_shape_keys(MeshButtonsPanel, Panel): bl_label = "Shape Keys" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} @classmethod def poll(cls, context): @@ -322,7 +322,7 @@ class DATA_PT_shape_keys(MeshButtonsPanel, Panel): class DATA_PT_uv_texture(MeshButtonsPanel, Panel): bl_label = "UV Maps" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} def draw(self, context): layout = self.layout @@ -341,7 +341,7 @@ class DATA_PT_uv_texture(MeshButtonsPanel, Panel): class DATA_PT_vertex_colors(MeshButtonsPanel, Panel): bl_label = "Vertex Colors" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} def draw(self, context): layout = self.layout @@ -361,7 +361,7 @@ class DATA_PT_vertex_colors(MeshButtonsPanel, Panel): class DATA_PT_customdata(MeshButtonsPanel, Panel): bl_label = "Geometry Data" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} def draw(self, context): layout = self.layout @@ -387,7 +387,7 @@ class DATA_PT_customdata(MeshButtonsPanel, Panel): class DATA_PT_custom_props_mesh(MeshButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} _context_path = "object.data" _property_type = bpy.types.Mesh diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py index 0a7890670b2..6ada3c59942 100644 --- a/release/scripts/startup/bl_ui/properties_physics_cloth.py +++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py @@ -64,6 +64,8 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel): split = layout.split(percentage=0.25) + col = split.column() + split.label(text="Presets:") sub = split.row(align=True) sub.menu("CLOTH_MT_presets", text=bpy.types.CLOTH_MT_presets.bl_label) diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index a7e8d9273ad..be7104163fd 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -584,6 +584,26 @@ class RENDER_PT_bake(RenderButtonsPanel, Panel): sub.prop(rd, "bake_user_scale", text="User Scale") +class RENDER_PT_clay_collection_settings(RenderButtonsPanel, Panel): + bl_label = "Clay Collection Settings" + COMPAT_ENGINES = {'BLENDER_CLAY'} + + def draw(self, context): + layout = self.layout + props = context.scene.collection_properties['BLENDER_CLAY'] + + col = layout.column() + col.template_icon_view(props, "matcap_icon") + col.prop(props, "matcap_rotation") + col.prop(props, "matcap_hue") + col.prop(props, "matcap_saturation") + col.prop(props, "matcap_value") + col.prop(props, "ssao_factor_cavity") + col.prop(props, "ssao_factor_edge") + col.prop(props, "ssao_distance") + col.prop(props, "ssao_attenuation") + + classes = ( RENDER_MT_presets, RENDER_MT_ffmpeg_presets, @@ -599,6 +619,7 @@ classes = ( RENDER_PT_output, RENDER_PT_encoding, RENDER_PT_bake, + RENDER_PT_clay_collection_settings, ) if __name__ == "__main__": # only for live edit. diff --git a/release/scripts/startup/bl_ui/properties_render_layer.py b/release/scripts/startup/bl_ui/properties_render_layer.py index 084bc387822..d6905cd1975 100644 --- a/release/scripts/startup/bl_ui/properties_render_layer.py +++ b/release/scripts/startup/bl_ui/properties_render_layer.py @@ -35,7 +35,7 @@ class RenderLayerButtonsPanel: class RENDERLAYER_UL_renderlayers(UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): - # assert(isinstance(item, bpy.types.SceneRenderLayer) + # assert(isinstance(item, bpy.types.SceneLayer) layer = item if self.layout_type in {'DEFAULT', 'COMPACT'}: layout.prop(layer, "name", text="", icon_value=icon, emboss=False) @@ -48,7 +48,7 @@ class RENDERLAYER_UL_renderlayers(UIList): class RENDERLAYER_PT_layers(RenderLayerButtonsPanel, Panel): bl_label = "Layer List" bl_options = {'HIDE_HEADER'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY'} def draw(self, context): layout = self.layout @@ -62,7 +62,7 @@ class RENDERLAYER_PT_layers(RenderLayerButtonsPanel, Panel): row = layout.row() col = row.column() - col.template_list("RENDERLAYER_UL_renderlayers", "", rd, "layers", rd.layers, "active_index", rows=2) + col.template_list("RENDERLAYER_UL_renderlayers", "", scene, "render_layers", scene.render_layers, "active_index", rows=2) col = row.column() sub = col.column(align=True) @@ -71,103 +71,6 @@ class RENDERLAYER_PT_layers(RenderLayerButtonsPanel, Panel): col.prop(rd, "use_single_layer", icon_only=True) -class RENDERLAYER_PT_layer_options(RenderLayerButtonsPanel, Panel): - bl_label = "Layer" - COMPAT_ENGINES = {'BLENDER_RENDER'} - - def draw(self, context): - layout = self.layout - - scene = context.scene - rd = scene.render - rl = rd.layers.active - - split = layout.split() - - col = split.column() - col.prop(scene, "layers", text="Scene") - col.label(text="") - col.prop(rl, "light_override", text="Lights") - col.prop(rl, "material_override", text="Material") - - col = split.column() - col.prop(rl, "layers", text="Layer") - col.prop(rl, "layers_zmask", text="Mask Layer") - - layout.separator() - layout.label(text="Include:") - - split = layout.split() - - col = split.column() - col.prop(rl, "use_zmask") - row = col.row() - row.prop(rl, "invert_zmask", text="Negate") - row.active = rl.use_zmask - col.prop(rl, "use_all_z") - - col = split.column() - col.prop(rl, "use_solid") - col.prop(rl, "use_halo") - col.prop(rl, "use_ztransp") - - col = split.column() - col.prop(rl, "use_sky") - col.prop(rl, "use_edge_enhance") - col.prop(rl, "use_strand") - if bpy.app.build_options.freestyle: - row = col.row() - row.prop(rl, "use_freestyle") - row.active = rd.use_freestyle - - -class RENDERLAYER_PT_layer_passes(RenderLayerButtonsPanel, Panel): - bl_label = "Passes" - bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER'} - - @staticmethod - def draw_pass_type_buttons(box, rl, pass_type): - # property names - use_pass_type = "use_pass_" + pass_type - exclude_pass_type = "exclude_" + pass_type - # draw pass type buttons - row = box.row() - row.prop(rl, use_pass_type) - row.prop(rl, exclude_pass_type, text="") - - def draw(self, context): - layout = self.layout - - scene = context.scene - rd = scene.render - rl = rd.layers.active - - split = layout.split() - - col = split.column() - col.prop(rl, "use_pass_combined") - col.prop(rl, "use_pass_z") - col.prop(rl, "use_pass_vector") - col.prop(rl, "use_pass_normal") - col.prop(rl, "use_pass_uv") - col.prop(rl, "use_pass_mist") - col.prop(rl, "use_pass_object_index") - col.prop(rl, "use_pass_material_index") - col.prop(rl, "use_pass_color") - - col = split.column() - col.prop(rl, "use_pass_diffuse") - self.draw_pass_type_buttons(col, rl, "specular") - self.draw_pass_type_buttons(col, rl, "shadow") - self.draw_pass_type_buttons(col, rl, "emit") - self.draw_pass_type_buttons(col, rl, "ambient_occlusion") - self.draw_pass_type_buttons(col, rl, "environment") - self.draw_pass_type_buttons(col, rl, "indirect") - self.draw_pass_type_buttons(col, rl, "reflection") - self.draw_pass_type_buttons(col, rl, "refraction") - - class RENDERLAYER_UL_renderviews(UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): # assert(isinstance(item, bpy.types.SceneRenderView) @@ -230,8 +133,6 @@ class RENDERLAYER_PT_views(RenderLayerButtonsPanel, Panel): classes = ( RENDERLAYER_UL_renderlayers, RENDERLAYER_PT_layers, - RENDERLAYER_PT_layer_options, - RENDERLAYER_PT_layer_passes, RENDERLAYER_UL_renderviews, RENDERLAYER_PT_views, ) diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index a7b518dfd2e..f986235cc90 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -40,7 +40,7 @@ class INFO_HT_header(Header): layout.operator("screen.back_to_previous", icon='SCREEN_BACK', text="Back to Previous") layout.separator() else: - layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete") + layout.template_ID_preview(context.window, "screen", new="screen.new", unlink="screen.delete", rows=2, cols=6) layout.template_ID(context.screen, "scene", new="scene.new", unlink="scene.delete") layout.separator() @@ -293,7 +293,7 @@ class INFO_MT_window(Menu): layout = self.layout - layout.operator("wm.window_duplicate") + layout.operator("wm.window_new") layout.operator("wm.window_fullscreen_toggle", icon='FULLSCREEN_ENTER') layout.separator() diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index 4eb550bbb35..054a955ab9c 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -60,6 +60,16 @@ class OUTLINER_HT_header(Header): elif space.display_mode == 'ORPHAN_DATA': layout.operator("outliner.orphans_purge") + elif space.display_mode in {'ACT_LAYER', 'MASTER_COLLECTION'}: + row = layout.row(align=True) + + row.operator("outliner.collection_new", text="", icon='NEW') + if space.display_mode == 'ACT_LAYER': + row.operator("outliner.collection_override_new", text="", icon='LINK_AREA') + row.operator("outliner.collection_link", text="", icon='LINKED') + row.operator("outliner.collection_unlink", text="", icon='UNLINKED') + row.operator("outliner.collections_delete", text="", icon='X') + class OUTLINER_MT_editor_menus(Menu): bl_idname = "OUTLINER_MT_editor_menus" @@ -88,7 +98,8 @@ class OUTLINER_MT_view(Menu): space = context.space_data if space.display_mode not in {'DATABLOCKS', 'USER_PREFERENCES', 'KEYMAPS'}: - layout.prop(space, "use_sort_alpha") + if space.display_mode not in {'ACT_LAYER', 'MASTER_COLLECTION'}: + layout.prop(space, "use_sort_alpha") layout.prop(space, "show_restrict_columns") layout.separator() layout.operator("outliner.show_active") diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index f13c7095f67..1ede823e6d8 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -635,7 +635,6 @@ class VIEW3D_MT_select_object(Menu): layout.operator("object.select_all", text="Inverse").action = 'INVERT' layout.operator("object.select_random", text="Random") layout.operator("object.select_mirror", text="Mirror") - layout.operator("object.select_by_layer", text="Select All by Layer") layout.operator_menu_enum("object.select_by_type", "type", text="Select All by Type...") layout.operator("object.select_camera", text="Select Camera") @@ -711,7 +710,6 @@ class VIEW3D_MT_select_particle(Menu): layout = self.layout layout.operator("view3d.select_border") - layout.operator("view3d.select_circle") layout.separator() @@ -1327,15 +1325,6 @@ class VIEW3D_MT_object(Menu): layout.separator() - if is_local_view: - layout.operator_context = 'EXEC_REGION_WIN' - layout.operator("object.move_to_layer", text="Move out of Local View") - layout.operator_context = 'INVOKE_REGION_WIN' - else: - layout.operator("object.move_to_layer", text="Move to Layer...") - - layout.menu("VIEW3D_MT_object_showhide") - layout.operator_menu_enum("object.convert", "target") @@ -1614,17 +1603,6 @@ class VIEW3D_MT_object_quick_effects(Menu): layout.operator("object.quick_fluid") -class VIEW3D_MT_object_showhide(Menu): - bl_label = "Show/Hide" - - def draw(self, context): - layout = self.layout - - layout.operator("object.hide_view_clear", text="Show Hidden") - layout.operator("object.hide_view_set", text="Hide Selected").unselected = False - layout.operator("object.hide_view_set", text="Hide Unselected").unselected = True - - class VIEW3D_MT_make_single_user(Menu): bl_label = "Make Single User" @@ -3149,6 +3127,47 @@ class VIEW3D_MT_edit_gpencil_interpolate(Menu): # ********** Panel ********** +class VIEW3D_PT_viewport_debug(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'UI' + bl_label = "Modern Viewport" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + view = context.space_data + return (view) + + def draw_header(self, context): + view = context.space_data + self.layout.prop(view, "use_modern_viewport", text="") + + def draw(self, context): + layout = self.layout + view = context.space_data + + layout.active = view.use_modern_viewport + + col = layout.column() + col.label(text="Placeholder for debugging options") + col.separator() + + row = col.row() + row.active = not view.show_combined_depth + row.prop(view, "show_scene_depth") + row = col.row() + row.active = not view.show_scene_depth + row.prop(view, "show_combined_depth") + + row = col.row(align=True) + row.active = view.show_scene_depth or view.show_combined_depth + row.prop(view, "debug_near") + row.prop(view, "debug_far") + + col.label(text="Background:") + col.row(align=True).prop(view, "debug_background", expand=True) + + class VIEW3D_PT_grease_pencil(GreasePencilDataPanel, Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'UI' @@ -3262,7 +3281,7 @@ class VIEW3D_PT_view3d_display(Panel): @classmethod def poll(cls, context): view = context.space_data - return (view) + return (view) and not view.use_modern_viewport def draw(self, context): layout = self.layout @@ -3362,6 +3381,11 @@ class VIEW3D_PT_view3d_shading(Panel): bl_region_type = 'UI' bl_label = "Shading" + @classmethod + def poll(cls, context): + view = context.space_data + return (view) and not view.use_modern_viewport + def draw(self, context): layout = self.layout @@ -3858,7 +3882,6 @@ classes = ( VIEW3D_MT_object_group, VIEW3D_MT_object_constraints, VIEW3D_MT_object_quick_effects, - VIEW3D_MT_object_showhide, VIEW3D_MT_make_single_user, VIEW3D_MT_make_links, VIEW3D_MT_object_game, @@ -3919,6 +3942,7 @@ classes = ( VIEW3D_MT_edit_armature_delete, VIEW3D_MT_edit_gpencil_transform, VIEW3D_MT_edit_gpencil_interpolate, + VIEW3D_PT_viewport_debug, VIEW3D_PT_grease_pencil, VIEW3D_PT_grease_pencil_palettecolor, VIEW3D_PT_view3d_properties, diff --git a/release/scripts/templates_py/batch_export.py b/release/scripts/templates_py/batch_export.py index 6c77c5d6a1a..8de7a5e2903 100644 --- a/release/scripts/templates_py/batch_export.py +++ b/release/scripts/templates_py/batch_export.py @@ -18,7 +18,7 @@ bpy.ops.object.select_all(action='DESELECT') for obj in selection: - obj.select = True + obj.select_set(action='SELECT') # some exporters only use the active object scene.objects.active = obj @@ -31,7 +31,7 @@ for obj in selection: ## Can be used for multiple formats # bpy.ops.export_scene.x3d(filepath=fn + ".x3d", use_selection=True) - obj.select = False + obj.select_set(action='DESELECT') print("written:", fn) @@ -39,4 +39,4 @@ for obj in selection: scene.objects.active = obj_active for obj in selection: - obj.select = True + obj.select_set(action='SELECT') diff --git a/release/scripts/templates_py/operator_modal_view3d_raycast.py b/release/scripts/templates_py/operator_modal_view3d_raycast.py index c4d661b4c1f..e3b63813fc4 100644 --- a/release/scripts/templates_py/operator_modal_view3d_raycast.py +++ b/release/scripts/templates_py/operator_modal_view3d_raycast.py @@ -67,7 +67,7 @@ def main(context, event): # now we have the object under the mouse cursor, # we could do lots of stuff but for the example just select. if best_obj is not None: - best_obj.select = True + best_obj.select_set(action='SELECT') context.scene.objects.active = best_obj |