1
1

Cycles: add view layer option to disable motion blur, in the Filter panel

This commit is contained in:
2021-06-25 18:29:17 +02:00
parent f863ef8a34
commit 23042a3fb1
5 changed files with 23 additions and 4 deletions

View File

@@ -821,6 +821,11 @@ class CYCLES_RENDER_PT_filter(CyclesButtonsPanel, Panel):
col.prop(view_layer, "use_strand", text="Hair")
col.prop(view_layer, "use_volumes", text="Volumes")
col = layout.column(heading="Use")
sub = col.row()
sub.prop(view_layer, "use_motion_blur", text="Motion Blur")
sub.active = rd.use_motion_blur
class CYCLES_RENDER_PT_override(CyclesButtonsPanel, Panel):
bl_label = "Override"

View File

@@ -281,7 +281,6 @@ void BlenderSync::sync_data(BL::RenderSettings &b_render,
void BlenderSync::sync_integrator()
{
BL::RenderSettings r = b_scene.render();
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
experimental = (get_enum(cscene, "feature_set") != 0);
@@ -325,7 +324,7 @@ void BlenderSync::sync_integrator()
integrator->set_sample_clamp_direct(get_float(cscene, "sample_clamp_direct"));
integrator->set_sample_clamp_indirect(get_float(cscene, "sample_clamp_indirect"));
if (!preview) {
integrator->set_motion_blur(r.use_motion_blur());
integrator->set_motion_blur(view_layer.use_motion_blur);
}
integrator->set_method((Integrator::Method)get_enum(
@@ -456,6 +455,8 @@ void BlenderSync::sync_view_layer(BL::ViewLayer &b_view_layer)
view_layer.use_surfaces = b_view_layer.use_solid() || scene->bake_manager->get_baking();
view_layer.use_hair = b_view_layer.use_strand();
view_layer.use_volumes = b_view_layer.use_volumes();
view_layer.use_motion_blur = b_view_layer.use_motion_blur() &&
b_scene.render().use_motion_blur();
/* Material override. */
view_layer.material_override = b_view_layer.material_override();
@@ -602,7 +603,7 @@ vector<Pass> BlenderSync::sync_render_passes(BL::Scene &b_scene,
for (BL::RenderPass &b_pass : b_rlay.passes) {
PassType pass_type = get_pass_type(b_pass);
if (pass_type == PASS_MOTION && b_scene.render().use_motion_blur())
if (pass_type == PASS_MOTION && view_layer.use_motion_blur)
continue;
if (pass_type != PASS_NONE)
Pass::add(pass_type, passes, b_pass.name().c_str());

View File

@@ -246,6 +246,7 @@ class BlenderSync {
use_surfaces(true),
use_hair(true),
use_volumes(true),
use_motion_blur(true),
samples(0),
bound_samples(false)
{
@@ -258,6 +259,7 @@ class BlenderSync {
bool use_surfaces;
bool use_hair;
bool use_volumes;
bool use_motion_blur;
int samples;
bool bound_samples;
} view_layer;

View File

@@ -241,7 +241,8 @@ typedef struct SceneRenderLayer {
#define SCE_LAY_FRS (1 << 6)
#define SCE_LAY_AO (1 << 7)
#define SCE_LAY_VOLUMES (1 << 8)
/* flags between (1 << 8) and (1 << 15) are set to 1 already, for future options */
#define SCE_LAY_MOTION_BLUR (1 << 9)
/* flags between (1 << 9) and (1 << 15) are set to 1 already, for future options */
#define SCE_LAY_ALL_Z (1 << 15)
/* #define SCE_LAY_XOR (1 << 16) */ /* UNUSED */

View File

@@ -4204,6 +4204,16 @@ void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, const bool sce
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
}
prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_MOTION_BLUR);
RNA_def_property_ui_text(prop, "Motion Blur", "Render motion blur in this Layer, if enabled in the scene");
if (scene) {
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
}
else {
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
}
/* passes */
prop = RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);