Workspaces: remove workspace engine, use 3D viewport draw mode instead.
ViewRender was removed, which means we can't get the render engine for files saved in 2.8. We assume that any files saved in 2.8 were intended to use Eevee and set the engine to that. A fix included with this is that .blend thumbails now draw with Clay mode, and never Eevee or Cycles. These were drawn with solid mode in 2.7, and should be very fast and not e.g. load heavy image textures. Differential Revision: https://developer.blender.org/D3156
This commit is contained in:
@@ -365,7 +365,7 @@ class QuickSmoke(Operator):
|
||||
# Setup material
|
||||
|
||||
# Cycles
|
||||
if context.scene.view_render.use_shading_nodes or context.view_render.use_shading_nodes:
|
||||
if context.scene.render.use_shading_nodes or context.render.use_shading_nodes:
|
||||
bpy.ops.object.material_slot_add()
|
||||
|
||||
mat = bpy.data.materials.new("Smoke Domain Material")
|
||||
|
||||
@@ -65,7 +65,7 @@ class COLLECTION_PT_clay_settings(CollectionButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.view_render.engine in cls.COMPAT_ENGINES
|
||||
return context.engine in cls.COMPAT_ENGINES
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
@@ -147,11 +147,11 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
view_render = context.scene.view_render
|
||||
render = context.scene.render
|
||||
st = context.camera.stereo
|
||||
cam = context.camera
|
||||
|
||||
is_spherical_stereo = cam.type != 'ORTHO' and view_render.use_spherical_stereo
|
||||
is_spherical_stereo = cam.type != 'ORTHO' and render.use_spherical_stereo
|
||||
use_spherical_stereo = is_spherical_stereo and st.use_spherical_stereo
|
||||
|
||||
col = layout.column()
|
||||
|
||||
@@ -935,7 +935,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
||||
col = split.column()
|
||||
|
||||
scene = context.scene
|
||||
engine = scene.view_render.engine
|
||||
engine = context.engine
|
||||
show_adaptive_options = (
|
||||
engine == 'CYCLES' and md == ob.modifiers[-1] and
|
||||
scene.cycles.feature_set == 'EXPERIMENTAL'
|
||||
|
||||
@@ -51,15 +51,11 @@ class WORKSPACE_PT_workspace(WorkSpaceButtonsPanel, Panel):
|
||||
window = context.window
|
||||
workspace = context.workspace
|
||||
scene = context.scene
|
||||
view_render = workspace.view_render
|
||||
|
||||
layout.enabled = not workspace.use_scene_settings
|
||||
|
||||
layout.template_search(window, "view_layer", scene, "view_layers")
|
||||
|
||||
if view_render.has_multiple_engines:
|
||||
layout.prop(view_render, "engine", text="")
|
||||
|
||||
|
||||
class WORKSPACE_PT_owner_ids(WorkSpaceButtonsPanel, Panel):
|
||||
bl_label = "Workspace Add-ons"
|
||||
|
||||
@@ -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.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return scene and with_freestyle and(context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
|
||||
class RENDER_PT_freestyle(RenderFreestyleButtonsPanel, Panel):
|
||||
@@ -75,7 +75,7 @@ class ViewLayerFreestyleButtonsPanel:
|
||||
with_freestyle = bpy.app.build_options.freestyle
|
||||
|
||||
return (scene and with_freestyle and rd.use_freestyle and
|
||||
scene.view_layers.active and(scene.view_render.engine in cls.COMPAT_ENGINES))
|
||||
scene.view_layers.active and(context.engine in cls.COMPAT_ENGINES))
|
||||
|
||||
|
||||
class ViewLayerFreestyleEditorButtonsPanel(ViewLayerFreestyleButtonsPanel):
|
||||
@@ -185,7 +185,6 @@ class VIEWLAYER_PT_freestyle_lineset(ViewLayerFreestyleEditorButtonsPanel, Panel
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
view_render = scene.view_render
|
||||
|
||||
view_layer = scene.view_layers.active
|
||||
freestyle = view_layer.freestyle_settings
|
||||
@@ -782,7 +781,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
|
||||
layout.separator()
|
||||
|
||||
row = layout.row()
|
||||
if view_render.use_shading_nodes:
|
||||
if scene.render.use_shading_nodes:
|
||||
row.prop(linestyle, "use_nodes")
|
||||
else:
|
||||
row.prop(linestyle, "use_texture")
|
||||
@@ -813,7 +812,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.view_render.engine in cls.COMPAT_ENGINES)
|
||||
(context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
|
||||
class MATERIAL_PT_freestyle_line(MaterialFreestyleButtonsPanel, Panel):
|
||||
|
||||
@@ -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.view_render.use_shading_nodes:
|
||||
if ma and not context.scene.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))
|
||||
|
||||
@@ -45,8 +45,7 @@ class PhysicButtonsPanel:
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
ob = context.object
|
||||
view_render = context.scene.view_render
|
||||
return (ob and ob.type == 'MESH') and (view_render.engine in cls.COMPAT_ENGINES) and (context.cloth)
|
||||
return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.cloth)
|
||||
|
||||
|
||||
class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel):
|
||||
|
||||
@@ -30,8 +30,7 @@ class PhysicButtonsPanel:
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
view_render = context.scene.view_render
|
||||
return (context.object) and view_render.engine in cls.COMPAT_ENGINES
|
||||
return (context.object) and context.engine in cls.COMPAT_ENGINES
|
||||
|
||||
|
||||
def physics_add(self, layout, md, name, type, typeicon, toggles):
|
||||
|
||||
@@ -55,8 +55,7 @@ class PhysicButtonsPanel:
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
ob = context.object
|
||||
view_render = context.scene.view_render
|
||||
return (ob and ob.type == 'MESH') and view_render.engine in cls.COMPAT_ENGINES and context.dynamic_paint
|
||||
return (ob and ob.type == 'MESH') and context.engine in cls.COMPAT_ENGINES and context.dynamic_paint
|
||||
|
||||
|
||||
class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel):
|
||||
@@ -109,7 +108,7 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel):
|
||||
|
||||
elif md.ui_type == 'BRUSH':
|
||||
brush = md.brush_settings
|
||||
use_shading_nodes = context.view_render.use_shading_nodes
|
||||
use_shading_nodes = context.scene.render.use_shading_nodes
|
||||
|
||||
if brush is None:
|
||||
layout.operator("dpaint.type_toggle", text="Add Brush").type = 'BRUSH'
|
||||
@@ -143,8 +142,7 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
md = context.dynamic_paint
|
||||
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
|
||||
return md and md.ui_type == 'CANVAS' and md.canvas_settings and md.canvas_settings.canvas_surfaces.active and context.engine in cls.COMPAT_ENGINES
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -220,13 +218,12 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
md = context.dynamic_paint
|
||||
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
|
||||
(view_render.engine in cls.COMPAT_ENGINES))
|
||||
(context.engine in cls.COMPAT_ENGINES))
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -314,11 +311,10 @@ class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
md = context.dynamic_paint
|
||||
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 (view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (surface and surface.surface_type == 'PAINT') and (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -351,11 +347,10 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
md = context.dynamic_paint
|
||||
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 (view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (surface and surface.surface_type == 'PAINT') and (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -401,13 +396,12 @@ class PHYSICS_PT_dp_cache(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
md = context.dynamic_paint
|
||||
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
|
||||
(view_render.engine in cls.COMPAT_ENGINES))
|
||||
(context.engine in cls.COMPAT_ENGINES))
|
||||
|
||||
def draw(self, context):
|
||||
surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
|
||||
@@ -423,8 +417,7 @@ class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
md = context.dynamic_paint
|
||||
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)
|
||||
return md and md.ui_type == 'BRUSH' and md.brush_settings and (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -477,8 +470,7 @@ class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
md = context.dynamic_paint
|
||||
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)
|
||||
return md and md.ui_type == 'BRUSH' and md.brush_settings and (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -514,8 +506,7 @@ class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
md = context.dynamic_paint
|
||||
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)
|
||||
return md and md.ui_type == 'BRUSH' and md.brush_settings and (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
@@ -33,8 +33,7 @@ class PhysicButtonsPanel:
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
view_render = context.scene.view_render
|
||||
return (context.object) and (view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.object) and (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
|
||||
class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
|
||||
@@ -44,8 +43,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
ob = context.object
|
||||
view_render = context.scene.view_render
|
||||
return (view_render.engine in cls.COMPAT_ENGINES) and (ob.field) and (ob.field.type != 'NONE')
|
||||
return (context.engine in cls.COMPAT_ENGINES) and (ob.field) and (ob.field.type != 'NONE')
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -182,8 +180,7 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
ob = context.object
|
||||
view_render = context.scene.view_render
|
||||
return (ob and ob.type == 'MESH') and (view_render.engine in cls.COMPAT_ENGINES) and (context.collision)
|
||||
return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.collision)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
@@ -37,8 +37,7 @@ class PhysicButtonsPanel:
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
ob = context.object
|
||||
view_render = context.scene.view_render
|
||||
return (ob and ob.type == 'MESH') and view_render.engine in cls.COMPAT_ENGINES and (context.fluid)
|
||||
return (ob and ob.type == 'MESH') and context.engine in cls.COMPAT_ENGINES and (context.fluid)
|
||||
|
||||
|
||||
class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
|
||||
@@ -211,8 +210,7 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
md = context.fluid
|
||||
view_render = context.scene.view_render
|
||||
return md and md.settings and (md.settings.type == 'DOMAIN') and view_render.engine in cls.COMPAT_ENGINES
|
||||
return md and md.settings and (md.settings.type == 'DOMAIN') and context.engine in cls.COMPAT_ENGINES
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -265,8 +263,7 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
md = context.fluid
|
||||
view_render = context.scene.view_render
|
||||
return md and md.settings and (md.settings.type == 'DOMAIN') and view_render.engine in cls.COMPAT_ENGINES
|
||||
return md and md.settings and (md.settings.type == 'DOMAIN') and context.engine in cls.COMPAT_ENGINES
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -296,8 +293,7 @@ class PHYSICS_PT_domain_particles(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
md = context.fluid
|
||||
view_render = context.scene.view_render
|
||||
return md and md.settings and (md.settings.type == 'DOMAIN') and view_render.engine in cls.COMPAT_ENGINES
|
||||
return md and md.settings and (md.settings.type == 'DOMAIN') and context.engine in cls.COMPAT_ENGINES
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
@@ -34,8 +34,7 @@ class PHYSICS_PT_rigid_body_constraint(PHYSICS_PT_rigidbody_constraint_panel, Pa
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
ob = context.object
|
||||
view_render = context.scene.view_render
|
||||
return (ob and ob.rigid_body_constraint and view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (ob and ob.rigid_body_constraint and context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
@@ -34,8 +34,7 @@ class PhysicButtonsPanel:
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
ob = context.object
|
||||
view_render = context.scene.view_render
|
||||
return (ob and ob.type == 'MESH') and (view_render.engine in cls.COMPAT_ENGINES) and (context.smoke)
|
||||
return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.smoke)
|
||||
|
||||
|
||||
class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
|
||||
@@ -242,8 +241,7 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
md = context.smoke
|
||||
view_render = context.scene.view_render
|
||||
return md and (md.smoke_type == 'DOMAIN') and (view_render.engine in cls.COMPAT_ENGINES)
|
||||
return md and (md.smoke_type == 'DOMAIN') and (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
md = context.smoke.domain_settings
|
||||
@@ -282,8 +280,7 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
md = context.smoke
|
||||
view_render = context.scene.view_render
|
||||
return md and (md.smoke_type == 'DOMAIN') and (view_render.engine in cls.COMPAT_ENGINES)
|
||||
return md and (md.smoke_type == 'DOMAIN') and (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -311,8 +308,7 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
md = context.smoke
|
||||
view_render = context.scene.view_render
|
||||
return md and (md.smoke_type == 'DOMAIN') and (view_render.engine in cls.COMPAT_ENGINES)
|
||||
return md and (md.smoke_type == 'DOMAIN') and (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -348,8 +344,7 @@ class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
md = context.smoke
|
||||
view_render = context.scene.view_render
|
||||
return md and (md.smoke_type == 'DOMAIN') and (view_render.engine in cls.COMPAT_ENGINES)
|
||||
return md and (md.smoke_type == 'DOMAIN') and (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
domain = context.smoke.domain_settings
|
||||
@@ -363,7 +358,6 @@ class PHYSICS_PT_smoke_display_settings(PhysicButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
md = context.smoke
|
||||
view_render = context.scene.view_render
|
||||
return md and (md.smoke_type == 'DOMAIN')
|
||||
|
||||
def draw(self, context):
|
||||
|
||||
@@ -41,8 +41,7 @@ class PhysicButtonsPanel:
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
ob = context.object
|
||||
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
|
||||
return ob and ob.type in COMPAT_OB_TYPES and context.engine in cls.COMPAT_ENGINES and context.soft_body
|
||||
|
||||
|
||||
class PHYSICS_PT_softbody(PhysicButtonsPanel, Panel):
|
||||
|
||||
@@ -51,8 +51,7 @@ class RenderButtonsPanel:
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
|
||||
class RENDER_PT_context(Panel):
|
||||
@@ -70,10 +69,10 @@ class RENDER_PT_context(Panel):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
view_render = scene.view_render
|
||||
rd = scene.render
|
||||
|
||||
if view_render.has_multiple_engines:
|
||||
layout.prop(view_render, "engine", text="")
|
||||
if rd.has_multiple_engines:
|
||||
layout.prop(rd, "engine", text="")
|
||||
|
||||
|
||||
class RENDER_PT_render(RenderButtonsPanel, Panel):
|
||||
@@ -228,10 +227,8 @@ class RENDER_PT_motion_blur(RenderButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
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)
|
||||
rd = context.scene.render
|
||||
return not rd.use_full_sample and (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render
|
||||
@@ -337,7 +334,7 @@ class RENDER_PT_post_processing(RenderButtonsPanel, Panel):
|
||||
|
||||
split.prop(rd, "dither_intensity", text="Dither", slider=True)
|
||||
|
||||
if context.scene.view_render.engine == 'BLENDER_EEVEE':
|
||||
if context.engine == 'BLENDER_EEVEE':
|
||||
return
|
||||
|
||||
layout.separator()
|
||||
@@ -631,8 +628,7 @@ class RENDER_PT_eevee_ambient_occlusion(RenderButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
scene = context.scene
|
||||
@@ -660,8 +656,7 @@ class RENDER_PT_eevee_motion_blur(RenderButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
scene = context.scene
|
||||
@@ -686,8 +681,7 @@ class RENDER_PT_eevee_depth_of_field(RenderButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
scene = context.scene
|
||||
@@ -712,8 +706,7 @@ class RENDER_PT_eevee_bloom(RenderButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
scene = context.scene
|
||||
@@ -742,8 +735,7 @@ class RENDER_PT_eevee_volumetric(RenderButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
scene = context.scene
|
||||
@@ -776,8 +768,7 @@ class RENDER_PT_eevee_subsurface_scattering(RenderButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
scene = context.scene
|
||||
@@ -802,8 +793,7 @@ class RENDER_PT_eevee_screen_space_reflections(RenderButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
scene = context.scene
|
||||
@@ -833,8 +823,7 @@ class RENDER_PT_eevee_shadows(RenderButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -854,8 +843,7 @@ class RENDER_PT_eevee_sampling(RenderButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -874,8 +862,7 @@ class RENDER_PT_eevee_indirect_lighting(RenderButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -895,8 +882,7 @@ class RENDER_PT_eevee_film(RenderButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
@@ -60,8 +60,7 @@ class SceneButtonsPanel:
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
view_render = context.scene.view_render
|
||||
return context.scene and (view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
|
||||
class SCENE_PT_scene(SceneButtonsPanel, Panel):
|
||||
@@ -330,8 +329,7 @@ class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
scene = context.scene
|
||||
@@ -377,8 +375,7 @@ class SCENE_PT_rigid_body_cache(SceneButtonsPanel, Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
view_render = scene.view_render
|
||||
return scene and scene.rigidbody_world and (view_render.engine in cls.COMPAT_ENGINES)
|
||||
return scene and scene.rigidbody_world and (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
scene = context.scene
|
||||
@@ -394,9 +391,8 @@ class SCENE_PT_rigid_body_field_weights(SceneButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
view_render = context.scene.view_render
|
||||
scene = context.scene
|
||||
return scene and scene.rigidbody_world and (view_render.engine in cls.COMPAT_ENGINES)
|
||||
return scene and scene.rigidbody_world and (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
scene = context.scene
|
||||
|
||||
@@ -29,8 +29,7 @@ class ViewLayerButtonsPanel:
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
|
||||
class VIEWLAYER_UL_viewlayers(UIList):
|
||||
@@ -55,7 +54,6 @@ class VIEWLAYER_PT_layers(ViewLayerButtonsPanel, Panel):
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
view_render = scene.view_render
|
||||
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
@@ -133,8 +131,7 @@ class VIEWLAYER_PT_clay_settings(ViewLayerButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -154,8 +151,7 @@ class VIEWLAYER_PT_eevee_ambient_occlusion(ViewLayerButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
scene = context.scene
|
||||
@@ -187,8 +183,7 @@ class VIEWLAYER_PT_eevee_motion_blur(ViewLayerButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
scene = context.scene
|
||||
@@ -217,8 +212,7 @@ class VIEWLAYER_PT_eevee_depth_of_field(ViewLayerButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
scene = context.scene
|
||||
@@ -247,8 +241,7 @@ class VIEWLAYER_PT_eevee_bloom(ViewLayerButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
scene = context.scene
|
||||
@@ -281,8 +274,7 @@ class VIEWLAYER_PT_eevee_volumetric(ViewLayerButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
scene = context.scene
|
||||
@@ -319,8 +311,7 @@ class VIEWLAYER_PT_eevee_subsurface_scattering(ViewLayerButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
scene = context.scene
|
||||
@@ -350,8 +341,7 @@ class VIEWLAYER_PT_eevee_screen_space_reflections(ViewLayerButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
scene = context.scene
|
||||
@@ -385,8 +375,7 @@ class VIEWLAYER_PT_eevee_shadows(ViewLayerButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -408,8 +397,7 @@ class VIEWLAYER_PT_eevee_sampling(ViewLayerButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -430,8 +418,7 @@ class VIEWLAYER_PT_eevee_indirect_lighting(ViewLayerButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
scene = context.scene
|
||||
return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
@@ -41,8 +41,7 @@ class WORLD_PT_context_world(WorldButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
view_render = context.scene.view_render
|
||||
return view_render.engine in cls.COMPAT_ENGINES
|
||||
return (context.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
@@ -32,7 +32,6 @@ class INFO_HT_header(Header):
|
||||
screen = context.screen
|
||||
scene = context.scene
|
||||
layer = context.view_layer
|
||||
view_render = workspace.view_render
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.template_header()
|
||||
@@ -57,9 +56,6 @@ class INFO_HT_header(Header):
|
||||
# Active workspace view-layer is retrieved through window, not through workspace.
|
||||
row.template_search(window, "view_layer", scene, "view_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")
|
||||
@@ -97,8 +93,6 @@ class INFO_MT_editor_menus(Menu):
|
||||
|
||||
@staticmethod
|
||||
def draw_menus(layout, context):
|
||||
view_render = context.view_render
|
||||
|
||||
layout.menu("INFO_MT_file")
|
||||
layout.menu("INFO_MT_render")
|
||||
layout.menu("INFO_MT_window")
|
||||
|
||||
@@ -51,7 +51,7 @@ 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
|
||||
use_shading_nodes = scene.render.use_shading_nodes
|
||||
|
||||
if snode.tree_type == 'ShaderNodeTree':
|
||||
if use_shading_nodes:
|
||||
|
||||
@@ -1547,7 +1547,7 @@ class VIEW3D_MT_object_specials(Menu):
|
||||
lamp = obj.data
|
||||
|
||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||
use_shading_nodes = context.view_render.use_shading_nodes
|
||||
use_shading_nodes = scene.render.use_shading_nodes
|
||||
|
||||
if use_shading_nodes:
|
||||
emission_node = None
|
||||
|
||||
@@ -47,14 +47,14 @@ class ShaderNewNodeCategory(SortedNodeCategory):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (context.space_data.tree_type == 'ShaderNodeTree' and
|
||||
context.view_render.use_shading_nodes)
|
||||
context.scene.render.use_shading_nodes)
|
||||
|
||||
|
||||
class ShaderOldNodeCategory(SortedNodeCategory):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (context.space_data.tree_type == 'ShaderNodeTree' and
|
||||
not context.view_render.use_shading_nodes)
|
||||
not context.scene.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.view_render.engine == 'CYCLES'
|
||||
return context.engine == 'CYCLES'
|
||||
|
||||
|
||||
def eevee_shader_nodes_poll(context):
|
||||
return context.view_render.engine == 'BLENDER_EEVEE'
|
||||
return context.engine == 'BLENDER_EEVEE'
|
||||
|
||||
|
||||
def eevee_cycles_shader_nodes_poll(context):
|
||||
|
||||
Reference in New Issue
Block a user