Cleanup: split `BKE_anim.h` and `anim.c` into smaller pieces
authorSybren A. Stüvel <sybren@blender.org>
Fri, 3 Apr 2020 09:35:04 +0000 (11:35 +0200)
committerSybren A. Stüvel <sybren@blender.org>
Fri, 3 Apr 2020 10:13:51 +0000 (12:13 +0200)
The files are now split up into the following sections:
- `BKE_anim_path.h` and `anim_path.c` for path/curve functions.
- `BKE_anim_visualization.h` and `anim_visualizationanim_path.c` for
  animation visualization (mostly motion paths).
- `BKE_duplilist.h` for DupliList function declarations. These were
  already implemented in `object_dupli.c`, so they were rather out of
  place being declared in `BKE_anim.h` in the first place.

No functional changes.

38 files changed:
source/blender/blenkernel/BKE_anim_path.h [new file with mode: 0644]
source/blender/blenkernel/BKE_anim_visualization.h [new file with mode: 0644]
source/blender/blenkernel/BKE_duplilist.h [moved from source/blender/blenkernel/BKE_anim.h with 60% similarity]
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/anim_path.c [moved from source/blender/blenkernel/intern/anim.c with 60% similarity]
source/blender/blenkernel/intern/anim_visualization.c [new file with mode: 0644]
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/armature_update.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/object_dupli.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/scene.c
source/blender/blenloader/intern/versioning_250.c
source/blender/blenloader/intern/versioning_260.c
source/blender/depsgraph/intern/depsgraph_query_iter.cc
source/blender/draw/engines/overlay/overlay_extra.c
source/blender/draw/intern/draw_hair.c
source/blender/draw/intern/draw_manager.c
source/blender/draw/intern/draw_manager_data.c
source/blender/editors/armature/pose_edit.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_edit.c
source/blender/editors/space_info/info_stats.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/transform/transform_snap_object.c
source/blender/io/alembic/intern/abc_exporter.cc
source/blender/io/usd/intern/abstract_hierarchy_iterator.cc
source/blender/io/usd/intern/usd_hierarchy_iterator.cc
source/blender/io/usd/intern/usd_writer_mesh.cc
source/blender/makesrna/intern/rna_depsgraph.c
source/blender/makesrna/intern/rna_object_api.c

diff --git a/source/blender/blenkernel/BKE_anim_path.h b/source/blender/blenkernel/BKE_anim_path.h
new file mode 100644 (file)
index 0000000..64bcede
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * 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) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ */
+#ifndef __BKE_ANIM_PATH_H__
+#define __BKE_ANIM_PATH_H__
+
+/** \file
+ * \ingroup bke
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct ListBase;
+struct Object;
+struct Path;
+
+/* ---------------------------------------------------- */
+/* Curve Paths */
+
+void free_path(struct Path *path);
+void calc_curvepath(struct Object *ob, struct ListBase *nurbs);
+int where_on_path(struct Object *ob,
+                  float ctime,
+                  float vec[4],
+                  float dir[3],
+                  float quat[4],
+                  float *radius,
+                  float *weight);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/source/blender/blenkernel/BKE_anim_visualization.h b/source/blender/blenkernel/BKE_anim_visualization.h
new file mode 100644 (file)
index 0000000..5dcbfa0
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * 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) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ */
+#ifndef __BKE_ANIM_VISUALIZATION_H__
+#define __BKE_ANIM_VISUALIZATION_H__
+
+/** \file
+ * \ingroup bke
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct Object;
+struct ReportList;
+struct Scene;
+struct bAnimVizSettings;
+struct bMotionPath;
+struct bPoseChannel;
+
+/* ---------------------------------------------------- */
+/* Animation Visualization */
+
+void animviz_settings_init(struct bAnimVizSettings *avs);
+
+struct bMotionPath *animviz_copy_motionpath(const struct bMotionPath *mpath_src);
+
+void animviz_free_motionpath_cache(struct bMotionPath *mpath);
+void animviz_free_motionpath(struct bMotionPath *mpath);
+
+struct bMotionPath *animviz_verify_motionpaths(struct ReportList *reports,
+                                               struct Scene *scene,
+                                               struct Object *ob,
+                                               struct bPoseChannel *pchan);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
similarity index 60%
rename from source/blender/blenkernel/BKE_anim.h
rename to source/blender/blenkernel/BKE_duplilist.h
index 38af96c2ff059432cd4ac523882215efb4b1e75b..71b6d06b450c5a8128534b338a0daf4c41a07fd8 100644 (file)
@@ -16,8 +16,8 @@
  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
  * All rights reserved.
  */
-#ifndef __BKE_ANIM_H__
-#define __BKE_ANIM_H__
+#ifndef __BKE_DUPLILIST_H__
+#define __BKE_DUPLILIST_H__
 
 /** \file
  * \ingroup bke
@@ -31,40 +31,7 @@ struct Depsgraph;
 struct ListBase;
 struct Object;
 struct ParticleSystem;
-struct Path;
-struct ReportList;
 struct Scene;
-struct bAnimVizSettings;
-struct bMotionPath;
-struct bPoseChannel;
-
-/* ---------------------------------------------------- */
-/* Animation Visualization */
-
-void animviz_settings_init(struct bAnimVizSettings *avs);
-
-struct bMotionPath *animviz_copy_motionpath(const struct bMotionPath *mpath_src);
-
-void animviz_free_motionpath_cache(struct bMotionPath *mpath);
-void animviz_free_motionpath(struct bMotionPath *mpath);
-
-struct bMotionPath *animviz_verify_motionpaths(struct ReportList *reports,
-                                               struct Scene *scene,
-                                               struct Object *ob,
-                                               struct bPoseChannel *pchan);
-
-/* ---------------------------------------------------- */
-/* Curve Paths */
-
-void free_path(struct Path *path);
-void calc_curvepath(struct Object *ob, struct ListBase *nurbs);
-int where_on_path(struct Object *ob,
-                  float ctime,
-                  float vec[4],
-                  float dir[3],
-                  float quat[4],
-                  float *radius,
-                  float *weight);
 
 /* ---------------------------------------------------- */
 /* Dupli-Geometry */
index 1e230e5af3a31ce81dec5675bd9f2831a3f8fb6d..ba4339f56ace13ce58aecd4481ebfcd9eac3e13e 100644 (file)
@@ -70,8 +70,9 @@ set(SRC
   intern/DerivedMesh.c
   intern/action.c
   intern/addon.c
-  intern/anim.c
+  intern/anim_path.c
   intern/anim_sys.c
+  intern/anim_visualization.c
   intern/appdir.c
   intern/armature.c
   intern/armature_update.c
@@ -250,7 +251,8 @@ set(SRC
   BKE_DerivedMesh.h
   BKE_action.h
   BKE_addon.h
-  BKE_anim.h
+  BKE_anim_path.h
+  BKE_anim_visualization.h
   BKE_animsys.h
   BKE_appdir.h
   BKE_armature.h
@@ -286,6 +288,7 @@ set(SRC
   BKE_deform.h
   BKE_displist.h
   BKE_displist_tangent.h
+  BKE_duplilist.h
   BKE_dynamicpaint.h
   BKE_editlattice.h
   BKE_editmesh.h
index c332939e90654df7b6cffe0c31f25ddcf95f2da6..478609f2f3f337d627ae9e5e919b1cd93c23563b 100644 (file)
@@ -43,7 +43,7 @@
 #include "BLT_translation.h"
 
 #include "BKE_action.h"
-#include "BKE_anim.h"
+#include "BKE_anim_visualization.h"
 #include "BKE_animsys.h"
 #include "BKE_armature.h"
 #include "BKE_constraint.h"
similarity index 60%
rename from source/blender/blenkernel/intern/anim.c
rename to source/blender/blenkernel/intern/anim_path.c
index 8804e7ae26c84b83bdc348de349ab3b643179612..e073bd6fc824e5eb16db2a09dad0e2b4a3d2d8d0 100644 (file)
 
 #include "MEM_guardedalloc.h"
 
-#include <stdlib.h>
+#include <float.h>
 
-#include "BLI_dlrbTree.h"
-#include "BLI_listbase.h"
-#include "BLI_math.h"
-
-#include "BLT_translation.h"
-
-#include "DNA_anim_types.h"
-#include "DNA_armature_types.h"
+#include "DNA_curve_types.h"
 #include "DNA_key_types.h"
-#include "DNA_scene_types.h"
+#include "DNA_object_types.h"
+
+#include "BLI_math_vector.h"
 
-#include "BKE_action.h"
-#include "BKE_anim.h"
-#include "BKE_animsys.h"
+#include "BKE_anim_path.h"
 #include "BKE_curve.h"
 #include "BKE_key.h"
-#include "BKE_main.h"
-#include "BKE_object.h"
-#include "BKE_particle.h"
-#include "BKE_report.h"
-#include "BKE_scene.h"
-
-#include "DEG_depsgraph.h"
-#include "DEG_depsgraph_build.h"
-#include "DEG_depsgraph_query.h"
-
-#include "GPU_batch.h"
 
 #include "CLG_log.h"
 
 static CLG_LogRef LOG = {"bke.anim"};
 
-/* --------------------- */
-/* forward declarations */
-
-/* ******************************************************************** */
-/* Animation Visualization */
-
-/* Initialize the default settings for animation visualization */
-void animviz_settings_init(bAnimVizSettings *avs)
-{
-  /* sanity check */
-  if (avs == NULL) {
-    return;
-  }
-
-  /* path settings */
-  avs->path_bc = avs->path_ac = 10;
-
-  avs->path_sf = 1;   /* xxx - take from scene instead? */
-  avs->path_ef = 250; /* xxx - take from scene instead? */
-
-  avs->path_viewflag = (MOTIONPATH_VIEW_KFRAS | MOTIONPATH_VIEW_KFNOS);
-
-  avs->path_step = 1;
-
-  avs->path_bakeflag |= MOTIONPATH_BAKE_HEADS;
-}
-
-/* ------------------- */
-
-/* Free the given motion path's cache */
-void animviz_free_motionpath_cache(bMotionPath *mpath)
-{
-  /* sanity check */
-  if (mpath == NULL) {
-    return;
-  }
-
-  /* free the path if necessary */
-  if (mpath->points) {
-    MEM_freeN(mpath->points);
-  }
-
-  GPU_VERTBUF_DISCARD_SAFE(mpath->points_vbo);
-  GPU_BATCH_DISCARD_SAFE(mpath->batch_line);
-  GPU_BATCH_DISCARD_SAFE(mpath->batch_points);
-
-  /* reset the relevant parameters */
-  mpath->points = NULL;
-  mpath->length = 0;
-}
-
-/* Free the given motion path instance and its data
- * NOTE: this frees the motion path given!
- */
-void animviz_free_motionpath(bMotionPath *mpath)
-{
-  /* sanity check */
-  if (mpath == NULL) {
-    return;
-  }
-
-  /* free the cache first */
-  animviz_free_motionpath_cache(mpath);
-
-  /* now the instance itself */
-  MEM_freeN(mpath);
-}
-
-/* ------------------- */
-
-/* Make a copy of motionpath data, so that viewing with copy on write works */
-bMotionPath *animviz_copy_motionpath(const bMotionPath *mpath_src)
-{
-  bMotionPath *mpath_dst;
-
-  if (mpath_src == NULL) {
-    return NULL;
-  }
-
-  mpath_dst = MEM_dupallocN(mpath_src);
-  mpath_dst->points = MEM_dupallocN(mpath_src->points);
-
-  /* should get recreated on draw... */
-  mpath_dst->points_vbo = NULL;
-  mpath_dst->batch_line = NULL;
-  mpath_dst->batch_points = NULL;
-
-  return mpath_dst;
-}
-
-/* ------------------- */
-
-/**
- * Setup motion paths for the given data.
- * \note Only used when explicitly calculating paths on bones which may/may not be consider already
- *
- * \param scene: Current scene (for frame ranges, etc.)
- * \param ob: Object to add paths for (must be provided)
- * \param pchan: Posechannel to add paths for (optional; if not provided, object-paths are assumed)
- */
-bMotionPath *animviz_verify_motionpaths(ReportList *reports,
-                                        Scene *scene,
-                                        Object *ob,
-                                        bPoseChannel *pchan)
-{
-  bAnimVizSettings *avs;
-  bMotionPath *mpath, **dst;
-
-  /* sanity checks */
-  if (ELEM(NULL, scene, ob)) {
-    return NULL;
-  }
-
-  /* get destination data */
-  if (pchan) {
-    /* paths for posechannel - assume that posechannel belongs to the object */
-    avs = &ob->pose->avs;
-    dst = &pchan->mpath;
-  }
-  else {
-    /* paths for object */
-    avs = &ob->avs;
-    dst = &ob->mpath;
-  }
-
-  /* avoid 0 size allocs */
-  if (avs->path_sf >= avs->path_ef) {
-    BKE_reportf(reports,
-                RPT_ERROR,
-                "Motion path frame extents invalid for %s (%d to %d)%s",
-                (pchan) ? pchan->name : ob->id.name,
-                avs->path_sf,
-                avs->path_ef,
-                (avs->path_sf == avs->path_ef) ? TIP_(", cannot have single-frame paths") : "");
-    return NULL;
-  }
-
-  /* if there is already a motionpath, just return that,
-   * provided it's settings are ok (saves extra free+alloc)
-   */
-  if (*dst != NULL) {
-    int expected_length = avs->path_ef - avs->path_sf;
-
-    mpath = *dst;
-
-    /* Path is "valid" if length is valid,
-     * but must also be of the same length as is being requested. */
-    if ((mpath->start_frame != mpath->end_frame) && (mpath->length > 0)) {
-      /* outer check ensures that we have some curve data for this path */
-      if (mpath->length == expected_length) {
-        /* return/use this as it is already valid length */
-        return mpath;
-      }
-      else {
-        /* clear the existing path (as the range has changed), and reallocate below */
-        animviz_free_motionpath_cache(mpath);
-      }
-    }
-  }
-  else {
-    /* create a new motionpath, and assign it */
-    mpath = MEM_callocN(sizeof(bMotionPath), "bMotionPath");
-    *dst = mpath;
-  }
-
-  /* set settings from the viz settings */
-  mpath->start_frame = avs->path_sf;
-  mpath->end_frame = avs->path_ef;
-
-  mpath->length = mpath->end_frame - mpath->start_frame;
-
-  if (avs->path_bakeflag & MOTIONPATH_BAKE_HEADS) {
-    mpath->flag |= MOTIONPATH_FLAG_BHEAD;
-  }
-  else {
-    mpath->flag &= ~MOTIONPATH_FLAG_BHEAD;
-  }
-
-  /* set default custom values */
-  mpath->color[0] = 1.0; /* Red */
-  mpath->color[1] = 0.0;
-  mpath->color[2] = 0.0;
-
-  mpath->line_thickness = 2;
-  mpath->flag |= MOTIONPATH_FLAG_LINES; /* draw lines by default */
-
-  /* allocate a cache */
-  mpath->points = MEM_callocN(sizeof(bMotionPathVert) * mpath->length, "bMotionPathVerts");
-
-  /* tag viz settings as currently having some path(s) which use it */
-  avs->path_bakeflag |= MOTIONPATH_BAKE_HAS_PATHS;
-
-  /* return it */
-  return mpath;
-}
-
 /* ******************************************************************** */
 /* Curve Paths - for curve deforms and/or curve following */
 
diff --git a/source/blender/blenkernel/intern/anim_visualization.c b/source/blender/blenkernel/intern/anim_visualization.c
new file mode 100644 (file)
index 0000000..04dbe41
--- /dev/null
@@ -0,0 +1,228 @@
+/*
+ * 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) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup bke
+ */
+#include "MEM_guardedalloc.h"
+
+#include "DNA_action_types.h"
+#include "DNA_anim_types.h"
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+
+#include "BLT_translation.h"
+
+#include "BKE_anim_visualization.h"
+#include "BKE_report.h"
+
+#include "GPU_batch.h"
+
+/* ******************************************************************** */
+/* Animation Visualization */
+
+/* Initialize the default settings for animation visualization */
+void animviz_settings_init(bAnimVizSettings *avs)
+{
+  /* sanity check */
+  if (avs == NULL) {
+    return;
+  }
+
+  /* path settings */
+  avs->path_bc = avs->path_ac = 10;
+
+  avs->path_sf = 1;   /* xxx - take from scene instead? */
+  avs->path_ef = 250; /* xxx - take from scene instead? */
+
+  avs->path_viewflag = (MOTIONPATH_VIEW_KFRAS | MOTIONPATH_VIEW_KFNOS);
+
+  avs->path_step = 1;
+
+  avs->path_bakeflag |= MOTIONPATH_BAKE_HEADS;
+}
+
+/* ------------------- */
+
+/* Free the given motion path's cache */
+void animviz_free_motionpath_cache(bMotionPath *mpath)
+{
+  /* sanity check */
+  if (mpath == NULL) {
+    return;
+  }
+
+  /* free the path if necessary */
+  if (mpath->points) {
+    MEM_freeN(mpath->points);
+  }
+
+  GPU_VERTBUF_DISCARD_SAFE(mpath->points_vbo);
+  GPU_BATCH_DISCARD_SAFE(mpath->batch_line);
+  GPU_BATCH_DISCARD_SAFE(mpath->batch_points);
+
+  /* reset the relevant parameters */
+  mpath->points = NULL;
+  mpath->length = 0;
+}
+
+/* Free the given motion path instance and its data
+ * NOTE: this frees the motion path given!
+ */
+void animviz_free_motionpath(bMotionPath *mpath)
+{
+  /* sanity check */
+  if (mpath == NULL) {
+    return;
+  }
+
+  /* free the cache first */
+  animviz_free_motionpath_cache(mpath);
+
+  /* now the instance itself */
+  MEM_freeN(mpath);
+}
+
+/* ------------------- */
+
+/* Make a copy of motionpath data, so that viewing with copy on write works */
+bMotionPath *animviz_copy_motionpath(const bMotionPath *mpath_src)
+{
+  bMotionPath *mpath_dst;
+
+  if (mpath_src == NULL) {
+    return NULL;
+  }
+
+  mpath_dst = MEM_dupallocN(mpath_src);
+  mpath_dst->points = MEM_dupallocN(mpath_src->points);
+
+  /* should get recreated on draw... */
+  mpath_dst->points_vbo = NULL;
+  mpath_dst->batch_line = NULL;
+  mpath_dst->batch_points = NULL;
+
+  return mpath_dst;
+}
+
+/* ------------------- */
+
+/**
+ * Setup motion paths for the given data.
+ * \note Only used when explicitly calculating paths on bones which may/may not be consider already
+ *
+ * \param scene: Current scene (for frame ranges, etc.)
+ * \param ob: Object to add paths for (must be provided)
+ * \param pchan: Posechannel to add paths for (optional; if not provided, object-paths are assumed)
+ */
+bMotionPath *animviz_verify_motionpaths(ReportList *reports,
+                                        Scene *scene,
+                                        Object *ob,
+                                        bPoseChannel *pchan)
+{
+  bAnimVizSettings *avs;
+  bMotionPath *mpath, **dst;
+
+  /* sanity checks */
+  if (ELEM(NULL, scene, ob)) {
+    return NULL;
+  }
+
+  /* get destination data */
+  if (pchan) {
+    /* paths for posechannel - assume that posechannel belongs to the object */
+    avs = &ob->pose->avs;
+    dst = &pchan->mpath;
+  }
+  else {
+    /* paths for object */
+    avs = &ob->avs;
+    dst = &ob->mpath;
+  }
+
+  /* avoid 0 size allocs */
+  if (avs->path_sf >= avs->path_ef) {
+    BKE_reportf(reports,
+                RPT_ERROR,
+                "Motion path frame extents invalid for %s (%d to %d)%s",
+                (pchan) ? pchan->name : ob->id.name,
+                avs->path_sf,
+                avs->path_ef,
+                (avs->path_sf == avs->path_ef) ? TIP_(", cannot have single-frame paths") : "");
+    return NULL;
+  }
+
+  /* if there is already a motionpath, just return that,
+   * provided it's settings are ok (saves extra free+alloc)
+   */
+  if (*dst != NULL) {
+    int expected_length = avs->path_ef - avs->path_sf;
+
+    mpath = *dst;
+
+    /* Path is "valid" if length is valid,
+     * but must also be of the same length as is being requested. */
+    if ((mpath->start_frame != mpath->end_frame) && (mpath->length > 0)) {
+      /* outer check ensures that we have some curve data for this path */
+      if (mpath->length == expected_length) {
+        /* return/use this as it is already valid length */
+        return mpath;
+      }
+      else {
+        /* clear the existing path (as the range has changed), and reallocate below */
+        animviz_free_motionpath_cache(mpath);
+      }
+    }
+  }
+  else {
+    /* create a new motionpath, and assign it */
+    mpath = MEM_callocN(sizeof(bMotionPath), "bMotionPath");
+    *dst = mpath;
+  }
+
+  /* set settings from the viz settings */
+  mpath->start_frame = avs->path_sf;
+  mpath->end_frame = avs->path_ef;
+
+  mpath->length = mpath->end_frame - mpath->start_frame;
+
+  if (avs->path_bakeflag & MOTIONPATH_BAKE_HEADS) {
+    mpath->flag |= MOTIONPATH_FLAG_BHEAD;
+  }
+  else {
+    mpath->flag &= ~MOTIONPATH_FLAG_BHEAD;
+  }
+
+  /* set default custom values */
+  mpath->color[0] = 1.0; /* Red */
+  mpath->color[1] = 0.0;
+  mpath->color[2] = 0.0;
+
+  mpath->line_thickness = 2;
+  mpath->flag |= MOTIONPATH_FLAG_LINES; /* draw lines by default */
+
+  /* allocate a cache */
+  mpath->points = MEM_callocN(sizeof(bMotionPathVert) * mpath->length, "bMotionPathVerts");
+
+  /* tag viz settings as currently having some path(s) which use it */
+  avs->path_bakeflag |= MOTIONPATH_BAKE_HAS_PATHS;
+
+  /* return it */
+  return mpath;
+}
index 444d63e33d0803a39d624761d396b32d966d7605..38a9864fd360d8f0315014e968b04eb6f474fcb3 100644 (file)
@@ -51,7 +51,7 @@
 #include "DNA_scene_types.h"
 
 #include "BKE_action.h"
-#include "BKE_anim.h"
+#include "BKE_anim_visualization.h"
 #include "BKE_animsys.h"
 #include "BKE_armature.h"
 #include "BKE_constraint.h"
index e51b9ea85d12d55a7b05d74a35601f21f2b708ae..d0a5e4348b9aab39de94e7e2451d504360d3eac4 100644 (file)
@@ -35,7 +35,7 @@
 #include "DNA_scene_types.h"
 
 #include "BKE_action.h"
-#include "BKE_anim.h"
+#include "BKE_anim_path.h"
 #include "BKE_armature.h"
 #include "BKE_curve.h"
 #include "BKE_displist.h"
index 04adb642fc0dd16d9fdac2e915e8531f0f80ba4c..28ce62c3de237babe57b15fed0ed44b4ccc4e672 100644 (file)
@@ -52,7 +52,7 @@
 #include "DNA_tracking_types.h"
 
 #include "BKE_action.h"
-#include "BKE_anim.h" /* for the curve calculation part */
+#include "BKE_anim_path.h"
 #include "BKE_armature.h"
 #include "BKE_bvhutils.h"
 #include "BKE_cachefile.h"
index dc2f603aa5cc62505530d980536237c5f34cbef6..907e7eb66ecd717b8980174347754310c26d84d1 100644 (file)
@@ -42,7 +42,7 @@
 #include "BLI_string.h"
 #include "BLI_utildefines.h"
 
-#include "BKE_anim.h"
+#include "BKE_anim_path.h"
 #include "BKE_curve.h"
 #include "BKE_displist.h"
 #include "BKE_font.h"
index f7ddc4385ac3a6b46776553ef942ebe7d2370480..984a7a12b941bd8230ebf11cf72607c40b894297 100644 (file)
@@ -49,7 +49,7 @@
 
 #include "PIL_time.h"
 
-#include "BKE_anim.h" /* needed for where_on_path */
+#include "BKE_anim_path.h" /* needed for where_on_path */
 #include "BKE_bvhutils.h"
 #include "BKE_collection.h"
 #include "BKE_collision.h"
index a4da7ceb86125670344cb857c5403aafc51e983c..e8ff2ccc1af8a5e2f7c22ee1d55960f3c23c73d7 100644 (file)
@@ -48,7 +48,7 @@
 #include "DNA_packedFile_types.h"
 #include "DNA_vfont_types.h"
 
-#include "BKE_anim.h"
+#include "BKE_anim_path.h"
 #include "BKE_curve.h"
 #include "BKE_font.h"
 #include "BKE_global.h"
index 3f353d6d5769d9561bf21535b08c91f2996bc66b..6541249304998cbf00f8ff06b894efc7fa399395 100644 (file)
@@ -45,7 +45,7 @@
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
 
-#include "BKE_anim.h"
+#include "BKE_anim_path.h"
 #include "BKE_animsys.h"
 #include "BKE_curve.h"
 #include "BKE_displist.h"
index 7a2e9583aa11545263433cace31a4a9a8e95366a..3f94958c7799868b9ae508c4944da232654ab653 100644 (file)
@@ -68,7 +68,8 @@
 
 #include "BKE_DerivedMesh.h"
 #include "BKE_action.h"
-#include "BKE_anim.h"
+#include "BKE_anim_path.h"
+#include "BKE_anim_visualization.h"
 #include "BKE_animsys.h"
 #include "BKE_armature.h"
 #include "BKE_camera.h"
@@ -77,6 +78,7 @@
 #include "BKE_curve.h"
 #include "BKE_deform.h"
 #include "BKE_displist.h"
+#include "BKE_duplilist.h"
 #include "BKE_editmesh.h"
 #include "BKE_effect.h"
 #include "BKE_fcurve.h"
index 1217d230d0d7f584bd9118fecf28b7e1fcac2c5a..f093b8c4211ccc1cc74b9f4af2f816efa1cf9231 100644 (file)
@@ -40,9 +40,9 @@
 #include "DNA_scene_types.h"
 #include "DNA_vfont_types.h"
 
-#include "BKE_anim.h"
 #include "BKE_animsys.h"
 #include "BKE_collection.h"
+#include "BKE_duplilist.h"
 #include "BKE_editmesh.h"
 #include "BKE_font.h"
 #include "BKE_global.h"
index f110a2bd3aee21795c7ecd19ff57942b224efc11..067eb6ab18e5cfc89c7acc82301bc22854808cba 100644 (file)
@@ -50,7 +50,7 @@
 
 #include "BLT_translation.h"
 
-#include "BKE_anim.h"
+#include "BKE_anim_path.h"
 #include "BKE_animsys.h"
 
 #include "BKE_boids.h"
index 76088867997d04588c29470cd4a7d83ff0ddae9c..b1cff53d399d5f5472ed3de005ae952af8d6708a 100644 (file)
@@ -51,7 +51,6 @@
 
 #include "PIL_time.h"
 
-#include "BKE_anim.h"
 #include "BKE_appdir.h"
 #include "BKE_cloth.h"
 #include "BKE_collection.h"
index b12402d74fcdff0dcf18057f3d81b41d7682abba..0011247fcd04e1395db6809b18b7b653e869ecc7 100644 (file)
 #include "BLT_translation.h"
 
 #include "BKE_action.h"
-#include "BKE_anim.h"
 #include "BKE_animsys.h"
 #include "BKE_armature.h"
 #include "BKE_cachefile.h"
 #include "BKE_collection.h"
 #include "BKE_colortools.h"
 #include "BKE_curveprofile.h"
+#include "BKE_duplilist.h"
 #include "BKE_editmesh.h"
 #include "BKE_fcurve.h"
 #include "BKE_freestyle.h"
index fed0cbda466cf04037b31dbbdfb9e1ba42031547..bb80aaaaa5a224cea320ae3a69590db8a275c253 100644 (file)
@@ -61,7 +61,7 @@
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
 
-#include "BKE_anim.h"
+#include "BKE_anim_visualization.h"
 #include "BKE_armature.h"
 #include "BKE_colortools.h"
 #include "BKE_global.h"  // for G
index 26de003dc1712b589d6b116001d123434d394c4d..f1dcbba8e901a1c04a5fa5de8016662c070099cb 100644 (file)
@@ -52,7 +52,7 @@
 
 #include "BLT_translation.h"
 
-#include "BKE_anim.h"
+#include "BKE_anim_visualization.h"
 #include "BKE_image.h"
 #include "BKE_main.h"  // for Main
 #include "BKE_mesh.h"  // for ME_ defines (patching)
index 427a16adfc4b4705c15d7a6593376385c5d48ea8..fadd0beb6365286fb6f6e9f2389af8bc4717ea94 100644 (file)
@@ -29,7 +29,7 @@
 #include "MEM_guardedalloc.h"
 
 extern "C" {
-#include "BKE_anim.h"
+#include "BKE_duplilist.h"
 #include "BKE_idprop.h"
 #include "BKE_layer.h"
 #include "BKE_node.h"
index bc0797eff0d322cf3ed2cc4e1e07f6218b2ab1df..80691a6c2ade39f17b81de3dd37dc0f2b0d9209a 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "UI_resources.h"
 
-#include "BKE_anim.h"
+#include "BKE_anim_path.h"
 #include "BKE_camera.h"
 #include "BKE_constraint.h"
 #include "BKE_curve.h"
index 048adccc4e645f507f2918be7c997fc690465d9d..0fe68950cdedc361651f86f089b78bfb48199653 100644 (file)
@@ -32,7 +32,7 @@
 #include "DNA_modifier_types.h"
 #include "DNA_particle_types.h"
 
-#include "BKE_anim.h"
+#include "BKE_duplilist.h"
 
 #include "GPU_batch.h"
 #include "GPU_shader.h"
index 1b169dbee1d5415f9c7d86028d51685660bfecd8..280e82ef473f1b09140d86b51bdf162f1990565d 100644 (file)
 
 #include "BLF_api.h"
 
-#include "BKE_anim.h"
 #include "BKE_colortools.h"
 #include "BKE_context.h"
 #include "BKE_curve.h"
+#include "BKE_duplilist.h"
 #include "BKE_editmesh.h"
 #include "BKE_global.h"
 #include "BKE_gpencil.h"
index fd13e22ff4edaa9985e4f5596995429fb43885fa..ae18636227da009990153c304c9d515a2b30a1ea 100644 (file)
@@ -22,8 +22,8 @@
 
 #include "draw_manager.h"
 
-#include "BKE_anim.h"
 #include "BKE_curve.h"
+#include "BKE_duplilist.h"
 #include "BKE_global.h"
 #include "BKE_image.h"
 #include "BKE_mesh.h"
index 09b6cd9c8cc84a72d09520fe9a11b3d8333aa4fd..5c75e8f61871836d1bced0682b084d82c1106e02 100644 (file)
@@ -33,7 +33,7 @@
 #include "DNA_scene_types.h"
 
 #include "BKE_action.h"
-#include "BKE_anim.h"
+#include "BKE_anim_visualization.h"
 #include "BKE_armature.h"
 #include "BKE_context.h"
 #include "BKE_deform.h"
index 65d3196d8c31b2187a0ee542ae44cea9adad76bb..e800203ae7912041441142a50517c027aeab6d43 100644 (file)
@@ -53,7 +53,6 @@
 #include "BLT_translation.h"
 
 #include "BKE_action.h"
-#include "BKE_anim.h"
 #include "BKE_animsys.h"
 #include "BKE_armature.h"
 #include "BKE_camera.h"
@@ -62,6 +61,7 @@
 #include "BKE_context.h"
 #include "BKE_curve.h"
 #include "BKE_displist.h"
+#include "BKE_duplilist.h"
 #include "BKE_effect.h"
 #include "BKE_font.h"
 #include "BKE_gpencil_geom.h"
index 7faad5cdd0e9a661a14102981060d6853d8e5788..80ee03ca86049083fcb9d20161d67e69787b2b28 100644 (file)
@@ -54,7 +54,7 @@
 
 #include "IMB_imbuf_types.h"
 
-#include "BKE_anim.h"
+#include "BKE_anim_visualization.h"
 #include "BKE_collection.h"
 #include "BKE_constraint.h"
 #include "BKE_context.h"
index e0e6edda8500888381850b041dc6ca866e2a04eb..a91a11b2465062d2fb2147e02574719f63924b90 100644 (file)
@@ -40,7 +40,6 @@
 
 #include "BLT_translation.h"
 
-#include "BKE_anim.h"
 #include "BKE_blender_version.h"
 #include "BKE_curve.h"
 #include "BKE_displist.h"
index 9adc15ccb6176abdaa89aefb392560cd5a94ab2f..dffe52745e4012f398e648994ff994f889f268b0 100644 (file)
@@ -44,8 +44,8 @@
 #include "GPU_immediate.h"
 #include "GPU_state.h"
 
-#include "BKE_anim.h" /* for duplis */
 #include "BKE_context.h"
+#include "BKE_duplilist.h"
 #include "BKE_editmesh.h"
 #include "BKE_layer.h"
 #include "BKE_main.h"
index 34c9e1f3273c076fe07a43620fe1e4f155f079dd..8e7e36d7cb782daf1790401bb3c35eda26233ddc 100644 (file)
 #include "DNA_screen_types.h"
 #include "DNA_view3d_types.h"
 
-#include "BKE_anim.h" /* for duplis */
 #include "BKE_armature.h"
 #include "BKE_bvhutils.h"
 #include "BKE_curve.h"
+#include "BKE_duplilist.h"
 #include "BKE_editmesh.h"
 #include "BKE_layer.h"
 #include "BKE_main.h"
index fb75fb1f6c7be9e6dc6688cd904d3cfbe3a071b5..e3e095463b4c097b45f89ca663b37de9ca62e710 100644 (file)
@@ -51,7 +51,7 @@ extern "C" {
 #  include "BLI_winstuff.h"
 #endif
 
-#include "BKE_anim.h"
+#include "BKE_duplilist.h"
 #include "BKE_global.h"
 #include "BKE_idprop.h"
 #include "BKE_layer.h"
index 50f81c2ffb1e54e61f78f0af7be871c76f808ee3..89f75a6ad80642e2d652fd0f9eb5e509b4d2f196 100644 (file)
@@ -24,8 +24,8 @@
 #include <string>
 
 extern "C" {
-#include "BKE_anim.h"
 #include "BKE_animsys.h"
+#include "BKE_duplilist.h"
 #include "BKE_key.h"
 #include "BKE_particle.h"
 
index fd888f39adc00cb696c3dd06e3d77d41db1aab1c..47f09af7442e56ec9f5513030456a3639c72fca0 100644 (file)
@@ -32,7 +32,7 @@
 #include <pxr/base/tf/stringUtils.h>
 
 extern "C" {
-#include "BKE_anim.h"
+#include "BKE_duplilist.h"
 
 #include "BLI_assert.h"
 
index cbf51fc15b3ed62f8db077153d58ceaee26a5340..2e6696e12ca04916e3feaae73f451727f150ab59 100644 (file)
@@ -27,7 +27,6 @@ extern "C" {
 #include "BLI_assert.h"
 #include "BLI_math_vector.h"
 
-#include "BKE_anim.h"
 #include "BKE_customdata.h"
 #include "BKE_lib_id.h"
 #include "BKE_material.h"
index 66c8522c53ab79429712c78a318751f7cf46cac2..41c107b8d043528e2f8f331f069a3342b4e7bc84 100644 (file)
@@ -43,7 +43,7 @@
 #  include "BLI_iterator.h"
 #  include "BLI_math.h"
 
-#  include "BKE_anim.h"
+#  include "BKE_duplilist.h"
 #  include "BKE_object.h"
 #  include "BKE_scene.h"
 
index 5104f4a66a1caab8153e0918c25687b509296de3..f4b64d2f81214e4afe518cb16d042a3d6398985f 100644 (file)
@@ -63,7 +63,6 @@ static const EnumPropertyItem space_items[] = {
 
 #  include "BLI_math.h"
 
-#  include "BKE_anim.h"
 #  include "BKE_bvhutils.h"
 #  include "BKE_constraint.h"
 #  include "BKE_context.h"