[Bf-blender-cvs] [f8ad9f1f8a5] lanpr-under-gp: LineArt: Remove LRT_ENABLED flag.

YimingWu noreply at git.blender.org
Wed Jul 15 12:23:44 CEST 2020


Commit: f8ad9f1f8a5aa01834f81095d4453e15076edd35
Author: YimingWu
Date:   Wed Jul 15 18:23:38 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rBf8ad9f1f8a5aa01834f81095d4453e15076edd35

LineArt: Remove LRT_ENABLED flag.

===================================================================

M	release/scripts/startup/bl_ui/properties_render.py
M	source/blender/editors/lineart/lineart_cpu.c
M	source/blender/editors/space_buttons/buttons_context.c
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/intern/rna_scene.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index 0dbde7155ed..933eba773a9 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -706,14 +706,14 @@ class RENDER_PT_lineart(RenderButtonsPanel, Panel):
     bl_options = {'DEFAULT_CLOSED'}
 
     def draw_header(self, context):
-        self.layout.prop(context.scene.lineart, "enabled", text="")
+        self.layout.prop(context.scene.lineart, "auto_update", text="")
 
     def draw(self, context):
         scene = context.scene
         lineart = scene.lineart
 
         layout = self.layout
-        layout.active = lineart.enabled
+        layout.active = lineart.auto_update
         layout.use_property_split = True
         layout.use_property_decorate = False  # No animation.
 
@@ -721,7 +721,6 @@ class RENDER_PT_lineart(RenderButtonsPanel, Panel):
             col.label(text="No active camera.")
 
         else:
-            layout.prop(lineart, 'auto_update', text='Auto Update')
             layout.prop(lineart, "use_intersections")
 
             layout.prop(lineart, "crease_threshold", slider=True)
diff --git a/source/blender/editors/lineart/lineart_cpu.c b/source/blender/editors/lineart/lineart_cpu.c
index 14075f6f739..21872d29c87 100644
--- a/source/blender/editors/lineart/lineart_cpu.c
+++ b/source/blender/editors/lineart/lineart_cpu.c
@@ -3445,7 +3445,7 @@ int ED_lineart_compute_feature_lines_internal(Depsgraph *depsgraph, const int sh
   SceneLineart *lineart = &scene->lineart;
   int intersections_only = 0; /* Not used right now, but preserve for future. */
 
-  if ((lineart->flags & LRT_ENABLED) == 0) {
+  if ((lineart->flags & LRT_AUTO_UPDATE) == 0) {
     /* Release lock when early return. */
     BLI_spin_unlock(&lineart_share.lock_loader);
     return OPERATOR_CANCELLED;
@@ -3967,7 +3967,7 @@ void SCENE_OT_lineart_bake_strokes(wmOperatorType *ot)
 
 void ED_lineart_post_frame_update_external(bContext *C, Scene *scene, Depsgraph *dg)
 {
-  if ((scene->lineart.flags & LRT_ENABLED) == 0 || !(scene->lineart.flags & LRT_AUTO_UPDATE)) {
+  if (!(scene->lineart.flags & LRT_AUTO_UPDATE)) {
     return;
   }
   if (ED_lineart_modifier_sync_flag_check(LRT_SYNC_WAITING)) {
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 47e9e5074ed..7ce1ab4ab16 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -623,7 +623,7 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma
       break;
     case BCONTEXT_LRT: /* This is for Line Art object flags */
 #ifdef WITH_LINEART
-      if (scene && ((scene->lineart.flags & LRT_ENABLED))) {
+      if (scene && (scene->lineart.flags & LRT_AUTO_UPDATE)) {
         found = buttons_context_path_object(path);
       }
       else {
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index f82dca85562..0505263ad05 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1701,7 +1701,7 @@ typedef enum eLineartPostProcessingStatus {
 } eLineartPostProcessingStatus;
 
 typedef enum eLineartMainFlags {
-  LRT_ENABLED = (1 << 0),
+  LRT_ENABLED = (1 << 0), /* Deprecated right now. */
   /* For Line Art->GP and viewport to update automatically. */
   LRT_AUTO_UPDATE = (1 << 1),
   LRT_SAME_TAPER = (1 << 2),
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 6fe8bae119e..d49e7f225cf 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2590,19 +2590,6 @@ static void rna_lineart_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UN
   }
 }
 
-static void rna_lineart_enable_set(PointerRNA *ptr, bool value)
-{
-  SceneLineart *lineart = (SceneLineart *)ptr->data;
-
-  if (value) {
-    lineart->flags |= LRT_ENABLED;
-    ED_lineart_init_locks();
-  }
-  else {
-    lineart->flags &= ~LRT_ENABLED;
-  }
-}
-
 static char *rna_FFmpegSettings_path(PointerRNA *UNUSED(ptr))
 {
   return BLI_strdup("render.ffmpeg");
@@ -7303,18 +7290,12 @@ static void rna_def_scene_lineart(BlenderRNA *brna)
   RNA_def_struct_sdna(srna, "SceneLineart");
   RNA_def_struct_ui_text(srna, "Scene Line Art Config", "Line Art global config");
 
-  prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_default(prop, 0);
-  RNA_def_property_boolean_sdna(prop, NULL, "flags", LRT_ENABLED);
-  RNA_def_property_boolean_funcs(prop, NULL, "rna_lineart_enable_set");
-  RNA_def_property_ui_text(prop, "Enabled", "Is Line Art enabled");
-  RNA_def_property_update(prop, NC_SCENE, NULL);
-
   prop = RNA_def_property(srna, "auto_update", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flags", LRT_AUTO_UPDATE);
   RNA_def_property_boolean_default(prop, 0);
   RNA_def_property_ui_text(
       prop, "Auto Update", "Automatically update Line Art cache when frame changes");
+  RNA_def_property_update(prop, NC_SCENE, NULL);
 
   prop = RNA_def_property(srna, "gpencil_overwrite", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flags", LRT_GPENCIL_OVERWRITE);



More information about the Bf-blender-cvs mailing list