[Bf-blender-cvs] [e50553c61a2] geometry-nodes: Empty Modifier: Fix build and put in the right order

Dalai Felinto noreply at git.blender.org
Sat Nov 14 01:52:37 CET 2020


Commit: e50553c61a2d0331b650d2d3d54ef9cb479eebd5
Author: Dalai Felinto
Date:   Sat Nov 14 01:36:47 2020 +0100
Branches: geometry-nodes
https://developer.blender.org/rBe50553c61a2d0331b650d2d3d54ef9cb479eebd5

Empty Modifier: Fix build and put in the right order

Bypassing the macro that creates modifiers to allow the enum to be
referring to the Empty modifier, but the internal struct in the code to
be Nodes.

Also fix the name of the new created modifiers to be "Empty".

Fix was built with rBb458ea6b23381a9acb90dbbd73ced678e1d404c5.

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

M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/modifiers/intern/MOD_nodes.cc
M	source/blender/modifiers/intern/MOD_util.c

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

diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 5b3bd61a1a4..5b21fdb9cec 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -143,6 +143,7 @@ const EnumPropertyItem rna_enum_object_modifier_type_items[] = {
      ICON_MOD_EDGESPLIT,
      "Edge Split",
      "Split away joined faces at the edges"},
+    {eModifierType_Empty, "EMPTY", ICON_MESH_DATA, "Empty", ""}, /* TODO: Use correct icon. */
     {eModifierType_Mask,
      "MASK",
      ICON_MOD_MASK,
@@ -163,7 +164,6 @@ const EnumPropertyItem rna_enum_object_modifier_type_items[] = {
      ICON_MOD_MULTIRES,
      "Multiresolution",
      "Subdivide the mesh in a way that allows editing the higher subdivision levels"},
-    {eModifierType_Empty, "EMPTY", ICON_MESH_DATA, "Empty", ""}, /* TODO: Use correct icon. */
     {eModifierType_Remesh,
      "REMESH",
      ICON_MOD_REMESH,
diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc
index 6dfc2f2bdba..4204b0e1013 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -987,7 +987,7 @@ static void freeData(ModifierData *md)
 }
 
 ModifierTypeInfo modifierType_Nodes = {
-    /* name */ "Nodes",
+    /* name */ "Empty",
     /* structName */ "NodesModifierData",
     /* structSize */ sizeof(NodesModifierData),
 #ifdef WITH_GEOMETRY_NODES
diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c
index 32d40027537..611d6de72da 100644
--- a/source/blender/modifiers/intern/MOD_util.c
+++ b/source/blender/modifiers/intern/MOD_util.c
@@ -342,9 +342,9 @@ void modifier_type_init(ModifierTypeInfo *types[])
   INIT_TYPE(MeshSequenceCache);
   INIT_TYPE(SurfaceDeform);
   INIT_TYPE(WeightedNormal);
-  INIT_TYPE(Nodes);
   INIT_TYPE(MeshToVolume);
   INIT_TYPE(VolumeDisplace);
   INIT_TYPE(VolumeToMesh);
 #undef INIT_TYPE
+  types[eModifierType_Empty] = &modifierType_Nodes;
 }



More information about the Bf-blender-cvs mailing list