[Bf-blender-cvs] [fe71389950a] soc-2019-npr: LANPR: Object modifier for line selection (not functional yet)

YimingWu noreply at git.blender.org
Mon Jun 17 08:51:18 CEST 2019


Commit: fe71389950aa611aac12cc88bdc965363dbcdc7d
Author: YimingWu
Date:   Mon Jun 17 14:50:34 2019 +0800
Branches: soc-2019-npr
https://developer.blender.org/rBfe71389950aa611aac12cc88bdc965363dbcdc7d

LANPR: Object modifier for line selection (not functional yet)

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

M	release/datafiles/locale
M	release/scripts/addons
M	release/scripts/addons_contrib
M	release/scripts/startup/bl_ui/properties_data_modifier.py
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/modifiers/CMakeLists.txt
M	source/blender/modifiers/MOD_modifiertypes.h
A	source/blender/modifiers/intern/MOD_featureline.c
M	source/blender/modifiers/intern/MOD_util.c
M	source/tools

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

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 469c949d1ca..ad82c4ce43e 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 469c949d1ca882be19daa128842f813b72a944d8
+Subproject commit ad82c4ce43ef2801ef51e75af1f9702992478b02
diff --git a/release/scripts/addons b/release/scripts/addons
index c88411ff777..8e6f485cf5b 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit c88411ff7776a2db5d6ef6117a1b2faa42a95611
+Subproject commit 8e6f485cf5b160c425d7da7c743879b20f3d6a96
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
index 310578043de..7077ff07384 160000
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@ -1 +1 @@
-Subproject commit 310578043dec1aae382eb6a447ae1d103792d7e6
+Subproject commit 7077ff07384491d1f7630484995557f1c7302dae
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 687d41a4d44..3f215ab7f31 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -1666,6 +1666,33 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
         col.prop(md, "thresh", text="Threshold")
         col.prop(md, "face_influence")
 
+    def FEATURE_LINE(self, layout, ob, md):
+        layout.label(text='Not operational yet')
+        layout.label(text='Usage:')
+        row = layout.row()
+        row.prop(md,'usage',expand=True)
+        if md.usage == 'INCLUDE':
+            layout.label(text='Enable Types:')
+            row = layout.row(align=True)
+            row.prop(md,'enable_contour',toggle=True)
+            row.prop(md,'enable_crease',toggle=True)
+            row.prop(md,'enable_mark',toggle=True)
+            row.prop(md,'enable_material',toggle=True)
+            row.prop(md,'enable_intersection',toggle=True)
+            row.prop(md,'enable_modifier_mark',toggle=True)
+            layout.label(text='Result GP:')
+            layout.prop(md,'target')
+            layout.prop(md,'replace')
+
+            row = layout.row()
+            row.prop(md,'layer')
+            row.prop(md,'material')
+
+            row = layout.row(align=True)
+            row.prop(md,'use_multiple_levels', icon='GP_MULTIFRAME_EDITING', icon_only=True)
+            row.prop(md,'level_begin')
+            if md.use_multiple_levels:
+                row.prop(md,'level_end')
 
 class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel):
     bl_label = "Modifiers"
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 54d4a6a7af4..0167e9bbafe 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -89,6 +89,7 @@ typedef enum ModifierType {
   eModifierType_SurfaceDeform = 53,
   eModifierType_WeightedNormal = 54,
   eModifierType_MyBMesh = 55,
+  eModifierType_FeatureLine = 56,
   NUM_MODIFIER_TYPES,
 } ModifierType;
 
@@ -1967,4 +1968,44 @@ enum {
   MOD_MYBMESH_OPTI = (1 << 7),
 };
 
+typedef struct FeatureLineModifierData {
+  ModifierData modifier;
+
+  int usage;
+  int types; //eFeatureLine_TypeFlag
+  
+  struct Object *target;
+  int replace;
+  int layer;
+  int material;
+
+  int use_multiple_levels;
+  int level_begin;
+  int level_end;
+
+} FeatureLineModifierData;
+
+enum eFeatureLine_Usage {
+  MOD_FEATURE_LINE_INCLUDE = 0,
+  MOD_FEATURE_LINE_OCCLUSION_ONLY = (1<<0),
+  MOD_FEATURE_LINE_EXCLUDE = (1<<1),
+};
+
+enum eFeatureLine_TypeFlag {
+  MOD_FEATURE_LINE_NONE = (1<<0),
+  MOD_FEATURE_LINE_CONTOUR = (1<<1),
+  MOD_FEATURE_LINE_CREASE = (1<<2),
+  MOD_FEATURE_LINE_MARK = (1<<3),
+  MOD_FEATURE_LINE_MATERIAL = (1<<4),
+  MOD_FEATURE_LINE_INTERSECTION = (1<<5),
+  MOD_FEATURE_LINE_MODIFIER_MARK = (1<<6)
+};
+
+#define MOD_FEATURE_LINE_ALL (MOD_FEATURE_LINE_CONTOUR|\
+               MOD_FEATURE_LINE_CREASE|\
+               MOD_FEATURE_LINE_MARK|\
+               MOD_FEATURE_LINE_MATERIAL|\
+               MOD_FEATURE_LINE_MODIFIER_MARK|\
+               MOD_FEATURE_LINE_INTERSECTION)
+
 #endif /* __DNA_MODIFIER_TYPES_H__ */
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 2dfe5feeac1..df43797af78 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -640,6 +640,7 @@ extern StructRNA RNA_SunLight;
 extern StructRNA RNA_SurfaceCurve;
 extern StructRNA RNA_SurfaceDeformModifier;
 extern StructRNA RNA_SurfaceModifier;
+extern StructRNA RNA_FeatureLineModifier;
 extern StructRNA RNA_TexMapping;
 extern StructRNA RNA_Text;
 extern StructRNA RNA_TextBox;
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index ce531e16f28..18d65028396 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -99,16 +99,9 @@ const EnumPropertyItem rna_enum_object_modifier_type_items[] = {
     {eModifierType_Solidify, "SOLIDIFY", ICON_MOD_SOLIDIFY, "Solidify", ""},
     {eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subdivision Surface", ""},
     {eModifierType_Triangulate, "TRIANGULATE", ICON_MOD_TRIANGULATE, "Triangulate", ""},
-    {eModifierType_Wireframe,
-     "WIREFRAME",
-     ICON_MOD_WIREFRAME,
-     "Wireframe",
-     "Generate a wireframe on the edges of a mesh"},
-    {eModifierType_MyBMesh,
-     "MY_BMESH",
-     ICON_MOD_SMOOTH,
-     "Smooth Contour",
-     "Generate smooth contour geometry for feature line rendering."},
+    {eModifierType_Wireframe, "WIREFRAME", ICON_MOD_WIREFRAME, "Wireframe", "Generate a wireframe on the edges of a mesh"},
+    {eModifierType_MyBMesh, "MY_BMESH", ICON_MOD_SMOOTH, "Smooth Contour", "Generate smooth contour geometry for feature line rendering."},
+    {eModifierType_FeatureLine, "FEATURE_LINE", ICON_MOD_WIREFRAME, "Feature Line", "Extract feature lines into an GPencil object target"},
     {0, "", 0, N_("Deform"), ""},
     {eModifierType_Armature, "ARMATURE", ICON_MOD_ARMATURE, "Armature", ""},
     {eModifierType_Cast, "CAST", ICON_MOD_CAST, "Cast", ""},
@@ -580,6 +573,8 @@ static StructRNA *rna_Modifier_refine(struct PointerRNA *ptr)
       return &RNA_WeightedNormalModifier;
     case eModifierType_MyBMesh:
       return &RNA_MyBMeshModifier;
+      case eModifierType_FeatureLine:
+      return &RNA_FeatureLineModifier;
     /* Default */
     case eModifierType_None:
     case eModifierType_ShapeKey:
@@ -5979,6 +5974,109 @@ static void rna_def_modifier_weightednormal(BlenderRNA *brna)
   RNA_def_property_update(prop, 0, "rna_Modifier_update");
 }
 
+static void rna_def_modifier_featureline(BlenderRNA *brna)
+{
+  StructRNA *srna;
+  PropertyRNA *prop;
+
+  static EnumPropertyItem prop_feature_line_usage_items[] = {
+      {MOD_FEATURE_LINE_INCLUDE,
+       "INCLUDE",
+       0,
+       "Include",
+       "Include this object into calculation"},
+      {MOD_FEATURE_LINE_OCCLUSION_ONLY,
+       "OCCLUSION_ONLY",
+       0,
+       "Occlusion Only",
+       "Don't produce lines, only used as occlusion object"},
+      {MOD_FEATURE_LINE_EXCLUDE,
+       "EXCLUDE",
+       0,
+       "Exclude",
+       "Don't calculate this object"},
+      {0, NULL, 0, NULL, NULL},
+  };
+
+  srna = RNA_def_struct(brna, "FeatureLineModifier", "Modifier");
+  RNA_def_struct_ui_text(srna, "Feature Line Modifier", "To extract feature lines from a mesh using LANPR");
+  RNA_def_struct_sdna(srna, "FeatureLineModifierData");
+  RNA_def_struct_ui_icon(srna, ICON_MOD_WIREFRAME);
+
+  prop = RNA_def_property(srna, "usage", PROP_ENUM, PROP_NONE);
+  RNA_def_property_enum_items(prop, prop_feature_line_usage_items);
+  RNA_def_property_ui_text(prop, "Usage", "How to use this object");
+  RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+  prop = RNA_def_property(srna, "enable_contour", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "types", MOD_FEATURE_LINE_CONTOUR);
+  RNA_def_property_ui_text(prop, "Contour", "Contour lines");
+  RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+  prop = RNA_def_property(srna, "enable_crease", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "types", MOD_FEATURE_LINE_CREASE);
+  RNA_def_property_ui_text(prop, "Crease", "Crease lines");
+  RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+  prop = RNA_def_property(srna, "enable_mark", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "types", MOD_FEATURE_LINE_MARK);
+  RNA_def_property_ui_text(prop, "Mark", "Freestyle marked edges");
+  RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+  prop = RNA_def_property(srna, "enable_material", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "types", MOD_FEATURE_LINE_MATERIAL);
+  RNA_def_property_ui_text(prop, "Material", "Material lines");
+  RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+  prop = RNA_def_property(srna, "enable_intersection", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "types", MOD_FEATURE_LINE_INTERSECTION);
+  RNA_def_property_ui_text(prop, "Intersection", "Intersection lines");
+  RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+  prop = RNA_def_property(srna, "enable_modifier_mark", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "types", MOD_FEATURE_LINE_MODIFIER_MARK);
+  RNA_def_property_ui_text(prop, "Modifier Mark", "Modifier mark lines");
+  RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
+  RNA_def_property_ui_text(prop, "Target", "GPencil object to put the stroke result");
+  RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
+  RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
+
+  prop = RNA_def_property(srna, "replace", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_ui_text(prop, "Replace", "Replace existing GP frames");
+  RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+  prop = RNA_def_property(srna, "layer", PROP_INT, PROP_NO

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list