Blender  V3.3
transform_convert_object.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #include "MEM_guardedalloc.h"
9 
10 #include "BLI_listbase.h"
11 #include "BLI_math.h"
12 
13 #include "BKE_animsys.h"
14 #include "BKE_context.h"
15 #include "BKE_layer.h"
16 #include "BKE_lib_id.h"
17 #include "BKE_main.h"
18 #include "BKE_object.h"
19 #include "BKE_pointcache.h"
20 #include "BKE_report.h"
21 #include "BKE_rigidbody.h"
22 #include "BKE_scene.h"
23 
24 #include "ED_keyframing.h"
25 #include "ED_object.h"
26 
27 #include "DEG_depsgraph_query.h"
28 
29 #include "transform.h"
30 #include "transform_orientations.h"
31 #include "transform_snap.h"
32 
33 /* Own include. */
34 #include "transform_convert.h"
35 
36 /* -------------------------------------------------------------------- */
40 typedef struct TransDataObject {
41 
48 
55 
57 
60  TransCustomData *custom_data)
61 {
62  TransDataObject *tdo = custom_data->data;
63  custom_data->data = NULL;
64 
65  if (t->options & CTX_OBMODE_XFORM_OBDATA) {
67  }
68 
69  if (t->options & CTX_OBMODE_XFORM_SKIP_CHILDREN) {
71  }
72  MEM_freeN(tdo);
73 }
74 
77 /* -------------------------------------------------------------------- */
88 {
89  TransDataObject *tdo = t->custom.type.data;
90  if (tdo->xds == NULL) {
91  return;
92  }
93 
94  struct Main *bmain = CTX_data_main(t->context);
95  ED_object_data_xform_container_update_all(tdo->xds, bmain, t->depsgraph);
96 }
97 
100 /* -------------------------------------------------------------------- */
111 {
112  TransDataObject *tdo = t->custom.type.data;
113  if (tdo->xcs == NULL) {
114  return;
115  }
116 
117  struct Main *bmain = CTX_data_main(t->context);
118  ED_object_xform_skip_child_container_update_all(tdo->xcs, bmain, t->depsgraph);
119 }
120 
123 /* -------------------------------------------------------------------- */
130 /* *********************** Object Transform data ******************* */
131 
132 /* transcribe given object into TransData for Transforming */
134 {
135  Scene *scene = t->scene;
136  bool constinv;
137  bool skip_invert = false;
138 
139  if (t->mode != TFM_DUMMY && ob->rigidbody_object) {
140  float rot[3][3], scale[3];
141  float ctime = BKE_scene_ctime_get(scene);
142 
143  /* only use rigid body transform if simulation is running,
144  * avoids problems with initial setup of rigid bodies */
146 
147  /* save original object transform */
148  copy_v3_v3(td->ext->oloc, ob->loc);
149 
150  if (ob->rotmode > 0) {
151  copy_v3_v3(td->ext->orot, ob->rot);
152  }
153  else if (ob->rotmode == ROT_MODE_AXISANGLE) {
154  td->ext->orotAngle = ob->rotAngle;
155  copy_v3_v3(td->ext->orotAxis, ob->rotAxis);
156  }
157  else {
158  copy_qt_qt(td->ext->oquat, ob->quat);
159  }
160  /* update object's loc/rot to get current rigid body transform */
161  mat4_to_loc_rot_size(ob->loc, rot, scale, ob->obmat);
162  sub_v3_v3(ob->loc, ob->dloc);
163  BKE_object_mat3_to_rot(ob, rot, false); /* drot is already corrected here */
164  }
165  }
166 
167  /* axismtx has the real orientation */
169  if (t->orient_type_mask & (1 << V3D_ORIENT_GIMBAL)) {
170  if (!gimbal_axis_object(ob, td->ext->axismtx_gimbal)) {
172  }
173  }
174 
175  td->con = ob->constraints.first;
176 
177  /* hack: temporarily disable tracking and/or constraints when getting
178  * object matrix, if tracking is on, or if constraints don't need
179  * inverse correction to stop it from screwing up space conversion
180  * matrix later
181  */
182  constinv = constraints_list_needinv(t, &ob->constraints);
183 
184  /* disable constraints inversion for dummy pass */
185  if (t->mode == TFM_DUMMY) {
186  skip_invert = true;
187  }
188 
189  /* NOTE: This is not really following copy-on-write design and we should not
190  * be re-evaluating the evaluated object. But as the comment above mentioned
191  * this is part of a hack.
192  * More proper solution would be to make a shallow copy of the object and
193  * evaluate that, and access matrix of that evaluated copy of the object.
194  * Might be more tricky than it sounds, if some logic later on accesses the
195  * object matrix via td->ob->obmat. */
196  Object *object_eval = DEG_get_evaluated_object(t->depsgraph, ob);
197  if (skip_invert == false && constinv == false) {
198  object_eval->transflag |= OB_NO_CONSTRAINTS; /* BKE_object_where_is_calc checks this */
199  /* It is possible to have transform data initialization prior to a
200  * complete dependency graph evaluated. Happens, for example, when
201  * changing transformation mode. */
202  BKE_object_tfm_copy(object_eval, ob);
203  BKE_object_where_is_calc(t->depsgraph, t->scene, object_eval);
204  object_eval->transflag &= ~OB_NO_CONSTRAINTS;
205  }
206  else {
207  BKE_object_where_is_calc(t->depsgraph, t->scene, object_eval);
208  }
209  /* Copy newly evaluated fields to the original object, similar to how
210  * active dependency graph will do it. */
211  copy_m4_m4(ob->obmat, object_eval->obmat);
212  /* Only copy negative scale flag, this is the only flag which is modified by
213  * the BKE_object_where_is_calc(). The rest of the flags we need to keep,
214  * otherwise we might lose dupli flags (see T61787). */
215  ob->transflag &= ~OB_NEG_SCALE;
216  ob->transflag |= (object_eval->transflag & OB_NEG_SCALE);
217 
218  td->ob = ob;
219 
220  td->loc = ob->loc;
221  copy_v3_v3(td->iloc, td->loc);
222 
223  if (ob->rotmode > 0) {
224  td->ext->rot = ob->rot;
225  td->ext->rotAxis = NULL;
226  td->ext->rotAngle = NULL;
227  td->ext->quat = NULL;
228 
229  copy_v3_v3(td->ext->irot, ob->rot);
230  copy_v3_v3(td->ext->drot, ob->drot);
231  }
232  else if (ob->rotmode == ROT_MODE_AXISANGLE) {
233  td->ext->rot = NULL;
234  td->ext->rotAxis = ob->rotAxis;
235  td->ext->rotAngle = &ob->rotAngle;
236  td->ext->quat = NULL;
237 
238  td->ext->irotAngle = ob->rotAngle;
239  copy_v3_v3(td->ext->irotAxis, ob->rotAxis);
240  /* XXX, not implemented. */
241 #if 0
242  td->ext->drotAngle = ob->drotAngle;
243  copy_v3_v3(td->ext->drotAxis, ob->drotAxis);
244 #endif
245  }
246  else {
247  td->ext->rot = NULL;
248  td->ext->rotAxis = NULL;
249  td->ext->rotAngle = NULL;
250  td->ext->quat = ob->quat;
251 
252  copy_qt_qt(td->ext->iquat, ob->quat);
253  copy_qt_qt(td->ext->dquat, ob->dquat);
254  }
255  td->ext->rotOrder = ob->rotmode;
256 
257  td->ext->size = ob->scale;
258  copy_v3_v3(td->ext->isize, ob->scale);
259  copy_v3_v3(td->ext->dscale, ob->dscale);
260 
261  copy_v3_v3(td->center, ob->obmat[3]);
262 
263  copy_m4_m4(td->ext->obmat, ob->obmat);
264 
265  /* is there a need to set the global<->data space conversion matrices? */
266  if (ob->parent || constinv) {
267  float obmtx[3][3], totmat[3][3], obinv[3][3];
268 
269  /* Get the effect of parenting, and/or certain constraints.
270  * NOTE: some Constraints, and also Tracking should never get this
271  * done, as it doesn't work well.
272  */
273  BKE_object_to_mat3(ob, obmtx);
274  copy_m3_m4(totmat, ob->obmat);
275 
276  /* If the object scale is zero on any axis, this might result in a zero matrix.
277  * In this case, the transformation would not do anything, see: T50103. */
278  orthogonalize_m3_zero_axes(obmtx, 1.0f);
279  orthogonalize_m3_zero_axes(totmat, 1.0f);
280 
281  /* Use safe invert even though the input matrices have had zero axes set to unit length,
282  * in the unlikely case of failure (float precision for eg) this uses unit matrix fallback. */
283  invert_m3_m3_safe_ortho(obinv, totmat);
284  mul_m3_m3m3(td->smtx, obmtx, obinv);
285  invert_m3_m3_safe_ortho(td->mtx, td->smtx);
286  }
287  else {
288  /* no conversion to/from dataspace */
289  unit_m3(td->smtx);
290  unit_m3(td->mtx);
291  }
292 }
293 
295 {
296  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
297  base->object->id.tag &= ~LIB_TAG_DOIT;
298  }
299 }
300 
303  void *UNUSED(user_data))
304 {
305  /* Here we only handle object IDs. */
306  if (GS(id->name) != ID_OB) {
307  return;
308  }
310  return;
311  }
312  id->tag |= LIB_TAG_DOIT;
313 }
314 
316 {
317  object->id.tag |= LIB_TAG_DOIT;
319  &object->id,
323  NULL);
324 }
325 
326 static void trans_object_base_deps_flag_finish(const TransInfo *t, ViewLayer *view_layer)
327 {
328 
329  if ((t->options & CTX_OBMODE_XFORM_OBDATA) == 0) {
330  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
331  if (base->object->id.tag & LIB_TAG_DOIT) {
332  base->flag_legacy |= BA_SNAP_FIX_DEPS_FIASCO;
333  }
334  }
335  }
336 }
337 
338 /* sets flags in Bases to define whether they take part in transform */
339 /* it deselects Bases, so we have to call the clear function always after */
341 {
342  Main *bmain = CTX_data_main(t->context);
343  ViewLayer *view_layer = t->view_layer;
344  View3D *v3d = t->view;
345  Scene *scene = t->scene;
346  Depsgraph *depsgraph = BKE_scene_ensure_depsgraph(bmain, scene, view_layer);
347  /* NOTE: if Base selected and has parent selected:
348  * base->flag_legacy = BA_WAS_SEL
349  */
350  /* Don't do it if we're not actually going to recalculate anything. */
351  if (t->mode == TFM_DUMMY) {
352  return;
353  }
354  /* Makes sure base flags and object flags are identical. */
355  BKE_scene_base_flag_to_objects(t->view_layer);
356  /* Make sure depsgraph is here. */
358  /* Clear all flags we need. It will be used to detect dependencies. */
360  /* Traverse all bases and set all possible flags. */
361  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
362  base->flag_legacy &= ~(BA_WAS_SEL | BA_TRANSFORM_LOCKED_IN_PLACE);
363  if (BASE_SELECTED_EDITABLE(v3d, base)) {
364  Object *ob = base->object;
365  Object *parsel = ob->parent;
366  /* If parent selected, deselect. */
367  while (parsel != NULL) {
368  if (parsel->base_flag & BASE_SELECTED) {
369  Base *parbase = BKE_view_layer_base_find(view_layer, parsel);
370  if (parbase != NULL) { /* in rare cases this can fail */
371  if (BASE_SELECTED_EDITABLE(v3d, parbase)) {
372  break;
373  }
374  }
375  }
376  parsel = parsel->parent;
377  }
378  if (parsel != NULL) {
379  /* Rotation around local centers are allowed to propagate. */
380  if ((t->around == V3D_AROUND_LOCAL_ORIGINS) &&
381  (ELEM(t->mode, TFM_ROTATION, TFM_TRACKBALL))) {
382  base->flag_legacy |= BA_TRANSFORM_CHILD;
383  }
384  else {
385  base->flag &= ~BASE_SELECTED;
386  base->flag_legacy |= BA_WAS_SEL;
387  }
388  }
390  }
391  }
392  /* Store temporary bits in base indicating that base is being modified
393  * (directly or indirectly) by transforming objects.
394  */
396 }
397 
398 static bool mark_children(Object *ob)
399 {
400  if (ob->flag & (SELECT | BA_TRANSFORM_CHILD)) {
401  return true;
402  }
403 
404  if (ob->parent) {
405  if (mark_children(ob->parent)) {
406  ob->flag |= BA_TRANSFORM_CHILD;
407  return true;
408  }
409  }
410 
411  return false;
412 }
413 
415 {
416  int total = 0;
417  ViewLayer *view_layer = t->view_layer;
418  View3D *v3d = t->view;
419  struct Main *bmain = CTX_data_main(t->context);
420  Scene *scene = t->scene;
421  Depsgraph *depsgraph = BKE_scene_ensure_depsgraph(bmain, scene, view_layer);
422  /* Clear all flags we need. It will be used to detect dependencies. */
424  /* Rotations around local centers are allowed to propagate, so we take all objects. */
425  if (!((t->around == V3D_AROUND_LOCAL_ORIGINS) && (ELEM(t->mode, TFM_ROTATION, TFM_TRACKBALL)))) {
426  /* Mark all parents. */
427  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
428  if (BASE_SELECTED_EDITABLE(v3d, base) && BASE_SELECTABLE(v3d, base)) {
429  Object *parent = base->object->parent;
430  /* flag all parents */
431  while (parent != NULL) {
432  parent->flag |= BA_TRANSFORM_PARENT;
433  parent = parent->parent;
434  }
435  }
436  }
437  /* Mark all children. */
438  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
439  /* all base not already selected or marked that is editable */
440  if ((base->object->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 &&
441  (base->flag & BASE_SELECTED) == 0 &&
442  (BASE_EDITABLE(v3d, base) && BASE_SELECTABLE(v3d, base))) {
443  mark_children(base->object);
444  }
445  }
446  }
447  /* Flush changed flags to all dependencies. */
448  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
449  Object *ob = base->object;
450  /* If base is not selected, not a parent of selection or not a child of
451  * selection and it is editable and selectable.
452  */
453  if ((ob->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 &&
454  (base->flag & BASE_SELECTED) == 0 &&
455  (BASE_EDITABLE(v3d, base) && BASE_SELECTABLE(v3d, base))) {
457  total += 1;
458  }
459  }
460  /* Store temporary bits in base indicating that base is being modified
461  * (directly or indirectly) by transforming objects.
462  */
464  return total;
465 }
466 
468 {
469  ViewLayer *view_layer = t->view_layer;
470  Base *base;
471 
472  for (base = view_layer->object_bases.first; base; base = base->next) {
473  if (base->flag_legacy & BA_WAS_SEL) {
475  }
476 
480  }
481 }
482 
484 {
485  Main *bmain = CTX_data_main(C);
486  TransData *td = NULL;
487  TransDataExtension *tx;
488  const bool is_prop_edit = (t->flag & T_PROP_EDIT) != 0;
489 
491 
493 
494  /* count */
495  tc->data_len = CTX_DATA_COUNT(C, selected_bases);
496 
497  if (!tc->data_len) {
498  /* clear here, main transform function escapes too */
500  return;
501  }
502 
503  if (is_prop_edit) {
505  }
506 
507  td = tc->data = MEM_callocN(tc->data_len * sizeof(TransData), "TransOb");
508  tx = tc->data_ext = MEM_callocN(tc->data_len * sizeof(TransDataExtension), "TransObExtension");
509 
510  TransDataObject *tdo = MEM_callocN(sizeof(*tdo), __func__);
511  t->custom.type.data = tdo;
512  t->custom.type.free_cb = freeTransObjectCustomData;
513 
514  if (t->options & CTX_OBMODE_XFORM_OBDATA) {
516  }
517 
518  CTX_DATA_BEGIN (C, Base *, base, selected_bases) {
519  Object *ob = base->object;
520 
521  td->flag = TD_SELECTED;
522  td->protectflag = ob->protectflag;
523  td->ext = tx;
524  td->ext->rotOrder = ob->rotmode;
525 
526  if (base->flag & BA_TRANSFORM_CHILD) {
527  td->flag |= TD_NOCENTER;
528  td->flag |= TD_NO_LOC;
529  }
530 
531  /* select linked objects, but skip them later */
532  if (!BKE_id_is_editable(bmain, &ob->id)) {
533  td->flag |= TD_SKIP;
534  }
535 
536  if (t->options & CTX_OBMODE_XFORM_OBDATA) {
537  ID *id = ob->data;
538  if (!id || id->lib) {
539  td->flag |= TD_SKIP;
540  }
541  else if (BKE_object_is_in_editmode(ob)) {
542  /* The object could have edit-mode data from another view-layer,
543  * it's such a corner-case it can be skipped for now - Campbell. */
544  td->flag |= TD_SKIP;
545  }
546  }
547 
548  if (t->options & CTX_OBMODE_XFORM_OBDATA) {
549  if ((td->flag & TD_SKIP) == 0) {
551  }
552  }
553 
554  ObjectToTransData(t, td, ob);
555  td->val = NULL;
556  td++;
557  tx++;
558  }
559  CTX_DATA_END;
560 
561  if (is_prop_edit) {
562  ViewLayer *view_layer = t->view_layer;
563  View3D *v3d = t->view;
564  Base *base;
565 
566  for (base = view_layer->object_bases.first; base; base = base->next) {
567  Object *ob = base->object;
568 
569  /* if base is not selected, not a parent of selection
570  * or not a child of selection and it is editable and selectable */
571  if ((ob->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 &&
572  (base->flag & BASE_SELECTED) == 0 && BASE_EDITABLE(v3d, base) &&
573  BASE_SELECTABLE(v3d, base)) {
574  td->protectflag = ob->protectflag;
575  td->ext = tx;
576  td->ext->rotOrder = ob->rotmode;
577 
578  ObjectToTransData(t, td, ob);
579  td->val = NULL;
580  td++;
581  tx++;
582  }
583  }
584  }
585 
586  if (t->options & CTX_OBMODE_XFORM_OBDATA) {
587  GSet *objects_in_transdata = BLI_gset_ptr_new_ex(__func__, tc->data_len);
588  td = tc->data;
589  for (int i = 0; i < tc->data_len; i++, td++) {
590  if ((td->flag & TD_SKIP) == 0) {
591  BLI_gset_add(objects_in_transdata, td->ob);
592  }
593  }
594 
595  ViewLayer *view_layer = t->view_layer;
596  View3D *v3d = t->view;
597 
598  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
599  Object *ob = base->object;
600 
601  /* if base is not selected, not a parent of selection
602  * or not a child of selection and it is editable and selectable */
603  if ((base->flag_legacy & BA_WAS_SEL) && (base->flag & BASE_SELECTED) == 0 &&
604  BASE_EDITABLE(v3d, base) && BASE_SELECTABLE(v3d, base)) {
605 
606  Object *ob_parent = ob->parent;
607  if (ob_parent != NULL) {
608  if (!BLI_gset_haskey(objects_in_transdata, ob)) {
609  bool parent_in_transdata = false;
610  while (ob_parent != NULL) {
611  if (BLI_gset_haskey(objects_in_transdata, ob_parent)) {
612  parent_in_transdata = true;
613  break;
614  }
615  ob_parent = ob_parent->parent;
616  }
617  if (parent_in_transdata) {
619  }
620  }
621  }
622  }
623  }
624  BLI_gset_free(objects_in_transdata, NULL);
625  }
626 
627  if (t->options & CTX_OBMODE_XFORM_SKIP_CHILDREN) {
628 
630 
631 #define BASE_XFORM_INDIRECT(base) \
632  ((base->flag_legacy & BA_WAS_SEL) && (base->flag & BASE_SELECTED) == 0)
633 
634  GSet *objects_in_transdata = BLI_gset_ptr_new_ex(__func__, tc->data_len);
635  GHash *objects_parent_root = BLI_ghash_ptr_new_ex(__func__, tc->data_len);
636  td = tc->data;
637  for (int i = 0; i < tc->data_len; i++, td++) {
638  if ((td->flag & TD_SKIP) == 0) {
639  BLI_gset_add(objects_in_transdata, td->ob);
640  }
641  }
642 
643  ViewLayer *view_layer = t->view_layer;
644 
645  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
646  Object *ob = base->object;
647  if (ob->parent != NULL) {
648  if (ob->parent && !BLI_gset_haskey(objects_in_transdata, ob->parent) &&
649  !BLI_gset_haskey(objects_in_transdata, ob)) {
650  if (((base->flag_legacy & BA_WAS_SEL) && (base->flag & BASE_SELECTED) == 0)) {
651  Base *base_parent = BKE_view_layer_base_find(view_layer, ob->parent);
652  if (base_parent && !BASE_XFORM_INDIRECT(base_parent)) {
653  Object *ob_parent_recurse = ob->parent;
654  if (ob_parent_recurse != NULL) {
655  while (ob_parent_recurse != NULL) {
656  if (BLI_gset_haskey(objects_in_transdata, ob_parent_recurse)) {
657  break;
658  }
659  ob_parent_recurse = ob_parent_recurse->parent;
660  }
661 
662  if (ob_parent_recurse) {
664  tdo->xcs, ob, ob_parent_recurse, XFORM_OB_SKIP_CHILD_PARENT_APPLY);
665  BLI_ghash_insert(objects_parent_root, ob, ob_parent_recurse);
666  base->flag_legacy |= BA_TRANSFORM_LOCKED_IN_PLACE;
667  }
668  }
669  }
670  }
671  }
672  }
673  }
674 
675  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
676  Object *ob = base->object;
677 
678  if (BASE_XFORM_INDIRECT(base) || BLI_gset_haskey(objects_in_transdata, ob)) {
679  /* pass. */
680  }
681  else if (ob->parent != NULL) {
682  Base *base_parent = BKE_view_layer_base_find(view_layer, ob->parent);
683  if (base_parent) {
684  if (BASE_XFORM_INDIRECT(base_parent) ||
685  BLI_gset_haskey(objects_in_transdata, ob->parent)) {
688  base->flag_legacy |= BA_TRANSFORM_LOCKED_IN_PLACE;
689  }
690  else {
691  Object *ob_parent_recurse = BLI_ghash_lookup(objects_parent_root, ob->parent);
692  if (ob_parent_recurse) {
694  tdo->xcs, ob, ob_parent_recurse, XFORM_OB_SKIP_CHILD_PARENT_IS_XFORM_INDIRECT);
695  }
696  }
697  }
698  }
699  }
700  BLI_gset_free(objects_in_transdata, NULL);
701  BLI_ghash_free(objects_parent_root, NULL, NULL);
702 
703 #undef BASE_XFORM_INDIRECT
704  }
705 }
706 
709 /* -------------------------------------------------------------------- */
722  bContext *C, Scene *scene, ViewLayer *view_layer, Object *ob, int tmode)
723 {
724  Main *bmain = CTX_data_main(C);
725  ID *id = &ob->id;
726  FCurve *fcu;
727 
728  /* TODO: this should probably be done per channel instead. */
729  if (autokeyframe_cfra_can_key(scene, id)) {
730  ReportList *reports = CTX_wm_reports(C);
733  ListBase dsources = {NULL, NULL};
736  depsgraph, (float)scene->r.cfra);
737  eInsertKeyFlags flag = 0;
738 
739  /* Get flags used for inserting keyframes. */
740  flag = ANIM_get_keyframing_flags(scene, true);
741 
742  /* Add data-source override for the object. */
744 
745  if (IS_AUTOKEY_FLAG(scene, ONLYKEYINGSET) && (active_ks)) {
746  /* Only insert into active keyingset
747  * NOTE: we assume here that the active Keying Set
748  * does not need to have its iterator overridden.
749  */
751  C, &dsources, NULL, active_ks, MODIFYKEY_MODE_INSERT, anim_eval_context.eval_time);
752  }
753  else if (IS_AUTOKEY_FLAG(scene, INSERTAVAIL)) {
754  AnimData *adt = ob->adt;
755 
756  /* only key on available channels */
757  if (adt && adt->action) {
758  ListBase nla_cache = {NULL, NULL};
759  for (fcu = adt->action->curves.first; fcu; fcu = fcu->next) {
760  insert_keyframe(bmain,
761  reports,
762  id,
763  adt->action,
764  (fcu->grp ? fcu->grp->name : NULL),
765  fcu->rna_path,
766  fcu->array_index,
767  &anim_eval_context,
768  ts->keyframe_type,
769  &nla_cache,
770  flag);
771  }
772 
774  }
775  }
776  else if (IS_AUTOKEY_FLAG(scene, INSERTNEEDED)) {
777  bool do_loc = false, do_rot = false, do_scale = false;
778 
779  /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */
780  if (tmode == TFM_TRANSLATION) {
781  do_loc = true;
782  }
783  else if (ELEM(tmode, TFM_ROTATION, TFM_TRACKBALL)) {
785  if (ob != OBACT(view_layer)) {
786  do_loc = true;
787  }
788  }
790  do_loc = true;
791  }
792 
794  do_rot = true;
795  }
796  }
797  else if (tmode == TFM_RESIZE) {
799  if (ob != OBACT(view_layer)) {
800  do_loc = true;
801  }
802  }
804  do_loc = true;
805  }
806 
808  do_scale = true;
809  }
810  }
811 
812  /* insert keyframes for the affected sets of channels using the builtin KeyingSets found */
813  if (do_loc) {
816  C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, anim_eval_context.eval_time);
817  }
818  if (do_rot) {
821  C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, anim_eval_context.eval_time);
822  }
823  if (do_scale) {
826  C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, anim_eval_context.eval_time);
827  }
828  }
829  /* insert keyframe in all (transform) channels */
830  else {
833  C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, anim_eval_context.eval_time);
834  }
835 
836  /* free temp info */
837  BLI_freelistN(&dsources);
838  }
839 }
840 
841 /* Return if we need to update motion paths, only if they already exist,
842  * and we will insert a keyframe at the end of transform. */
844 {
845  /* XXX: there's potential here for problems with unkeyed rotations/scale,
846  * but for now (until proper data-locality for baking operations),
847  * this should be a better fix for T24451 and T37755
848  */
849 
850  if (autokeyframe_cfra_can_key(scene, &ob->id)) {
851  return (ob->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS) != 0;
852  }
853 
854  return false;
855 }
856 
859 /* -------------------------------------------------------------------- */
864 {
865  bool motionpath_update = false;
866 
867  if (t->state != TRANS_CANCEL) {
869  }
870 
872  TransData *td = tc->data;
873 
874  for (int i = 0; i < tc->data_len; i++, td++) {
875  Object *ob = td->ob;
876  if (td->flag & TD_SKIP) {
877  continue;
878  }
879 
880  /* if animtimer is running, and the object already has animation data,
881  * check if the auto-record feature means that we should record 'samples'
882  * (i.e. uneditable animation values)
883  */
884  /* TODO: autokeyframe calls need some setting to specify to add samples
885  * (FPoints) instead of keyframes? */
886  if ((t->animtimer) && IS_AUTOKEY_ON(t->scene)) {
887  animrecord_check_state(t, &ob->id);
888  autokeyframe_object(t->context, t->scene, t->view_layer, ob, t->mode);
889  }
890 
891  motionpath_update |= motionpath_need_update_object(t->scene, ob);
892 
893  /* sets recalc flags fully, instead of flushing existing ones
894  * otherwise proxies don't function correctly
895  */
897  }
898  }
899 
900  if (motionpath_update) {
901  /* Update motion paths once for all transformed objects. */
903  t->context, t->scene, OBJECT_PATH_CALC_RANGE_CURRENT_FRAME);
904  }
905 
906  if (t->options & CTX_OBMODE_XFORM_SKIP_CHILDREN) {
908  }
909 
910  if (t->options & CTX_OBMODE_XFORM_OBDATA) {
912  }
913 }
914 
917 /* -------------------------------------------------------------------- */
922 {
923  BLI_assert(t->options & CTX_OBJECT);
924 
925  Object *ob;
926  const bool canceled = (t->state == TRANS_CANCEL);
927 
929  bool motionpath_update = false;
930 
931  for (int i = 0; i < tc->data_len; i++) {
932  TransData *td = tc->data + i;
933  ListBase pidlist;
934  PTCacheID *pid;
935  ob = td->ob;
936 
937  if (td->flag & TD_SKIP) {
938  continue;
939  }
940 
941  /* flag object caches as outdated */
942  BKE_ptcache_ids_from_object(&pidlist, ob, t->scene, MAX_DUPLI_RECUR);
943  for (pid = pidlist.first; pid; pid = pid->next) {
944  if (pid->type != PTCACHE_TYPE_PARTICLES) {
945  /* particles don't need reset on geometry change */
946  pid->cache->flag |= PTCACHE_OUTDATED;
947  }
948  }
949  BLI_freelistN(&pidlist);
950 
951  /* Point-cache refresh. */
954  }
955 
956  /* Needed for proper updating of "quick cached" dynamics.
957  * Creates troubles for moving animated objects without
958  * auto-key though, probably needed is an animation-system override?
959  * NOTE(@jahka): Please remove if some other solution is found. */
961 
962  /* Set auto-key if necessary. */
963  if (!canceled) {
964  autokeyframe_object(C, t->scene, t->view_layer, ob, t->mode);
965  }
966 
967  motionpath_update |= motionpath_need_update_object(t->scene, ob);
968 
969  /* Restore rigid body transform. */
970  if (ob->rigidbody_object && canceled) {
971  float ctime = BKE_scene_ctime_get(t->scene);
972  if (BKE_rigidbody_check_sim_running(t->scene->rigidbody_world, ctime)) {
974  td->ext->oloc,
975  td->ext->orot,
976  td->ext->oquat,
977  td->ext->orotAxis,
978  td->ext->orotAngle);
979  }
980  }
981  }
982 
983  if (motionpath_update) {
984  /* Update motion paths once for all transformed objects. */
987  ED_objects_recalculate_paths_selected(C, t->scene, range);
988  }
989 
991 }
992 
996  /* flags */ 0,
997  /* createTransData */ createTransObject,
998  /* recalcData */ recalcData_objects,
999  /* special_aftertrans_update */ special_aftertrans_update__object,
1000 };
void BKE_animsys_free_nla_keyframing_context_cache(struct ListBase *cache)
Definition: anim_sys.c:3866
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time)
Definition: anim_sys.c:761
#define CTX_DATA_BEGIN(C, Type, instance, member)
Definition: BKE_context.h:269
#define CTX_DATA_COUNT(C, member)
Definition: BKE_context.h:290
struct ReportList * CTX_wm_reports(const bContext *C)
Definition: context.c:775
struct Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Definition: context.c:1505
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1074
#define CTX_DATA_END
Definition: BKE_context.h:278
struct Base * BKE_view_layer_base_find(struct ViewLayer *view_layer, struct Object *ob)
Definition: layer.c:379
bool BKE_id_is_editable(const struct Main *bmain, const struct ID *id)
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.cc:2934
void BKE_object_where_is_calc(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
Definition: object.cc:3495
void BKE_object_to_mat3(struct Object *ob, float r_mat[3][3])
Definition: object.cc:3069
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:1250
#define PTCACHE_TYPE_PARTICLES
#define PTCACHE_RESET_OUTDATED
int BKE_ptcache_object_reset(struct Scene *scene, struct Object *ob, int mode)
Definition: pointcache.c:2930
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:2348
bool BKE_rigidbody_check_sim_running(struct RigidBodyWorld *rbw, float ctime)
Definition: rigidbody.c:2352
void BKE_scene_base_flag_to_objects(struct ViewLayer *view_layer)
Definition: scene.cc:2886
float BKE_scene_ctime_get(const struct Scene *scene)
struct Depsgraph * BKE_scene_ensure_depsgraph(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer)
Definition: scene.cc:3456
#define BLI_assert(a)
Definition: BLI_assert.h:46
struct GSet GSet
Definition: BLI_ghash.h:340
bool BLI_gset_haskey(const GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.c:1007
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.c:734
GHash * BLI_ghash_ptr_new_ex(const char *info, unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
GSet * BLI_gset_ptr_new_ex(const char *info, unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
Definition: BLI_ghash.c:710
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
Definition: BLI_ghash.c:863
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
Definition: BLI_ghash.c:1037
bool BLI_gset_add(GSet *gs, void *key)
Definition: BLI_ghash.c:969
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:466
void copy_m3_m3(float m1[3][3], const float m2[3][3])
Definition: math_matrix.c:71
void unit_m3(float m[3][3])
Definition: math_matrix.c:40
void copy_m3_m4(float m1[3][3], const float m2[4][4])
Definition: math_matrix.c:87
void invert_m3_m3_safe_ortho(float Ainv[3][3], const float A[3][3])
Definition: math_matrix.c:3199
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:2224
bool orthogonalize_m3_zero_axes(float R[3][3], float unit_length)
Definition: math_matrix.c:1768
void copy_m4_m4(float m1[4][4], const float m2[4][4])
Definition: math_matrix.c:77
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
Definition: math_matrix.c:388
void copy_qt_qt(float q[4], const float a[4])
Definition: math_rotation.c:33
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:108
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
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:771
@ ID_RECALC_GEOMETRY
Definition: DNA_ID.h:791
@ LIB_TAG_DOIT
Definition: DNA_ID.h:707
@ ID_OB
Definition: DNA_ID_enums.h:47
@ MOTIONPATH_BAKE_HAS_PATHS
@ ROT_MODE_AXISANGLE
eInsertKeyFlags
@ BASE_SELECTABLE
@ BASE_SELECTED
#define MAX_DUPLI_RECUR
#define BA_TRANSFORM_PARENT
#define BA_TEMP_TAG
@ BA_WAS_SEL
@ BA_SNAP_FIX_DEPS_FIASCO
@ OB_NO_CONSTRAINTS
@ OB_NEG_SCALE
#define BA_TRANSFORM_LOCKED_IN_PLACE
#define BA_TRANSFORM_CHILD
@ PTCACHE_OUTDATED
#define BASE_SELECTED_EDITABLE(v3d, base)
@ SCE_XFORM_AXIS_ALIGN
#define BASE_EDITABLE(v3d, base)
#define OBACT(_view_layer)
@ V3D_AROUND_ACTIVE
@ V3D_AROUND_CURSOR
@ V3D_AROUND_LOCAL_ORIGINS
@ V3D_ORIENT_GIMBAL
#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_object_xform_skip_child_container_update_all(struct XFormObjectSkipChild_Container *xcs, struct Main *bmain, struct Depsgraph *depsgraph)
Definition: object_utils.c:257
void ED_object_xform_skip_child_container_destroy(struct XFormObjectSkipChild_Container *xcs)
Definition: object_utils.c:230
void ED_objects_recalculate_paths_selected(struct bContext *C, struct Scene *scene, eObjectPathCalcRange range)
Definition: object_edit.c:1104
void ED_object_base_select(struct Base *base, eObjectSelect_Mode mode)
Definition: object_select.c:76
struct XFormObjectSkipChild_Container * ED_object_xform_skip_child_container_create(void)
Definition: object_utils.c:161
void ED_object_data_xform_container_destroy(struct XFormObjectData_Container *xds)
Definition: object_utils.c:409
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:236
void ED_object_data_xform_container_item_ensure(struct XFormObjectData_Container *xds, struct Object *ob)
Definition: object_utils.c:341
eObjectPathCalcRange
Definition: ED_object.h:396
@ OBJECT_PATH_CALC_RANGE_CHANGED
Definition: ED_object.h:398
@ OBJECT_PATH_CALC_RANGE_CURRENT_FRAME
Definition: ED_object.h:397
void ED_object_data_xform_container_update_all(struct XFormObjectData_Container *xds, struct Main *bmain, struct Depsgraph *depsgraph)
Definition: object_utils.c:358
@ BA_SELECT
Definition: ED_object.h:155
struct XFormObjectData_Container * ED_object_data_xform_container_create(void)
Definition: object_utils.c:402
@ XFORM_OB_SKIP_CHILD_PARENT_APPLY
Definition: ED_object.h:109
@ XFORM_OB_SKIP_CHILD_PARENT_IS_XFORM_INDIRECT
Definition: ED_object.h:102
@ XFORM_OB_SKIP_CHILD_PARENT_IS_XFORM
Definition: ED_object.h:97
@ TFM_RESIZE
Definition: ED_transform.h:32
@ TFM_ROTATION
Definition: ED_transform.h:31
@ TFM_TRANSLATION
Definition: ED_transform.h:30
@ TFM_DUMMY
Definition: ED_transform.h:29
@ TFM_TRACKBALL
Definition: ED_transform.h:39
_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:25
#define SELECT
Scene scene
const Depsgraph * depsgraph
void * user_data
#define rot(x, k)
#define GS(x)
Definition: iris.c:225
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
Definition: keyframing.c:2850
eInsertKeyFlags ANIM_get_keyframing_flags(Scene *scene, const bool use_autokey_mode)
Definition: keyframing.c:82
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:1476
int ANIM_apply_keyingset(bContext *C, ListBase *dsources, bAction *act, KeyingSet *ks, short mode, float cfra)
Definition: keyingsets.c:1038
KeyingSet * ANIM_scene_get_active_keyingset(const Scene *scene)
Definition: keyingsets.c:647
KeyingSet * ANIM_builtin_keyingset_get_named(KeyingSet *prevKS, const char name[])
Definition: keyingsets.c:531
void ANIM_relative_keyingset_add_source(ListBase *dsources, ID *id, StructRNA *srna, void *data)
Definition: keyingsets.c:924
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
bool gimbal_axis_object(struct Object *ob, float gmat[3][3])
#define TRANS_DATA_CONTAINER_FIRST_SINGLE(t)
#define FOREACH_TRANS_DATA_CONTAINER(t, th)
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:368
struct Library * lib
Definition: DNA_ID.h:372
char name[66]
Definition: DNA_ID.h:378
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
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
struct RenderData r
char transform_pivot_point
float axismtx_gimbal[3][3]
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
void animrecord_check_state(TransInfo *t, struct ID *id)
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)
static void special_aftertrans_update__object(bContext *C, TransInfo *t)
static void set_trans_object_base_flags(TransInfo *t)
static void recalcData_objects(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)
static void trans_object_base_deps_flag_finish(const TransInfo *t, ViewLayer *view_layer)
#define BASE_XFORM_INDIRECT(base)
static int count_proportional_objects(TransInfo *t)
static void createTransObject(bContext *C, 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))
TransConvertTypeInfo TransConvertType_Object
@ 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 applySnappingIndividual(TransInfo *t)