[Bf-blender-cvs] [1f6c2507f80] master: Cleanup: Remove legacy dupli system from point cloud object

Hans Goudey noreply at git.blender.org
Tue Mar 29 17:19:53 CEST 2022


Commit: 1f6c2507f80ce4330fd9ddad8b4ea62086008012
Author: Hans Goudey
Date:   Tue Mar 29 10:16:05 2022 -0500
Branches: master
https://developer.blender.org/rB1f6c2507f80ce4330fd9ddad8b4ea62086008012

Cleanup: Remove legacy dupli system from point cloud object

The "dupli" system now has a faster, more powerful, and more flexible
alternative with geometry nodes. Since the point cloud objects haven't
been exposed in the non-experimental UI yet, we can remove the dupli
implementation and the panel for the object type.

Differential Revision: https://developer.blender.org/D14482

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

M	release/scripts/startup/bl_ui/properties_object.py
M	source/blender/blenkernel/intern/object_dupli.cc
M	source/blender/makesrna/intern/rna_object.c

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

diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index 89f840306e1..44c30cf4372 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -246,7 +246,7 @@ class OBJECT_PT_instancing(ObjectButtonsPanel, Panel):
     def poll(cls, context):
         ob = context.object
         # FONT objects need (vertex) instancing for the 'Object Font' feature
-        return (ob.type in {'MESH', 'EMPTY', 'POINTCLOUD', 'FONT'})
+        return (ob.type in {'MESH', 'EMPTY', 'FONT'})
 
     def draw(self, context):
         layout = self.layout
diff --git a/source/blender/blenkernel/intern/object_dupli.cc b/source/blender/blenkernel/intern/object_dupli.cc
index 009a7bd70be..327035971d5 100644
--- a/source/blender/blenkernel/intern/object_dupli.cc
+++ b/source/blender/blenkernel/intern/object_dupli.cc
@@ -765,68 +765,6 @@ static const DupliGenerator gen_dupli_verts_font = {
 
 /** \} */
 
-/* -------------------------------------------------------------------- */
-/** \name Dupli-Vertices Implementation (#OB_DUPLIVERTS for #PointCloud)
- * \{ */
-
-static void make_child_duplis_pointcloud(const DupliContext *ctx,
-                                         void *UNUSED(userdata),
-                                         Object *child)
-{
-  const Object *parent = ctx->object;
-  const PointCloud *pointcloud = (PointCloud *)parent->data;
-  const float(*co)[3] = pointcloud->co;
-  const float *radius = pointcloud->radius;
-  const float(*rotation)[4] = nullptr; /* TODO: add optional rotation attribute. */
-  const float(*orco)[3] = nullptr;     /* TODO: add optional texture coordinate attribute. */
-
-  /* Relative transform from parent to child space. */
-  float child_imat[4][4];
-  mul_m4_m4m4(child_imat, child->imat, parent->obmat);
-
-  for (int i = 0; i < pointcloud->totpoint; i++) {
-    /* Transform matrix from point position, radius and rotation. */
-    float quat[4] = {1.0f, 0.0f, 0.0f, 0.0f};
-    float size[3] = {1.0f, 1.0f, 1.0f};
-    if (radius) {
-      copy_v3_fl(size, radius[i]);
-    }
-    if (rotation) {
-      copy_v4_v4(quat, rotation[i]);
-    }
-
-    float space_mat[4][4];
-    loc_quat_size_to_mat4(space_mat, co[i], quat, size);
-
-    /* Make offset relative to child object using relative child transform,
-     * and apply object matrix after local vertex transform. */
-    mul_mat3_m4_v3(child_imat, space_mat[3]);
-
-    /* Create dupli object. */
-    float obmat[4][4];
-    mul_m4_m4m4(obmat, child->obmat, space_mat);
-    DupliObject *dob = make_dupli(ctx, child, obmat, i);
-    if (orco) {
-      copy_v3_v3(dob->orco, orco[i]);
-    }
-
-    /* Recursion. */
-    make_recursive_duplis(ctx, child, space_mat, i);
-  }
-}
-
-static void make_duplis_pointcloud(const DupliContext *ctx)
-{
-  make_child_duplis(ctx, nullptr, make_child_duplis_pointcloud);
-}
-
-static const DupliGenerator gen_dupli_verts_pointcloud = {
-    OB_DUPLIVERTS,         /* type */
-    make_duplis_pointcloud /* make_duplis */
-};
-
-/** \} */
-
 /* -------------------------------------------------------------------- */
 /** \name Instances Geometry Component Implementation
  * \{ */
@@ -1654,9 +1592,6 @@ static const DupliGenerator *get_dupli_generator(const DupliContext *ctx)
     if (ctx->object->type == OB_MESH) {
       return &gen_dupli_verts;
     }
-    if (ctx->object->type == OB_POINTCLOUD) {
-      return &gen_dupli_verts_pointcloud;
-    }
   }
   else if (transflag & OB_DUPLIFACES) {
     if (ctx->object->type == OB_MESH) {
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 7164f24c2f7..0b39c8e27c7 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -200,12 +200,6 @@ static EnumPropertyItem instance_items_nogroup[] = {
     {0, NULL, 0, NULL, NULL},
 };
 
-static EnumPropertyItem instance_items_pointcloud[] = {
-    {0, "NONE", 0, "None", ""},
-    {OB_DUPLIVERTS, "POINTS", 0, "Points", "Instantiate child objects on all points"},
-    {0, NULL, 0, NULL, NULL},
-};
-
 static EnumPropertyItem instance_items_empty[] = {
     {0, "NONE", 0, "None", ""},
     INSTANCE_ITEM_COLLECTION,
@@ -760,9 +754,6 @@ static const EnumPropertyItem *rna_Object_instance_type_itemf(bContext *UNUSED(C
   if (ob->type == OB_EMPTY) {
     item = instance_items_empty;
   }
-  else if (ob->type == OB_POINTCLOUD) {
-    item = instance_items_pointcloud;
-  }
   else if (ob->type == OB_FONT) {
     item = instance_items_font;
   }



More information about the Bf-blender-cvs mailing list