[Bf-blender-cvs] [bb80b1278cd] lanpr-under-gp: LineArt: Further value tweaks for the UI.
YimingWu
noreply at git.blender.org
Sat Oct 31 10:01:31 CET 2020
Commit: bb80b1278cd786a86a51dfdfbf5816e2deeffd79
Author: YimingWu
Date: Sat Oct 31 17:00:48 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rBbb80b1278cd786a86a51dfdfbf5816e2deeffd79
LineArt: Further value tweaks for the UI.
===================================================================
M source/blender/blenloader/intern/versioning_290.c
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 097b61d0ed5..57f4ffe6d5f 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -898,19 +898,6 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
part->phystype = PART_PHYS_NO;
}
}
-
- 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 = 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;
- }
- }
- }
}
if (!MAIN_VERSION_ATLEAST(bmain, 291, 9)) {
@@ -982,6 +969,18 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
* \note Keep this message at the bottom of the function.
*/
{
- /* Keep this block, even when empty. */
+
+ 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 = 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 = DEG2RAD(60.0f);
+ scene->lineart.chaining_geometry_threshold = 0.1f;
+ scene->lineart.chaining_image_threshold = 0.01f;
+ }
+ }
+ }
}
}
diff --git a/source/blender/makesdna/DNA_scene_defaults.h b/source/blender/makesdna/DNA_scene_defaults.h
index d2ec216d9ed..c1bf716c6cd 100644
--- a/source/blender/makesdna/DNA_scene_defaults.h
+++ b/source/blender/makesdna/DNA_scene_defaults.h
@@ -241,7 +241,7 @@
#define _DNA_DEFAULT_SceneLineArt \
{ \
.crease_threshold = 140.0f,\
- .angle_splitting_threshold = 0.5f,\
+ .angle_splitting_threshold = DEG2RAD(60.0f),\
.chaining_geometry_threshold = 0.1f,\
.chaining_image_threshold = 0.01f,\
}
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 5039941852a..0eb23c4f84e 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -7440,11 +7440,11 @@ static void rna_def_scene_lineart(BlenderRNA *brna)
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_float_default(prop, DEG2RAD(60.0f));
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, 180.0f, 0.01f, 1);
+ RNA_def_property_ui_range(prop, 0.0f, DEG2RAD(179.5f), 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