diff options
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 12 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 144 | ||||
-rw-r--r-- | intern/cycles/blender/blender_curves.cpp | 6 | ||||
-rw-r--r-- | intern/cycles/blender/blender_mesh.cpp | 14 | ||||
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 10 | ||||
-rw-r--r-- | intern/cycles/blender/blender_session.cpp | 16 | ||||
-rw-r--r-- | intern/cycles/blender/blender_session.h | 2 | ||||
-rw-r--r-- | intern/cycles/blender/blender_shader.cpp | 26 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 48 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.h | 18 | ||||
-rw-r--r-- | intern/cycles/blender/blender_texture.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/blender/blender_texture.h | 2 | ||||
-rw-r--r-- | intern/cycles/blender/blender_util.h | 8 |
13 files changed, 155 insertions, 155 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index aeeabe001e6..3ce8852abc2 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -1148,15 +1148,15 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup): def update_render_passes(self, context): scene = context.scene rd = scene.render - rl = scene.render_layers.active - rl.update_render_passes() + view_layer = scene.view_layers.active + view_layer.update_render_passes() class CyclesRenderLayerSettings(bpy.types.PropertyGroup): @classmethod def register(cls): - bpy.types.SceneLayer.cycles = PointerProperty( - name="Cycles SceneRenderLayer Settings", - description="Cycles SceneLayer Settings", + bpy.types.ViewLayer.cycles = PointerProperty( + name="Cycles ViewLayer Settings", + description="Cycles ViewLayer Settings", type=cls, ) cls.pass_debug_bvh_traversed_nodes = BoolProperty( @@ -1280,7 +1280,7 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup): @classmethod def unregister(cls): - del bpy.types.SceneLayer.cycles + del bpy.types.ViewLayer.cycles class CyclesCurveSettings(bpy.types.PropertyGroup): diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index b1e13de5e0c..79ed01191d8 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -400,8 +400,8 @@ class CYCLES_RENDER_PT_performance(CyclesButtonsPanel, Panel): subsub = sub.column() subsub.active = not rd.use_save_buffers - for rl in scene.render_layers: - if rl.cycles.use_denoising: + for view_layer in scene.view_layers: + if view_layer.cycles.use_denoising: subsub.active = False subsub.prop(cscene, "use_progressive_refine") @@ -430,24 +430,24 @@ class CYCLES_RENDER_PT_performance(CyclesButtonsPanel, Panel): class CYCLES_RENDER_PT_layer_options(CyclesButtonsPanel, Panel): bl_label = "Layer" - bl_context = "render_layer" + bl_context = "view_layer" def draw(self, context): layout = self.layout scene = context.scene - rl = scene.render_layers.active + view_layer = scene.view_layers.active col = layout.column() - col.prop(rl, "use_sky", "Use Environment") - col.prop(rl, "use_ao", "Use AO") - col.prop(rl, "use_solid", "Use Surfaces") - col.prop(rl, "use_strand", "Use Hair") + col.prop(view_layer, "use_sky", "Use Environment") + col.prop(view_layer, "use_ao", "Use AO") + col.prop(view_layer, "use_solid", "Use Surfaces") + col.prop(view_layer, "use_strand", "Use Hair") class CYCLES_RENDER_PT_layer_passes(CyclesButtonsPanel, Panel): bl_label = "Passes" - bl_context = "render_layer" + bl_context = "view_layer" bl_options = {'DEFAULT_CLOSED'} def draw(self, context): @@ -457,76 +457,76 @@ class CYCLES_RENDER_PT_layer_passes(CyclesButtonsPanel, Panel): scene = context.scene rd = scene.render - rl = scene.render_layers.active - crl = rl.cycles + view_layer = scene.view_layers.active + cycles_view_layer = view_layer.cycles split = layout.split() col = split.column() - col.prop(rl, "use_pass_combined") - col.prop(rl, "use_pass_z") - col.prop(rl, "use_pass_mist") - col.prop(rl, "use_pass_normal") + col.prop(view_layer, "use_pass_combined") + col.prop(view_layer, "use_pass_z") + col.prop(view_layer, "use_pass_mist") + col.prop(view_layer, "use_pass_normal") row = col.row() - row.prop(rl, "use_pass_vector") + row.prop(view_layer, "use_pass_vector") row.active = not rd.use_motion_blur - col.prop(rl, "use_pass_uv") - col.prop(rl, "use_pass_object_index") - col.prop(rl, "use_pass_material_index") + col.prop(view_layer, "use_pass_uv") + col.prop(view_layer, "use_pass_object_index") + col.prop(view_layer, "use_pass_material_index") col.separator() - col.prop(rl, "use_pass_shadow") - col.prop(rl, "use_pass_ambient_occlusion") + col.prop(view_layer, "use_pass_shadow") + col.prop(view_layer, "use_pass_ambient_occlusion") col.separator() - col.prop(rl, "pass_alpha_threshold") + col.prop(view_layer, "pass_alpha_threshold") col = split.column() col.label(text="Diffuse:") row = col.row(align=True) - row.prop(rl, "use_pass_diffuse_direct", text="Direct", toggle=True) - row.prop(rl, "use_pass_diffuse_indirect", text="Indirect", toggle=True) - row.prop(rl, "use_pass_diffuse_color", text="Color", toggle=True) + row.prop(view_layer, "use_pass_diffuse_direct", text="Direct", toggle=True) + row.prop(view_layer, "use_pass_diffuse_indirect", text="Indirect", toggle=True) + row.prop(view_layer, "use_pass_diffuse_color", text="Color", toggle=True) col.label(text="Glossy:") row = col.row(align=True) - row.prop(rl, "use_pass_glossy_direct", text="Direct", toggle=True) - row.prop(rl, "use_pass_glossy_indirect", text="Indirect", toggle=True) - row.prop(rl, "use_pass_glossy_color", text="Color", toggle=True) + row.prop(view_layer, "use_pass_glossy_direct", text="Direct", toggle=True) + row.prop(view_layer, "use_pass_glossy_indirect", text="Indirect", toggle=True) + row.prop(view_layer, "use_pass_glossy_color", text="Color", toggle=True) col.label(text="Transmission:") row = col.row(align=True) - row.prop(rl, "use_pass_transmission_direct", text="Direct", toggle=True) - row.prop(rl, "use_pass_transmission_indirect", text="Indirect", toggle=True) - row.prop(rl, "use_pass_transmission_color", text="Color", toggle=True) + row.prop(view_layer, "use_pass_transmission_direct", text="Direct", toggle=True) + row.prop(view_layer, "use_pass_transmission_indirect", text="Indirect", toggle=True) + row.prop(view_layer, "use_pass_transmission_color", text="Color", toggle=True) col.label(text="Subsurface:") row = col.row(align=True) - row.prop(rl, "use_pass_subsurface_direct", text="Direct", toggle=True) - row.prop(rl, "use_pass_subsurface_indirect", text="Indirect", toggle=True) - row.prop(rl, "use_pass_subsurface_color", text="Color", toggle=True) + row.prop(view_layer, "use_pass_subsurface_direct", text="Direct", toggle=True) + row.prop(view_layer, "use_pass_subsurface_indirect", text="Indirect", toggle=True) + row.prop(view_layer, "use_pass_subsurface_color", text="Color", toggle=True) col.label(text="Volume:") row = col.row(align=True) - row.prop(crl, "use_pass_volume_direct", text="Direct", toggle=True) - row.prop(crl, "use_pass_volume_indirect", text="Indirect", toggle=True) + row.prop(cycles_view_layer, "use_pass_volume_direct", text="Direct", toggle=True) + row.prop(cycles_view_layer, "use_pass_volume_indirect", text="Indirect", toggle=True) col.separator() - col.prop(rl, "use_pass_emit", text="Emission") - col.prop(rl, "use_pass_environment") + col.prop(view_layer, "use_pass_emit", text="Emission") + col.prop(view_layer, "use_pass_environment") if context.scene.cycles.feature_set == 'EXPERIMENTAL': col.separator() sub = col.column() - sub.active = crl.use_denoising - sub.prop(crl, "denoising_store_passes", text="Denoising") + sub.active = cycles_view_layer.use_denoising + sub.prop(cycles_view_layer, "denoising_store_passes", text="Denoising") col = layout.column() - col.prop(crl, "pass_debug_render_time") + col.prop(cycles_view_layer, "pass_debug_render_time") if _cycles.with_cycles_debug: - col.prop(crl, "pass_debug_bvh_traversed_nodes") - col.prop(crl, "pass_debug_bvh_traversed_instances") - col.prop(crl, "pass_debug_bvh_intersections") - col.prop(crl, "pass_debug_ray_bounces") + col.prop(cycles_view_layer, "pass_debug_bvh_traversed_nodes") + col.prop(cycles_view_layer, "pass_debug_bvh_traversed_instances") + col.prop(cycles_view_layer, "pass_debug_bvh_intersections") + col.prop(cycles_view_layer, "pass_debug_ray_bounces") class CYCLES_RENDER_PT_views(CyclesButtonsPanel, Panel): bl_label = "Views" - bl_context = "render_layer" + bl_context = "view_layer" bl_options = {'DEFAULT_CLOSED'} def draw_header(self, context): @@ -548,7 +548,7 @@ class CYCLES_RENDER_PT_views(CyclesButtonsPanel, Panel): if basic_stereo: row = layout.row() - row.template_list("RENDERLAYER_UL_renderviews", "name", rd, "stereo_views", rd.views, "active_index", rows=2) + row.template_list("VIEWLAYER_UL_renderviews", "name", rd, "stereo_views", rd.views, "active_index", rows=2) row = layout.row() row.label(text="File Suffix:") @@ -556,7 +556,7 @@ class CYCLES_RENDER_PT_views(CyclesButtonsPanel, Panel): else: row = layout.row() - row.template_list("RENDERLAYER_UL_renderviews", "name", rd, "views", rd.views, "active_index", rows=2) + row.template_list("VIEWLAYER_UL_renderviews", "name", rd, "views", rd.views, "active_index", rows=2) col = row.column(align=True) col.operator("scene.render_view_add", icon='ZOOMIN', text="") @@ -569,65 +569,65 @@ class CYCLES_RENDER_PT_views(CyclesButtonsPanel, Panel): class CYCLES_RENDER_PT_denoising(CyclesButtonsPanel, Panel): bl_label = "Denoising" - bl_context = "render_layer" + bl_context = "view_layer" bl_options = {'DEFAULT_CLOSED'} def draw_header(self, context): scene = context.scene - rl = scene.render_layers.active - crl = rl.cycles + view_layer = scene.view_layers.active + cycles_view_layer = view_layer.cycles cscene = scene.cycles layout = self.layout - layout.prop(crl, "use_denoising", text="") + layout.prop(cycles_view_layer, "use_denoising", text="") def draw(self, context): layout = self.layout scene = context.scene cscene = scene.cycles - rl = scene.render_layers.active - crl = rl.cycles + view_layer = scene.view_layers.active + cycles_view_layer = view_layer.cycles - layout.active = crl.use_denoising + layout.active = cycles_view_layer.use_denoising split = layout.split() col = split.column() sub = col.column(align=True) - sub.prop(crl, "denoising_radius", text="Radius") - sub.prop(crl, "denoising_strength", slider=True, text="Strength") + sub.prop(cycles_view_layer, "denoising_radius", text="Radius") + sub.prop(cycles_view_layer, "denoising_strength", slider=True, text="Strength") col = split.column() sub = col.column(align=True) - sub.prop(crl, "denoising_feature_strength", slider=True, text="Feature Strength") - sub.prop(crl, "denoising_relative_pca") + sub.prop(cycles_view_layer, "denoising_feature_strength", slider=True, text="Feature Strength") + sub.prop(cycles_view_layer, "denoising_relative_pca") layout.separator() row = layout.row() row.label(text="Diffuse:") sub = row.row(align=True) - sub.prop(crl, "denoising_diffuse_direct", text="Direct", toggle=True) - sub.prop(crl, "denoising_diffuse_indirect", text="Indirect", toggle=True) + sub.prop(cycles_view_layer, "denoising_diffuse_direct", text="Direct", toggle=True) + sub.prop(cycles_view_layer, "denoising_diffuse_indirect", text="Indirect", toggle=True) row = layout.row() row.label(text="Glossy:") sub = row.row(align=True) - sub.prop(crl, "denoising_glossy_direct", text="Direct", toggle=True) - sub.prop(crl, "denoising_glossy_indirect", text="Indirect", toggle=True) + sub.prop(cycles_view_layer, "denoising_glossy_direct", text="Direct", toggle=True) + sub.prop(cycles_view_layer, "denoising_glossy_indirect", text="Indirect", toggle=True) row = layout.row() row.label(text="Transmission:") sub = row.row(align=True) - sub.prop(crl, "denoising_transmission_direct", text="Direct", toggle=True) - sub.prop(crl, "denoising_transmission_indirect", text="Indirect", toggle=True) + sub.prop(cycles_view_layer, "denoising_transmission_direct", text="Direct", toggle=True) + sub.prop(cycles_view_layer, "denoising_transmission_indirect", text="Indirect", toggle=True) row = layout.row() row.label(text="Subsurface:") sub = row.row(align=True) - sub.prop(crl, "denoising_subsurface_direct", text="Direct", toggle=True) - sub.prop(crl, "denoising_subsurface_indirect", text="Indirect", toggle=True) + sub.prop(cycles_view_layer, "denoising_subsurface_direct", text="Direct", toggle=True) + sub.prop(cycles_view_layer, "denoising_subsurface_indirect", text="Indirect", toggle=True) class CYCLES_PT_post_processing(CyclesButtonsPanel, Panel): @@ -1090,8 +1090,8 @@ class CYCLES_WORLD_PT_mist(CyclesButtonsPanel, Panel): def poll(cls, context): if CyclesButtonsPanel.poll(context): if context.world: - for rl in context.scene.render_layers: - if rl.use_pass_mist: + for view_layer in context.scene.view_layers: + if view_layer.use_pass_mist: return True return False @@ -1729,9 +1729,9 @@ def get_panels(): 'MATERIAL_PT_volume_options', 'MATERIAL_PT_volume_shading', 'MATERIAL_PT_volume_transp', - 'RENDERLAYER_PT_layer_options', - 'RENDERLAYER_PT_layer_passes', - 'RENDERLAYER_PT_views', + 'VIEWLAYER_PT_layer_options', + 'VIEWLAYER_PT_layer_passes', + 'VIEWLAYER_PT_views', 'RENDER_PT_antialiasing', 'RENDER_PT_bake', 'RENDER_PT_motion_blur', diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp index 63b07936426..b2c0a09e14b 100644 --- a/intern/cycles/blender/blender_curves.cpp +++ b/intern/cycles/blender/blender_curves.cpp @@ -325,7 +325,7 @@ static bool ObtainCacheParticleVcol(Mesh *mesh, return true; } -static void set_resolution(BL::Object *b_ob, BL::Scene *scene, BL::SceneLayer *sl, bool render) +static void set_resolution(BL::Object *b_ob, BL::Scene *scene, BL::ViewLayer *sl, bool render) { BL::Object::modifiers_iterator b_mod; for(b_ob->modifiers.begin(b_mod); b_mod != b_ob->modifiers.end(); ++b_mod) { @@ -912,7 +912,7 @@ void BlenderSync::sync_curves(Mesh *mesh, ParticleCurveData CData; if(!preview) - set_resolution(&b_ob, &b_scene, &b_scene_layer, true); + set_resolution(&b_ob, &b_scene, &b_view_layer, true); ObtainCacheParticleData(mesh, &b_mesh, &b_ob, &CData, !preview); @@ -1057,7 +1057,7 @@ void BlenderSync::sync_curves(Mesh *mesh, } if(!preview) - set_resolution(&b_ob, &b_scene, &b_scene_layer, false); + set_resolution(&b_ob, &b_scene, &b_view_layer, false); mesh->compute_bounds(); } diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index 9e9ab030146..4622dce286f 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -980,7 +980,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object& b_ob, /* test if we can instance or if the object is modified */ BL::ID b_ob_data = b_ob.data(); BL::ID key = (BKE_object_is_modified(b_ob))? b_ob_instance: b_ob_data; - BL::Material material_override = render_layer.material_override; + BL::Material material_override = view_layer.material_override; /* find shader indices */ vector<Shader*> used_shaders; @@ -1005,10 +1005,10 @@ Mesh *BlenderSync::sync_mesh(BL::Object& b_ob, /* test if we need to sync */ int requested_geometry_flags = Mesh::GEOMETRY_NONE; - if(render_layer.use_surfaces) { + if(view_layer.use_surfaces) { requested_geometry_flags |= Mesh::GEOMETRY_TRIANGLES; } - if(render_layer.use_hair) { + if(view_layer.use_hair) { requested_geometry_flags |= Mesh::GEOMETRY_CURVES; } Mesh *mesh; @@ -1076,14 +1076,14 @@ Mesh *BlenderSync::sync_mesh(BL::Object& b_ob, BL::Mesh b_mesh = object_to_mesh(b_data, b_ob, b_scene, - b_scene_layer, + b_view_layer, true, !preview, need_undeformed, mesh->subdivision_type); if(b_mesh) { - if(render_layer.use_surfaces && !hide_tris) { + if(view_layer.use_surfaces && !hide_tris) { if(mesh->subdivision_type != Mesh::SUBDIVISION_NONE) create_subd_mesh(scene, mesh, b_ob, b_mesh, used_shaders, dicing_rate, max_subdivisions); @@ -1093,7 +1093,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object& b_ob, create_mesh_volume_attributes(scene, b_ob, mesh, b_scene.frame_current()); } - if(render_layer.use_hair && mesh->subdivision_type == Mesh::SUBDIVISION_NONE) + if(view_layer.use_hair && mesh->subdivision_type == Mesh::SUBDIVISION_NONE) sync_curves(mesh, b_mesh, b_ob, false); if(can_free_caches) { @@ -1208,7 +1208,7 @@ void BlenderSync::sync_mesh_motion(BL::Object& b_ob, b_mesh = object_to_mesh(b_data, b_ob, b_scene, - b_scene_layer, + b_view_layer, true, !preview, false, diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index 986f0ccda68..d9210585044 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -288,8 +288,8 @@ Object *BlenderSync::sync_object(BL::Depsgraph::duplis_iterator& b_dupli_iter, /* light is handled separately */ if(object_is_light(b_ob)) { /* don't use lamps for excluded layers used as mask layer */ - if(!motion && !((layer_flag & render_layer.holdout_layer) && - (layer_flag & render_layer.exclude_layer))) + if(!motion && !((layer_flag & view_layer.holdout_layer) && + (layer_flag & view_layer.exclude_layer))) { sync_light(b_parent, persistent_id, @@ -314,7 +314,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph::duplis_iterator& b_dupli_iter, } /* Visibility flags for both parent and child. */ - bool use_holdout = (layer_flag & render_layer.holdout_layer) != 0; + bool use_holdout = (layer_flag & view_layer.holdout_layer) != 0; uint visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY; if(b_parent.ptr.data != b_ob.ptr.data) { @@ -322,12 +322,12 @@ Object *BlenderSync::sync_object(BL::Depsgraph::duplis_iterator& b_dupli_iter, } /* Make holdout objects on excluded layer invisible for non-camera rays. */ - if(use_holdout && (layer_flag & render_layer.exclude_layer)) { + if(use_holdout && (layer_flag & view_layer.exclude_layer)) { visibility &= ~(PATH_RAY_ALL_VISIBILITY - PATH_RAY_CAMERA); } /* Hide objects not on render layer from camera rays. */ - if(!(layer_flag & render_layer.layer)) { + if(!(layer_flag & view_layer.layer)) { visibility &= ~PATH_RAY_CAMERA; } diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index 9b06e11fd88..60e49161be2 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -60,7 +60,7 @@ BlenderSession::BlenderSession(BL::RenderEngine& b_engine, b_render(b_engine.render()), b_depsgraph(b_depsgraph), b_scene(b_scene), - b_scene_layer(b_engine.scene_layer()), + b_view_layer(b_engine.view_layer()), b_v3d(PointerRNA_NULL), b_rv3d(PointerRNA_NULL), python_thread_state(NULL) @@ -90,7 +90,7 @@ BlenderSession::BlenderSession(BL::RenderEngine& b_engine, b_render(b_scene.render()), b_depsgraph(b_depsgraph), b_scene(b_scene), - b_scene_layer(b_engine.scene_layer()), + b_view_layer(b_engine.view_layer()), b_v3d(b_v3d), b_rv3d(b_rv3d), width(width), @@ -165,7 +165,7 @@ void BlenderSession::create_session() else { /* for final render we will do full data sync per render layer, only * do some basic syncing here, no objects or materials for speed */ - sync->sync_render_layers(b_v3d, NULL); + sync->sync_view_layers(b_v3d, NULL); sync->sync_integrator(); sync->sync_camera(b_render, b_camera_override, width, height, ""); } @@ -222,7 +222,7 @@ void BlenderSession::reset_session(BL::BlendData& b_data_, BL::Scene& b_scene_) /* for final render we will do full data sync per render layer, only * do some basic syncing here, no objects or materials for speed */ BL::Object b_camera_override(b_engine.camera_override()); - sync->sync_render_layers(b_v3d, NULL); + sync->sync_view_layers(b_v3d, NULL); sync->sync_integrator(); sync->sync_camera(b_render, b_camera_override, width, height, ""); @@ -383,13 +383,13 @@ void BlenderSession::render() BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_v3d, b_rv3d, scene->camera, width, height); /* render each layer */ - BL::Scene::render_layers_iterator b_layer_iter; + BL::Scene::view_layers_iterator b_layer_iter; BL::RenderResult::views_iterator b_view_iter; /* We do some special meta attributes when we only have single layer. */ - const bool is_single_layer = (b_scene.render_layers.length() == 1); + const bool is_single_layer = (b_scene.view_layers.length() == 1); - for(b_scene.render_layers.begin(b_layer_iter); b_layer_iter != b_scene.render_layers.end(); ++b_layer_iter) { + for(b_scene.view_layers.begin(b_layer_iter); b_layer_iter != b_scene.view_layers.end(); ++b_layer_iter) { b_rlay_name = b_layer_iter->name(); /* temporary render result to find needed passes and views */ @@ -1311,7 +1311,7 @@ bool BlenderSession::builtin_image_float_pixels(const string &builtin_name, BL::ShaderNodeTexPointDensity b_point_density_node(b_node); int length; int settings = background ? 1 : 0; /* 1 - render settings, 0 - vewport settings. */ - b_point_density_node.calc_point_density(b_scene, b_scene_layer, settings, &length, &pixels); + b_point_density_node.calc_point_density(b_scene, b_view_layer, settings, &length, &pixels); } } diff --git a/intern/cycles/blender/blender_session.h b/intern/cycles/blender/blender_session.h index 7ae7bde1737..8694c9499b8 100644 --- a/intern/cycles/blender/blender_session.h +++ b/intern/cycles/blender/blender_session.h @@ -108,7 +108,7 @@ public: BL::RenderSettings b_render; BL::Depsgraph b_depsgraph; BL::Scene b_scene; - BL::SceneLayer b_scene_layer; + BL::ViewLayer b_view_layer; BL::SpaceView3D b_v3d; BL::RegionView3D b_rv3d; string b_rlay_name; diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index 50a95777a0f..94c7aa3b248 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -235,7 +235,7 @@ static ShaderNode *add_node(Scene *scene, BL::RenderEngine& b_engine, BL::BlendData& b_data, BL::Scene& b_scene, - BL::SceneLayer b_scene_layer, + BL::ViewLayer b_view_layer, const bool background, ShaderGraph *graph, BL::ShaderNodeTree& b_ntree, @@ -832,7 +832,7 @@ static ShaderNode *add_node(Scene *scene, /* TODO(sergey): Use more proper update flag. */ if(true) { - b_point_density_node.cache_point_density(b_scene, b_scene_layer, settings); + b_point_density_node.cache_point_density(b_scene, b_view_layer, settings); scene->image_manager->tag_reload_image( point_density->filename.string(), point_density->builtin_data, @@ -850,7 +850,7 @@ static ShaderNode *add_node(Scene *scene, BL::Object b_ob(b_point_density_node.object()); if(b_ob) { float3 loc, size; - point_density_texture_space(b_scene, b_scene_layer, + point_density_texture_space(b_scene, b_view_layer, b_point_density_node, settings, loc, @@ -978,7 +978,7 @@ static void add_nodes(Scene *scene, BL::RenderEngine& b_engine, BL::BlendData& b_data, BL::Scene& b_scene, - BL::SceneLayer& b_scene_layer, + BL::ViewLayer& b_view_layer, const bool background, ShaderGraph *graph, BL::ShaderNodeTree& b_ntree, @@ -1053,7 +1053,7 @@ static void add_nodes(Scene *scene, b_engine, b_data, b_scene, - b_scene_layer, + b_view_layer, background, graph, b_group_ntree, @@ -1101,7 +1101,7 @@ static void add_nodes(Scene *scene, b_engine, b_data, b_scene, - b_scene_layer, + b_view_layer, background, graph, b_ntree, @@ -1165,7 +1165,7 @@ static void add_nodes(Scene *scene, BL::RenderEngine& b_engine, BL::BlendData& b_data, BL::Scene& b_scene, - BL::SceneLayer& b_scene_layer, + BL::ViewLayer& b_view_layer, const bool background, ShaderGraph *graph, BL::ShaderNodeTree& b_ntree) @@ -1175,7 +1175,7 @@ static void add_nodes(Scene *scene, b_engine, b_data, b_scene, - b_scene_layer, + b_view_layer, background, graph, b_ntree, @@ -1214,7 +1214,7 @@ void BlenderSync::sync_materials(bool update_all) if(b_mat->use_nodes() && b_mat->node_tree()) { BL::ShaderNodeTree b_ntree(b_mat->node_tree()); - add_nodes(scene, b_engine, b_data, b_scene, b_scene_layer, !preview, graph, b_ntree); + add_nodes(scene, b_engine, b_data, b_scene, b_view_layer, !preview, graph, b_ntree); } else { DiffuseBsdfNode *diffuse = new DiffuseBsdfNode(); @@ -1285,7 +1285,7 @@ void BlenderSync::sync_world(bool update_all) if(b_world && b_world.use_nodes() && b_world.node_tree()) { BL::ShaderNodeTree b_ntree(b_world.node_tree()); - add_nodes(scene, b_engine, b_data, b_scene, b_scene_layer, !preview, graph, b_ntree); + add_nodes(scene, b_engine, b_data, b_scene, b_view_layer, !preview, graph, b_ntree); /* volume */ PointerRNA cworld = RNA_pointer_get(&b_world.ptr, "cycles"); @@ -1344,8 +1344,8 @@ void BlenderSync::sync_world(bool update_all) else background->transparent = b_scene.render().alpha_mode() == BL::RenderSettings::alpha_mode_TRANSPARENT; - background->use_shader = render_layer.use_background_shader; - background->use_ao = background->use_ao && render_layer.use_background_ao; + background->use_shader = view_layer.use_background_shader; + background->use_ao = background->use_ao && view_layer.use_background_ao; if(background->modified(prevbackground)) background->tag_update(scene); @@ -1378,7 +1378,7 @@ void BlenderSync::sync_lamps(bool update_all) BL::ShaderNodeTree b_ntree(b_lamp->node_tree()); - add_nodes(scene, b_engine, b_data, b_scene, b_scene_layer, !preview, graph, b_ntree); + add_nodes(scene, b_engine, b_data, b_scene, b_view_layer, !preview, graph, b_ntree); } else { float strength = 1.0f; diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index d340435aa93..66509ebeef2 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -53,7 +53,7 @@ BlenderSync::BlenderSync(BL::RenderEngine& b_engine, b_data(b_data), b_depsgraph(b_depsgraph), b_scene(b_scene), - b_scene_layer(b_engine.scene_layer()), + b_view_layer(b_engine.view_layer()), shader_map(&scene->shaders), object_map(&scene->objects), mesh_map(&scene->meshes), @@ -198,7 +198,7 @@ void BlenderSync::sync_data(BL::RenderSettings& b_render, void **python_thread_state, const char *layer) { - sync_render_layers(b_v3d, layer); + sync_view_layers(b_v3d, layer); sync_integrator(); sync_film(); sync_shaders(); @@ -376,43 +376,43 @@ void BlenderSync::sync_film() /* Render Layer */ -void BlenderSync::sync_render_layers(BL::SpaceView3D& b_v3d, const char *layer) +void BlenderSync::sync_view_layers(BL::SpaceView3D& b_v3d, const char *layer) { string layername; /* 3d view */ if(b_v3d) { - layername = b_scene.render_layers.active().name(); + layername = b_scene.view_layers.active().name(); layer = layername.c_str(); } /* render layer */ - BL::Scene::render_layers_iterator b_rlay; + BL::Scene::view_layers_iterator b_rlay; bool first_layer = true; uint layer_override = get_layer(b_engine.layer_override()); - uint scene_layers = layer_override ? layer_override : get_layer(b_scene.layers()); + uint view_layers = layer_override ? layer_override : get_layer(b_scene.layers()); - for(b_scene.render_layers.begin(b_rlay); b_rlay != b_scene.render_layers.end(); ++b_rlay) { + for(b_scene.view_layers.begin(b_rlay); b_rlay != b_scene.view_layers.end(); ++b_rlay) { if((!layer && first_layer) || (layer && b_rlay->name() == layer)) { - render_layer.name = b_rlay->name(); + view_layer.name = b_rlay->name(); - render_layer.holdout_layer = 0; - render_layer.exclude_layer = 0; + view_layer.holdout_layer = 0; + view_layer.exclude_layer = 0; - render_layer.scene_layer = scene_layers & ~render_layer.exclude_layer; - render_layer.scene_layer |= render_layer.exclude_layer & render_layer.holdout_layer; + view_layer.view_layer = view_layers & ~view_layer.exclude_layer; + view_layer.view_layer |= view_layer.exclude_layer & view_layer.holdout_layer; - render_layer.layer = (1 << 20) - 1; - render_layer.layer |= render_layer.holdout_layer; + view_layer.layer = (1 << 20) - 1; + view_layer.layer |= view_layer.holdout_layer; - render_layer.material_override = PointerRNA_NULL; - render_layer.use_background_shader = b_rlay->use_sky(); - render_layer.use_background_ao = b_rlay->use_ao(); - render_layer.use_surfaces = b_rlay->use_solid(); - render_layer.use_hair = b_rlay->use_strand(); + view_layer.material_override = PointerRNA_NULL; + view_layer.use_background_shader = b_rlay->use_sky(); + view_layer.use_background_ao = b_rlay->use_ao(); + view_layer.use_surfaces = b_rlay->use_solid(); + view_layer.use_hair = b_rlay->use_strand(); - render_layer.bound_samples = false; - render_layer.samples = 0; + view_layer.bound_samples = false; + view_layer.samples = 0; } first_layer = false; @@ -526,7 +526,7 @@ int BlenderSync::get_denoising_pass(BL::RenderPass& b_pass) } array<Pass> BlenderSync::sync_render_passes(BL::RenderLayer& b_rlay, - BL::SceneLayer& b_slay, + BL::ViewLayer& b_slay, const SessionParams &session_params) { array<Pass> passes; @@ -820,8 +820,8 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine& b_engine, !b_r.use_save_buffers(); if(params.progressive_refine) { - BL::Scene::render_layers_iterator b_rlay; - for(b_scene.render_layers.begin(b_rlay); b_rlay != b_scene.render_layers.end(); ++b_rlay) { + BL::Scene::view_layers_iterator b_rlay; + for(b_scene.view_layers.begin(b_rlay); b_rlay != b_scene.view_layers.end(); ++b_rlay) { PointerRNA crl = RNA_pointer_get(&b_rlay->ptr, "cycles"); if(get_boolean(crl, "use_denoising")) { params.progressive_refine = false; diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h index d262adb13fe..dd415b1ea9d 100644 --- a/intern/cycles/blender/blender_sync.h +++ b/intern/cycles/blender/blender_sync.h @@ -43,7 +43,7 @@ class Mesh; class Object; class ParticleSystem; class Scene; -class SceneLayer; +class ViewLayer; class Shader; class ShaderGraph; class ShaderNode; @@ -67,9 +67,9 @@ public: int width, int height, void **python_thread_state, const char *layer = 0); - void sync_render_layers(BL::SpaceView3D& b_v3d, const char *layer); + void sync_view_layers(BL::SpaceView3D& b_v3d, const char *layer); array<Pass> sync_render_passes(BL::RenderLayer& b_rlay, - BL::SceneLayer& b_slay, + BL::ViewLayer& b_slay, const SessionParams &session_params); void sync_integrator(); void sync_camera(BL::RenderSettings& b_render, @@ -79,8 +79,8 @@ public: void sync_view(BL::SpaceView3D& b_v3d, BL::RegionView3D& b_rv3d, int width, int height); - inline int get_layer_samples() { return render_layer.samples; } - inline int get_layer_bound_samples() { return render_layer.bound_samples; } + inline int get_layer_samples() { return view_layer.samples; } + inline int get_layer_bound_samples() { return view_layer.bound_samples; } /* get parameters */ static SceneParams get_scene_params(BL::Scene& b_scene, @@ -165,7 +165,7 @@ private: BL::BlendData b_data; BL::Depsgraph b_depsgraph; BL::Scene b_scene; - BL::SceneLayer b_scene_layer; + BL::ViewLayer b_view_layer; id_map<void*, Shader> shader_map; id_map<ObjectKey, Object> object_map; @@ -187,7 +187,7 @@ private: struct RenderLayerInfo { RenderLayerInfo() - : scene_layer(0), layer(0), + : view_layer(0), layer(0), holdout_layer(0), exclude_layer(0), material_override(PointerRNA_NULL), use_background_shader(true), @@ -198,7 +198,7 @@ private: {} string name; - uint scene_layer; + uint view_layer; uint layer; /* This can be safely removed from Cycles. */ uint holdout_layer; /* This can be safely removed from Cycles. */ uint exclude_layer; /* This can be safely removed from Cycles. */ @@ -209,7 +209,7 @@ private: bool use_hair; int samples; /* This can be safely removed from Cycles. */ bool bound_samples; /* This can be safely removed from Cycles. */ - } render_layer; + } view_layer; Progress &progress; }; diff --git a/intern/cycles/blender/blender_texture.cpp b/intern/cycles/blender/blender_texture.cpp index dd08be3ddc9..3b06fb720de 100644 --- a/intern/cycles/blender/blender_texture.cpp +++ b/intern/cycles/blender/blender_texture.cpp @@ -34,7 +34,7 @@ void density_texture_space_invert(float3& loc, } /* namespace */ -void point_density_texture_space(BL::Scene& b_scene, BL::SceneLayer& b_scene_layer, +void point_density_texture_space(BL::Scene& b_scene, BL::ViewLayer& b_view_layer, BL::ShaderNodeTexPointDensity& b_point_density_node, int settings, float3& loc, @@ -48,7 +48,7 @@ void point_density_texture_space(BL::Scene& b_scene, BL::SceneLayer& b_scene_lay } float3 min, max; b_point_density_node.calc_point_density_minmax(b_scene, - b_scene_layer, + b_view_layer, settings, &min[0], &max[0]); diff --git a/intern/cycles/blender/blender_texture.h b/intern/cycles/blender/blender_texture.h index c343d5dab92..3d4b8739d49 100644 --- a/intern/cycles/blender/blender_texture.h +++ b/intern/cycles/blender/blender_texture.h @@ -22,7 +22,7 @@ CCL_NAMESPACE_BEGIN -void point_density_texture_space(BL::Scene& b_scene, BL::SceneLayer& b_scene_layer, +void point_density_texture_space(BL::Scene& b_scene, BL::ViewLayer& b_view_layer, BL::ShaderNodeTexPointDensity& b_point_density_node, const int settings, float3& loc, diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h index 314bcaf23c4..a813a09f38a 100644 --- a/intern/cycles/blender/blender_util.h +++ b/intern/cycles/blender/blender_util.h @@ -46,7 +46,7 @@ void python_thread_state_restore(void **python_thread_state); static inline BL::Mesh object_to_mesh(BL::BlendData& data, BL::Object& object, BL::Scene& scene, - BL::SceneLayer scene_layer, + BL::ViewLayer view_layer, bool apply_modifiers, bool render, bool calc_undeformed, @@ -65,7 +65,7 @@ static inline BL::Mesh object_to_mesh(BL::BlendData& data, subsurf_mod.show_viewport(false); } - BL::Mesh me = data.meshes.new_from_object(scene, scene_layer, object, apply_modifiers, (render)? 2: 1, false, calc_undeformed); + BL::Mesh me = data.meshes.new_from_object(scene, view_layer, object, apply_modifiers, (render)? 2: 1, false, calc_undeformed); if(subdivision_type != Mesh::SUBDIVISION_NONE) { BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length()-1]; @@ -307,7 +307,7 @@ static inline uint get_layer(const BL::Array<int, 20>& array) static inline uint get_layer(const BL::Array<int, 20>& array, const BL::Array<int, 8>& local_array, bool is_light = false, - uint scene_layers = (1 << 20) - 1) + uint view_layers = (1 << 20) - 1) { uint layer = 0; @@ -319,7 +319,7 @@ static inline uint get_layer(const BL::Array<int, 20>& array, /* Consider light is visible if it was visible without layer * override, which matches behavior of Blender Internal. */ - if(layer & scene_layers) { + if(layer & view_layers) { for(uint i = 0; i < 8; i++) layer |= (1 << (20+i)); } |