[Bf-blender-cvs] [f869dcaed56] rigid_deform: new empty Rigid Deform modifier

Jacques Lucke noreply at git.blender.org
Thu Jan 31 19:55:29 CET 2019


Commit: f869dcaed564b2c5e87eab2f67e655494e0175fd
Author: Jacques Lucke
Date:   Sat Dec 8 17:39:22 2018 +0100
Branches: rigid_deform
https://developer.blender.org/rBf869dcaed564b2c5e87eab2f67e655494e0175fd

new empty Rigid Deform modifier

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

M	release/scripts/startup/bl_ui/properties_data_modifier.py
M	source/blender/makesdna/DNA_modifier_types.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_rigiddeform.c
M	source/blender/modifiers/intern/MOD_util.c

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

diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 23bba83271b..1401461b091 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -1633,6 +1633,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
         col.prop(md, "thresh", text="Threshold")
         col.prop(md, "face_influence")
 
+    def RIGID_DEFORM(self, layout, ob, md):
+        layout.label(text="Hello World")
+
 
 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 9a06af14b9d..eaa585ecf95 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -92,6 +92,7 @@ typedef enum ModifierType {
 	eModifierType_MeshSequenceCache = 52,
 	eModifierType_SurfaceDeform     = 53,
 	eModifierType_WeightedNormal	= 54,
+	eModifierType_RigidDeform       = 55,
 	NUM_MODIFIER_TYPES
 } ModifierType;
 
@@ -1947,4 +1948,8 @@ enum {
 #define MOD_MESHSEQ_READ_ALL \
 	(MOD_MESHSEQ_READ_VERT | MOD_MESHSEQ_READ_POLY | MOD_MESHSEQ_READ_UV | MOD_MESHSEQ_READ_COLOR)
 
+typedef struct RigidDeformModifierData {
+	ModifierData modifier;
+} RigidDeformModifierData;
+
 #endif  /* __DNA_MODIFIER_TYPES_H__ */
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 8afa62262a1..32e9d8c3c3d 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -109,6 +109,7 @@ const EnumPropertyItem rna_enum_object_modifier_type_items[] = {
 	{eModifierType_SurfaceDeform, "SURFACE_DEFORM", ICON_MOD_MESHDEFORM, "Surface Deform", ""},
 	{eModifierType_Warp, "WARP", ICON_MOD_WARP, "Warp", ""},
 	{eModifierType_Wave, "WAVE", ICON_MOD_WAVE, "Wave", ""},
+	{eModifierType_RigidDeform, "RIGID_DEFORM", ICON_NONE, "Rigid Deform", ""},
 	{0, "", 0, N_("Simulate"), ""},
 	{eModifierType_Cloth, "CLOTH", ICON_MOD_CLOTH, "Cloth", ""},
 	{eModifierType_Collision, "COLLISION", ICON_MOD_PHYSICS, "Collision", ""},
@@ -435,6 +436,8 @@ static StructRNA *rna_Modifier_refine(struct PointerRNA *ptr)
 			return &RNA_SurfaceDeformModifier;
 		case eModifierType_WeightedNormal:
 			return &RNA_WeightedNormalModifier;
+		case eModifierType_RigidDeform:
+			return &RNA_RigidDeformModifier;
 		/* Default */
 		case eModifierType_None:
 		case eModifierType_ShapeKey:
@@ -5066,6 +5069,17 @@ static void rna_def_modifier_weightednormal(BlenderRNA *brna)
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 }
 
+static void rna_def_modifier_rigiddeform(BlenderRNA *brna)
+{
+	StructRNA *srna;
+	PropertyRNA *UNUSED(prop);
+
+	srna = RNA_def_struct(brna, "RigidDeformModifier", "Modifier");
+	RNA_def_struct_ui_text(srna, "Rigid Deform Modifier", "");
+	RNA_def_struct_sdna(srna, "RigidDeformModifierData");
+	RNA_def_struct_ui_icon(srna, ICON_NONE);
+}
+
 void RNA_def_modifier(BlenderRNA *brna)
 {
 	StructRNA *srna;
@@ -5188,6 +5202,7 @@ void RNA_def_modifier(BlenderRNA *brna)
 	rna_def_modifier_meshseqcache(brna);
 	rna_def_modifier_surfacedeform(brna);
 	rna_def_modifier_weightednormal(brna);
+	rna_def_modifier_rigiddeform(brna);
 }
 
 #endif
diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt
index d4beb416ae9..a134401c10d 100644
--- a/source/blender/modifiers/CMakeLists.txt
+++ b/source/blender/modifiers/CMakeLists.txt
@@ -82,6 +82,7 @@ set(SRC
 	intern/MOD_particleinstance.c
 	intern/MOD_particlesystem.c
 	intern/MOD_remesh.c
+	intern/MOD_rigiddeform.c
 	intern/MOD_screw.c
 	intern/MOD_shapekey.c
 	intern/MOD_shrinkwrap.c
diff --git a/source/blender/modifiers/MOD_modifiertypes.h b/source/blender/modifiers/MOD_modifiertypes.h
index 3511b0edbec..a29e498f821 100644
--- a/source/blender/modifiers/MOD_modifiertypes.h
+++ b/source/blender/modifiers/MOD_modifiertypes.h
@@ -87,6 +87,7 @@ extern ModifierTypeInfo modifierType_CorrectiveSmooth;
 extern ModifierTypeInfo modifierType_MeshSequenceCache;
 extern ModifierTypeInfo modifierType_SurfaceDeform;
 extern ModifierTypeInfo modifierType_WeightedNormal;
+extern ModifierTypeInfo modifierType_RigidDeform;
 
 /* MOD_util.c */
 void modifier_type_init(ModifierTypeInfo *types[]);
diff --git a/source/blender/modifiers/intern/MOD_rigiddeform.c b/source/blender/modifiers/intern/MOD_rigiddeform.c
new file mode 100644
index 00000000000..7f40dddde9a
--- /dev/null
+++ b/source/blender/modifiers/intern/MOD_rigiddeform.c
@@ -0,0 +1,82 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software  Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2005 by the Blender Foundation.
+ * All rights reserved.
+  * ***** END GPL LICENSE BLOCK *****
+ *
+ */
+ /** \file blender/modifiers/intern/MOD_rigiddeform.c
+ *  \ingroup modifiers
+ *
+ */
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_mesh_types.h"
+#include "DNA_modifier_types.h"
+#include "DNA_meshdata_types.h"
+
+#include "BKE_mesh.h"
+#include "BKE_modifier.h"
+
+#include "BLI_math.h"
+#include "BLI_utildefines.h"
+
+#include "MOD_util.h"
+#include "DEG_depsgraph.h"
+
+
+static void deformVerts(
+        ModifierData *md, const ModifierEvalContext *ctx,
+        Mesh *mesh, float (*vertexCos)[3],
+        int numVerts)
+{
+}
+
+static void initData(ModifierData *md)
+{
+}
+
+ ModifierTypeInfo modifierType_RigidDeform = {
+	/* name */              "Rigid Deform",
+	/* structName */        "RigidDeformModifierData",
+	/* structSize */        sizeof(RigidDeformModifierData),
+	/* type */              eModifierTypeType_OnlyDeform,
+	/* flags */             eModifierTypeFlag_AcceptsMesh,
+	/* copyData */          modifier_copyData_generic,
+ 	/* deformVerts_DM */    NULL,
+	/* deformMatrices_DM */ NULL,
+	/* deformVertsEM_DM */  NULL,
+	/* deformMatricesEM_DM*/NULL,
+	/* applyModifier_DM */  NULL,
+ 	/* deformVerts */       deformVerts,
+	/* deformMatrices */    NULL,
+	/* deformVertsEM */     NULL,
+	/* deformMatricesEM */  NULL,
+	/* applyModifier */     NULL,
+ 	/* initData */          initData,
+	/* requiredDataMask */  NULL,
+	/* freeData */          NULL,
+	/* isDisabled */        NULL,
+	/* updateDepsgraph */   NULL,
+	/* dependsOnTime */     NULL,
+	/* dependsOnNormals */	NULL,
+	/* foreachObjectLink */ NULL,
+	/* foreachIDLink */     NULL,
+	/* foreachTexLink */    NULL,
+};
\ No newline at end of file
diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c
index dca2d536a5d..c018788e6c8 100644
--- a/source/blender/modifiers/intern/MOD_util.c
+++ b/source/blender/modifiers/intern/MOD_util.c
@@ -310,5 +310,6 @@ void modifier_type_init(ModifierTypeInfo *types[])
 	INIT_TYPE(MeshSequenceCache);
 	INIT_TYPE(SurfaceDeform);
 	INIT_TYPE(WeightedNormal);
+	INIT_TYPE(RigidDeform);
 #undef INIT_TYPE
 }



More information about the Bf-blender-cvs mailing list