[Bf-blender-cvs] [ee4069e460d] lanpr-under-gp: LineArt: Default values and description clean up.

YimingWu noreply at git.blender.org
Sat Oct 31 09:48:59 CET 2020


Commit: ee4069e460de44c6d01801e985b340c6fca47362
Author: YimingWu
Date:   Sat Oct 31 16:48:39 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rBee4069e460de44c6d01801e985b340c6fca47362

LineArt: Default values and description clean up.

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

M	source/blender/blenloader/intern/versioning_290.c
M	source/blender/makesdna/DNA_object_defaults.h
M	source/blender/makesdna/DNA_scene_defaults.h
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index bcfb2ef42c7..097b61d0ed5 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -902,9 +902,12 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
     for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
       if (!DNA_struct_find(fd->filesdna, "SceneLineart")) {
         for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
-          scene->lineart.crease_threshold = 145.0f; /* in degrees. */
+          scene->lineart.crease_threshold = 140.0f;
           scene->lineart.line_types |= LRT_EDGE_FLAG_ALL_TYPE;
           scene->lineart.flags |= (LRT_ALLOW_DUPLI_OBJECTS | LRT_REMOVE_DOUBLES);
+          scene->lineart.angle_splitting_threshold = 0.5f;
+          scene->lineart.chaining_geometry_threshold = 0.1f;
+          scene->lineart.chaining_image_threshold = 0.01f;
         }
       }
     }
diff --git a/source/blender/makesdna/DNA_object_defaults.h b/source/blender/makesdna/DNA_object_defaults.h
index 1bca572b963..f3475c7c94a 100644
--- a/source/blender/makesdna/DNA_object_defaults.h
+++ b/source/blender/makesdna/DNA_object_defaults.h
@@ -66,6 +66,7 @@
     .preview = NULL, \
     .duplicator_visibility_flag = OB_DUPLI_FLAG_VIEWPORT | OB_DUPLI_FLAG_RENDER, \
     .pc_ids = {NULL, NULL}, \
+    .lineart = { .crease_threshold = 140.0f }, \
   }
 
 /** \} */
diff --git a/source/blender/makesdna/DNA_scene_defaults.h b/source/blender/makesdna/DNA_scene_defaults.h
index ae02ac5ee35..d2ec216d9ed 100644
--- a/source/blender/makesdna/DNA_scene_defaults.h
+++ b/source/blender/makesdna/DNA_scene_defaults.h
@@ -235,6 +235,17 @@
                     SCE_EEVEE_GTAO_BOUNCE | SCE_EEVEE_TAA_REPROJECTION | \
                     SCE_EEVEE_SSR_HALF_RESOLUTION | SCE_EEVEE_SHADOW_SOFT, \
   }
+  
+
+
+#define _DNA_DEFAULT_SceneLineArt \
+  { \
+    .crease_threshold = 140.0f,\
+    .angle_splitting_threshold = 0.5f,\
+    .chaining_geometry_threshold = 0.1f,\
+    .chaining_image_threshold = 0.01f,\
+  }
+
 
 #define _DNA_DEFAULT_Scene \
   { \
@@ -249,6 +260,7 @@
     .safe_areas = _DNA_DEFAULT_DisplaySafeAreas, \
  \
     .eevee = _DNA_DEFAULT_SceneEEVEE, \
+    .lineart = _DNA_DEFAULT_SceneLineArt, \
   }
 
 /** \} */
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 1d132ca50f0..5039941852a 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -7421,28 +7421,30 @@ static void rna_def_scene_lineart(BlenderRNA *brna)
   RNA_def_property_boolean_default(prop, 1);
   RNA_def_property_ui_text(prop,
                            "Allow Overlapping Edges",
-                           "Allow lines from edge split to show properly, may run slower.");
+                           "Allow lines from edge split to show properly, may run slower");
   RNA_def_property_update(prop, NC_SCENE, "rna_lineart_update");
 
   prop = RNA_def_property(srna, "allow_clipping_boundaries", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flags", LRT_ALLOW_CLIPPING_BOUNDARIES);
   RNA_def_property_boolean_default(prop, 1);
   RNA_def_property_ui_text(
-      prop, "Clipping Boundaries", "Allow lines on near/far clipping plane to be shown.");
+      prop, "Clipping Boundaries", "Allow lines on near/far clipping plane to be shown");
   RNA_def_property_update(prop, NC_SCENE, "rna_lineart_update");
 
   prop = RNA_def_property(srna, "crease_threshold", PROP_FLOAT, PROP_NONE);
   RNA_def_property_range(prop, 0, 180);
-  RNA_def_property_float_default(prop, 140);
+  RNA_def_property_float_default(prop, 140.0f);
   RNA_def_property_ui_range(prop, 0.0f, 180.0f, 0.01f, 1);
-  RNA_def_property_ui_text(prop, "Crease Threshold", "Cosine value of face angle");
+  RNA_def_property_ui_text(
+      prop, "Crease Threshold", "Angle smaller than this value will be treated as a crease line");
   RNA_def_property_update(prop, NC_SCENE, "rna_lineart_update");
 
   prop = RNA_def_property(srna, "angle_splitting_threshold", PROP_FLOAT, PROP_ANGLE);
   RNA_def_property_float_default(prop, 0.5f);
-  RNA_def_property_ui_text(prop, "Angle Splitting", "Angle splitting threshold");
+  RNA_def_property_ui_text(
+      prop, "Angle Splitting", "A 2D angle, below which a long stroke is split into two");
   /*  Don't allow value very close to PI, or we get a lot of small segments.*/
-  RNA_def_property_ui_range(prop, 0.0f, DEG2RAD(179), 0.01f, 2);
+  RNA_def_property_ui_range(prop, 0.0f, 180.0f, 0.01f, 1);
   RNA_def_property_update(prop, NC_SCENE, "rna_lineart_update");
 
   prop = RNA_def_property(srna, "remove_doubles", PROP_BOOLEAN, PROP_NONE);



More information about the Bf-blender-cvs mailing list