SceneRenderLayer Removal/Refactor
This patch moves all the functionality previously in SceneRenderLayer to SceneLayer. If we want to rename some of these structs now would be a good time to do it, before they are in SceneLayer. Everything should be working, though I will test things further tomorrow. Once this is committed depsgraph can get rid of the workaround added in rna_Main_meshes_new_from_object and finish whatever this patch was preventing from being finished. This patch also adds a few placeholders for the overrides (samples, ...). These are obviously not working, so some unittests that rely on 'lay', and 'zmask' will fail. This patch does not addressed the change of moving samples to ViewRender (I have this as a separate patch and needs some separate discussion). Following next is the individual note of the individual parts that were committed. Note 1: It is up to Cycles to still get rid of exclude_layer internally. Note 2: Cycles still need to handle its own doversion for the use_layer_samples cases and (1) Remove the override as it is (2) Add a new override (scene.cycles.samples) if scene.cycles.use_layer_samples != IGNORE Respecting the expected behaviour when scene.cycles.use_layer_samples == BOUNDED. Note 3: Cycles still need to implement the per-object holdout (similar to how we do shadow catcher). Note 4: There are parts of the old (Blender Internal) rendering pipeline that is still using lay, e.g., in shi->lay. Honestly it will be easier to purge the entire Blender Internal code away instead of taking things from it bit by bit. Reviewers: sergey, campbellbarton, brecht Differential Revision: https://developer.blender.org/D2919
This commit is contained in:
parent
8ba6103e66
commit
3a95bdfc65
|
@ -1148,15 +1148,15 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
|
||||||
def update_render_passes(self, context):
|
def update_render_passes(self, context):
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
rd = scene.render
|
rd = scene.render
|
||||||
rl = rd.layers.active
|
rl = scene.render_layers.active
|
||||||
rl.update_render_passes()
|
rl.update_render_passes()
|
||||||
|
|
||||||
class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
||||||
@classmethod
|
@classmethod
|
||||||
def register(cls):
|
def register(cls):
|
||||||
bpy.types.SceneRenderLayer.cycles = PointerProperty(
|
bpy.types.SceneLayer.cycles = PointerProperty(
|
||||||
name="Cycles SceneRenderLayer Settings",
|
name="Cycles SceneRenderLayer Settings",
|
||||||
description="Cycles SceneRenderLayer Settings",
|
description="Cycles SceneLayer Settings",
|
||||||
type=cls,
|
type=cls,
|
||||||
)
|
)
|
||||||
cls.pass_debug_bvh_traversed_nodes = BoolProperty(
|
cls.pass_debug_bvh_traversed_nodes = BoolProperty(
|
||||||
|
@ -1280,7 +1280,7 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def unregister(cls):
|
def unregister(cls):
|
||||||
del bpy.types.SceneRenderLayer.cycles
|
del bpy.types.SceneLayer.cycles
|
||||||
|
|
||||||
|
|
||||||
class CyclesCurveSettings(bpy.types.PropertyGroup):
|
class CyclesCurveSettings(bpy.types.PropertyGroup):
|
||||||
|
|
|
@ -400,7 +400,7 @@ class CYCLES_RENDER_PT_performance(CyclesButtonsPanel, Panel):
|
||||||
|
|
||||||
subsub = sub.column()
|
subsub = sub.column()
|
||||||
subsub.active = not rd.use_save_buffers
|
subsub.active = not rd.use_save_buffers
|
||||||
for rl in rd.layers:
|
for rl in scene.render_layers:
|
||||||
if rl.cycles.use_denoising:
|
if rl.cycles.use_denoising:
|
||||||
subsub.active = False
|
subsub.active = False
|
||||||
subsub.prop(cscene, "use_progressive_refine")
|
subsub.prop(cscene, "use_progressive_refine")
|
||||||
|
@ -436,28 +436,9 @@ class CYCLES_RENDER_PT_layer_options(CyclesButtonsPanel, Panel):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
rd = scene.render
|
rl = scene.render_layers.active
|
||||||
rl = rd.layers.active
|
|
||||||
|
|
||||||
split = layout.split()
|
col = layout.column()
|
||||||
|
|
||||||
col = split.column()
|
|
||||||
col.prop(scene, "layers", text="Scene")
|
|
||||||
col.prop(rl, "layers_exclude", text="Exclude")
|
|
||||||
|
|
||||||
col = split.column()
|
|
||||||
col.prop(rl, "layers", text="Layer")
|
|
||||||
col.prop(rl, "layers_zmask", text="Mask Layer")
|
|
||||||
|
|
||||||
split = layout.split()
|
|
||||||
|
|
||||||
col = split.column()
|
|
||||||
col.label(text="Material:")
|
|
||||||
col.prop(rl, "material_override", text="")
|
|
||||||
col.separator()
|
|
||||||
col.prop(rl, "samples")
|
|
||||||
|
|
||||||
col = split.column()
|
|
||||||
col.prop(rl, "use_sky", "Use Environment")
|
col.prop(rl, "use_sky", "Use Environment")
|
||||||
col.prop(rl, "use_ao", "Use AO")
|
col.prop(rl, "use_ao", "Use AO")
|
||||||
col.prop(rl, "use_solid", "Use Surfaces")
|
col.prop(rl, "use_solid", "Use Surfaces")
|
||||||
|
@ -476,7 +457,7 @@ class CYCLES_RENDER_PT_layer_passes(CyclesButtonsPanel, Panel):
|
||||||
|
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
rd = scene.render
|
rd = scene.render
|
||||||
rl = rd.layers.active
|
rl = scene.render_layers.active
|
||||||
crl = rl.cycles
|
crl = rl.cycles
|
||||||
|
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
|
@ -592,10 +573,10 @@ class CYCLES_RENDER_PT_denoising(CyclesButtonsPanel, Panel):
|
||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
|
|
||||||
def draw_header(self, context):
|
def draw_header(self, context):
|
||||||
rd = context.scene.render
|
scene = context.scene
|
||||||
rl = rd.layers.active
|
rl = scene.render_layers.active
|
||||||
crl = rl.cycles
|
crl = rl.cycles
|
||||||
cscene = context.scene.cycles
|
cscene = scene.cycles
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
layout.prop(crl, "use_denoising", text="")
|
layout.prop(crl, "use_denoising", text="")
|
||||||
|
@ -605,8 +586,7 @@ class CYCLES_RENDER_PT_denoising(CyclesButtonsPanel, Panel):
|
||||||
|
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
cscene = scene.cycles
|
cscene = scene.cycles
|
||||||
rd = scene.render
|
rl = scene.render_layers.active
|
||||||
rl = rd.layers.active
|
|
||||||
crl = rl.cycles
|
crl = rl.cycles
|
||||||
|
|
||||||
layout.active = crl.use_denoising
|
layout.active = crl.use_denoising
|
||||||
|
@ -1110,7 +1090,7 @@ class CYCLES_WORLD_PT_mist(CyclesButtonsPanel, Panel):
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
if CyclesButtonsPanel.poll(context):
|
if CyclesButtonsPanel.poll(context):
|
||||||
if context.world:
|
if context.world:
|
||||||
for rl in context.scene.render.layers:
|
for rl in context.scene.render_layers:
|
||||||
if rl.use_pass_mist:
|
if rl.use_pass_mist:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -383,14 +383,13 @@ void BlenderSession::render()
|
||||||
BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_v3d, b_rv3d, scene->camera, width, height);
|
BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_v3d, b_rv3d, scene->camera, width, height);
|
||||||
|
|
||||||
/* render each layer */
|
/* render each layer */
|
||||||
BL::RenderSettings r = b_scene.render();
|
BL::Scene::render_layers_iterator b_layer_iter;
|
||||||
BL::RenderSettings::layers_iterator b_layer_iter;
|
|
||||||
BL::RenderResult::views_iterator b_view_iter;
|
BL::RenderResult::views_iterator b_view_iter;
|
||||||
|
|
||||||
/* We do some special meta attributes when we only have single layer. */
|
/* We do some special meta attributes when we only have single layer. */
|
||||||
const bool is_single_layer = (r.layers.length() == 1);
|
const bool is_single_layer = (b_scene.render_layers.length() == 1);
|
||||||
|
|
||||||
for(r.layers.begin(b_layer_iter); b_layer_iter != r.layers.end(); ++b_layer_iter) {
|
for(b_scene.render_layers.begin(b_layer_iter); b_layer_iter != b_scene.render_layers.end(); ++b_layer_iter) {
|
||||||
b_rlay_name = b_layer_iter->name();
|
b_rlay_name = b_layer_iter->name();
|
||||||
|
|
||||||
/* temporary render result to find needed passes and views */
|
/* temporary render result to find needed passes and views */
|
||||||
|
|
|
@ -382,19 +382,17 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D& b_v3d, const char *layer)
|
||||||
|
|
||||||
/* 3d view */
|
/* 3d view */
|
||||||
if(b_v3d) {
|
if(b_v3d) {
|
||||||
BL::RenderLayers layers(b_scene.render().ptr);
|
layername = b_scene.render_layers.active().name();
|
||||||
layername = layers.active().name();
|
|
||||||
layer = layername.c_str();
|
layer = layername.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* render layer */
|
/* render layer */
|
||||||
BL::RenderSettings r = b_scene.render();
|
BL::Scene::render_layers_iterator b_rlay;
|
||||||
BL::RenderSettings::layers_iterator b_rlay;
|
|
||||||
bool first_layer = true;
|
bool first_layer = true;
|
||||||
uint layer_override = get_layer(b_engine.layer_override());
|
uint layer_override = get_layer(b_engine.layer_override());
|
||||||
uint scene_layers = layer_override ? layer_override : get_layer(b_scene.layers());
|
uint scene_layers = layer_override ? layer_override : get_layer(b_scene.layers());
|
||||||
|
|
||||||
for(r.layers.begin(b_rlay); b_rlay != r.layers.end(); ++b_rlay) {
|
for(b_scene.render_layers.begin(b_rlay); b_rlay != b_scene.render_layers.end(); ++b_rlay) {
|
||||||
if((!layer && first_layer) || (layer && b_rlay->name() == layer)) {
|
if((!layer && first_layer) || (layer && b_rlay->name() == layer)) {
|
||||||
render_layer.name = b_rlay->name();
|
render_layer.name = b_rlay->name();
|
||||||
|
|
||||||
|
@ -528,7 +526,7 @@ int BlenderSync::get_denoising_pass(BL::RenderPass& b_pass)
|
||||||
}
|
}
|
||||||
|
|
||||||
array<Pass> BlenderSync::sync_render_passes(BL::RenderLayer& b_rlay,
|
array<Pass> BlenderSync::sync_render_passes(BL::RenderLayer& b_rlay,
|
||||||
BL::SceneRenderLayer& b_srlay,
|
BL::SceneLayer& b_slay,
|
||||||
const SessionParams &session_params)
|
const SessionParams &session_params)
|
||||||
{
|
{
|
||||||
array<Pass> passes;
|
array<Pass> passes;
|
||||||
|
@ -551,49 +549,49 @@ array<Pass> BlenderSync::sync_render_passes(BL::RenderLayer& b_rlay,
|
||||||
Pass::add(pass_type, passes);
|
Pass::add(pass_type, passes);
|
||||||
}
|
}
|
||||||
|
|
||||||
PointerRNA crp = RNA_pointer_get(&b_srlay.ptr, "cycles");
|
PointerRNA crp = RNA_pointer_get(&b_slay.ptr, "cycles");
|
||||||
if(get_boolean(crp, "denoising_store_passes") &&
|
if(get_boolean(crp, "denoising_store_passes") &&
|
||||||
get_boolean(crp, "use_denoising"))
|
get_boolean(crp, "use_denoising"))
|
||||||
{
|
{
|
||||||
b_engine.add_pass("Denoising Normal", 3, "XYZ", b_srlay.name().c_str());
|
b_engine.add_pass("Denoising Normal", 3, "XYZ", b_slay.name().c_str());
|
||||||
b_engine.add_pass("Denoising Normal Variance", 3, "XYZ", b_srlay.name().c_str());
|
b_engine.add_pass("Denoising Normal Variance", 3, "XYZ", b_slay.name().c_str());
|
||||||
b_engine.add_pass("Denoising Albedo", 3, "RGB", b_srlay.name().c_str());
|
b_engine.add_pass("Denoising Albedo", 3, "RGB", b_slay.name().c_str());
|
||||||
b_engine.add_pass("Denoising Albedo Variance", 3, "RGB", b_srlay.name().c_str());
|
b_engine.add_pass("Denoising Albedo Variance", 3, "RGB", b_slay.name().c_str());
|
||||||
b_engine.add_pass("Denoising Depth", 1, "Z", b_srlay.name().c_str());
|
b_engine.add_pass("Denoising Depth", 1, "Z", b_slay.name().c_str());
|
||||||
b_engine.add_pass("Denoising Depth Variance", 1, "Z", b_srlay.name().c_str());
|
b_engine.add_pass("Denoising Depth Variance", 1, "Z", b_slay.name().c_str());
|
||||||
b_engine.add_pass("Denoising Shadow A", 3, "XYV", b_srlay.name().c_str());
|
b_engine.add_pass("Denoising Shadow A", 3, "XYV", b_slay.name().c_str());
|
||||||
b_engine.add_pass("Denoising Shadow B", 3, "XYV", b_srlay.name().c_str());
|
b_engine.add_pass("Denoising Shadow B", 3, "XYV", b_slay.name().c_str());
|
||||||
b_engine.add_pass("Denoising Image", 3, "RGB", b_srlay.name().c_str());
|
b_engine.add_pass("Denoising Image", 3, "RGB", b_slay.name().c_str());
|
||||||
b_engine.add_pass("Denoising Image Variance", 3, "RGB", b_srlay.name().c_str());
|
b_engine.add_pass("Denoising Image Variance", 3, "RGB", b_slay.name().c_str());
|
||||||
}
|
}
|
||||||
#ifdef __KERNEL_DEBUG__
|
#ifdef __KERNEL_DEBUG__
|
||||||
if(get_boolean(crp, "pass_debug_bvh_traversed_nodes")) {
|
if(get_boolean(crp, "pass_debug_bvh_traversed_nodes")) {
|
||||||
b_engine.add_pass("Debug BVH Traversed Nodes", 1, "X", b_srlay.name().c_str());
|
b_engine.add_pass("Debug BVH Traversed Nodes", 1, "X", b_slay.name().c_str());
|
||||||
Pass::add(PASS_BVH_TRAVERSED_NODES, passes);
|
Pass::add(PASS_BVH_TRAVERSED_NODES, passes);
|
||||||
}
|
}
|
||||||
if(get_boolean(crp, "pass_debug_bvh_traversed_instances")) {
|
if(get_boolean(crp, "pass_debug_bvh_traversed_instances")) {
|
||||||
b_engine.add_pass("Debug BVH Traversed Instances", 1, "X", b_srlay.name().c_str());
|
b_engine.add_pass("Debug BVH Traversed Instances", 1, "X", b_slay.name().c_str());
|
||||||
Pass::add(PASS_BVH_TRAVERSED_INSTANCES, passes);
|
Pass::add(PASS_BVH_TRAVERSED_INSTANCES, passes);
|
||||||
}
|
}
|
||||||
if(get_boolean(crp, "pass_debug_bvh_intersections")) {
|
if(get_boolean(crp, "pass_debug_bvh_intersections")) {
|
||||||
b_engine.add_pass("Debug BVH Intersections", 1, "X", b_srlay.name().c_str());
|
b_engine.add_pass("Debug BVH Intersections", 1, "X", b_slay.name().c_str());
|
||||||
Pass::add(PASS_BVH_INTERSECTIONS, passes);
|
Pass::add(PASS_BVH_INTERSECTIONS, passes);
|
||||||
}
|
}
|
||||||
if(get_boolean(crp, "pass_debug_ray_bounces")) {
|
if(get_boolean(crp, "pass_debug_ray_bounces")) {
|
||||||
b_engine.add_pass("Debug Ray Bounces", 1, "X", b_srlay.name().c_str());
|
b_engine.add_pass("Debug Ray Bounces", 1, "X", b_slay.name().c_str());
|
||||||
Pass::add(PASS_RAY_BOUNCES, passes);
|
Pass::add(PASS_RAY_BOUNCES, passes);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if(get_boolean(crp, "pass_debug_render_time")) {
|
if(get_boolean(crp, "pass_debug_render_time")) {
|
||||||
b_engine.add_pass("Debug Render Time", 1, "X", b_srlay.name().c_str());
|
b_engine.add_pass("Debug Render Time", 1, "X", b_slay.name().c_str());
|
||||||
Pass::add(PASS_RENDER_TIME, passes);
|
Pass::add(PASS_RENDER_TIME, passes);
|
||||||
}
|
}
|
||||||
if(get_boolean(crp, "use_pass_volume_direct")) {
|
if(get_boolean(crp, "use_pass_volume_direct")) {
|
||||||
b_engine.add_pass("VolumeDir", 3, "RGB", b_srlay.name().c_str());
|
b_engine.add_pass("VolumeDir", 3, "RGB", b_slay.name().c_str());
|
||||||
Pass::add(PASS_VOLUME_DIRECT, passes);
|
Pass::add(PASS_VOLUME_DIRECT, passes);
|
||||||
}
|
}
|
||||||
if(get_boolean(crp, "use_pass_volume_indirect")) {
|
if(get_boolean(crp, "use_pass_volume_indirect")) {
|
||||||
b_engine.add_pass("VolumeInd", 3, "RGB", b_srlay.name().c_str());
|
b_engine.add_pass("VolumeInd", 3, "RGB", b_slay.name().c_str());
|
||||||
Pass::add(PASS_VOLUME_INDIRECT, passes);
|
Pass::add(PASS_VOLUME_INDIRECT, passes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -822,8 +820,8 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine& b_engine,
|
||||||
!b_r.use_save_buffers();
|
!b_r.use_save_buffers();
|
||||||
|
|
||||||
if(params.progressive_refine) {
|
if(params.progressive_refine) {
|
||||||
BL::RenderSettings::layers_iterator b_rlay;
|
BL::Scene::render_layers_iterator b_rlay;
|
||||||
for(b_r.layers.begin(b_rlay); b_rlay != b_r.layers.end(); ++b_rlay) {
|
for(b_scene.render_layers.begin(b_rlay); b_rlay != b_scene.render_layers.end(); ++b_rlay) {
|
||||||
PointerRNA crl = RNA_pointer_get(&b_rlay->ptr, "cycles");
|
PointerRNA crl = RNA_pointer_get(&b_rlay->ptr, "cycles");
|
||||||
if(get_boolean(crl, "use_denoising")) {
|
if(get_boolean(crl, "use_denoising")) {
|
||||||
params.progressive_refine = false;
|
params.progressive_refine = false;
|
||||||
|
|
|
@ -69,7 +69,7 @@ public:
|
||||||
const char *layer = 0);
|
const char *layer = 0);
|
||||||
void sync_render_layers(BL::SpaceView3D& b_v3d, const char *layer);
|
void sync_render_layers(BL::SpaceView3D& b_v3d, const char *layer);
|
||||||
array<Pass> sync_render_passes(BL::RenderLayer& b_rlay,
|
array<Pass> sync_render_passes(BL::RenderLayer& b_rlay,
|
||||||
BL::SceneRenderLayer& b_srlay,
|
BL::SceneLayer& b_slay,
|
||||||
const SessionParams &session_params);
|
const SessionParams &session_params);
|
||||||
void sync_integrator();
|
void sync_integrator();
|
||||||
void sync_camera(BL::RenderSettings& b_render,
|
void sync_camera(BL::RenderSettings& b_render,
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 5b02e6e1acc4c3cf4822607ab33f48d7cffecbd3
|
Subproject commit 371960484a38fc64e0a2635170a41a0d8ab2f6bd
|
|
@ -1 +1 @@
|
||||||
Subproject commit c3991195ad6eac741db27dc9e8905efb224f219d
|
Subproject commit a8515cfdfe9a98127b592f36fcbe51b7e23b969a
|
|
@ -1206,7 +1206,7 @@ integration_types = {
|
||||||
# main function for parameter processing
|
# main function for parameter processing
|
||||||
def process(layer_name, lineset_name):
|
def process(layer_name, lineset_name):
|
||||||
scene = getCurrentScene()
|
scene = getCurrentScene()
|
||||||
layer = scene.render.layers[layer_name]
|
layer = scene.render_layers[layer_name]
|
||||||
lineset = layer.freestyle_settings.linesets[lineset_name]
|
lineset = layer.freestyle_settings.linesets[lineset_name]
|
||||||
linestyle = lineset.linestyle
|
linestyle = lineset.linestyle
|
||||||
|
|
||||||
|
|
|
@ -613,22 +613,22 @@ class CLIP_OT_setup_tracking_scene(Operator):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _setupRenderLayers(context):
|
def _setupRenderLayers(context):
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
rlayers = scene.render.layers
|
rlayers = scene.render_layers
|
||||||
|
|
||||||
if not scene.render.layers.get("Foreground"):
|
if not scene.render_layers.get("Foreground"):
|
||||||
if len(rlayers) == 1:
|
if len(rlayers) == 1:
|
||||||
fg = rlayers[0]
|
fg = rlayers[0]
|
||||||
fg.name = 'Foreground'
|
fg.name = 'Foreground'
|
||||||
else:
|
else:
|
||||||
fg = scene.render.layers.new("Foreground")
|
fg = scene.render_layers.new("Foreground")
|
||||||
|
|
||||||
fg.use_sky = True
|
fg.use_sky = True
|
||||||
fg.layers = [True] + [False] * 19
|
fg.layers = [True] + [False] * 19
|
||||||
fg.layers_zmask = [False] * 10 + [True] + [False] * 9
|
fg.layers_zmask = [False] * 10 + [True] + [False] * 9
|
||||||
fg.use_pass_vector = True
|
fg.use_pass_vector = True
|
||||||
|
|
||||||
if not scene.render.layers.get("Background"):
|
if not scene.render_layers.get("Background"):
|
||||||
bg = scene.render.layers.new("Background")
|
bg = scene.render_layers.new("Background")
|
||||||
bg.use_pass_shadow = True
|
bg.use_pass_shadow = True
|
||||||
bg.use_pass_ambient_occlusion = True
|
bg.use_pass_ambient_occlusion = True
|
||||||
bg.layers = [False] * 10 + [True] + [False] * 9
|
bg.layers = [False] * 10 + [True] + [False] * 9
|
||||||
|
@ -940,8 +940,8 @@ class CLIP_OT_setup_tracking_scene(Operator):
|
||||||
def _setupObjects(self, context):
|
def _setupObjects(self, context):
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
|
|
||||||
fg = scene.render.layers.get("Foreground")
|
fg = scene.render_layers.get("Foreground")
|
||||||
bg = scene.render.layers.get("Background")
|
bg = scene.render_layers.get("Background")
|
||||||
|
|
||||||
all_layers = self._mergeLayers(fg.layers, bg.layers)
|
all_layers = self._mergeLayers(fg.layers, bg.layers)
|
||||||
|
|
||||||
|
|
|
@ -47,14 +47,14 @@ class SCENE_OT_freestyle_fill_range_by_selection(bpy.types.Operator):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
rl = context.scene.render.layers.active
|
rl = context.scene.render_layers.active
|
||||||
return rl and rl.freestyle_settings.linesets.active
|
return rl and rl.freestyle_settings.linesets.active
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
rl = scene.render.layers.active
|
rl = scene.render_layers.active
|
||||||
lineset = rl.freestyle_settings.linesets.active
|
lineset = rl.freestyle_settings.linesets.active
|
||||||
linestyle = lineset.linestyle
|
linestyle = lineset.linestyle
|
||||||
# Find the modifier to work on
|
# Find the modifier to work on
|
||||||
|
@ -207,7 +207,7 @@ class SCENE_OT_freestyle_module_open(bpy.types.Operator):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
rl = context.scene.render.layers.active
|
rl = context.scene.render_layers.active
|
||||||
return rl and rl.freestyle_settings.mode == 'SCRIPT'
|
return rl and rl.freestyle_settings.mode == 'SCRIPT'
|
||||||
|
|
||||||
def invoke(self, context, event):
|
def invoke(self, context, event):
|
||||||
|
|
|
@ -75,7 +75,7 @@ class RenderLayerFreestyleButtonsPanel:
|
||||||
with_freestyle = bpy.app.build_options.freestyle
|
with_freestyle = bpy.app.build_options.freestyle
|
||||||
|
|
||||||
return (scene and with_freestyle and rd.use_freestyle and
|
return (scene and with_freestyle and rd.use_freestyle and
|
||||||
rd.layers.active and(scene.view_render.engine in cls.COMPAT_ENGINES))
|
scene.render_layers.active and(scene.view_render.engine in cls.COMPAT_ENGINES))
|
||||||
|
|
||||||
|
|
||||||
class RenderLayerFreestyleEditorButtonsPanel(RenderLayerFreestyleButtonsPanel):
|
class RenderLayerFreestyleEditorButtonsPanel(RenderLayerFreestyleButtonsPanel):
|
||||||
|
@ -85,7 +85,7 @@ class RenderLayerFreestyleEditorButtonsPanel(RenderLayerFreestyleButtonsPanel):
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
if not super().poll(context):
|
if not super().poll(context):
|
||||||
return False
|
return False
|
||||||
rl = context.scene.render.layers.active
|
rl = context.scene.render_layers.active
|
||||||
return rl and rl.freestyle_settings.mode == 'EDITOR'
|
return rl and rl.freestyle_settings.mode == 'EDITOR'
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,8 +116,8 @@ class RENDERLAYER_PT_freestyle(RenderLayerFreestyleButtonsPanel, Panel):
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
rd = context.scene.render
|
scene = context.scene
|
||||||
rl = rd.layers.active
|
rl = scene.render_layers.active
|
||||||
freestyle = rl.freestyle_settings
|
freestyle = rl.freestyle_settings
|
||||||
|
|
||||||
layout.active = rl.use_freestyle
|
layout.active = rl.use_freestyle
|
||||||
|
@ -187,7 +187,7 @@ class RENDERLAYER_PT_freestyle_lineset(RenderLayerFreestyleEditorButtonsPanel, P
|
||||||
rd = scene.render
|
rd = scene.render
|
||||||
view_render = scene.view_render
|
view_render = scene.view_render
|
||||||
|
|
||||||
rl = rd.layers.active
|
rl = scene.render_layers.active
|
||||||
freestyle = rl.freestyle_settings
|
freestyle = rl.freestyle_settings
|
||||||
lineset = freestyle.linesets.active
|
lineset = freestyle.linesets.active
|
||||||
|
|
||||||
|
@ -379,7 +379,7 @@ class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel,
|
||||||
row = box.row(align=True)
|
row = box.row(align=True)
|
||||||
row.prop(modifier, "curvature_min")
|
row.prop(modifier, "curvature_min")
|
||||||
row.prop(modifier, "curvature_max")
|
row.prop(modifier, "curvature_max")
|
||||||
freestyle = context.scene.render.layers.active.freestyle_settings
|
freestyle = context.scene.render_layers.active.freestyle_settings
|
||||||
if not freestyle.use_smoothness:
|
if not freestyle.use_smoothness:
|
||||||
message = "Enable Face Smoothness to use this modifier"
|
message = "Enable Face Smoothness to use this modifier"
|
||||||
self.draw_modifier_box_error(col.box(), modifier, message)
|
self.draw_modifier_box_error(col.box(), modifier, message)
|
||||||
|
@ -434,7 +434,7 @@ class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel,
|
||||||
row = box.row(align=True)
|
row = box.row(align=True)
|
||||||
row.prop(modifier, "curvature_min")
|
row.prop(modifier, "curvature_min")
|
||||||
row.prop(modifier, "curvature_max")
|
row.prop(modifier, "curvature_max")
|
||||||
freestyle = context.scene.render.layers.active.freestyle_settings
|
freestyle = context.scene.render_layers.active.freestyle_settings
|
||||||
if not freestyle.use_smoothness:
|
if not freestyle.use_smoothness:
|
||||||
message = "Enable Face Smoothness to use this modifier"
|
message = "Enable Face Smoothness to use this modifier"
|
||||||
self.draw_modifier_box_error(col.box(), modifier, message)
|
self.draw_modifier_box_error(col.box(), modifier, message)
|
||||||
|
@ -506,7 +506,7 @@ class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel,
|
||||||
row = box.row(align=True)
|
row = box.row(align=True)
|
||||||
row.prop(modifier, "curvature_min")
|
row.prop(modifier, "curvature_min")
|
||||||
row.prop(modifier, "curvature_max")
|
row.prop(modifier, "curvature_max")
|
||||||
freestyle = context.scene.render.layers.active.freestyle_settings
|
freestyle = context.scene.render_layers.active.freestyle_settings
|
||||||
if not freestyle.use_smoothness:
|
if not freestyle.use_smoothness:
|
||||||
message = "Enable Face Smoothness to use this modifier"
|
message = "Enable Face Smoothness to use this modifier"
|
||||||
self.draw_modifier_box_error(col.box(), modifier, message)
|
self.draw_modifier_box_error(col.box(), modifier, message)
|
||||||
|
@ -614,8 +614,8 @@ class RENDERLAYER_PT_freestyle_linestyle(RenderLayerFreestyleEditorButtonsPanel,
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
rd = context.scene.render
|
scene = context.scene
|
||||||
rl = rd.layers.active
|
rl = scene.render_layers.active
|
||||||
lineset = rl.freestyle_settings.linesets.active
|
lineset = rl.freestyle_settings.linesets.active
|
||||||
|
|
||||||
layout.active = rl.use_freestyle
|
layout.active = rl.use_freestyle
|
||||||
|
|
|
@ -81,7 +81,7 @@ class NODE_HT_header(Header):
|
||||||
row.prop(snode_id, "use_nodes")
|
row.prop(snode_id, "use_nodes")
|
||||||
|
|
||||||
if use_shading_nodes and snode.shader_type == 'LINESTYLE':
|
if use_shading_nodes and snode.shader_type == 'LINESTYLE':
|
||||||
rl = context.scene.render.layers.active
|
rl = context.scene.render_layers.active
|
||||||
lineset = rl.freestyle_settings.linesets.active
|
lineset = rl.freestyle_settings.linesets.active
|
||||||
if lineset is not None:
|
if lineset is not None:
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
|
|
|
@ -988,7 +988,7 @@ void ntreeCompositTagRender(struct Scene *sce);
|
||||||
int ntreeCompositTagAnimated(struct bNodeTree *ntree);
|
int ntreeCompositTagAnimated(struct bNodeTree *ntree);
|
||||||
void ntreeCompositTagGenerators(struct bNodeTree *ntree);
|
void ntreeCompositTagGenerators(struct bNodeTree *ntree);
|
||||||
void ntreeCompositUpdateRLayers(struct bNodeTree *ntree);
|
void ntreeCompositUpdateRLayers(struct bNodeTree *ntree);
|
||||||
void ntreeCompositRegisterPass(struct bNodeTree *ntree, struct Scene *scene, struct SceneRenderLayer *srl, const char *name, int type);
|
void ntreeCompositRegisterPass(struct bNodeTree *ntree, struct Scene *scene, struct SceneLayer *scene_layer, const char *name, int type);
|
||||||
void ntreeCompositClearTags(struct bNodeTree *ntree);
|
void ntreeCompositClearTags(struct bNodeTree *ntree);
|
||||||
|
|
||||||
struct bNodeSocket *ntreeCompositOutputFileAddSocket(struct bNodeTree *ntree, struct bNode *node,
|
struct bNodeSocket *ntreeCompositOutputFileAddSocket(struct bNodeTree *ntree, struct bNode *node,
|
||||||
|
|
|
@ -43,8 +43,6 @@ struct EvaluationContext;
|
||||||
struct Main;
|
struct Main;
|
||||||
struct Object;
|
struct Object;
|
||||||
struct RenderData;
|
struct RenderData;
|
||||||
struct SceneLayer;
|
|
||||||
struct SceneRenderLayer;
|
|
||||||
struct Scene;
|
struct Scene;
|
||||||
struct SceneCollection;
|
struct SceneCollection;
|
||||||
struct SceneLayer;
|
struct SceneLayer;
|
||||||
|
@ -150,9 +148,6 @@ void BKE_scene_graph_update_for_newframe(struct EvaluationContext *eval_ctx,
|
||||||
struct Scene *scene,
|
struct Scene *scene,
|
||||||
struct SceneLayer *scene_layer);
|
struct SceneLayer *scene_layer);
|
||||||
|
|
||||||
struct SceneRenderLayer *BKE_scene_add_render_layer(struct Scene *sce, const char *name);
|
|
||||||
bool BKE_scene_remove_render_layer(struct Main *main, struct Scene *scene, struct SceneRenderLayer *srl);
|
|
||||||
|
|
||||||
struct SceneRenderView *BKE_scene_add_render_view(struct Scene *sce, const char *name);
|
struct SceneRenderView *BKE_scene_add_render_view(struct Scene *sce, const char *name);
|
||||||
bool BKE_scene_remove_render_view(struct Scene *scene, struct SceneRenderView *srv);
|
bool BKE_scene_remove_render_view(struct Scene *scene, struct SceneRenderView *srv);
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "BLT_translation.h"
|
#include "BLT_translation.h"
|
||||||
|
|
||||||
#include "BKE_collection.h"
|
#include "BKE_collection.h"
|
||||||
|
#include "BKE_freestyle.h"
|
||||||
#include "BKE_global.h"
|
#include "BKE_global.h"
|
||||||
#include "BKE_idprop.h"
|
#include "BKE_idprop.h"
|
||||||
#include "BKE_layer.h"
|
#include "BKE_layer.h"
|
||||||
|
@ -113,7 +114,7 @@ SceneLayer *BKE_scene_layer_add(Scene *scene, const char *name)
|
||||||
|
|
||||||
IDPropertyTemplate val = {0};
|
IDPropertyTemplate val = {0};
|
||||||
SceneLayer *sl = MEM_callocN(sizeof(SceneLayer), "Scene Layer");
|
SceneLayer *sl = MEM_callocN(sizeof(SceneLayer), "Scene Layer");
|
||||||
sl->flag |= SCENE_LAYER_RENDER;
|
sl->flag = SCENE_LAYER_RENDER | SCENE_LAYER_FREESTYLE;
|
||||||
|
|
||||||
sl->properties = IDP_New(IDP_GROUP, &val, ROOT_PROP);
|
sl->properties = IDP_New(IDP_GROUP, &val, ROOT_PROP);
|
||||||
layer_engine_settings_init(sl->properties, false);
|
layer_engine_settings_init(sl->properties, false);
|
||||||
|
@ -127,6 +128,12 @@ SceneLayer *BKE_scene_layer_add(Scene *scene, const char *name)
|
||||||
SceneCollection *sc = BKE_collection_master(scene);
|
SceneCollection *sc = BKE_collection_master(scene);
|
||||||
layer_collection_add(sl, NULL, sc);
|
layer_collection_add(sl, NULL, sc);
|
||||||
|
|
||||||
|
/* Pure rendering pipeline settings. */
|
||||||
|
sl->layflag = 0x7FFF; /* solid ztra halo edge strand */
|
||||||
|
sl->passflag = SCE_PASS_COMBINED | SCE_PASS_Z;
|
||||||
|
sl->pass_alpha_threshold = 0.5f;
|
||||||
|
BKE_freestyle_config_init(&sl->freestyle_config);
|
||||||
|
|
||||||
return sl;
|
return sl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,6 +179,13 @@ void BKE_scene_layer_free(SceneLayer *sl)
|
||||||
|
|
||||||
MEM_SAFE_FREE(sl->stats);
|
MEM_SAFE_FREE(sl->stats);
|
||||||
|
|
||||||
|
BKE_freestyle_config_free(&sl->freestyle_config);
|
||||||
|
|
||||||
|
if (sl->id_properties) {
|
||||||
|
IDP_FreeProperty(sl->id_properties);
|
||||||
|
MEM_freeN(sl->id_properties);
|
||||||
|
}
|
||||||
|
|
||||||
MEM_freeN(sl);
|
MEM_freeN(sl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -407,7 +407,6 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call
|
||||||
{
|
{
|
||||||
Scene *scene = (Scene *) id;
|
Scene *scene = (Scene *) id;
|
||||||
ToolSettings *toolsett = scene->toolsettings;
|
ToolSettings *toolsett = scene->toolsettings;
|
||||||
SceneRenderLayer *srl;
|
|
||||||
|
|
||||||
CALLBACK_INVOKE(scene->camera, IDWALK_CB_NOP);
|
CALLBACK_INVOKE(scene->camera, IDWALK_CB_NOP);
|
||||||
CALLBACK_INVOKE(scene->world, IDWALK_CB_USER);
|
CALLBACK_INVOKE(scene->world, IDWALK_CB_USER);
|
||||||
|
@ -421,25 +420,6 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call
|
||||||
* since basact is just a pointer to one of those items. */
|
* since basact is just a pointer to one of those items. */
|
||||||
CALLBACK_INVOKE(scene->obedit, IDWALK_CB_NOP);
|
CALLBACK_INVOKE(scene->obedit, IDWALK_CB_NOP);
|
||||||
|
|
||||||
for (srl = scene->r.layers.first; srl; srl = srl->next) {
|
|
||||||
FreestyleModuleConfig *fmc;
|
|
||||||
FreestyleLineSet *fls;
|
|
||||||
|
|
||||||
for (fmc = srl->freestyleConfig.modules.first; fmc; fmc = fmc->next) {
|
|
||||||
if (fmc->script) {
|
|
||||||
CALLBACK_INVOKE(fmc->script, IDWALK_CB_NOP);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (fls = srl->freestyleConfig.linesets.first; fls; fls = fls->next) {
|
|
||||||
if (fls->group) {
|
|
||||||
CALLBACK_INVOKE(fls->group, IDWALK_CB_USER);
|
|
||||||
}
|
|
||||||
if (fls->linestyle) {
|
|
||||||
CALLBACK_INVOKE(fls->linestyle, IDWALK_CB_USER);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (scene->ed) {
|
if (scene->ed) {
|
||||||
Sequence *seq;
|
Sequence *seq;
|
||||||
SEQP_BEGIN(scene->ed, seq)
|
SEQP_BEGIN(scene->ed, seq)
|
||||||
|
@ -471,11 +451,27 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call
|
||||||
}
|
}
|
||||||
FOREACH_SCENE_COLLECTION_END
|
FOREACH_SCENE_COLLECTION_END
|
||||||
|
|
||||||
SceneLayer *sl;
|
SceneLayer *scene_layer;
|
||||||
for (sl = scene->render_layers.first; sl; sl = sl->next) {
|
for (scene_layer = scene->render_layers.first; scene_layer; scene_layer = scene_layer->next) {
|
||||||
for (Base *base = sl->object_bases.first; base; base = base->next) {
|
for (Base *base = scene_layer->object_bases.first; base; base = base->next) {
|
||||||
CALLBACK_INVOKE(base->object, IDWALK_NOP);
|
CALLBACK_INVOKE(base->object, IDWALK_NOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (FreestyleModuleConfig *fmc = scene_layer->freestyle_config.modules.first; fmc; fmc = fmc->next) {
|
||||||
|
if (fmc->script) {
|
||||||
|
CALLBACK_INVOKE(fmc->script, IDWALK_CB_NOP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (FreestyleLineSet *fls = scene_layer->freestyle_config.linesets.first; fls; fls = fls->next) {
|
||||||
|
if (fls->group) {
|
||||||
|
CALLBACK_INVOKE(fls->group, IDWALK_CB_USER);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fls->linestyle) {
|
||||||
|
CALLBACK_INVOKE(fls->linestyle, IDWALK_CB_USER);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (TimeMarker *marker = scene->markers.first; marker; marker = marker->next) {
|
for (TimeMarker *marker = scene->markers.first; marker; marker = marker->next) {
|
||||||
|
|
|
@ -215,9 +215,9 @@ void BKE_linestyle_make_local(struct Main *bmain, FreestyleLineStyle *linestyle,
|
||||||
|
|
||||||
FreestyleLineStyle *BKE_linestyle_active_from_scene(Scene *scene)
|
FreestyleLineStyle *BKE_linestyle_active_from_scene(Scene *scene)
|
||||||
{
|
{
|
||||||
SceneRenderLayer *actsrl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *active_render_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
if (actsrl) {
|
if (active_render_layer) {
|
||||||
FreestyleConfig *config = &actsrl->freestyleConfig;
|
FreestyleConfig *config = &active_render_layer->freestyle_config;
|
||||||
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);
|
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);
|
||||||
if (lineset) {
|
if (lineset) {
|
||||||
return lineset->linestyle;
|
return lineset->linestyle;
|
||||||
|
|
|
@ -252,28 +252,33 @@ void BKE_scene_copy_data(Main *bmain, Scene *sce_dst, const Scene *sce_src, cons
|
||||||
|
|
||||||
IDPropertyTemplate val = {0};
|
IDPropertyTemplate val = {0};
|
||||||
BLI_duplicatelist(&sce_dst->render_layers, &sce_src->render_layers);
|
BLI_duplicatelist(&sce_dst->render_layers, &sce_src->render_layers);
|
||||||
for (SceneLayer *sl_src = sce_src->render_layers.first, *sl_dst = sce_dst->render_layers.first;
|
for (SceneLayer *scene_layer_src = sce_src->render_layers.first, *scene_layer_dst = sce_dst->render_layers.first;
|
||||||
sl_src;
|
scene_layer_src;
|
||||||
sl_src = sl_src->next, sl_dst = sl_dst->next)
|
scene_layer_src = scene_layer_src->next, scene_layer_dst = scene_layer_dst->next)
|
||||||
{
|
{
|
||||||
sl_dst->stats = NULL;
|
if (scene_layer_dst->id_properties != NULL) {
|
||||||
sl_dst->properties_evaluated = NULL;
|
scene_layer_dst->id_properties = IDP_CopyProperty_ex(scene_layer_dst->id_properties, flag_subdata);
|
||||||
sl_dst->properties = IDP_New(IDP_GROUP, &val, ROOT_PROP);
|
}
|
||||||
IDP_MergeGroup_ex(sl_dst->properties, sl_src->properties, true, flag_subdata);
|
BKE_freestyle_config_copy(&scene_layer_dst->freestyle_config, &scene_layer_src->freestyle_config, flag_subdata);
|
||||||
|
|
||||||
|
scene_layer_dst->stats = NULL;
|
||||||
|
scene_layer_dst->properties_evaluated = NULL;
|
||||||
|
scene_layer_dst->properties = IDP_New(IDP_GROUP, &val, ROOT_PROP);
|
||||||
|
IDP_MergeGroup_ex(scene_layer_dst->properties, scene_layer_src->properties, true, flag_subdata);
|
||||||
|
|
||||||
/* we start fresh with no overrides and no visibility flags set
|
/* we start fresh with no overrides and no visibility flags set
|
||||||
* instead of syncing both trees we simply unlink and relink the scene collection */
|
* instead of syncing both trees we simply unlink and relink the scene collection */
|
||||||
BLI_listbase_clear(&sl_dst->layer_collections);
|
BLI_listbase_clear(&scene_layer_dst->layer_collections);
|
||||||
BLI_listbase_clear(&sl_dst->object_bases);
|
BLI_listbase_clear(&scene_layer_dst->object_bases);
|
||||||
BLI_listbase_clear(&sl_dst->drawdata);
|
BLI_listbase_clear(&scene_layer_dst->drawdata);
|
||||||
|
|
||||||
layer_collections_recreate(sl_dst, &sl_src->layer_collections, mc_dst, mc_src);
|
layer_collections_recreate(scene_layer_dst, &scene_layer_src->layer_collections, mc_dst, mc_src);
|
||||||
|
|
||||||
/* Now we handle the syncing for visibility, selectability, ... */
|
/* Now we handle the syncing for visibility, selectability, ... */
|
||||||
layer_collections_sync_flags(&sl_dst->layer_collections, &sl_src->layer_collections);
|
layer_collections_sync_flags(&scene_layer_dst->layer_collections, &scene_layer_src->layer_collections);
|
||||||
|
|
||||||
Object *active_ob = OBACT(sl_src);
|
Object *active_ob = OBACT(scene_layer_src);
|
||||||
for (Base *base_src = sl_src->object_bases.first, *base_dst = sl_dst->object_bases.first;
|
for (Base *base_src = scene_layer_src->object_bases.first, *base_dst = scene_layer_dst->object_bases.first;
|
||||||
base_src;
|
base_src;
|
||||||
base_src = base_src->next, base_dst = base_dst->next)
|
base_src = base_src->next, base_dst = base_dst->next)
|
||||||
{
|
{
|
||||||
|
@ -281,7 +286,7 @@ void BKE_scene_copy_data(Main *bmain, Scene *sce_dst, const Scene *sce_src, cons
|
||||||
base_dst->flag_legacy = base_src->flag_legacy;
|
base_dst->flag_legacy = base_src->flag_legacy;
|
||||||
|
|
||||||
if (base_dst->object == active_ob) {
|
if (base_dst->object == active_ob) {
|
||||||
sl_dst->basact = base_dst;
|
scene_layer_dst->basact = base_dst;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -296,7 +301,6 @@ void BKE_scene_copy_data(Main *bmain, Scene *sce_dst, const Scene *sce_src, cons
|
||||||
}
|
}
|
||||||
|
|
||||||
BLI_duplicatelist(&(sce_dst->markers), &(sce_src->markers));
|
BLI_duplicatelist(&(sce_dst->markers), &(sce_src->markers));
|
||||||
BLI_duplicatelist(&(sce_dst->r.layers), &(sce_src->r.layers));
|
|
||||||
BLI_duplicatelist(&(sce_dst->r.views), &(sce_src->r.views));
|
BLI_duplicatelist(&(sce_dst->r.views), &(sce_src->r.views));
|
||||||
BKE_keyingsets_copy(&(sce_dst->keyingsets), &(sce_src->keyingsets));
|
BKE_keyingsets_copy(&(sce_dst->keyingsets), &(sce_src->keyingsets));
|
||||||
|
|
||||||
|
@ -311,17 +315,6 @@ void BKE_scene_copy_data(Main *bmain, Scene *sce_dst, const Scene *sce_src, cons
|
||||||
sce_dst->rigidbody_world = BKE_rigidbody_world_copy(sce_src->rigidbody_world, flag_subdata);
|
sce_dst->rigidbody_world = BKE_rigidbody_world_copy(sce_src->rigidbody_world, flag_subdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* copy Freestyle settings */
|
|
||||||
for (SceneRenderLayer *srl_dst = sce_dst->r.layers.first, *srl_src = sce_src->r.layers.first;
|
|
||||||
srl_src;
|
|
||||||
srl_dst = srl_dst->next, srl_src = srl_src->next)
|
|
||||||
{
|
|
||||||
if (srl_dst->prop != NULL) {
|
|
||||||
srl_dst->prop = IDP_CopyProperty_ex(srl_dst->prop, flag_subdata);
|
|
||||||
}
|
|
||||||
BKE_freestyle_config_copy(&srl_dst->freestyleConfig, &srl_src->freestyleConfig, flag_subdata);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* copy color management settings */
|
/* copy color management settings */
|
||||||
BKE_color_managed_display_settings_copy(&sce_dst->display_settings, &sce_src->display_settings);
|
BKE_color_managed_display_settings_copy(&sce_dst->display_settings, &sce_src->display_settings);
|
||||||
BKE_color_managed_view_settings_copy(&sce_dst->view_settings, &sce_src->view_settings);
|
BKE_color_managed_view_settings_copy(&sce_dst->view_settings, &sce_src->view_settings);
|
||||||
|
@ -410,16 +403,14 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type)
|
||||||
* But for now, let's keep it well isolated here. */
|
* But for now, let's keep it well isolated here. */
|
||||||
if (type == SCE_COPY_EMPTY) {
|
if (type == SCE_COPY_EMPTY) {
|
||||||
ToolSettings *ts;
|
ToolSettings *ts;
|
||||||
ListBase rl, rv;
|
ListBase rv;
|
||||||
|
|
||||||
sce_copy = BKE_scene_add(bmain, sce->id.name + 2);
|
sce_copy = BKE_scene_add(bmain, sce->id.name + 2);
|
||||||
|
|
||||||
rl = sce_copy->r.layers;
|
|
||||||
rv = sce_copy->r.views;
|
rv = sce_copy->r.views;
|
||||||
curvemapping_free_data(&sce_copy->r.mblur_shutter_curve);
|
curvemapping_free_data(&sce_copy->r.mblur_shutter_curve);
|
||||||
sce_copy->r = sce->r;
|
sce_copy->r = sce->r;
|
||||||
sce_copy->r.layers = rl;
|
sce_copy->active_layer = 0;
|
||||||
sce_copy->r.actlay = 0;
|
|
||||||
sce_copy->r.views = rv;
|
sce_copy->r.views = rv;
|
||||||
sce_copy->unit = sce->unit;
|
sce_copy->unit = sce->unit;
|
||||||
sce_copy->physics_settings = sce->physics_settings;
|
sce_copy->physics_settings = sce->physics_settings;
|
||||||
|
@ -517,8 +508,8 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type)
|
||||||
|
|
||||||
if (type == SCE_COPY_FULL) {
|
if (type == SCE_COPY_FULL) {
|
||||||
/* Copy Freestyle LineStyle datablocks. */
|
/* Copy Freestyle LineStyle datablocks. */
|
||||||
for (SceneRenderLayer *srl_dst = sce_copy->r.layers.first; srl_dst; srl_dst = srl_dst->next) {
|
for (SceneLayer *scene_layer_dst = sce_copy->render_layers.first; scene_layer_dst; scene_layer_dst = scene_layer_dst->next) {
|
||||||
for (FreestyleLineSet *lineset = srl_dst->freestyleConfig.linesets.first; lineset; lineset = lineset->next) {
|
for (FreestyleLineSet *lineset = scene_layer_dst->freestyle_config.linesets.first; lineset; lineset = lineset->next) {
|
||||||
if (lineset->linestyle) {
|
if (lineset->linestyle) {
|
||||||
/* XXX Not copying anim/actions here? */
|
/* XXX Not copying anim/actions here? */
|
||||||
BKE_id_copy_ex(bmain, (ID *)lineset->linestyle, (ID **)&lineset->linestyle, 0, false);
|
BKE_id_copy_ex(bmain, (ID *)lineset->linestyle, (ID **)&lineset->linestyle, 0, false);
|
||||||
|
@ -572,8 +563,6 @@ void BKE_scene_make_local(Main *bmain, Scene *sce, const bool lib_local)
|
||||||
/** Free (or release) any data used by this scene (does not free the scene itself). */
|
/** Free (or release) any data used by this scene (does not free the scene itself). */
|
||||||
void BKE_scene_free_ex(Scene *sce, const bool do_id_user)
|
void BKE_scene_free_ex(Scene *sce, const bool do_id_user)
|
||||||
{
|
{
|
||||||
SceneRenderLayer *srl;
|
|
||||||
|
|
||||||
BKE_animdata_free((ID *)sce, false);
|
BKE_animdata_free((ID *)sce, false);
|
||||||
|
|
||||||
/* check all sequences */
|
/* check all sequences */
|
||||||
|
@ -606,16 +595,7 @@ void BKE_scene_free_ex(Scene *sce, const bool do_id_user)
|
||||||
sce->r.ffcodecdata.properties = NULL;
|
sce->r.ffcodecdata.properties = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (srl = sce->r.layers.first; srl; srl = srl->next) {
|
|
||||||
if (srl->prop != NULL) {
|
|
||||||
IDP_FreeProperty(srl->prop);
|
|
||||||
MEM_freeN(srl->prop);
|
|
||||||
}
|
|
||||||
BKE_freestyle_config_free(&srl->freestyleConfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
BLI_freelistN(&sce->markers);
|
BLI_freelistN(&sce->markers);
|
||||||
BLI_freelistN(&sce->r.layers);
|
|
||||||
BLI_freelistN(&sce->r.views);
|
BLI_freelistN(&sce->r.views);
|
||||||
|
|
||||||
if (sce->toolsettings) {
|
if (sce->toolsettings) {
|
||||||
|
@ -907,7 +887,6 @@ void BKE_scene_init(Scene *sce)
|
||||||
sce->r.osa = 8;
|
sce->r.osa = 8;
|
||||||
|
|
||||||
/* note; in header_info.c the scene copy happens..., if you add more to renderdata it has to be checked there */
|
/* note; in header_info.c the scene copy happens..., if you add more to renderdata it has to be checked there */
|
||||||
BKE_scene_add_render_layer(sce, NULL);
|
|
||||||
|
|
||||||
/* multiview - stereo */
|
/* multiview - stereo */
|
||||||
BKE_scene_add_render_view(sce, STEREO_LEFT_NAME);
|
BKE_scene_add_render_view(sce, STEREO_LEFT_NAME);
|
||||||
|
@ -1618,64 +1597,6 @@ void BKE_scene_graph_update_for_newframe(EvaluationContext *eval_ctx,
|
||||||
DEG_ids_clear_recalc(bmain);
|
DEG_ids_clear_recalc(bmain);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return default layer, also used to patch old files */
|
|
||||||
SceneRenderLayer *BKE_scene_add_render_layer(Scene *sce, const char *name)
|
|
||||||
{
|
|
||||||
SceneRenderLayer *srl;
|
|
||||||
|
|
||||||
if (!name)
|
|
||||||
name = DATA_("RenderLayer");
|
|
||||||
|
|
||||||
srl = MEM_callocN(sizeof(SceneRenderLayer), "new render layer");
|
|
||||||
BLI_strncpy(srl->name, name, sizeof(srl->name));
|
|
||||||
BLI_uniquename(&sce->r.layers, srl, DATA_("RenderLayer"), '.', offsetof(SceneRenderLayer, name), sizeof(srl->name));
|
|
||||||
BLI_addtail(&sce->r.layers, srl);
|
|
||||||
|
|
||||||
/* note, this is also in render, pipeline.c, to make layer when scenedata doesnt have it */
|
|
||||||
srl->layflag = 0x7FFF; /* solid ztra halo edge strand */
|
|
||||||
srl->passflag = SCE_PASS_COMBINED | SCE_PASS_Z;
|
|
||||||
srl->pass_alpha_threshold = 0.5f;
|
|
||||||
BKE_freestyle_config_init(&srl->freestyleConfig);
|
|
||||||
|
|
||||||
return srl;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool BKE_scene_remove_render_layer(Main *bmain, Scene *scene, SceneRenderLayer *srl)
|
|
||||||
{
|
|
||||||
const int act = BLI_findindex(&scene->r.layers, srl);
|
|
||||||
Scene *sce;
|
|
||||||
|
|
||||||
if (act == -1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if ( (scene->r.layers.first == scene->r.layers.last) &&
|
|
||||||
(scene->r.layers.first == srl))
|
|
||||||
{
|
|
||||||
/* ensure 1 layer is kept */
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
BKE_freestyle_config_free(&srl->freestyleConfig);
|
|
||||||
|
|
||||||
if (srl->prop) {
|
|
||||||
IDP_FreeProperty(srl->prop);
|
|
||||||
MEM_freeN(srl->prop);
|
|
||||||
}
|
|
||||||
|
|
||||||
BLI_remlink(&scene->r.layers, srl);
|
|
||||||
MEM_freeN(srl);
|
|
||||||
|
|
||||||
scene->r.actlay = 0;
|
|
||||||
|
|
||||||
for (sce = bmain->scene.first; sce; sce = sce->id.next) {
|
|
||||||
if (sce->nodetree) {
|
|
||||||
BKE_nodetree_remove_layer_n(sce->nodetree, scene, act);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* return default view */
|
/* return default view */
|
||||||
SceneRenderView *BKE_scene_add_render_view(Scene *sce, const char *name)
|
SceneRenderView *BKE_scene_add_render_view(Scene *sce, const char *name)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5935,6 +5935,16 @@ static void lib_link_scene(FileData *fd, Main *main)
|
||||||
for (SceneLayer *scene_layer = sce->render_layers.first; scene_layer; scene_layer = scene_layer->next) {
|
for (SceneLayer *scene_layer = sce->render_layers.first; scene_layer; scene_layer = scene_layer->next) {
|
||||||
/* tag scene layer to update for collection tree evaluation */
|
/* tag scene layer to update for collection tree evaluation */
|
||||||
scene_layer->flag |= SCENE_LAYER_ENGINE_DIRTY;
|
scene_layer->flag |= SCENE_LAYER_ENGINE_DIRTY;
|
||||||
|
|
||||||
|
for (FreestyleModuleConfig *fmc = scene_layer->freestyle_config.modules.first; fmc; fmc = fmc->next) {
|
||||||
|
fmc->script = newlibadr(fd, sce->id.lib, fmc->script);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (FreestyleLineSet *fls = scene_layer->freestyle_config.linesets.first; fls; fls = fls->next) {
|
||||||
|
fls->linestyle = newlibadr_us(fd, sce->id.lib, fls->linestyle);
|
||||||
|
fls->group = newlibadr_us(fd, sce->id.lib, fls->group);
|
||||||
|
}
|
||||||
|
|
||||||
for (Base *base = scene_layer->object_bases.first; base; base = base->next) {
|
for (Base *base = scene_layer->object_bases.first; base; base = base->next) {
|
||||||
/* we only bump the use count for the collection objects */
|
/* we only bump the use count for the collection objects */
|
||||||
base->object = newlibadr(fd, sce->id.lib, base->object);
|
base->object = newlibadr(fd, sce->id.lib, base->object);
|
||||||
|
@ -6305,11 +6315,7 @@ static void direct_link_scene(FileData *fd, Scene *sce, Main *bmain)
|
||||||
for (srl = sce->r.layers.first; srl; srl = srl->next) {
|
for (srl = sce->r.layers.first; srl; srl = srl->next) {
|
||||||
srl->prop = newdataadr(fd, srl->prop);
|
srl->prop = newdataadr(fd, srl->prop);
|
||||||
IDP_DirectLinkGroup_OrFree(&srl->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
|
IDP_DirectLinkGroup_OrFree(&srl->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
|
||||||
}
|
|
||||||
for (srl = sce->r.layers.first; srl; srl = srl->next) {
|
|
||||||
link_list(fd, &(srl->freestyleConfig.modules));
|
link_list(fd, &(srl->freestyleConfig.modules));
|
||||||
}
|
|
||||||
for (srl = sce->r.layers.first; srl; srl = srl->next) {
|
|
||||||
link_list(fd, &(srl->freestyleConfig.linesets));
|
link_list(fd, &(srl->freestyleConfig.linesets));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6369,6 +6375,12 @@ static void direct_link_scene(FileData *fd, Scene *sce, Main *bmain)
|
||||||
BKE_scene_layer_engine_settings_validate_layer(scene_layer);
|
BKE_scene_layer_engine_settings_validate_layer(scene_layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scene_layer->id_properties = newdataadr(fd, scene_layer->id_properties);
|
||||||
|
IDP_DirectLinkGroup_OrFree(&scene_layer->id_properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
|
||||||
|
|
||||||
|
link_list(fd, &(scene_layer->freestyle_config.modules));
|
||||||
|
link_list(fd, &(scene_layer->freestyle_config.linesets));
|
||||||
|
|
||||||
scene_layer->properties_evaluated = NULL;
|
scene_layer->properties_evaluated = NULL;
|
||||||
|
|
||||||
BLI_listbase_clear(&scene_layer->drawdata);
|
BLI_listbase_clear(&scene_layer->drawdata);
|
||||||
|
@ -9810,7 +9822,22 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce)
|
||||||
expand_doit(fd, mainvar, lineset->linestyle);
|
expand_doit(fd, mainvar, lineset->linestyle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (SceneLayer *scene_layer = sce->render_layers.first; scene_layer; scene_layer = scene_layer->next) {
|
||||||
|
for (module = scene_layer->freestyle_config.modules.first; module; module = module->next) {
|
||||||
|
if (module->script) {
|
||||||
|
expand_doit(fd, mainvar, module->script);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (lineset = scene_layer->freestyle_config.linesets.first; lineset; lineset = lineset->next) {
|
||||||
|
if (lineset->group) {
|
||||||
|
expand_doit(fd, mainvar, lineset->group);
|
||||||
|
}
|
||||||
|
expand_doit(fd, mainvar, lineset->linestyle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (sce->r.dometext)
|
if (sce->r.dometext)
|
||||||
expand_doit(fd, mainvar, sce->gm.dome.warptext);
|
expand_doit(fd, mainvar, sce->gm.dome.warptext);
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
|
|
||||||
#include "BKE_collection.h"
|
#include "BKE_collection.h"
|
||||||
#include "BKE_customdata.h"
|
#include "BKE_customdata.h"
|
||||||
|
#include "BKE_freestyle.h"
|
||||||
#include "BKE_idprop.h"
|
#include "BKE_idprop.h"
|
||||||
#include "BKE_layer.h"
|
#include "BKE_layer.h"
|
||||||
#include "BKE_main.h"
|
#include "BKE_main.h"
|
||||||
|
@ -324,6 +325,25 @@ void do_versions_after_linking_280(Main *main)
|
||||||
(ID *)srl->mat_override);
|
(ID *)srl->mat_override);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (srl->layflag & SCE_LAY_DISABLE) {
|
||||||
|
scene_layer->flag &= ~SCENE_LAYER_RENDER;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((srl->layflag & SCE_LAY_FRS) == 0) {
|
||||||
|
scene_layer->flag &= ~SCENE_LAYER_FREESTYLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* XXX If we are to keep layflag it should be merged with flag (dfelinto). */
|
||||||
|
scene_layer->layflag = srl->layflag;
|
||||||
|
/* XXX Not sure if we should keep the passes (dfelinto). */
|
||||||
|
scene_layer->passflag = srl->passflag;
|
||||||
|
scene_layer->pass_xor = srl->pass_xor;
|
||||||
|
scene_layer->pass_alpha_threshold = srl->pass_alpha_threshold;
|
||||||
|
|
||||||
|
BKE_freestyle_config_free(&scene_layer->freestyle_config);
|
||||||
|
scene_layer->freestyle_config = srl->freestyleConfig;
|
||||||
|
scene_layer->id_properties = srl->prop;
|
||||||
|
|
||||||
/* unlink master collection */
|
/* unlink master collection */
|
||||||
BKE_collection_unlink(scene_layer, scene_layer->layer_collections.first);
|
BKE_collection_unlink(scene_layer, scene_layer->layer_collections.first);
|
||||||
|
|
||||||
|
@ -383,14 +403,22 @@ void do_versions_after_linking_280(Main *main)
|
||||||
base->flag |= BASE_SELECTED;
|
base->flag |= BASE_SELECTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: passes, samples, mask_layesr, exclude, ... */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BLI_findlink(&scene->render_layers, scene->r.actlay)) {
|
if (BLI_findlink(&scene->render_layers, scene->r.actlay)) {
|
||||||
scene->active_layer = scene->r.actlay;
|
scene->active_layer = scene->r.actlay;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
for (SceneRenderLayer *srl = scene->r.layers.first; srl; srl = srl->next) {
|
||||||
|
if (srl->prop) {
|
||||||
|
IDP_FreeProperty(srl->prop);
|
||||||
|
MEM_freeN(srl->prop);
|
||||||
|
}
|
||||||
|
BKE_freestyle_config_free(&srl->freestyleConfig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BLI_freelistN(&scene->r.layers);
|
||||||
|
|
||||||
SceneLayer *scene_layer = BKE_scene_layer_add(scene, "Viewport");
|
SceneLayer *scene_layer = BKE_scene_layer_add(scene, "Viewport");
|
||||||
|
|
||||||
|
@ -441,8 +469,6 @@ void do_versions_after_linking_280(Main *main)
|
||||||
base->lay = base->object->lay;
|
base->lay = base->object->lay;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: copy scene render data to layer */
|
|
||||||
|
|
||||||
/* Fallback name if only one layer was found in the original file */
|
/* Fallback name if only one layer was found in the original file */
|
||||||
if (BLI_listbase_count_ex(&sc_master->scene_collections, 2) == 1) {
|
if (BLI_listbase_count_ex(&sc_master->scene_collections, 2) == 1) {
|
||||||
BKE_collection_rename(scene, sc_master->scene_collections.first, "Default Collection");
|
BKE_collection_rename(scene, sc_master->scene_collections.first, "Default Collection");
|
||||||
|
@ -697,4 +723,19 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
if (!DNA_struct_elem_find(fd->filesdna, "SceneLayer", "FreestyleConfig", "freestyle_config")) {
|
||||||
|
for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
|
||||||
|
SceneLayer *scene_layer;
|
||||||
|
for (scene_layer = scene->render_layers.first; scene_layer; scene_layer = scene_layer->next) {
|
||||||
|
scene_layer->flag |= SCENE_LAYER_FREESTYLE;
|
||||||
|
scene_layer->layflag = 0x7FFF; /* solid ztra halo edge strand */
|
||||||
|
scene_layer->passflag = SCE_PASS_COMBINED | SCE_PASS_Z;
|
||||||
|
scene_layer->pass_alpha_threshold = 0.5f;
|
||||||
|
BKE_freestyle_config_init(&scene_layer->freestyle_config);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,9 +127,9 @@ void BLO_update_defaults_startup_blend(Main *bmain)
|
||||||
scene->r.im_format.planes = R_IMF_PLANES_RGBA;
|
scene->r.im_format.planes = R_IMF_PLANES_RGBA;
|
||||||
scene->r.im_format.compress = 15;
|
scene->r.im_format.compress = 15;
|
||||||
|
|
||||||
for (SceneRenderLayer *srl = scene->r.layers.first; srl; srl = srl->next) {
|
for (SceneLayer *scene_layer = scene->render_layers.first; scene_layer; scene_layer = scene_layer->next) {
|
||||||
srl->freestyleConfig.sphere_radius = 0.1f;
|
scene_layer->freestyle_config.sphere_radius = 0.1f;
|
||||||
srl->pass_alpha_threshold = 0.5f;
|
scene_layer->pass_alpha_threshold = 0.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scene->toolsettings) {
|
if (scene->toolsettings) {
|
||||||
|
|
|
@ -2145,18 +2145,16 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
|
||||||
if (sce->r.yparts < 2)
|
if (sce->r.yparts < 2)
|
||||||
sce->r.yparts = 4;
|
sce->r.yparts = 4;
|
||||||
|
|
||||||
/* adds default layer */
|
/* We don't add default layer since blender2.8 because the layers
|
||||||
if (BLI_listbase_is_empty(&sce->r.layers)) {
|
* are now in Scene->render_layers and a default layer is created in
|
||||||
BKE_scene_add_render_layer(sce, NULL);
|
* the doversion later on.
|
||||||
}
|
*/
|
||||||
else {
|
SceneRenderLayer *srl;
|
||||||
SceneRenderLayer *srl;
|
/* new layer flag for sky, was default for solid */
|
||||||
/* new layer flag for sky, was default for solid */
|
for (srl = sce->r.layers.first; srl; srl = srl->next) {
|
||||||
for (srl = sce->r.layers.first; srl; srl = srl->next) {
|
if (srl->layflag & SCE_LAY_SOLID)
|
||||||
if (srl->layflag & SCE_LAY_SOLID)
|
srl->layflag |= SCE_LAY_SKY;
|
||||||
srl->layflag |= SCE_LAY_SKY;
|
srl->passflag &= (SCE_PASS_COMBINED|SCE_PASS_Z|SCE_PASS_NORMAL|SCE_PASS_VECTOR);
|
||||||
srl->passflag &= (SCE_PASS_COMBINED|SCE_PASS_Z|SCE_PASS_NORMAL|SCE_PASS_VECTOR);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* node version changes */
|
/* node version changes */
|
||||||
|
|
|
@ -2748,19 +2748,6 @@ static void write_scene(WriteData *wd, Scene *sce)
|
||||||
writestruct(wd, DATA, TimeMarker, 1, marker);
|
writestruct(wd, DATA, TimeMarker, 1, marker);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (SceneRenderLayer *srl = sce->r.layers.first; srl; srl = srl->next) {
|
|
||||||
writestruct(wd, DATA, SceneRenderLayer, 1, srl);
|
|
||||||
if (srl->prop) {
|
|
||||||
IDP_WriteProperty(srl->prop, wd);
|
|
||||||
}
|
|
||||||
for (FreestyleModuleConfig *fmc = srl->freestyleConfig.modules.first; fmc; fmc = fmc->next) {
|
|
||||||
writestruct(wd, DATA, FreestyleModuleConfig, 1, fmc);
|
|
||||||
}
|
|
||||||
for (FreestyleLineSet *fls = srl->freestyleConfig.linesets.first; fls; fls = fls->next) {
|
|
||||||
writestruct(wd, DATA, FreestyleLineSet, 1, fls);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* writing MultiView to the blend file */
|
/* writing MultiView to the blend file */
|
||||||
for (SceneRenderView *srv = sce->r.views.first; srv; srv = srv->next) {
|
for (SceneRenderView *srv = sce->r.views.first; srv; srv = srv->next) {
|
||||||
writestruct(wd, DATA, SceneRenderView, 1, srv);
|
writestruct(wd, DATA, SceneRenderView, 1, srv);
|
||||||
|
@ -2787,9 +2774,23 @@ static void write_scene(WriteData *wd, Scene *sce)
|
||||||
for (SceneLayer *scene_layer = sce->render_layers.first; scene_layer; scene_layer = scene_layer->next) {
|
for (SceneLayer *scene_layer = sce->render_layers.first; scene_layer; scene_layer = scene_layer->next) {
|
||||||
writestruct(wd, DATA, SceneLayer, 1, scene_layer);
|
writestruct(wd, DATA, SceneLayer, 1, scene_layer);
|
||||||
writelist(wd, DATA, Base, &scene_layer->object_bases);
|
writelist(wd, DATA, Base, &scene_layer->object_bases);
|
||||||
|
|
||||||
if (scene_layer->properties) {
|
if (scene_layer->properties) {
|
||||||
IDP_WriteProperty(scene_layer->properties, wd);
|
IDP_WriteProperty(scene_layer->properties, wd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (scene_layer->id_properties) {
|
||||||
|
IDP_WriteProperty(scene_layer->id_properties, wd);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (FreestyleModuleConfig *fmc = scene_layer->freestyle_config.modules.first; fmc; fmc = fmc->next) {
|
||||||
|
writestruct(wd, DATA, FreestyleModuleConfig, 1, fmc);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (FreestyleLineSet *fls = scene_layer->freestyle_config.linesets.first; fls; fls = fls->next) {
|
||||||
|
writestruct(wd, DATA, FreestyleLineSet, 1, fls);
|
||||||
|
}
|
||||||
|
|
||||||
write_layer_collections(wd, &scene_layer->layer_collections);
|
write_layer_collections(wd, &scene_layer->layer_collections);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,12 +65,12 @@ void RenderLayersNode::testRenderLink(NodeConverter &converter,
|
||||||
missingRenderLink(converter);
|
missingRenderLink(converter);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SceneRenderLayer *srl = (SceneRenderLayer *)BLI_findlink(&scene->r.layers, layerId);
|
SceneLayer *scene_layer = (SceneLayer *)BLI_findlink(&scene->render_layers, layerId);
|
||||||
if (srl == NULL) {
|
if (scene_layer == NULL) {
|
||||||
missingRenderLink(converter);
|
missingRenderLink(converter);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RenderLayer *rl = RE_GetRenderLayer(rr, srl->name);
|
RenderLayer *rl = RE_GetRenderLayer(rr, scene_layer->name);
|
||||||
if (rl == NULL) {
|
if (rl == NULL) {
|
||||||
missingRenderLink(converter);
|
missingRenderLink(converter);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -55,10 +55,10 @@ void RenderLayersProg::initExecution()
|
||||||
rr = RE_AcquireResultRead(re);
|
rr = RE_AcquireResultRead(re);
|
||||||
|
|
||||||
if (rr) {
|
if (rr) {
|
||||||
SceneRenderLayer *srl = (SceneRenderLayer *)BLI_findlink(&scene->r.layers, getLayerId());
|
SceneLayer *scene_layer = (SceneLayer *)BLI_findlink(&scene->render_layers, getLayerId());
|
||||||
if (srl) {
|
if (scene_layer) {
|
||||||
|
|
||||||
RenderLayer *rl = RE_GetRenderLayer(rr, srl->name);
|
RenderLayer *rl = RE_GetRenderLayer(rr, scene_layer->name);
|
||||||
if (rl) {
|
if (rl) {
|
||||||
this->m_inputBuffer = RE_RenderLayerGetPass(rl, this->m_passName.c_str(), this->m_viewName);
|
this->m_inputBuffer = RE_RenderLayerGetPass(rl, this->m_passName.c_str(), this->m_viewName);
|
||||||
}
|
}
|
||||||
|
@ -189,9 +189,9 @@ void RenderLayersProg::determineResolution(unsigned int resolution[2], unsigned
|
||||||
rr = RE_AcquireResultRead(re);
|
rr = RE_AcquireResultRead(re);
|
||||||
|
|
||||||
if (rr) {
|
if (rr) {
|
||||||
SceneRenderLayer *srl = (SceneRenderLayer *)BLI_findlink(&sce->r.layers, getLayerId());
|
SceneLayer *scene_layer = (SceneLayer *)BLI_findlink(&sce->render_layers, getLayerId());
|
||||||
if (srl) {
|
if (scene_layer) {
|
||||||
RenderLayer *rl = RE_GetRenderLayer(rr, srl->name);
|
RenderLayer *rl = RE_GetRenderLayer(rr, scene_layer->name);
|
||||||
if (rl) {
|
if (rl) {
|
||||||
resolution[0] = rl->rectx;
|
resolution[0] = rl->rectx;
|
||||||
resolution[1] = rl->recty;
|
resolution[1] = rl->recty;
|
||||||
|
|
|
@ -1958,25 +1958,26 @@ static size_t animdata_filter_ds_nodetree(bAnimContext *ac, ListBase *anim_data,
|
||||||
|
|
||||||
static size_t animdata_filter_ds_linestyle(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode)
|
static size_t animdata_filter_ds_linestyle(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode)
|
||||||
{
|
{
|
||||||
SceneRenderLayer *srl;
|
SceneLayer *scene_layer;
|
||||||
FreestyleLineSet *lineset;
|
FreestyleLineSet *lineset;
|
||||||
size_t items = 0;
|
size_t items = 0;
|
||||||
|
|
||||||
for (srl = sce->r.layers.first; srl; srl = srl->next) {
|
for (scene_layer = sce->render_layers.first; scene_layer; scene_layer = scene_layer->next) {
|
||||||
for (lineset = srl->freestyleConfig.linesets.first; lineset; lineset = lineset->next) {
|
for (lineset = scene_layer->freestyle_config.linesets.first; lineset; lineset = lineset->next) {
|
||||||
if (lineset->linestyle) {
|
if (lineset->linestyle) {
|
||||||
lineset->linestyle->id.tag |= LIB_TAG_DOIT;
|
lineset->linestyle->id.tag |= LIB_TAG_DOIT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (srl = sce->r.layers.first; srl; srl = srl->next) {
|
for (scene_layer = sce->render_layers.first; scene_layer; scene_layer = scene_layer->next) {
|
||||||
/* skip render layers without Freestyle enabled */
|
/* skip render layers without Freestyle enabled */
|
||||||
if (!(srl->layflag & SCE_LAY_FRS))
|
if ((scene_layer->flag & SCENE_LAYER_FREESTYLE) == 0) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* loop over linesets defined in the render layer */
|
/* loop over linesets defined in the render layer */
|
||||||
for (lineset = srl->freestyleConfig.linesets.first; lineset; lineset = lineset->next) {
|
for (lineset = scene_layer->freestyle_config.linesets.first; lineset; lineset = lineset->next) {
|
||||||
FreestyleLineStyle *linestyle = lineset->linestyle;
|
FreestyleLineStyle *linestyle = lineset->linestyle;
|
||||||
ListBase tmp_data = {NULL, NULL};
|
ListBase tmp_data = {NULL, NULL};
|
||||||
size_t tmp_items = 0;
|
size_t tmp_items = 0;
|
||||||
|
|
|
@ -108,7 +108,6 @@ typedef struct RenderJob {
|
||||||
*/
|
*/
|
||||||
Depsgraph *depsgraph;
|
Depsgraph *depsgraph;
|
||||||
Render *re;
|
Render *re;
|
||||||
SceneRenderLayer *srl;
|
|
||||||
struct Object *camera_override;
|
struct Object *camera_override;
|
||||||
int lay_override;
|
int lay_override;
|
||||||
bool v3d_override;
|
bool v3d_override;
|
||||||
|
@ -261,7 +260,7 @@ static void image_buffer_rect_update(RenderJob *rj, RenderResult *rr, ImBuf *ibu
|
||||||
/* set callbacks, exported to sequence render too.
|
/* set callbacks, exported to sequence render too.
|
||||||
* Only call in foreground (UI) renders. */
|
* Only call in foreground (UI) renders. */
|
||||||
|
|
||||||
static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **scene, SceneRenderLayer **srl)
|
static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **scene, SceneLayer **scene_layer)
|
||||||
{
|
{
|
||||||
/* single layer re-render */
|
/* single layer re-render */
|
||||||
if (RNA_struct_property_is_set(op->ptr, "scene")) {
|
if (RNA_struct_property_is_set(op->ptr, "scene")) {
|
||||||
|
@ -281,14 +280,14 @@ static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **s
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RNA_struct_property_is_set(op->ptr, "layer")) {
|
if (RNA_struct_property_is_set(op->ptr, "layer")) {
|
||||||
SceneRenderLayer *rl;
|
SceneLayer *rl;
|
||||||
char rl_name[RE_MAXNAME];
|
char rl_name[RE_MAXNAME];
|
||||||
|
|
||||||
RNA_string_get(op->ptr, "layer", rl_name);
|
RNA_string_get(op->ptr, "layer", rl_name);
|
||||||
rl = (SceneRenderLayer *)BLI_findstring(&(*scene)->r.layers, rl_name, offsetof(SceneRenderLayer, name));
|
rl = (SceneLayer *)BLI_findstring(&(*scene)->render_layers, rl_name, offsetof(SceneLayer, name));
|
||||||
|
|
||||||
if (rl)
|
if (rl)
|
||||||
*srl = rl;
|
*scene_layer = rl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,9 +295,8 @@ static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **s
|
||||||
static int screen_render_exec(bContext *C, wmOperator *op)
|
static int screen_render_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneLayer *scene_layer = CTX_data_scene_layer(C);
|
SceneLayer *scene_layer = NULL;
|
||||||
Depsgraph *depsgraph = CTX_data_depsgraph(C);
|
Depsgraph *depsgraph = CTX_data_depsgraph(C);
|
||||||
SceneRenderLayer *srl = NULL;
|
|
||||||
Render *re;
|
Render *re;
|
||||||
Image *ima;
|
Image *ima;
|
||||||
View3D *v3d = CTX_wm_view3d(C);
|
View3D *v3d = CTX_wm_view3d(C);
|
||||||
|
@ -309,7 +307,10 @@ static int screen_render_exec(bContext *C, wmOperator *op)
|
||||||
struct Object *camera_override = v3d ? V3D_CAMERA_LOCAL(v3d) : NULL;
|
struct Object *camera_override = v3d ? V3D_CAMERA_LOCAL(v3d) : NULL;
|
||||||
|
|
||||||
/* custom scene and single layer re-render */
|
/* custom scene and single layer re-render */
|
||||||
screen_render_scene_layer_set(op, mainp, &scene, &srl);
|
screen_render_scene_layer_set(op, mainp, &scene, &scene_layer);
|
||||||
|
if (scene_layer == NULL) {
|
||||||
|
scene_layer = CTX_data_scene_layer(C);
|
||||||
|
}
|
||||||
|
|
||||||
if (!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.im_format.imtype)) {
|
if (!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.im_format.imtype)) {
|
||||||
BKE_report(op->reports, RPT_ERROR, "Cannot write a single file with an animation format selected");
|
BKE_report(op->reports, RPT_ERROR, "Cannot write a single file with an animation format selected");
|
||||||
|
@ -339,7 +340,7 @@ static int screen_render_exec(bContext *C, wmOperator *op)
|
||||||
if (is_animation)
|
if (is_animation)
|
||||||
RE_BlenderAnim(re, mainp, scene, camera_override, lay_override, scene->r.sfra, scene->r.efra, scene->r.frame_step);
|
RE_BlenderAnim(re, mainp, scene, camera_override, lay_override, scene->r.sfra, scene->r.efra, scene->r.frame_step);
|
||||||
else
|
else
|
||||||
RE_BlenderFrame(re, mainp, scene, srl, camera_override, lay_override, scene->r.cfra, is_write_still);
|
RE_BlenderFrame(re, mainp, scene, scene_layer, camera_override, lay_override, scene->r.cfra, is_write_still);
|
||||||
BLI_end_threaded_malloc();
|
BLI_end_threaded_malloc();
|
||||||
|
|
||||||
RE_SetReports(re, NULL);
|
RE_SetReports(re, NULL);
|
||||||
|
@ -616,7 +617,7 @@ static void render_startjob(void *rjv, short *stop, short *do_update, float *pro
|
||||||
if (rj->anim)
|
if (rj->anim)
|
||||||
RE_BlenderAnim(rj->re, rj->main, rj->scene, rj->camera_override, rj->lay_override, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->r.frame_step);
|
RE_BlenderAnim(rj->re, rj->main, rj->scene, rj->camera_override, rj->lay_override, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->r.frame_step);
|
||||||
else
|
else
|
||||||
RE_BlenderFrame(rj->re, rj->main, rj->scene, rj->srl, rj->camera_override, rj->lay_override, rj->scene->r.cfra, rj->write_still);
|
RE_BlenderFrame(rj->re, rj->main, rj->scene, rj->scene_layer, rj->camera_override, rj->lay_override, rj->scene->r.cfra, rj->write_still);
|
||||||
|
|
||||||
RE_SetReports(rj->re, NULL);
|
RE_SetReports(rj->re, NULL);
|
||||||
}
|
}
|
||||||
|
@ -669,7 +670,7 @@ static void render_endjob(void *rjv)
|
||||||
/* potentially set by caller */
|
/* potentially set by caller */
|
||||||
rj->scene->r.scemode &= ~R_NO_FRAME_UPDATE;
|
rj->scene->r.scemode &= ~R_NO_FRAME_UPDATE;
|
||||||
|
|
||||||
if (rj->srl) {
|
if (rj->scene_layer) {
|
||||||
nodeUpdateID(rj->scene->nodetree, &rj->scene->id);
|
nodeUpdateID(rj->scene->nodetree, &rj->scene->id);
|
||||||
WM_main_add_notifier(NC_NODE | NA_EDITED, rj->scene);
|
WM_main_add_notifier(NC_NODE | NA_EDITED, rj->scene);
|
||||||
}
|
}
|
||||||
|
@ -699,7 +700,7 @@ static void render_endjob(void *rjv)
|
||||||
* engine API, so lets use simple and robust way for now
|
* engine API, so lets use simple and robust way for now
|
||||||
* - sergey -
|
* - sergey -
|
||||||
*/
|
*/
|
||||||
if (rj->scene->r.layers.first != rj->scene->r.layers.last ||
|
if (rj->scene->render_layers.first != rj->scene->render_layers.last ||
|
||||||
rj->image_outdated)
|
rj->image_outdated)
|
||||||
{
|
{
|
||||||
void *lock;
|
void *lock;
|
||||||
|
@ -844,8 +845,8 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even
|
||||||
{
|
{
|
||||||
/* new render clears all callbacks */
|
/* new render clears all callbacks */
|
||||||
Main *mainp;
|
Main *mainp;
|
||||||
|
SceneLayer *scene_layer = NULL;
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = NULL;
|
|
||||||
Render *re;
|
Render *re;
|
||||||
wmJob *wm_job;
|
wmJob *wm_job;
|
||||||
RenderJob *rj;
|
RenderJob *rj;
|
||||||
|
@ -912,7 +913,10 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even
|
||||||
jobflag = WM_JOB_EXCL_RENDER | WM_JOB_PRIORITY | WM_JOB_PROGRESS;
|
jobflag = WM_JOB_EXCL_RENDER | WM_JOB_PRIORITY | WM_JOB_PROGRESS;
|
||||||
|
|
||||||
/* custom scene and single layer re-render */
|
/* custom scene and single layer re-render */
|
||||||
screen_render_scene_layer_set(op, mainp, &scene, &srl);
|
screen_render_scene_layer_set(op, mainp, &scene, &scene_layer);
|
||||||
|
if (scene_layer == NULL) {
|
||||||
|
scene_layer = CTX_data_scene_layer(C);
|
||||||
|
}
|
||||||
|
|
||||||
if (RNA_struct_property_is_set(op->ptr, "layer"))
|
if (RNA_struct_property_is_set(op->ptr, "layer"))
|
||||||
jobflag |= WM_JOB_SUSPEND;
|
jobflag |= WM_JOB_SUSPEND;
|
||||||
|
@ -922,10 +926,9 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even
|
||||||
rj->main = mainp;
|
rj->main = mainp;
|
||||||
rj->scene = scene;
|
rj->scene = scene;
|
||||||
rj->current_scene = rj->scene;
|
rj->current_scene = rj->scene;
|
||||||
rj->scene_layer = CTX_data_scene_layer(C);
|
rj->scene_layer = scene_layer;
|
||||||
/* TODO(sergey): Render engine should be using own depsgraph. */
|
/* TODO(sergey): Render engine should be using own depsgraph. */
|
||||||
rj->depsgraph = CTX_data_depsgraph(C);
|
rj->depsgraph = CTX_data_depsgraph(C);
|
||||||
rj->srl = srl;
|
|
||||||
rj->camera_override = camera_override;
|
rj->camera_override = camera_override;
|
||||||
rj->lay_override = 0;
|
rj->lay_override = 0;
|
||||||
rj->anim = is_animation;
|
rj->anim = is_animation;
|
||||||
|
@ -1283,10 +1286,10 @@ static void render_view3d_startjob(void *customdata, short *stop, short *do_upda
|
||||||
/* initalize always */
|
/* initalize always */
|
||||||
if (use_border) {
|
if (use_border) {
|
||||||
rdata.mode |= R_BORDER;
|
rdata.mode |= R_BORDER;
|
||||||
RE_InitState(re, NULL, &rdata, &rp->scene->view_render, NULL, rp->ar->winx, rp->ar->winy, &cliprct);
|
RE_InitState(re, NULL, &rdata, &rp->scene->render_layers, rp->scene->active_layer, &rp->scene->view_render, NULL, rp->ar->winx, rp->ar->winy, &cliprct);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
RE_InitState(re, NULL, &rdata, &rp->scene->view_render, NULL, rp->ar->winx, rp->ar->winy, NULL);
|
RE_InitState(re, NULL, &rdata, &rp->scene->render_layers, rp->scene->active_layer, &rp->scene->view_render, NULL, rp->ar->winx, rp->ar->winy, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (orth)
|
if (orth)
|
||||||
|
|
|
@ -715,7 +715,7 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op)
|
||||||
oglrender->iuser.ok = 1;
|
oglrender->iuser.ok = 1;
|
||||||
|
|
||||||
/* create render result */
|
/* create render result */
|
||||||
RE_InitState(oglrender->re, NULL, &scene->r, view_render, NULL, sizex, sizey, NULL);
|
RE_InitState(oglrender->re, NULL, &scene->r, &scene->render_layers, scene->active_layer, view_render, NULL, sizex, sizey, NULL);
|
||||||
|
|
||||||
/* create render views */
|
/* create render views */
|
||||||
screen_opengl_views_setup(oglrender);
|
screen_opengl_views_setup(oglrender);
|
||||||
|
|
|
@ -772,9 +772,9 @@ static int freestyle_active_module_poll(bContext *C)
|
||||||
static int freestyle_module_add_exec(bContext *C, wmOperator *UNUSED(op))
|
static int freestyle_module_add_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
|
|
||||||
BKE_freestyle_module_add(&srl->freestyleConfig);
|
BKE_freestyle_module_add(&scene_layer->freestyle_config);
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
|
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
|
||||||
|
|
||||||
|
@ -798,11 +798,11 @@ void SCENE_OT_freestyle_module_add(wmOperatorType *ot)
|
||||||
static int freestyle_module_remove_exec(bContext *C, wmOperator *UNUSED(op))
|
static int freestyle_module_remove_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
PointerRNA ptr = CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings);
|
PointerRNA ptr = CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings);
|
||||||
FreestyleModuleConfig *module = ptr.data;
|
FreestyleModuleConfig *module = ptr.data;
|
||||||
|
|
||||||
BKE_freestyle_module_delete(&srl->freestyleConfig, module);
|
BKE_freestyle_module_delete(&scene_layer->freestyle_config, module);
|
||||||
|
|
||||||
DEG_id_tag_update(&scene->id, 0);
|
DEG_id_tag_update(&scene->id, 0);
|
||||||
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
|
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
|
||||||
|
@ -828,12 +828,12 @@ void SCENE_OT_freestyle_module_remove(wmOperatorType *ot)
|
||||||
static int freestyle_module_move_exec(bContext *C, wmOperator *op)
|
static int freestyle_module_move_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
PointerRNA ptr = CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings);
|
PointerRNA ptr = CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings);
|
||||||
FreestyleModuleConfig *module = ptr.data;
|
FreestyleModuleConfig *module = ptr.data;
|
||||||
int dir = RNA_enum_get(op->ptr, "direction");
|
int dir = RNA_enum_get(op->ptr, "direction");
|
||||||
|
|
||||||
if (BKE_freestyle_module_move(&srl->freestyleConfig, module, dir)) {
|
if (BKE_freestyle_module_move(&scene_layer->freestyle_config, module, dir)) {
|
||||||
DEG_id_tag_update(&scene->id, 0);
|
DEG_id_tag_update(&scene->id, 0);
|
||||||
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
|
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
|
||||||
}
|
}
|
||||||
|
@ -870,9 +870,9 @@ static int freestyle_lineset_add_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
Main *bmain = CTX_data_main(C);
|
Main *bmain = CTX_data_main(C);
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
|
|
||||||
BKE_freestyle_lineset_add(bmain, &srl->freestyleConfig, NULL);
|
BKE_freestyle_lineset_add(bmain, &scene_layer->freestyle_config, NULL);
|
||||||
|
|
||||||
DEG_id_tag_update(&scene->id, 0);
|
DEG_id_tag_update(&scene->id, 0);
|
||||||
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
|
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
|
||||||
|
@ -897,21 +897,21 @@ void SCENE_OT_freestyle_lineset_add(wmOperatorType *ot)
|
||||||
static int freestyle_active_lineset_poll(bContext *C)
|
static int freestyle_active_lineset_poll(bContext *C)
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
|
|
||||||
if (!srl) {
|
if (!scene_layer) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return BKE_freestyle_lineset_get_active(&srl->freestyleConfig) != NULL;
|
return BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config) != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int freestyle_lineset_copy_exec(bContext *C, wmOperator *UNUSED(op))
|
static int freestyle_lineset_copy_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
|
|
||||||
FRS_copy_active_lineset(&srl->freestyleConfig);
|
FRS_copy_active_lineset(&scene_layer->freestyle_config);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
|
@ -934,9 +934,9 @@ void SCENE_OT_freestyle_lineset_copy(wmOperatorType *ot)
|
||||||
static int freestyle_lineset_paste_exec(bContext *C, wmOperator *UNUSED(op))
|
static int freestyle_lineset_paste_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
|
|
||||||
FRS_paste_active_lineset(&srl->freestyleConfig);
|
FRS_paste_active_lineset(&scene_layer->freestyle_config);
|
||||||
|
|
||||||
DEG_id_tag_update(&scene->id, 0);
|
DEG_id_tag_update(&scene->id, 0);
|
||||||
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
|
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
|
||||||
|
@ -962,9 +962,9 @@ void SCENE_OT_freestyle_lineset_paste(wmOperatorType *ot)
|
||||||
static int freestyle_lineset_remove_exec(bContext *C, wmOperator *UNUSED(op))
|
static int freestyle_lineset_remove_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
|
|
||||||
FRS_delete_active_lineset(&srl->freestyleConfig);
|
FRS_delete_active_lineset(&scene_layer->freestyle_config);
|
||||||
|
|
||||||
DEG_id_tag_update(&scene->id, 0);
|
DEG_id_tag_update(&scene->id, 0);
|
||||||
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
|
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
|
||||||
|
@ -990,10 +990,10 @@ void SCENE_OT_freestyle_lineset_remove(wmOperatorType *ot)
|
||||||
static int freestyle_lineset_move_exec(bContext *C, wmOperator *op)
|
static int freestyle_lineset_move_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
int dir = RNA_enum_get(op->ptr, "direction");
|
int dir = RNA_enum_get(op->ptr, "direction");
|
||||||
|
|
||||||
if (FRS_move_active_lineset(&srl->freestyleConfig, dir)) {
|
if (FRS_move_active_lineset(&scene_layer->freestyle_config, dir)) {
|
||||||
DEG_id_tag_update(&scene->id, 0);
|
DEG_id_tag_update(&scene->id, 0);
|
||||||
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
|
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
|
||||||
}
|
}
|
||||||
|
@ -1030,8 +1030,8 @@ static int freestyle_linestyle_new_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Main *bmain = CTX_data_main(C);
|
Main *bmain = CTX_data_main(C);
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig);
|
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config);
|
||||||
|
|
||||||
if (!lineset) {
|
if (!lineset) {
|
||||||
BKE_report(op->reports, RPT_ERROR, "No active lineset to add a new line style to");
|
BKE_report(op->reports, RPT_ERROR, "No active lineset to add a new line style to");
|
||||||
|
@ -1068,8 +1068,8 @@ void SCENE_OT_freestyle_linestyle_new(wmOperatorType *ot)
|
||||||
static int freestyle_color_modifier_add_exec(bContext *C, wmOperator *op)
|
static int freestyle_color_modifier_add_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig);
|
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config);
|
||||||
int type = RNA_enum_get(op->ptr, "type");
|
int type = RNA_enum_get(op->ptr, "type");
|
||||||
|
|
||||||
if (!freestyle_linestyle_check_report(lineset, op->reports)) {
|
if (!freestyle_linestyle_check_report(lineset, op->reports)) {
|
||||||
|
@ -1108,8 +1108,8 @@ void SCENE_OT_freestyle_color_modifier_add(wmOperatorType *ot)
|
||||||
static int freestyle_alpha_modifier_add_exec(bContext *C, wmOperator *op)
|
static int freestyle_alpha_modifier_add_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig);
|
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config);
|
||||||
int type = RNA_enum_get(op->ptr, "type");
|
int type = RNA_enum_get(op->ptr, "type");
|
||||||
|
|
||||||
if (!freestyle_linestyle_check_report(lineset, op->reports)) {
|
if (!freestyle_linestyle_check_report(lineset, op->reports)) {
|
||||||
|
@ -1148,8 +1148,8 @@ void SCENE_OT_freestyle_alpha_modifier_add(wmOperatorType *ot)
|
||||||
static int freestyle_thickness_modifier_add_exec(bContext *C, wmOperator *op)
|
static int freestyle_thickness_modifier_add_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig);
|
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config);
|
||||||
int type = RNA_enum_get(op->ptr, "type");
|
int type = RNA_enum_get(op->ptr, "type");
|
||||||
|
|
||||||
if (!freestyle_linestyle_check_report(lineset, op->reports)) {
|
if (!freestyle_linestyle_check_report(lineset, op->reports)) {
|
||||||
|
@ -1188,8 +1188,8 @@ void SCENE_OT_freestyle_thickness_modifier_add(wmOperatorType *ot)
|
||||||
static int freestyle_geometry_modifier_add_exec(bContext *C, wmOperator *op)
|
static int freestyle_geometry_modifier_add_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig);
|
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config);
|
||||||
int type = RNA_enum_get(op->ptr, "type");
|
int type = RNA_enum_get(op->ptr, "type");
|
||||||
|
|
||||||
if (!freestyle_linestyle_check_report(lineset, op->reports)) {
|
if (!freestyle_linestyle_check_report(lineset, op->reports)) {
|
||||||
|
@ -1241,8 +1241,8 @@ static int freestyle_get_modifier_type(PointerRNA *ptr)
|
||||||
static int freestyle_modifier_remove_exec(bContext *C, wmOperator *op)
|
static int freestyle_modifier_remove_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig);
|
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config);
|
||||||
PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_LineStyleModifier);
|
PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_LineStyleModifier);
|
||||||
LineStyleModifier *modifier = ptr.data;
|
LineStyleModifier *modifier = ptr.data;
|
||||||
|
|
||||||
|
@ -1291,8 +1291,8 @@ void SCENE_OT_freestyle_modifier_remove(wmOperatorType *ot)
|
||||||
static int freestyle_modifier_copy_exec(bContext *C, wmOperator *op)
|
static int freestyle_modifier_copy_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig);
|
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config);
|
||||||
PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_LineStyleModifier);
|
PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_LineStyleModifier);
|
||||||
LineStyleModifier *modifier = ptr.data;
|
LineStyleModifier *modifier = ptr.data;
|
||||||
|
|
||||||
|
@ -1341,8 +1341,8 @@ void SCENE_OT_freestyle_modifier_copy(wmOperatorType *ot)
|
||||||
static int freestyle_modifier_move_exec(bContext *C, wmOperator *op)
|
static int freestyle_modifier_move_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&srl->freestyleConfig);
|
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&scene_layer->freestyle_config);
|
||||||
PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_LineStyleModifier);
|
PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_LineStyleModifier);
|
||||||
LineStyleModifier *modifier = ptr.data;
|
LineStyleModifier *modifier = ptr.data;
|
||||||
int dir = RNA_enum_get(op->ptr, "direction");
|
int dir = RNA_enum_get(op->ptr, "direction");
|
||||||
|
|
|
@ -561,7 +561,7 @@ static int buttons_context_path_texture(const bContext *C, ButsContextPath *path
|
||||||
static bool buttons_context_linestyle_pinnable(const bContext *C)
|
static bool buttons_context_linestyle_pinnable(const bContext *C)
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *actsrl;
|
SceneLayer *active_scene_layer;
|
||||||
FreestyleConfig *config;
|
FreestyleConfig *config;
|
||||||
SpaceButs *sbuts;
|
SpaceButs *sbuts;
|
||||||
|
|
||||||
|
@ -570,8 +570,8 @@ static bool buttons_context_linestyle_pinnable(const bContext *C)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
/* if Freestyle is not in the Parameter Editor mode */
|
/* if Freestyle is not in the Parameter Editor mode */
|
||||||
actsrl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
active_scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
config = &actsrl->freestyleConfig;
|
config = &active_scene_layer->freestyle_config;
|
||||||
if (config->mode != FREESTYLE_CONTROL_EDITOR_MODE) {
|
if (config->mode != FREESTYLE_CONTROL_EDITOR_MODE) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,14 +109,14 @@ bool ED_texture_context_check_linestyle(const bContext *C)
|
||||||
{
|
{
|
||||||
#ifdef WITH_FREESTYLE
|
#ifdef WITH_FREESTYLE
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
SceneRenderLayer *actsrl;
|
SceneLayer *active_render_layer;
|
||||||
FreestyleConfig *config;
|
FreestyleConfig *config;
|
||||||
FreestyleLineSet *lineset;
|
FreestyleLineSet *lineset;
|
||||||
FreestyleLineStyle *linestyle;
|
FreestyleLineStyle *linestyle;
|
||||||
|
|
||||||
if (scene && (scene->r.mode & R_EDGE_FRS)) {
|
if (scene && (scene->r.mode & R_EDGE_FRS)) {
|
||||||
actsrl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
active_render_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
config = &actsrl->freestyleConfig;
|
config = &active_render_layer->freestyle_config;
|
||||||
if (config->mode == FREESTYLE_CONTROL_EDITOR_MODE) {
|
if (config->mode == FREESTYLE_CONTROL_EDITOR_MODE) {
|
||||||
lineset = BKE_freestyle_lineset_get_active(config);
|
lineset = BKE_freestyle_lineset_get_active(config);
|
||||||
if (lineset) {
|
if (lineset) {
|
||||||
|
|
|
@ -700,12 +700,12 @@ void ED_node_set_active(Main *bmain, bNodeTree *ntree, bNode *node)
|
||||||
for (scene = bmain->scene.first; scene; scene = scene->id.next) {
|
for (scene = bmain->scene.first; scene; scene = scene->id.next) {
|
||||||
if (scene->nodetree && scene->use_nodes && ntreeHasTree(scene->nodetree, ntree)) {
|
if (scene->nodetree && scene->use_nodes && ntreeHasTree(scene->nodetree, ntree)) {
|
||||||
if (node->id == NULL || node->id == (ID *)scene) {
|
if (node->id == NULL || node->id == (ID *)scene) {
|
||||||
int num_layers = BLI_listbase_count(&scene->r.layers);
|
int num_layers = BLI_listbase_count(&scene->render_layers);
|
||||||
scene->r.actlay = node->custom1;
|
scene->active_layer = node->custom1;
|
||||||
/* Clamp the value, because it might have come from a different
|
/* Clamp the value, because it might have come from a different
|
||||||
* scene which could have more render layers than new one.
|
* scene which could have more render layers than new one.
|
||||||
*/
|
*/
|
||||||
scene->r.actlay = min_ff(scene->r.actlay, num_layers - 1);
|
scene->active_layer = min_ff(scene->active_layer, num_layers - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1366,13 +1366,13 @@ int node_render_changed_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (node) {
|
if (node) {
|
||||||
SceneRenderLayer *srl = BLI_findlink(&sce->r.layers, node->custom1);
|
SceneLayer *scene_layer = BLI_findlink(&sce->render_layers, node->custom1);
|
||||||
|
|
||||||
if (srl) {
|
if (scene_layer) {
|
||||||
PointerRNA op_ptr;
|
PointerRNA op_ptr;
|
||||||
|
|
||||||
WM_operator_properties_create(&op_ptr, "RENDER_OT_render");
|
WM_operator_properties_create(&op_ptr, "RENDER_OT_render");
|
||||||
RNA_string_set(&op_ptr, "layer", srl->name);
|
RNA_string_set(&op_ptr, "layer", scene_layer->name);
|
||||||
RNA_string_set(&op_ptr, "scene", sce->id.name + 2);
|
RNA_string_set(&op_ptr, "scene", sce->id.name + 2);
|
||||||
|
|
||||||
/* to keep keypositions */
|
/* to keep keypositions */
|
||||||
|
|
|
@ -464,7 +464,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
|
||||||
if (tselem->type == TSE_R_LAYER) {
|
if (tselem->type == TSE_R_LAYER) {
|
||||||
UI_block_emboss_set(block, UI_EMBOSS_NONE);
|
UI_block_emboss_set(block, UI_EMBOSS_NONE);
|
||||||
|
|
||||||
bt = uiDefIconButBitI(block, UI_BTYPE_ICON_TOGGLE_N, SCE_LAY_DISABLE, 0, ICON_CHECKBOX_HLT - 1,
|
bt = uiDefIconButBitI(block, UI_BTYPE_ICON_TOGGLE, SCENE_LAYER_RENDER, 0, ICON_CHECKBOX_HLT - 1,
|
||||||
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX), te->ys, UI_UNIT_X,
|
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX), te->ys, UI_UNIT_X,
|
||||||
UI_UNIT_Y, te->directdata, 0, 0, 0, 0, TIP_("Render this RenderLayer"));
|
UI_UNIT_Y, te->directdata, 0, 0, 0, 0, TIP_("Render this RenderLayer"));
|
||||||
UI_but_func_set(bt, restrictbutton_r_lay_cb, tselem->id, NULL);
|
UI_but_func_set(bt, restrictbutton_r_lay_cb, tselem->id, NULL);
|
||||||
|
|
|
@ -85,11 +85,11 @@ static eOLDrawState tree_element_active_renderlayer(
|
||||||
sce = (Scene *)tselem->id;
|
sce = (Scene *)tselem->id;
|
||||||
|
|
||||||
if (set != OL_SETSEL_NONE) {
|
if (set != OL_SETSEL_NONE) {
|
||||||
sce->r.actlay = tselem->nr;
|
sce->active_layer = tselem->nr;
|
||||||
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, sce);
|
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, sce);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return sce->r.actlay == tselem->nr;
|
return sce->active_layer == tselem->nr;
|
||||||
}
|
}
|
||||||
return OL_DRAWSEL_NONE;
|
return OL_DRAWSEL_NONE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,7 +234,7 @@ static void outliner_add_bone(SpaceOops *soops, ListBase *lb, ID *id, Bone *curB
|
||||||
|
|
||||||
#define LOG2I(x) (int)(log(x) / M_LN2)
|
#define LOG2I(x) (int)(log(x) / M_LN2)
|
||||||
|
|
||||||
static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, SceneRenderLayer *srl)
|
static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, SceneLayer *scene_layer)
|
||||||
{
|
{
|
||||||
TreeStoreElem *tselem = NULL;
|
TreeStoreElem *tselem = NULL;
|
||||||
TreeElement *te = NULL;
|
TreeElement *te = NULL;
|
||||||
|
@ -244,7 +244,7 @@ static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, Sc
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_COMBINED));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_COMBINED));
|
||||||
te->name = IFACE_("Combined");
|
te->name = IFACE_("Combined");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
/* save cpu cycles, but we add the first to invoke an open/close triangle */
|
/* save cpu cycles, but we add the first to invoke an open/close triangle */
|
||||||
tselem = TREESTORE(tenla);
|
tselem = TREESTORE(tenla);
|
||||||
|
@ -253,71 +253,71 @@ static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, Sc
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_Z));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_Z));
|
||||||
te->name = IFACE_("Z");
|
te->name = IFACE_("Z");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_VECTOR));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_VECTOR));
|
||||||
te->name = IFACE_("Vector");
|
te->name = IFACE_("Vector");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_NORMAL));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_NORMAL));
|
||||||
te->name = IFACE_("Normal");
|
te->name = IFACE_("Normal");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_UV));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_UV));
|
||||||
te->name = IFACE_("UV");
|
te->name = IFACE_("UV");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_MIST));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_MIST));
|
||||||
te->name = IFACE_("Mist");
|
te->name = IFACE_("Mist");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_INDEXOB));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_INDEXOB));
|
||||||
te->name = IFACE_("Index Object");
|
te->name = IFACE_("Index Object");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_INDEXMA));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_INDEXMA));
|
||||||
te->name = IFACE_("Index Material");
|
te->name = IFACE_("Index Material");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_RGBA));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_RGBA));
|
||||||
te->name = IFACE_("Color");
|
te->name = IFACE_("Color");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_DIFFUSE));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_DIFFUSE));
|
||||||
te->name = IFACE_("Diffuse");
|
te->name = IFACE_("Diffuse");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_SPEC));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_SPEC));
|
||||||
te->name = IFACE_("Specular");
|
te->name = IFACE_("Specular");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_SHADOW));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_SHADOW));
|
||||||
te->name = IFACE_("Shadow");
|
te->name = IFACE_("Shadow");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_AO));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_AO));
|
||||||
te->name = IFACE_("AO");
|
te->name = IFACE_("AO");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_REFLECT));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_REFLECT));
|
||||||
te->name = IFACE_("Reflection");
|
te->name = IFACE_("Reflection");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_REFRACT));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_REFRACT));
|
||||||
te->name = IFACE_("Refraction");
|
te->name = IFACE_("Refraction");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_INDIRECT));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_INDIRECT));
|
||||||
te->name = IFACE_("Indirect");
|
te->name = IFACE_("Indirect");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_ENVIRONMENT));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_ENVIRONMENT));
|
||||||
te->name = IFACE_("Environment");
|
te->name = IFACE_("Environment");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
|
|
||||||
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_EMIT));
|
te = outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_EMIT));
|
||||||
te->name = IFACE_("Emit");
|
te->name = IFACE_("Emit");
|
||||||
te->directdata = &srl->passflag;
|
te->directdata = &scene_layer->passflag;
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef LOG2I
|
#undef LOG2I
|
||||||
|
@ -332,19 +332,19 @@ static bool outliner_animdata_test(AnimData *adt)
|
||||||
#ifdef WITH_FREESTYLE
|
#ifdef WITH_FREESTYLE
|
||||||
static void outliner_add_line_styles(SpaceOops *soops, ListBase *lb, Scene *sce, TreeElement *te)
|
static void outliner_add_line_styles(SpaceOops *soops, ListBase *lb, Scene *sce, TreeElement *te)
|
||||||
{
|
{
|
||||||
SceneRenderLayer *srl;
|
SceneLayer *scene_layer;
|
||||||
FreestyleLineSet *lineset;
|
FreestyleLineSet *lineset;
|
||||||
|
|
||||||
for (srl = sce->r.layers.first; srl; srl = srl->next) {
|
for (scene_layer = sce->render_layers.first; scene_layer; scene_layer = scene_layer->next) {
|
||||||
for (lineset = srl->freestyleConfig.linesets.first; lineset; lineset = lineset->next) {
|
for (lineset = scene_layer->freestyle_config.linesets.first; lineset; lineset = lineset->next) {
|
||||||
FreestyleLineStyle *linestyle = lineset->linestyle;
|
FreestyleLineStyle *linestyle = lineset->linestyle;
|
||||||
if (linestyle) {
|
if (linestyle) {
|
||||||
linestyle->id.tag |= LIB_TAG_DOIT;
|
linestyle->id.tag |= LIB_TAG_DOIT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (srl = sce->r.layers.first; srl; srl = srl->next) {
|
for (scene_layer = sce->render_layers.first; scene_layer; scene_layer = scene_layer->next) {
|
||||||
for (lineset = srl->freestyleConfig.linesets.first; lineset; lineset = lineset->next) {
|
for (lineset = scene_layer->freestyle_config.linesets.first; lineset; lineset = lineset->next) {
|
||||||
FreestyleLineStyle *linestyle = lineset->linestyle;
|
FreestyleLineStyle *linestyle = lineset->linestyle;
|
||||||
if (linestyle) {
|
if (linestyle) {
|
||||||
if (!(linestyle->id.tag & LIB_TAG_DOIT))
|
if (!(linestyle->id.tag & LIB_TAG_DOIT))
|
||||||
|
@ -359,16 +359,16 @@ static void outliner_add_line_styles(SpaceOops *soops, ListBase *lb, Scene *sce,
|
||||||
|
|
||||||
static void outliner_add_scene_contents(SpaceOops *soops, ListBase *lb, Scene *sce, TreeElement *te)
|
static void outliner_add_scene_contents(SpaceOops *soops, ListBase *lb, Scene *sce, TreeElement *te)
|
||||||
{
|
{
|
||||||
SceneRenderLayer *srl;
|
SceneLayer *scene_layer;
|
||||||
TreeElement *tenla = outliner_add_element(soops, lb, sce, te, TSE_R_LAYER_BASE, 0);
|
TreeElement *tenla = outliner_add_element(soops, lb, sce, te, TSE_R_LAYER_BASE, 0);
|
||||||
int a;
|
int a;
|
||||||
|
|
||||||
tenla->name = IFACE_("RenderLayers");
|
tenla->name = IFACE_("RenderLayers");
|
||||||
for (a = 0, srl = sce->r.layers.first; srl; srl = srl->next, a++) {
|
for (a = 0, scene_layer = sce->render_layers.first; scene_layer; scene_layer = scene_layer->next, a++) {
|
||||||
TreeElement *tenlay = outliner_add_element(soops, &tenla->subtree, sce, te, TSE_R_LAYER, a);
|
TreeElement *tenlay = outliner_add_element(soops, &tenla->subtree, sce, te, TSE_R_LAYER, a);
|
||||||
tenlay->name = srl->name;
|
tenlay->name = scene_layer->name;
|
||||||
tenlay->directdata = &srl->layflag;
|
tenlay->directdata = &scene_layer->flag;
|
||||||
outliner_add_passes(soops, tenlay, &sce->id, srl);
|
outliner_add_passes(soops, tenlay, &sce->id, scene_layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: move this to the front?
|
// TODO: move this to the front?
|
||||||
|
|
|
@ -392,8 +392,8 @@ set(SRC
|
||||||
intern/scene_graph/NodeGroup.h
|
intern/scene_graph/NodeGroup.h
|
||||||
intern/scene_graph/NodeLight.cpp
|
intern/scene_graph/NodeLight.cpp
|
||||||
intern/scene_graph/NodeLight.h
|
intern/scene_graph/NodeLight.h
|
||||||
intern/scene_graph/NodeSceneRenderLayer.cpp
|
intern/scene_graph/NodeSceneLayer.cpp
|
||||||
intern/scene_graph/NodeSceneRenderLayer.h
|
intern/scene_graph/NodeSceneLayer.h
|
||||||
intern/scene_graph/NodeShape.cpp
|
intern/scene_graph/NodeShape.cpp
|
||||||
intern/scene_graph/NodeShape.h
|
intern/scene_graph/NodeShape.h
|
||||||
intern/scene_graph/NodeTransform.cpp
|
intern/scene_graph/NodeTransform.cpp
|
||||||
|
|
|
@ -30,6 +30,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct Render;
|
struct Render;
|
||||||
|
struct RenderLayer;
|
||||||
struct Material;
|
struct Material;
|
||||||
struct FreestyleConfig;
|
struct FreestyleConfig;
|
||||||
struct FreestyleLineStyle;
|
struct FreestyleLineStyle;
|
||||||
|
@ -50,13 +51,13 @@ extern struct FreestyleGlobals g_freestyle;
|
||||||
void FRS_initialize(void);
|
void FRS_initialize(void);
|
||||||
void FRS_set_context(struct bContext *C);
|
void FRS_set_context(struct bContext *C);
|
||||||
void FRS_read_file(struct bContext *C);
|
void FRS_read_file(struct bContext *C);
|
||||||
int FRS_is_freestyle_enabled(struct SceneRenderLayer *srl);
|
int FRS_is_freestyle_enabled(struct SceneLayer *scene_layer);
|
||||||
void FRS_init_stroke_renderer(struct Render *re);
|
void FRS_init_stroke_renderer(struct Render *re);
|
||||||
void FRS_begin_stroke_rendering(struct Render *re);
|
void FRS_begin_stroke_rendering(struct Render *re);
|
||||||
struct Render *FRS_do_stroke_rendering(struct Render *re, struct SceneRenderLayer *srl, int render);
|
struct Render *FRS_do_stroke_rendering(struct Render *re, struct SceneLayer *scene_layer, int render);
|
||||||
void FRS_end_stroke_rendering(struct Render *re);
|
void FRS_end_stroke_rendering(struct Render *re);
|
||||||
void FRS_free_view_map_cache(void);
|
void FRS_free_view_map_cache(void);
|
||||||
void FRS_composite_result(struct Render *re, struct SceneRenderLayer *srl, struct Render *freestyle_render);
|
void FRS_composite_result(struct Render *re, struct SceneLayer *scene_layer, struct Render *freestyle_render);
|
||||||
void FRS_exit(void);
|
void FRS_exit(void);
|
||||||
|
|
||||||
/* FreestyleConfig.linesets */
|
/* FreestyleConfig.linesets */
|
||||||
|
|
|
@ -40,7 +40,7 @@ extern "C" {
|
||||||
#include "../scene_graph/NodeDrawingStyle.h"
|
#include "../scene_graph/NodeDrawingStyle.h"
|
||||||
#include "../scene_graph/NodeShape.h"
|
#include "../scene_graph/NodeShape.h"
|
||||||
#include "../scene_graph/NodeTransform.h"
|
#include "../scene_graph/NodeTransform.h"
|
||||||
#include "../scene_graph/NodeSceneRenderLayer.h"
|
#include "../scene_graph/NodeSceneLayer.h"
|
||||||
#include "../scene_graph/ScenePrettyPrinter.h"
|
#include "../scene_graph/ScenePrettyPrinter.h"
|
||||||
#include "../scene_graph/VertexRep.h"
|
#include "../scene_graph/VertexRep.h"
|
||||||
|
|
||||||
|
@ -232,9 +232,9 @@ bool Controller::hitViewMapCache()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Controller::LoadMesh(Render *re, SceneRenderLayer *srl)
|
int Controller::LoadMesh(Render *re, SceneLayer *scene_layer)
|
||||||
{
|
{
|
||||||
BlenderFileLoader loader(re, srl);
|
BlenderFileLoader loader(re, scene_layer);
|
||||||
|
|
||||||
loader.setRenderMonitor(_pRenderMonitor);
|
loader.setRenderMonitor(_pRenderMonitor);
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@ int Controller::LoadMesh(Render *re, SceneRenderLayer *srl)
|
||||||
}
|
}
|
||||||
cam->setProjectionMatrix(proj);
|
cam->setProjectionMatrix(proj);
|
||||||
_RootNode->AddChild(cam);
|
_RootNode->AddChild(cam);
|
||||||
_RootNode->AddChild(new NodeSceneRenderLayer(*re->scene, *srl));
|
_RootNode->AddChild(new NodeSceneLayer(*re->scene, *scene_layer));
|
||||||
|
|
||||||
sceneHashFunc.reset();
|
sceneHashFunc.reset();
|
||||||
//blenderScene->accept(sceneHashFunc);
|
//blenderScene->accept(sceneHashFunc);
|
||||||
|
|
|
@ -68,7 +68,7 @@ public:
|
||||||
//soc
|
//soc
|
||||||
void init_options();
|
void init_options();
|
||||||
|
|
||||||
int LoadMesh(Render *re, SceneRenderLayer *srl);
|
int LoadMesh(Render *re, SceneLayer *scene_layer);
|
||||||
int Load3DSFile(const char *iFileName);
|
int Load3DSFile(const char *iFileName);
|
||||||
void CloseFile();
|
void CloseFile();
|
||||||
void ComputeViewMap();
|
void ComputeViewMap();
|
||||||
|
|
|
@ -32,16 +32,16 @@
|
||||||
|
|
||||||
namespace Freestyle {
|
namespace Freestyle {
|
||||||
|
|
||||||
BlenderFileLoader::BlenderFileLoader(Render *re, SceneRenderLayer *srl)
|
BlenderFileLoader::BlenderFileLoader(Render *re, SceneLayer *scene_layer)
|
||||||
{
|
{
|
||||||
_re = re;
|
_re = re;
|
||||||
_srl = srl;
|
_scene_layer = scene_layer;
|
||||||
_Scene = NULL;
|
_Scene = NULL;
|
||||||
_numFacesRead = 0;
|
_numFacesRead = 0;
|
||||||
#if 0
|
#if 0
|
||||||
_minEdgeSize = DBL_MAX;
|
_minEdgeSize = DBL_MAX;
|
||||||
#endif
|
#endif
|
||||||
_smooth = (srl->freestyleConfig.flags & FREESTYLE_FACE_SMOOTHNESS_FLAG) != 0;
|
_smooth = (scene_layer->freestyle_config.flags & FREESTYLE_FACE_SMOOTHNESS_FLAG) != 0;
|
||||||
_pRenderMonitor = NULL;
|
_pRenderMonitor = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ class BlenderFileLoader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/*! Builds a MaxFileLoader */
|
/*! Builds a MaxFileLoader */
|
||||||
BlenderFileLoader(Render *re, SceneRenderLayer *srl);
|
BlenderFileLoader(Render *re, SceneLayer *scene_layer);
|
||||||
virtual ~BlenderFileLoader();
|
virtual ~BlenderFileLoader();
|
||||||
|
|
||||||
/*! Loads the 3D scene and returns a pointer to the scene root node */
|
/*! Loads the 3D scene and returns a pointer to the scene root node */
|
||||||
|
@ -114,7 +114,7 @@ protected:
|
||||||
unsigned n;
|
unsigned n;
|
||||||
};
|
};
|
||||||
Render *_re;
|
Render *_re;
|
||||||
SceneRenderLayer *_srl;
|
SceneLayer *_scene_layer;
|
||||||
NodeGroup *_Scene;
|
NodeGroup *_Scene;
|
||||||
unsigned _numFacesRead;
|
unsigned _numFacesRead;
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -127,12 +127,9 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render *re, int render_count) : Str
|
||||||
BKE_scene_set_background(freestyle_bmain, freestyle_scene);
|
BKE_scene_set_background(freestyle_bmain, freestyle_scene);
|
||||||
DEG_graph_id_tag_update(freestyle_bmain, freestyle_depsgraph, &freestyle_scene->id, 0);
|
DEG_graph_id_tag_update(freestyle_bmain, freestyle_depsgraph, &freestyle_scene->id, 0);
|
||||||
|
|
||||||
// Render layer
|
|
||||||
SceneRenderLayer *srl = (SceneRenderLayer *)freestyle_scene->r.layers.first;
|
|
||||||
srl->layflag = SCE_LAY_SOLID | SCE_LAY_ZTRA;
|
|
||||||
|
|
||||||
// Scene layer.
|
// Scene layer.
|
||||||
SceneLayer *scene_layer = (SceneLayer *)freestyle_scene->render_layers.first;
|
SceneLayer *scene_layer = (SceneLayer *)freestyle_scene->render_layers.first;
|
||||||
|
scene_layer->layflag = SCE_LAY_SOLID | SCE_LAY_ZTRA;
|
||||||
|
|
||||||
// Camera
|
// Camera
|
||||||
Object *object_camera = BKE_object_add(freestyle_bmain, freestyle_scene, scene_layer, OB_CAMERA, NULL);
|
Object *object_camera = BKE_object_add(freestyle_bmain, freestyle_scene, scene_layer, OB_CAMERA, NULL);
|
||||||
|
|
|
@ -283,19 +283,19 @@ static bool test_edge_type_conditions(struct edge_type_condition *conditions,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void prepare(Render *re, SceneRenderLayer *srl)
|
static void prepare(Render *re, SceneLayer *scene_layer)
|
||||||
{
|
{
|
||||||
// load mesh
|
// load mesh
|
||||||
re->i.infostr = IFACE_("Freestyle: Mesh loading");
|
re->i.infostr = IFACE_("Freestyle: Mesh loading");
|
||||||
re->stats_draw(re->sdh, &re->i);
|
re->stats_draw(re->sdh, &re->i);
|
||||||
re->i.infostr = NULL;
|
re->i.infostr = NULL;
|
||||||
if (controller->LoadMesh(re, srl)) // returns if scene cannot be loaded or if empty
|
if (controller->LoadMesh(re, scene_layer)) // returns if scene cannot be loaded or if empty
|
||||||
return;
|
return;
|
||||||
if (re->test_break(re->tbh))
|
if (re->test_break(re->tbh))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// add style modules
|
// add style modules
|
||||||
FreestyleConfig *config = &srl->freestyleConfig;
|
FreestyleConfig *config = &scene_layer->freestyle_config;
|
||||||
|
|
||||||
if (G.debug & G_DEBUG_FREESTYLE) {
|
if (G.debug & G_DEBUG_FREESTYLE) {
|
||||||
cout << "\n=== Rendering options ===" << endl;
|
cout << "\n=== Rendering options ===" << endl;
|
||||||
|
@ -359,7 +359,7 @@ static void prepare(Render *re, SceneRenderLayer *srl)
|
||||||
cout << " " << layer_count+1 << ": " << lineset->name << " - " <<
|
cout << " " << layer_count+1 << ": " << lineset->name << " - " <<
|
||||||
(lineset->linestyle ? (lineset->linestyle->id.name + 2) : "<NULL>") << endl;
|
(lineset->linestyle ? (lineset->linestyle->id.name + 2) : "<NULL>") << endl;
|
||||||
}
|
}
|
||||||
char *buffer = create_lineset_handler(srl->name, lineset->name);
|
char *buffer = create_lineset_handler(scene_layer->name, lineset->name);
|
||||||
controller->InsertStyleModule(layer_count, lineset->name, buffer);
|
controller->InsertStyleModule(layer_count, lineset->name, buffer);
|
||||||
controller->toggleLayer(layer_count, true);
|
controller->toggleLayer(layer_count, true);
|
||||||
MEM_freeN(buffer);
|
MEM_freeN(buffer);
|
||||||
|
@ -445,7 +445,7 @@ static void prepare(Render *re, SceneRenderLayer *srl)
|
||||||
}
|
}
|
||||||
|
|
||||||
// set diffuse and z depth passes
|
// set diffuse and z depth passes
|
||||||
RenderLayer *rl = RE_GetRenderLayer(re->result, srl->name);
|
RenderLayer *rl = RE_GetRenderLayer(re->result, scene_layer->name);
|
||||||
bool diffuse = false, z = false;
|
bool diffuse = false, z = false;
|
||||||
for (RenderPass *rpass = (RenderPass *)rl->passes.first; rpass; rpass = rpass->next) {
|
for (RenderPass *rpass = (RenderPass *)rl->passes.first; rpass; rpass = rpass->next) {
|
||||||
if (STREQ(rpass->name, RE_PASSNAME_DIFFUSE)) {
|
if (STREQ(rpass->name, RE_PASSNAME_DIFFUSE)) {
|
||||||
|
@ -473,7 +473,7 @@ static void prepare(Render *re, SceneRenderLayer *srl)
|
||||||
controller->ComputeViewMap();
|
controller->ComputeViewMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FRS_composite_result(Render *re, SceneRenderLayer *srl, Render *freestyle_render)
|
void FRS_composite_result(Render *re, SceneLayer *scene_layer, Render *freestyle_render)
|
||||||
{
|
{
|
||||||
RenderLayer *rl;
|
RenderLayer *rl;
|
||||||
float *src, *dest, *pixSrc, *pixDest;
|
float *src, *dest, *pixSrc, *pixDest;
|
||||||
|
@ -503,7 +503,7 @@ void FRS_composite_result(Render *re, SceneRenderLayer *srl, Render *freestyle_r
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rl = RE_GetRenderLayer(re->result, srl->name);
|
rl = RE_GetRenderLayer(re->result, scene_layer->name);
|
||||||
if (!rl) {
|
if (!rl) {
|
||||||
if (G.debug & G_DEBUG_FREESTYLE) {
|
if (G.debug & G_DEBUG_FREESTYLE) {
|
||||||
cout << "No destination render layer to composite to" << endl;
|
cout << "No destination render layer to composite to" << endl;
|
||||||
|
@ -536,13 +536,13 @@ void FRS_composite_result(Render *re, SceneRenderLayer *srl, Render *freestyle_r
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int displayed_layer_count(SceneRenderLayer *srl)
|
static int displayed_layer_count(SceneLayer *scene_layer)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
switch (srl->freestyleConfig.mode) {
|
switch (scene_layer->freestyle_config.mode) {
|
||||||
case FREESTYLE_CONTROL_SCRIPT_MODE:
|
case FREESTYLE_CONTROL_SCRIPT_MODE:
|
||||||
for (FreestyleModuleConfig *module = (FreestyleModuleConfig *)srl->freestyleConfig.modules.first;
|
for (FreestyleModuleConfig *module = (FreestyleModuleConfig *)scene_layer->freestyle_config.modules.first;
|
||||||
module;
|
module;
|
||||||
module = module->next)
|
module = module->next)
|
||||||
{
|
{
|
||||||
|
@ -551,7 +551,7 @@ static int displayed_layer_count(SceneRenderLayer *srl)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FREESTYLE_CONTROL_EDITOR_MODE:
|
case FREESTYLE_CONTROL_EDITOR_MODE:
|
||||||
for (FreestyleLineSet *lineset = (FreestyleLineSet *)srl->freestyleConfig.linesets.first;
|
for (FreestyleLineSet *lineset = (FreestyleLineSet *)scene_layer->freestyle_config.linesets.first;
|
||||||
lineset;
|
lineset;
|
||||||
lineset = lineset->next)
|
lineset = lineset->next)
|
||||||
{
|
{
|
||||||
|
@ -563,9 +563,11 @@ static int displayed_layer_count(SceneRenderLayer *srl)
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FRS_is_freestyle_enabled(SceneRenderLayer *srl)
|
int FRS_is_freestyle_enabled(SceneLayer *scene_layer)
|
||||||
{
|
{
|
||||||
return (!(srl->layflag & SCE_LAY_DISABLE) && srl->layflag & SCE_LAY_FRS && displayed_layer_count(srl) > 0);
|
return ((scene_layer->flag & SCENE_LAYER_RENDER) &&
|
||||||
|
(scene_layer->flag & SCENE_LAYER_FREESTYLE) &&
|
||||||
|
displayed_layer_count(scene_layer) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FRS_init_stroke_renderer(Render *re)
|
void FRS_init_stroke_renderer(Render *re)
|
||||||
|
@ -587,7 +589,7 @@ void FRS_begin_stroke_rendering(Render *re)
|
||||||
init_camera(re);
|
init_camera(re);
|
||||||
}
|
}
|
||||||
|
|
||||||
Render *FRS_do_stroke_rendering(Render *re, SceneRenderLayer *srl, int render)
|
Render *FRS_do_stroke_rendering(Render *re, SceneLayer *scene_layer, int render)
|
||||||
{
|
{
|
||||||
Render *freestyle_render = NULL;
|
Render *freestyle_render = NULL;
|
||||||
|
|
||||||
|
@ -596,12 +598,12 @@ Render *FRS_do_stroke_rendering(Render *re, SceneRenderLayer *srl, int render)
|
||||||
|
|
||||||
RenderMonitor monitor(re);
|
RenderMonitor monitor(re);
|
||||||
controller->setRenderMonitor(&monitor);
|
controller->setRenderMonitor(&monitor);
|
||||||
controller->setViewMapCache((srl->freestyleConfig.flags & FREESTYLE_VIEW_MAP_CACHE) ? true : false);
|
controller->setViewMapCache((scene_layer->freestyle_config.flags & FREESTYLE_VIEW_MAP_CACHE) ? true : false);
|
||||||
|
|
||||||
if (G.debug & G_DEBUG_FREESTYLE) {
|
if (G.debug & G_DEBUG_FREESTYLE) {
|
||||||
cout << endl;
|
cout << endl;
|
||||||
cout << "----------------------------------------------------------" << endl;
|
cout << "----------------------------------------------------------" << endl;
|
||||||
cout << "| " << (re->scene->id.name + 2) << "|" << srl->name << endl;
|
cout << "| " << (re->scene->id.name + 2) << "|" << scene_layer->name << endl;
|
||||||
cout << "----------------------------------------------------------" << endl;
|
cout << "----------------------------------------------------------" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -610,7 +612,7 @@ Render *FRS_do_stroke_rendering(Render *re, SceneRenderLayer *srl, int render)
|
||||||
// - add style modules
|
// - add style modules
|
||||||
// - set parameters
|
// - set parameters
|
||||||
// - compute view map
|
// - compute view map
|
||||||
prepare(re, srl);
|
prepare(re, scene_layer);
|
||||||
|
|
||||||
if (re->test_break(re->tbh)) {
|
if (re->test_break(re->tbh)) {
|
||||||
controller->CloseFile();
|
controller->CloseFile();
|
||||||
|
@ -635,7 +637,7 @@ Render *FRS_do_stroke_rendering(Render *re, SceneRenderLayer *srl, int render)
|
||||||
|
|
||||||
// composite result
|
// composite result
|
||||||
if (freestyle_render) {
|
if (freestyle_render) {
|
||||||
FRS_composite_result(re, srl, freestyle_render);
|
FRS_composite_result(re, scene_layer, freestyle_render);
|
||||||
RE_FreeRenderResult(freestyle_render->result);
|
RE_FreeRenderResult(freestyle_render->result);
|
||||||
freestyle_render->result = NULL;
|
freestyle_render->result = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,18 +18,18 @@
|
||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \file blender/freestyle/intern/scene_graph/NodeSceneRenderLayer.cpp
|
/** \file blender/freestyle/intern/scene_graph/NodeSceneLayer.cpp
|
||||||
* \ingroup freestyle
|
* \ingroup freestyle
|
||||||
* \brief Class to represent a scene render layer in Blender.
|
* \brief Class to represent a scene render layer in Blender.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "NodeSceneRenderLayer.h"
|
#include "NodeSceneLayer.h"
|
||||||
|
|
||||||
namespace Freestyle {
|
namespace Freestyle {
|
||||||
|
|
||||||
void NodeSceneRenderLayer::accept(SceneVisitor& v)
|
void NodeSceneLayer::accept(SceneVisitor& v)
|
||||||
{
|
{
|
||||||
v.visitNodeSceneRenderLayer(*this);
|
v.visitNodeSceneLayer(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* namespace Freestyle */
|
} /* namespace Freestyle */
|
|
@ -18,10 +18,10 @@
|
||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __FREESTYLE_NODE_SCENE_RENDER_LAYER_H__
|
#ifndef __FREESTYLE_NODE_SCENE_LAYER_H__
|
||||||
#define __FREESTYLE_NODE_SCENE_RENDER_LAYER_H__
|
#define __FREESTYLE_NODE_SCENE_LAYER_H__
|
||||||
|
|
||||||
/** \file blender/freestyle/intern/scene_graph/NodeSceneRenderLayer.h
|
/** \file blender/freestyle/intern/scene_graph/NodeSceneLayer.h
|
||||||
* \ingroup freestyle
|
* \ingroup freestyle
|
||||||
* \brief Class to represent a scene render layer in Blender.
|
* \brief Class to represent a scene render layer in Blender.
|
||||||
*/
|
*/
|
||||||
|
@ -36,20 +36,20 @@ using namespace std;
|
||||||
|
|
||||||
namespace Freestyle {
|
namespace Freestyle {
|
||||||
|
|
||||||
class NodeSceneRenderLayer : public Node
|
class NodeSceneLayer : public Node
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline NodeSceneRenderLayer(Scene& scene, SceneRenderLayer& srl) : Node(), _Scene(scene), _SceneRenderLayer(srl) {}
|
inline NodeSceneLayer(Scene& scene, SceneLayer& scene_layer) : Node(), _Scene(scene), _SceneLayer(scene_layer) {}
|
||||||
virtual ~NodeSceneRenderLayer() {}
|
virtual ~NodeSceneLayer() {}
|
||||||
|
|
||||||
inline struct Scene& scene() const
|
inline struct Scene& scene() const
|
||||||
{
|
{
|
||||||
return _Scene;
|
return _Scene;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline struct SceneRenderLayer& sceneRenderLayer() const
|
inline struct SceneLayer& sceneLayer() const
|
||||||
{
|
{
|
||||||
return _SceneRenderLayer;
|
return _SceneLayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Accept the corresponding visitor */
|
/*! Accept the corresponding visitor */
|
||||||
|
@ -58,9 +58,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Scene& _Scene;
|
Scene& _Scene;
|
||||||
SceneRenderLayer& _SceneRenderLayer;
|
SceneLayer& _SceneLayer;
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace Freestyle */
|
} /* namespace Freestyle */
|
||||||
|
|
||||||
#endif // __FREESTYLE_NODE_SCENE_RENDER_LAYER_H__
|
#endif // __FREESTYLE_NODE_SCENE_LAYER_H__
|
|
@ -35,14 +35,14 @@ string SceneHash::toString()
|
||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneHash::visitNodeSceneRenderLayer(NodeSceneRenderLayer& node)
|
void SceneHash::visitNodeSceneLayer(NodeSceneLayer& node)
|
||||||
{
|
{
|
||||||
struct RenderData *r = &node.scene().r;
|
struct RenderData *r = &node.scene().r;
|
||||||
adler32((unsigned char *)&r->xsch, sizeof(r->xsch)); // resolution_x
|
adler32((unsigned char *)&r->xsch, sizeof(r->xsch)); // resolution_x
|
||||||
adler32((unsigned char *)&r->ysch, sizeof(r->ysch)); // resolution_y
|
adler32((unsigned char *)&r->ysch, sizeof(r->ysch)); // resolution_y
|
||||||
adler32((unsigned char *)&r->size, sizeof(r->size)); // resolution_percentage
|
adler32((unsigned char *)&r->size, sizeof(r->size)); // resolution_percentage
|
||||||
|
|
||||||
struct FreestyleConfig *config = &node.sceneRenderLayer().freestyleConfig;
|
struct FreestyleConfig *config = &node.sceneLayer().freestyle_config;
|
||||||
adler32((unsigned char *)&config->flags, sizeof(config->flags));
|
adler32((unsigned char *)&config->flags, sizeof(config->flags));
|
||||||
adler32((unsigned char *)&config->crease_angle, sizeof(config->crease_angle));
|
adler32((unsigned char *)&config->crease_angle, sizeof(config->crease_angle));
|
||||||
adler32((unsigned char *)&config->sphere_radius, sizeof(config->sphere_radius));
|
adler32((unsigned char *)&config->sphere_radius, sizeof(config->sphere_radius));
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "IndexedFaceSet.h"
|
#include "IndexedFaceSet.h"
|
||||||
#include "NodeSceneRenderLayer.h"
|
#include "NodeSceneLayer.h"
|
||||||
#include "NodeCamera.h"
|
#include "NodeCamera.h"
|
||||||
#include "SceneVisitor.h"
|
#include "SceneVisitor.h"
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public:
|
||||||
virtual ~SceneHash() {}
|
virtual ~SceneHash() {}
|
||||||
|
|
||||||
VISIT_DECL(NodeCamera)
|
VISIT_DECL(NodeCamera)
|
||||||
VISIT_DECL(NodeSceneRenderLayer)
|
VISIT_DECL(NodeSceneLayer)
|
||||||
VISIT_DECL(IndexedFaceSet)
|
VISIT_DECL(IndexedFaceSet)
|
||||||
|
|
||||||
string toString();
|
string toString();
|
||||||
|
|
|
@ -56,7 +56,7 @@ class NodeLight;
|
||||||
class NodeCamera;
|
class NodeCamera;
|
||||||
class NodeDrawingStyle;
|
class NodeDrawingStyle;
|
||||||
class NodeTransform;
|
class NodeTransform;
|
||||||
class NodeSceneRenderLayer;
|
class NodeSceneLayer;
|
||||||
|
|
||||||
class Rep;
|
class Rep;
|
||||||
class LineRep;
|
class LineRep;
|
||||||
|
@ -88,7 +88,7 @@ public:
|
||||||
VISIT_COMPLETE_DEF(NodeCamera)
|
VISIT_COMPLETE_DEF(NodeCamera)
|
||||||
VISIT_COMPLETE_DEF(NodeDrawingStyle)
|
VISIT_COMPLETE_DEF(NodeDrawingStyle)
|
||||||
VISIT_COMPLETE_DEF(NodeTransform)
|
VISIT_COMPLETE_DEF(NodeTransform)
|
||||||
VISIT_COMPLETE_DEF(NodeSceneRenderLayer)
|
VISIT_COMPLETE_DEF(NodeSceneLayer)
|
||||||
|
|
||||||
VISIT_COMPLETE_DEF(Rep)
|
VISIT_COMPLETE_DEF(Rep)
|
||||||
VISIT_COMPLETE_DEF(LineRep)
|
VISIT_COMPLETE_DEF(LineRep)
|
||||||
|
|
|
@ -47,7 +47,6 @@ struct ListBase;
|
||||||
struct Material;
|
struct Material;
|
||||||
struct Object;
|
struct Object;
|
||||||
struct Scene;
|
struct Scene;
|
||||||
struct SceneRenderLayer;
|
|
||||||
struct GPUVertexAttribs;
|
struct GPUVertexAttribs;
|
||||||
struct GPUNode;
|
struct GPUNode;
|
||||||
struct GPUNodeLink;
|
struct GPUNodeLink;
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "DNA_freestyle_types.h"
|
||||||
#include "DNA_listBase.h"
|
#include "DNA_listBase.h"
|
||||||
|
|
||||||
typedef struct Base {
|
typedef struct Base {
|
||||||
|
@ -84,6 +85,16 @@ typedef struct SceneLayer {
|
||||||
struct IDProperty *properties; /* overrides */
|
struct IDProperty *properties; /* overrides */
|
||||||
struct IDProperty *properties_evaluated;
|
struct IDProperty *properties_evaluated;
|
||||||
|
|
||||||
|
/* Old SceneRenderLayer data. */
|
||||||
|
int layflag;
|
||||||
|
int passflag; /* pass_xor has to be after passflag */
|
||||||
|
int pass_xor;
|
||||||
|
float pass_alpha_threshold;
|
||||||
|
|
||||||
|
struct IDProperty *id_properties; /* Equivalent to datablocks ID properties. */
|
||||||
|
|
||||||
|
struct FreestyleConfig freestyle_config;
|
||||||
|
|
||||||
/* Runtime data */
|
/* Runtime data */
|
||||||
ListBase drawdata; /* SceneLayerEngineData */
|
ListBase drawdata; /* SceneLayerEngineData */
|
||||||
} SceneLayer;
|
} SceneLayer;
|
||||||
|
@ -120,6 +131,7 @@ enum {
|
||||||
enum {
|
enum {
|
||||||
SCENE_LAYER_RENDER = (1 << 0),
|
SCENE_LAYER_RENDER = (1 << 0),
|
||||||
SCENE_LAYER_ENGINE_DIRTY = (1 << 1),
|
SCENE_LAYER_ENGINE_DIRTY = (1 << 1),
|
||||||
|
SCENE_LAYER_FREESTYLE = (1 << 2),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -172,24 +172,24 @@ typedef struct AudioData {
|
||||||
typedef struct SceneRenderLayer {
|
typedef struct SceneRenderLayer {
|
||||||
struct SceneRenderLayer *next, *prev;
|
struct SceneRenderLayer *next, *prev;
|
||||||
|
|
||||||
char name[64]; /* MAX_NAME */
|
char name[64] DNA_DEPRECATED; /* MAX_NAME */
|
||||||
|
|
||||||
struct Material *mat_override DNA_DEPRECATED; /* Converted to SceneLayer override. */
|
struct Material *mat_override DNA_DEPRECATED; /* Converted to SceneLayer override. */
|
||||||
|
|
||||||
unsigned int lay DNA_DEPRECATED; /* Converted to LayerCollection cycles camera visibility override. */
|
unsigned int lay DNA_DEPRECATED; /* Converted to LayerCollection cycles camera visibility override. */
|
||||||
unsigned int lay_zmask DNA_DEPRECATED; /* Converted to LayerCollection cycles holdout override. */
|
unsigned int lay_zmask DNA_DEPRECATED; /* Converted to LayerCollection cycles holdout override. */
|
||||||
unsigned int lay_exclude DNA_DEPRECATED;
|
unsigned int lay_exclude DNA_DEPRECATED;
|
||||||
int layflag;
|
int layflag DNA_DEPRECATED; /* Converted to SceneLayer layflag and flag. */
|
||||||
|
|
||||||
int passflag; /* pass_xor has to be after passflag */
|
int passflag DNA_DEPRECATED; /* pass_xor has to be after passflag */
|
||||||
int pass_xor;
|
int pass_xor DNA_DEPRECATED; /* Converted to SceneLayer passflag and flag. */
|
||||||
|
|
||||||
int samples DNA_DEPRECATED; /* Converted to SceneLayer override. */
|
int samples DNA_DEPRECATED; /* Converted to SceneLayer override. */
|
||||||
float pass_alpha_threshold;
|
float pass_alpha_threshold DNA_DEPRECATED; /* Converted to SceneLayer pass_alpha_threshold. */
|
||||||
|
|
||||||
IDProperty *prop;
|
IDProperty *prop DNA_DEPRECATED; /* Converted to SceneLayer id_properties. */
|
||||||
|
|
||||||
struct FreestyleConfig freestyleConfig;
|
struct FreestyleConfig freestyleConfig DNA_DEPRECATED; /* Converted to SceneLayer freestyleConfig. */
|
||||||
} SceneRenderLayer;
|
} SceneRenderLayer;
|
||||||
|
|
||||||
/* srl->layflag */
|
/* srl->layflag */
|
||||||
|
@ -662,8 +662,8 @@ typedef struct RenderData {
|
||||||
rcti disprect;
|
rcti disprect;
|
||||||
|
|
||||||
/* information on different layers to be rendered */
|
/* information on different layers to be rendered */
|
||||||
ListBase layers;
|
ListBase layers DNA_DEPRECATED; /* Converted to Scene->render_layers. */
|
||||||
short actlay;
|
short actlay DNA_DEPRECATED; /* Converted to Scene->active_layer. */
|
||||||
|
|
||||||
/* number of mblur samples */
|
/* number of mblur samples */
|
||||||
short mblur_samples;
|
short mblur_samples;
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
#define RNA_MAGIC ((int)~0)
|
#define RNA_MAGIC ((int)~0)
|
||||||
|
|
||||||
|
struct FreestyleSettings;
|
||||||
struct ID;
|
struct ID;
|
||||||
struct IDProperty;
|
struct IDProperty;
|
||||||
struct Main;
|
struct Main;
|
||||||
|
@ -239,6 +240,29 @@ void rna_object_vcollayer_name_set(struct PointerRNA *ptr, const char *value, ch
|
||||||
PointerRNA rna_object_shapekey_index_get(struct ID *id, int value);
|
PointerRNA rna_object_shapekey_index_get(struct ID *id, int value);
|
||||||
int rna_object_shapekey_index_set(struct ID *id, PointerRNA value, int current);
|
int rna_object_shapekey_index_set(struct ID *id, PointerRNA value, int current);
|
||||||
|
|
||||||
|
/* SceneLayer related functions defined in rna_scene.c but required in rna_layer.c */
|
||||||
|
void rna_def_freestyle_settings(struct BlenderRNA *brna);
|
||||||
|
struct PointerRNA rna_FreestyleLineSet_linestyle_get(struct PointerRNA *ptr);
|
||||||
|
void rna_FreestyleLineSet_linestyle_set(struct PointerRNA *ptr, struct PointerRNA value);
|
||||||
|
struct FreestyleLineSet *rna_FreestyleSettings_lineset_add(
|
||||||
|
struct ID *id, struct FreestyleSettings *config, struct Main *bmain, const char *name);
|
||||||
|
void rna_FreestyleSettings_lineset_remove(
|
||||||
|
struct ID *id, struct FreestyleSettings *config, struct ReportList *reports, struct PointerRNA *lineset_ptr);
|
||||||
|
struct PointerRNA rna_FreestyleSettings_active_lineset_get(struct PointerRNA *ptr);
|
||||||
|
void rna_FreestyleSettings_active_lineset_index_range(
|
||||||
|
struct PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax);
|
||||||
|
int rna_FreestyleSettings_active_lineset_index_get(struct PointerRNA *ptr);
|
||||||
|
void rna_FreestyleSettings_active_lineset_index_set(struct PointerRNA *ptr, int value);
|
||||||
|
struct FreestyleModuleConfig *rna_FreestyleSettings_module_add(struct ID *id, struct FreestyleSettings *config);
|
||||||
|
void rna_FreestyleSettings_module_remove(
|
||||||
|
struct ID *id, struct FreestyleSettings *config, struct ReportList *reports, struct PointerRNA *module_ptr);
|
||||||
|
|
||||||
|
void rna_Scene_use_view_map_cache_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
|
||||||
|
void rna_Scene_glsl_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
|
||||||
|
void rna_Scene_freestyle_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
|
||||||
|
void rna_SceneLayer_name_set(struct PointerRNA *ptr, const char *value);
|
||||||
|
void rna_SceneLayer_pass_update(struct Main *bmain, struct Scene *activescene, struct PointerRNA *ptr);
|
||||||
|
|
||||||
/* named internal so as not to conflict with obj.update() rna func */
|
/* named internal so as not to conflict with obj.update() rna func */
|
||||||
void rna_Object_internal_update_data(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
|
void rna_Object_internal_update_data(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
|
||||||
void rna_Mesh_update_draw(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
|
void rna_Mesh_update_draw(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr);
|
||||||
|
|
|
@ -805,28 +805,23 @@ static void rna_LayerObjects_active_object_set(PointerRNA *ptr, PointerRNA value
|
||||||
scene_layer->basact = NULL;
|
scene_layer->basact = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_SceneLayer_name_set(PointerRNA *ptr, const char *value)
|
static IDProperty *rna_SceneLayer_idprops(PointerRNA *ptr, bool create)
|
||||||
{
|
{
|
||||||
Scene *scene = (Scene *)ptr->id.data;
|
|
||||||
SceneLayer *scene_layer = (SceneLayer *)ptr->data;
|
SceneLayer *scene_layer = (SceneLayer *)ptr->data;
|
||||||
char oldname[sizeof(scene_layer->name)];
|
|
||||||
|
|
||||||
BLI_strncpy(oldname, scene_layer->name, sizeof(scene_layer->name));
|
if (create && !scene_layer->id_properties) {
|
||||||
|
IDPropertyTemplate val = {0};
|
||||||
BLI_strncpy_utf8(scene_layer->name, value, sizeof(scene_layer->name));
|
scene_layer->id_properties = IDP_New(IDP_GROUP, &val, "SceneLayer ID properties");
|
||||||
BLI_uniquename(&scene->render_layers, scene_layer, DATA_("SceneLayer"), '.', offsetof(SceneLayer, name), sizeof(scene_layer->name));
|
|
||||||
|
|
||||||
if (scene->nodetree) {
|
|
||||||
bNode *node;
|
|
||||||
int index = BLI_findindex(&scene->render_layers, scene_layer);
|
|
||||||
|
|
||||||
for (node = scene->nodetree->nodes.first; node; node = node->next) {
|
|
||||||
if (node->type == CMP_NODE_R_LAYERS && node->id == NULL) {
|
|
||||||
if (node->custom1 == index)
|
|
||||||
BLI_strncpy(node->name, scene_layer->name, NODE_MAXSTR);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return scene_layer->id_properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void rna_SceneLayer_update_render_passes(ID *id)
|
||||||
|
{
|
||||||
|
Scene *scene = (Scene *)id;
|
||||||
|
if (scene->nodetree)
|
||||||
|
ntreeCompositUpdateRLayers(scene->nodetree);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PointerRNA rna_SceneLayer_objects_get(CollectionPropertyIterator *iter)
|
static PointerRNA rna_SceneLayer_objects_get(CollectionPropertyIterator *iter)
|
||||||
|
@ -2161,12 +2156,13 @@ void RNA_def_scene_layer(BlenderRNA *brna)
|
||||||
srna = RNA_def_struct(brna, "SceneLayer", NULL);
|
srna = RNA_def_struct(brna, "SceneLayer", NULL);
|
||||||
RNA_def_struct_ui_text(srna, "Render Layer", "Render layer");
|
RNA_def_struct_ui_text(srna, "Render Layer", "Render layer");
|
||||||
RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
|
RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
|
||||||
|
RNA_def_struct_idprops_func(srna, "rna_SceneLayer_idprops");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
rna_def_render_layer_common(srna, 1);
|
||||||
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneLayer_name_set");
|
|
||||||
RNA_def_property_ui_text(prop, "Name", "Render layer name");
|
func = RNA_def_function(srna, "update_render_passes", "rna_SceneLayer_update_render_passes");
|
||||||
RNA_def_struct_name_property(srna, prop);
|
RNA_def_function_ui_description(func, "Requery the enabled render passes from the render engine");
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, NULL);
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_NO_SELF);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "collections", PROP_COLLECTION, PROP_NONE);
|
prop = RNA_def_property(srna, "collections", PROP_COLLECTION, PROP_NONE);
|
||||||
RNA_def_property_collection_sdna(prop, NULL, "layer_collections", NULL);
|
RNA_def_property_collection_sdna(prop, NULL, "layer_collections", NULL);
|
||||||
|
@ -2187,6 +2183,20 @@ void RNA_def_scene_layer(BlenderRNA *brna)
|
||||||
RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer");
|
RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer");
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_LAYER, NULL);
|
RNA_def_property_update(prop, NC_SCENE | ND_LAYER, NULL);
|
||||||
|
|
||||||
|
prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE);
|
||||||
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", SCENE_LAYER_FREESTYLE);
|
||||||
|
RNA_def_property_ui_text(prop, "Freestyle", "Render stylized strokes in this Layer");
|
||||||
|
RNA_def_property_update(prop, NC_SCENE | ND_LAYER, NULL);
|
||||||
|
|
||||||
|
/* Freestyle */
|
||||||
|
rna_def_freestyle_settings(brna);
|
||||||
|
|
||||||
|
prop = RNA_def_property(srna, "freestyle_settings", PROP_POINTER, PROP_NONE);
|
||||||
|
RNA_def_property_flag(prop, PROP_NEVER_NULL);
|
||||||
|
RNA_def_property_pointer_sdna(prop, NULL, "freestyle_config");
|
||||||
|
RNA_def_property_struct_type(prop, "FreestyleSettings");
|
||||||
|
RNA_def_property_ui_text(prop, "Freestyle Settings", "");
|
||||||
|
|
||||||
/* Override settings */
|
/* Override settings */
|
||||||
prop = RNA_def_property(srna, "engine_overrides", PROP_COLLECTION, PROP_NONE);
|
prop = RNA_def_property(srna, "engine_overrides", PROP_COLLECTION, PROP_NONE);
|
||||||
RNA_def_property_collection_sdna(prop, NULL, "properties->data.group", NULL);
|
RNA_def_property_collection_sdna(prop, NULL, "properties->data.group", NULL);
|
||||||
|
|
|
@ -2780,7 +2780,7 @@ static const EnumPropertyItem *rna_Node_scene_layer_itemf(bContext *UNUSED(C), P
|
||||||
return DummyRNA_NULL_items;
|
return DummyRNA_NULL_items;
|
||||||
}
|
}
|
||||||
|
|
||||||
rl = sce->r.layers.first;
|
rl = sce->render_layers.first;
|
||||||
item = renderresult_layers_add_enum(rl);
|
item = renderresult_layers_add_enum(rl);
|
||||||
|
|
||||||
*r_free = true;
|
*r_free = true;
|
||||||
|
|
|
@ -280,7 +280,7 @@ static void engine_collection_settings_create(RenderEngine *engine, struct IDPro
|
||||||
RNA_parameter_list_free(&list);
|
RNA_parameter_list_free(&list);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void engine_update_render_passes(RenderEngine *engine, struct Scene *scene, struct SceneRenderLayer *srl)
|
static void engine_update_render_passes(RenderEngine *engine, struct Scene *scene, struct SceneLayer *scene_layer)
|
||||||
{
|
{
|
||||||
extern FunctionRNA rna_RenderEngine_update_render_passes_func;
|
extern FunctionRNA rna_RenderEngine_update_render_passes_func;
|
||||||
PointerRNA ptr;
|
PointerRNA ptr;
|
||||||
|
@ -292,7 +292,7 @@ static void engine_update_render_passes(RenderEngine *engine, struct Scene *scen
|
||||||
|
|
||||||
RNA_parameter_list_create(&list, &ptr, func);
|
RNA_parameter_list_create(&list, &ptr, func);
|
||||||
RNA_parameter_set_lookup(&list, "scene", &scene);
|
RNA_parameter_set_lookup(&list, "scene", &scene);
|
||||||
RNA_parameter_set_lookup(&list, "renderlayer", &srl);
|
RNA_parameter_set_lookup(&list, "renderlayer", &scene_layer);
|
||||||
engine->type->ext.call(NULL, &ptr, func, &list);
|
engine->type->ext.call(NULL, &ptr, func, &list);
|
||||||
|
|
||||||
RNA_parameter_list_free(&list);
|
RNA_parameter_list_free(&list);
|
||||||
|
@ -565,7 +565,7 @@ static void rna_def_render_engine(BlenderRNA *brna)
|
||||||
RNA_def_function_ui_description(func, "Update the render passes that will be generated");
|
RNA_def_function_ui_description(func, "Update the render passes that will be generated");
|
||||||
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE);
|
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE);
|
||||||
parm = RNA_def_pointer(func, "scene", "Scene", "", "");
|
parm = RNA_def_pointer(func, "scene", "Scene", "", "");
|
||||||
parm = RNA_def_pointer(func, "renderlayer", "SceneRenderLayer", "", "");
|
parm = RNA_def_pointer(func, "renderlayer", "SceneLayer", "", "");
|
||||||
|
|
||||||
/* per-collection engine settings initialization */
|
/* per-collection engine settings initialization */
|
||||||
func = RNA_def_function(srna, "collection_settings_create", NULL);
|
func = RNA_def_function(srna, "collection_settings_create", NULL);
|
||||||
|
@ -758,7 +758,7 @@ static void rna_def_render_engine(BlenderRNA *brna)
|
||||||
RNA_def_function_ui_description(func, "Register a render pass that will be part of the render with the current settings");
|
RNA_def_function_ui_description(func, "Register a render pass that will be part of the render with the current settings");
|
||||||
prop = RNA_def_pointer(func, "scene", "Scene", "", "");
|
prop = RNA_def_pointer(func, "scene", "Scene", "", "");
|
||||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
||||||
prop = RNA_def_pointer(func, "srl", "SceneRenderLayer", "", "");
|
prop = RNA_def_pointer(func, "scene_layer", "SceneLayer", "", "");
|
||||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
||||||
prop = RNA_def_string(func, "name", NULL, MAX_NAME, "Name", "");
|
prop = RNA_def_string(func, "name", NULL, MAX_NAME, "Name", "");
|
||||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
||||||
|
|
|
@ -1286,73 +1286,6 @@ static void rna_FFmpegSettings_codec_settings_update(Main *UNUSED(bmain), Scene
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int rna_RenderSettings_active_layer_index_get(PointerRNA *ptr)
|
|
||||||
{
|
|
||||||
RenderData *rd = (RenderData *)ptr->data;
|
|
||||||
return rd->actlay;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void rna_RenderSettings_active_layer_index_set(PointerRNA *ptr, int value)
|
|
||||||
{
|
|
||||||
RenderData *rd = (RenderData *)ptr->data;
|
|
||||||
int num_layers = BLI_listbase_count(&rd->layers);
|
|
||||||
rd->actlay = min_ff(value, num_layers - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void rna_RenderSettings_active_layer_index_range(
|
|
||||||
PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
|
|
||||||
{
|
|
||||||
RenderData *rd = (RenderData *)ptr->data;
|
|
||||||
|
|
||||||
*min = 0;
|
|
||||||
*max = max_ii(0, BLI_listbase_count(&rd->layers) - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static PointerRNA rna_RenderSettings_active_layer_get(PointerRNA *ptr)
|
|
||||||
{
|
|
||||||
RenderData *rd = (RenderData *)ptr->data;
|
|
||||||
SceneRenderLayer *srl = BLI_findlink(&rd->layers, rd->actlay);
|
|
||||||
|
|
||||||
return rna_pointer_inherit_refine(ptr, &RNA_SceneRenderLayer, srl);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void rna_RenderSettings_active_layer_set(PointerRNA *ptr, PointerRNA value)
|
|
||||||
{
|
|
||||||
RenderData *rd = (RenderData *)ptr->data;
|
|
||||||
SceneRenderLayer *srl = (SceneRenderLayer *)value.data;
|
|
||||||
const int index = BLI_findindex(&rd->layers, srl);
|
|
||||||
if (index != -1) rd->actlay = index;
|
|
||||||
}
|
|
||||||
|
|
||||||
static SceneRenderLayer *rna_RenderLayer_new(ID *id, RenderData *UNUSED(rd), const char *name)
|
|
||||||
{
|
|
||||||
Scene *scene = (Scene *)id;
|
|
||||||
SceneRenderLayer *srl = BKE_scene_add_render_layer(scene, name);
|
|
||||||
|
|
||||||
DEG_id_tag_update(&scene->id, 0);
|
|
||||||
WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL);
|
|
||||||
|
|
||||||
return srl;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void rna_RenderLayer_remove(
|
|
||||||
ID *id, RenderData *UNUSED(rd), Main *bmain, ReportList *reports, PointerRNA *srl_ptr)
|
|
||||||
{
|
|
||||||
SceneRenderLayer *srl = srl_ptr->data;
|
|
||||||
Scene *scene = (Scene *)id;
|
|
||||||
|
|
||||||
if (!BKE_scene_remove_render_layer(bmain, scene, srl)) {
|
|
||||||
BKE_reportf(reports, RPT_ERROR, "Render layer '%s' could not be removed from scene '%s'",
|
|
||||||
srl->name, scene->id.name + 2);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
RNA_POINTER_INVALIDATE(srl_ptr);
|
|
||||||
|
|
||||||
DEG_id_tag_update(&scene->id, 0);
|
|
||||||
WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int rna_RenderSettings_active_view_index_get(PointerRNA *ptr)
|
static int rna_RenderSettings_active_view_index_get(PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
RenderData *rd = (RenderData *)ptr->data;
|
RenderData *rd = (RenderData *)ptr->data;
|
||||||
|
@ -1431,7 +1364,7 @@ static void rna_RenderSettings_views_format_set(PointerRNA *ptr, int value)
|
||||||
rd->views_format = value;
|
rd->views_format = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_Scene_glsl_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
void rna_Scene_glsl_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
Scene *scene = (Scene *)ptr->id.data;
|
Scene *scene = (Scene *)ptr->id.data;
|
||||||
|
|
||||||
|
@ -1446,66 +1379,45 @@ static void rna_Scene_world_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||||
WM_main_add_notifier(NC_WORLD | ND_WORLD, &sc->id);
|
WM_main_add_notifier(NC_WORLD | ND_WORLD, &sc->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_Scene_freestyle_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
void rna_Scene_freestyle_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
Scene *scene = (Scene *)ptr->id.data;
|
Scene *scene = (Scene *)ptr->id.data;
|
||||||
|
|
||||||
DEG_id_tag_update(&scene->id, 0);
|
DEG_id_tag_update(&scene->id, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_Scene_use_view_map_cache_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
|
void rna_Scene_use_view_map_cache_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
|
||||||
{
|
{
|
||||||
#ifdef WITH_FREESTYLE
|
#ifdef WITH_FREESTYLE
|
||||||
FRS_free_view_map_cache();
|
FRS_free_view_map_cache();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static IDProperty *rna_SceneRenderLayer_idprops(PointerRNA *ptr, bool create)
|
void rna_SceneLayer_name_set(PointerRNA *ptr, const char *value)
|
||||||
{
|
|
||||||
SceneRenderLayer *srl = (SceneRenderLayer *)ptr->data;
|
|
||||||
|
|
||||||
if (create && !srl->prop) {
|
|
||||||
IDPropertyTemplate val = {0};
|
|
||||||
srl->prop = IDP_New(IDP_GROUP, &val, "SceneRenderLayer ID properties");
|
|
||||||
}
|
|
||||||
|
|
||||||
return srl->prop;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
|
|
||||||
{
|
{
|
||||||
Scene *scene = (Scene *)ptr->id.data;
|
Scene *scene = (Scene *)ptr->id.data;
|
||||||
SceneRenderLayer *rl = (SceneRenderLayer *)ptr->data;
|
SceneLayer *scene_layer = (SceneLayer *)ptr->data;
|
||||||
char oldname[sizeof(rl->name)];
|
char oldname[sizeof(scene_layer->name)];
|
||||||
|
|
||||||
BLI_strncpy(oldname, rl->name, sizeof(rl->name));
|
BLI_strncpy(oldname, scene_layer->name, sizeof(scene_layer->name));
|
||||||
|
|
||||||
BLI_strncpy_utf8(rl->name, value, sizeof(rl->name));
|
BLI_strncpy_utf8(scene_layer->name, value, sizeof(scene_layer->name));
|
||||||
BLI_uniquename(&scene->r.layers, rl, DATA_("RenderLayer"), '.', offsetof(SceneRenderLayer, name), sizeof(rl->name));
|
BLI_uniquename(&scene->render_layers, scene_layer, DATA_("RenderLayer"), '.', offsetof(SceneLayer, name), sizeof(scene_layer->name));
|
||||||
|
|
||||||
if (scene->nodetree) {
|
if (scene->nodetree) {
|
||||||
bNode *node;
|
bNode *node;
|
||||||
int index = BLI_findindex(&scene->r.layers, rl);
|
int index = BLI_findindex(&scene->render_layers, scene_layer);
|
||||||
|
|
||||||
for (node = scene->nodetree->nodes.first; node; node = node->next) {
|
for (node = scene->nodetree->nodes.first; node; node = node->next) {
|
||||||
if (node->type == CMP_NODE_R_LAYERS && node->id == NULL) {
|
if (node->type == CMP_NODE_R_LAYERS && node->id == NULL) {
|
||||||
if (node->custom1 == index)
|
if (node->custom1 == index)
|
||||||
BLI_strncpy(node->name, rl->name, NODE_MAXSTR);
|
BLI_strncpy(node->name, scene_layer->name, NODE_MAXSTR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fix all the animation data which may link to this */
|
/* fix all the animation data which may link to this */
|
||||||
BKE_animdata_fix_paths_rename_all(NULL, "render.layers", oldname, rl->name);
|
BKE_animdata_fix_paths_rename_all(NULL, "render.layers", oldname, scene_layer->name);
|
||||||
}
|
|
||||||
|
|
||||||
static char *rna_SceneRenderLayer_path(PointerRNA *ptr)
|
|
||||||
{
|
|
||||||
SceneRenderLayer *srl = (SceneRenderLayer *)ptr->data;
|
|
||||||
char name_esc[sizeof(srl->name) * 2];
|
|
||||||
|
|
||||||
BLI_strescape(name_esc, srl->name, sizeof(name_esc));
|
|
||||||
return BLI_sprintfN("render.layers[\"%s\"]", name_esc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_SceneRenderView_name_set(PointerRNA *ptr, const char *value)
|
static void rna_SceneRenderView_name_set(PointerRNA *ptr, const char *value)
|
||||||
|
@ -1516,13 +1428,7 @@ static void rna_SceneRenderView_name_set(PointerRNA *ptr, const char *value)
|
||||||
BLI_uniquename(&scene->r.views, rv, DATA_("RenderView"), '.', offsetof(SceneRenderView, name), sizeof(rv->name));
|
BLI_uniquename(&scene->r.views, rv, DATA_("RenderView"), '.', offsetof(SceneRenderView, name), sizeof(rv->name));
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *rna_SceneRenderView_path(PointerRNA *ptr)
|
void rna_SceneLayer_pass_update(Main *bmain, Scene *activescene, PointerRNA *ptr)
|
||||||
{
|
|
||||||
SceneRenderView *srv = (SceneRenderView *)ptr->data;
|
|
||||||
return BLI_sprintfN("render.views[\"%s\"]", srv->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void rna_SceneRenderLayer_pass_update(Main *bmain, Scene *activescene, PointerRNA *ptr)
|
|
||||||
{
|
{
|
||||||
Scene *scene = (Scene *)ptr->id.data;
|
Scene *scene = (Scene *)ptr->id.data;
|
||||||
|
|
||||||
|
@ -1532,11 +1438,10 @@ static void rna_SceneRenderLayer_pass_update(Main *bmain, Scene *activescene, Po
|
||||||
rna_Scene_glsl_update(bmain, activescene, ptr);
|
rna_Scene_glsl_update(bmain, activescene, ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_SceneRenderLayer_update_render_passes(ID *id)
|
static char *rna_SceneRenderView_path(PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
Scene *scene = (Scene *)id;
|
SceneRenderView *srv = (SceneRenderView *)ptr->data;
|
||||||
if (scene->nodetree)
|
return BLI_sprintfN("render.views[\"%s\"]", srv->name);
|
||||||
ntreeCompositUpdateRLayers(scene->nodetree);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_Scene_use_nodes_update(bContext *C, PointerRNA *ptr)
|
static void rna_Scene_use_nodes_update(bContext *C, PointerRNA *ptr)
|
||||||
|
@ -1885,14 +1790,14 @@ static char *rna_ToolSettings_path(PointerRNA *UNUSED(ptr))
|
||||||
return BLI_strdup("tool_settings");
|
return BLI_strdup("tool_settings");
|
||||||
}
|
}
|
||||||
|
|
||||||
static PointerRNA rna_FreestyleLineSet_linestyle_get(PointerRNA *ptr)
|
PointerRNA rna_FreestyleLineSet_linestyle_get(PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
FreestyleLineSet *lineset = (FreestyleLineSet *)ptr->data;
|
FreestyleLineSet *lineset = (FreestyleLineSet *)ptr->data;
|
||||||
|
|
||||||
return rna_pointer_inherit_refine(ptr, &RNA_FreestyleLineStyle, lineset->linestyle);
|
return rna_pointer_inherit_refine(ptr, &RNA_FreestyleLineStyle, lineset->linestyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_FreestyleLineSet_linestyle_set(PointerRNA *ptr, PointerRNA value)
|
void rna_FreestyleLineSet_linestyle_set(PointerRNA *ptr, PointerRNA value)
|
||||||
{
|
{
|
||||||
FreestyleLineSet *lineset = (FreestyleLineSet *)ptr->data;
|
FreestyleLineSet *lineset = (FreestyleLineSet *)ptr->data;
|
||||||
|
|
||||||
|
@ -1902,7 +1807,7 @@ static void rna_FreestyleLineSet_linestyle_set(PointerRNA *ptr, PointerRNA value
|
||||||
id_us_plus(&lineset->linestyle->id);
|
id_us_plus(&lineset->linestyle->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static FreestyleLineSet *rna_FreestyleSettings_lineset_add(
|
FreestyleLineSet *rna_FreestyleSettings_lineset_add(
|
||||||
ID *id, FreestyleSettings *config, Main *bmain, const char *name)
|
ID *id, FreestyleSettings *config, Main *bmain, const char *name)
|
||||||
{
|
{
|
||||||
Scene *scene = (Scene *)id;
|
Scene *scene = (Scene *)id;
|
||||||
|
@ -1914,7 +1819,7 @@ static FreestyleLineSet *rna_FreestyleSettings_lineset_add(
|
||||||
return lineset;
|
return lineset;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_FreestyleSettings_lineset_remove(
|
void rna_FreestyleSettings_lineset_remove(
|
||||||
ID *id, FreestyleSettings *config, ReportList *reports, PointerRNA *lineset_ptr)
|
ID *id, FreestyleSettings *config, ReportList *reports, PointerRNA *lineset_ptr)
|
||||||
{
|
{
|
||||||
FreestyleLineSet *lineset = lineset_ptr->data;
|
FreestyleLineSet *lineset = lineset_ptr->data;
|
||||||
|
@ -1931,14 +1836,14 @@ static void rna_FreestyleSettings_lineset_remove(
|
||||||
WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL);
|
WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PointerRNA rna_FreestyleSettings_active_lineset_get(PointerRNA *ptr)
|
PointerRNA rna_FreestyleSettings_active_lineset_get(PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
FreestyleConfig *config = (FreestyleConfig *)ptr->data;
|
FreestyleConfig *config = (FreestyleConfig *)ptr->data;
|
||||||
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);
|
FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);
|
||||||
return rna_pointer_inherit_refine(ptr, &RNA_FreestyleLineSet, lineset);
|
return rna_pointer_inherit_refine(ptr, &RNA_FreestyleLineSet, lineset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_FreestyleSettings_active_lineset_index_range(
|
void rna_FreestyleSettings_active_lineset_index_range(
|
||||||
PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
|
PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
|
||||||
{
|
{
|
||||||
FreestyleConfig *config = (FreestyleConfig *)ptr->data;
|
FreestyleConfig *config = (FreestyleConfig *)ptr->data;
|
||||||
|
@ -1947,19 +1852,19 @@ static void rna_FreestyleSettings_active_lineset_index_range(
|
||||||
*max = max_ii(0, BLI_listbase_count(&config->linesets) - 1);
|
*max = max_ii(0, BLI_listbase_count(&config->linesets) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rna_FreestyleSettings_active_lineset_index_get(PointerRNA *ptr)
|
int rna_FreestyleSettings_active_lineset_index_get(PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
FreestyleConfig *config = (FreestyleConfig *)ptr->data;
|
FreestyleConfig *config = (FreestyleConfig *)ptr->data;
|
||||||
return BKE_freestyle_lineset_get_active_index(config);
|
return BKE_freestyle_lineset_get_active_index(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_FreestyleSettings_active_lineset_index_set(PointerRNA *ptr, int value)
|
void rna_FreestyleSettings_active_lineset_index_set(PointerRNA *ptr, int value)
|
||||||
{
|
{
|
||||||
FreestyleConfig *config = (FreestyleConfig *)ptr->data;
|
FreestyleConfig *config = (FreestyleConfig *)ptr->data;
|
||||||
BKE_freestyle_lineset_set_active_index(config, value);
|
BKE_freestyle_lineset_set_active_index(config, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static FreestyleModuleConfig *rna_FreestyleSettings_module_add(ID *id, FreestyleSettings *config)
|
FreestyleModuleConfig *rna_FreestyleSettings_module_add(ID *id, FreestyleSettings *config)
|
||||||
{
|
{
|
||||||
Scene *scene = (Scene *)id;
|
Scene *scene = (Scene *)id;
|
||||||
FreestyleModuleConfig *module = BKE_freestyle_module_add((FreestyleConfig *)config);
|
FreestyleModuleConfig *module = BKE_freestyle_module_add((FreestyleConfig *)config);
|
||||||
|
@ -1970,7 +1875,7 @@ static FreestyleModuleConfig *rna_FreestyleSettings_module_add(ID *id, Freestyle
|
||||||
return module;
|
return module;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_FreestyleSettings_module_remove(
|
void rna_FreestyleSettings_module_remove(
|
||||||
ID *id, FreestyleSettings *config, ReportList *reports, PointerRNA *module_ptr)
|
ID *id, FreestyleSettings *config, ReportList *reports, PointerRNA *module_ptr)
|
||||||
{
|
{
|
||||||
Scene *scene = (Scene *)id;
|
Scene *scene = (Scene *)id;
|
||||||
|
@ -3268,7 +3173,7 @@ void rna_def_render_layer_common(StructRNA *srna, int scene)
|
||||||
PropertyRNA *prop;
|
PropertyRNA *prop;
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
||||||
if (scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
|
if (scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneLayer_name_set");
|
||||||
else RNA_def_property_string_sdna(prop, NULL, "name");
|
else RNA_def_property_string_sdna(prop, NULL, "name");
|
||||||
RNA_def_property_ui_text(prop, "Name", "Render layer name");
|
RNA_def_property_ui_text(prop, "Name", "Render layer name");
|
||||||
RNA_def_struct_name_property(srna, prop);
|
RNA_def_struct_name_property(srna, prop);
|
||||||
|
@ -3284,12 +3189,6 @@ void rna_def_render_layer_common(StructRNA *srna, int scene)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* layer options */
|
/* layer options */
|
||||||
prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
|
|
||||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);
|
|
||||||
RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer");
|
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update");
|
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_zmask", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_zmask", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
|
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
|
||||||
RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values");
|
RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values");
|
||||||
|
@ -3351,247 +3250,241 @@ void rna_def_render_layer_common(StructRNA *srna, int scene)
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE);
|
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_FRS);
|
|
||||||
RNA_def_property_ui_text(prop, "Freestyle", "Render stylized strokes in this Layer");
|
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
|
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
||||||
|
|
||||||
/* passes */
|
/* passes */
|
||||||
prop = RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
|
||||||
RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
|
RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
|
||||||
RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
|
RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
|
||||||
RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
|
RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
|
||||||
RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
|
RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
|
||||||
RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
|
RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
|
||||||
RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)");
|
RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
|
||||||
RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
|
RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_material_index", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_material_index", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXMA);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXMA);
|
||||||
RNA_def_property_ui_text(prop, "Material Index", "Deliver material index pass");
|
RNA_def_property_ui_text(prop, "Material Index", "Deliver material index pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
|
||||||
RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass");
|
RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
|
||||||
RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass");
|
RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_specular", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_specular", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
|
||||||
RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass");
|
RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
|
||||||
RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
|
RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
|
||||||
RNA_def_property_ui_text(prop, "AO", "Deliver AO pass");
|
RNA_def_property_ui_text(prop, "AO", "Deliver AO pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_reflection", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_reflection", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
|
||||||
RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass");
|
RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_refraction", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_refraction", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
|
||||||
RNA_def_property_ui_text(prop, "Refraction", "Deliver raytraced refraction pass");
|
RNA_def_property_ui_text(prop, "Refraction", "Deliver raytraced refraction pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
|
||||||
RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
|
RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_ENVIRONMENT);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_ENVIRONMENT);
|
||||||
RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
|
RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDIRECT);
|
||||||
RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass");
|
RNA_def_property_ui_text(prop, "Indirect", "Deliver indirect lighting pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "exclude_specular", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "exclude_specular", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
|
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC);
|
||||||
RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined");
|
RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined");
|
||||||
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
|
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "exclude_shadow", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "exclude_shadow", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
|
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW);
|
||||||
RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined");
|
RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined");
|
||||||
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
|
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "exclude_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "exclude_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
|
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO);
|
||||||
RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined");
|
RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined");
|
||||||
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
|
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "exclude_reflection", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "exclude_reflection", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
|
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT);
|
||||||
RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude raytraced reflection pass from combined");
|
RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude raytraced reflection pass from combined");
|
||||||
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
|
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "exclude_refraction", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "exclude_refraction", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
|
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT);
|
||||||
RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude raytraced refraction pass from combined");
|
RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude raytraced refraction pass from combined");
|
||||||
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
|
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "exclude_emit", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "exclude_emit", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_EMIT);
|
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_EMIT);
|
||||||
RNA_def_property_ui_text(prop, "Emit Exclude", "Exclude emission pass from combined");
|
RNA_def_property_ui_text(prop, "Emit Exclude", "Exclude emission pass from combined");
|
||||||
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
|
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "exclude_environment", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "exclude_environment", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_ENVIRONMENT);
|
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_ENVIRONMENT);
|
||||||
RNA_def_property_ui_text(prop, "Environment Exclude", "Exclude environment pass from combined");
|
RNA_def_property_ui_text(prop, "Environment Exclude", "Exclude environment pass from combined");
|
||||||
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
|
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "exclude_indirect", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "exclude_indirect", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_INDIRECT);
|
RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_INDIRECT);
|
||||||
RNA_def_property_ui_text(prop, "Indirect Exclude", "Exclude indirect pass from combined");
|
RNA_def_property_ui_text(prop, "Indirect Exclude", "Exclude indirect pass from combined");
|
||||||
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
|
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_diffuse_direct", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_diffuse_direct", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE_DIRECT);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE_DIRECT);
|
||||||
RNA_def_property_ui_text(prop, "Diffuse Direct", "Deliver diffuse direct pass");
|
RNA_def_property_ui_text(prop, "Diffuse Direct", "Deliver diffuse direct pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_diffuse_indirect", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_diffuse_indirect", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE_INDIRECT);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE_INDIRECT);
|
||||||
RNA_def_property_ui_text(prop, "Diffuse Indirect", "Deliver diffuse indirect pass");
|
RNA_def_property_ui_text(prop, "Diffuse Indirect", "Deliver diffuse indirect pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_diffuse_color", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_diffuse_color", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE_COLOR);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE_COLOR);
|
||||||
RNA_def_property_ui_text(prop, "Diffuse Color", "Deliver diffuse color pass");
|
RNA_def_property_ui_text(prop, "Diffuse Color", "Deliver diffuse color pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_glossy_direct", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_glossy_direct", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_GLOSSY_DIRECT);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_GLOSSY_DIRECT);
|
||||||
RNA_def_property_ui_text(prop, "Glossy Direct", "Deliver glossy direct pass");
|
RNA_def_property_ui_text(prop, "Glossy Direct", "Deliver glossy direct pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_glossy_indirect", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_glossy_indirect", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_GLOSSY_INDIRECT);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_GLOSSY_INDIRECT);
|
||||||
RNA_def_property_ui_text(prop, "Glossy Indirect", "Deliver glossy indirect pass");
|
RNA_def_property_ui_text(prop, "Glossy Indirect", "Deliver glossy indirect pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_glossy_color", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_glossy_color", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_GLOSSY_COLOR);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_GLOSSY_COLOR);
|
||||||
RNA_def_property_ui_text(prop, "Glossy Color", "Deliver glossy color pass");
|
RNA_def_property_ui_text(prop, "Glossy Color", "Deliver glossy color pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_transmission_direct", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_transmission_direct", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_TRANSM_DIRECT);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_TRANSM_DIRECT);
|
||||||
RNA_def_property_ui_text(prop, "Transmission Direct", "Deliver transmission direct pass");
|
RNA_def_property_ui_text(prop, "Transmission Direct", "Deliver transmission direct pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_transmission_indirect", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_transmission_indirect", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_TRANSM_INDIRECT);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_TRANSM_INDIRECT);
|
||||||
RNA_def_property_ui_text(prop, "Transmission Indirect", "Deliver transmission indirect pass");
|
RNA_def_property_ui_text(prop, "Transmission Indirect", "Deliver transmission indirect pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_transmission_color", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_transmission_color", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_TRANSM_COLOR);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_TRANSM_COLOR);
|
||||||
RNA_def_property_ui_text(prop, "Transmission Color", "Deliver transmission color pass");
|
RNA_def_property_ui_text(prop, "Transmission Color", "Deliver transmission color pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_subsurface_direct", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_subsurface_direct", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SUBSURFACE_DIRECT);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SUBSURFACE_DIRECT);
|
||||||
RNA_def_property_ui_text(prop, "Subsurface Direct", "Deliver subsurface direct pass");
|
RNA_def_property_ui_text(prop, "Subsurface Direct", "Deliver subsurface direct pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_subsurface_indirect", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_subsurface_indirect", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SUBSURFACE_INDIRECT);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SUBSURFACE_INDIRECT);
|
||||||
RNA_def_property_ui_text(prop, "Subsurface Indirect", "Deliver subsurface indirect pass");
|
RNA_def_property_ui_text(prop, "Subsurface Indirect", "Deliver subsurface indirect pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pass_subsurface_color", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pass_subsurface_color", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SUBSURFACE_COLOR);
|
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SUBSURFACE_COLOR);
|
||||||
RNA_def_property_ui_text(prop, "Subsurface Color", "Deliver subsurface color pass");
|
RNA_def_property_ui_text(prop, "Subsurface Color", "Deliver subsurface color pass");
|
||||||
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
|
if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneLayer_pass_update");
|
||||||
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3661,7 +3554,7 @@ static void rna_def_freestyle_linesets(BlenderRNA *brna, PropertyRNA *cprop)
|
||||||
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_def_freestyle_settings(BlenderRNA *brna)
|
void rna_def_freestyle_settings(BlenderRNA *brna)
|
||||||
{
|
{
|
||||||
StructRNA *srna;
|
StructRNA *srna;
|
||||||
PropertyRNA *prop;
|
PropertyRNA *prop;
|
||||||
|
@ -3954,8 +3847,8 @@ static void rna_def_freestyle_settings(BlenderRNA *brna)
|
||||||
|
|
||||||
srna = RNA_def_struct(brna, "FreestyleSettings", NULL);
|
srna = RNA_def_struct(brna, "FreestyleSettings", NULL);
|
||||||
RNA_def_struct_sdna(srna, "FreestyleConfig");
|
RNA_def_struct_sdna(srna, "FreestyleConfig");
|
||||||
RNA_def_struct_nested(brna, srna, "SceneRenderLayer");
|
RNA_def_struct_nested(brna, srna, "SceneLayer");
|
||||||
RNA_def_struct_ui_text(srna, "Freestyle Settings", "Freestyle settings for a SceneRenderLayer data-block");
|
RNA_def_struct_ui_text(srna, "Freestyle Settings", "Freestyle settings for a SceneLayer data-block");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "modules", PROP_COLLECTION, PROP_NONE);
|
prop = RNA_def_property(srna, "modules", PROP_COLLECTION, PROP_NONE);
|
||||||
RNA_def_property_collection_sdna(prop, NULL, "modules", NULL);
|
RNA_def_property_collection_sdna(prop, NULL, "modules", NULL);
|
||||||
|
@ -4981,82 +4874,6 @@ static void rna_def_scene_layers(BlenderRNA *brna, PropertyRNA *cprop)
|
||||||
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO LAYERS: legacy SceneRenderLayers, to be removed */
|
|
||||||
|
|
||||||
static void rna_def_scene_render_layer(BlenderRNA *brna)
|
|
||||||
{
|
|
||||||
StructRNA *srna;
|
|
||||||
PropertyRNA *prop;
|
|
||||||
FunctionRNA *func;
|
|
||||||
|
|
||||||
srna = RNA_def_struct(brna, "SceneRenderLayer", NULL);
|
|
||||||
RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer");
|
|
||||||
RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
|
|
||||||
RNA_def_struct_path_func(srna, "rna_SceneRenderLayer_path");
|
|
||||||
RNA_def_struct_idprops_func(srna, "rna_SceneRenderLayer_idprops");
|
|
||||||
|
|
||||||
rna_def_render_layer_common(srna, 1);
|
|
||||||
|
|
||||||
func = RNA_def_function(srna, "update_render_passes", "rna_SceneRenderLayer_update_render_passes");
|
|
||||||
RNA_def_function_ui_description(func, "Requery the enabled render passes from the render engine");
|
|
||||||
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_NO_SELF);
|
|
||||||
|
|
||||||
/* Freestyle */
|
|
||||||
rna_def_freestyle_settings(brna);
|
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "freestyle_settings", PROP_POINTER, PROP_NONE);
|
|
||||||
RNA_def_property_flag(prop, PROP_NEVER_NULL);
|
|
||||||
RNA_def_property_pointer_sdna(prop, NULL, "freestyleConfig");
|
|
||||||
RNA_def_property_struct_type(prop, "FreestyleSettings");
|
|
||||||
RNA_def_property_ui_text(prop, "Freestyle Settings", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Render Layers */
|
|
||||||
static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop)
|
|
||||||
{
|
|
||||||
StructRNA *srna;
|
|
||||||
PropertyRNA *prop;
|
|
||||||
|
|
||||||
FunctionRNA *func;
|
|
||||||
PropertyRNA *parm;
|
|
||||||
|
|
||||||
RNA_def_property_srna(cprop, "RenderLayers");
|
|
||||||
srna = RNA_def_struct(brna, "RenderLayers", NULL);
|
|
||||||
RNA_def_struct_sdna(srna, "RenderData");
|
|
||||||
RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");
|
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
|
|
||||||
RNA_def_property_int_sdna(prop, NULL, "actlay");
|
|
||||||
RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get",
|
|
||||||
"rna_RenderSettings_active_layer_index_set",
|
|
||||||
"rna_RenderSettings_active_layer_index_range");
|
|
||||||
RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array");
|
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update");
|
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
|
|
||||||
RNA_def_property_struct_type(prop, "SceneRenderLayer");
|
|
||||||
RNA_def_property_pointer_funcs(prop, "rna_RenderSettings_active_layer_get",
|
|
||||||
"rna_RenderSettings_active_layer_set", NULL, NULL);
|
|
||||||
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL);
|
|
||||||
RNA_def_property_ui_text(prop, "Active Render Layer", "Active Render Layer");
|
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update");
|
|
||||||
|
|
||||||
func = RNA_def_function(srna, "new", "rna_RenderLayer_new");
|
|
||||||
RNA_def_function_ui_description(func, "Add a render layer to scene");
|
|
||||||
RNA_def_function_flag(func, FUNC_USE_SELF_ID);
|
|
||||||
parm = RNA_def_string(func, "name", "RenderLayer", 0, "", "New name for the render layer (not unique)");
|
|
||||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
||||||
parm = RNA_def_pointer(func, "result", "SceneRenderLayer", "", "Newly created render layer");
|
|
||||||
RNA_def_function_return(func, parm);
|
|
||||||
|
|
||||||
func = RNA_def_function(srna, "remove", "rna_RenderLayer_remove");
|
|
||||||
RNA_def_function_ui_description(func, "Remove a render layer");
|
|
||||||
RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS | FUNC_USE_SELF_ID);
|
|
||||||
parm = RNA_def_pointer(func, "layer", "SceneRenderLayer", "", "Render layer to remove");
|
|
||||||
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
||||||
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Render Views - MultiView */
|
/* Render Views - MultiView */
|
||||||
static void rna_def_scene_render_view(BlenderRNA *brna)
|
static void rna_def_scene_render_view(BlenderRNA *brna)
|
||||||
{
|
{
|
||||||
|
@ -6422,13 +6239,6 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
|
||||||
RNA_def_property_ui_text(prop, "Textured Solid", "Draw face-assigned textures in solid draw method");
|
RNA_def_property_ui_text(prop, "Textured Solid", "Draw face-assigned textures in solid draw method");
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SceneSequencer_update");
|
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SceneSequencer_update");
|
||||||
|
|
||||||
/* layers */
|
|
||||||
prop = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
|
|
||||||
RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
|
|
||||||
RNA_def_property_struct_type(prop, "SceneRenderLayer");
|
|
||||||
RNA_def_property_ui_text(prop, "Render Layers", "");
|
|
||||||
rna_def_render_layers(brna, prop);
|
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
|
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
|
||||||
RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer");
|
RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer");
|
||||||
|
@ -7189,7 +6999,6 @@ void RNA_def_scene(BlenderRNA *brna)
|
||||||
RNA_define_animate_sdna(true);
|
RNA_define_animate_sdna(true);
|
||||||
/* *** Animated *** */
|
/* *** Animated *** */
|
||||||
rna_def_scene_render_data(brna);
|
rna_def_scene_render_data(brna);
|
||||||
rna_def_scene_render_layer(brna);
|
|
||||||
rna_def_gpu_fx(brna);
|
rna_def_gpu_fx(brna);
|
||||||
rna_def_scene_render_view(brna);
|
rna_def_scene_render_view(brna);
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,7 @@ void register_node_type_cmp_planetrackdeform(void);
|
||||||
void register_node_type_cmp_cornerpin(void);
|
void register_node_type_cmp_cornerpin(void);
|
||||||
|
|
||||||
void node_cmp_rlayers_outputs(struct bNodeTree *ntree, struct bNode *node);
|
void node_cmp_rlayers_outputs(struct bNodeTree *ntree, struct bNode *node);
|
||||||
void node_cmp_rlayers_register_pass(struct bNodeTree *ntree, struct bNode *node, struct Scene *scene, struct SceneRenderLayer *srl, const char *name, int type);
|
void node_cmp_rlayers_register_pass(struct bNodeTree *ntree, struct bNode *node, struct Scene *scene, struct SceneLayer *scene_layer, const char *name, int type);
|
||||||
const char *node_cmp_rlayers_sock_to_pass(int sock_index);
|
const char *node_cmp_rlayers_sock_to_pass(int sock_index);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -261,7 +261,7 @@ void ntreeCompositUpdateRLayers(bNodeTree *ntree)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ntreeCompositRegisterPass(bNodeTree *ntree, Scene *scene, SceneRenderLayer *srl, const char *name, int type)
|
void ntreeCompositRegisterPass(bNodeTree *ntree, Scene *scene, SceneLayer *scene_layer, const char *name, int type)
|
||||||
{
|
{
|
||||||
bNode *node;
|
bNode *node;
|
||||||
|
|
||||||
|
@ -269,7 +269,7 @@ void ntreeCompositRegisterPass(bNodeTree *ntree, Scene *scene, SceneRenderLayer
|
||||||
|
|
||||||
for (node = ntree->nodes.first; node; node = node->next) {
|
for (node = ntree->nodes.first; node; node = node->next) {
|
||||||
if (node->type == CMP_NODE_R_LAYERS)
|
if (node->type == CMP_NODE_R_LAYERS)
|
||||||
node_cmp_rlayers_register_pass(ntree, node, scene, srl, name, type);
|
node_cmp_rlayers_register_pass(ntree, node, scene, scene_layer, name, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,16 +191,16 @@ typedef struct RLayerUpdateData {
|
||||||
int prev_index;
|
int prev_index;
|
||||||
} RLayerUpdateData;
|
} RLayerUpdateData;
|
||||||
|
|
||||||
void node_cmp_rlayers_register_pass(bNodeTree *ntree, bNode *node, Scene *scene, SceneRenderLayer *srl, const char *name, int type)
|
void node_cmp_rlayers_register_pass(bNodeTree *ntree, bNode *node, Scene *scene, SceneLayer *scene_layer, const char *name, int type)
|
||||||
{
|
{
|
||||||
RLayerUpdateData *data = node->storage;
|
RLayerUpdateData *data = node->storage;
|
||||||
|
|
||||||
if (scene == NULL || srl == NULL || data == NULL || node->id != (ID *)scene) {
|
if (scene == NULL || scene_layer == NULL || data == NULL || node->id != (ID *)scene) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneRenderLayer *node_srl = BLI_findlink(&scene->r.layers, node->custom1);
|
SceneLayer *node_scene_layer = BLI_findlink(&scene->render_layers, node->custom1);
|
||||||
if (node_srl != srl) {
|
if (node_scene_layer != scene_layer) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,15 +221,15 @@ static void cmp_node_rlayer_create_outputs(bNodeTree *ntree, bNode *node, LinkNo
|
||||||
if (scene) {
|
if (scene) {
|
||||||
RenderEngineType *engine_type = RE_engines_find(scene->view_render.engine_id);
|
RenderEngineType *engine_type = RE_engines_find(scene->view_render.engine_id);
|
||||||
if (engine_type && engine_type->update_render_passes) {
|
if (engine_type && engine_type->update_render_passes) {
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, node->custom1);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, node->custom1);
|
||||||
if (srl) {
|
if (scene_layer) {
|
||||||
RLayerUpdateData *data = MEM_mallocN(sizeof(RLayerUpdateData), "render layer update data");
|
RLayerUpdateData *data = MEM_mallocN(sizeof(RLayerUpdateData), "render layer update data");
|
||||||
data->available_sockets = available_sockets;
|
data->available_sockets = available_sockets;
|
||||||
data->prev_index = -1;
|
data->prev_index = -1;
|
||||||
node->storage = data;
|
node->storage = data;
|
||||||
|
|
||||||
RenderEngine *engine = RE_engine_create(engine_type);
|
RenderEngine *engine = RE_engine_create(engine_type);
|
||||||
engine_type->update_render_passes(engine, scene, srl);
|
engine_type->update_render_passes(engine, scene, scene_layer);
|
||||||
RE_engine_free(engine);
|
RE_engine_free(engine);
|
||||||
|
|
||||||
MEM_freeN(data);
|
MEM_freeN(data);
|
||||||
|
|
|
@ -102,7 +102,7 @@ typedef struct RenderEngineType {
|
||||||
void (*render_to_view)(struct RenderEngine *engine, const struct bContext *context);
|
void (*render_to_view)(struct RenderEngine *engine, const struct bContext *context);
|
||||||
|
|
||||||
void (*update_script_node)(struct RenderEngine *engine, struct bNodeTree *ntree, struct bNode *node);
|
void (*update_script_node)(struct RenderEngine *engine, struct bNodeTree *ntree, struct bNode *node);
|
||||||
void (*update_render_passes)(struct RenderEngine *engine, struct Scene *scene, struct SceneRenderLayer *srl);
|
void (*update_render_passes)(struct RenderEngine *engine, struct Scene *scene, struct SceneLayer *scene_layer);
|
||||||
|
|
||||||
void (*collection_settings_create)(struct RenderEngine *engine, struct IDProperty *props);
|
void (*collection_settings_create)(struct RenderEngine *engine, struct IDProperty *props);
|
||||||
void (*render_settings_create)(struct RenderEngine *engine, struct IDProperty *props);
|
void (*render_settings_create)(struct RenderEngine *engine, struct IDProperty *props);
|
||||||
|
@ -174,7 +174,7 @@ bool RE_engine_is_external(struct Render *re);
|
||||||
|
|
||||||
void RE_engine_frame_set(struct RenderEngine *engine, int frame, float subframe);
|
void RE_engine_frame_set(struct RenderEngine *engine, int frame, float subframe);
|
||||||
|
|
||||||
void RE_engine_register_pass(struct RenderEngine *engine, struct Scene *scene, struct SceneRenderLayer *srl,
|
void RE_engine_register_pass(struct RenderEngine *engine, struct Scene *scene, struct SceneLayer *scene_layer,
|
||||||
const char *name, int channels, const char *chanid, int type);
|
const char *name, int channels, const char *chanid, int type);
|
||||||
|
|
||||||
/* Engine Types */
|
/* Engine Types */
|
||||||
|
|
|
@ -48,7 +48,7 @@ struct RenderData;
|
||||||
struct RenderResult;
|
struct RenderResult;
|
||||||
struct ReportList;
|
struct ReportList;
|
||||||
struct Scene;
|
struct Scene;
|
||||||
struct SceneRenderLayer;
|
struct SceneLayer;
|
||||||
struct EnvMap;
|
struct EnvMap;
|
||||||
struct StampData;
|
struct StampData;
|
||||||
struct ViewRender;
|
struct ViewRender;
|
||||||
|
@ -240,7 +240,8 @@ struct RenderPass *RE_create_gp_pass(struct RenderResult *rr, const char *layern
|
||||||
|
|
||||||
/* obligatory initialize call, disprect is optional */
|
/* obligatory initialize call, disprect is optional */
|
||||||
void RE_InitState(struct Render *re, struct Render *source, struct RenderData *rd,
|
void RE_InitState(struct Render *re, struct Render *source, struct RenderData *rd,
|
||||||
struct ViewRender *view_render, struct SceneRenderLayer *srl,
|
struct ListBase *render_layers, const int active_layer,
|
||||||
|
struct ViewRender *view_render, struct SceneLayer *scene_layer,
|
||||||
int winx, int winy, rcti *disprect);
|
int winx, int winy, rcti *disprect);
|
||||||
void RE_ChangeResolution(struct Render *re, int winx, int winy, rcti *disprect);
|
void RE_ChangeResolution(struct Render *re, int winx, int winy, rcti *disprect);
|
||||||
void RE_ChangeModeFlag(struct Render *re, int flag, bool clear);
|
void RE_ChangeModeFlag(struct Render *re, int flag, bool clear);
|
||||||
|
@ -289,7 +290,7 @@ bool RE_WriteRenderViewsMovie(
|
||||||
|
|
||||||
/* only RE_NewRender() needed, main Blender render calls */
|
/* only RE_NewRender() needed, main Blender render calls */
|
||||||
void RE_BlenderFrame(struct Render *re, struct Main *bmain, struct Scene *scene,
|
void RE_BlenderFrame(struct Render *re, struct Main *bmain, struct Scene *scene,
|
||||||
struct SceneRenderLayer *srl, struct Object *camera_override,
|
struct SceneLayer *scene_layer, struct Object *camera_override,
|
||||||
unsigned int lay_override, int frame, const bool write_still);
|
unsigned int lay_override, int frame, const bool write_still);
|
||||||
void RE_BlenderAnim(struct Render *re, struct Main *bmain, struct Scene *scene, struct Object *camera_override,
|
void RE_BlenderAnim(struct Render *re, struct Main *bmain, struct Scene *scene, struct Object *camera_override,
|
||||||
unsigned int lay_override, int sfra, int efra, int tfra);
|
unsigned int lay_override, int sfra, int efra, int tfra);
|
||||||
|
|
|
@ -192,6 +192,8 @@ struct Render {
|
||||||
struct Main *main;
|
struct Main *main;
|
||||||
Scene *scene;
|
Scene *scene;
|
||||||
RenderData r;
|
RenderData r;
|
||||||
|
ListBase render_layers;
|
||||||
|
int active_layer;
|
||||||
World wrld;
|
World wrld;
|
||||||
ViewRender view_render;
|
ViewRender view_render;
|
||||||
struct Object *camera_override;
|
struct Object *camera_override;
|
||||||
|
|
|
@ -83,7 +83,7 @@ void zbufshade_sss_tile(struct RenderPart *pa);
|
||||||
|
|
||||||
int get_sample_layers(struct RenderPart *pa, struct RenderLayer *rl, struct RenderLayer **rlpp);
|
int get_sample_layers(struct RenderPart *pa, struct RenderLayer *rl, struct RenderLayer **rlpp);
|
||||||
|
|
||||||
void render_internal_update_passes(struct RenderEngine *engine, struct Scene *scene, struct SceneRenderLayer *srl);
|
void render_internal_update_passes(struct RenderEngine *engine, struct Scene *scene, struct SceneLayer *scene_layer);
|
||||||
|
|
||||||
|
|
||||||
/* -------- ray.c ------- */
|
/* -------- ray.c ------- */
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#ifndef __RENDERPIPELINE_H__
|
#ifndef __RENDERPIPELINE_H__
|
||||||
#define __RENDERPIPELINE_H__
|
#define __RENDERPIPELINE_H__
|
||||||
|
|
||||||
|
struct ListBase;
|
||||||
struct Render;
|
struct Render;
|
||||||
struct RenderData;
|
struct RenderData;
|
||||||
struct RenderLayer;
|
struct RenderLayer;
|
||||||
|
@ -41,7 +42,7 @@ struct ViewRender;
|
||||||
|
|
||||||
struct RenderLayer *render_get_active_layer(struct Render *re, struct RenderResult *rr);
|
struct RenderLayer *render_get_active_layer(struct Render *re, struct RenderResult *rr);
|
||||||
float panorama_pixel_rot(struct Render *re);
|
float panorama_pixel_rot(struct Render *re);
|
||||||
void render_update_anim_renderdata(struct Render *re, struct RenderData *rd);
|
void render_update_anim_renderdata(struct Render *re, struct RenderData *rd, struct ListBase *render_layers);
|
||||||
void render_copy_renderdata(struct RenderData *to, struct RenderData *from);
|
void render_copy_renderdata(struct RenderData *to, struct RenderData *from);
|
||||||
void render_copy_viewrender(struct ViewRender *to, struct ViewRender *from);
|
void render_copy_viewrender(struct ViewRender *to, struct ViewRender *from);
|
||||||
|
|
||||||
|
|
|
@ -5203,7 +5203,7 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l
|
||||||
/* applies changes fully */
|
/* applies changes fully */
|
||||||
if ((re->r.scemode & (R_NO_FRAME_UPDATE|R_BUTS_PREVIEW|R_VIEWPORT_PREVIEW))==0) {
|
if ((re->r.scemode & (R_NO_FRAME_UPDATE|R_BUTS_PREVIEW|R_VIEWPORT_PREVIEW))==0) {
|
||||||
BKE_scene_graph_update_for_newframe(re->eval_ctx, re->depsgraph, re->main, re->scene, NULL);
|
BKE_scene_graph_update_for_newframe(re->eval_ctx, re->depsgraph, re->main, re->scene, NULL);
|
||||||
render_update_anim_renderdata(re, &re->scene->r);
|
render_update_anim_renderdata(re, &re->scene->r, &re->scene->render_layers);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if no camera, viewmat should have been set! */
|
/* if no camera, viewmat should have been set! */
|
||||||
|
|
|
@ -143,7 +143,7 @@ static Render *envmap_render_copy(Render *re, EnvMap *env)
|
||||||
|
|
||||||
/* set up renderdata */
|
/* set up renderdata */
|
||||||
envre->r.mode &= ~(R_BORDER | R_PANORAMA | R_ORTHO | R_MBLUR);
|
envre->r.mode &= ~(R_BORDER | R_PANORAMA | R_ORTHO | R_MBLUR);
|
||||||
BLI_freelistN(&envre->r.layers);
|
BLI_freelistN(&envre->render_layers);
|
||||||
BLI_freelistN(&envre->r.views);
|
BLI_freelistN(&envre->r.views);
|
||||||
envre->r.filtertype = 0;
|
envre->r.filtertype = 0;
|
||||||
envre->r.tilex = envre->r.xsch / 2;
|
envre->r.tilex = envre->r.xsch / 2;
|
||||||
|
@ -151,7 +151,7 @@ static Render *envmap_render_copy(Render *re, EnvMap *env)
|
||||||
envre->r.size = 100;
|
envre->r.size = 100;
|
||||||
envre->r.yasp = envre->r.xasp = 1;
|
envre->r.yasp = envre->r.xasp = 1;
|
||||||
|
|
||||||
RE_InitState(envre, NULL, &envre->r, &envre->view_render, NULL, cuberes, cuberes, NULL);
|
RE_InitState(envre, NULL, &envre->r, &re->render_layers, re->active_layer, &envre->view_render, NULL, cuberes, cuberes, NULL);
|
||||||
envre->main = re->main;
|
envre->main = re->main;
|
||||||
envre->scene = re->scene; /* unsure about this... */
|
envre->scene = re->scene; /* unsure about this... */
|
||||||
envre->scene_color_manage = re->scene_color_manage;
|
envre->scene_color_manage = re->scene_color_manage;
|
||||||
|
|
|
@ -658,7 +658,7 @@ int RE_engine_render(Render *re, int do_all)
|
||||||
* creating the render result */
|
* creating the render result */
|
||||||
if ((re->r.scemode & (R_NO_FRAME_UPDATE | R_BUTS_PREVIEW)) == 0) {
|
if ((re->r.scemode & (R_NO_FRAME_UPDATE | R_BUTS_PREVIEW)) == 0) {
|
||||||
BKE_scene_graph_update_for_newframe(re->eval_ctx, re->depsgraph, re->main, re->scene, NULL);
|
BKE_scene_graph_update_for_newframe(re->eval_ctx, re->depsgraph, re->main, re->scene, NULL);
|
||||||
render_update_anim_renderdata(re, &re->scene->r);
|
render_update_anim_renderdata(re, &re->scene->r, &re->scene->render_layers);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create render result */
|
/* create render result */
|
||||||
|
@ -777,12 +777,12 @@ int RE_engine_render(Render *re, int do_all)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RE_engine_register_pass(struct RenderEngine *engine, struct Scene *scene, struct SceneRenderLayer *srl,
|
void RE_engine_register_pass(struct RenderEngine *engine, struct Scene *scene, struct SceneLayer *scene_layer,
|
||||||
const char *name, int UNUSED(channels), const char *UNUSED(chanid), int type)
|
const char *name, int UNUSED(channels), const char *UNUSED(chanid), int type)
|
||||||
{
|
{
|
||||||
/* The channel information is currently not used, but is part of the API in case it's needed in the future. */
|
/* The channel information is currently not used, but is part of the API in case it's needed in the future. */
|
||||||
|
|
||||||
if (!(scene && srl && engine)) {
|
if (!(scene && scene_layer && engine)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -792,7 +792,7 @@ void RE_engine_register_pass(struct RenderEngine *engine, struct Scene *scene, s
|
||||||
Scene *sce;
|
Scene *sce;
|
||||||
for (sce = G.main->scene.first; sce; sce = sce->id.next) {
|
for (sce = G.main->scene.first; sce; sce = sce->id.next) {
|
||||||
if (sce->nodetree) {
|
if (sce->nodetree) {
|
||||||
ntreeCompositRegisterPass(sce->nodetree, scene, srl, name, type);
|
ntreeCompositRegisterPass(sce->nodetree, scene, scene_layer, name, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,7 +264,7 @@ RenderResult *RE_MultilayerConvert(void *exrhandle, const char *colorspace, bool
|
||||||
|
|
||||||
RenderLayer *render_get_active_layer(Render *re, RenderResult *rr)
|
RenderLayer *render_get_active_layer(Render *re, RenderResult *rr)
|
||||||
{
|
{
|
||||||
RenderLayer *rl = BLI_findlink(&rr->layers, re->r.actlay);
|
RenderLayer *rl = BLI_findlink(&rr->layers, re->active_layer);
|
||||||
|
|
||||||
if (rl)
|
if (rl)
|
||||||
return rl;
|
return rl;
|
||||||
|
@ -274,21 +274,21 @@ RenderLayer *render_get_active_layer(Render *re, RenderResult *rr)
|
||||||
|
|
||||||
static int render_scene_needs_vector(Render *re)
|
static int render_scene_needs_vector(Render *re)
|
||||||
{
|
{
|
||||||
SceneRenderLayer *srl;
|
SceneLayer *scene_layer;
|
||||||
|
for (scene_layer = re->render_layers.first; scene_layer; scene_layer = scene_layer->next)
|
||||||
for (srl = re->r.layers.first; srl; srl = srl->next)
|
if (scene_layer->flag & SCENE_LAYER_RENDER) {
|
||||||
if (!(srl->layflag & SCE_LAY_DISABLE))
|
if (scene_layer->passflag & SCE_PASS_VECTOR) {
|
||||||
if (srl->passflag & SCE_PASS_VECTOR)
|
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool render_scene_has_layers_to_render(Scene *scene)
|
static bool render_scene_has_layers_to_render(Scene *scene)
|
||||||
{
|
{
|
||||||
SceneRenderLayer *srl;
|
SceneLayer *scene_layer;
|
||||||
for (srl = scene->r.layers.first; srl; srl = srl->next) {
|
for (scene_layer = scene->render_layers.first; scene_layer; scene_layer = scene_layer->next) {
|
||||||
if (!(srl->layflag & SCE_LAY_DISABLE)) {
|
if (scene_layer->flag & SCENE_LAYER_RENDER) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -584,7 +584,7 @@ void RE_FreeRender(Render *re)
|
||||||
BLI_rw_mutex_end(&re->resultmutex);
|
BLI_rw_mutex_end(&re->resultmutex);
|
||||||
BLI_rw_mutex_end(&re->partsmutex);
|
BLI_rw_mutex_end(&re->partsmutex);
|
||||||
|
|
||||||
BLI_freelistN(&re->r.layers);
|
BLI_freelistN(&re->render_layers);
|
||||||
BLI_freelistN(&re->r.views);
|
BLI_freelistN(&re->r.views);
|
||||||
|
|
||||||
curvemapping_free_data(&re->r.mblur_shutter_curve);
|
curvemapping_free_data(&re->r.mblur_shutter_curve);
|
||||||
|
@ -730,13 +730,11 @@ static void re_init_resolution(Render *re, Render *source,
|
||||||
|
|
||||||
void render_copy_renderdata(RenderData *to, RenderData *from)
|
void render_copy_renderdata(RenderData *to, RenderData *from)
|
||||||
{
|
{
|
||||||
BLI_freelistN(&to->layers);
|
|
||||||
BLI_freelistN(&to->views);
|
BLI_freelistN(&to->views);
|
||||||
curvemapping_free_data(&to->mblur_shutter_curve);
|
curvemapping_free_data(&to->mblur_shutter_curve);
|
||||||
|
|
||||||
*to = *from;
|
*to = *from;
|
||||||
|
|
||||||
BLI_duplicatelist(&to->layers, &from->layers);
|
|
||||||
BLI_duplicatelist(&to->views, &from->views);
|
BLI_duplicatelist(&to->views, &from->views);
|
||||||
curvemapping_copy_data(&to->mblur_shutter_curve, &from->mblur_shutter_curve);
|
curvemapping_copy_data(&to->mblur_shutter_curve, &from->mblur_shutter_curve);
|
||||||
}
|
}
|
||||||
|
@ -749,7 +747,8 @@ void render_copy_viewrender(ViewRender *to, ViewRender *from)
|
||||||
/* what doesn't change during entire render sequence */
|
/* what doesn't change during entire render sequence */
|
||||||
/* disprect is optional, if NULL it assumes full window render */
|
/* disprect is optional, if NULL it assumes full window render */
|
||||||
void RE_InitState(Render *re, Render *source, RenderData *rd,
|
void RE_InitState(Render *re, Render *source, RenderData *rd,
|
||||||
ViewRender *view_render, SceneRenderLayer *srl,
|
ListBase *render_layers, const int active_layer,
|
||||||
|
ViewRender *view_render, SceneLayer *scene_layer,
|
||||||
int winx, int winy, rcti *disprect)
|
int winx, int winy, rcti *disprect)
|
||||||
{
|
{
|
||||||
bool had_freestyle = (re->r.mode & R_EDGE_FRS) != 0;
|
bool had_freestyle = (re->r.mode & R_EDGE_FRS) != 0;
|
||||||
|
@ -761,6 +760,9 @@ void RE_InitState(Render *re, Render *source, RenderData *rd,
|
||||||
/* copy render data and render layers for thread safety */
|
/* copy render data and render layers for thread safety */
|
||||||
render_copy_renderdata(&re->r, rd);
|
render_copy_renderdata(&re->r, rd);
|
||||||
render_copy_viewrender(&re->view_render, view_render);
|
render_copy_viewrender(&re->view_render, view_render);
|
||||||
|
BLI_freelistN(&re->render_layers);
|
||||||
|
BLI_duplicatelist(&re->render_layers, render_layers);
|
||||||
|
re->active_layer = active_layer;
|
||||||
|
|
||||||
if (source) {
|
if (source) {
|
||||||
/* reuse border flags from source renderer */
|
/* reuse border flags from source renderer */
|
||||||
|
@ -809,10 +811,10 @@ void RE_InitState(Render *re, Render *source, RenderData *rd,
|
||||||
else re->osa = 0;
|
else re->osa = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (srl) {
|
if (scene_layer) {
|
||||||
int index = BLI_findindex(&rd->layers, srl);
|
int index = BLI_findindex(render_layers, scene_layer);
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
re->r.actlay = index;
|
re->active_layer = index;
|
||||||
re->r.scemode |= R_SINGLE_LAYER;
|
re->r.scemode |= R_SINGLE_LAYER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -830,12 +832,12 @@ void RE_InitState(Render *re, Render *source, RenderData *rd,
|
||||||
re->result = NULL;
|
re->result = NULL;
|
||||||
}
|
}
|
||||||
else if (re->result) {
|
else if (re->result) {
|
||||||
SceneRenderLayer *actsrl = BLI_findlink(&re->r.layers, re->r.actlay);
|
SceneLayer *active_render_layer = BLI_findlink(&re->render_layers, re->active_layer);
|
||||||
RenderLayer *rl;
|
RenderLayer *rl;
|
||||||
bool have_layer = false;
|
bool have_layer = false;
|
||||||
|
|
||||||
for (rl = re->result->layers.first; rl; rl = rl->next)
|
for (rl = re->result->layers.first; rl; rl = rl->next)
|
||||||
if (STREQ(rl->name, actsrl->name))
|
if (STREQ(rl->name, active_render_layer->name))
|
||||||
have_layer = true;
|
have_layer = true;
|
||||||
|
|
||||||
if (re->result->rectx == re->rectx && re->result->recty == re->recty &&
|
if (re->result->rectx == re->rectx && re->result->recty == re->recty &&
|
||||||
|
@ -960,7 +962,7 @@ void RE_ChangeModeFlag(Render *re, int flag, bool clear)
|
||||||
|
|
||||||
/* update some variables that can be animated, and otherwise wouldn't be due to
|
/* update some variables that can be animated, and otherwise wouldn't be due to
|
||||||
* RenderData getting copied once at the start of animation render */
|
* RenderData getting copied once at the start of animation render */
|
||||||
void render_update_anim_renderdata(Render *re, RenderData *rd)
|
void render_update_anim_renderdata(Render *re, RenderData *rd, ListBase *render_layers)
|
||||||
{
|
{
|
||||||
/* filter */
|
/* filter */
|
||||||
re->r.gauss = rd->gauss;
|
re->r.gauss = rd->gauss;
|
||||||
|
@ -974,8 +976,8 @@ void render_update_anim_renderdata(Render *re, RenderData *rd)
|
||||||
re->r.unit_line_thickness = rd->unit_line_thickness;
|
re->r.unit_line_thickness = rd->unit_line_thickness;
|
||||||
|
|
||||||
/* render layers */
|
/* render layers */
|
||||||
BLI_freelistN(&re->r.layers);
|
BLI_freelistN(&re->render_layers);
|
||||||
BLI_duplicatelist(&re->r.layers, &rd->layers);
|
BLI_duplicatelist(&re->render_layers, render_layers);
|
||||||
|
|
||||||
/* render views */
|
/* render views */
|
||||||
BLI_freelistN(&re->r.views);
|
BLI_freelistN(&re->r.views);
|
||||||
|
@ -1977,7 +1979,7 @@ static void render_scene(Render *re, Scene *sce, int cfra)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initial setup */
|
/* initial setup */
|
||||||
RE_InitState(resc, re, &sce->r, &sce->view_render, NULL, winx, winy, &re->disprect);
|
RE_InitState(resc, re, &sce->r, &sce->render_layers, sce->active_layer, &sce->view_render, NULL, winx, winy, &re->disprect);
|
||||||
|
|
||||||
/* We still want to use 'rendercache' setting from org (main) scene... */
|
/* We still want to use 'rendercache' setting from org (main) scene... */
|
||||||
resc->r.scemode = (resc->r.scemode & ~R_EXR_CACHE_FILE) | (re->r.scemode & R_EXR_CACHE_FILE);
|
resc->r.scemode = (resc->r.scemode & ~R_EXR_CACHE_FILE) | (re->r.scemode & R_EXR_CACHE_FILE);
|
||||||
|
@ -2248,24 +2250,24 @@ static void init_freestyle(Render *re)
|
||||||
/* invokes Freestyle stroke rendering */
|
/* invokes Freestyle stroke rendering */
|
||||||
static void add_freestyle(Render *re, int render)
|
static void add_freestyle(Render *re, int render)
|
||||||
{
|
{
|
||||||
SceneRenderLayer *srl, *actsrl;
|
SceneLayer *scene_layer, *active_render_layer;
|
||||||
LinkData *link;
|
LinkData *link;
|
||||||
Render *r;
|
Render *r;
|
||||||
const bool do_link = (re->r.mode & R_MBLUR) == 0 || re->i.curblur == re->r.mblur_samples;
|
const bool do_link = (re->r.mode & R_MBLUR) == 0 || re->i.curblur == re->r.mblur_samples;
|
||||||
|
|
||||||
actsrl = BLI_findlink(&re->r.layers, re->r.actlay);
|
active_render_layer = BLI_findlink(&re->render_layers, re->active_layer);
|
||||||
|
|
||||||
FRS_begin_stroke_rendering(re);
|
FRS_begin_stroke_rendering(re);
|
||||||
|
|
||||||
for (srl = (SceneRenderLayer *)re->r.layers.first; srl; srl = srl->next) {
|
for (scene_layer = (SceneLayer *)re->render_layers.first; scene_layer; scene_layer = scene_layer->next) {
|
||||||
if (do_link) {
|
if (do_link) {
|
||||||
link = (LinkData *)MEM_callocN(sizeof(LinkData), "LinkData to Freestyle render");
|
link = (LinkData *)MEM_callocN(sizeof(LinkData), "LinkData to Freestyle render");
|
||||||
BLI_addtail(&re->freestyle_renders, link);
|
BLI_addtail(&re->freestyle_renders, link);
|
||||||
}
|
}
|
||||||
if ((re->r.scemode & R_SINGLE_LAYER) && srl != actsrl)
|
if ((re->r.scemode & R_SINGLE_LAYER) && scene_layer != active_render_layer)
|
||||||
continue;
|
continue;
|
||||||
if (FRS_is_freestyle_enabled(srl)) {
|
if (FRS_is_freestyle_enabled(scene_layer)) {
|
||||||
r = FRS_do_stroke_rendering(re, srl, render);
|
r = FRS_do_stroke_rendering(re, scene_layer, render);
|
||||||
if (do_link)
|
if (do_link)
|
||||||
link->data = (void *)r;
|
link->data = (void *)r;
|
||||||
}
|
}
|
||||||
|
@ -2282,25 +2284,25 @@ static void composite_freestyle_renders(Render *re, int sample)
|
||||||
{
|
{
|
||||||
Render *freestyle_render;
|
Render *freestyle_render;
|
||||||
RenderView *rv;
|
RenderView *rv;
|
||||||
SceneRenderLayer *srl, *actsrl;
|
SceneLayer *scene_layer, *active_scene_layer;
|
||||||
LinkData *link;
|
LinkData *link;
|
||||||
|
|
||||||
actsrl = BLI_findlink(&re->r.layers, re->r.actlay);
|
active_scene_layer = BLI_findlink(&re->render_layers, re->active_layer);
|
||||||
|
|
||||||
link = (LinkData *)re->freestyle_renders.first;
|
link = (LinkData *)re->freestyle_renders.first;
|
||||||
|
|
||||||
for (rv = re->result->views.first; rv; rv = rv->next) {
|
for (rv = re->result->views.first; rv; rv = rv->next) {
|
||||||
for (srl = (SceneRenderLayer *)re->r.layers.first; srl; srl = srl->next) {
|
for (scene_layer = (SceneLayer *)re->render_layers.first; scene_layer; scene_layer = scene_layer->next) {
|
||||||
if ((re->r.scemode & R_SINGLE_LAYER) && srl != actsrl)
|
if ((re->r.scemode & R_SINGLE_LAYER) && scene_layer != active_scene_layer)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (FRS_is_freestyle_enabled(srl)) {
|
if (FRS_is_freestyle_enabled(scene_layer)) {
|
||||||
freestyle_render = (Render *)link->data;
|
freestyle_render = (Render *)link->data;
|
||||||
|
|
||||||
/* may be NULL in case of empty render layer */
|
/* may be NULL in case of empty render layer */
|
||||||
if (freestyle_render) {
|
if (freestyle_render) {
|
||||||
render_result_exr_file_read_sample(freestyle_render, sample);
|
render_result_exr_file_read_sample(freestyle_render, sample);
|
||||||
FRS_composite_result(re, srl, freestyle_render);
|
FRS_composite_result(re, scene_layer, freestyle_render);
|
||||||
RE_FreeRenderResult(freestyle_render->result);
|
RE_FreeRenderResult(freestyle_render->result);
|
||||||
freestyle_render->result = NULL;
|
freestyle_render->result = NULL;
|
||||||
}
|
}
|
||||||
|
@ -2880,10 +2882,10 @@ bool RE_force_single_renderlayer(Scene *scene)
|
||||||
{
|
{
|
||||||
int scemode = check_mode_full_sample(&scene->r, &scene->view_render);
|
int scemode = check_mode_full_sample(&scene->r, &scene->view_render);
|
||||||
if (scemode & R_SINGLE_LAYER) {
|
if (scemode & R_SINGLE_LAYER) {
|
||||||
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
SceneLayer *scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer);
|
||||||
/* force layer to be enabled */
|
/* force layer to be enabled */
|
||||||
if (srl->layflag & SCE_LAY_DISABLE) {
|
if ((scene_layer->flag & SCENE_LAYER_RENDER) == 0) {
|
||||||
srl->layflag &= ~SCE_LAY_DISABLE;
|
scene_layer->flag |= SCENE_LAYER_RENDER;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3174,7 +3176,7 @@ void RE_SetEngineByID(Render *re, const char *engine_id)
|
||||||
|
|
||||||
/* evaluating scene options for general Blender render */
|
/* evaluating scene options for general Blender render */
|
||||||
static int render_initialize_from_main(Render *re, RenderData *rd, Main *bmain, Scene *scene, ViewRender *view_render,
|
static int render_initialize_from_main(Render *re, RenderData *rd, Main *bmain, Scene *scene, ViewRender *view_render,
|
||||||
SceneRenderLayer *srl, Object *camera_override, unsigned int lay_override,
|
SceneLayer *scene_layer, Object *camera_override, unsigned int lay_override,
|
||||||
int anim, int anim_init)
|
int anim, int anim_init)
|
||||||
{
|
{
|
||||||
int winx, winy;
|
int winx, winy;
|
||||||
|
@ -3213,7 +3215,7 @@ static int render_initialize_from_main(Render *re, RenderData *rd, Main *bmain,
|
||||||
|
|
||||||
/* not too nice, but it survives anim-border render */
|
/* not too nice, but it survives anim-border render */
|
||||||
if (anim) {
|
if (anim) {
|
||||||
render_update_anim_renderdata(re, &scene->r);
|
render_update_anim_renderdata(re, &scene->r, &scene->render_layers);
|
||||||
re->disprect = disprect;
|
re->disprect = disprect;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -3228,17 +3230,17 @@ static int render_initialize_from_main(Render *re, RenderData *rd, Main *bmain,
|
||||||
*/
|
*/
|
||||||
if (0) {
|
if (0) {
|
||||||
/* make sure dynamics are up to date */
|
/* make sure dynamics are up to date */
|
||||||
SceneLayer *scene_layer = BKE_scene_layer_from_scene_get(scene);
|
scene_layer = BKE_scene_layer_from_scene_get(scene);
|
||||||
update_physics_cache(re, scene, scene_layer, anim_init);
|
update_physics_cache(re, scene, scene_layer, anim_init);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (srl || scene->r.scemode & R_SINGLE_LAYER) {
|
if (scene_layer || scene->r.scemode & R_SINGLE_LAYER) {
|
||||||
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
||||||
render_result_single_layer_begin(re);
|
render_result_single_layer_begin(re);
|
||||||
BLI_rw_mutex_unlock(&re->resultmutex);
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
RE_InitState(re, NULL, &scene->r, &scene->view_render, srl, winx, winy, &disprect);
|
RE_InitState(re, NULL, &scene->r, &scene->render_layers, scene->active_layer, &scene->view_render, scene_layer, winx, winy, &disprect);
|
||||||
if (!re->ok) /* if an error was printed, abort */
|
if (!re->ok) /* if an error was printed, abort */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -3259,7 +3261,7 @@ void RE_SetReports(Render *re, ReportList *reports)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* general Blender frame render call */
|
/* general Blender frame render call */
|
||||||
void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *srl, Object *camera_override,
|
void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneLayer *scene_layer, Object *camera_override,
|
||||||
unsigned int lay_override, int frame, const bool write_still)
|
unsigned int lay_override, int frame, const bool write_still)
|
||||||
{
|
{
|
||||||
BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_INIT);
|
BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_INIT);
|
||||||
|
@ -3269,7 +3271,7 @@ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *sr
|
||||||
|
|
||||||
scene->r.cfra = frame;
|
scene->r.cfra = frame;
|
||||||
|
|
||||||
if (render_initialize_from_main(re, &scene->r, bmain, scene, &scene->view_render, srl,
|
if (render_initialize_from_main(re, &scene->r, bmain, scene, &scene->view_render, scene_layer,
|
||||||
camera_override, lay_override, 0, 0))
|
camera_override, lay_override, 0, 0))
|
||||||
{
|
{
|
||||||
MEM_reset_peak_memory();
|
MEM_reset_peak_memory();
|
||||||
|
@ -3855,7 +3857,7 @@ void RE_PreviewRender(Render *re, Main *bmain, Scene *sce, ViewRender *view_rend
|
||||||
winx = (sce->r.size * sce->r.xsch) / 100;
|
winx = (sce->r.size * sce->r.xsch) / 100;
|
||||||
winy = (sce->r.size * sce->r.ysch) / 100;
|
winy = (sce->r.size * sce->r.ysch) / 100;
|
||||||
|
|
||||||
RE_InitState(re, NULL, &sce->r, view_render, NULL, winx, winy, NULL);
|
RE_InitState(re, NULL, &sce->r, &sce->render_layers, sce->active_layer, view_render, NULL, winx, winy, NULL);
|
||||||
|
|
||||||
re->pool = BKE_image_pool_new();
|
re->pool = BKE_image_pool_new();
|
||||||
|
|
||||||
|
@ -3910,7 +3912,7 @@ bool RE_ReadRenderResult(Scene *scene, Scene *scenode)
|
||||||
re = RE_GetSceneRender(scene);
|
re = RE_GetSceneRender(scene);
|
||||||
if (re == NULL)
|
if (re == NULL)
|
||||||
re = RE_NewSceneRender(scene);
|
re = RE_NewSceneRender(scene);
|
||||||
RE_InitState(re, NULL, &scene->r, &scene->view_render, NULL, winx, winy, &disprect);
|
RE_InitState(re, NULL, &scene->r, &scene->render_layers, scene->active_layer, &scene->view_render, NULL, winx, winy, &disprect);
|
||||||
re->scene = scene;
|
re->scene = scene;
|
||||||
re->scene_color_manage = BKE_scene_check_color_management_enabled(scene);
|
re->scene_color_manage = BKE_scene_check_color_management_enabled(scene);
|
||||||
|
|
||||||
|
|
|
@ -264,7 +264,7 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf
|
||||||
RenderResult *rr;
|
RenderResult *rr;
|
||||||
RenderLayer *rl;
|
RenderLayer *rl;
|
||||||
RenderView *rv;
|
RenderView *rv;
|
||||||
SceneRenderLayer *srl;
|
SceneLayer *scene_layer;
|
||||||
int rectx, recty;
|
int rectx, recty;
|
||||||
int nr;
|
int nr;
|
||||||
|
|
||||||
|
@ -294,27 +294,30 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf
|
||||||
render_result_views_new(rr, &re->r);
|
render_result_views_new(rr, &re->r);
|
||||||
|
|
||||||
/* check renderdata for amount of layers */
|
/* check renderdata for amount of layers */
|
||||||
for (nr = 0, srl = re->r.layers.first; srl; srl = srl->next, nr++) {
|
for (nr = 0, scene_layer = re->render_layers.first; scene_layer; scene_layer = scene_layer->next, nr++) {
|
||||||
|
|
||||||
if (layername && layername[0])
|
if (layername && layername[0])
|
||||||
if (!STREQ(srl->name, layername))
|
if (!STREQ(scene_layer->name, layername))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (re->r.scemode & R_SINGLE_LAYER) {
|
if (re->r.scemode & R_SINGLE_LAYER) {
|
||||||
if (nr != re->r.actlay)
|
if (nr != re->active_layer) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (srl->layflag & SCE_LAY_DISABLE)
|
if ((scene_layer->flag & SCENE_LAYER_RENDER) == 0) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rl = MEM_callocN(sizeof(RenderLayer), "new render layer");
|
rl = MEM_callocN(sizeof(RenderLayer), "new render layer");
|
||||||
BLI_addtail(&rr->layers, rl);
|
BLI_addtail(&rr->layers, rl);
|
||||||
|
|
||||||
BLI_strncpy(rl->name, srl->name, sizeof(rl->name));
|
BLI_strncpy(rl->name, scene_layer->name, sizeof(rl->name));
|
||||||
rl->passflag = srl->passflag; /* for debugging: srl->passflag | SCE_PASS_RAYHITS; */
|
rl->layflag = scene_layer->layflag;
|
||||||
rl->pass_xor = srl->pass_xor;
|
rl->passflag = scene_layer->passflag; /* for debugging: scene_layer->passflag | SCE_PASS_RAYHITS; */
|
||||||
|
rl->pass_xor = scene_layer->pass_xor;
|
||||||
rl->rectx = rectx;
|
rl->rectx = rectx;
|
||||||
rl->recty = recty;
|
rl->recty = recty;
|
||||||
|
|
||||||
|
@ -349,65 +352,65 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf
|
||||||
/* a renderlayer should always have a Combined pass*/
|
/* a renderlayer should always have a Combined pass*/
|
||||||
render_layer_add_pass(rr, rl, 4, "Combined", view, "RGBA");
|
render_layer_add_pass(rr, rl, 4, "Combined", view, "RGBA");
|
||||||
|
|
||||||
if (srl->passflag & SCE_PASS_Z)
|
if (scene_layer->passflag & SCE_PASS_Z)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 1, RE_PASSNAME_Z, view, "Z");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 1, RE_PASSNAME_Z, view, "Z");
|
||||||
if (srl->passflag & SCE_PASS_VECTOR)
|
if (scene_layer->passflag & SCE_PASS_VECTOR)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 4, RE_PASSNAME_VECTOR, view, "XYZW");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 4, RE_PASSNAME_VECTOR, view, "XYZW");
|
||||||
if (srl->passflag & SCE_PASS_NORMAL)
|
if (scene_layer->passflag & SCE_PASS_NORMAL)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_NORMAL, view, "XYZ");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_NORMAL, view, "XYZ");
|
||||||
if (srl->passflag & SCE_PASS_UV)
|
if (scene_layer->passflag & SCE_PASS_UV)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_UV, view, "UVA");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_UV, view, "UVA");
|
||||||
if (srl->passflag & SCE_PASS_RGBA)
|
if (scene_layer->passflag & SCE_PASS_RGBA)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 4, RE_PASSNAME_RGBA, view, "RGBA");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 4, RE_PASSNAME_RGBA, view, "RGBA");
|
||||||
if (srl->passflag & SCE_PASS_EMIT)
|
if (scene_layer->passflag & SCE_PASS_EMIT)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_EMIT, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_EMIT, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_DIFFUSE)
|
if (scene_layer->passflag & SCE_PASS_DIFFUSE)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_DIFFUSE, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_DIFFUSE, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_SPEC)
|
if (scene_layer->passflag & SCE_PASS_SPEC)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SPEC, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SPEC, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_AO)
|
if (scene_layer->passflag & SCE_PASS_AO)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_AO, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_AO, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_ENVIRONMENT)
|
if (scene_layer->passflag & SCE_PASS_ENVIRONMENT)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_ENVIRONMENT, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_ENVIRONMENT, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_INDIRECT)
|
if (scene_layer->passflag & SCE_PASS_INDIRECT)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_INDIRECT, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_INDIRECT, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_SHADOW)
|
if (scene_layer->passflag & SCE_PASS_SHADOW)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SHADOW, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SHADOW, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_REFLECT)
|
if (scene_layer->passflag & SCE_PASS_REFLECT)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_REFLECT, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_REFLECT, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_REFRACT)
|
if (scene_layer->passflag & SCE_PASS_REFRACT)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_REFRACT, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_REFRACT, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_INDEXOB)
|
if (scene_layer->passflag & SCE_PASS_INDEXOB)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 1, RE_PASSNAME_INDEXOB, view, "X");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 1, RE_PASSNAME_INDEXOB, view, "X");
|
||||||
if (srl->passflag & SCE_PASS_INDEXMA)
|
if (scene_layer->passflag & SCE_PASS_INDEXMA)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 1, RE_PASSNAME_INDEXMA, view, "X");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 1, RE_PASSNAME_INDEXMA, view, "X");
|
||||||
if (srl->passflag & SCE_PASS_MIST)
|
if (scene_layer->passflag & SCE_PASS_MIST)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 1, RE_PASSNAME_MIST, view, "Z");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 1, RE_PASSNAME_MIST, view, "Z");
|
||||||
if (rl->passflag & SCE_PASS_RAYHITS)
|
if (rl->passflag & SCE_PASS_RAYHITS)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 4, RE_PASSNAME_RAYHITS, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 4, RE_PASSNAME_RAYHITS, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_DIFFUSE_DIRECT)
|
if (scene_layer->passflag & SCE_PASS_DIFFUSE_DIRECT)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_DIFFUSE_DIRECT, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_DIFFUSE_DIRECT, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_DIFFUSE_INDIRECT)
|
if (scene_layer->passflag & SCE_PASS_DIFFUSE_INDIRECT)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_DIFFUSE_INDIRECT, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_DIFFUSE_INDIRECT, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_DIFFUSE_COLOR)
|
if (scene_layer->passflag & SCE_PASS_DIFFUSE_COLOR)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_DIFFUSE_COLOR, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_DIFFUSE_COLOR, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_GLOSSY_DIRECT)
|
if (scene_layer->passflag & SCE_PASS_GLOSSY_DIRECT)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_GLOSSY_DIRECT, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_GLOSSY_DIRECT, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_GLOSSY_INDIRECT)
|
if (scene_layer->passflag & SCE_PASS_GLOSSY_INDIRECT)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_GLOSSY_INDIRECT, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_GLOSSY_INDIRECT, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_GLOSSY_COLOR)
|
if (scene_layer->passflag & SCE_PASS_GLOSSY_COLOR)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_GLOSSY_COLOR, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_GLOSSY_COLOR, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_TRANSM_DIRECT)
|
if (scene_layer->passflag & SCE_PASS_TRANSM_DIRECT)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_TRANSM_DIRECT, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_TRANSM_DIRECT, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_TRANSM_INDIRECT)
|
if (scene_layer->passflag & SCE_PASS_TRANSM_INDIRECT)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_TRANSM_INDIRECT, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_TRANSM_INDIRECT, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_TRANSM_COLOR)
|
if (scene_layer->passflag & SCE_PASS_TRANSM_COLOR)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_TRANSM_COLOR, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_TRANSM_COLOR, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_SUBSURFACE_DIRECT)
|
if (scene_layer->passflag & SCE_PASS_SUBSURFACE_DIRECT)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SUBSURFACE_DIRECT, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SUBSURFACE_DIRECT, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_SUBSURFACE_INDIRECT)
|
if (scene_layer->passflag & SCE_PASS_SUBSURFACE_INDIRECT)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SUBSURFACE_INDIRECT, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SUBSURFACE_INDIRECT, view, "RGB");
|
||||||
if (srl->passflag & SCE_PASS_SUBSURFACE_COLOR)
|
if (scene_layer->passflag & SCE_PASS_SUBSURFACE_COLOR)
|
||||||
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SUBSURFACE_COLOR, view, "RGB");
|
RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_SUBSURFACE_COLOR, view, "RGB");
|
||||||
#undef RENDER_LAYER_ADD_PASS_SAFE
|
#undef RENDER_LAYER_ADD_PASS_SAFE
|
||||||
}
|
}
|
||||||
|
@ -444,7 +447,7 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf
|
||||||
rl->layflag = 0x7FFF; /* solid ztra halo strand */
|
rl->layflag = 0x7FFF; /* solid ztra halo strand */
|
||||||
rl->passflag = SCE_PASS_COMBINED;
|
rl->passflag = SCE_PASS_COMBINED;
|
||||||
|
|
||||||
re->r.actlay = 0;
|
re->active_layer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* border render; calculate offset for use in compositor. compo is centralized coords */
|
/* border render; calculate offset for use in compositor. compo is centralized coords */
|
||||||
|
@ -975,7 +978,7 @@ void render_result_single_layer_begin(Render *re)
|
||||||
/* if scemode is R_SINGLE_LAYER, at end of rendering, merge the both render results */
|
/* if scemode is R_SINGLE_LAYER, at end of rendering, merge the both render results */
|
||||||
void render_result_single_layer_end(Render *re)
|
void render_result_single_layer_end(Render *re)
|
||||||
{
|
{
|
||||||
SceneRenderLayer *srl;
|
SceneLayer *scene_layer;
|
||||||
RenderLayer *rlpush;
|
RenderLayer *rlpush;
|
||||||
RenderLayer *rl;
|
RenderLayer *rl;
|
||||||
int nr;
|
int nr;
|
||||||
|
@ -996,12 +999,12 @@ void render_result_single_layer_end(Render *re)
|
||||||
BLI_remlink(&re->result->layers, rl);
|
BLI_remlink(&re->result->layers, rl);
|
||||||
|
|
||||||
/* reconstruct render result layers */
|
/* reconstruct render result layers */
|
||||||
for (nr = 0, srl = re->r.layers.first; srl; srl = srl->next, nr++) {
|
for (nr = 0, scene_layer = re->render_layers.first; scene_layer; scene_layer = scene_layer->next, nr++) {
|
||||||
if (nr == re->r.actlay) {
|
if (nr == re->active_layer) {
|
||||||
BLI_addtail(&re->result->layers, rl);
|
BLI_addtail(&re->result->layers, rl);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rlpush = RE_GetRenderLayer(re->pushedresult, srl->name);
|
rlpush = RE_GetRenderLayer(re->pushedresult, scene_layer->name);
|
||||||
if (rlpush) {
|
if (rlpush) {
|
||||||
BLI_remlink(&re->pushedresult->layers, rlpush);
|
BLI_remlink(&re->pushedresult->layers, rlpush);
|
||||||
BLI_addtail(&re->result->layers, rlpush);
|
BLI_addtail(&re->result->layers, rlpush);
|
||||||
|
|
|
@ -1992,18 +1992,18 @@ void add_halo_flare(Render *re)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void render_internal_update_passes(RenderEngine *engine, Scene *scene, SceneRenderLayer *srl)
|
void render_internal_update_passes(RenderEngine *engine, Scene *scene, SceneLayer *scene_layer)
|
||||||
{
|
{
|
||||||
int type;
|
int type;
|
||||||
|
|
||||||
RE_engine_register_pass(engine, scene, srl, RE_PASSNAME_COMBINED, 4, "RGBA", SOCK_RGBA);
|
RE_engine_register_pass(engine, scene, scene_layer, RE_PASSNAME_COMBINED, 4, "RGBA", SOCK_RGBA);
|
||||||
|
|
||||||
#define CHECK_PASS(name, channels, chanid) \
|
#define CHECK_PASS(name, channels, chanid) \
|
||||||
if (srl->passflag & (SCE_PASS_ ## name)) { \
|
if (scene_layer->passflag & (SCE_PASS_ ## name)) { \
|
||||||
if (channels == 4) type = SOCK_RGBA; \
|
if (channels == 4) type = SOCK_RGBA; \
|
||||||
else if (channels == 3) type = SOCK_VECTOR; \
|
else if (channels == 3) type = SOCK_VECTOR; \
|
||||||
else type = SOCK_FLOAT; \
|
else type = SOCK_FLOAT; \
|
||||||
RE_engine_register_pass(engine, scene, srl, RE_PASSNAME_ ## name, channels, chanid, type); \
|
RE_engine_register_pass(engine, scene, scene_layer, RE_PASSNAME_ ## name, channels, chanid, type); \
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK_PASS(Z, 1, "Z");
|
CHECK_PASS(Z, 1, "Z");
|
||||||
|
|
|
@ -314,7 +314,7 @@ double elbeemEstimateMemreq(int res, float sx, float sy, float sz, int refine, c
|
||||||
struct Render *RE_NewRender(const char *name) RET_NULL
|
struct Render *RE_NewRender(const char *name) RET_NULL
|
||||||
struct Render *RE_NewSceneRender(const struct Scene *scene) RET_NULL
|
struct Render *RE_NewSceneRender(const struct Scene *scene) RET_NULL
|
||||||
void RE_SwapResult(struct Render *re, struct RenderResult **rr) RET_NONE
|
void RE_SwapResult(struct Render *re, struct RenderResult **rr) RET_NONE
|
||||||
void RE_BlenderFrame(struct Render *re, struct Main *bmain, struct Scene *scene, struct SceneRenderLayer *srl, struct Object *camera_override, unsigned int lay_override, int frame, const bool write_still) RET_NONE
|
void RE_BlenderFrame(struct Render *re, struct Main *bmain, struct Scene *scene, struct SceneLayer *scene_layer, struct Object *camera_override, unsigned int lay_override, int frame, const bool write_still) RET_NONE
|
||||||
bool RE_WriteEnvmapResult(struct ReportList *reports, struct Scene *scene, struct EnvMap *env, const char *relpath, const char imtype, float layout[12]) RET_ZERO
|
bool RE_WriteEnvmapResult(struct ReportList *reports, struct Scene *scene, struct EnvMap *env, const char *relpath, const char imtype, float layout[12]) RET_ZERO
|
||||||
|
|
||||||
/* rna */
|
/* rna */
|
||||||
|
@ -765,7 +765,7 @@ void RE_point_density_free(struct PointDensity *pd) RET_NONE
|
||||||
void RE_instance_get_particle_info(struct ObjectInstanceRen *obi, float *index, float *age, float *lifetime, float co[3], float *size, float vel[3], float angvel[3]) RET_NONE
|
void RE_instance_get_particle_info(struct ObjectInstanceRen *obi, float *index, float *age, float *lifetime, float co[3], float *size, float vel[3], float angvel[3]) RET_NONE
|
||||||
void RE_FreeAllPersistentData(void) RET_NONE
|
void RE_FreeAllPersistentData(void) RET_NONE
|
||||||
float RE_fresnel_dielectric(float incoming[3], float normal[3], float eta) RET_ZERO
|
float RE_fresnel_dielectric(float incoming[3], float normal[3], float eta) RET_ZERO
|
||||||
void RE_engine_register_pass(struct RenderEngine *engine, struct Scene *scene, struct SceneRenderLayer *srl, const char *name, int channels, const char *chanid, int type) RET_NONE
|
void RE_engine_register_pass(struct RenderEngine *engine, struct Scene *scene, struct SceneLayer *scene_layer, const char *name, int channels, const char *chanid, int type) RET_NONE
|
||||||
struct SceneLayer *RE_engine_get_scene_layer(struct Render *re) RET_NULL
|
struct SceneLayer *RE_engine_get_scene_layer(struct Render *re) RET_NULL
|
||||||
void RE_SetDepsgraph(struct Render *re, struct Depsgraph *graph) RET_NONE
|
void RE_SetDepsgraph(struct Render *re, struct Depsgraph *graph) RET_NONE
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue