diff options
Diffstat (limited to 'release/scripts/startup')
35 files changed, 326 insertions, 218 deletions
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index cc3d1ffc229..d7135ca202c 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -42,6 +42,7 @@ _modules = [ "properties_data_modifier", "properties_data_lightprobe", "properties_data_speaker", + "properties_data_workspace", "properties_game", "properties_mask_common", "properties_material", diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py index 9e7d29358a9..ae61dc2b74f 100644 --- a/release/scripts/startup/bl_ui/properties_collection.py +++ b/release/scripts/startup/bl_ui/properties_collection.py @@ -50,7 +50,7 @@ class COLLECTION_PT_clay_settings(CollectionButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -76,8 +76,8 @@ class COLLECTION_PT_object_mode_settings(CollectionButtonsPanel, Panel): @classmethod def poll(cls, context): - ob = context.object - return ob and (ob.mode == 'OBJECT') + workspace = context.workspace + return workspace and hasattr(workspace, 'object_mode') and (workspace.object_mode == 'OBJECT') def draw(self, context): layout = self.layout @@ -95,8 +95,8 @@ class COLLECTION_PT_edit_mode_settings(CollectionButtonsPanel, Panel): @classmethod def poll(cls, context): - ob = context.object - return ob and (ob.mode == 'EDIT') + workspace = context.workspace + return workspace and hasattr(workspace, 'object_mode') and (workspace.object_mode == 'EDIT') def draw(self, context): layout = self.layout @@ -119,8 +119,8 @@ class COLLECTION_PT_paint_weight_mode_settings(CollectionButtonsPanel, Panel): @classmethod def poll(cls, context): - ob = context.object - return ob and (ob.mode == 'WEIGHT_PAINT') + workspace = context.workspace + return workspace and hasattr(workspace, 'object_mode') and (workspace.object_mode == 'WEIGHT_PAINT') def draw(self, context): layout = self.layout @@ -138,8 +138,8 @@ class COLLECTION_PT_paint_vertex_mode_settings(CollectionButtonsPanel, Panel): @classmethod def poll(cls, context): - ob = context.object - return ob and (ob.mode == 'VERTEX_PAINT') + workspace = context.workspace + return workspace and hasattr(workspace, 'object_mode') and (workspace.object_mode == 'VERTEX_PAINT') def draw(self, context): layout = self.layout diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py index bed8baf8210..fbfb611e03c 100644 --- a/release/scripts/startup/bl_ui/properties_data_armature.py +++ b/release/scripts/startup/bl_ui/properties_data_armature.py @@ -65,7 +65,7 @@ class DATA_PT_skeleton(ArmatureButtonsPanel, Panel): col.label(text="Protected Layers:") col.prop(arm, "layers_protected", text="") - if context.scene.render.engine == 'BLENDER_GAME': + if context.engine == 'BLENDER_GAME': col = layout.column() col.label(text="Deform:") col.prop(arm, "deform_method", expand=True) diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py index e0b92555735..f77c0ff40e8 100644 --- a/release/scripts/startup/bl_ui/properties_data_camera.py +++ b/release/scripts/startup/bl_ui/properties_data_camera.py @@ -29,7 +29,7 @@ class CameraButtonsPanel: @classmethod def poll(cls, context): - engine = context.scene.render.engine + engine = context.engine return context.camera and (engine in cls.COMPAT_ENGINES) @@ -96,7 +96,7 @@ class DATA_PT_lens(CameraButtonsPanel, Panel): col.prop(cam, "ortho_scale") elif cam.type == 'PANO': - engine = context.scene.render.engine + engine = context.engine if engine == 'CYCLES': ccam = cam.cycles col.prop(ccam, "panorama_type", text="Type") @@ -147,11 +147,11 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel): def draw(self, context): layout = self.layout - render = context.scene.render + view_render = context.scene.view_render st = context.camera.stereo cam = context.camera - is_spherical_stereo = cam.type != 'ORTHO' and render.use_spherical_stereo + is_spherical_stereo = cam.type != 'ORTHO' and view_render.use_spherical_stereo use_spherical_stereo = is_spherical_stereo and st.use_spherical_stereo col = layout.column() @@ -234,10 +234,10 @@ class DATA_PT_camera_dof(CameraButtonsPanel, Panel): sub.active = (cam.dof_object is None) sub.prop(cam, "dof_distance", text="Distance") - if context.scene.render.engine == 'BLENDER_EEVEE': + if context.engine == 'BLENDER_EEVEE': col = split.column(align=True) col.label("Aperture:") - engine = context.scene.render.engine + engine = context.engine sub = col.column(align=True) sub.prop(dof_options, "fstop") sub.prop(dof_options, "blades") diff --git a/release/scripts/startup/bl_ui/properties_data_lamp.py b/release/scripts/startup/bl_ui/properties_data_lamp.py index 40ebdbda75d..9ee17d808cf 100644 --- a/release/scripts/startup/bl_ui/properties_data_lamp.py +++ b/release/scripts/startup/bl_ui/properties_data_lamp.py @@ -37,7 +37,7 @@ class DataButtonsPanel: @classmethod def poll(cls, context): - engine = context.scene.render.engine + engine = context.engine return context.lamp and (engine in cls.COMPAT_ENGINES) @@ -172,7 +172,7 @@ class DATA_PT_sunsky(DataButtonsPanel, Panel): @classmethod def poll(cls, context): lamp = context.lamp - engine = context.scene.render.engine + engine = context.engine return (lamp and lamp.type == 'SUN') and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -244,7 +244,7 @@ class DATA_PT_shadow(DataButtonsPanel, Panel): @classmethod def poll(cls, context): lamp = context.lamp - engine = context.scene.render.engine + engine = context.engine return (lamp and lamp.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -359,7 +359,7 @@ class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel): @classmethod def poll(cls, context): lamp = context.lamp - engine = context.scene.render.engine + engine = context.engine return (lamp and lamp.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and (engine in cls.COMPAT_ENGINES) def draw_header(self, context): @@ -422,7 +422,7 @@ class DATA_PT_area(DataButtonsPanel, Panel): @classmethod def poll(cls, context): lamp = context.lamp - engine = context.scene.render.engine + engine = context.engine return (lamp and lamp.type == 'AREA') and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -448,7 +448,7 @@ class DATA_PT_spot(DataButtonsPanel, Panel): @classmethod def poll(cls, context): lamp = context.lamp - engine = context.scene.render.engine + engine = context.engine return (lamp and lamp.type == 'SPOT') and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -483,7 +483,7 @@ class DATA_PT_spot(DataButtonsPanel, Panel): @classmethod def poll(cls, context): lamp = context.lamp - engine = context.scene.render.engine + engine = context.engine return (lamp and lamp.type == 'SPOT') and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -509,7 +509,7 @@ class DATA_PT_falloff_curve(DataButtonsPanel, Panel): @classmethod def poll(cls, context): lamp = context.lamp - engine = context.scene.render.engine + engine = context.engine return (lamp and lamp.type in {'POINT', 'SPOT'} and lamp.falloff_type == 'CUSTOM_CURVE') and (engine in cls.COMPAT_ENGINES) diff --git a/release/scripts/startup/bl_ui/properties_data_lightprobe.py b/release/scripts/startup/bl_ui/properties_data_lightprobe.py index 13af5139632..b1deacb3051 100644 --- a/release/scripts/startup/bl_ui/properties_data_lightprobe.py +++ b/release/scripts/startup/bl_ui/properties_data_lightprobe.py @@ -28,7 +28,7 @@ class DataButtonsPanel: @classmethod def poll(cls, context): - engine = context.scene.render.engine + engine = context.engine return context.lightprobe and (engine in cls.COMPAT_ENGINES) @@ -107,7 +107,7 @@ class DATA_PT_lightprobe_parallax(DataButtonsPanel, Panel): @classmethod def poll(cls, context): - engine = context.scene.render.engine + engine = context.engine return context.lightprobe and context.lightprobe.type == 'CUBEMAP' and (engine in cls.COMPAT_ENGINES) def draw(self, context): diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index 4d00b70a0fa..d98e3f00e7d 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -130,7 +130,7 @@ class MeshButtonsPanel: @classmethod def poll(cls, context): - engine = context.scene.render.engine + engine = context.engine return context.mesh and (engine in cls.COMPAT_ENGINES) @@ -198,7 +198,7 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, Panel): @classmethod def poll(cls, context): - engine = context.scene.render.engine + engine = context.engine obj = context.object return (obj and obj.type in {'MESH', 'LATTICE'} and (engine in cls.COMPAT_ENGINES)) @@ -285,7 +285,7 @@ class DATA_PT_shape_keys(MeshButtonsPanel, Panel): @classmethod def poll(cls, context): - engine = context.scene.render.engine + engine = context.engine obj = context.object return (obj and obj.type in {'MESH', 'LATTICE', 'CURVE', 'SURFACE'} and (engine in cls.COMPAT_ENGINES)) diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 32c758e9d02..d886b2f20bc 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -929,7 +929,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col = split.column() scene = bpy.context.scene - engine = scene.render.engine + engine = scene.view_render.engine show_adaptive_options = ( engine == 'CYCLES' and md == ob.modifiers[-1] and scene.cycles.feature_set == 'EXPERIMENTAL' diff --git a/release/scripts/startup/bl_ui/properties_data_speaker.py b/release/scripts/startup/bl_ui/properties_data_speaker.py index 5ed9ce0478c..769efb96b38 100644 --- a/release/scripts/startup/bl_ui/properties_data_speaker.py +++ b/release/scripts/startup/bl_ui/properties_data_speaker.py @@ -29,7 +29,7 @@ class DataButtonsPanel: @classmethod def poll(cls, context): - engine = context.scene.render.engine + engine = context.engine return context.speaker and (engine in cls.COMPAT_ENGINES) diff --git a/release/scripts/startup/bl_ui/properties_data_workspace.py b/release/scripts/startup/bl_ui/properties_data_workspace.py new file mode 100644 index 00000000000..42a5406d1c8 --- /dev/null +++ b/release/scripts/startup/bl_ui/properties_data_workspace.py @@ -0,0 +1,78 @@ +# ##### 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, + ) + +from rna_prop_ui import PropertyPanel + + +class WorkSpaceButtonsPanel: + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "workspace" + + +class WORKSPACE_PT_context(WorkSpaceButtonsPanel, Panel): + bl_label = "" + bl_options = {'HIDE_HEADER'} + + def draw(self, context): + layout = self.layout + + workspace = context.workspace + layout.prop(workspace, "use_scene_settings", icon='SCENE') + + +class WORKSPACE_PT_workspace(WorkSpaceButtonsPanel, Panel): + bl_label = "Workspace" + + def draw(self, context): + layout = self.layout + + workspace = context.workspace + scene = context.scene + view_render = workspace.view_render + + layout.enabled = not workspace.use_scene_settings + + layout.template_search(workspace, "render_layer", scene, "render_layers") + + if view_render.has_multiple_engines: + layout.prop(view_render, "engine", text="") + + +class WORKSPACE_PT_custom_props(WorkSpaceButtonsPanel, PropertyPanel, Panel): + _context_path = "workspace" + _property_type = bpy.types.WorkSpace + + +classes = ( + WORKSPACE_PT_context, + WORKSPACE_PT_workspace, + WORKSPACE_PT_custom_props, +) + +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_freestyle.py b/release/scripts/startup/bl_ui/properties_freestyle.py index 3d105934bf8..ddc5c1643d0 100644 --- a/release/scripts/startup/bl_ui/properties_freestyle.py +++ b/release/scripts/startup/bl_ui/properties_freestyle.py @@ -33,7 +33,7 @@ class RenderFreestyleButtonsPanel: def poll(cls, context): scene = context.scene with_freestyle = bpy.app.build_options.freestyle - return scene and with_freestyle and(scene.render.engine in cls.COMPAT_ENGINES) + return scene and with_freestyle and(scene.view_render.engine in cls.COMPAT_ENGINES) class RENDER_PT_freestyle(RenderFreestyleButtonsPanel, Panel): @@ -75,7 +75,7 @@ class RenderLayerFreestyleButtonsPanel: 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)) + rd.layers.active and(scene.view_render.engine in cls.COMPAT_ENGINES)) class RenderLayerFreestyleEditorButtonsPanel(RenderLayerFreestyleButtonsPanel): @@ -183,7 +183,10 @@ class RENDERLAYER_PT_freestyle_lineset(RenderLayerFreestyleEditorButtonsPanel, P def draw(self, context): layout = self.layout - rd = context.scene.render + scene = context.scene + rd = scene.render + view_render = scene.view_render + rl = rd.layers.active freestyle = rl.freestyle_settings lineset = freestyle.linesets.active @@ -779,7 +782,7 @@ class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel, layout.separator() row = layout.row() - if rd.use_shading_nodes: + if view_render.use_shading_nodes: row.prop(linestyle, "use_nodes") else: row.prop(linestyle, "use_texture") @@ -810,7 +813,7 @@ class MaterialFreestyleButtonsPanel: material = context.material with_freestyle = bpy.app.build_options.freestyle return with_freestyle and material and scene and scene.render.use_freestyle and \ - (scene.render.engine in cls.COMPAT_ENGINES) + (scene.view_render.engine in cls.COMPAT_ENGINES) class MATERIAL_PT_freestyle_line(MaterialFreestyleButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index 8ea64b53727..eb2d3d49e61 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -34,8 +34,8 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel): @classmethod def poll(cls, context): ob = context.active_object - rd = context.scene.render - return ob and ob.game and (rd.engine in cls.COMPAT_ENGINES) + view_render = context.scene.view_render + return ob and ob.game and (view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -205,8 +205,8 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel): @classmethod def poll(cls, context): game = context.object.game - rd = context.scene.render - return (rd.engine in cls.COMPAT_ENGINES) \ + view_render = context.scene.view_render + return (view_render.engine in cls.COMPAT_ENGINES) \ and (game.physics_type in {'SENSOR', 'STATIC', 'DYNAMIC', 'RIGID_BODY', 'CHARACTER', 'SOFT_BODY'}) def draw_header(self, context): @@ -246,8 +246,8 @@ class PHYSICS_PT_game_obstacles(PhysicsButtonsPanel, Panel): @classmethod def poll(cls, context): game = context.object.game - rd = context.scene.render - return (rd.engine in cls.COMPAT_ENGINES) \ + view_render = context.scene.view_render + return (view_render.engine in cls.COMPAT_ENGINES) \ and (game.physics_type in {'SENSOR', 'STATIC', 'DYNAMIC', 'RIGID_BODY', 'SOFT_BODY', 'CHARACTER', 'NO_COLLISION'}) def draw_header(self, context): @@ -274,8 +274,8 @@ class RenderButtonsPanel: @classmethod def poll(cls, context): - rd = context.scene.render - return (rd.engine in cls.COMPAT_ENGINES) + view_render = context.scene.view_render + return (view_render.engine in cls.COMPAT_ENGINES) class RENDER_PT_embedded(RenderButtonsPanel, Panel): @@ -285,7 +285,7 @@ class RENDER_PT_embedded(RenderButtonsPanel, Panel): def draw(self, context): layout = self.layout - rd = context.scene.render + view_render = context.scene.view_render row = layout.row() row.operator("view3d.game_start", text="Start") @@ -474,7 +474,7 @@ class SCENE_PT_game_physics(SceneButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return (scene.render.engine in cls.COMPAT_ENGINES) + return (scene.view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -532,7 +532,7 @@ class SCENE_PT_game_physics_obstacles(SceneButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return (scene.render.engine in cls.COMPAT_ENGINES) + return (scene.view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -553,7 +553,7 @@ class SCENE_PT_game_navmesh(SceneButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return (scene and scene.render.engine in cls.COMPAT_ENGINES) + return (scene and scene.view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -614,7 +614,7 @@ class SCENE_PT_game_hysteresis(SceneButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return (scene and scene.render.engine in cls.COMPAT_ENGINES) + return (scene and scene.view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -640,8 +640,8 @@ class WORLD_PT_game_context_world(WorldButtonsPanel, Panel): @classmethod def poll(cls, context): - rd = context.scene.render - return (context.scene) and (rd.engine in cls.COMPAT_ENGINES) + view_render = context.scene.view_render + return (context.scene) and (view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -664,7 +664,7 @@ class WORLD_PT_game_world(WorldButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return (scene.world and scene.render.engine in cls.COMPAT_ENGINES) + return (scene.world and scene.view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -684,7 +684,7 @@ class WORLD_PT_game_environment_lighting(WorldButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return (scene.world and scene.render.engine in cls.COMPAT_ENGINES) + return (scene.world and scene.view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): light = context.world.light_settings @@ -709,7 +709,7 @@ class WORLD_PT_game_mist(WorldButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return (scene.world and scene.render.engine in cls.COMPAT_ENGINES) + return (scene.world and scene.view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): world = context.world @@ -746,7 +746,7 @@ class DATA_PT_shadow_game(DataButtonsPanel, Panel): def poll(cls, context): COMPAT_LIGHTS = {'SPOT', 'SUN'} lamp = context.lamp - engine = context.scene.render.engine + engine = context.engine return (lamp and lamp.type in COMPAT_LIGHTS) and (engine in cls.COMPAT_ENGINES) def draw_header(self, context): @@ -815,7 +815,7 @@ class OBJECT_PT_levels_of_detail(ObjectButtonsPanel, Panel): @classmethod def poll(cls, context): - return context.scene.render.engine in cls.COMPAT_ENGINES + return context.engine in cls.COMPAT_ENGINES def draw(self, context): layout = self.layout diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index 29cb2466ee5..42a132004d4 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -82,7 +82,7 @@ class MATERIAL_UL_matslots(UIList): layout.prop(ma, "name", text="", emboss=False, icon_value=icon) else: layout.label(text="", icon_value=icon) - if ma and not context.scene.render.use_shading_nodes: + if ma and not context.view_render.use_shading_nodes: manode = ma.active_node_material if manode: layout.label(text=iface_("Node %s") % manode.name, translate=False, icon_value=layout.icon(manode)) @@ -101,7 +101,7 @@ class MaterialButtonsPanel: @classmethod def poll(cls, context): - return context.material and (context.scene.render.engine in cls.COMPAT_ENGINES) + return context.material and (context.engine in cls.COMPAT_ENGINES) class MATERIAL_PT_context_material(MaterialButtonsPanel, Panel): @@ -114,7 +114,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel, Panel): # An exception, don't call the parent poll func because # this manages materials for all engine types - engine = context.scene.render.engine + engine = context.engine return (context.material or context.object) and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -197,7 +197,7 @@ class MATERIAL_PT_pipeline(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): mat = context.material - engine = context.scene.render.engine + engine = context.engine return mat and (not simple_material(mat)) and (mat.type in {'SURFACE', 'WIRE', 'VOLUME'}) and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -250,7 +250,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): mat = context.material - engine = context.scene.render.engine + engine = context.engine return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -307,7 +307,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): mat = context.material - engine = context.scene.render.engine + engine = context.engine return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -360,7 +360,7 @@ class MATERIAL_PT_shading(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): mat = context.material - engine = context.scene.render.engine + engine = context.engine return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -394,7 +394,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): mat = context.material - engine = context.scene.render.engine + engine = context.engine return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES) def draw_header(self, context): @@ -460,7 +460,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): mat = context.material - engine = context.scene.render.engine + engine = context.engine return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES) def draw_header(self, context): @@ -518,7 +518,7 @@ class MATERIAL_PT_sss(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): mat = context.material - engine = context.scene.render.engine + engine = context.engine return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES) def draw_header(self, context): @@ -569,7 +569,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): mat = context.material - engine = context.scene.render.engine + engine = context.engine return mat and (mat.type == 'HALO') and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -622,7 +622,7 @@ class MATERIAL_PT_flare(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): mat = context.material - engine = context.scene.render.engine + engine = context.engine return mat and (mat.type == 'HALO') and (engine in cls.COMPAT_ENGINES) def draw_header(self, context): @@ -656,7 +656,7 @@ class MATERIAL_PT_game_settings(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): - return context.material and (context.scene.render.engine in cls.COMPAT_ENGINES) + return context.material and (context.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -685,7 +685,7 @@ class MATERIAL_PT_physics(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): - return context.material and (context.scene.render.engine in cls.COMPAT_ENGINES) + return context.material and (context.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -718,7 +718,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): mat = context.material - engine = context.scene.render.engine + engine = context.engine return mat and (mat.type in {'SURFACE', 'WIRE', 'HALO'}) and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -764,7 +764,7 @@ class MATERIAL_PT_options(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): mat = context.material - engine = context.scene.render.engine + engine = context.engine return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -814,7 +814,7 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): mat = context.material - engine = context.scene.render.engine + engine = context.engine return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -864,7 +864,7 @@ class MATERIAL_PT_transp_game(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): mat = context.material - engine = context.scene.render.engine + engine = context.engine return check_material(mat) and (engine in cls.COMPAT_ENGINES) def draw_header(self, context): @@ -897,7 +897,7 @@ class VolumeButtonsPanel: @classmethod def poll(cls, context): mat = context.material - engine = context.scene.render.engine + engine = context.engine return mat and (mat.type == 'VOLUME') and (engine in cls.COMPAT_ENGINES) @@ -982,7 +982,7 @@ class MATERIAL_PT_volume_transp(VolumeButtonsPanel, Panel): @classmethod def poll(cls, context): mat = context.material - engine = context.scene.render.engine + engine = context.engine return mat and simple_material(mat) and (mat.type == 'VOLUME') and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -1023,7 +1023,7 @@ class MATERIAL_PT_volume_options(VolumeButtonsPanel, Panel): @classmethod def poll(cls, context): mat = context.material - engine = context.scene.render.engine + engine = context.engine return check_material(mat) and (mat.type == 'VOLUME') and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -1061,7 +1061,7 @@ class EEVEE_MATERIAL_PT_context_material(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): - engine = context.scene.render.engine + engine = context.engine return (context.material or context.object) and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -1135,7 +1135,7 @@ class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): - engine = context.scene.render.engine + engine = context.engine return context.material and (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -1163,7 +1163,7 @@ class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): - engine = context.scene.render.engine + engine = context.engine return context.material and (engine in cls.COMPAT_ENGINES) def draw(self, context): diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index 0d8309268fb..dc14396a285 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -163,7 +163,7 @@ class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel): split = layout.split() - if context.scene.render.engine != 'BLENDER_GAME': + if context.engine != 'BLENDER_GAME': col = split.column() col.label(text="Tracking Axes:") col.prop(ob, "track_axis", text="Axis") diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index 68f040fb8aa..8d79da4cd89 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -42,7 +42,7 @@ def particle_panel_enabled(context, psys): def particle_panel_poll(cls, context): psys = context.particle_system - engine = context.scene.render.engine + engine = context.engine settings = 0 if psys: @@ -135,13 +135,13 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel): @classmethod def poll(cls, context): - engine = context.scene.render.engine + engine = context.engine return (context.particle_system or context.object or context.space_data.pin_id) and (engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout - if context.scene.render.engine == 'BLENDER_GAME': + if context.engine == 'BLENDER_GAME': layout.label("Not available in the Game Engine") return @@ -319,7 +319,7 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel): @classmethod def poll(cls, context): psys = context.particle_system - engine = context.scene.render.engine + engine = context.engine if psys is None: return False if psys.settings is None: @@ -417,7 +417,7 @@ class PARTICLE_PT_cache(ParticleButtonsPanel, Panel): @classmethod def poll(cls, context): psys = context.particle_system - engine = context.scene.render.engine + engine = context.engine if psys is None: return False if psys.settings is None: @@ -802,7 +802,7 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel): def poll(cls, context): psys = context.particle_system settings = particle_get_settings(context) - engine = context.scene.render.engine + engine = context.engine if settings is None: return False @@ -904,7 +904,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel): @classmethod def poll(cls, context): settings = particle_get_settings(context) - engine = context.scene.render.engine + engine = context.engine if settings is None: return False @@ -1103,7 +1103,7 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, Panel): @classmethod def poll(cls, context): settings = particle_get_settings(context) - engine = context.scene.render.engine + engine = context.engine if settings is None: return False return engine in cls.COMPAT_ENGINES diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py index 6ada3c59942..07f995640c3 100644 --- a/release/scripts/startup/bl_ui/properties_physics_cloth.py +++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py @@ -45,8 +45,8 @@ class PhysicButtonsPanel: @classmethod def poll(cls, context): ob = context.object - rd = context.scene.render - return (ob and ob.type == 'MESH') and (rd.engine in cls.COMPAT_ENGINES) and (context.cloth) + view_render = context.scene.view_render + return (ob and ob.type == 'MESH') and (view_render.engine in cls.COMPAT_ENGINES) and (context.cloth) class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py index 73d3d5fc755..c67b2a57b0c 100644 --- a/release/scripts/startup/bl_ui/properties_physics_common.py +++ b/release/scripts/startup/bl_ui/properties_physics_common.py @@ -30,8 +30,8 @@ class PhysicButtonsPanel: @classmethod def poll(cls, context): - rd = context.scene.render - return (context.object) and rd.engine in cls.COMPAT_ENGINES + view_render = context.scene.view_render + return (context.object) and view_render.engine in cls.COMPAT_ENGINES def physics_add(self, layout, md, name, type, typeicon, toggles): diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 767eb185d8e..c0ecb09d360 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -55,8 +55,8 @@ class PhysicButtonsPanel: @classmethod def poll(cls, context): ob = context.object - rd = context.scene.render - return (ob and ob.type == 'MESH') and rd.engine in cls.COMPAT_ENGINES and context.dynamic_paint + view_render = context.scene.view_render + return (ob and ob.type == 'MESH') and view_render.engine in cls.COMPAT_ENGINES and context.dynamic_paint class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel): @@ -109,7 +109,7 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel): elif md.ui_type == 'BRUSH': brush = md.brush_settings - use_shading_nodes = context.scene.render.use_shading_nodes + use_shading_nodes = context.view_render.use_shading_nodes if brush is None: layout.operator("dpaint.type_toggle", text="Add Brush").type = 'BRUSH' @@ -143,8 +143,8 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.dynamic_paint - rd = context.scene.render - return md and md.ui_type == 'CANVAS' and md.canvas_settings and md.canvas_settings.canvas_surfaces.active and rd.engine in cls.COMPAT_ENGINES + view_render = context.scene.view_render + return md and md.ui_type == 'CANVAS' and md.canvas_settings and md.canvas_settings.canvas_surfaces.active and view_render.engine in cls.COMPAT_ENGINES def draw(self, context): layout = self.layout @@ -220,13 +220,13 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.dynamic_paint - rd = context.scene.render + view_render = context.scene.view_render if not (md and md.ui_type == 'CANVAS' and md.canvas_settings): return 0 surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active return (surface and (not (surface.surface_format == 'VERTEX' and (surface.surface_type in {'DISPLACE', 'WAVE'}))) and - (rd.engine in cls.COMPAT_ENGINES)) + (view_render.engine in cls.COMPAT_ENGINES)) def draw(self, context): layout = self.layout @@ -314,11 +314,11 @@ class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.dynamic_paint - rd = context.scene.render + view_render = context.scene.view_render if not (md and md.ui_type == 'CANVAS' and md.canvas_settings): return 0 surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active - return (surface and surface.surface_type == 'PAINT') and (rd.engine in cls.COMPAT_ENGINES) + return (surface and surface.surface_type == 'PAINT') and (view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -351,11 +351,11 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.dynamic_paint - rd = context.scene.render + view_render = context.scene.view_render if not (md and md.ui_type == 'CANVAS' and md.canvas_settings): return False surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active - return (surface and surface.surface_type == 'PAINT') and (rd.engine in cls.COMPAT_ENGINES) + return (surface and surface.surface_type == 'PAINT') and (view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -401,13 +401,13 @@ class PHYSICS_PT_dp_cache(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.dynamic_paint - rd = context.scene.render + view_render = context.scene.view_render return (md and md.ui_type == 'CANVAS' and md.canvas_settings and md.canvas_settings.canvas_surfaces.active and md.canvas_settings.canvas_surfaces.active.is_cache_user and - (rd.engine in cls.COMPAT_ENGINES)) + (view_render.engine in cls.COMPAT_ENGINES)) def draw(self, context): surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active @@ -423,8 +423,8 @@ class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.dynamic_paint - rd = context.scene.render - return md and md.ui_type == 'BRUSH' and md.brush_settings and (rd.engine in cls.COMPAT_ENGINES) + view_render = context.scene.view_render + return md and md.ui_type == 'BRUSH' and md.brush_settings and (view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -477,8 +477,8 @@ class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.dynamic_paint - rd = context.scene.render - return md and md.ui_type == 'BRUSH' and md.brush_settings and (rd.engine in cls.COMPAT_ENGINES) + view_render = context.scene.view_render + return md and md.ui_type == 'BRUSH' and md.brush_settings and (view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -514,8 +514,8 @@ class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.dynamic_paint - rd = context.scene.render - return md and md.ui_type == 'BRUSH' and md.brush_settings and (rd.engine in cls.COMPAT_ENGINES) + view_render = context.scene.view_render + return md and md.ui_type == 'BRUSH' and md.brush_settings and (view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout diff --git a/release/scripts/startup/bl_ui/properties_physics_field.py b/release/scripts/startup/bl_ui/properties_physics_field.py index bb15ba5e189..fd212beee97 100644 --- a/release/scripts/startup/bl_ui/properties_physics_field.py +++ b/release/scripts/startup/bl_ui/properties_physics_field.py @@ -33,8 +33,8 @@ class PhysicButtonsPanel: @classmethod def poll(cls, context): - rd = context.scene.render - return (context.object) and (rd.engine in cls.COMPAT_ENGINES) + view_render = context.scene.view_render + return (context.object) and (view_render.engine in cls.COMPAT_ENGINES) class PHYSICS_PT_field(PhysicButtonsPanel, Panel): @@ -44,8 +44,8 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): ob = context.object - rd = context.scene.render - return (rd.engine in cls.COMPAT_ENGINES) and (ob.field) and (ob.field.type != 'NONE') + view_render = context.scene.view_render + return (view_render.engine in cls.COMPAT_ENGINES) and (ob.field) and (ob.field.type != 'NONE') def draw(self, context): layout = self.layout @@ -182,8 +182,8 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): ob = context.object - rd = context.scene.render - return (ob and ob.type == 'MESH') and (rd.engine in cls.COMPAT_ENGINES) and (context.collision) + view_render = context.scene.view_render + return (ob and ob.type == 'MESH') and (view_render.engine in cls.COMPAT_ENGINES) and (context.collision) def draw(self, context): layout = self.layout diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py index ab92370f9ae..61ca23be4bc 100644 --- a/release/scripts/startup/bl_ui/properties_physics_fluid.py +++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py @@ -37,8 +37,8 @@ class PhysicButtonsPanel: @classmethod def poll(cls, context): ob = context.object - rd = context.scene.render - return (ob and ob.type == 'MESH') and rd.engine in cls.COMPAT_ENGINES and (context.fluid) + view_render = context.scene.view_render + return (ob and ob.type == 'MESH') and view_render.engine in cls.COMPAT_ENGINES and (context.fluid) class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel): @@ -211,8 +211,8 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.fluid - rd = context.scene.render - return md and md.settings and (md.settings.type == 'DOMAIN') and rd.engine in cls.COMPAT_ENGINES + view_render = context.scene.view_render + return md and md.settings and (md.settings.type == 'DOMAIN') and view_render.engine in cls.COMPAT_ENGINES def draw(self, context): layout = self.layout @@ -265,8 +265,8 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.fluid - rd = context.scene.render - return md and md.settings and (md.settings.type == 'DOMAIN') and rd.engine in cls.COMPAT_ENGINES + view_render = context.scene.view_render + return md and md.settings and (md.settings.type == 'DOMAIN') and view_render.engine in cls.COMPAT_ENGINES def draw(self, context): layout = self.layout @@ -296,8 +296,8 @@ class PHYSICS_PT_domain_particles(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.fluid - rd = context.scene.render - return md and md.settings and (md.settings.type == 'DOMAIN') and rd.engine in cls.COMPAT_ENGINES + view_render = context.scene.view_render + return md and md.settings and (md.settings.type == 'DOMAIN') and view_render.engine in cls.COMPAT_ENGINES def draw(self, context): layout = self.layout diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py index 6afdd800b88..21453ff3642 100644 --- a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py +++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py @@ -35,7 +35,7 @@ class PHYSICS_PT_rigid_body(PHYSICS_PT_rigidbody_panel, Panel): def poll(cls, context): obj = context.object return (obj and obj.rigid_body and - (context.scene.render.engine in cls.COMPAT_ENGINES)) + (context.engine in cls.COMPAT_ENGINES)) def draw(self, context): layout = self.layout @@ -62,7 +62,7 @@ class PHYSICS_PT_rigid_body_collisions(PHYSICS_PT_rigidbody_panel, Panel): def poll(cls, context): obj = context.object return (obj and obj.rigid_body and - (context.scene.render.engine in cls.COMPAT_ENGINES)) + (context.engine in cls.COMPAT_ENGINES)) def draw(self, context): layout = self.layout @@ -108,7 +108,7 @@ class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel): obj = context.object return (obj and obj.rigid_body and obj.rigid_body.type == 'ACTIVE' and - (context.scene.render.engine in cls.COMPAT_ENGINES)) + (context.engine in cls.COMPAT_ENGINES)) def draw(self, context): layout = self.layout diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py index 84a4cbb4b68..a9b30c3b388 100644 --- a/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py +++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py @@ -34,8 +34,8 @@ class PHYSICS_PT_rigid_body_constraint(PHYSICS_PT_rigidbody_constraint_panel, Pa @classmethod def poll(cls, context): ob = context.object - rd = context.scene.render - return (ob and ob.rigid_body_constraint and rd.engine in cls.COMPAT_ENGINES) + view_render = context.scene.view_render + return (ob and ob.rigid_body_constraint and view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py index bf070bf6acb..f9aba70bb75 100644 --- a/release/scripts/startup/bl_ui/properties_physics_smoke.py +++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py @@ -34,8 +34,8 @@ class PhysicButtonsPanel: @classmethod def poll(cls, context): ob = context.object - rd = context.scene.render - return (ob and ob.type == 'MESH') and (rd.engine in cls.COMPAT_ENGINES) and (context.smoke) + view_render = context.scene.view_render + return (ob and ob.type == 'MESH') and (view_render.engine in cls.COMPAT_ENGINES) and (context.smoke) class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel): @@ -240,8 +240,8 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.smoke - rd = context.scene.render - return md and (md.smoke_type == 'DOMAIN') and (rd.engine in cls.COMPAT_ENGINES) + view_render = context.scene.view_render + return md and (md.smoke_type == 'DOMAIN') and (view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): md = context.smoke.domain_settings @@ -280,8 +280,8 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.smoke - rd = context.scene.render - return md and (md.smoke_type == 'DOMAIN') and (rd.engine in cls.COMPAT_ENGINES) + view_render = context.scene.view_render + return md and (md.smoke_type == 'DOMAIN') and (view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -309,8 +309,8 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.smoke - rd = context.scene.render - return md and (md.smoke_type == 'DOMAIN') and (rd.engine in cls.COMPAT_ENGINES) + view_render = context.scene.view_render + return md and (md.smoke_type == 'DOMAIN') and (view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -346,8 +346,8 @@ class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.smoke - rd = context.scene.render - return md and (md.smoke_type == 'DOMAIN') and (rd.engine in cls.COMPAT_ENGINES) + view_render = context.scene.view_render + return md and (md.smoke_type == 'DOMAIN') and (view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): domain = context.smoke.domain_settings @@ -361,8 +361,8 @@ class PHYSICS_PT_smoke_display_settings(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): md = context.smoke - rd = context.scene.render - return md and (md.smoke_type == 'DOMAIN') and (not rd.use_game_engine) + view_render = context.scene.view_render + return md and (md.smoke_type == 'DOMAIN') and (not view_render.use_game_engine) def draw(self, context): domain = context.smoke.domain_settings diff --git a/release/scripts/startup/bl_ui/properties_physics_softbody.py b/release/scripts/startup/bl_ui/properties_physics_softbody.py index 5efe105e7d8..186ba19f62d 100644 --- a/release/scripts/startup/bl_ui/properties_physics_softbody.py +++ b/release/scripts/startup/bl_ui/properties_physics_softbody.py @@ -41,8 +41,8 @@ class PhysicButtonsPanel: @classmethod def poll(cls, context): ob = context.object - rd = context.scene.render - return ob and ob.type in COMPAT_OB_TYPES and rd.engine in cls.COMPAT_ENGINES and context.soft_body + view_render = context.scene.view_render + return ob and ob.type in COMPAT_OB_TYPES and view_render.engine in cls.COMPAT_ENGINES and context.soft_body class PHYSICS_PT_softbody(PhysicButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index 06c562445f9..6ce11bf7c4d 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -52,7 +52,28 @@ class RenderButtonsPanel: @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) + + +class RENDER_PT_context(Panel): + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "render" + bl_options = {'HIDE_HEADER'} + bl_label = "" + + @classmethod + def poll(cls, context): + return context.scene + + def draw(self, context): + layout = self.layout + + scene = context.scene + view_render = scene.view_render + + if view_render.has_multiple_engines: + layout.prop(view_render, "engine", text="") class RENDER_PT_render(RenderButtonsPanel, Panel): @@ -207,8 +228,10 @@ class RENDER_PT_motion_blur(RenderButtonsPanel, Panel): @classmethod def poll(cls, context): - rd = context.scene.render - return not rd.use_full_sample and (rd.engine in cls.COMPAT_ENGINES) + scene = context.scene + rd = scene.render + view_render = scene.view_render + return not rd.use_full_sample and (view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): rd = context.scene.render @@ -595,7 +618,7 @@ class RENDER_PT_eevee_ambient_occlusion(RenderButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): scene = context.scene @@ -626,7 +649,7 @@ class RENDER_PT_eevee_motion_blur(RenderButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): scene = context.scene @@ -652,7 +675,7 @@ class RENDER_PT_eevee_depth_of_field(RenderButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): scene = context.scene @@ -678,7 +701,7 @@ class RENDER_PT_eevee_bloom(RenderButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): scene = context.scene @@ -708,7 +731,7 @@ class RENDER_PT_eevee_volumetric(RenderButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): scene = context.scene @@ -741,7 +764,7 @@ class RENDER_PT_eevee_screen_space_reflections(RenderButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): scene = context.scene @@ -773,7 +796,7 @@ class RENDER_PT_eevee_shadows(RenderButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -794,7 +817,7 @@ class RENDER_PT_eevee_sampling(RenderButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -813,7 +836,7 @@ class RENDER_PT_eevee_indirect_lighting(RenderButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -829,6 +852,7 @@ classes = ( RENDER_MT_presets, RENDER_MT_ffmpeg_presets, RENDER_MT_framerate_presets, + RENDER_PT_context, RENDER_PT_render, RENDER_PT_dimensions, RENDER_PT_antialiasing, diff --git a/release/scripts/startup/bl_ui/properties_render_layer.py b/release/scripts/startup/bl_ui/properties_render_layer.py index a53de764405..99776723fd9 100644 --- a/release/scripts/startup/bl_ui/properties_render_layer.py +++ b/release/scripts/startup/bl_ui/properties_render_layer.py @@ -30,7 +30,7 @@ class RenderLayerButtonsPanel: @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) class RENDERLAYER_UL_renderlayers(UIList): @@ -54,9 +54,9 @@ class RENDERLAYER_PT_layers(RenderLayerButtonsPanel, Panel): layout = self.layout scene = context.scene - rd = scene.render + view_render = scene.view_render - if rd.engine == 'BLENDER_GAME': + if view_render.engine == 'BLENDER_GAME': layout.label("Not available in the Game Engine") return @@ -137,7 +137,7 @@ class RENDERLAYER_PT_clay_settings(RenderLayerButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -158,7 +158,7 @@ class RENDERLAYER_PT_eevee_ambient_occlusion(RenderLayerButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): scene = context.scene @@ -193,7 +193,7 @@ class RENDERLAYER_PT_eevee_motion_blur(RenderLayerButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): scene = context.scene @@ -223,7 +223,7 @@ class RENDERLAYER_PT_eevee_depth_of_field(RenderLayerButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): scene = context.scene @@ -253,7 +253,7 @@ class RENDERLAYER_PT_eevee_bloom(RenderLayerButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): scene = context.scene @@ -287,7 +287,7 @@ class RENDERLAYER_PT_eevee_volumetric(RenderLayerButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): scene = context.scene @@ -324,7 +324,7 @@ class RENDERLAYER_PT_eevee_screen_space_reflections(RenderLayerButtonsPanel, Pan @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): scene = context.scene @@ -360,7 +360,7 @@ class RENDERLAYER_PT_eevee_shadows(RenderLayerButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -383,7 +383,7 @@ class RENDERLAYER_PT_eevee_sampling(RenderLayerButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -404,7 +404,7 @@ class RENDERLAYER_PT_eevee_indirect_lighting(RenderLayerButtonsPanel, Panel): @classmethod def poll(cls, context): scene = context.scene - return scene and (scene.render.engine in cls.COMPAT_ENGINES) + return scene and (scene.view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index 8c65ed2b78a..a143433a28e 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -60,8 +60,8 @@ class SceneButtonsPanel: @classmethod def poll(cls, context): - rd = context.scene.render - return context.scene and (rd.engine in cls.COMPAT_ENGINES) + view_render = context.scene.view_render + return context.scene and (view_render.engine in cls.COMPAT_ENGINES) class SCENE_PT_scene(SceneButtonsPanel, Panel): @@ -75,7 +75,7 @@ class SCENE_PT_scene(SceneButtonsPanel, Panel): layout.prop(scene, "camera") layout.prop(scene, "background_set", text="Background") - if context.scene.render.engine != 'BLENDER_GAME': + if context.engine != 'BLENDER_GAME': layout.prop(scene, "active_clip", text="Active Clip") @@ -333,7 +333,7 @@ class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel): def poll(cls, context): scene = context.scene rd = scene.render - return scene and (rd.engine in cls.COMPAT_ENGINES) + return scene and (view_render.engine in cls.COMPAT_ENGINES) def draw_header(self, context): scene = context.scene @@ -378,9 +378,9 @@ class SCENE_PT_rigid_body_cache(SceneButtonsPanel, Panel): @classmethod def poll(cls, context): - rd = context.scene.render scene = context.scene - return scene and scene.rigidbody_world and (rd.engine in cls.COMPAT_ENGINES) + view_render = scene.view_render + return scene and scene.rigidbody_world and (view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): scene = context.scene @@ -396,9 +396,9 @@ class SCENE_PT_rigid_body_field_weights(SceneButtonsPanel, Panel): @classmethod def poll(cls, context): - rd = context.scene.render + view_render = context.scene.view_render scene = context.scene - return scene and scene.rigidbody_world and (rd.engine in cls.COMPAT_ENGINES) + return scene and scene.rigidbody_world and (view_render.engine in cls.COMPAT_ENGINES) def draw(self, context): scene = context.scene @@ -412,13 +412,13 @@ class SCENE_PT_simplify(SceneButtonsPanel, Panel): COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} def draw_header(self, context): - rd = context.scene.render + view_render = context.scene.view_render self.layout.prop(rd, "use_simplify", text="") def draw(self, context): layout = self.layout - rd = context.scene.render + view_render = context.scene.view_render layout.active = rd.use_simplify diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index d309b909f92..86863b93ce3 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -125,7 +125,7 @@ class TextureButtonsPanel: @classmethod def poll(cls, context): tex = context.texture - return tex and (tex.type != 'NONE' or tex.use_nodes) and (context.scene.render.engine in cls.COMPAT_ENGINES) + return tex and (tex.type != 'NONE' or tex.use_nodes) and (context.engine in cls.COMPAT_ENGINES) class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel): @@ -135,7 +135,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel): @classmethod def poll(cls, context): - engine = context.scene.render.engine + engine = context.engine # if not (hasattr(context, "texture_slot") or hasattr(context, "texture_node")): # return False return ((context.material or @@ -292,7 +292,7 @@ class TextureSlotPanel(TextureButtonsPanel): if not hasattr(context, "texture_slot"): return False - engine = context.scene.render.engine + engine = context.engine return TextureButtonsPanel.poll(cls, context) and (engine in cls.COMPAT_ENGINES) @@ -304,7 +304,7 @@ class TextureTypePanel(TextureButtonsPanel): @classmethod def poll(cls, context): tex = context.texture - engine = context.scene.render.engine + engine = context.engine return tex and ((tex.type == cls.tex_type and not tex.use_nodes) and (engine in cls.COMPAT_ENGINES)) @@ -474,7 +474,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel): COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} def draw(self, context): - if context.scene.render.engine == 'BLENDER_GAME': + if context.engine == 'BLENDER_GAME': self.draw_bge(context) else: self.draw_bi(context) @@ -756,7 +756,7 @@ class TEXTURE_PT_voxeldata(TextureButtonsPanel, Panel): @classmethod def poll(cls, context): tex = context.texture - engine = context.scene.render.engine + engine = context.engine return tex and (tex.type == 'VOXEL_DATA' and (engine in cls.COMPAT_ENGINES)) def draw(self, context): @@ -799,7 +799,7 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel, Panel): @classmethod def poll(cls, context): tex = context.texture - engine = context.scene.render.engine + engine = context.engine return tex and (tex.type == 'POINT_DENSITY' and (engine in cls.COMPAT_ENGINES)) def draw(self, context): @@ -874,7 +874,7 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, Panel): @classmethod def poll(cls, context): tex = context.texture - engine = context.scene.render.engine + engine = context.engine return tex and (tex.type == 'POINT_DENSITY' and (engine in cls.COMPAT_ENGINES)) def draw_header(self, context): @@ -933,7 +933,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel): if not getattr(context, "texture_slot", None): return False - engine = context.scene.render.engine + engine = context.engine return (engine in cls.COMPAT_ENGINES) def draw(self, context): @@ -1036,7 +1036,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): if not getattr(context, "texture_slot", None): return False - engine = context.scene.render.engine + engine = context.engine return (engine in cls.COMPAT_ENGINES) def draw(self, context): diff --git a/release/scripts/startup/bl_ui/properties_world.py b/release/scripts/startup/bl_ui/properties_world.py index 6e06d0593ff..e56a7977791 100644 --- a/release/scripts/startup/bl_ui/properties_world.py +++ b/release/scripts/startup/bl_ui/properties_world.py @@ -31,7 +31,7 @@ class WorldButtonsPanel: @classmethod def poll(cls, context): - return (context.world and context.scene.render.engine in cls.COMPAT_ENGINES) + return (context.world and context.engine in cls.COMPAT_ENGINES) class WORLD_PT_context_world(WorldButtonsPanel, Panel): @@ -41,8 +41,8 @@ class WORLD_PT_context_world(WorldButtonsPanel, Panel): @classmethod def poll(cls, context): - rd = context.scene.render - return rd.engine in cls.COMPAT_ENGINES + view_render = context.scene.view_render + return view_render.engine in cls.COMPAT_ENGINES def draw(self, context): layout = self.layout @@ -69,8 +69,7 @@ class WORLD_PT_preview(WorldButtonsPanel, Panel): @classmethod def poll(cls, context): - rd = context.scene.render - return (context.world) and (rd.engine in cls.COMPAT_ENGINES) + return (context.world) and (context.engine in cls.COMPAT_ENGINES) def draw(self, context): self.layout.template_preview(context.world) @@ -257,7 +256,7 @@ class EEVEE_WORLD_PT_surface(WorldButtonsPanel, Panel): @classmethod def poll(cls, context): - engine = context.scene.render.engine + engine = context.engine return context.world and (engine in cls.COMPAT_ENGINES) def draw(self, context): diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 5d3f4585a8a..c105e72b1e5 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -608,7 +608,7 @@ class IMAGE_PT_game_properties(Panel): def poll(cls, context): sima = context.space_data # display even when not in game mode because these settings effect the 3d view - return (sima and sima.image and not sima.show_maskedit) # and (rd.engine == 'BLENDER_GAME') + return (sima and sima.image and not sima.show_maskedit) # and (view_render.engine == 'BLENDER_GAME') def draw(self, context): layout = self.layout diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index f05808c7a2c..aa999e72f7d 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -32,7 +32,7 @@ class INFO_HT_header(Header): screen = context.screen scene = context.scene layer = context.render_layer - rd = scene.render + view_render = workspace.view_render row = layout.row(align=True) row.template_header() @@ -54,15 +54,17 @@ class INFO_HT_header(Header): act_mode_item = bpy.types.Object.bl_rna.properties['mode'].enum_items[layer.objects.active.mode] layout.operator_menu_enum("object.mode_set", "mode", text=act_mode_item.name, icon=act_mode_item.icon) - layout.template_search(workspace, "render_layer", scene, "render_layers") + row = layout.row() + row.active = not workspace.use_scene_settings + row.template_search(workspace, "render_layer", scene, "render_layers") + + if view_render.has_multiple_engines: + row.prop(view_render, "engine", text="") layout.separator() layout.template_ID(window, "scene", new="scene.new", unlink="scene.delete") - if rd.has_multiple_engines: - layout.prop(rd, "engine", text="") - layout.separator() layout.template_running_jobs() @@ -96,12 +98,11 @@ class INFO_MT_editor_menus(Menu): @staticmethod def draw_menus(layout, context): - scene = context.scene - rd = scene.render + view_render = context.view_render layout.menu("INFO_MT_file") - if rd.use_game_engine: + if view_render.use_game_engine: layout.menu("INFO_MT_game") else: layout.menu("INFO_MT_render") diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 3def0ca6328..335ef67c847 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -51,13 +51,14 @@ class NODE_HT_header(Header): NODE_MT_editor_menus.draw_collapsible(context, layout) layout.prop(snode, "tree_type", text="", expand=True) + use_shading_nodes = scene.view_render.use_shading_nodes or context.view_render.use_shading_nodes if snode.tree_type == 'ShaderNodeTree': - if scene.render.use_shading_nodes: + if use_shading_nodes: layout.prop(snode, "shader_type", text="", expand=True) ob = context.object - if (not scene.render.use_shading_nodes or snode.shader_type == 'OBJECT') and ob: + if (not use_shading_nodes or snode.shader_type == 'OBJECT') and ob: row = layout.row() # disable material slot buttons when pinned, cannot find correct slot within id_from (#36589) row.enabled = not snode.pin @@ -69,17 +70,17 @@ class NODE_HT_header(Header): row.template_ID(id_from, "active_material", new="material.new") # Don't show "Use Nodes" Button when Engine is BI for Lamps - if snode_id and not (scene.render.use_shading_nodes == 0 and ob.type == 'LAMP'): + if snode_id and not (use_shading_nodes == 0 and ob.type == 'LAMP'): layout.prop(snode_id, "use_nodes") - if scene.render.use_shading_nodes and snode.shader_type == 'WORLD': + if use_shading_nodes and snode.shader_type == 'WORLD': row = layout.row() row.enabled = not snode.pin row.template_ID(scene, "world", new="world.new") if snode_id: row.prop(snode_id, "use_nodes") - if scene.render.use_shading_nodes and snode.shader_type == 'LINESTYLE': + if use_shading_nodes and snode.shader_type == 'LINESTYLE': rl = context.scene.render.layers.active lineset = rl.freestyle_settings.linesets.active if lineset is not None: diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index a31fd81efb5..9bdf1c67f2b 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -1451,8 +1451,9 @@ class VIEW3D_MT_object_specials(Menu): lamp = obj.data layout.operator_context = 'INVOKE_REGION_WIN' + use_shading_nodes = context.view_render.use_shading_nodes - if scene.render.use_shading_nodes: + if use_shading_nodes: try: value = lamp.node_tree.nodes["Emission"].inputs["Strength"].default_value except AttributeError: @@ -1510,7 +1511,7 @@ class VIEW3D_MT_object_specials(Menu): props.input_scale = -0.01 props.header_text = "Spot Blend: %.2f" - if not scene.render.use_shading_nodes: + if not use_shading_nodes: props = layout.operator("wm.context_modal_mouse", text="Clip Start") props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.shadow_buffer_clip_start" diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 5430b108642..88e6f5df86b 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1199,7 +1199,7 @@ class TEXTURE_UL_texpaintslots(UIList): if self.layout_type in {'DEFAULT', 'COMPACT'}: layout.prop(item, "name", text="", emboss=False, icon_value=icon) - if (not mat.use_nodes) and context.scene.render.engine in {'BLENDER_RENDER', 'BLENDER_GAME'}: + if (not mat.use_nodes) and context.engine in {'BLENDER_RENDER', 'BLENDER_GAME'}: mtex_index = mat.texture_paint_slots[index].index layout.prop(mat, "use_textures", text="", index=mtex_index) elif self.layout_type == 'GRID': @@ -1262,7 +1262,7 @@ class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel): else: slot = None - if (not mat.use_nodes) and context.scene.render.engine in {'BLENDER_RENDER', 'BLENDER_GAME'}: + if (not mat.use_nodes) and context.engine in {'BLENDER_RENDER', 'BLENDER_GAME'}: row = col.row(align=True) row.operator_menu_enum("paint.add_texture_paint_slot", "type") row.operator("paint.delete_texture_paint_slot", text="", icon='X') diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index 341efd78f5e..a2bceef7dab 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -47,14 +47,14 @@ class ShaderNewNodeCategory(SortedNodeCategory): @classmethod def poll(cls, context): return (context.space_data.tree_type == 'ShaderNodeTree' and - context.scene.render.use_shading_nodes) + context.view_render.use_shading_nodes) class ShaderOldNodeCategory(SortedNodeCategory): @classmethod def poll(cls, context): return (context.space_data.tree_type == 'ShaderNodeTree' and - not context.scene.render.use_shading_nodes) + not context.view_render.use_shading_nodes) class TextureNodeCategory(SortedNodeCategory): @@ -142,11 +142,11 @@ def object_shader_nodes_poll(context): def cycles_shader_nodes_poll(context): - return context.scene.render.engine == 'CYCLES' + return context.view_render.engine == 'CYCLES' def eevee_shader_nodes_poll(context): - return context.scene.render.engine == 'BLENDER_EEVEE' + return context.view_render.engine == 'BLENDER_EEVEE' def eevee_cycles_shader_nodes_poll(context): |