[Bf-blender-cvs] [6ff28535096] temp-lineart-contained: LineArt: Custom camera working correctly.
YimingWu
noreply at git.blender.org
Wed Jun 2 14:50:59 CEST 2021
Commit: 6ff28535096ab93e8afb73c73e0114bf779a0213
Author: YimingWu
Date: Wed Jun 2 20:50:33 2021 +0800
Branches: temp-lineart-contained
https://developer.blender.org/rB6ff28535096ab93e8afb73c73e0114bf779a0213
LineArt: Custom camera working correctly.
===================================================================
M source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
M source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
M source/blender/makesrna/intern/rna_gpencil_modifier.c
===================================================================
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index 3ce7c3748de..f20b2dcd030 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -289,9 +289,6 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
uiItemR(layout, ptr, "use_cached_result", 0, NULL, ICON_NONE);
}
- uiItemR(layout, ptr, "use_custom_camera", 0, NULL, ICON_OBJECT_DATA);
- uiItemR(layout, ptr, "source_camera", 0, NULL, ICON_OBJECT_DATA);
-
uiItemR(layout, ptr, "source_type", 0, NULL, ICON_NONE);
if (source_type == LRT_SOURCE_OBJECT) {
@@ -358,6 +355,13 @@ static void options_panel_draw(const bContext *UNUSED(C), Panel *panel)
!is_baked &&
(!use_cache || BKE_gpencil_lineart_is_first_run(ob_ptr.data, ptr->data)));
+ uiLayout *row = uiLayoutRowWithHeading(layout, false, IFACE_("Custom Camera"));
+ uiItemR(row, ptr, "use_custom_camera", 0, "", 0);
+ uiLayout *subrow = uiLayoutRow(row, true);
+ uiLayoutSetActive(subrow, RNA_boolean_get(ptr, "use_custom_camera"));
+ uiLayoutSetPropSep(subrow, true);
+ uiItemR(subrow, ptr, "source_camera", 0, "", ICON_OBJECT_DATA);
+
uiItemR(layout, ptr, "use_remove_doubles", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "use_edge_overlap", 0, IFACE_("Overlapping Edges As Contour"), ICON_NONE);
uiItemR(layout, ptr, "use_object_instances", 0, NULL, ICON_NONE);
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 509a5efdc70..8178f175cce 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -4027,10 +4027,11 @@ bool MOD_lineart_compute_feature_lines(Depsgraph *depsgraph,
BKE_scene_camera_switch_update(scene);
if (lmd->calculation_flags & LRT_USE_CUSTOM_CAMERA) {
- if (!lmd->source_camera || ((Object *)lmd->source_camera->id.orig_id)->type != OB_CAMERA) {
+ if (!lmd->source_camera ||
+ (use_camera = DEG_get_evaluated_object(depsgraph, lmd->source_camera))->type !=
+ OB_CAMERA) {
return false;
}
- use_camera = (Object *)lmd->source_camera->id.orig_id;
}
else {
if (!scene->camera) {
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index 4b244898c4f..5ca4baac2a0 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -2845,7 +2845,7 @@ static void rna_def_modifier_gpencillineart(BlenderRNA *brna)
prop = RNA_def_property(srna, "source_camera", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
- RNA_def_property_struct_type(prop, "Camera");
+ RNA_def_property_struct_type(prop, "Object");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(
prop, "Camera Object", "Use specified camera object for generating line art");
More information about the Bf-blender-cvs
mailing list