[Bf-blender-cvs] [7be203b070d] soc-2019-npr: LANPR: collection line type selecot and default values.

YimingWu noreply at git.blender.org
Thu Jun 27 08:29:01 CEST 2019


Commit: 7be203b070dea1c2fb740ecaeb8fdc6518b5e067
Author: YimingWu
Date:   Thu Jun 27 14:27:07 2019 +0800
Branches: soc-2019-npr
https://developer.blender.org/rB7be203b070dea1c2fb740ecaeb8fdc6518b5e067

LANPR: collection line type selecot and default values.

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

M	release/scripts/startup/bl_ui/properties_collection.py
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/makesdna/DNA_collection_types.h
M	source/blender/makesrna/intern/rna_collection.c

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

diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py
index e3110155ae2..e1446769f0e 100644
--- a/release/scripts/startup/bl_ui/properties_collection.py
+++ b/release/scripts/startup/bl_ui/properties_collection.py
@@ -76,13 +76,23 @@ class COLLECTION_PT_lanpr_collection(CollectionButtonsPanel, Panel):
             row.prop(lanpr,"target")
             
             if lanpr.target:
+
+                row = layout.row(align=True)
+                row.prop(lanpr,'enable_contour',toggle=True)
+                row.prop(lanpr,'enable_crease',toggle=True)
+                row.prop(lanpr,'enable_mark',toggle=True)
+                row.prop(lanpr,'enable_material',toggle=True)
+                row.prop(lanpr,'enable_intersection',toggle=True)
+
                 row = layout.row(align=True)
                 row.prop(lanpr,'use_multiple_levels', icon='GP_MULTIFRAME_EDITING', icon_only=True)
                 row.prop(lanpr,'level_begin')
                 if lanpr.use_multiple_levels:
                     row.prop(lanpr,'level_end')
+                
                 row = layout.row()
                 row.prop(lanpr,'replace', text='Replace existing frames')
+                
                 row = layout.row()
                 row.prop(lanpr,'layer')
                 row.prop(lanpr,'material')
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index edc2759341e..b2aac37ec91 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -3545,6 +3545,9 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
       sce->lanpr.chaining_image_threshold = 0.01;
       sce->lanpr.chaining_geometry_threshold = 0.1;
     }
+    for (Collection* co = bmain->collections.first;co;co=co->id.next){
+      co->lanpr.types = COLLECTION_FEATURE_LINE_ALL;
+    }
   }
 
   {
diff --git a/source/blender/makesdna/DNA_collection_types.h b/source/blender/makesdna/DNA_collection_types.h
index 2da8a0dea64..2ca7b326d3a 100644
--- a/source/blender/makesdna/DNA_collection_types.h
+++ b/source/blender/makesdna/DNA_collection_types.h
@@ -53,7 +53,7 @@ typedef struct CollectionLANPR {
   short usage;
   short force; /* force objects with LANPR modifier follow the rule */
 
-  char _pad[4];
+  int types;
 
   struct Object *target;
   int replace;
@@ -64,6 +64,20 @@ typedef struct CollectionLANPR {
   int level_end;
 } CollectionLANPR;
 
+/* CollectionLANPR->types */
+enum CollectionFeatureLine_TypeFlag {
+  COLLECTION_FEATURE_LINE_NONE = (1 << 0),
+  COLLECTION_FEATURE_LINE_CONTOUR = (1 << 1),
+  COLLECTION_FEATURE_LINE_CREASE = (1 << 2),
+  COLLECTION_FEATURE_LINE_MARK = (1 << 3),
+  COLLECTION_FEATURE_LINE_MATERIAL = (1 << 4),
+  COLLECTION_FEATURE_LINE_INTERSECTION = (1 << 5),
+};
+
+#define COLLECTION_FEATURE_LINE_ALL \
+  (COLLECTION_FEATURE_LINE_CONTOUR | COLLECTION_FEATURE_LINE_CREASE | COLLECTION_FEATURE_LINE_MARK | \
+   COLLECTION_FEATURE_LINE_MATERIAL | COLLECTION_FEATURE_LINE_INTERSECTION)
+
 /* CollectionLANPR->mode */
 enum {
   COLLECTION_LANPR_INCLUDE = 0,
diff --git a/source/blender/makesrna/intern/rna_collection.c b/source/blender/makesrna/intern/rna_collection.c
index 6b749bece03..c4b917ee7b3 100644
--- a/source/blender/makesrna/intern/rna_collection.c
+++ b/source/blender/makesrna/intern/rna_collection.c
@@ -385,6 +385,27 @@ static void rna_def_collection_lanpr(BlenderRNA *brna, StructRNA *srna)
   RNA_def_property_ui_text(prop, "Usage", "How to use this collection in LANPR");
   RNA_def_property_update(prop, NC_SCENE, NULL);
 
+
+  prop = RNA_def_property(srna, "enable_contour", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "types", COLLECTION_FEATURE_LINE_CONTOUR);
+  RNA_def_property_ui_text(prop, "Contour", "Contour lines");
+
+  prop = RNA_def_property(srna, "enable_crease", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "types", COLLECTION_FEATURE_LINE_CREASE);
+  RNA_def_property_ui_text(prop, "Crease", "Crease lines");
+
+  prop = RNA_def_property(srna, "enable_mark", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "types", COLLECTION_FEATURE_LINE_MARK);
+  RNA_def_property_ui_text(prop, "Mark", "Freestyle marked edges");
+
+  prop = RNA_def_property(srna, "enable_material", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "types", COLLECTION_FEATURE_LINE_MATERIAL);
+  RNA_def_property_ui_text(prop, "Material", "Material lines");
+
+  prop = RNA_def_property(srna, "enable_intersection", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "types", COLLECTION_FEATURE_LINE_INTERSECTION);
+  RNA_def_property_ui_text(prop, "Intersection", "Intersection lines");
+
   prop = RNA_def_property(srna, "force", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_default(prop, 0);
   RNA_def_property_ui_text(



More information about the Bf-blender-cvs mailing list