[Bf-blender-cvs] [4e731ec97bd] master: Transform: Split transform_conversions into multiple files.

mano-wii noreply at git.blender.org
Thu Sep 5 19:36:39 CEST 2019


Commit: 4e731ec97bd4b689a725f4bdcd49ab1f5c68c12c
Author: mano-wii
Date:   Thu Sep 5 14:34:54 2019 -0300
Branches: master
https://developer.blender.org/rB4e731ec97bd4b689a725f4bdcd49ab1f5c68c12c

Transform: Split transform_conversions into multiple files.

Part of T68836

`transform conversions.c` is a file that is getting too big (almost 10,000 lines).
So it's a good idea to split it into smaller files.

differential revision: https://developer.blender.org/D5677

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

M	source/blender/editors/transform/CMakeLists.txt
M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform.h
D	source/blender/editors/transform/transform_conversions.c
A	source/blender/editors/transform/transform_convert.c
A	source/blender/editors/transform/transform_convert.h
A	source/blender/editors/transform/transform_convert_action.c
A	source/blender/editors/transform/transform_convert_armature.c
A	source/blender/editors/transform/transform_convert_cursor.c
A	source/blender/editors/transform/transform_convert_curve.c
A	source/blender/editors/transform/transform_convert_gpencil.c
A	source/blender/editors/transform/transform_convert_graph.c
A	source/blender/editors/transform/transform_convert_lattice.c
A	source/blender/editors/transform/transform_convert_mask.c
A	source/blender/editors/transform/transform_convert_mball.c
A	source/blender/editors/transform/transform_convert_mesh.c
A	source/blender/editors/transform/transform_convert_nla.c
A	source/blender/editors/transform/transform_convert_node.c
A	source/blender/editors/transform/transform_convert_object.c
A	source/blender/editors/transform/transform_convert_paintcurve.c
A	source/blender/editors/transform/transform_convert_particle.c
A	source/blender/editors/transform/transform_convert_sequencer.c
A	source/blender/editors/transform/transform_convert_tracking.c
M	source/blender/editors/transform/transform_generics.c
M	source/blender/editors/transform/transform_gizmo_3d.c
M	source/blender/editors/transform/transform_ops.c

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

diff --git a/source/blender/editors/transform/CMakeLists.txt b/source/blender/editors/transform/CMakeLists.txt
index 9696f0fb315..5575e43a011 100644
--- a/source/blender/editors/transform/CMakeLists.txt
+++ b/source/blender/editors/transform/CMakeLists.txt
@@ -40,7 +40,24 @@ set(INC_SYS
 set(SRC
   transform.c
   transform_constraints.c
-  transform_conversions.c
+  transform_convert.c
+  transform_convert_action.c
+  transform_convert_armature.c
+  transform_convert_paintcurve.c
+  transform_convert_cursor.c
+  transform_convert_curve.c
+  transform_convert_graph.c
+  transform_convert_gpencil.c
+  transform_convert_lattice.c
+  transform_convert_mask.c
+  transform_convert_mball.c
+  transform_convert_mesh.c
+  transform_convert_nla.c
+  transform_convert_node.c
+  transform_convert_object.c
+  transform_convert_particle.c
+  transform_convert_sequencer.c
+  transform_convert_tracking.c
   transform_generics.c
   transform_gizmo_2d.c
   transform_gizmo_3d.c
@@ -52,6 +69,7 @@ set(SRC
   transform_snap_object.c
 
   transform.h
+  transform_convert.h
 )
 
 set(LIB
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index ade09d88c5d..019db4f74fa 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -95,6 +95,7 @@
 #include "BLT_translation.h"
 
 #include "transform.h"
+#include "transform_convert.h"
 
 /* Disabling, since when you type you know what you are doing,
  * and being able to set it to zero is handy. */
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 45efde24d83..92db32fa836 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -909,23 +909,6 @@ void drawPropCircle(const struct bContext *C, TransInfo *t);
 
 struct wmKeyMap *transform_modal_keymap(struct wmKeyConfig *keyconf);
 
-/*********************** transform_conversions.c ********** */
-
-void flushTransIntFrameActionData(TransInfo *t);
-void flushTransGraphData(TransInfo *t);
-void remake_graph_transdata(TransInfo *t, struct ListBase *anim_data);
-void flushTransUVs(TransInfo *t);
-void flushTransParticles(TransInfo *t);
-bool clipUVTransform(TransInfo *t, float vec[2], const bool resize);
-void clipUVData(TransInfo *t);
-void flushTransNodes(TransInfo *t);
-void flushTransSeq(TransInfo *t);
-void flushTransTracking(TransInfo *t);
-void flushTransMasking(TransInfo *t);
-void flushTransPaintCurve(TransInfo *t);
-void restoreMirrorPoseBones(TransDataContainer *tc);
-void restoreBones(TransDataContainer *tc);
-
 /*********************** transform_gizmo.c ********** */
 
 #define GIZMO_AXIS_LINE_WIDTH 2.0f
@@ -935,32 +918,8 @@ bool gimbal_axis(struct Object *ob, float gmat[3][3]);
 void drawDial3d(const TransInfo *t);
 
 /*********************** TransData Creation and General Handling *********** */
-void createTransData(struct bContext *C, TransInfo *t);
-void sort_trans_data_dist(TransInfo *t);
-void special_aftertrans_update(struct bContext *C, TransInfo *t);
-int special_transform_moving(TransInfo *t);
-
-void transform_autoik_update(TransInfo *t, short mode);
 bool transdata_check_local_islands(TransInfo *t, short around);
 
-int count_set_pose_transflags(struct Object *ob,
-                              const int mode,
-                              const short around,
-                              bool has_translate_rotate[2]);
-
-/* Auto-keyframe applied after transform, returns true if motion paths need to be updated. */
-void autokeyframe_object(struct bContext *C,
-                         struct Scene *scene,
-                         struct ViewLayer *view_layer,
-                         struct Object *ob,
-                         int tmode);
-void autokeyframe_pose(
-    struct bContext *C, struct Scene *scene, struct Object *ob, int tmode, short targetless_ik);
-
-/* Test if we need to update motion paths for a given object. */
-bool motionpath_need_update_object(struct Scene *scene, struct Object *ob);
-bool motionpath_need_update_pose(struct Scene *scene, struct Object *ob);
-
 /*********************** Constraints *****************************/
 
 void drawConstraint(TransInfo *t);
@@ -1165,7 +1124,4 @@ bool checkUseAxisMatrix(TransInfo *t);
        th != tc_end; \
        th++, i++)
 
-void trans_obdata_in_obmode_update_all(struct TransInfo *t);
-void trans_obchild_in_obmode_update_all(struct TransInfo *t);
-
 #endif
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
deleted file mode 100644
index 611992c1d3c..00000000000
--- a/source/blender/editors/transform/transform_conversions.c
+++ /dev/null
@@ -1,10205 +0,0 @@
-/*
- * 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 edtransform
- */
-
-#include <string.h>
-#include <math.h>
-#include <limits.h>
-
-#include "DNA_anim_types.h"
-#include "DNA_brush_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_node_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_movieclip_types.h"
-#include "DNA_mask_types.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_math.h"
-#include "BLI_utildefines.h"
-#include "BLI_listbase.h"
-#include "BLI_linklist_stack.h"
-#include "BLI_string.h"
-#include "BLI_bitmap.h"
-#include "BLI_rect.h"
-#include "BLI_kdtree.h"
-
-#include "BKE_action.h"
-#include "BKE_animsys.h"
-#include "BKE_armature.h"
-#include "BKE_constraint.h"
-#include "BKE_context.h"
-#include "BKE_crazyspace.h"
-#include "BKE_curve.h"
-#include "BKE_fcurve.h"
-#include "BKE_global.h"
-#include "BKE_gpencil.h"
-#include "BKE_layer.h"
-#include "BKE_key.h"
-#include "BKE_main.h"
-#include "BKE_mesh.h"
-#include "BKE_mesh_mapping.h"
-#include "BKE_modifier.h"
-#include "BKE_movieclip.h"
-#include "BKE_nla.h"
-#include "BKE_node.h"
-#include "BKE_object.h"
-#include "BKE_particle.h"
-#include "BKE_paint.h"
-#include "BKE_pointcache.h"
-#include "BKE_report.h"
-#include "BKE_rigidbody.h"
-#include "BKE_scene.h"
-#include "BKE_sequencer.h"
-#include "BKE_editmesh.h"
-#include "BKE_tracking.h"
-#include "BKE_mask.h"
-#include "BKE_colortools.h"
-
-#include "BIK_api.h"
-
-#include "ED_anim_api.h"
-#include "ED_armature.h"
-#include "ED_particle.h"
-#include "ED_image.h"
-#include "ED_keyframing.h"
-#include "ED_keyframes_edit.h"
-#include "ED_object.h"
-#include "ED_markers.h"
-#include "ED_mesh.h"
-#include "ED_node.h"
-#include "ED_uvedit.h"
-#include "ED_clip.h"
-#include "ED_mask.h"
-#include "ED_gpencil.h"
-
-#include "WM_api.h" /* for WM_event_add_notifier to deal with stabilization nodes */
-#include "WM_types.h"
-
-#include "UI_view2d.h"
-#include "UI_interface.h"
-
-#include "RNA_access.h"
-
-#include "DEG_depsgraph.h"
-#include "DEG_depsgraph_build.h"
-#include "DEG_depsgraph_query.h"
-
-#include "transform.h"
-#include "bmesh.h"
-
-/**
- * Transforming around ourselves is no use, fallback to individual origins,
- * useful for curve/armatures.
- */
-static void transform_around_single_fallback(TransInfo *t)
-{
-  if ((t->data_len_all == 1) &&
-      (ELEM(t->around, V3D_AROUND_CENTER_BOUNDS, V3D_AROUND_CENTER_MEDIAN, V3D_AROUND_ACTIVE)) &&
-      (ELEM(t->mode, TFM_RESIZE, TFM_ROTATION, TFM_TRACKBALL))) {
-    t->around = V3D_AROUND_LOCAL_ORIGINS;
-  }
-}
-
-/* when transforming islands */
-struct TransIslandData {
-  float co[3];
-  float axismtx[3][3];
-};
-
-/* local function prototype - for Object/Bone Constraints */
-static bool constraints_list_needinv(TransInfo *t, ListBase *list);
-
-/* ************************** Functions *************************** */
-
-static int trans_data_compare_dist(const void *a, const void *b)
-{
-  const TransData *td_a = (const TransData *)a;
-  const TransData *td_b = (const TransData *)b;
-
-  if (td_a->dist < td_b->dist) {
-    return -1;
-  }
-  else if (td_a->dist > td_b->dist) {
-    return 1;
-  }
-  else {
-    return 0;
-  }
-}
-
-static int trans_data_compare_rdist(const void *a, const void *b)
-{
-  const TransData *td_a = (const TransData *)a;
-  const TransData *td_b = (const TransData *)b;
-
-  if (td_a->rdist < td_b->rdist) {
-    return -1;
-  }
-  else if (td_a->rdist > td_b->rdist) {
-    return 1;
-  }
-  else {
-    return 0;
-  }
-}
-
-static void sort_trans_data_dist_container(const TransInfo *t, TransDataContainer *tc)
-{
-  TransData *start = tc->data;
-  int i;
-
-  for (i = 0; i < tc->data_len && start->flag & TD_SELECTED; i++) {
-    start++;
-  }
-
-  if (i < tc->data_len) {
-    if (t->flag & T_PROP_CONNECTED) {
-      qsort(start, tc->data_len - i, sizeof(TransData), trans_data_compare_dist);
-    }
-    else {
-      qsort(start, tc->data_len - i, sizeof(TransData), trans_data_compare_rdist);
-    }
-  }
-}
-void sort_trans_data_dist(TransInfo *t)
-{
-  FOREACH_TRANS_DATA_CONTAINER (t, tc) {
-    sort_trans_data_dist_container(t, tc);
-  }
-}
-
-/**
- * Make #TD_SELECTED first in the array.
- */
-static void sort_trans_data_selected_first_container(TransDataContainer *tc)
-{
-  TransData *sel, *unsel;
-  TransData temp;
-  unsel = tc->

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list