Blender  V2.93
transform_convert_object.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
24 #include "MEM_guardedalloc.h"
25 
26 #include "BLI_listbase.h"
27 #include "BLI_math.h"
28 
29 #include "BKE_animsys.h"
30 #include "BKE_context.h"
31 #include "BKE_layer.h"
32 #include "BKE_main.h"
33 #include "BKE_object.h"
34 #include "BKE_pointcache.h"
35 #include "BKE_report.h"
36 #include "BKE_rigidbody.h"
37 #include "BKE_scene.h"
38 
39 #include "ED_keyframing.h"
40 #include "ED_object.h"
41 
42 #include "DEG_depsgraph_query.h"
43 
44 #include "transform.h"
45 #include "transform_orientations.h"
46 #include "transform_snap.h"
47 
48 /* Own include. */
49 #include "transform_convert.h"
50 
51 /* -------------------------------------------------------------------- */
55 typedef struct TransDataObject {
56 
63 
70 
72 
75  TransCustomData *custom_data)
76 {
77  TransDataObject *tdo = custom_data->data;
78  custom_data->data = NULL;
79 
80  if (t->options & CTX_OBMODE_XFORM_OBDATA) {
82  }
83 
84  if (t->options & CTX_OBMODE_XFORM_SKIP_CHILDREN) {
86  }
87  MEM_freeN(tdo);
88 }
89 
92 /* -------------------------------------------------------------------- */
103 {
104  TransDataObject *tdo = t->custom.type.data;
105  if (tdo->xds == NULL) {
106  return;
107  }
108 
109  struct Main *bmain = CTX_data_main(t->context);
110  ED_object_data_xform_container_update_all(tdo->xds, bmain, t->depsgraph);
111 }
112 
115 /* -------------------------------------------------------------------- */
126 {
127  TransDataObject *tdo = t->custom.type.data;
128  if (tdo->xcs == NULL) {
129  return;
130  }
131 
132  struct Main *bmain = CTX_data_main(t->context);
133  ED_object_xform_skip_child_container_update_all(tdo->xcs, bmain, t->depsgraph);
134 }
135 
138 /* -------------------------------------------------------------------- */
145 /* *********************** Object Transform data ******************* */
146 
147 /* transcribe given object into TransData for Transforming */
149 {
150  Scene *scene = t->scene;
151  bool constinv;
152  bool skip_invert = false;
153 
154  if (t->mode != TFM_DUMMY && ob->rigidbody_object) {
155  float rot[3][3], scale[3];
156  float ctime = BKE_scene_frame_get(scene);
157 
158  /* only use rigid body transform if simulation is running,
159  * avoids problems with initial setup of rigid bodies */
161 
162  /* save original object transform */
163  copy_v3_v3(td->ext->oloc, ob->loc);
164 
165  if (ob->rotmode > 0) {
166  copy_v3_v3(td->ext->orot, ob->rot);
167  }
168  else if (ob->rotmode == ROT_MODE_AXISANGLE) {
169  td->ext->orotAngle = ob->rotAngle;
170  copy_v3_v3(td->ext->orotAxis, ob->rotAxis);
171  }
172  else {
173  copy_qt_qt(td->ext->oquat, ob->quat);
174  }
175  /* update object's loc/rot to get current rigid body transform */
176  mat4_to_loc_rot_size(ob->loc, rot, scale, ob->obmat);
177  sub_v3_v3(ob->loc, ob->dloc);
178  BKE_object_mat3_to_rot(ob, rot, false); /* drot is already corrected here */
179  }
180  }
181 
182  /* axismtx has the real orientation */
184 
185  td->con = ob->constraints.first;
186 
187  /* hack: temporarily disable tracking and/or constraints when getting
188  * object matrix, if tracking is on, or if constraints don't need
189  * inverse correction to stop it from screwing up space conversion
190  * matrix later
191  */
192  constinv = constraints_list_needinv(t, &ob->constraints);
193 
194  /* disable constraints inversion for dummy pass */
195  if (t->mode == TFM_DUMMY) {
196  skip_invert = true;
197  }
198 
199  /* NOTE: This is not really following copy-on-write design and we should not
200  * be re-evaluating the evaluated object. But as the comment above mentioned
201  * this is part of a hack.
202  * More proper solution would be to make a shallow copy of the object and
203  * evaluate that, and access matrix of that evaluated copy of the object.
204  * Might be more tricky than it sounds, if some logic later on accesses the
205  * object matrix via td->ob->obmat. */
206  Object *object_eval = DEG_get_evaluated_object(t->depsgraph, ob);
207  if (skip_invert == false && constinv == false) {
208  object_eval->transflag |= OB_NO_CONSTRAINTS; /* BKE_object_where_is_calc checks this */
209  /* It is possible to have transform data initialization prior to a
210  * complete dependency graph evaluated. Happens, for example, when
211  * changing transformation mode. */
212  BKE_object_tfm_copy(object_eval, ob);
213  BKE_object_where_is_calc(t->depsgraph, t->scene, object_eval);
214  object_eval->transflag &= ~OB_NO_CONSTRAINTS;
215  }
216  else {
217  BKE_object_where_is_calc(t->depsgraph, t->scene, object_eval);
218  }
219  /* Copy newly evaluated fields to the original object, similar to how
220  * active dependency graph will do it. */
221  copy_m4_m4(ob->obmat, object_eval->obmat);
222  /* Only copy negative scale flag, this is the only flag which is modified by
223  * the BKE_object_where_is_calc(). The rest of the flags we need to keep,
224  * otherwise we might lose dupli flags (see T61787). */
225  ob->transflag &= ~OB_NEG_SCALE;
226  ob->transflag |= (object_eval->transflag & OB_NEG_SCALE);
227 
228  td->ob = ob;
229 
230  td->loc = ob->loc;
231  copy_v3_v3(td->iloc, td->loc);
232 
233  if (ob->rotmode > 0) {
234  td->ext->rot = ob->rot;
235  td->ext->rotAxis = NULL;
236  td->ext->rotAngle = NULL;
237  td->ext->quat = NULL;
238 
239  copy_v3_v3(td->ext->irot, ob->rot);
240  copy_v3_v3(td->ext->drot, ob->drot);
241  }
242  else if (ob->rotmode == ROT_MODE_AXISANGLE) {
243  td->ext->rot = NULL;
244  td->ext->rotAxis = ob->rotAxis;
245  td->ext->rotAngle = &ob->rotAngle;
246  td->ext->quat = NULL;
247 
248  td->ext->irotAngle = ob->rotAngle;
249  copy_v3_v3(td->ext->irotAxis, ob->rotAxis);
250  /* XXX, not implemented. */
251 #if 0
252  td->ext->drotAngle = ob->drotAngle;
253  copy_v3_v3(td->ext->drotAxis, ob->drotAxis);
254 #endif
255  }
256  else {
257  td->ext->rot = NULL;
258  td->ext->rotAxis = NULL;
259  td->ext->rotAngle = NULL;
260  td->ext->quat = ob->quat;
261 
262  copy_qt_qt(td->ext->iquat, ob->quat);
263  copy_qt_qt(td->ext->dquat, ob->dquat);
264  }
265  td->ext->rotOrder = ob->rotmode;
266 
267  td->ext->size = ob->scale;
268  copy_v3_v3(td->ext->isize, ob->scale);
269  copy_v3_v3(td->ext->dscale, ob->dscale);
270 
271  copy_v3_v3(td->center, ob->obmat[3]);
272 
273  copy_m4_m4(td->ext->obmat, ob->obmat);
274 
275  /* is there a need to set the global<->data space conversion matrices? */
276  if (ob->parent || constinv) {
277  float obmtx[3][3], totmat[3][3], obinv[3][3];
278 
279  /* Get the effect of parenting, and/or certain constraints.
280  * NOTE: some Constraints, and also Tracking should never get this
281  * done, as it doesn't work well.
282  */
283  BKE_object_to_mat3(ob, obmtx);
284  copy_m3_m4(totmat, ob->obmat);
285 
286  /* If the object scale is zero on any axis, this might result in a zero matrix.
287  * In this case, the transformation would not do anything, see: T50103. */
288  orthogonalize_m3_zero_axes(obmtx, 1.0f);
289  orthogonalize_m3_zero_axes(totmat, 1.0f);
290 
291  /* Use safe invert even though the input matrices have had zero axes set to unit length,
292  * in the unlikely case of failure (float precision for eg) this uses unit matrix fallback. */
293  invert_m3_m3_safe_ortho(obinv, totmat);
294  mul_m3_m3m3(td->smtx, obmtx, obinv);
295  invert_m3_m3_safe_ortho(td->mtx, td->smtx);
296  }
297  else {
298  /* no conversion to/from dataspace */
299  unit_m3(td->smtx);
300  unit_m3(td->mtx);
301  }
302 }
303 
305 {
306  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
307  base->object->id.tag &= ~LIB_TAG_DOIT;
308  }
309 }
310 
313  void *UNUSED(user_data))
314 {
315  /* Here we only handle object IDs. */
316  if (GS(id->name) != ID_OB) {
317  return;
318  }
320  return;
321  }
322  id->tag |= LIB_TAG_DOIT;
323 }
324 
326 {
327  object->id.tag |= LIB_TAG_DOIT;
329  &object->id,
333  NULL);
334 }
335 
336 static void trans_object_base_deps_flag_finish(const TransInfo *t, ViewLayer *view_layer)
337 {
338 
339  if ((t->options & CTX_OBMODE_XFORM_OBDATA) == 0) {
340  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
341  if (base->object->id.tag & LIB_TAG_DOIT) {
342  base->flag_legacy |= BA_SNAP_FIX_DEPS_FIASCO;
343  }
344  }
345  }
346 }
347 
348 /* sets flags in Bases to define whether they take part in transform */
349 /* it deselects Bases, so we have to call the clear function always after */
351 {
352  Main *bmain = CTX_data_main(t->context);
353  ViewLayer *view_layer = t->view_layer;
354  View3D *v3d = t->view;
355  Scene *scene = t->scene;
356  Depsgraph *depsgraph = BKE_scene_ensure_depsgraph(bmain, scene, view_layer);
357  /* NOTE: if Base selected and has parent selected:
358  * base->flag_legacy = BA_WAS_SEL
359  */
360  /* Don't do it if we're not actually going to recalculate anything. */
361  if (t->mode == TFM_DUMMY) {
362  return;
363  }
364  /* Makes sure base flags and object flags are identical. */
365  BKE_scene_base_flag_to_objects(t->view_layer);
366  /* Make sure depsgraph is here. */
368  /* Clear all flags we need. It will be used to detect dependencies. */
370  /* Traverse all bases and set all possible flags. */
371  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
372  base->flag_legacy &= ~(BA_WAS_SEL | BA_TRANSFORM_LOCKED_IN_PLACE);
373  if (BASE_SELECTED_EDITABLE(v3d, base)) {
374  Object *ob = base->object;
375  Object *parsel = ob->parent;
376  /* If parent selected, deselect. */
377  while (parsel != NULL) {
378  if (parsel->base_flag & BASE_SELECTED) {
379  Base *parbase = BKE_view_layer_base_find(view_layer, parsel);
380  if (parbase != NULL) { /* in rare cases this can fail */
381  if (BASE_SELECTED_EDITABLE(v3d, parbase)) {
382  break;
383  }
384  }
385  }
386  parsel = parsel->parent;
387  }
388  if (parsel != NULL) {
389  /* Rotation around local centers are allowed to propagate. */
390  if ((t->around == V3D_AROUND_LOCAL_ORIGINS) &&
391  (t->mode == TFM_ROTATION || t->mode == TFM_TRACKBALL)) {
392  base->flag_legacy |= BA_TRANSFORM_CHILD;
393  }
394  else {
395  base->flag &= ~BASE_SELECTED;
396  base->flag_legacy |= BA_WAS_SEL;
397  }
398  }
400  }
401  }
402  /* Store temporary bits in base indicating that base is being modified
403  * (directly or indirectly) by transforming objects.
404  */
406 }
407 
408 static bool mark_children(Object *ob)
409 {
410  if (ob->flag & (SELECT | BA_TRANSFORM_CHILD)) {
411  return true;
412  }
413 
414  if (ob->parent) {
415  if (mark_children(ob->parent)) {
416  ob->flag |= BA_TRANSFORM_CHILD;
417  return true;
418  }
419  }
420 
421  return false;
422 }
423 
425 {
426  int total = 0;
427  ViewLayer *view_layer = t->view_layer;
428  View3D *v3d = t->view;
429  struct Main *bmain = CTX_data_main(t->context);
430  Scene *scene = t->scene;
431  Depsgraph *depsgraph = BKE_scene_ensure_depsgraph(bmain, scene, view_layer);
432  /* Clear all flags we need. It will be used to detect dependencies. */
434  /* Rotations around local centers are allowed to propagate, so we take all objects. */
435  if (!((t->around == V3D_AROUND_LOCAL_ORIGINS) &&
436  (t->mode == TFM_ROTATION || t->mode == TFM_TRACKBALL))) {
437  /* Mark all parents. */
438  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
439  if (BASE_SELECTED_EDITABLE(v3d, base) && BASE_SELECTABLE(v3d, base)) {
440  Object *parent = base->object->parent;
441  /* flag all parents */
442  while (parent != NULL) {
443  parent->flag |= BA_TRANSFORM_PARENT;
444  parent = parent->parent;
445  }
446  }
447  }
448  /* Mark all children. */
449  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
450  /* all base not already selected or marked that is editable */
451  if ((base->object->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 &&
452  (base->flag & BASE_SELECTED) == 0 &&
453  (BASE_EDITABLE(v3d, base) && BASE_SELECTABLE(v3d, base))) {
454  mark_children(base->object);
455  }
456  }
457  }
458  /* Flush changed flags to all dependencies. */
459  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
460  Object *ob = base->object;
461  /* If base is not selected, not a parent of selection or not a child of
462  * selection and it is editable and selectable.
463  */
464  if ((ob->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 &&
465  (base->flag & BASE_SELECTED) == 0 &&
466  (BASE_EDITABLE(v3d, base) && BASE_SELECTABLE(v3d, base))) {
468  total += 1;
469  }
470  }
471  /* Store temporary bits in base indicating that base is being modified
472  * (directly or indirectly) by transforming objects.
473  */
475  return total;
476 }
477 
479 {
480  ViewLayer *view_layer = t->view_layer;
481  Base *base;
482 
483  for (base = view_layer->object_bases.first; base; base = base->next) {
484  if (base->flag_legacy & BA_WAS_SEL) {
486  }
487 
491  }
492 }
493 
495 {
496  TransData *td = NULL;
497  TransDataExtension *tx;
498  const bool is_prop_edit = (t->flag & T_PROP_EDIT) != 0;
499 
501 
503 
504  /* count */
505  tc->data_len = CTX_DATA_COUNT(C, selected_bases);
506 
507  if (!tc->data_len) {
508  /* clear here, main transform function escapes too */
510  return;
511  }
512 
513  if (is_prop_edit) {
515  }
516 
517  td = tc->data = MEM_callocN(tc->data_len * sizeof(TransData), "TransOb");
518  tx = tc->data_ext = MEM_callocN(tc->data_len * sizeof(TransDataExtension), "TransObExtension");
519 
520  TransDataObject *tdo = MEM_callocN(sizeof(*tdo), __func__);
521  t->custom.type.data = tdo;
522  t->custom.type.free_cb = freeTransObjectCustomData;
523 
524  if (t->options & CTX_OBMODE_XFORM_OBDATA) {
526  }
527 
528  CTX_DATA_BEGIN (C, Base *, base, selected_bases) {
529  Object *ob = base->object;
530 
531  td->flag = TD_SELECTED;
532  td->protectflag = ob->protectflag;
533  td->ext = tx;
534  td->ext->rotOrder = ob->rotmode;
535 
536  if (base->flag & BA_TRANSFORM_CHILD) {
537  td->flag |= TD_NOCENTER;
538  td->flag |= TD_NO_LOC;
539  }
540 
541  /* select linked objects, but skip them later */
542  if (ID_IS_LINKED(ob)) {
543  td->flag |= TD_SKIP;
544  }
545 
546  if (t->options & CTX_OBMODE_XFORM_OBDATA) {
547  ID *id = ob->data;
548  if (!id || id->lib) {
549  td->flag |= TD_SKIP;
550  }
551  else if (BKE_object_is_in_editmode(ob)) {
552  /* The object could have edit-mode data from another view-layer,
553  * it's such a corner-case it can be skipped for now - Campbell. */
554  td->flag |= TD_SKIP;
555  }
556  }
557 
558  if (t->options & CTX_OBMODE_XFORM_OBDATA) {
559  if ((td->flag & TD_SKIP) == 0) {
561  }
562  }
563 
564  ObjectToTransData(t, td, ob);
565  td->val = NULL;
566  td++;
567  tx++;
568  }
569  CTX_DATA_END;
570 
571  if (is_prop_edit) {
572  ViewLayer *view_layer = t->view_layer;
573  View3D *v3d = t->view;
574  Base *base;
575 
576  for (base = view_layer->object_bases.first; base; base = base->next) {
577  Object *ob = base->object;
578 
579  /* if base is not selected, not a parent of selection
580  * or not a child of selection and it is editable and selectable */
581  if ((ob->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 &&
582  (base->flag & BASE_SELECTED) == 0 && BASE_EDITABLE(v3d, base) &&
583  BASE_SELECTABLE(v3d, base)) {
584  td->protectflag = ob->protectflag;
585  td->ext = tx;
586  td->ext->rotOrder = ob->rotmode;
587 
588  ObjectToTransData(t, td, ob);
589  td->val = NULL;
590  td++;
591  tx++;
592  }
593  }
594  }
595 
596  if (t->options & CTX_OBMODE_XFORM_OBDATA) {
597  GSet *objects_in_transdata = BLI_gset_ptr_new_ex(__func__, tc->data_len);
598  td = tc->data;
599  for (int i = 0; i < tc->data_len; i++, td++) {
600  if ((td->flag & TD_SKIP) == 0) {
601  BLI_gset_add(objects_in_transdata, td->ob);
602  }
603  }
604 
605  ViewLayer *view_layer = t->view_layer;
606  View3D *v3d = t->view;
607 
608  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
609  Object *ob = base->object;
610 
611  /* if base is not selected, not a parent of selection
612  * or not a child of selection and it is editable and selectable */
613  if ((base->flag_legacy & BA_WAS_SEL) && (base->flag & BASE_SELECTED) == 0 &&
614  BASE_EDITABLE(v3d, base) && BASE_SELECTABLE(v3d, base)) {
615 
616  Object *ob_parent = ob->parent;
617  if (ob_parent != NULL) {
618  if (!BLI_gset_haskey(objects_in_transdata, ob)) {
619  bool parent_in_transdata = false;
620  while (ob_parent != NULL) {
621  if (BLI_gset_haskey(objects_in_transdata, ob_parent)) {
622  parent_in_transdata = true;
623  break;
624  }
625  ob_parent = ob_parent->parent;
626  }
627  if (parent_in_transdata) {
629  }
630  }
631  }
632  }
633  }
634  BLI_gset_free(objects_in_transdata, NULL);
635  }
636 
637  if (t->options & CTX_OBMODE_XFORM_SKIP_CHILDREN) {
638 
640 
641 #define BASE_XFORM_INDIRECT(base) \
642  ((base->flag_legacy & BA_WAS_SEL) && (base->flag & BASE_SELECTED) == 0)
643 
644  GSet *objects_in_transdata = BLI_gset_ptr_new_ex(__func__, tc->data_len);
645  GHash *objects_parent_root = BLI_ghash_ptr_new_ex(__func__, tc->data_len);
646  td = tc->data;
647  for (int i = 0; i < tc->data_len; i++, td++) {
648  if ((td->flag & TD_SKIP) == 0) {
649  BLI_gset_add(objects_in_transdata, td->ob);
650  }
651  }
652 
653  ViewLayer *view_layer = t->view_layer;
654 
655  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
656  Object *ob = base->object;
657  if (ob->parent != NULL) {
658  if (ob->parent && !BLI_gset_haskey(objects_in_transdata, ob->parent) &&
659  !BLI_gset_haskey(objects_in_transdata, ob)) {
660  if (((base->flag_legacy & BA_WAS_SEL) && (base->flag & BASE_SELECTED) == 0)) {
661  Base *base_parent = BKE_view_layer_base_find(view_layer, ob->parent);
662  if (base_parent && !BASE_XFORM_INDIRECT(base_parent)) {
663  Object *ob_parent_recurse = ob->parent;
664  if (ob_parent_recurse != NULL) {
665  while (ob_parent_recurse != NULL) {
666  if (BLI_gset_haskey(objects_in_transdata, ob_parent_recurse)) {
667  break;
668  }
669  ob_parent_recurse = ob_parent_recurse->parent;
670  }
671 
672  if (ob_parent_recurse) {
674  tdo->xcs, ob, ob_parent_recurse, XFORM_OB_SKIP_CHILD_PARENT_APPLY);
675  BLI_ghash_insert(objects_parent_root, ob, ob_parent_recurse);
676  base->flag_legacy |= BA_TRANSFORM_LOCKED_IN_PLACE;
677  }
678  }
679  }
680  }
681  }
682  }
683  }
684 
685  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
686  Object *ob = base->object;
687 
688  if (BASE_XFORM_INDIRECT(base) || BLI_gset_haskey(objects_in_transdata, ob)) {
689  /* pass. */
690  }
691  else if (ob->parent != NULL) {
692  Base *base_parent = BKE_view_layer_base_find(view_layer, ob->parent);
693  if (base_parent) {
694  if (BASE_XFORM_INDIRECT(base_parent) ||
695  BLI_gset_haskey(objects_in_transdata, ob->parent)) {
698  base->flag_legacy |= BA_TRANSFORM_LOCKED_IN_PLACE;
699  }
700  else {
701  Object *ob_parent_recurse = BLI_ghash_lookup(objects_parent_root, ob->parent);
702  if (ob_parent_recurse) {
704  tdo->xcs, ob, ob_parent_recurse, XFORM_OB_SKIP_CHILD_PARENT_IS_XFORM_INDIRECT);
705  }
706  }
707  }
708  }
709  }
710  BLI_gset_free(objects_in_transdata, NULL);
711  BLI_ghash_free(objects_parent_root, NULL, NULL);
712 
713 #undef BASE_XFORM_INDIRECT
714  }
715 }
716 
719 /* -------------------------------------------------------------------- */
732  bContext *C, Scene *scene, ViewLayer *view_layer, Object *ob, int tmode)
733 {
734  Main *bmain = CTX_data_main(C);
735  ID *id = &ob->id;
736  FCurve *fcu;
737 
738  /* TODO: this should probably be done per channel instead. */
739  if (autokeyframe_cfra_can_key(scene, id)) {
740  ReportList *reports = CTX_wm_reports(C);
743  ListBase dsources = {NULL, NULL};
746  (float)CFRA);
747  eInsertKeyFlags flag = 0;
748 
749  /* Get flags used for inserting keyframes. */
750  flag = ANIM_get_keyframing_flags(scene, true);
751 
752  /* add datasource override for the object */
754 
755  if (IS_AUTOKEY_FLAG(scene, ONLYKEYINGSET) && (active_ks)) {
756  /* Only insert into active keyingset
757  * NOTE: we assume here that the active Keying Set
758  * does not need to have its iterator overridden.
759  */
761  C, &dsources, NULL, active_ks, MODIFYKEY_MODE_INSERT, anim_eval_context.eval_time);
762  }
763  else if (IS_AUTOKEY_FLAG(scene, INSERTAVAIL)) {
764  AnimData *adt = ob->adt;
765 
766  /* only key on available channels */
767  if (adt && adt->action) {
768  ListBase nla_cache = {NULL, NULL};
769  for (fcu = adt->action->curves.first; fcu; fcu = fcu->next) {
770  insert_keyframe(bmain,
771  reports,
772  id,
773  adt->action,
774  (fcu->grp ? fcu->grp->name : NULL),
775  fcu->rna_path,
776  fcu->array_index,
777  &anim_eval_context,
778  ts->keyframe_type,
779  &nla_cache,
780  flag);
781  }
782 
784  }
785  }
786  else if (IS_AUTOKEY_FLAG(scene, INSERTNEEDED)) {
787  bool do_loc = false, do_rot = false, do_scale = false;
788 
789  /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */
790  if (tmode == TFM_TRANSLATION) {
791  do_loc = true;
792  }
793  else if (ELEM(tmode, TFM_ROTATION, TFM_TRACKBALL)) {
795  if (ob != OBACT(view_layer)) {
796  do_loc = true;
797  }
798  }
800  do_loc = true;
801  }
802 
804  do_rot = true;
805  }
806  }
807  else if (tmode == TFM_RESIZE) {
809  if (ob != OBACT(view_layer)) {
810  do_loc = true;
811  }
812  }
814  do_loc = true;
815  }
816 
818  do_scale = true;
819  }
820  }
821 
822  /* insert keyframes for the affected sets of channels using the builtin KeyingSets found */
823  if (do_loc) {
826  C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, anim_eval_context.eval_time);
827  }
828  if (do_rot) {
831  C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, anim_eval_context.eval_time);
832  }
833  if (do_scale) {
836  C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, anim_eval_context.eval_time);
837  }
838  }
839  /* insert keyframe in all (transform) channels */
840  else {
843  C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, anim_eval_context.eval_time);
844  }
845 
846  /* free temp info */
847  BLI_freelistN(&dsources);
848  }
849 }
850 
851 /* Return if we need to update motion paths, only if they already exist,
852  * and we will insert a keyframe at the end of transform. */
854 {
855  /* XXX: there's potential here for problems with unkeyed rotations/scale,
856  * but for now (until proper data-locality for baking operations),
857  * this should be a better fix for T24451 and T37755
858  */
859 
860  if (autokeyframe_cfra_can_key(scene, &ob->id)) {
861  return (ob->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS) != 0;
862  }
863 
864  return false;
865 }
866 
869 /* -------------------------------------------------------------------- */
873 /* helper for recalcData() - for object transforms, typically in the 3D view */
875 {
876  bool motionpath_update = false;
877 
878  if (t->state != TRANS_CANCEL) {
879  applyProject(t);
880  }
881 
883  TransData *td = tc->data;
884 
885  for (int i = 0; i < tc->data_len; i++, td++) {
886  Object *ob = td->ob;
887  if (td->flag & TD_SKIP) {
888  continue;
889  }
890 
891  /* if animtimer is running, and the object already has animation data,
892  * check if the auto-record feature means that we should record 'samples'
893  * (i.e. uneditable animation values)
894  */
895  /* TODO: autokeyframe calls need some setting to specify to add samples
896  * (FPoints) instead of keyframes? */
897  if ((t->animtimer) && IS_AUTOKEY_ON(t->scene)) {
899  autokeyframe_object(t->context, t->scene, t->view_layer, ob, t->mode);
900  }
901 
902  motionpath_update |= motionpath_need_update_object(t->scene, ob);
903 
904  /* sets recalc flags fully, instead of flushing existing ones
905  * otherwise proxies don't function correctly
906  */
908  }
909  }
910 
911  if (motionpath_update) {
912  /* Update motion paths once for all transformed objects. */
914  }
915 
916  if (t->options & CTX_OBMODE_XFORM_SKIP_CHILDREN) {
918  }
919 
920  if (t->options & CTX_OBMODE_XFORM_OBDATA) {
922  }
923 }
924 
927 /* -------------------------------------------------------------------- */
932 {
933  BLI_assert(t->options & CTX_OBJECT);
934 
935  Object *ob;
936  const bool canceled = (t->state == TRANS_CANCEL);
937 
939  bool motionpath_update = false;
940 
941  for (int i = 0; i < tc->data_len; i++) {
942  TransData *td = tc->data + i;
943  ListBase pidlist;
944  PTCacheID *pid;
945  ob = td->ob;
946 
947  if (td->flag & TD_SKIP) {
948  continue;
949  }
950 
951  /* flag object caches as outdated */
952  BKE_ptcache_ids_from_object(&pidlist, ob, t->scene, MAX_DUPLI_RECUR);
953  for (pid = pidlist.first; pid; pid = pid->next) {
954  if (pid->type != PTCACHE_TYPE_PARTICLES) {
955  /* particles don't need reset on geometry change */
956  pid->cache->flag |= PTCACHE_OUTDATED;
957  }
958  }
959  BLI_freelistN(&pidlist);
960 
961  /* pointcache refresh */
964  }
965 
966  /* Needed for proper updating of "quick cached" dynamics. */
967  /* Creates troubles for moving animated objects without */
968  /* autokey though, probably needed is an anim sys override? */
969  /* Please remove if some other solution is found. -jahka */
971 
972  /* Set autokey if necessary */
973  if (!canceled) {
974  autokeyframe_object(C, t->scene, t->view_layer, ob, t->mode);
975  }
976 
977  motionpath_update |= motionpath_need_update_object(t->scene, ob);
978 
979  /* restore rigid body transform */
980  if (ob->rigidbody_object && canceled) {
981  float ctime = BKE_scene_frame_get(t->scene);
982  if (BKE_rigidbody_check_sim_running(t->scene->rigidbody_world, ctime)) {
984  td->ext->oloc,
985  td->ext->orot,
986  td->ext->oquat,
987  td->ext->orotAxis,
988  td->ext->orotAngle);
989  }
990  }
991  }
992 
993  if (motionpath_update) {
994  /* Update motion paths once for all transformed objects. */
997  ED_objects_recalculate_paths(C, t->scene, range);
998  }
999 
1001 }
1002 
void BKE_animsys_free_nla_keyframing_context_cache(struct ListBase *cache)
Definition: anim_sys.c:2756
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time)
Definition: anim_sys.c:637
#define CTX_DATA_BEGIN(C, Type, instance, member)
Definition: BKE_context.h:252
#define CTX_DATA_COUNT(C, member)
Definition: BKE_context.h:272
struct ReportList * CTX_wm_reports(const bContext *C)
Definition: context.c:751
struct Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Definition: context.c:1401
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1018
#define CTX_DATA_END
Definition: BKE_context.h:260
struct Base * BKE_view_layer_base_find(struct ViewLayer *view_layer, struct Object *ob)
Definition: layer.c:394
General operations, lookup, etc. for blender objects.
void BKE_object_mat3_to_rot(struct Object *ob, float r_mat[3][3], bool use_compat)
Definition: object.c:3085
void BKE_object_where_is_calc(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
Definition: object.c:3653
void BKE_object_to_mat3(struct Object *ob, float r_mat[3][3])
Definition: object.c:3220
void BKE_object_tfm_copy(struct Object *object_dst, const struct Object *object_src)
bool BKE_object_is_in_editmode(const struct Object *ob)
void BKE_ptcache_ids_from_object(struct ListBase *lb, struct Object *ob, struct Scene *scene, int duplis)
Definition: pointcache.c:1278
#define PTCACHE_TYPE_PARTICLES
#define PTCACHE_RESET_OUTDATED
int BKE_ptcache_object_reset(struct Scene *scene, struct Object *ob, int mode)
Definition: pointcache.c:2953
API for Blender-side Rigid Body stuff.
void BKE_rigidbody_aftertrans_update(struct Object *ob, float loc[3], float rot[3], float quat[4], float rotAxis[3], float rotAngle)
Definition: rigidbody.c:2331
bool BKE_rigidbody_check_sim_running(struct RigidBodyWorld *rbw, float ctime)
Definition: rigidbody.c:2335
void BKE_scene_base_flag_to_objects(struct ViewLayer *view_layer)
Definition: scene.c:2946
float BKE_scene_frame_get(const struct Scene *scene)
struct Depsgraph * BKE_scene_ensure_depsgraph(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer)
Definition: scene.c:3526
#define BLI_assert(a)
Definition: BLI_assert.h:58
struct GSet GSet
Definition: BLI_ghash.h:189
bool BLI_gset_haskey(GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.c:1216
void BLI_ghash_insert(GHash *gh, void *key, void *val)
Definition: BLI_ghash.c:756
GSet * BLI_gset_ptr_new_ex(const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
Definition: BLI_ghash.c:1008
GHash * BLI_ghash_ptr_new_ex(const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
Definition: BLI_ghash.c:1253
bool BLI_gset_add(GSet *gs, void *key)
Definition: BLI_ghash.c:1160
void * BLI_ghash_lookup(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.c:803
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:547
void unit_m3(float m[3][3])
Definition: math_matrix.c:58
void copy_m3_m4(float m1[3][3], const float m2[4][4])
Definition: math_matrix.c:105
void invert_m3_m3_safe_ortho(float Ainv[3][3], const float A[3][3])
Definition: math_matrix.c:3298
void mat4_to_loc_rot_size(float loc[3], float rot[3][3], float size[3], const float wmat[4][4])
Definition: math_matrix.c:2236
bool orthogonalize_m3_zero_axes(float R[3][3], const float unit_length)
Definition: math_matrix.c:1775
void copy_m4_m4(float m1[4][4], const float m2[4][4])
Definition: math_matrix.c:95
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
Definition: math_matrix.c:391
void copy_qt_qt(float q[4], const float a[4])
Definition: math_rotation.c:52
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define UNUSED(x)
#define UNPACK3(a)
#define ELEM(...)
static uint8 component(Color32 c, uint i)
Definition: ColorBlock.cpp:126
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
void DEG_id_tag_update(struct ID *id, int flag)
eDepsObjectComponentType
@ DEG_OB_COMP_GEOMETRY
@ DEG_OB_COMP_TRANSFORM
void DEG_graph_relations_update(struct Depsgraph *graph)
void DEG_foreach_dependent_ID_component(const Depsgraph *depsgraph, const ID *id, eDepsObjectComponentType source_component_type, int flags, DEGForeachIDComponentCallback callback, void *user_data)
@ DEG_FOREACH_COMPONENT_IGNORE_TRANSFORM_SOLVERS
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
@ ID_RECALC_TRANSFORM
Definition: DNA_ID.h:599
@ ID_RECALC_GEOMETRY
Definition: DNA_ID.h:611
@ LIB_TAG_DOIT
Definition: DNA_ID.h:554
#define ID_IS_LINKED(_id)
Definition: DNA_ID.h:426
@ ID_OB
Definition: DNA_ID_enums.h:59
@ MOTIONPATH_BAKE_HAS_PATHS
@ ROT_MODE_AXISANGLE
eInsertKeyFlags
@ BASE_SELECTABLE
@ BASE_SELECTED
#define MAX_DUPLI_RECUR
@ OB_NO_CONSTRAINTS
@ OB_NEG_SCALE
#define BA_TRANSFORM_PARENT
#define BA_TEMP_TAG
#define BA_TRANSFORM_LOCKED_IN_PLACE
#define BA_TRANSFORM_CHILD
@ BA_WAS_SEL
@ BA_SNAP_FIX_DEPS_FIASCO
#define PTCACHE_OUTDATED
#define BASE_SELECTED_EDITABLE(v3d, base)
#define CFRA
@ SCE_XFORM_AXIS_ALIGN
#define BASE_EDITABLE(v3d, base)
#define OBACT(_view_layer)
@ V3D_AROUND_ACTIVE
@ V3D_AROUND_CURSOR
@ V3D_AROUND_LOCAL_ORIGINS
#define ANIM_KS_LOC_ROT_SCALE_ID
#define IS_AUTOKEY_FLAG(scene, flag)
@ MODIFYKEY_MODE_INSERT
#define ANIM_KS_LOCATION_ID
#define ANIM_KS_SCALING_ID
#define IS_AUTOKEY_ON(scene)
#define ANIM_KS_ROTATION_ID
void ED_objects_recalculate_paths(struct bContext *C, struct Scene *scene, eObjectPathCalcRange range)
Definition: object_edit.c:1135
void ED_object_xform_skip_child_container_update_all(struct XFormObjectSkipChild_Container *xcs, struct Main *bmain, struct Depsgraph *depsgraph)
Definition: object_utils.c:270
void ED_object_xform_skip_child_container_destroy(struct XFormObjectSkipChild_Container *xcs)
Definition: object_utils.c:243
void ED_object_base_select(struct Base *base, eObjectSelect_Mode mode)
Definition: object_select.c:98
struct XFormObjectSkipChild_Container * ED_object_xform_skip_child_container_create(void)
Definition: object_utils.c:174
void ED_object_data_xform_container_destroy(struct XFormObjectData_Container *xds)
Definition: object_utils.c:426
@ XFORM_OB_SKIP_CHILD_PARENT_APPLY
Definition: ED_object.h:105
@ XFORM_OB_SKIP_CHILD_PARENT_IS_XFORM_INDIRECT
Definition: ED_object.h:98
@ XFORM_OB_SKIP_CHILD_PARENT_IS_XFORM
Definition: ED_object.h:93
void ED_object_xform_skip_child_container_item_ensure(struct XFormObjectSkipChild_Container *xcs, struct Object *ob, struct Object *ob_parent_recurse, int mode)
Definition: object_utils.c:249
void ED_object_data_xform_container_item_ensure(struct XFormObjectData_Container *xds, struct Object *ob)
Definition: object_utils.c:354
eObjectPathCalcRange
Definition: ED_object.h:328
@ OBJECT_PATH_CALC_RANGE_CHANGED
Definition: ED_object.h:330
@ OBJECT_PATH_CALC_RANGE_CURRENT_FRAME
Definition: ED_object.h:329
void ED_object_data_xform_container_update_all(struct XFormObjectData_Container *xds, struct Main *bmain, struct Depsgraph *depsgraph)
Definition: object_utils.c:375
@ BA_SELECT
Definition: ED_object.h:147
struct XFormObjectData_Container * ED_object_data_xform_container_create(void)
Definition: object_utils.c:419
@ TFM_RESIZE
Definition: ED_transform.h:48
@ TFM_ROTATION
Definition: ED_transform.h:47
@ TFM_TRANSLATION
Definition: ED_transform.h:46
@ TFM_DUMMY
Definition: ED_transform.h:45
@ TFM_TRACKBALL
Definition: ED_transform.h:55
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
Read Guarded memory(de)allocation.
#define C
Definition: RandGen.cpp:39
#define SELECT
Scene scene
const Depsgraph * depsgraph
void * user_data
#define rot(x, k)
#define GS(x)
Definition: iris.c:241
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
Definition: keyframing.c:2779
eInsertKeyFlags ANIM_get_keyframing_flags(Scene *scene, const bool use_autokey_mode)
Definition: keyframing.c:92
int insert_keyframe(Main *bmain, ReportList *reports, ID *id, bAction *act, const char group[], const char rna_path[], int array_index, const AnimationEvalContext *anim_eval_context, eBezTriple_KeyframeType keytype, ListBase *nla_cache, eInsertKeyFlags flag)
Definition: keyframing.c:1413
int ANIM_apply_keyingset(bContext *C, ListBase *dsources, bAction *act, KeyingSet *ks, short mode, float cfra)
Definition: keyingsets.c:1028
KeyingSet * ANIM_scene_get_active_keyingset(const Scene *scene)
Definition: keyingsets.c:674
KeyingSet * ANIM_builtin_keyingset_get_named(KeyingSet *prevKS, const char name[])
Definition: keyingsets.c:550
void ANIM_relative_keyingset_add_source(ListBase *dsources, ID *id, StructRNA *srna, void *data)
Definition: keyingsets.c:898
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
bAction * action
struct Base * next
short flag
int flag_legacy
struct Object * object
struct FCurve * next
bActionGroup * grp
char * rna_path
int array_index
Definition: DNA_ID.h:273
struct Library * lib
Definition: DNA_ID.h:277
char name[66]
Definition: DNA_ID.h:283
void * first
Definition: DNA_listBase.h:47
Definition: BKE_main.h:116
short transflag
ListBase constraints
short base_flag
float drot[3]
float dquat[4]
struct RigidBodyOb * rigidbody_object
float loc[3]
float dloc[3]
float scale[3]
float rot[3]
float drotAxis[3]
float obmat[4][4]
float quat[4]
short rotmode
float rotAngle
float rotAxis[3]
float drotAngle
struct AnimData * adt
float dscale[3]
short protectflag
struct Object * parent
void * data
bAnimVizSettings avs
unsigned int type
struct PTCacheID * next
struct PointCache * cache
struct RigidBodyWorld * rigidbody_world
struct ToolSettings * toolsettings
char transform_pivot_point
TransData * data
Definition: transform.h:448
TransDataExtension * data_ext
Definition: transform.h:450
struct XFormObjectData_Container * xds
struct XFormObjectSkipChild_Container * xcs
float smtx[3][3]
short protectflag
struct bConstraint * con
float axismtx[3][3]
float mtx[3][3]
TransDataExtension * ext
float * val
struct Object * ob
ListBase object_bases
ListBase curves
@ CTX_OBMODE_XFORM_OBDATA
Definition: transform.h:94
@ CTX_OBMODE_XFORM_SKIP_CHILDREN
Definition: transform.h:96
@ CTX_OBJECT
Definition: transform.h:85
@ T_PROP_EDIT
Definition: transform.h:111
#define TRANS_DATA_CONTAINER_FIRST_SINGLE(t)
Definition: transform.h:810
@ TRANS_CANCEL
Definition: transform.h:193
#define FOREACH_TRANS_DATA_CONTAINER(t, th)
Definition: transform.h:813
void animrecord_check_state(TransInfo *t, struct Object *ob)
bool constraints_list_needinv(TransInfo *t, ListBase *list)
conversion and adaptation of different datablocks to a common struct.
static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
static void freeTransObjectCustomData(TransInfo *t, TransDataContainer *UNUSED(tc), TransCustomData *custom_data)
void special_aftertrans_update__object(bContext *C, TransInfo *t)
static void set_trans_object_base_flags(TransInfo *t)
struct TransDataObject TransDataObject
static bool motionpath_need_update_object(Scene *scene, Object *ob)
static void flush_trans_object_base_deps_flag(Depsgraph *depsgraph, Object *object)
static void trans_object_base_deps_flag_prepare(ViewLayer *view_layer)
static void trans_obchild_in_obmode_update_all(TransInfo *t)
static void clear_trans_object_base_flags(TransInfo *t)
void recalcData_objects(TransInfo *t)
static void trans_object_base_deps_flag_finish(const TransInfo *t, ViewLayer *view_layer)
void createTransObject(bContext *C, TransInfo *t)
#define BASE_XFORM_INDIRECT(base)
static int count_proportional_objects(TransInfo *t)
static bool mark_children(Object *ob)
static void autokeyframe_object(bContext *C, Scene *scene, ViewLayer *view_layer, Object *ob, int tmode)
static void trans_obdata_in_obmode_update_all(TransInfo *t)
static void set_trans_object_base_deps_flag_cb(ID *id, eDepsObjectComponentType component, void *UNUSED(user_data))
@ TD_SELECTED
@ TD_SKIP
@ TD_NO_LOC
@ TD_NOCENTER
bool transform_orientations_create_from_axis(float mat[3][3], const float x[3], const float y[3], const float z[3])
void applyProject(TransInfo *t)