[Bf-blender-cvs] [6f262f79ff8] lanpr-under-gp: Cleanup: Continue last commit

YimingWu noreply at git.blender.org
Sat Jul 4 13:41:14 CEST 2020


Commit: 6f262f79ff8e5119fc9791daced3854ca12f59fb
Author: YimingWu
Date:   Sat Jul 4 19:41:07 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rB6f262f79ff8e5119fc9791daced3854ca12f59fb

Cleanup: Continue last commit

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

M	release/scripts/startup/bl_ui/properties_render.py
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/editors/lineart/lineart_cpu.c
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 0be89328599..94c06954402 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -724,10 +724,12 @@ class RENDER_PT_lineart(RenderButtonsPanel, Panel):
         layout.use_property_split = True
         layout.use_property_decorate = False  # No animation.
 
-        col = layout.column()
-
         layout.prop(lineart, "crease_threshold", slider=True)
 
+        col = layout.column()
+        col.prop(lineart, "master_thickness", slider=True)
+        col.prop(lineart, "master_strength", slider=True)
+
         col.prop(lineart, 'auto_update', text='Auto Update')
         layout.prop(lineart, "gpencil_overwrite", text='Overwrite')
 
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 67a54f99e67..0adf3a9a8d0 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -5114,7 +5114,9 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
       if (!DNA_struct_find(fd->filesdna, "SceneLineart")) {
         for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
 
-          scene->lineart.crease_threshold = 0.7;
+          scene->lineart.crease_threshold = 0.7f;
+          scene->lineart.master_thickness = 20;
+          scene->lineart.master_strength = 1.0f;
 
           scene->lineart.flags |= (LRT_USE_INTERSECTIONS);
 
diff --git a/source/blender/editors/lineart/lineart_cpu.c b/source/blender/editors/lineart/lineart_cpu.c
index 77a9596e974..602d0691b21 100644
--- a/source/blender/editors/lineart/lineart_cpu.c
+++ b/source/blender/editors/lineart/lineart_cpu.c
@@ -3975,7 +3975,9 @@ void ED_lineart_generate_gpencil_from_chain(Depsgraph *depsgraph,
   static int tempnum = 0;
   tempnum++;
   int color_idx = 0;
-  short thickness = 100;
+  Scene *s = DEG_get_evaluated_scene(depsgraph);
+  short thickness = s->lineart.master_thickness;
+  short opacity = s->lineart.master_strength;
 
   float mat[4][4];
 
@@ -4025,7 +4027,6 @@ void ED_lineart_generate_gpencil_from_chain(Depsgraph *depsgraph,
                                      "line art add stroke");
 
     for (rlci = rlc->chain.first; rlci; rlci = rlci->next) {
-      float opacity = 1.0f; /* rlci->occlusion ? 0.0f : 1.0f; */
       stroke_data[array_idx] = rlci->gpos[0];
       stroke_data[array_idx + 1] = rlci->gpos[1];
       stroke_data[array_idx + 2] = rlci->gpos[2];
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 938a89f9cab..54491c07f83 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -7421,6 +7421,20 @@ static void rna_def_scene_lineart(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Calculate Intersections", "Calculate Intersections or not");
   RNA_def_property_update(prop, NC_SCENE, NULL);
 
+  prop = RNA_def_property(srna, "master_thickness", PROP_INT, PROP_NONE);
+  RNA_def_property_int_default(prop, 20);
+  RNA_def_property_ui_text(
+      prop, "Master Thickness", "The thickness that are used to generate strokes");
+  RNA_def_property_ui_range(prop, 1, 100, 1, 1);
+  RNA_def_property_range(prop, 1, 200);
+
+  prop = RNA_def_property(srna, "master_strength", PROP_FLOAT, PROP_NONE);
+  RNA_def_property_float_default(prop, 0.1f);
+  RNA_def_property_ui_text(
+      prop, "Master Strength", "The strength value used to generate strokes.");
+  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01f, 2);
+  RNA_def_property_range(prop, 0.0f, 1.0f);
+
   /* Below these two are only for grease pencil, thus no viewport updates. */
 
   prop = RNA_def_property(srna, "chaining_geometry_threshold", PROP_FLOAT, PROP_NONE);



More information about the Bf-blender-cvs mailing list