Blender  V3.3
rna_constraint.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include <stdlib.h>
8 
9 #include "BLI_math.h"
10 
11 #include "MEM_guardedalloc.h"
12 
13 #include "BLT_translation.h"
14 
15 #include "DNA_action_types.h"
16 #include "DNA_constraint_types.h"
17 #include "DNA_modifier_types.h"
18 #include "DNA_object_types.h"
19 #include "DNA_scene_types.h"
20 
21 #include "RNA_define.h"
22 #include "RNA_enum_types.h"
23 
24 #include "rna_internal.h"
25 
26 #include "WM_types.h"
27 
28 #include "ED_object.h"
29 
30 /* please keep the names in sync with constraint.c */
32  RNA_ENUM_ITEM_HEADING(N_("Motion Tracking"), NULL),
33  {CONSTRAINT_TYPE_CAMERASOLVER, "CAMERA_SOLVER", ICON_CON_CAMERASOLVER, "Camera Solver", ""},
34  {CONSTRAINT_TYPE_FOLLOWTRACK, "FOLLOW_TRACK", ICON_CON_FOLLOWTRACK, "Follow Track", ""},
35  {CONSTRAINT_TYPE_OBJECTSOLVER, "OBJECT_SOLVER", ICON_CON_OBJECTSOLVER, "Object Solver", ""},
36 
37  RNA_ENUM_ITEM_HEADING(N_("Transform"), NULL),
39  "COPY_LOCATION",
40  ICON_CON_LOCLIKE,
41  "Copy Location",
42  "Copy the location of a target (with an optional offset), so that they move together"},
44  "COPY_ROTATION",
45  ICON_CON_ROTLIKE,
46  "Copy Rotation",
47  "Copy the rotation of a target (with an optional offset), so that they rotate together"},
49  "COPY_SCALE",
50  ICON_CON_SIZELIKE,
51  "Copy Scale",
52  "Copy the scale factors of a target (with an optional offset), so that they are scaled by "
53  "the same amount"},
55  "COPY_TRANSFORMS",
56  ICON_CON_TRANSLIKE,
57  "Copy Transforms",
58  "Copy all the transformations of a target, so that they move together"},
60  "LIMIT_DISTANCE",
61  ICON_CON_DISTLIMIT,
62  "Limit Distance",
63  "Restrict movements to within a certain distance of a target (at the time of constraint "
64  "evaluation only)"},
66  "LIMIT_LOCATION",
67  ICON_CON_LOCLIMIT,
68  "Limit Location",
69  "Restrict movement along each axis within given ranges"},
71  "LIMIT_ROTATION",
72  ICON_CON_ROTLIMIT,
73  "Limit Rotation",
74  "Restrict rotation along each axis within given ranges"},
76  "LIMIT_SCALE",
77  ICON_CON_SIZELIMIT,
78  "Limit Scale",
79  "Restrict scaling along each axis with given ranges"},
81  "MAINTAIN_VOLUME",
82  ICON_CON_SAMEVOL,
83  "Maintain Volume",
84  "Compensate for scaling one axis by applying suitable scaling to the other two axes"},
86  "TRANSFORM",
87  ICON_CON_TRANSFORM,
88  "Transformation",
89  "Use one transform property from target to control another (or same) property on owner"},
91  "TRANSFORM_CACHE",
92  ICON_CON_TRANSFORM_CACHE,
93  "Transform Cache",
94  "Look up the transformation matrix from an external file"},
95 
96  RNA_ENUM_ITEM_HEADING(N_("Tracking"), NULL),
98  "CLAMP_TO",
99  ICON_CON_CLAMPTO,
100  "Clamp To",
101  "Restrict movements to lie along a curve by remapping location along curve's longest axis"},
103  "DAMPED_TRACK",
104  ICON_CON_TRACKTO,
105  "Damped Track",
106  "Point towards a target by performing the smallest rotation necessary"},
108  "IK",
109  ICON_CON_KINEMATIC,
110  "Inverse Kinematics",
111  "Control a chain of bones by specifying the endpoint target (Bones only)"},
113  "LOCKED_TRACK",
114  ICON_CON_LOCKTRACK,
115  "Locked Track",
116  "Rotate around the specified ('locked') axis to point towards a target"},
118  "SPLINE_IK",
119  ICON_CON_SPLINEIK,
120  "Spline IK",
121  "Align chain of bones along a curve (Bones only)"},
123  "STRETCH_TO",
124  ICON_CON_STRETCHTO,
125  "Stretch To",
126  "Stretch along Y-Axis to point towards a target"},
128  "TRACK_TO",
129  ICON_CON_TRACKTO,
130  "Track To",
131  "Legacy tracking constraint prone to twisting artifacts"},
132 
133  RNA_ENUM_ITEM_HEADING(N_("Relationship"), NULL),
135  "ACTION",
136  ICON_ACTION,
137  "Action",
138  "Use transform property of target to look up pose for owner from an Action"},
140  "ARMATURE",
141  ICON_CON_ARMATURE,
142  "Armature",
143  "Apply weight-blended transformation from multiple bones like the Armature modifier"},
145  "CHILD_OF",
146  ICON_CON_CHILDOF,
147  "Child Of",
148  "Make target the 'detachable' parent of owner"},
150  "FLOOR",
151  ICON_CON_FLOOR,
152  "Floor",
153  "Use position (and optionally rotation) of target to define a 'wall' or 'floor' that the "
154  "owner can not cross"},
156  "FOLLOW_PATH",
157  ICON_CON_FOLLOWPATH,
158  "Follow Path",
159  "Use to animate an object/bone following a path"},
161  "PIVOT",
162  ICON_CON_PIVOT,
163  "Pivot",
164  "Change pivot point for transforms (buggy)"},
165 #if 0
166  {CONSTRAINT_TYPE_RIGIDBODYJOINT,
167  "RIGID_BODY_JOINT",
168  ICON_CONSTRAINT_DATA,
169  "Rigid Body Joint",
170  "Use to define a Rigid Body Constraint (for Game Engine use only)"},
172  "SCRIPT",
173  ICON_CONSTRAINT_DATA,
174  "Script",
175  "Custom constraint(s) written in Python (Not yet implemented)"},
176 #endif
178  "SHRINKWRAP",
179  ICON_CON_SHRINKWRAP,
180  "Shrinkwrap",
181  "Restrict movements to surface of target mesh"},
182  {0, NULL, 0, NULL, NULL},
183 };
184 
187  "WORLD",
188  0,
189  "World Space",
190  "The transformation of the target is evaluated relative to the world "
191  "coordinate system"},
193  "CUSTOM",
194  0,
195  "Custom Space",
196  "The transformation of the target is evaluated relative to a custom object/bone/vertex "
197  "group"},
200  "POSE",
201  0,
202  "Pose Space",
203  "The transformation of the target is only evaluated in the Pose Space, "
204  "the target armature object transformation is ignored"},
206  "LOCAL_WITH_PARENT",
207  0,
208  "Local With Parent",
209  "The transformation of the target bone is evaluated relative to its rest pose "
210  "local coordinate system, thus including the parent-induced transformation"},
212  "LOCAL",
213  0,
214  "Local Space",
215  "The transformation of the target is evaluated relative to its local "
216  "coordinate system"},
218  "LOCAL_OWNER_ORIENT",
219  0,
220  "Local Space (Owner Orientation)",
221  "The transformation of the target bone is evaluated relative to its local coordinate "
222  "system, followed by a correction for the difference in target and owner rest pose "
223  "orientations. When applied as local transform to the owner produces the same global "
224  "motion as the target if the parents are still in rest pose"},
225  {0, NULL, 0, NULL, NULL},
226 };
227 
230  "WORLD",
231  0,
232  "World Space",
233  "The constraint is applied relative to the world coordinate system"},
235  "CUSTOM",
236  0,
237  "Custom Space",
238  "The constraint is applied in local space of a custom object/bone/vertex group"},
241  "POSE",
242  0,
243  "Pose Space",
244  "The constraint is applied in Pose Space, the object transformation is ignored"},
246  "LOCAL_WITH_PARENT",
247  0,
248  "Local With Parent",
249  "The constraint is applied relative to the rest pose local coordinate system "
250  "of the bone, thus including the parent-induced transformation"},
252  "LOCAL",
253  0,
254  "Local Space",
255  "The constraint is applied relative to the local coordinate system of the object"},
256  {0, NULL, 0, NULL, NULL},
257 };
258 
260  {TRACK_X, "TRACK_X", 0, "X", ""},
261  {TRACK_Y, "TRACK_Y", 0, "Y", ""},
262  {TRACK_Z, "TRACK_Z", 0, "Z", ""},
263  {TRACK_nX, "TRACK_NEGATIVE_X", 0, "-X", ""},
264  {TRACK_nY, "TRACK_NEGATIVE_Y", 0, "-Y", ""},
265  {TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""},
266  {0, NULL, 0, NULL, NULL},
267 };
268 
270  {CONSTRAINT_EULER_AUTO, "AUTO", 0, "Default", "Euler using the default rotation order"},
271  {CONSTRAINT_EULER_XYZ, "XYZ", 0, "XYZ Euler", "Euler using the XYZ rotation order"},
272  {CONSTRAINT_EULER_XZY, "XZY", 0, "XZY Euler", "Euler using the XZY rotation order"},
273  {CONSTRAINT_EULER_YXZ, "YXZ", 0, "YXZ Euler", "Euler using the YXZ rotation order"},
274  {CONSTRAINT_EULER_YZX, "YZX", 0, "YZX Euler", "Euler using the YZX rotation order"},
275  {CONSTRAINT_EULER_ZXY, "ZXY", 0, "ZXY Euler", "Euler using the ZXY rotation order"},
276  {CONSTRAINT_EULER_ZYX, "ZYX", 0, "ZYX Euler", "Euler using the ZYX rotation order"},
277  {0, NULL, 0, NULL, NULL},
278 };
279 
280 #ifdef RNA_RUNTIME
281 
282 static const EnumPropertyItem space_object_items[] = {
284  "WORLD",
285  0,
286  "World Space",
287  "The transformation of the target is evaluated relative to the world coordinate system"},
289  "CUSTOM",
290  0,
291  "Custom Space",
292  "The transformation of the target is evaluated relative to a custom object/bone/vertex "
293  "group"},
295  "LOCAL",
296  0,
297  "Local Space",
298  "The transformation of the target is evaluated relative to its local coordinate system"},
299  {0, NULL, 0, NULL, NULL},
300 };
301 
302 # include "DNA_cachefile_types.h"
303 
304 # include "BKE_action.h"
305 # include "BKE_animsys.h"
306 # include "BKE_constraint.h"
307 # include "BKE_context.h"
308 
309 # ifdef WITH_ALEMBIC
310 # include "ABC_alembic.h"
311 # endif
312 
313 static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
314 {
315  bConstraint *con = (bConstraint *)ptr->data;
316 
317  switch (con->type) {
319  return &RNA_ChildOfConstraint;
321  return &RNA_TrackToConstraint;
323  return &RNA_KinematicConstraint;
325  return &RNA_FollowPathConstraint;
327  return &RNA_CopyRotationConstraint;
329  return &RNA_CopyLocationConstraint;
331  return &RNA_CopyScaleConstraint;
333  return &RNA_MaintainVolumeConstraint;
335  return &RNA_PythonConstraint;
337  return &RNA_ArmatureConstraint;
339  return &RNA_ActionConstraint;
341  return &RNA_LockedTrackConstraint;
343  return &RNA_StretchToConstraint;
345  return &RNA_FloorConstraint;
347  return &RNA_ClampToConstraint;
349  return &RNA_TransformConstraint;
351  return &RNA_LimitRotationConstraint;
353  return &RNA_LimitLocationConstraint;
355  return &RNA_LimitScaleConstraint;
357  return &RNA_LimitDistanceConstraint;
359  return &RNA_ShrinkwrapConstraint;
361  return &RNA_DampedTrackConstraint;
363  return &RNA_SplineIKConstraint;
365  return &RNA_CopyTransformsConstraint;
367  return &RNA_PivotConstraint;
369  return &RNA_FollowTrackConstraint;
371  return &RNA_CameraSolverConstraint;
373  return &RNA_ObjectSolverConstraint;
375  return &RNA_TransformCacheConstraint;
376  default:
377  return &RNA_UnknownType;
378  }
379 }
380 
381 static void rna_ConstraintTargetBone_target_set(PointerRNA *ptr,
382  PointerRNA value,
383  struct ReportList *UNUSED(reports))
384 {
386  Object *ob = value.data;
387 
388  if (!ob || ob->type == OB_ARMATURE) {
389  id_lib_extern((ID *)ob);
390  tgt->tar = ob;
391  }
392 }
393 
394 static void rna_Constraint_name_set(PointerRNA *ptr, const char *value)
395 {
396  bConstraint *con = ptr->data;
397  char oldname[sizeof(con->name)];
398 
399  /* make a copy of the old name first */
400  BLI_strncpy(oldname, con->name, sizeof(con->name));
401 
402  /* copy the new name into the name slot */
403  BLI_strncpy_utf8(con->name, value, sizeof(con->name));
404 
405  /* make sure name is unique */
406  if (ptr->owner_id) {
407  Object *ob = (Object *)ptr->owner_id;
409 
410  /* if we have the list, check for unique name, otherwise give up */
411  if (list) {
412  BKE_constraint_unique_name(con, list);
413  }
414  }
415 
416  /* fix all the animation data which may link to this */
417  BKE_animdata_fix_paths_rename_all(NULL, "constraints", oldname, con->name);
418 }
419 
420 static char *rna_Constraint_do_compute_path(Object *ob, bConstraint *con)
421 {
422  bPoseChannel *pchan;
424 
425  if (lb == NULL) {
426  printf("%s: internal error, constraint '%s' not found in object '%s'\n",
427  __func__,
428  con->name,
429  ob->id.name);
430  }
431 
432  if (pchan) {
433  char name_esc_pchan[sizeof(pchan->name) * 2];
434  char name_esc_const[sizeof(con->name) * 2];
435  BLI_str_escape(name_esc_pchan, pchan->name, sizeof(name_esc_pchan));
436  BLI_str_escape(name_esc_const, con->name, sizeof(name_esc_const));
437  return BLI_sprintfN("pose.bones[\"%s\"].constraints[\"%s\"]", name_esc_pchan, name_esc_const);
438  }
439  else {
440  char name_esc_const[sizeof(con->name) * 2];
441  BLI_str_escape(name_esc_const, con->name, sizeof(name_esc_const));
442  return BLI_sprintfN("constraints[\"%s\"]", name_esc_const);
443  }
444 }
445 
446 static char *rna_Constraint_path(const PointerRNA *ptr)
447 {
448  Object *ob = (Object *)ptr->owner_id;
449  bConstraint *con = ptr->data;
450 
451  return rna_Constraint_do_compute_path(ob, con);
452 }
453 
454 static bConstraint *rna_constraint_from_target(const PointerRNA *ptr)
455 {
456  Object *ob = (Object *)ptr->owner_id;
457  bConstraintTarget *tgt = ptr->data;
458 
459  return BKE_constraint_find_from_target(ob, tgt, NULL);
460 }
461 
462 static char *rna_ConstraintTarget_path(const PointerRNA *ptr)
463 {
464  Object *ob = (Object *)ptr->owner_id;
465  bConstraintTarget *tgt = ptr->data;
466  bConstraint *con = rna_constraint_from_target(ptr);
467  int index = -1;
468 
469  if (con != NULL) {
470  if (con->type == CONSTRAINT_TYPE_ARMATURE) {
471  bArmatureConstraint *acon = con->data;
472  index = BLI_findindex(&acon->targets, tgt);
473  }
474  else if (con->type == CONSTRAINT_TYPE_PYTHON) {
475  bPythonConstraint *pcon = con->data;
476  index = BLI_findindex(&pcon->targets, tgt);
477  }
478  }
479 
480  if (index >= 0) {
481  char *con_path = rna_Constraint_do_compute_path(ob, con);
482  char *result = BLI_sprintfN("%s.targets[%d]", con_path, index);
483 
484  MEM_freeN(con_path);
485  return result;
486  }
487  else {
488  printf("%s: internal error, constraint '%s' of object '%s' does not contain the target\n",
489  __func__,
490  con->name,
491  ob->id.name);
492  }
493 
494  return NULL;
495 }
496 
497 static void rna_Constraint_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
498 {
500 }
501 
502 static void rna_Constraint_dependency_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
503 {
505 }
506 
507 static void rna_ConstraintTarget_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
508 {
509  ED_object_constraint_tag_update(bmain, (Object *)ptr->owner_id, rna_constraint_from_target(ptr));
510 }
511 
512 static void rna_ConstraintTarget_dependency_update(Main *bmain,
513  Scene *UNUSED(scene),
514  PointerRNA *ptr)
515 {
517  bmain, (Object *)ptr->owner_id, rna_constraint_from_target(ptr));
518 }
519 
520 static void rna_Constraint_influence_update(Main *bmain, Scene *scene, PointerRNA *ptr)
521 {
522  Object *ob = (Object *)ptr->owner_id;
523 
524  if (ob->pose) {
525  ob->pose->flag |= (POSE_LOCKED | POSE_DO_UNLOCK);
526  }
527 
528  rna_Constraint_update(bmain, scene, ptr);
529 }
530 
531 /* Update only needed so this isn't overwritten on first evaluation. */
532 static void rna_Constraint_childof_inverse_matrix_update(Main *bmain,
533  Scene *scene,
534  PointerRNA *ptr)
535 {
536  bConstraint *con = ptr->data;
537  bChildOfConstraint *data = con->data;
538  data->flag &= ~CHILDOF_SET_INVERSE;
539  rna_Constraint_update(bmain, scene, ptr);
540 }
541 
542 static void rna_Constraint_ik_type_set(struct PointerRNA *ptr, int value)
543 {
544  bConstraint *con = ptr->data;
545  bKinematicConstraint *ikdata = con->data;
546 
547  if (ikdata->type != value) {
548  /* the type of IK constraint has changed, set suitable default values */
549  /* in case constraints reuse same fields incompatible */
550  switch (value) {
552  break;
554  break;
555  }
556  ikdata->type = value;
557  }
558 }
559 
560 /* DEPRECATED: use_offset replaced with mix_mode */
561 static bool rna_Constraint_RotLike_use_offset_get(struct PointerRNA *ptr)
562 {
563  bConstraint *con = ptr->data;
564  bRotateLikeConstraint *rotlike = con->data;
565  return rotlike->mix_mode != ROTLIKE_MIX_REPLACE;
566 }
567 
568 static void rna_Constraint_RotLike_use_offset_set(struct PointerRNA *ptr, bool value)
569 {
570  bConstraint *con = ptr->data;
571  bRotateLikeConstraint *rotlike = con->data;
572  bool curval = (rotlike->mix_mode != ROTLIKE_MIX_REPLACE);
573  if (curval != value) {
574  rotlike->mix_mode = (value ? ROTLIKE_MIX_OFFSET : ROTLIKE_MIX_REPLACE);
575  }
576 }
577 
578 static const EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext *UNUSED(C),
579  PointerRNA *ptr,
580  PropertyRNA *UNUSED(prop),
581  bool *UNUSED(r_free))
582 {
583  Object *ob = (Object *)ptr->owner_id;
584  bConstraint *con = (bConstraint *)ptr->data;
585 
586  if (BLI_findindex(&ob->constraints, con) == -1) {
588  }
589  else {
590  /* object */
591  return space_object_items;
592  }
593 }
594 
595 static const EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *UNUSED(C),
596  PointerRNA *ptr,
597  PropertyRNA *UNUSED(prop),
598  bool *UNUSED(r_free))
599 {
600  bConstraint *con = (bConstraint *)ptr->data;
601  ListBase targets = {NULL, NULL};
602  bConstraintTarget *ct;
603 
604  if (BKE_constraint_targets_get(con, &targets)) {
605  for (ct = targets.first; ct; ct = ct->next) {
606  if (ct->tar && ct->tar->type == OB_ARMATURE && !(ct->flag & CONSTRAINT_TAR_CUSTOM_SPACE)) {
607  break;
608  }
609  }
610 
611  BKE_constraint_targets_flush(con, &targets, 1);
612 
613  if (ct) {
615  }
616  }
617 
618  return space_object_items;
619 }
620 
621 static bConstraintTarget *rna_ArmatureConstraint_target_new(ID *id, bConstraint *con, Main *bmain)
622 {
623  bArmatureConstraint *acon = con->data;
624  bConstraintTarget *tgt = MEM_callocN(sizeof(bConstraintTarget), "Constraint Target");
625 
626  tgt->weight = 1.0f;
627  BLI_addtail(&acon->targets, tgt);
628 
630  return tgt;
631 }
632 
633 static void rna_ArmatureConstraint_target_remove(
634  ID *id, bConstraint *con, Main *bmain, ReportList *reports, PointerRNA *target_ptr)
635 {
636  bArmatureConstraint *acon = con->data;
637  bConstraintTarget *tgt = target_ptr->data;
638 
639  if (BLI_findindex(&acon->targets, tgt) < 0) {
640  BKE_report(reports, RPT_ERROR, "Target is not in the constraint target list");
641  return;
642  }
643 
644  BLI_freelinkN(&acon->targets, tgt);
645 
647 }
648 
649 static void rna_ArmatureConstraint_target_clear(ID *id, bConstraint *con, Main *bmain)
650 {
651  bArmatureConstraint *acon = con->data;
652 
653  BLI_freelistN(&acon->targets);
654 
656 }
657 
658 static void rna_ActionConstraint_mix_mode_set(PointerRNA *ptr, int value)
659 {
660  bConstraint *con = (bConstraint *)ptr->data;
661  bActionConstraint *acon = (bActionConstraint *)con->data;
662 
663  acon->mix_mode = value;
664 
665  /* The After mode can be computed in world space for efficiency
666  * and backward compatibility, while Before or Split requires Local. */
669  }
670  else {
672  }
673 }
674 
675 static void rna_ActionConstraint_minmax_range(
676  PointerRNA *ptr, float *min, float *max, float *UNUSED(softmin), float *UNUSED(softmax))
677 {
678  bConstraint *con = (bConstraint *)ptr->data;
679  bActionConstraint *acon = (bActionConstraint *)con->data;
680 
681  /* 0, 1, 2 = magic numbers for rotX, rotY, rotZ */
682  if (ELEM(acon->type, 0, 1, 2)) {
683  *min = -180.0f;
684  *max = 180.0f;
685  }
686  else {
687  *min = -1000.0f;
688  *max = 1000.0f;
689  }
690 }
691 
692 static int rna_SplineIKConstraint_joint_bindings_get_length(const PointerRNA *ptr,
694 {
695  const bConstraint *con = (bConstraint *)ptr->data;
696  const bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data;
697 
698  if (ikData) {
699  length[0] = ikData->numpoints;
700  }
701  else {
702  length[0] = 0;
703  }
704 
705  return length[0];
706 }
707 
708 static void rna_SplineIKConstraint_joint_bindings_get(PointerRNA *ptr, float *values)
709 {
710  bConstraint *con = (bConstraint *)ptr->data;
711  bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data;
712 
713  memcpy(values, ikData->points, ikData->numpoints * sizeof(float));
714 }
715 
716 static void rna_SplineIKConstraint_joint_bindings_set(PointerRNA *ptr, const float *values)
717 {
718  bConstraint *con = (bConstraint *)ptr->data;
719  bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data;
720 
721  memcpy(ikData->points, values, ikData->numpoints * sizeof(float));
722 }
723 
724 static int rna_ShrinkwrapConstraint_face_cull_get(PointerRNA *ptr)
725 {
726  bConstraint *con = (bConstraint *)ptr->data;
728  return swc->flag & CON_SHRINKWRAP_PROJECT_CULL_MASK;
729 }
730 
731 static void rna_ShrinkwrapConstraint_face_cull_set(struct PointerRNA *ptr, int value)
732 {
733  bConstraint *con = (bConstraint *)ptr->data;
735  swc->flag = (swc->flag & ~CON_SHRINKWRAP_PROJECT_CULL_MASK) | value;
736 }
737 
738 static bool rna_Constraint_cameraObject_poll(PointerRNA *ptr, PointerRNA value)
739 {
740  Object *ob = (Object *)value.data;
741 
742  if (ob) {
743  if (ob->type == OB_CAMERA && ob != (Object *)ptr->owner_id) {
744  return 1;
745  }
746  }
747 
748  return 0;
749 }
750 
751 static void rna_Constraint_followTrack_camera_set(PointerRNA *ptr,
752  PointerRNA value,
753  struct ReportList *UNUSED(reports))
754 {
755  bConstraint *con = (bConstraint *)ptr->data;
757  Object *ob = (Object *)value.data;
758 
759  if (ob) {
760  if (ob->type == OB_CAMERA && ob != (Object *)ptr->owner_id) {
761  data->camera = ob;
762  id_lib_extern((ID *)ob);
763  }
764  }
765  else {
766  data->camera = NULL;
767  }
768 }
769 
770 static void rna_Constraint_followTrack_depthObject_set(PointerRNA *ptr,
771  PointerRNA value,
772  struct ReportList *UNUSED(reports))
773 {
774  bConstraint *con = (bConstraint *)ptr->data;
776  Object *ob = (Object *)value.data;
777 
778  if (ob) {
779  if (ob->type == OB_MESH && ob != (Object *)ptr->owner_id) {
780  data->depth_ob = ob;
781  id_lib_extern((ID *)ob);
782  }
783  }
784  else {
785  data->depth_ob = NULL;
786  }
787 }
788 
789 static bool rna_Constraint_followTrack_depthObject_poll(PointerRNA *ptr, PointerRNA value)
790 {
791  Object *ob = (Object *)value.data;
792 
793  if (ob) {
794  if (ob->type == OB_MESH && ob != (Object *)ptr->owner_id) {
795  return 1;
796  }
797  }
798 
799  return 0;
800 }
801 
802 static void rna_Constraint_objectSolver_camera_set(PointerRNA *ptr,
803  PointerRNA value,
804  struct ReportList *UNUSED(reports))
805 {
806  bConstraint *con = (bConstraint *)ptr->data;
808  Object *ob = (Object *)value.data;
809 
810  if (ob) {
811  if (ob->type == OB_CAMERA && ob != (Object *)ptr->owner_id) {
812  data->camera = ob;
813  id_lib_extern((ID *)ob);
814  }
815  }
816  else {
817  data->camera = NULL;
818  }
819 }
820 
821 #else
822 
825  "LIMITDIST_INSIDE",
826  0,
827  "Inside",
828  "The object is constrained inside a virtual sphere around the target object, "
829  "with a radius defined by the limit distance"},
831  "LIMITDIST_OUTSIDE",
832  0,
833  "Outside",
834  "The object is constrained outside a virtual sphere around the target object, "
835  "with a radius defined by the limit distance"},
837  "LIMITDIST_ONSURFACE",
838  0,
839  "On Surface",
840  "The object is constrained on the surface of a virtual sphere around the target object, "
841  "with a radius defined by the limit distance"},
842  {0, NULL, 0, NULL, NULL},
843 };
844 
846 {
847  PropertyRNA *prop;
848 
850 
851  prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
852  RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
853  RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head is 0, Tail is 1");
854  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
855 
856  prop = RNA_def_property(srna, "use_bbone_shape", PROP_BOOLEAN, PROP_NONE);
857  RNA_def_property_boolean_sdna(prop, "bConstraint", "flag", CONSTRAINT_BBONE_SHAPE);
859  "Follow B-Bone",
860  "Follow shape of B-Bone segments when calculating Head/Tail position");
861  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
862 
864 }
865 
867 {
868  PropertyRNA *prop;
869 
871 
872  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
873  RNA_def_property_pointer_sdna(prop, NULL, "tar");
874  RNA_def_property_ui_text(prop, "Target", "Target object");
876  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
877 
878  prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
879  RNA_def_property_string_sdna(prop, NULL, "subtarget");
880  RNA_def_property_ui_text(prop, "Sub-Target", "Armature bone, mesh or lattice vertex group, ...");
881  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
882 
884 }
885 
887 {
888  StructRNA *srna;
889  PropertyRNA *prop;
890 
891  srna = RNA_def_struct(brna, "ConstraintTarget", NULL);
892  RNA_def_struct_ui_text(srna, "Constraint Target", "Target object for multi-target constraints");
893  RNA_def_struct_path_func(srna, "rna_ConstraintTarget_path");
894  RNA_def_struct_sdna(srna, "bConstraintTarget");
895 
897 
898  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
899  RNA_def_property_pointer_sdna(prop, NULL, "tar");
900  RNA_def_property_ui_text(prop, "Target", "Target object");
903  prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_dependency_update");
904 
905  prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
906  RNA_def_property_string_sdna(prop, NULL, "subtarget");
907  RNA_def_property_ui_text(prop, "Sub-Target", "Armature bone, mesh or lattice vertex group, ...");
909  prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_dependency_update");
910 
911  /* space, flag and type still to do. */
912 
914 }
915 
917 {
918  StructRNA *srna;
919  PropertyRNA *prop;
920 
921  srna = RNA_def_struct(brna, "ConstraintTargetBone", NULL);
923  srna, "Constraint Target Bone", "Target bone for multi-target constraints");
924  RNA_def_struct_path_func(srna, "rna_ConstraintTarget_path");
925  RNA_def_struct_sdna(srna, "bConstraintTarget");
926 
928 
929  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
930  RNA_def_property_pointer_sdna(prop, NULL, "tar");
931  RNA_def_property_ui_text(prop, "Target", "Target armature");
933  prop, NULL, "rna_ConstraintTargetBone_target_set", NULL, "rna_Armature_object_poll");
936  prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_dependency_update");
937 
938  prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
939  RNA_def_property_string_sdna(prop, NULL, "subtarget");
940  RNA_def_property_ui_text(prop, "Sub-Target", "Target armature bone");
942  prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_dependency_update");
943 
944  prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
945  RNA_def_property_float_sdna(prop, NULL, "weight");
946  RNA_def_property_range(prop, 0.0f, 1.0f);
947  RNA_def_property_ui_text(prop, "Blend Weight", "Blending weight of this bone");
948  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_update");
949 
951 }
952 
954 {
955  StructRNA *srna;
956  PropertyRNA *prop;
957 
958  srna = RNA_def_struct(brna, "ChildOfConstraint", "Constraint");
960  srna, "Child Of Constraint", "Create constraint-based parent-child relationship");
961  RNA_def_struct_sdna_from(srna, "bChildOfConstraint", "data");
962  RNA_def_struct_ui_icon(srna, ICON_CON_CHILDOF);
963 
965 
967 
968  prop = RNA_def_property(srna, "use_location_x", PROP_BOOLEAN, PROP_NONE);
970  RNA_def_property_ui_text(prop, "Location X", "Use X Location of Parent");
971  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
972 
973  prop = RNA_def_property(srna, "use_location_y", PROP_BOOLEAN, PROP_NONE);
975  RNA_def_property_ui_text(prop, "Location Y", "Use Y Location of Parent");
976  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
977 
978  prop = RNA_def_property(srna, "use_location_z", PROP_BOOLEAN, PROP_NONE);
980  RNA_def_property_ui_text(prop, "Location Z", "Use Z Location of Parent");
981  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
982 
983  prop = RNA_def_property(srna, "use_rotation_x", PROP_BOOLEAN, PROP_NONE);
985  RNA_def_property_ui_text(prop, "Rotation X", "Use X Rotation of Parent");
986  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
987 
988  prop = RNA_def_property(srna, "use_rotation_y", PROP_BOOLEAN, PROP_NONE);
990  RNA_def_property_ui_text(prop, "Rotation Y", "Use Y Rotation of Parent");
991  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
992 
993  prop = RNA_def_property(srna, "use_rotation_z", PROP_BOOLEAN, PROP_NONE);
995  RNA_def_property_ui_text(prop, "Rotation Z", "Use Z Rotation of Parent");
996  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
997 
998  prop = RNA_def_property(srna, "use_scale_x", PROP_BOOLEAN, PROP_NONE);
1000  RNA_def_property_ui_text(prop, "Scale X", "Use X Scale of Parent");
1001  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1002 
1003  prop = RNA_def_property(srna, "use_scale_y", PROP_BOOLEAN, PROP_NONE);
1005  RNA_def_property_ui_text(prop, "Scale Y", "Use Y Scale of Parent");
1006  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1007 
1008  prop = RNA_def_property(srna, "use_scale_z", PROP_BOOLEAN, PROP_NONE);
1010  RNA_def_property_ui_text(prop, "Scale Z", "Use Z Scale of Parent");
1011  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1012 
1013  prop = RNA_def_property(srna, "set_inverse_pending", PROP_BOOLEAN, PROP_NONE);
1016  prop, "Set Inverse Pending", "Set to true to request recalculation of the inverse matrix");
1017  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1018 
1019  prop = RNA_def_property(srna, "inverse_matrix", PROP_FLOAT, PROP_MATRIX);
1020  RNA_def_property_float_sdna(prop, NULL, "invmat");
1023  RNA_def_property_ui_text(prop, "Inverse Matrix", "Transformation matrix to apply before");
1025  prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_childof_inverse_matrix_update");
1026 
1028 }
1029 
1031 {
1032  StructRNA *srna;
1033  PropertyRNA *prop;
1034 
1035  srna = RNA_def_struct(brna, "PythonConstraint", "Constraint");
1036  RNA_def_struct_ui_text(srna, "Python Constraint", "Use Python script for constraint evaluation");
1037  RNA_def_struct_sdna_from(srna, "bPythonConstraint", "data");
1038 
1040 
1041  prop = RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
1042  RNA_def_property_collection_sdna(prop, NULL, "targets", NULL);
1043  RNA_def_property_struct_type(prop, "ConstraintTarget");
1044  RNA_def_property_ui_text(prop, "Targets", "Target Objects");
1045 
1046  prop = RNA_def_property(srna, "target_count", PROP_INT, PROP_NONE);
1047  RNA_def_property_int_sdna(prop, NULL, "tarnum");
1048  RNA_def_property_ui_text(prop, "Number of Targets", "Usually only 1 to 3 are needed");
1049  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1050 
1051  prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
1052  RNA_def_property_ui_text(prop, "Script", "The text object that contains the Python script");
1054  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1055 
1056  prop = RNA_def_property(srna, "use_targets", PROP_BOOLEAN, PROP_NONE);
1059  prop, "Use Targets", "Use the targets indicated in the constraint panel");
1060  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1061 
1062  prop = RNA_def_property(srna, "has_script_error", PROP_BOOLEAN, PROP_NONE);
1065  RNA_def_property_ui_text(prop, "Script Error", "The linked Python script has thrown an error");
1066 
1068 }
1069 
1071 {
1072  StructRNA *srna;
1073  FunctionRNA *func;
1074  PropertyRNA *parm;
1075 
1076  RNA_def_property_srna(cprop, "ArmatureConstraintTargets");
1077  srna = RNA_def_struct(brna, "ArmatureConstraintTargets", NULL);
1078  RNA_def_struct_sdna(srna, "bConstraint");
1080  srna, "Armature Deform Constraint Targets", "Collection of target bones and weights");
1081  RNA_def_struct_ui_icon(srna, ICON_CON_ARMATURE);
1082 
1083  func = RNA_def_function(srna, "new", "rna_ArmatureConstraint_target_new");
1085  RNA_def_function_ui_description(func, "Add a new target to the constraint");
1086  parm = RNA_def_pointer(func, "target", "ConstraintTargetBone", "", "New target bone");
1087  RNA_def_function_return(func, parm);
1088 
1089  func = RNA_def_function(srna, "remove", "rna_ArmatureConstraint_target_remove");
1091  RNA_def_function_ui_description(func, "Delete target from the constraint");
1092  parm = RNA_def_pointer(func, "target", "ConstraintTargetBone", "", "Target to remove");
1095 
1096  func = RNA_def_function(srna, "clear", "rna_ArmatureConstraint_target_clear");
1098  RNA_def_function_ui_description(func, "Delete all targets from object");
1099 }
1100 
1102 {
1103  StructRNA *srna;
1104  PropertyRNA *prop;
1105 
1106  srna = RNA_def_struct(brna, "ArmatureConstraint", "Constraint");
1108  srna, "Armature Constraint", "Applies transformations done by the Armature modifier");
1109  RNA_def_struct_sdna_from(srna, "bArmatureConstraint", "data");
1110  RNA_def_struct_ui_icon(srna, ICON_CON_ARMATURE);
1111 
1113 
1114  prop = RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
1115  RNA_def_property_collection_sdna(prop, NULL, "targets", NULL);
1116  RNA_def_property_struct_type(prop, "ConstraintTargetBone");
1117  RNA_def_property_ui_text(prop, "Targets", "Target Bones");
1119 
1120  prop = RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE);
1123  prop, "Preserve Volume", "Deform rotation interpolation with quaternions");
1124  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1125 
1126  prop = RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE);
1129  prop,
1130  "Use Envelopes",
1131  "Multiply weights by envelope for all bones, instead of acting like Vertex Group based "
1132  "blending. "
1133  "The specified weights are still used, and only the listed bones are considered");
1134  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1135 
1136  prop = RNA_def_property(srna, "use_current_location", PROP_BOOLEAN, PROP_NONE);
1139  "Use Current Location",
1140  "Use the current bone location for envelopes and choosing B-Bone "
1141  "segments instead of rest position");
1142  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1143 
1145 }
1146 
1148 {
1149  StructRNA *srna;
1150  PropertyRNA *prop;
1151 
1152  static const EnumPropertyItem constraint_ik_axisref_items[] = {
1153  {0, "BONE", 0, "Bone", ""},
1154  {CONSTRAINT_IK_TARGETAXIS, "TARGET", 0, "Target", ""},
1155  {0, NULL, 0, NULL, NULL},
1156  };
1157 
1158  static const EnumPropertyItem constraint_ik_type_items[] = {
1159  {CONSTRAINT_IK_COPYPOSE, "COPY_POSE", 0, "Copy Pose", ""},
1160  {CONSTRAINT_IK_DISTANCE, "DISTANCE", 0, "Distance", ""},
1161  {0, NULL, 0, NULL, NULL},
1162  };
1163 
1164  srna = RNA_def_struct(brna, "KinematicConstraint", "Constraint");
1165  RNA_def_struct_ui_text(srna, "Kinematic Constraint", "Inverse Kinematics");
1166  RNA_def_struct_sdna_from(srna, "bKinematicConstraint", "data");
1167  RNA_def_struct_ui_icon(srna, ICON_CON_KINEMATIC);
1168 
1170 
1172 
1173  prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
1174  RNA_def_property_range(prop, 0, 10000);
1175  RNA_def_property_ui_text(prop, "Iterations", "Maximum number of solving iterations");
1176  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1177 
1178  prop = RNA_def_property(srna, "pole_target", PROP_POINTER, PROP_NONE);
1179  RNA_def_property_pointer_sdna(prop, NULL, "poletar");
1180  RNA_def_property_ui_text(prop, "Pole Target", "Object for pole rotation");
1182  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1183 
1184  prop = RNA_def_property(srna, "pole_subtarget", PROP_STRING, PROP_NONE);
1185  RNA_def_property_string_sdna(prop, NULL, "polesubtarget");
1186  RNA_def_property_ui_text(prop, "Pole Sub-Target", "");
1187  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1188 
1189  prop = RNA_def_property(srna, "pole_angle", PROP_FLOAT, PROP_ANGLE);
1190  RNA_def_property_float_sdna(prop, NULL, "poleangle");
1191  RNA_def_property_range(prop, -M_PI, M_PI);
1192  RNA_def_property_ui_range(prop, -M_PI, M_PI, 10, 4);
1193  RNA_def_property_ui_text(prop, "Pole Angle", "Pole rotation offset");
1194  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1195 
1196  prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
1197  RNA_def_property_range(prop, 0.01, 1.0f);
1199  prop, "Weight", "For Tree-IK: Weight of position control for this target");
1200 
1201  prop = RNA_def_property(srna, "orient_weight", PROP_FLOAT, PROP_NONE);
1202  RNA_def_property_float_sdna(prop, NULL, "orientweight");
1203  RNA_def_property_range(prop, 0.01, 1.0f);
1205  prop, "Orientation Weight", "For Tree-IK: Weight of orientation control for this target");
1206  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1207 
1208  prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE);
1209  RNA_def_property_int_sdna(prop, NULL, "rootbone");
1210  /* Changing the IK chain length requires a rebuild of depsgraph relations. This makes it
1211  * unsuitable for animation. */
1213  RNA_def_property_range(prop, 0, 255);
1215  prop, "Chain Length", "How many bones are included in the IK effect - 0 uses all bones");
1216  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1217 
1218  prop = RNA_def_property(srna, "use_tail", PROP_BOOLEAN, PROP_NONE);
1220  RNA_def_property_ui_text(prop, "Use Tail", "Include bone's tail as last element in chain");
1221  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1222 
1223  prop = RNA_def_property(srna, "reference_axis", PROP_ENUM, PROP_NONE);
1225  RNA_def_property_enum_items(prop, constraint_ik_axisref_items);
1227  prop, "Axis Reference", "Constraint axis Lock options relative to Bone or Target reference");
1228  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1229 
1230  prop = RNA_def_property(srna, "use_location", PROP_BOOLEAN, PROP_NONE);
1232  RNA_def_property_ui_text(prop, "Position", "Chain follows position of target");
1233  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1234 
1235  prop = RNA_def_property(srna, "lock_location_x", PROP_BOOLEAN, PROP_NONE);
1237  RNA_def_property_ui_text(prop, "Lock X Pos", "Constraint position along X axis");
1238  RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1239 
1240  prop = RNA_def_property(srna, "lock_location_y", PROP_BOOLEAN, PROP_NONE);
1242  RNA_def_property_ui_text(prop, "Lock Y Pos", "Constraint position along Y axis");
1243  RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1244 
1245  prop = RNA_def_property(srna, "lock_location_z", PROP_BOOLEAN, PROP_NONE);
1247  RNA_def_property_ui_text(prop, "Lock Z Pos", "Constraint position along Z axis");
1248  RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1249 
1250  prop = RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE);
1252  RNA_def_property_ui_text(prop, "Rotation", "Chain follows rotation of target");
1253  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1254 
1255  prop = RNA_def_property(srna, "lock_rotation_x", PROP_BOOLEAN, PROP_NONE);
1257  RNA_def_property_ui_text(prop, "Lock X Rotation", "Constraint rotation along X axis");
1258  RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1259 
1260  prop = RNA_def_property(srna, "lock_rotation_y", PROP_BOOLEAN, PROP_NONE);
1262  RNA_def_property_ui_text(prop, "Lock Y Rotation", "Constraint rotation along Y axis");
1263  RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1264 
1265  prop = RNA_def_property(srna, "lock_rotation_z", PROP_BOOLEAN, PROP_NONE);
1267  RNA_def_property_ui_text(prop, "Lock Z Rotation", "Constraint rotation along Z axis");
1268  RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1269 
1270  prop = RNA_def_property(srna, "use_stretch", PROP_BOOLEAN, PROP_NONE);
1272  RNA_def_property_ui_text(prop, "Stretch", "Enable IK Stretching");
1273  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1274 
1275  prop = RNA_def_property(srna, "ik_type", PROP_ENUM, PROP_NONE);
1276  RNA_def_property_enum_sdna(prop, NULL, "type");
1277  RNA_def_property_enum_funcs(prop, NULL, "rna_Constraint_ik_type_set", NULL);
1278  RNA_def_property_enum_items(prop, constraint_ik_type_items);
1279  RNA_def_property_ui_text(prop, "IK Type", "");
1280  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1281 
1282  prop = RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE);
1283  RNA_def_property_enum_sdna(prop, NULL, "mode");
1286  prop, "Limit Mode", "Distances in relation to sphere of influence to allow");
1287  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1288 
1289  prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
1290  RNA_def_property_float_sdna(prop, NULL, "dist");
1291  RNA_def_property_range(prop, 0.0, 100.0f);
1292  RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere");
1293  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1294 
1296 }
1297 
1299 {
1300  StructRNA *srna;
1301  PropertyRNA *prop;
1302 
1303  static const EnumPropertyItem up_items[] = {
1304  {TRACK_X, "UP_X", 0, "X", ""},
1305  {TRACK_Y, "UP_Y", 0, "Y", ""},
1306  {TRACK_Z, "UP_Z", 0, "Z", ""},
1307  {0, NULL, 0, NULL, NULL},
1308  };
1309 
1310  srna = RNA_def_struct(brna, "TrackToConstraint", "Constraint");
1312  srna, "Track To Constraint", "Aim the constrained object toward the target");
1313 
1315 
1316  RNA_def_struct_sdna_from(srna, "bTrackToConstraint", "data");
1317 
1319 
1320  RNA_def_struct_ui_icon(srna, ICON_CON_TRACKTO);
1321 
1323 
1324  prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
1325  RNA_def_property_enum_sdna(prop, NULL, "reserved1");
1327  RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object");
1328  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1329 
1330  prop = RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
1331  RNA_def_property_enum_sdna(prop, NULL, "reserved2");
1332  RNA_def_property_enum_items(prop, up_items);
1333  RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward");
1334  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1335 
1336  prop = RNA_def_property(srna, "use_target_z", PROP_BOOLEAN, PROP_NONE);
1339  prop, "Target Z", "Target's Z axis, not World Z axis, will constraint the Up direction");
1340  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1341 
1343 }
1344 
1346 {
1347  StructRNA *srna;
1348  PropertyRNA *prop;
1349 
1350  srna = RNA_def_struct(brna, "CopyLocationConstraint", "Constraint");
1351  RNA_def_struct_ui_text(srna, "Copy Location Constraint", "Copy the location of the target");
1352  RNA_def_struct_ui_icon(srna, ICON_CON_LOCLIKE);
1353 
1355 
1356  RNA_def_struct_sdna_from(srna, "bLocateLikeConstraint", "data");
1357 
1359 
1361 
1362  prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
1364  RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X location");
1365  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1366 
1367  prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
1369  RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y location");
1370  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1371 
1372  prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
1374  RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z location");
1375  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1376 
1377  prop = RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE);
1379  RNA_def_property_ui_text(prop, "Invert X", "Invert the X location");
1380  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1381 
1382  prop = RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE);
1384  RNA_def_property_ui_text(prop, "Invert Y", "Invert the Y location");
1385  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1386 
1387  prop = RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
1389  RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z location");
1390  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1391 
1392  prop = RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
1394  RNA_def_property_ui_text(prop, "Offset", "Add original location into copied location");
1395  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1396 
1398 }
1399 
1401 {
1402  StructRNA *srna;
1403  PropertyRNA *prop;
1404 
1405  static const EnumPropertyItem mix_mode_items[] = {
1406  {ROTLIKE_MIX_REPLACE, "REPLACE", 0, "Replace", "Replace the original rotation with copied"},
1407  {ROTLIKE_MIX_ADD, "ADD", 0, "Add", "Add euler component values together"},
1409  "BEFORE",
1410  0,
1411  "Before Original",
1412  "Apply copied rotation before original, as if the constraint target is a parent"},
1414  "AFTER",
1415  0,
1416  "After Original",
1417  "Apply copied rotation after original, as if the constraint target is a child"},
1419  "OFFSET",
1420  0,
1421  "Offset (Legacy)",
1422  "Combine rotations like the original Offset checkbox. Does not work well for "
1423  "multiple axis rotations"},
1424  {0, NULL, 0, NULL, NULL},
1425  };
1426 
1427  srna = RNA_def_struct(brna, "CopyRotationConstraint", "Constraint");
1428  RNA_def_struct_ui_text(srna, "Copy Rotation Constraint", "Copy the rotation of the target");
1429  RNA_def_struct_sdna_from(srna, "bRotateLikeConstraint", "data");
1430  RNA_def_struct_ui_icon(srna, ICON_CON_ROTLIKE);
1431 
1433 
1435 
1436  prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
1438  RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X rotation");
1439  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1440 
1441  prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
1443  RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y rotation");
1444  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1445 
1446  prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
1448  RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z rotation");
1449  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1450 
1451  prop = RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE);
1453  RNA_def_property_ui_text(prop, "Invert X", "Invert the X rotation");
1454  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1455 
1456  prop = RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE);
1458  RNA_def_property_ui_text(prop, "Invert Y", "Invert the Y rotation");
1459  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1460 
1461  prop = RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
1463  RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z rotation");
1464  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1465 
1466  prop = RNA_def_property(srna, "euler_order", PROP_ENUM, PROP_NONE);
1467  RNA_def_property_enum_sdna(prop, NULL, "euler_order");
1469  RNA_def_property_ui_text(prop, "Euler Order", "Explicitly specify the euler rotation order");
1470  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1471 
1472  prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
1473  RNA_def_property_enum_sdna(prop, NULL, "mix_mode");
1474  RNA_def_property_enum_items(prop, mix_mode_items);
1476  prop, "Mix Mode", "Specify how the copied and existing rotations are combined");
1477  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1478 
1479  /* DEPRECATED: replaced with mix_mode */
1480  prop = RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
1482  prop, "rna_Constraint_RotLike_use_offset_get", "rna_Constraint_RotLike_use_offset_set");
1484  prop, "Offset", "DEPRECATED: Add original rotation into copied rotation");
1485  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1486 
1488 }
1489 
1491 {
1492  StructRNA *srna;
1493  PropertyRNA *prop;
1494 
1495  srna = RNA_def_struct(brna, "CopyScaleConstraint", "Constraint");
1496  RNA_def_struct_ui_text(srna, "Copy Scale Constraint", "Copy the scale of the target");
1497  RNA_def_struct_sdna_from(srna, "bSizeLikeConstraint", "data");
1498  RNA_def_struct_ui_icon(srna, ICON_CON_SIZELIKE);
1499 
1501 
1503 
1504  prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
1506  RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X scale");
1507  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1508 
1509  prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
1511  RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y scale");
1512  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1513 
1514  prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
1516  RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z scale");
1517  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1518 
1519  prop = RNA_def_property(srna, "power", PROP_FLOAT, PROP_NONE);
1520  RNA_def_property_float_sdna(prop, NULL, "power");
1521  RNA_def_property_float_default(prop, 1.0f);
1522  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 3);
1523  RNA_def_property_ui_text(prop, "Power", "Raise the target's scale to the specified power");
1524  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1525 
1526  prop = RNA_def_property(srna, "use_make_uniform", PROP_BOOLEAN, PROP_NONE);
1529  "Make Uniform",
1530  "Redistribute the copied change in volume equally "
1531  "between the three axes of the owner");
1532  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1533 
1534  prop = RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
1536  RNA_def_property_ui_text(prop, "Offset", "Combine original scale with copied scale");
1537  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1538 
1539  prop = RNA_def_property(srna, "use_add", PROP_BOOLEAN, PROP_NONE);
1542  prop,
1543  "Additive",
1544  "Use addition instead of multiplication to combine scale (2.7 compatibility)");
1545  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1546 
1548 }
1549 
1551 {
1552  StructRNA *srna;
1553  PropertyRNA *prop;
1554 
1555  static const EnumPropertyItem axis_items[] = {
1556  {SAMEVOL_X, "SAMEVOL_X", 0, "X", ""},
1557  {SAMEVOL_Y, "SAMEVOL_Y", 0, "Y", ""},
1558  {SAMEVOL_Z, "SAMEVOL_Z", 0, "Z", ""},
1559  {0, NULL, 0, NULL, NULL},
1560  };
1561 
1562  static const EnumPropertyItem mode_items[] = {
1563  {SAMEVOL_STRICT,
1564  "STRICT",
1565  0,
1566  "Strict",
1567  "Volume is strictly preserved, overriding the scaling of non-free axes"},
1568  {SAMEVOL_UNIFORM,
1569  "UNIFORM",
1570  0,
1571  "Uniform",
1572  "Volume is preserved when the object is scaled uniformly. "
1573  "Deviations from uniform scale on non-free axes are passed through"},
1575  "SINGLE_AXIS",
1576  0,
1577  "Single Axis",
1578  "Volume is preserved when the object is scaled only on the free axis. "
1579  "Non-free axis scaling is passed through"},
1580  {0, NULL, 0, NULL, NULL},
1581  };
1582 
1583  srna = RNA_def_struct(brna, "MaintainVolumeConstraint", "Constraint");
1585  "Maintain Volume Constraint",
1586  "Maintain a constant volume along a single scaling axis");
1587  RNA_def_struct_sdna_from(srna, "bSameVolumeConstraint", "data");
1588  RNA_def_struct_ui_icon(srna, ICON_CON_SAMEVOL);
1589 
1591 
1592  prop = RNA_def_property(srna, "free_axis", PROP_ENUM, PROP_NONE);
1593  RNA_def_property_enum_sdna(prop, NULL, "free_axis");
1594  RNA_def_property_enum_items(prop, axis_items);
1595  RNA_def_property_ui_text(prop, "Free Axis", "The free scaling axis of the object");
1596  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1597 
1598  prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1599  RNA_def_property_enum_sdna(prop, NULL, "mode");
1602  prop, "Mode", "The way the constraint treats original non-free axis scaling");
1603  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1604 
1605  prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_DISTANCE);
1606  RNA_def_property_range(prop, 0.001f, 100.0f);
1607  RNA_def_property_ui_text(prop, "Volume", "Volume of the bone at rest");
1608  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1609 
1611 }
1612 
1614 {
1615  StructRNA *srna;
1616  PropertyRNA *prop;
1617 
1618  static const EnumPropertyItem mix_mode_items[] = {
1620  "REPLACE",
1621  0,
1622  "Replace",
1623  "Replace the original transformation with copied"},
1626  "BEFORE_FULL",
1627  0,
1628  "Before Original (Full)",
1629  "Apply copied transformation before original, using simple matrix multiplication as if "
1630  "the constraint target is a parent in Full Inherit Scale mode. "
1631  "Will create shear when combining rotation and non-uniform scale"},
1633  "BEFORE",
1634  0,
1635  "Before Original (Aligned)",
1636  "Apply copied transformation before original, as if the constraint target is a parent in "
1637  "Aligned Inherit Scale mode. This effectively uses Full for location and Split Channels "
1638  "for rotation and scale"},
1640  "BEFORE_SPLIT",
1641  0,
1642  "Before Original (Split Channels)",
1643  "Apply copied transformation before original, handling location, rotation and scale "
1644  "separately, similar to a sequence of three Copy constraints"},
1647  "AFTER_FULL",
1648  0,
1649  "After Original (Full)",
1650  "Apply copied transformation after original, using simple matrix multiplication as if "
1651  "the constraint target is a child in Full Inherit Scale mode. "
1652  "Will create shear when combining rotation and non-uniform scale"},
1654  "AFTER",
1655  0,
1656  "After Original (Aligned)",
1657  "Apply copied transformation after original, as if the constraint target is a child in "
1658  "Aligned Inherit Scale mode. This effectively uses Full for location and Split Channels "
1659  "for rotation and scale"},
1661  "AFTER_SPLIT",
1662  0,
1663  "After Original (Split Channels)",
1664  "Apply copied transformation after original, handling location, rotation and scale "
1665  "separately, similar to a sequence of three Copy constraints"},
1666  {0, NULL, 0, NULL, NULL},
1667  };
1668 
1669  srna = RNA_def_struct(brna, "CopyTransformsConstraint", "Constraint");
1671  srna, "Copy Transforms Constraint", "Copy all the transforms of the target");
1672 
1674 
1675  RNA_def_struct_sdna_from(srna, "bTransLikeConstraint", "data");
1676 
1677  RNA_def_struct_ui_icon(srna, ICON_CON_TRANSLIKE);
1678 
1680 
1682 
1683  prop = RNA_def_property(srna, "remove_target_shear", PROP_BOOLEAN, PROP_NONE);
1686  prop, "Remove Target Shear", "Remove shear from the target transformation before combining");
1687  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1688 
1689  prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
1690  RNA_def_property_enum_sdna(prop, NULL, "mix_mode");
1691  RNA_def_property_enum_items(prop, mix_mode_items);
1693  prop, "Mix Mode", "Specify how the copied and existing transformations are combined");
1694  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1695 
1697 }
1698 
1700 {
1701  StructRNA *srna;
1702  PropertyRNA *prop;
1703 
1704  static const EnumPropertyItem minmax_items[] = {
1705  {TRACK_X, "FLOOR_X", 0, "X", ""},
1706  {TRACK_Y, "FLOOR_Y", 0, "Y", ""},
1707  {TRACK_Z, "FLOOR_Z", 0, "Z", ""},
1708  {TRACK_nX, "FLOOR_NEGATIVE_X", 0, "-X", ""},
1709  {TRACK_nY, "FLOOR_NEGATIVE_Y", 0, "-Y", ""},
1710  {TRACK_nZ, "FLOOR_NEGATIVE_Z", 0, "-Z", ""},
1711  {0, NULL, 0, NULL, NULL},
1712  };
1713 
1714  srna = RNA_def_struct(brna, "FloorConstraint", "Constraint");
1716  srna, "Floor Constraint", "Use the target object for location limitation");
1717  RNA_def_struct_sdna_from(srna, "bMinMaxConstraint", "data");
1718  RNA_def_struct_ui_icon(srna, ICON_CON_FLOOR);
1719 
1721 
1723 
1724  prop = RNA_def_property(srna, "floor_location", PROP_ENUM, PROP_NONE);
1725  RNA_def_property_enum_sdna(prop, NULL, "minmaxflag");
1726  RNA_def_property_enum_items(prop, minmax_items);
1728  prop, "Floor Location", "Location of target that object will not pass through");
1729  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1730 
1731  prop = RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE);
1733  RNA_def_property_ui_text(prop, "Use Rotation", "Use the target's rotation to determine floor");
1734  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1735 
1736  prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_DISTANCE);
1737  RNA_def_property_ui_range(prop, -100.0f, 100.0f, 1, -1);
1738  RNA_def_property_ui_text(prop, "Offset", "Offset of floor from object origin");
1739  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1740 
1742 }
1743 
1745 {
1746  StructRNA *srna;
1747  PropertyRNA *prop;
1748 
1749  static const EnumPropertyItem transform_channel_items[] = {
1750  {20, "LOCATION_X", 0, "X Location", ""},
1751  {21, "LOCATION_Y", 0, "Y Location", ""},
1752  {22, "LOCATION_Z", 0, "Z Location", ""},
1753  {00, "ROTATION_X", 0, "X Rotation", ""},
1754  {01, "ROTATION_Y", 0, "Y Rotation", ""},
1755  {02, "ROTATION_Z", 0, "Z Rotation", ""},
1756  {10, "SCALE_X", 0, "X Scale", ""},
1757  {11, "SCALE_Y", 0, "Y Scale", ""},
1758  {12, "SCALE_Z", 0, "Z Scale", ""},
1759  {0, NULL, 0, NULL, NULL},
1760  };
1761 
1762  static const EnumPropertyItem mix_mode_items[] = {
1764  "BEFORE_FULL",
1765  0,
1766  "Before Original (Full)",
1767  "Apply the action channels before the original transformation, as if applied to an "
1768  "imaginary parent in Full Inherit Scale mode. Will create shear when combining rotation "
1769  "and non-uniform scale"},
1771  "BEFORE",
1772  0,
1773  "Before Original (Aligned)",
1774  "Apply the action channels before the original transformation, as if applied to an "
1775  "imaginary parent in Aligned Inherit Scale mode. This effectively uses Full for location "
1776  "and Split Channels for rotation and scale"},
1778  "BEFORE_SPLIT",
1779  0,
1780  "Before Original (Split Channels)",
1781  "Apply the action channels before the original transformation, handling location, rotation "
1782  "and scale separately"},
1785  "AFTER_FULL",
1786  0,
1787  "After Original (Full)",
1788  "Apply the action channels after the original transformation, as if applied to an "
1789  "imaginary child in Full Inherit Scale mode. Will create shear when combining rotation "
1790  "and non-uniform scale"},
1792  "AFTER",
1793  0,
1794  "After Original (Aligned)",
1795  "Apply the action channels after the original transformation, as if applied to an "
1796  "imaginary child in Aligned Inherit Scale mode. This effectively uses Full for location "
1797  "and Split Channels for rotation and scale"},
1799  "AFTER_SPLIT",
1800  0,
1801  "After Original (Split Channels)",
1802  "Apply the action channels after the original transformation, handling location, rotation "
1803  "and scale separately"},
1804  {0, NULL, 0, NULL, NULL},
1805  };
1806 
1807  srna = RNA_def_struct(brna, "ActionConstraint", "Constraint");
1809  srna, "Action Constraint", "Map an action to the transform axes of a bone");
1810  RNA_def_struct_sdna_from(srna, "bActionConstraint", "data");
1811  RNA_def_struct_ui_icon(srna, ICON_ACTION);
1812 
1814 
1816 
1817  prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
1818  RNA_def_property_enum_sdna(prop, NULL, "mix_mode");
1819  RNA_def_property_enum_items(prop, mix_mode_items);
1820  RNA_def_property_enum_funcs(prop, NULL, "rna_ActionConstraint_mix_mode_set", NULL);
1822  prop,
1823  "Mix Mode",
1824  "Specify how existing transformations and the action channels are combined");
1825  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1826 
1827  prop = RNA_def_property(srna, "transform_channel", PROP_ENUM, PROP_NONE);
1828  RNA_def_property_enum_sdna(prop, NULL, "type");
1829  RNA_def_property_enum_items(prop, transform_channel_items);
1831  prop,
1832  "Transform Channel",
1833  "Transformation channel from the target that is used to key the Action");
1834  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1835 
1836  prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
1837  RNA_def_property_pointer_sdna(prop, NULL, "act");
1838  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Action_id_poll");
1839  RNA_def_property_ui_text(prop, "Action", "The constraining action");
1841  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1842 
1843  prop = RNA_def_property(srna, "use_bone_object_action", PROP_BOOLEAN, PROP_NONE);
1846  "Object Action",
1847  "Bones only: apply the object's transformation channels of the action "
1848  "to the constrained bone, instead of bone's channels");
1849  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1850 
1851  prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
1852  RNA_def_property_int_sdna(prop, NULL, "start");
1854  RNA_def_property_ui_text(prop, "Start Frame", "First frame of the Action to use");
1855  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1856 
1857  prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
1858  RNA_def_property_int_sdna(prop, NULL, "end");
1860  RNA_def_property_ui_text(prop, "End Frame", "Last frame of the Action to use");
1861  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1862 
1863  prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
1864  RNA_def_property_float_sdna(prop, NULL, "max");
1865  RNA_def_property_range(prop, -1000.0f, 1000.0f);
1866  RNA_def_property_ui_text(prop, "Maximum", "Maximum value for target channel range");
1867  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1868  RNA_def_property_float_funcs(prop, NULL, NULL, "rna_ActionConstraint_minmax_range");
1869 
1870  prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
1871  RNA_def_property_float_sdna(prop, NULL, "min");
1872  RNA_def_property_range(prop, -1000.0f, 1000.0f);
1873  RNA_def_property_ui_text(prop, "Minimum", "Minimum value for target channel range");
1874  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1875  RNA_def_property_float_funcs(prop, NULL, NULL, "rna_ActionConstraint_minmax_range");
1876 
1877  prop = RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_FACTOR);
1878  RNA_def_property_float_sdna(prop, NULL, "eval_time");
1879  RNA_def_property_range(prop, 0.0f, 1.0f);
1881  prop, "Evaluation Time", "Interpolates between Action Start and End frames");
1882  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1883 
1884  prop = RNA_def_property(srna, "use_eval_time", PROP_BOOLEAN, PROP_NONE);
1887  "Use Evaluation Time",
1888  "Interpolate between Action Start and End frames, with the Evaluation "
1889  "Time slider instead of the Target object/bone");
1890  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1891 
1893 }
1894 
1896 {
1897  StructRNA *srna;
1898  PropertyRNA *prop;
1899 
1900  static const EnumPropertyItem lock_items[] = {
1901  {TRACK_X, "LOCK_X", 0, "X", ""},
1902  {TRACK_Y, "LOCK_Y", 0, "Y", ""},
1903  {TRACK_Z, "LOCK_Z", 0, "Z", ""},
1904  {0, NULL, 0, NULL, NULL},
1905  };
1906 
1907  srna = RNA_def_struct(brna, "LockedTrackConstraint", "Constraint");
1909  srna,
1910  "Locked Track Constraint",
1911  "Point toward the target along the track axis, while locking the other axis");
1912  RNA_def_struct_ui_icon(srna, ICON_CON_LOCKTRACK);
1913 
1915 
1916  RNA_def_struct_sdna_from(srna, "bLockTrackConstraint", "data");
1917 
1919 
1921 
1922  prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
1923  RNA_def_property_enum_sdna(prop, NULL, "trackflag");
1925  RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object");
1926  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1927 
1928  prop = RNA_def_property(srna, "lock_axis", PROP_ENUM, PROP_NONE);
1929  RNA_def_property_enum_sdna(prop, NULL, "lockflag");
1930  RNA_def_property_enum_items(prop, lock_items);
1931  RNA_def_property_ui_text(prop, "Locked Axis", "Axis that points upward");
1932  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1933 
1935 }
1936 
1938 {
1939  StructRNA *srna;
1940  PropertyRNA *prop;
1941 
1942  static const EnumPropertyItem forwardpath_items[] = {
1943  {TRACK_X, "FORWARD_X", 0, "X", ""},
1944  {TRACK_Y, "FORWARD_Y", 0, "Y", ""},
1945  {TRACK_Z, "FORWARD_Z", 0, "Z", ""},
1946  {TRACK_nX, "TRACK_NEGATIVE_X", 0, "-X", ""},
1947  {TRACK_nY, "TRACK_NEGATIVE_Y", 0, "-Y", ""},
1948  {TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""},
1949  {0, NULL, 0, NULL, NULL},
1950  };
1951 
1952  static const EnumPropertyItem pathup_items[] = {
1953  {TRACK_X, "UP_X", 0, "X", ""},
1954  {TRACK_Y, "UP_Y", 0, "Y", ""},
1955  {TRACK_Z, "UP_Z", 0, "Z", ""},
1956  {0, NULL, 0, NULL, NULL},
1957  };
1958 
1959  srna = RNA_def_struct(brna, "FollowPathConstraint", "Constraint");
1960  RNA_def_struct_ui_text(srna, "Follow Path Constraint", "Lock motion to the target path");
1961  RNA_def_struct_sdna_from(srna, "bFollowPathConstraint", "data");
1962  RNA_def_struct_ui_icon(srna, ICON_CON_FOLLOWPATH);
1963 
1965 
1966  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
1967  RNA_def_property_pointer_sdna(prop, NULL, "tar");
1968  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll");
1969  RNA_def_property_ui_text(prop, "Target", "Target Curve object");
1971  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1972 
1973  prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TIME);
1976  prop, "Offset", "Offset from the position corresponding to the time frame");
1977  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1978 
1979  prop = RNA_def_property(srna, "offset_factor", PROP_FLOAT, PROP_FACTOR);
1980  RNA_def_property_float_sdna(prop, NULL, "offset_fac");
1981  RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
1982  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 3);
1984  prop, "Offset Factor", "Percentage value defining target position along length of curve");
1985  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1986 
1987  prop = RNA_def_property(srna, "forward_axis", PROP_ENUM, PROP_NONE);
1988  RNA_def_property_enum_sdna(prop, NULL, "trackflag");
1989  RNA_def_property_enum_items(prop, forwardpath_items);
1990  RNA_def_property_ui_text(prop, "Forward Axis", "Axis that points forward along the path");
1991  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1992 
1993  prop = RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
1994  RNA_def_property_enum_sdna(prop, NULL, "upflag");
1995  RNA_def_property_enum_items(prop, pathup_items);
1996  RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward");
1997  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1998 
1999  prop = RNA_def_property(srna, "use_curve_follow", PROP_BOOLEAN, PROP_NONE);
2002  prop, "Follow Curve", "Object will follow the heading and banking of the curve");
2003  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2004 
2005  prop = RNA_def_property(srna, "use_fixed_location", PROP_BOOLEAN, PROP_NONE);
2008  prop,
2009  "Fixed Position",
2010  "Object will stay locked to a single point somewhere along the length of the curve "
2011  "regardless of time");
2012  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2013 
2014  prop = RNA_def_property(srna, "use_curve_radius", PROP_BOOLEAN, PROP_NONE);
2016  RNA_def_property_ui_text(prop, "Curve Radius", "Object is scaled by the curve radius");
2017  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2018 
2020 }
2021 
2023 {
2024  StructRNA *srna;
2025  PropertyRNA *prop;
2026 
2027  static const EnumPropertyItem volume_items[] = {
2028  {VOLUME_XZ, "VOLUME_XZX", 0, "XZ", ""},
2029  {VOLUME_X, "VOLUME_X", 0, "X", ""},
2030  {VOLUME_Z, "VOLUME_Z", 0, "Z", ""},
2031  {NO_VOLUME, "NO_VOLUME", 0, "None", ""},
2032  {0, NULL, 0, NULL, NULL},
2033  };
2034 
2035  static const EnumPropertyItem plane_items[] = {
2036  {PLANE_X, "PLANE_X", 0, "XZ", "Rotate around local X, then Z"},
2037  {PLANE_Z, "PLANE_Z", 0, "ZX", "Rotate around local Z, then X"},
2038  {SWING_Y,
2039  "SWING_Y",
2040  0,
2041  "Swing",
2042  "Use the smallest single axis rotation, similar to Damped Track"},
2043  {0, NULL, 0, NULL, NULL},
2044  };
2045 
2046  srna = RNA_def_struct(brna, "StretchToConstraint", "Constraint");
2047  RNA_def_struct_ui_text(srna, "Stretch To Constraint", "Stretch to meet the target object");
2048  RNA_def_struct_ui_icon(srna, ICON_CON_STRETCHTO);
2049 
2051 
2052  RNA_def_struct_sdna_from(srna, "bStretchToConstraint", "data");
2053 
2055 
2057 
2058  prop = RNA_def_property(srna, "volume", PROP_ENUM, PROP_NONE);
2059  RNA_def_property_enum_sdna(prop, NULL, "volmode");
2060  RNA_def_property_enum_items(prop, volume_items);
2062  prop, "Maintain Volume", "Maintain the object's volume as it stretches");
2063  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2064 
2065  prop = RNA_def_property(srna, "keep_axis", PROP_ENUM, PROP_NONE);
2066  RNA_def_property_enum_sdna(prop, NULL, "plane");
2067  RNA_def_property_enum_items(prop, plane_items);
2068  RNA_def_property_ui_text(prop, "Keep Axis", "The rotation type and axis order to use");
2069  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2070 
2071  prop = RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_DISTANCE);
2072  RNA_def_property_float_sdna(prop, NULL, "orglength");
2073  RNA_def_property_range(prop, 0.0f, 1000.0f);
2075  RNA_def_property_ui_text(prop, "Original Length", "Length at rest position");
2076  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2077 
2078  prop = RNA_def_property(srna, "bulge", PROP_FLOAT, PROP_NONE);
2079  RNA_def_property_range(prop, 0.0, 100.0f);
2081  prop, "Volume Variation", "Factor between volume variation and stretching");
2082  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2083 
2084  prop = RNA_def_property(srna, "use_bulge_min", PROP_BOOLEAN, PROP_NONE);
2087  prop, "Use Volume Variation Minimum", "Use lower limit for volume variation");
2088  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2089 
2090  prop = RNA_def_property(srna, "use_bulge_max", PROP_BOOLEAN, PROP_NONE);
2093  prop, "Use Volume Variation Maximum", "Use upper limit for volume variation");
2094  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2095 
2096  prop = RNA_def_property(srna, "bulge_min", PROP_FLOAT, PROP_NONE);
2097  RNA_def_property_range(prop, 0.0, 1.0f);
2098  RNA_def_property_ui_text(prop, "Volume Variation Minimum", "Minimum volume stretching factor");
2099  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2100 
2101  prop = RNA_def_property(srna, "bulge_max", PROP_FLOAT, PROP_NONE);
2102  RNA_def_property_range(prop, 1.0, 100.0f);
2103  RNA_def_property_ui_text(prop, "Volume Variation Maximum", "Maximum volume stretching factor");
2104  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2105 
2106  prop = RNA_def_property(srna, "bulge_smooth", PROP_FLOAT, PROP_FACTOR);
2107  RNA_def_property_range(prop, 0.0, 1.0f);
2109  prop, "Volume Variation Smoothness", "Strength of volume stretching clamping");
2110  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2111 
2113 }
2114 
2116 {
2117  StructRNA *srna;
2118  PropertyRNA *prop;
2119 
2120  static const EnumPropertyItem clamp_items[] = {
2121  {CLAMPTO_AUTO, "CLAMPTO_AUTO", 0, "Auto", ""},
2122  {CLAMPTO_X, "CLAMPTO_X", 0, "X", ""},
2123  {CLAMPTO_Y, "CLAMPTO_Y", 0, "Y", ""},
2124  {CLAMPTO_Z, "CLAMPTO_Z", 0, "Z", ""},
2125  {0, NULL, 0, NULL, NULL},
2126  };
2127 
2128  srna = RNA_def_struct(brna, "ClampToConstraint", "Constraint");
2130  srna,
2131  "Clamp To Constraint",
2132  "Constrain an object's location to the nearest point along the target path");
2133  RNA_def_struct_sdna_from(srna, "bClampToConstraint", "data");
2134  RNA_def_struct_ui_icon(srna, ICON_CON_CLAMPTO);
2135 
2137 
2138  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
2139  RNA_def_property_pointer_sdna(prop, NULL, "tar");
2140  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll");
2141  RNA_def_property_ui_text(prop, "Target", "Target Object (Curves only)");
2143  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
2144 
2145  prop = RNA_def_property(srna, "main_axis", PROP_ENUM, PROP_NONE);
2146  RNA_def_property_enum_sdna(prop, NULL, "flag");
2147  RNA_def_property_enum_items(prop, clamp_items);
2148  RNA_def_property_ui_text(prop, "Main Axis", "Main axis of movement");
2149  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2150 
2151  prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
2154  prop, "Cyclic", "Treat curve as cyclic curve (no clamping to curve bounding box)");
2155  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2156 
2158 }
2159 
2161 {
2162  StructRNA *srna;
2163  PropertyRNA *prop;
2164 
2165  static const EnumPropertyItem transform_items[] = {
2166  {TRANS_LOCATION, "LOCATION", 0, "Location", ""},
2167  {TRANS_ROTATION, "ROTATION", 0, "Rotation", ""},
2168  {TRANS_SCALE, "SCALE", 0, "Scale", ""},
2169  {0, NULL, 0, NULL, NULL},
2170  };
2171 
2172  static const EnumPropertyItem mix_mode_loc_items[] = {
2173  {TRANS_MIXLOC_REPLACE, "REPLACE", 0, "Replace", "Replace component values"},
2174  {TRANS_MIXLOC_ADD, "ADD", 0, "Add", "Add component values together"},
2175  {0, NULL, 0, NULL, NULL},
2176  };
2177 
2178  static const EnumPropertyItem mix_mode_rot_items[] = {
2179  {TRANS_MIXROT_REPLACE, "REPLACE", 0, "Replace", "Replace component values"},
2180  {TRANS_MIXROT_ADD, "ADD", 0, "Add", "Add component values together"},
2182  "BEFORE",
2183  0,
2184  "Before Original",
2185  "Apply new rotation before original, as if it was on a parent"},
2187  "AFTER",
2188  0,
2189  "After Original",
2190  "Apply new rotation after original, as if it was on a child"},
2191  {0, NULL, 0, NULL, NULL},
2192  };
2193 
2194  static const EnumPropertyItem mix_mode_scale_items[] = {
2195  {TRANS_MIXSCALE_REPLACE, "REPLACE", 0, "Replace", "Replace component values"},
2196  {TRANS_MIXSCALE_MULTIPLY, "MULTIPLY", 0, "Multiply", "Multiply component values together"},
2197  {0, NULL, 0, NULL, NULL},
2198  };
2199 
2200  srna = RNA_def_struct(brna, "TransformConstraint", "Constraint");
2202  srna, "Transformation Constraint", "Map transformations of the target to the object");
2203  RNA_def_struct_sdna_from(srna, "bTransformConstraint", "data");
2204  RNA_def_struct_ui_icon(srna, ICON_CON_TRANSFORM);
2205 
2207 
2209 
2210  prop = RNA_def_property(srna, "map_from", PROP_ENUM, PROP_NONE);
2211  RNA_def_property_enum_sdna(prop, NULL, "from");
2212  RNA_def_property_enum_items(prop, transform_items);
2213  RNA_def_property_ui_text(prop, "Map From", "The transformation type to use from the target");
2214  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2215 
2216  prop = RNA_def_property(srna, "map_to", PROP_ENUM, PROP_NONE);
2217  RNA_def_property_enum_sdna(prop, NULL, "to");
2218  RNA_def_property_enum_items(prop, transform_items);
2220  prop, "Map To", "The transformation type to affect of the constrained object");
2221  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2222 
2223  prop = RNA_def_property(srna, "map_to_x_from", PROP_ENUM, PROP_NONE);
2224  RNA_def_property_enum_sdna(prop, NULL, "map[0]");
2227  prop, "Map To X From", "The source axis constrained object's X axis uses");
2228  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2229 
2230  prop = RNA_def_property(srna, "map_to_y_from", PROP_ENUM, PROP_NONE);
2231  RNA_def_property_enum_sdna(prop, NULL, "map[1]");
2234  prop, "Map To Y From", "The source axis constrained object's Y axis uses");
2235  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2236 
2237  prop = RNA_def_property(srna, "map_to_z_from", PROP_ENUM, PROP_NONE);
2238  RNA_def_property_enum_sdna(prop, NULL, "map[2]");
2241  prop, "Map To Z From", "The source axis constrained object's Z axis uses");
2242  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2243 
2244  prop = RNA_def_property(srna, "use_motion_extrapolate", PROP_BOOLEAN, PROP_NONE);
2246  RNA_def_property_ui_text(prop, "Extrapolate Motion", "Extrapolate ranges");
2247  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2248 
2249  prop = RNA_def_property(srna, "from_rotation_mode", PROP_ENUM, PROP_NONE);
2250  RNA_def_property_enum_sdna(prop, NULL, "from_rotation_mode");
2252  RNA_def_property_ui_text(prop, "From Mode", "Specify the type of rotation channels to use");
2253  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2254 
2255  prop = RNA_def_property(srna, "to_euler_order", PROP_ENUM, PROP_NONE);
2256  RNA_def_property_enum_sdna(prop, NULL, "to_euler_order");
2258  RNA_def_property_ui_text(prop, "To Order", "Explicitly specify the output euler rotation order");
2259  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2260 
2261  /* Loc */
2262  prop = RNA_def_property(srna, "from_min_x", PROP_FLOAT, PROP_DISTANCE);
2263  RNA_def_property_float_sdna(prop, NULL, "from_min[0]");
2264  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2265  RNA_def_property_ui_text(prop, "From Minimum X", "Bottom range of X axis source motion");
2266  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2267 
2268  prop = RNA_def_property(srna, "from_min_y", PROP_FLOAT, PROP_DISTANCE);
2269  RNA_def_property_float_sdna(prop, NULL, "from_min[1]");
2270  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2271  RNA_def_property_ui_text(prop, "From Minimum Y", "Bottom range of Y axis source motion");
2272  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2273 
2274  prop = RNA_def_property(srna, "from_min_z", PROP_FLOAT, PROP_DISTANCE);
2275  RNA_def_property_float_sdna(prop, NULL, "from_min[2]");
2276  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2277  RNA_def_property_ui_text(prop, "From Minimum Z", "Bottom range of Z axis source motion");
2278  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2279 
2280  prop = RNA_def_property(srna, "from_max_x", PROP_FLOAT, PROP_DISTANCE);
2281  RNA_def_property_float_sdna(prop, NULL, "from_max[0]");
2282  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2283  RNA_def_property_ui_text(prop, "From Maximum X", "Top range of X axis source motion");
2284  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2285 
2286  prop = RNA_def_property(srna, "from_max_y", PROP_FLOAT, PROP_DISTANCE);
2287  RNA_def_property_float_sdna(prop, NULL, "from_max[1]");
2288  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2289  RNA_def_property_ui_text(prop, "From Maximum Y", "Top range of Y axis source motion");
2290  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2291 
2292  prop = RNA_def_property(srna, "from_max_z", PROP_FLOAT, PROP_DISTANCE);
2293  RNA_def_property_float_sdna(prop, NULL, "from_max[2]");
2294  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2295  RNA_def_property_ui_text(prop, "From Maximum Z", "Top range of Z axis source motion");
2296  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2297 
2298  prop = RNA_def_property(srna, "to_min_x", PROP_FLOAT, PROP_DISTANCE);
2299  RNA_def_property_float_sdna(prop, NULL, "to_min[0]");
2300  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2301  RNA_def_property_ui_text(prop, "To Minimum X", "Bottom range of X axis destination motion");
2302  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2303 
2304  prop = RNA_def_property(srna, "to_min_y", PROP_FLOAT, PROP_DISTANCE);
2305  RNA_def_property_float_sdna(prop, NULL, "to_min[1]");
2306  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2307  RNA_def_property_ui_text(prop, "To Minimum Y", "Bottom range of Y axis destination motion");
2308  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2309 
2310  prop = RNA_def_property(srna, "to_min_z", PROP_FLOAT, PROP_DISTANCE);
2311  RNA_def_property_float_sdna(prop, NULL, "to_min[2]");
2312  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2313  RNA_def_property_ui_text(prop, "To Minimum Z", "Bottom range of Z axis destination motion");
2314  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2315 
2316  prop = RNA_def_property(srna, "to_max_x", PROP_FLOAT, PROP_DISTANCE);
2317  RNA_def_property_float_sdna(prop, NULL, "to_max[0]");
2318  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2319  RNA_def_property_ui_text(prop, "To Maximum X", "Top range of X axis destination motion");
2320  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2321 
2322  prop = RNA_def_property(srna, "to_max_y", PROP_FLOAT, PROP_DISTANCE);
2323  RNA_def_property_float_sdna(prop, NULL, "to_max[1]");
2324  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2325  RNA_def_property_ui_text(prop, "To Maximum Y", "Top range of Y axis destination motion");
2326  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2327 
2328  prop = RNA_def_property(srna, "to_max_z", PROP_FLOAT, PROP_DISTANCE);
2329  RNA_def_property_float_sdna(prop, NULL, "to_max[2]");
2330  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2331  RNA_def_property_ui_text(prop, "To Maximum Z", "Top range of Z axis destination motion");
2332  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2333 
2334  prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
2335  RNA_def_property_enum_sdna(prop, NULL, "mix_mode_loc");
2336  RNA_def_property_enum_items(prop, mix_mode_loc_items);
2338  prop, "Location Mix Mode", "Specify how to combine the new location with original");
2339  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2340 
2341  /* Rot */
2342  prop = RNA_def_property(srna, "from_min_x_rot", PROP_FLOAT, PROP_ANGLE);
2343  RNA_def_property_float_sdna(prop, NULL, "from_min_rot[0]");
2344  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2345  RNA_def_property_ui_text(prop, "From Minimum X", "Bottom range of X axis source motion");
2346  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2347 
2348  prop = RNA_def_property(srna, "from_min_y_rot", PROP_FLOAT, PROP_ANGLE);
2349  RNA_def_property_float_sdna(prop, NULL, "from_min_rot[1]");
2350  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2351  RNA_def_property_ui_text(prop, "From Minimum Y", "Bottom range of Y axis source motion");
2352  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2353 
2354  prop = RNA_def_property(srna, "from_min_z_rot", PROP_FLOAT, PROP_ANGLE);
2355  RNA_def_property_float_sdna(prop, NULL, "from_min_rot[2]");
2356  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2357  RNA_def_property_ui_text(prop, "From Minimum Z", "Bottom range of Z axis source motion");
2358  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2359 
2360  prop = RNA_def_property(srna, "from_max_x_rot", PROP_FLOAT, PROP_ANGLE);
2361  RNA_def_property_float_sdna(prop, NULL, "from_max_rot[0]");
2362  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2363  RNA_def_property_ui_text(prop, "From Maximum X", "Top range of X axis source motion");
2364  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2365 
2366  prop = RNA_def_property(srna, "from_max_y_rot", PROP_FLOAT, PROP_ANGLE);
2367  RNA_def_property_float_sdna(prop, NULL, "from_max_rot[1]");
2368  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2369  RNA_def_property_ui_text(prop, "From Maximum Y", "Top range of Y axis source motion");
2370  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2371 
2372  prop = RNA_def_property(srna, "from_max_z_rot", PROP_FLOAT, PROP_ANGLE);
2373  RNA_def_property_float_sdna(prop, NULL, "from_max_rot[2]");
2374  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2375  RNA_def_property_ui_text(prop, "From Maximum Z", "Top range of Z axis source motion");
2376  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2377 
2378  prop = RNA_def_property(srna, "to_min_x_rot", PROP_FLOAT, PROP_ANGLE);
2379  RNA_def_property_float_sdna(prop, NULL, "to_min_rot[0]");
2380  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2381  RNA_def_property_ui_text(prop, "To Minimum X", "Bottom range of X axis destination motion");
2382  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2383 
2384  prop = RNA_def_property(srna, "to_min_y_rot", PROP_FLOAT, PROP_ANGLE);
2385  RNA_def_property_float_sdna(prop, NULL, "to_min_rot[1]");
2386  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2387  RNA_def_property_ui_text(prop, "To Minimum Y", "Bottom range of Y axis destination motion");
2388  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2389 
2390  prop = RNA_def_property(srna, "to_min_z_rot", PROP_FLOAT, PROP_ANGLE);
2391  RNA_def_property_float_sdna(prop, NULL, "to_min_rot[2]");
2392  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2393  RNA_def_property_ui_text(prop, "To Minimum Z", "Bottom range of Z axis destination motion");
2394  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2395 
2396  prop = RNA_def_property(srna, "to_max_x_rot", PROP_FLOAT, PROP_ANGLE);
2397  RNA_def_property_float_sdna(prop, NULL, "to_max_rot[0]");
2398  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2399  RNA_def_property_ui_text(prop, "To Maximum X", "Top range of X axis destination motion");
2400  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2401 
2402  prop = RNA_def_property(srna, "to_max_y_rot", PROP_FLOAT, PROP_ANGLE);
2403  RNA_def_property_float_sdna(prop, NULL, "to_max_rot[1]");
2404  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2405  RNA_def_property_ui_text(prop, "To Maximum Y", "Top range of Y axis destination motion");
2406  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2407 
2408  prop = RNA_def_property(srna, "to_max_z_rot", PROP_FLOAT, PROP_ANGLE);
2409  RNA_def_property_float_sdna(prop, NULL, "to_max_rot[2]");
2410  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2411  RNA_def_property_ui_text(prop, "To Maximum Z", "Top range of Z axis destination motion");
2412  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2413 
2414  prop = RNA_def_property(srna, "mix_mode_rot", PROP_ENUM, PROP_NONE);
2415  RNA_def_property_enum_sdna(prop, NULL, "mix_mode_rot");
2416  RNA_def_property_enum_items(prop, mix_mode_rot_items);
2418  prop, "Rotation Mix Mode", "Specify how to combine the new rotation with original");
2419  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2420 
2421  /* Scale */
2422  prop = RNA_def_property(srna, "from_min_x_scale", PROP_FLOAT, PROP_NONE);
2423  RNA_def_property_float_sdna(prop, NULL, "from_min_scale[0]");
2424  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2425  RNA_def_property_ui_text(prop, "From Minimum X", "Bottom range of X axis source motion");
2426  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2427 
2428  prop = RNA_def_property(srna, "from_min_y_scale", PROP_FLOAT, PROP_NONE);
2429  RNA_def_property_float_sdna(prop, NULL, "from_min_scale[1]");
2430  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2431  RNA_def_property_ui_text(prop, "From Minimum Y", "Bottom range of Y axis source motion");
2432  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2433 
2434  prop = RNA_def_property(srna, "from_min_z_scale", PROP_FLOAT, PROP_NONE);
2435  RNA_def_property_float_sdna(prop, NULL, "from_min_scale[2]");
2436  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2437  RNA_def_property_ui_text(prop, "From Minimum Z", "Bottom range of Z axis source motion");
2438  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2439 
2440  prop = RNA_def_property(srna, "from_max_x_scale", PROP_FLOAT, PROP_NONE);
2441  RNA_def_property_float_sdna(prop, NULL, "from_max_scale[0]");
2442  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2443  RNA_def_property_ui_text(prop, "From Maximum X", "Top range of X axis source motion");
2444  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2445 
2446  prop = RNA_def_property(srna, "from_max_y_scale", PROP_FLOAT, PROP_NONE);
2447  RNA_def_property_float_sdna(prop, NULL, "from_max_scale[1]");
2448  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2449  RNA_def_property_ui_text(prop, "From Maximum Y", "Top range of Y axis source motion");
2450  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2451 
2452  prop = RNA_def_property(srna, "from_max_z_scale", PROP_FLOAT, PROP_NONE);
2453  RNA_def_property_float_sdna(prop, NULL, "from_max_scale[2]");
2454  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2455  RNA_def_property_ui_text(prop, "From Maximum Z", "Top range of Z axis source motion");
2456  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2457 
2458  prop = RNA_def_property(srna, "to_min_x_scale", PROP_FLOAT, PROP_NONE);
2459  RNA_def_property_float_sdna(prop, NULL, "to_min_scale[0]");
2460  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2461  RNA_def_property_ui_text(prop, "To Minimum X", "Bottom range of X axis destination motion");
2462  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2463 
2464  prop = RNA_def_property(srna, "to_min_y_scale", PROP_FLOAT, PROP_NONE);
2465  RNA_def_property_float_sdna(prop, NULL, "to_min_scale[1]");
2466  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2467  RNA_def_property_ui_text(prop, "To Minimum Y", "Bottom range of Y axis destination motion");
2468  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2469 
2470  prop = RNA_def_property(srna, "to_min_z_scale", PROP_FLOAT, PROP_NONE);
2471  RNA_def_property_float_sdna(prop, NULL, "to_min_scale[2]");
2472  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2473  RNA_def_property_ui_text(prop, "To Minimum Z", "Bottom range of Z axis destination motion");
2474  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2475 
2476  prop = RNA_def_property(srna, "to_max_x_scale", PROP_FLOAT, PROP_NONE);
2477  RNA_def_property_float_sdna(prop, NULL, "to_max_scale[0]");
2478  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2479  RNA_def_property_ui_text(prop, "To Maximum X", "Top range of X axis destination motion");
2480  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2481 
2482  prop = RNA_def_property(srna, "to_max_y_scale", PROP_FLOAT, PROP_NONE);
2483  RNA_def_property_float_sdna(prop, NULL, "to_max_scale[1]");
2484  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2485  RNA_def_property_ui_text(prop, "To Maximum Y", "Top range of Y axis destination motion");
2486  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2487 
2488  prop = RNA_def_property(srna, "to_max_z_scale", PROP_FLOAT, PROP_NONE);
2489  RNA_def_property_float_sdna(prop, NULL, "to_max_scale[2]");
2490  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2491  RNA_def_property_ui_text(prop, "To Maximum Z", "Top range of Z axis destination motion");
2492  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2493 
2494  prop = RNA_def_property(srna, "mix_mode_scale", PROP_ENUM, PROP_NONE);
2495  RNA_def_property_enum_sdna(prop, NULL, "mix_mode_scale");
2496  RNA_def_property_enum_items(prop, mix_mode_scale_items);
2498  prop, "Scale Mix Mode", "Specify how to combine the new scale with original");
2499  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2500 
2502 }
2503 
2505 {
2506  StructRNA *srna;
2507  PropertyRNA *prop;
2508 
2509  srna = RNA_def_struct(brna, "LimitLocationConstraint", "Constraint");
2511  srna, "Limit Location Constraint", "Limit the location of the constrained object");
2512  RNA_def_struct_sdna_from(srna, "bLocLimitConstraint", "data");
2513  RNA_def_struct_ui_icon(srna, ICON_CON_LOCLIMIT);
2514 
2516 
2517  prop = RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE);
2519  RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value");
2520  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2521 
2522  prop = RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE);
2524  RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value");
2525  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2526 
2527  prop = RNA_def_property(srna, "use_min_z", PROP_BOOLEAN, PROP_NONE);
2529  RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value");
2530  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2531 
2532  prop = RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE);
2534  RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value");
2535  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2536 
2537  prop = RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE);
2539  RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value");
2540  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2541 
2542  prop = RNA_def_property(srna, "use_max_z", PROP_BOOLEAN, PROP_NONE);
2544  RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value");
2545  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2546 
2547  prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_DISTANCE);
2548  RNA_def_property_float_sdna(prop, NULL, "xmin");
2549  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2550  RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
2551  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2552 
2553  prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_DISTANCE);
2554  RNA_def_property_float_sdna(prop, NULL, "ymin");
2555  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2556  RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
2557  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2558 
2559  prop = RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_DISTANCE);
2560  RNA_def_property_float_sdna(prop, NULL, "zmin");
2561  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2562  RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow");
2563  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2564 
2565  prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_DISTANCE);
2566  RNA_def_property_float_sdna(prop, NULL, "xmax");
2567  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2568  RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
2569  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2570 
2571  prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_DISTANCE);
2572  RNA_def_property_float_sdna(prop, NULL, "ymax");
2573  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2574  RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
2575  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2576 
2577  prop = RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_DISTANCE);
2578  RNA_def_property_float_sdna(prop, NULL, "zmax");
2579  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2580  RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow");
2581  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2582 
2583  prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
2586  prop, "Affect Transform", "Transform tools are affected by this constraint as well");
2587  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2588 
2590 }
2591 
2593 {
2594  StructRNA *srna;
2595  PropertyRNA *prop;
2596 
2597  srna = RNA_def_struct(brna, "LimitRotationConstraint", "Constraint");
2599  srna, "Limit Rotation Constraint", "Limit the rotation of the constrained object");
2600  RNA_def_struct_sdna_from(srna, "bRotLimitConstraint", "data");
2601  RNA_def_struct_ui_icon(srna, ICON_CON_ROTLIMIT);
2602 
2604 
2605  prop = RNA_def_property(srna, "use_limit_x", PROP_BOOLEAN, PROP_NONE);
2607  RNA_def_property_ui_text(prop, "Limit X", "Use the minimum X value");
2608  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2609 
2610  prop = RNA_def_property(srna, "use_limit_y", PROP_BOOLEAN, PROP_NONE);
2612  RNA_def_property_ui_text(prop, "Limit Y", "Use the minimum Y value");
2613  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2614 
2615  prop = RNA_def_property(srna, "use_limit_z", PROP_BOOLEAN, PROP_NONE);
2617  RNA_def_property_ui_text(prop, "Limit Z", "Use the minimum Z value");
2618  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2619 
2620  prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_ANGLE);
2621  RNA_def_property_float_sdna(prop, NULL, "xmin");
2622  RNA_def_property_range(prop, -1000.0, 1000.0f);
2623  RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
2624  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2625 
2626  prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_ANGLE);
2627  RNA_def_property_float_sdna(prop, NULL, "ymin");
2628  RNA_def_property_range(prop, -1000.0, 1000.0f);
2629  RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
2630  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2631 
2632  prop = RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_ANGLE);
2633  RNA_def_property_float_sdna(prop, NULL, "zmin");
2634  RNA_def_property_range(prop, -1000.0, 1000.0f);
2635  RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow");
2636  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2637 
2638  prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_ANGLE);
2639  RNA_def_property_float_sdna(prop, NULL, "xmax");
2640  RNA_def_property_range(prop, -1000.0, 1000.0f);
2641  RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
2642  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2643 
2644  prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_ANGLE);
2645  RNA_def_property_float_sdna(prop, NULL, "ymax");
2646  RNA_def_property_range(prop, -1000.0, 1000.0f);
2647  RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
2648  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2649 
2650  prop = RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_ANGLE);
2651  RNA_def_property_float_sdna(prop, NULL, "zmax");
2652  RNA_def_property_range(prop, -1000.0, 1000.0f);
2653  RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow");
2654  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2655 
2656  prop = RNA_def_property(srna, "euler_order", PROP_ENUM, PROP_NONE);
2657  RNA_def_property_enum_sdna(prop, NULL, "euler_order");
2659  RNA_def_property_ui_text(prop, "Euler Order", "Explicitly specify the euler rotation order");
2660  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2661 
2662  prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
2665  prop, "Affect Transform", "Transform tools are affected by this constraint as well");
2666  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2667 
2669 }
2670 
2672 {
2673  StructRNA *srna;
2674  PropertyRNA *prop;
2675 
2676  srna = RNA_def_struct(brna, "LimitScaleConstraint", "Constraint");
2678  srna, "Limit Size Constraint", "Limit the scaling of the constrained object");
2679  RNA_def_struct_sdna_from(srna, "bSizeLimitConstraint", "data");
2680  RNA_def_struct_ui_icon(srna, ICON_CON_SIZELIMIT);
2681 
2683 
2684  prop = RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE);
2686  RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value");
2687  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2688 
2689  prop = RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE);
2691  RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value");
2692  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2693 
2694  prop = RNA_def_property(srna, "use_min_z", PROP_BOOLEAN, PROP_NONE);
2696  RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value");
2697  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2698 
2699  prop = RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE);
2701  RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value");
2702  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2703 
2704  prop = RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE);
2706  RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value");
2707  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2708 
2709  prop = RNA_def_property(srna, "use_max_z", PROP_BOOLEAN, PROP_NONE);
2711  RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value");
2712  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2713 
2714  prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_NONE);
2715  RNA_def_property_float_sdna(prop, NULL, "xmin");
2716  RNA_def_property_range(prop, -1000.0, 1000.0f);
2717  RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
2718  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2719 
2720  prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_NONE);
2721  RNA_def_property_float_sdna(prop, NULL, "ymin");
2722  RNA_def_property_range(prop, -1000.0, 1000.0f);
2723  RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
2724  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2725 
2726  prop = RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_NONE);
2727  RNA_def_property_float_sdna(prop, NULL, "zmin");
2728  RNA_def_property_range(prop, -1000.0, 1000.0f);
2729  RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow");
2730  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2731 
2732  prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_NONE);
2733  RNA_def_property_float_sdna(prop, NULL, "xmax");
2734  RNA_def_property_range(prop, -1000.0, 1000.0f);
2735  RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
2736  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2737 
2738  prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_NONE);
2739  RNA_def_property_float_sdna(prop, NULL, "ymax");
2740  RNA_def_property_range(prop, -1000.0, 1000.0f);
2741  RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
2742  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2743 
2744  prop = RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_NONE);
2745  RNA_def_property_float_sdna(prop, NULL, "zmax");
2746  RNA_def_property_range(prop, -1000.0, 1000.0f);
2747  RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow");
2748  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2749 
2750  prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
2753  prop, "Affect Transform", "Transform tools are affected by this constraint as well");
2754  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2755 
2757 }
2758 
2760 {
2761  StructRNA *srna;
2762  PropertyRNA *prop;
2763 
2764  srna = RNA_def_struct(brna, "LimitDistanceConstraint", "Constraint");
2766  srna, "Limit Distance Constraint", "Limit the distance from target object");
2767 
2769 
2770  RNA_def_struct_sdna_from(srna, "bDistLimitConstraint", "data");
2771  RNA_def_struct_ui_icon(srna, ICON_CON_DISTLIMIT);
2772 
2774 
2776 
2777  prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
2778  RNA_def_property_float_sdna(prop, NULL, "dist");
2779  RNA_def_property_ui_range(prop, 0.0f, 100.0f, 10, 3);
2780  RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere");
2781  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2782 
2783  prop = RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE);
2784  RNA_def_property_enum_sdna(prop, NULL, "mode");
2787  prop, "Limit Mode", "Distances in relation to sphere of influence to allow");
2788  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2789 
2790  prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
2793  prop, "Affect Transform", "Transforms are affected by this constraint as well");
2794  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2795 
2797 }
2798 
2800 {
2801  StructRNA *srna;
2802  PropertyRNA *prop;
2803 
2804  static const EnumPropertyItem type_items[] = {
2806  "NEAREST_SURFACE",
2807  0,
2808  "Nearest Surface Point",
2809  "Shrink the location to the nearest target surface"},
2811  "PROJECT",
2812  0,
2813  "Project",
2814  "Shrink the location to the nearest target surface along a given axis"},
2816  "NEAREST_VERTEX",
2817  0,
2818  "Nearest Vertex",
2819  "Shrink the location to the nearest target vertex"},
2821  "TARGET_PROJECT",
2822  0,
2823  "Target Normal Project",
2824  "Shrink the location to the nearest target surface "
2825  "along the interpolated vertex normals of the target"},
2826  {0, NULL, 0, NULL, NULL},
2827  };
2828 
2829  static const EnumPropertyItem shrink_face_cull_items[] = {
2830  {0, "OFF", 0, "Off", "No culling"},
2832  "FRONT",
2833  0,
2834  "Front",
2835  "No projection when in front of the face"},
2837  "BACK",
2838  0,
2839  "Back",
2840  "No projection when behind the face"},
2841  {0, NULL, 0, NULL, NULL},
2842  };
2843 
2844  srna = RNA_def_struct(brna, "ShrinkwrapConstraint", "Constraint");
2846  srna, "Shrinkwrap Constraint", "Create constraint-based shrinkwrap relationship");
2847  RNA_def_struct_sdna_from(srna, "bShrinkwrapConstraint", "data");
2848  RNA_def_struct_ui_icon(srna, ICON_CON_SHRINKWRAP);
2849 
2851 
2852  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
2853  RNA_def_property_pointer_sdna(prop, NULL, "target"); /* TODO: mesh type. */
2854  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Mesh_object_poll");
2855  RNA_def_property_ui_text(prop, "Target", "Target Mesh object");
2857  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
2858 
2859  prop = RNA_def_property(srna, "shrinkwrap_type", PROP_ENUM, PROP_NONE);
2860  RNA_def_property_enum_sdna(prop, NULL, "shrinkType");
2861  RNA_def_property_enum_items(prop, type_items);
2863  prop, "Shrinkwrap Type", "Select type of shrinkwrap algorithm for target position");
2864  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
2865 
2866  prop = RNA_def_property(srna, "wrap_mode", PROP_ENUM, PROP_NONE);
2867  RNA_def_property_enum_sdna(prop, NULL, "shrinkMode");
2870  prop, "Snap Mode", "Select how to constrain the object to the target surface");
2871  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
2872 
2873  prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
2874  RNA_def_property_float_sdna(prop, NULL, "dist");
2875  RNA_def_property_range(prop, 0.0f, FLT_MAX);
2876  RNA_def_property_ui_range(prop, 0.0f, 100.0f, 10, 3);
2877  RNA_def_property_ui_text(prop, "Distance", "Distance to Target");
2878  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2879 
2880  prop = RNA_def_property(srna, "project_axis", PROP_ENUM, PROP_NONE);
2881  RNA_def_property_enum_sdna(prop, NULL, "projAxis");
2883  RNA_def_property_ui_text(prop, "Project Axis", "Axis constrain to");
2884  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2885 
2886  prop = RNA_def_property(srna, "project_axis_space", PROP_ENUM, PROP_NONE);
2887  RNA_def_property_enum_sdna(prop, NULL, "projAxisSpace");
2889  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_owner_space_itemf");
2890  RNA_def_property_ui_text(prop, "Axis Space", "Space for the projection axis");
2891 
2892  prop = RNA_def_property(srna, "project_limit", PROP_FLOAT, PROP_DISTANCE);
2893  RNA_def_property_float_sdna(prop, NULL, "projLimit");
2894  RNA_def_property_range(prop, 0.0f, FLT_MAX);
2895  RNA_def_property_ui_range(prop, 0.0f, 100.0f, 10, 3);
2897  prop, "Project Distance", "Limit the distance used for projection (zero disables)");
2898  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2899 
2900  prop = RNA_def_property(srna, "use_project_opposite", PROP_BOOLEAN, PROP_NONE);
2903  prop, "Project Opposite", "Project in both specified and opposite directions");
2904  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2905 
2906  prop = RNA_def_property(srna, "cull_face", PROP_ENUM, PROP_NONE);
2907  RNA_def_property_enum_sdna(prop, NULL, "flag");
2908  RNA_def_property_enum_items(prop, shrink_face_cull_items);
2910  "rna_ShrinkwrapConstraint_face_cull_get",
2911  "rna_ShrinkwrapConstraint_face_cull_set",
2912  NULL);
2914  prop,
2915  "Face Cull",
2916  "Stop vertices from projecting to a face on the target when facing towards/away");
2917  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2918 
2919  prop = RNA_def_property(srna, "use_invert_cull", PROP_BOOLEAN, PROP_NONE);
2922  prop, "Invert Cull", "When projecting in the opposite direction invert the face cull mode");
2923  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2924 
2925  prop = RNA_def_property(srna, "use_track_normal", PROP_BOOLEAN, PROP_NONE);
2928  prop, "Align Axis To Normal", "Align the specified axis to the surface normal");
2929  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
2930 
2931  prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
2932  RNA_def_property_enum_sdna(prop, NULL, "trackAxis");
2934  RNA_def_property_ui_text(prop, "Track Axis", "Axis that is aligned to the normal");
2935  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2936 
2938 }
2939 
2941 {
2942  StructRNA *srna;
2943  PropertyRNA *prop;
2944 
2945  srna = RNA_def_struct(brna, "DampedTrackConstraint", "Constraint");
2947  srna, "Damped Track Constraint", "Point toward target by taking the shortest rotation path");
2948  RNA_def_struct_ui_icon(srna, ICON_CON_TRACKTO);
2949 
2951 
2952  RNA_def_struct_sdna_from(srna, "bDampTrackConstraint", "data");
2953 
2955 
2957 
2958  prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
2959  RNA_def_property_enum_sdna(prop, NULL, "trackflag");
2961  RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object");
2962  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2963 
2965 }
2966 
2968 {
2969  StructRNA *srna;
2970  PropertyRNA *prop;
2971 
2972  static const EnumPropertyItem splineik_xz_scale_mode[] = {
2973  {CONSTRAINT_SPLINEIK_XZS_NONE, "NONE", 0, "None", "Don't scale the X and Z axes"},
2975  "BONE_ORIGINAL",
2976  0,
2977  "Bone Original",
2978  "Use the original scaling of the bones"},
2980  "INVERSE_PRESERVE",
2981  0,
2982  "Inverse Scale",
2983  "Scale of the X and Z axes is the inverse of the Y-Scale"},
2985  "VOLUME_PRESERVE",
2986  0,
2987  "Volume Preservation",
2988  "Scale of the X and Z axes are adjusted to preserve the volume of the bones"},
2989  {0, NULL, 0, NULL, NULL},
2990  };
2991 
2992  static const EnumPropertyItem splineik_y_scale_mode[] = {
2993  {CONSTRAINT_SPLINEIK_YS_NONE, "NONE", 0, "None", "Don't scale in the Y axis"},
2995  "FIT_CURVE",
2996  0,
2997  "Fit Curve",
2998  "Scale the bones to fit the entire length of the curve"},
3000  "BONE_ORIGINAL",
3001  0,
3002  "Bone Original",
3003  "Use the original Y scale of the bone"},
3004  {0, NULL, 0, NULL, NULL},
3005  };
3006 
3007  srna = RNA_def_struct(brna, "SplineIKConstraint", "Constraint");
3008  RNA_def_struct_ui_text(srna, "Spline IK Constraint", "Align 'n' bones along a curve");
3009  RNA_def_struct_sdna_from(srna, "bSplineIKConstraint", "data");
3010  RNA_def_struct_ui_icon(srna, ICON_CON_SPLINEIK);
3011 
3013 
3014  /* target chain */
3015  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
3016  RNA_def_property_pointer_sdna(prop, NULL, "tar");
3017  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll");
3018  RNA_def_property_ui_text(prop, "Target", "Curve that controls this relationship");
3020  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3021 
3022  prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE);
3023  RNA_def_property_int_sdna(prop, NULL, "chainlen");
3024  /* Changing the IK chain length requires a rebuild of depsgraph relations. This makes it
3025  * unsuitable for animation. */
3027  /* TODO: this should really check the max length of the chain the constraint is attached to */
3028  RNA_def_property_range(prop, 1, 255);
3029  RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the chain");
3030  /* XXX: this update goes wrong... needs extra flush? */
3031  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3032 
3033  /* direct access to bindings */
3034  /* NOTE: only to be used by experienced users */
3035  prop = RNA_def_property(srna, "joint_bindings", PROP_FLOAT, PROP_FACTOR);
3036  RNA_def_property_array(prop, 32); /* XXX this is the maximum value allowed - why? */
3038  RNA_def_property_dynamic_array_funcs(prop, "rna_SplineIKConstraint_joint_bindings_get_length");
3040  "rna_SplineIKConstraint_joint_bindings_get",
3041  "rna_SplineIKConstraint_joint_bindings_set",
3042  NULL);
3044  prop,
3045  "Joint Bindings",
3046  "(EXPERIENCED USERS ONLY) The relative positions of the joints along the chain, "
3047  "as percentages");
3048  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3049 
3050  /* settings */
3051  prop = RNA_def_property(srna, "use_chain_offset", PROP_BOOLEAN, PROP_NONE);
3054  prop, "Chain Offset", "Offset the entire chain relative to the root joint");
3055  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3056 
3057  prop = RNA_def_property(srna, "use_even_divisions", PROP_BOOLEAN, PROP_NONE);
3060  "Even Divisions",
3061  "Ignore the relative lengths of the bones when fitting to the curve");
3062  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3063 
3064  prop = RNA_def_property(srna, "use_curve_radius", PROP_BOOLEAN, PROP_NONE);
3067  prop,
3068  "Use Curve Radius",
3069  "Average radius of the endpoints is used to tweak the X and Z Scaling of the bones, "
3070  "on top of XZ Scale mode");
3071  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3072 
3073  /* xz scaling mode */
3074  prop = RNA_def_property(srna, "xz_scale_mode", PROP_ENUM, PROP_NONE);
3075  RNA_def_property_enum_sdna(prop, NULL, "xzScaleMode");
3076  RNA_def_property_enum_items(prop, splineik_xz_scale_mode);
3078  prop,
3079  "XZ Scale Mode",
3080  "Method used for determining the scaling of the X and Z axes of the bones");
3081  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3082 
3083  /* y scaling mode */
3084  prop = RNA_def_property(srna, "y_scale_mode", PROP_ENUM, PROP_NONE);
3085  RNA_def_property_enum_sdna(prop, NULL, "yScaleMode");
3086  RNA_def_property_enum_items(prop, splineik_y_scale_mode);
3088  "Y Scale Mode",
3089  "Method used for determining the scaling of the Y axis of the bones, "
3090  "on top of the shape and scaling of the curve itself");
3091  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3092 
3093  /* take original scaling of the bone into account in volume preservation */
3094  prop = RNA_def_property(srna, "use_original_scale", PROP_BOOLEAN, PROP_NONE);
3097  prop, "Use Original Scale", "Apply volume preservation over the original scaling");
3098  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3099 
3100  /* Volume preservation for "volumetric" scale mode. */
3101  prop = RNA_def_property(srna, "bulge", PROP_FLOAT, PROP_NONE);
3102  RNA_def_property_range(prop, 0.0, 100.0f);
3104  prop, "Volume Variation", "Factor between volume variation and stretching");
3105  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3106 
3107  prop = RNA_def_property(srna, "use_bulge_min", PROP_BOOLEAN, PROP_NONE);
3110  prop, "Use Volume Variation Minimum", "Use lower limit for volume variation");
3111  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3112 
3113  prop = RNA_def_property(srna, "use_bulge_max", PROP_BOOLEAN, PROP_NONE);
3116  prop, "Use Volume Variation Maximum", "Use upper limit for volume variation");
3117  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3118 
3119  prop = RNA_def_property(srna, "bulge_min", PROP_FLOAT, PROP_NONE);
3120  RNA_def_property_range(prop, 0.0, 1.0f);
3121  RNA_def_property_ui_text(prop, "Volume Variation Minimum", "Minimum volume stretching factor");
3122  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3123 
3124  prop = RNA_def_property(srna, "bulge_max", PROP_FLOAT, PROP_NONE);
3125  RNA_def_property_range(prop, 1.0, 100.0f);
3126  RNA_def_property_ui_text(prop, "Volume Variation Maximum", "Maximum volume stretching factor");
3127  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3128 
3129  prop = RNA_def_property(srna, "bulge_smooth", PROP_FLOAT, PROP_FACTOR);
3130  RNA_def_property_range(prop, 0.0, 1.0f);
3132  prop, "Volume Variation Smoothness", "Strength of volume stretching clamping");
3133  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3134 
3136 }
3137 
3139 {
3140  StructRNA *srna;
3141  PropertyRNA *prop;
3142 
3143  static const EnumPropertyItem pivot_rotAxis_items[] = {
3144  {PIVOTCON_AXIS_NONE, "ALWAYS_ACTIVE", 0, "Always", "Use the pivot point in every rotation"},
3146  "NX",
3147  0,
3148  "-X Rotation",
3149  "Use the pivot point in the negative rotation range around the X-axis"},
3151  "NY",
3152  0,
3153  "-Y Rotation",
3154  "Use the pivot point in the negative rotation range around the Y-axis"},
3156  "NZ",
3157  0,
3158  "-Z Rotation",
3159  "Use the pivot point in the negative rotation range around the Z-axis"},
3160  {PIVOTCON_AXIS_X,
3161  "X",
3162  0,
3163  "X Rotation",
3164  "Use the pivot point in the positive rotation range around the X-axis"},
3165  {PIVOTCON_AXIS_Y,
3166  "Y",
3167  0,
3168  "Y Rotation",
3169  "Use the pivot point in the positive rotation range around the Y-axis"},
3170  {PIVOTCON_AXIS_Z,
3171  "Z",
3172  0,
3173  "Z Rotation",
3174  "Use the pivot point in the positive rotation range around the Z-axis"},
3175  {0, NULL, 0, NULL, NULL},
3176  };
3177 
3178  srna = RNA_def_struct(brna, "PivotConstraint", "Constraint");
3179  RNA_def_struct_ui_text(srna, "Pivot Constraint", "Rotate around a different point");
3180 
3182 
3183  RNA_def_struct_sdna_from(srna, "bPivotConstraint", "data");
3184 
3185  RNA_def_struct_ui_icon(srna, ICON_CON_PIVOT);
3186 
3188 
3189  /* target-defined pivot */
3190  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
3191  RNA_def_property_pointer_sdna(prop, NULL, "tar");
3193  prop, "Target", "Target Object, defining the position of the pivot when defined");
3195  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3196 
3197  prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
3198  RNA_def_property_string_sdna(prop, NULL, "subtarget");
3199  RNA_def_property_ui_text(prop, "Sub-Target", "");
3200  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3201 
3202  /* pivot offset */
3203  prop = RNA_def_property(srna, "use_relative_location", PROP_BOOLEAN, PROP_NONE);
3206  prop,
3207  "Use Relative Offset",
3208  "Offset will be an absolute point in space instead of relative to the target");
3209  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3210 
3211  prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION);
3212  RNA_def_property_float_sdna(prop, NULL, "offset");
3214  "Offset",
3215  "Offset of pivot from target (when set), or from owner's location "
3216  "(when Fixed Position is off), or the absolute pivot point");
3217  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3218 
3219  /* rotation-based activation */
3220  prop = RNA_def_property(srna, "rotation_range", PROP_ENUM, PROP_NONE);
3221  RNA_def_property_enum_sdna(prop, NULL, "rotAxis");
3222  RNA_def_property_enum_items(prop, pivot_rotAxis_items);
3224  prop, "Enabled Rotation Range", "Rotation range on which pivoting should occur");
3225  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3226 
3228 }
3229 
3231 {
3232  StructRNA *srna;
3233  PropertyRNA *prop;
3234 
3235  static const EnumPropertyItem frame_method_items[] = {
3236  {FOLLOWTRACK_FRAME_STRETCH, "STRETCH", 0, "Stretch", ""},
3237  {FOLLOWTRACK_FRAME_FIT, "FIT", 0, "Fit", ""},
3238  {FOLLOWTRACK_FRAME_CROP, "CROP", 0, "Crop", ""},
3239  {0, NULL, 0, NULL, NULL},
3240  };
3241 
3242  srna = RNA_def_struct(brna, "FollowTrackConstraint", "Constraint");
3244  srna, "Follow Track Constraint", "Lock motion to the target motion track");
3245  RNA_def_struct_sdna_from(srna, "bFollowTrackConstraint", "data");
3246  RNA_def_struct_ui_icon(srna, ICON_CON_FOLLOWTRACK);
3247 
3249 
3250  /* movie clip */
3251  prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
3252  RNA_def_property_pointer_sdna(prop, NULL, "clip");
3253  RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from");
3255  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3256 
3257  /* track */
3258  prop = RNA_def_property(srna, "track", PROP_STRING, PROP_NONE);
3259  RNA_def_property_string_sdna(prop, NULL, "track");
3260  RNA_def_property_ui_text(prop, "Track", "Movie tracking track to follow");
3261  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3262 
3263  /* use default clip */
3264  prop = RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE);
3266  RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene");
3267  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3268 
3269  /* use 3d position */
3270  prop = RNA_def_property(srna, "use_3d_position", PROP_BOOLEAN, PROP_NONE);
3272  RNA_def_property_ui_text(prop, "3D Position", "Use 3D position of track to parent to");
3273  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3274 
3275  /* object */
3276  prop = RNA_def_property(srna, "object", PROP_STRING, PROP_NONE);
3277  RNA_def_property_string_sdna(prop, NULL, "object");
3279  prop, "Object", "Movie tracking object to follow (if empty, camera object is used)");
3280  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3281 
3282  /* camera */
3283  prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
3284  RNA_def_property_pointer_sdna(prop, NULL, "camera");
3286  prop, "Camera", "Camera to which motion is parented (if empty active scene camera is used)");
3288  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3290  NULL,
3291  "rna_Constraint_followTrack_camera_set",
3292  NULL,
3293  "rna_Constraint_cameraObject_poll");
3294 
3295  /* depth object */
3296  prop = RNA_def_property(srna, "depth_object", PROP_POINTER, PROP_NONE);
3297  RNA_def_property_pointer_sdna(prop, NULL, "depth_ob");
3299  prop,
3300  "Depth Object",
3301  "Object used to define depth in camera space by projecting onto surface of this object");
3303  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3305  NULL,
3306  "rna_Constraint_followTrack_depthObject_set",
3307  NULL,
3308  "rna_Constraint_followTrack_depthObject_poll");
3309 
3310  /* frame method */
3311  prop = RNA_def_property(srna, "frame_method", PROP_ENUM, PROP_NONE);
3312  RNA_def_property_enum_bitflag_sdna(prop, NULL, "frame_method");
3313  RNA_def_property_enum_items(prop, frame_method_items);
3314  RNA_def_property_ui_text(prop, "Frame Method", "How the footage fits in the camera frame");
3315  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3316 
3317  /* use undistortion */
3318  prop = RNA_def_property(srna, "use_undistorted_position", PROP_BOOLEAN, PROP_NONE);
3320  RNA_def_property_ui_text(prop, "Undistort", "Parent to undistorted position of 2D track");
3321  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3322 
3324 }
3325 
3327 {
3328  StructRNA *srna;
3329  PropertyRNA *prop;
3330 
3331  srna = RNA_def_struct(brna, "CameraSolverConstraint", "Constraint");
3333  srna, "Camera Solver Constraint", "Lock motion to the reconstructed camera movement");
3334  RNA_def_struct_sdna_from(srna, "bCameraSolverConstraint", "data");
3335  RNA_def_struct_ui_icon(srna, ICON_CON_CAMERASOLVER);
3336 
3338 
3339  /* movie clip */
3340  prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
3341  RNA_def_property_pointer_sdna(prop, NULL, "clip");
3342  RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from");
3344  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3345 
3346  /* use default clip */
3347  prop = RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE);
3349  RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene");
3350  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3351 
3353 }
3354 
3356 {
3357  StructRNA *srna;
3358  PropertyRNA *prop;
3359 
3360  srna = RNA_def_struct(brna, "ObjectSolverConstraint", "Constraint");
3362  srna, "Object Solver Constraint", "Lock motion to the reconstructed object movement");
3363  RNA_def_struct_sdna_from(srna, "bObjectSolverConstraint", "data");
3364  RNA_def_struct_ui_icon(srna, ICON_CON_OBJECTSOLVER);
3365 
3367 
3368  /* movie clip */
3369  prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
3370  RNA_def_property_pointer_sdna(prop, NULL, "clip");
3371  RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from");
3373  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3374 
3375  /* use default clip */
3376  prop = RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE);
3378  RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene");
3379  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3380 
3381  prop = RNA_def_property(srna, "set_inverse_pending", PROP_BOOLEAN, PROP_NONE);
3384  prop, "Set Inverse Pending", "Set to true to request recalculation of the inverse matrix");
3385  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3386 
3387  /* object */
3388  prop = RNA_def_property(srna, "object", PROP_STRING, PROP_NONE);
3389  RNA_def_property_string_sdna(prop, NULL, "object");
3390  RNA_def_property_ui_text(prop, "Object", "Movie tracking object to follow");
3391  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3392 
3393  /* camera */
3394  prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
3395  RNA_def_property_pointer_sdna(prop, NULL, "camera");
3397  prop, "Camera", "Camera to which motion is parented (if empty active scene camera is used)");
3399  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3401  NULL,
3402  "rna_Constraint_objectSolver_camera_set",
3403  NULL,
3404  "rna_Constraint_cameraObject_poll");
3405 
3407 }
3408 
3410 {
3411  StructRNA *srna;
3412  PropertyRNA *prop;
3413 
3414  srna = RNA_def_struct(brna, "TransformCacheConstraint", "Constraint");
3416  srna, "Transform Cache Constraint", "Look up transformation from an external file");
3417  RNA_def_struct_sdna_from(srna, "bTransformCacheConstraint", "data");
3418  RNA_def_struct_ui_icon(srna, ICON_CON_TRANSFORM_CACHE);
3419 
3421 
3422  prop = RNA_def_property(srna, "cache_file", PROP_POINTER, PROP_NONE);
3423  RNA_def_property_pointer_sdna(prop, NULL, "cache_file");
3424  RNA_def_property_struct_type(prop, "CacheFile");
3425  RNA_def_property_ui_text(prop, "Cache File", "");
3427  RNA_def_property_update(prop, 0, "rna_Constraint_dependency_update");
3428 
3429  prop = RNA_def_property(srna, "object_path", PROP_STRING, PROP_NONE);
3431  prop,
3432  "Object Path",
3433  "Path to the object in the Alembic archive used to lookup the transform matrix");
3434  RNA_def_property_update(prop, 0, "rna_Constraint_update");
3435 
3437 }
3438 
3439 /* Define the base struct for constraints. */
3440 
3442 {
3443  StructRNA *srna;
3444  PropertyRNA *prop;
3445 
3446  /* data */
3447  srna = RNA_def_struct(brna, "Constraint", NULL);
3449  srna, "Constraint", "Constraint modifying the transformation of objects and bones");
3450  RNA_def_struct_refine_func(srna, "rna_ConstraintType_refine");
3451  RNA_def_struct_path_func(srna, "rna_Constraint_path");
3452  RNA_def_struct_sdna(srna, "bConstraint");
3453  RNA_def_struct_ui_icon(srna, ICON_CONSTRAINT);
3454 
3455  /* strings */
3456  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
3457  RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Constraint_name_set");
3458  RNA_def_property_ui_text(prop, "Name", "Constraint name");
3459  RNA_def_struct_name_property(srna, prop);
3461 
3462  /* enums */
3463  prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
3465  RNA_def_property_enum_sdna(prop, NULL, "type");
3467  RNA_def_property_ui_text(prop, "Type", "");
3468 
3469  prop = RNA_def_boolean(srna,
3470  "is_override_data",
3471  false,
3472  "Override Constraint",
3473  "In a local override object, whether this constraint comes from the "
3474  "linked reference object, or is local to the override");
3477 
3479 
3480  prop = RNA_def_property(srna, "owner_space", PROP_ENUM, PROP_NONE);
3481  RNA_def_property_enum_sdna(prop, NULL, "ownspace");
3483  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_owner_space_itemf");
3484  RNA_def_property_ui_text(prop, "Owner Space", "Space that owner is evaluated in");
3485  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3486 
3487  prop = RNA_def_property(srna, "target_space", PROP_ENUM, PROP_NONE);
3488  RNA_def_property_enum_sdna(prop, NULL, "tarspace");
3490  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_target_space_itemf");
3491  RNA_def_property_ui_text(prop, "Target Space", "Space that target is evaluated in");
3492  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3493 
3494  prop = RNA_def_property(srna, "space_object", PROP_POINTER, PROP_NONE);
3495  RNA_def_property_pointer_sdna(prop, NULL, "space_object");
3496  RNA_def_property_ui_text(prop, "Object", "Object for Custom Space");
3499  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3500 
3501  prop = RNA_def_property(srna, "space_subtarget", PROP_STRING, PROP_NONE);
3502  RNA_def_property_string_sdna(prop, NULL, "space_subtarget");
3503  RNA_def_property_ui_text(prop, "Sub-Target", "Armature bone, mesh or lattice vertex group, ...");
3504  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3505 
3506  /* flags */
3507  prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
3509  RNA_def_property_ui_text(prop, "Disable", "Enable/Disable Constraint");
3510  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3511  RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
3512 
3513  prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
3515  RNA_def_property_ui_text(prop, "Enabled", "Use the results of this constraint");
3516  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3517  RNA_def_property_ui_icon(prop, ICON_HIDE_ON, 1);
3518 
3519  prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
3521  RNA_def_property_boolean_sdna(prop, NULL, "ui_expand_flag", 0);
3522  RNA_def_property_ui_text(prop, "Expanded", "Constraint's panel is expanded in UI");
3523  RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);
3524 
3525  /* XXX this is really an internal flag,
3526  * but it may be useful for some tools to be able to access this... */
3527  prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
3530  RNA_def_property_ui_text(prop, "Valid", "Constraint has valid settings and can be evaluated");
3531 
3532  /* TODO: setting this to true must ensure that all others in stack are turned off too... */
3533  prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
3535  RNA_def_property_ui_text(prop, "Active", "Constraint is the one being edited");
3536 
3537  /* values */
3538  prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR);
3539  RNA_def_property_float_sdna(prop, NULL, "enforce");
3540  RNA_def_property_range(prop, 0.0f, 1.0f);
3542  prop, "Influence", "Amount of influence constraint will have on the final solution");
3543  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_influence_update");
3544 
3545  /* readonly values */
3546  prop = RNA_def_property(srna, "error_location", PROP_FLOAT, PROP_NONE);
3547  RNA_def_property_float_sdna(prop, NULL, "lin_error");
3550  prop,
3551  "Lin error",
3552  "Amount of residual error in Blender space unit for constraints that work on position");
3553 
3554  prop = RNA_def_property(srna, "error_rotation", PROP_FLOAT, PROP_NONE);
3555  RNA_def_property_float_sdna(prop, NULL, "rot_error");
3558  prop,
3559  "Rotation error",
3560  "Amount of residual error in radians for constraints that work on orientation");
3561 
3563 
3564  /* pointers */
3567 
3597 }
3598 
3599 #endif
Blender kernel action and pose functionality.
void BKE_animdata_fix_paths_rename_all(struct ID *ref_id, const char *prefix, const char *oldName, const char *newName)
Definition: anim_data.c:1287
void BKE_constraint_targets_flush(struct bConstraint *con, struct ListBase *targets, bool no_copy)
Definition: constraint.c:6186
int BKE_constraint_targets_get(struct bConstraint *con, struct ListBase *r_targets)
Definition: constraint.c:6157
struct bConstraint * BKE_constraint_find_from_target(struct Object *ob, struct bConstraintTarget *tgt, struct bPoseChannel **r_pchan)
Definition: constraint.c:6052
void BKE_constraint_unique_name(struct bConstraint *con, struct ListBase *list)
Definition: constraint.c:112
void id_lib_extern(struct ID *id)
Definition: lib_id.c:237
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition: report.c:83
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:239
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:466
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define M_PI
Definition: BLI_math_base.h:20
#define DEG2RADF(_deg)
size_t size_t char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL()
Definition: string.c:250
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL(1
#define UNUSED(x)
#define ELEM(...)
@ POSE_LOCKED
@ POSE_DO_UNLOCK
@ CONSTRAINT_BBONE_SHAPE
@ CONSTRAINT_OFF
@ CONSTRAINT_OVERRIDE_LIBRARY_LOCAL
@ CONSTRAINT_ACTIVE
@ CONSTRAINT_DISABLE
@ SIZELIKE_MULTIPLY
@ SIZELIKE_Z
@ SIZELIKE_UNIFORM
@ SIZELIKE_Y
@ SIZELIKE_X
@ SIZELIKE_OFFSET
@ CONSTRAINT_IK_ROT
@ CONSTRAINT_IK_NO_ROT_X
@ CONSTRAINT_IK_TARGETAXIS
@ CONSTRAINT_IK_NO_POS_Z
@ CONSTRAINT_IK_NO_POS_Y
@ CONSTRAINT_IK_NO_ROT_Y
@ CONSTRAINT_IK_POS
@ CONSTRAINT_IK_NO_POS_X
@ CONSTRAINT_IK_NO_ROT_Z
@ CONSTRAINT_IK_STRETCH
@ CONSTRAINT_IK_TIP
@ CONSTRAINT_TAR_CUSTOM_SPACE
@ ROTLIKE_MIX_OFFSET
@ ROTLIKE_MIX_BEFORE
@ ROTLIKE_MIX_AFTER
@ ROTLIKE_MIX_REPLACE
@ ROTLIKE_MIX_ADD
@ CONSTRAINT_TYPE_TRACKTO
@ CONSTRAINT_TYPE_PIVOT
@ CONSTRAINT_TYPE_CHILDOF
@ CONSTRAINT_TYPE_TRANSFORM
@ CONSTRAINT_TYPE_FOLLOWTRACK
@ CONSTRAINT_TYPE_OBJECTSOLVER
@ CONSTRAINT_TYPE_ARMATURE
@ CONSTRAINT_TYPE_LOCLIKE
@ CONSTRAINT_TYPE_SHRINKWRAP
@ CONSTRAINT_TYPE_MINMAX
@ CONSTRAINT_TYPE_ROTLIMIT
@ CONSTRAINT_TYPE_CAMERASOLVER
@ CONSTRAINT_TYPE_ROTLIKE
@ CONSTRAINT_TYPE_SPLINEIK
@ CONSTRAINT_TYPE_PYTHON
@ CONSTRAINT_TYPE_KINEMATIC
@ CONSTRAINT_TYPE_DISTLIMIT
@ CONSTRAINT_TYPE_TRANSLIKE
@ CONSTRAINT_TYPE_LOCLIMIT
@ CONSTRAINT_TYPE_CLAMPTO
@ CONSTRAINT_TYPE_LOCKTRACK
@ CONSTRAINT_TYPE_SIZELIMIT
@ CONSTRAINT_TYPE_ACTION
@ CONSTRAINT_TYPE_FOLLOWPATH
@ CONSTRAINT_TYPE_STRETCHTO
@ CONSTRAINT_TYPE_SIZELIKE
@ CONSTRAINT_TYPE_SAMEVOL
@ CONSTRAINT_TYPE_DAMPTRACK
@ CONSTRAINT_TYPE_TRANSFORM_CACHE
@ LIMITDIST_INSIDE
@ LIMITDIST_OUTSIDE
@ LIMITDIST_ONSURFACE
@ CONSTRAINT_ARMATURE_QUATERNION
@ CONSTRAINT_ARMATURE_ENVELOPE
@ CONSTRAINT_ARMATURE_CUR_LOCATION
@ CAMERASOLVER_ACTIVECLIP
@ FOLLOWTRACK_USE_UNDISTORTION
@ FOLLOWTRACK_USE_3D_POSITION
@ FOLLOWTRACK_ACTIVECLIP
@ MINMAX_USEROT
@ ACTCON_BONE_USE_OBJECT_ACTION
@ ACTCON_USE_EVAL_TIME
@ TARGET_Z_UP
#define CON_SHRINKWRAP_PROJECT_CULL_MASK
@ TRANS_MIXSCALE_MULTIPLY
@ TRANS_MIXSCALE_REPLACE
@ CONSTRAINT_SPLINEIK_YS_NONE
@ CONSTRAINT_SPLINEIK_YS_FIT_CURVE
@ CONSTRAINT_SPLINEIK_YS_ORIGINAL
@ TRANS_MIXLOC_ADD
@ TRANS_MIXLOC_REPLACE
@ CONSTRAINT_SPACE_CUSTOM
@ CONSTRAINT_SPACE_POSE
@ CONSTRAINT_SPACE_WORLD
@ CONSTRAINT_SPACE_OWNLOCAL
@ CONSTRAINT_SPACE_LOCAL
@ CONSTRAINT_SPACE_PARLOCAL
@ ACTCON_MIX_BEFORE
@ ACTCON_MIX_BEFORE_SPLIT
@ ACTCON_MIX_BEFORE_FULL
@ ACTCON_MIX_AFTER_FULL
@ ACTCON_MIX_AFTER_SPLIT
@ ACTCON_MIX_AFTER
@ FOLLOWPATH_FOLLOW
@ FOLLOWPATH_RADIUS
@ FOLLOWPATH_STATIC
@ LIMIT_TRANSFORM
@ PYCON_USETARGETS
@ PYCON_SCRIPTERROR
@ CONSTRAINT_SPLINEIK_EVENSPLITS
@ CONSTRAINT_SPLINEIK_USE_BULGE_MAX
@ CONSTRAINT_SPLINEIK_USE_ORIGINAL_SCALE
@ CONSTRAINT_SPLINEIK_USE_BULGE_MIN
@ CONSTRAINT_SPLINEIK_NO_CURVERAD
@ CONSTRAINT_SPLINEIK_NO_ROOT
@ TRANSLIKE_MIX_AFTER
@ TRANSLIKE_MIX_AFTER_FULL
@ TRANSLIKE_MIX_BEFORE
@ TRANSLIKE_MIX_BEFORE_SPLIT
@ TRANSLIKE_MIX_REPLACE
@ TRANSLIKE_MIX_BEFORE_FULL
@ TRANSLIKE_MIX_AFTER_SPLIT
@ OBJECTSOLVER_SET_INVERSE
@ CON_SHRINKWRAP_PROJECT_INVERT_CULL
@ CON_SHRINKWRAP_PROJECT_OPPOSITE
@ CON_SHRINKWRAP_PROJECT_CULL_FRONTFACE
@ CON_SHRINKWRAP_PROJECT_CULL_BACKFACE
@ CON_SHRINKWRAP_TRACK_NORMAL
@ CLAMPTO_CYCLIC
@ CONSTRAINT_IK_COPYPOSE
@ CONSTRAINT_IK_DISTANCE
@ PIVOTCON_AXIS_X_NEG
@ PIVOTCON_AXIS_X
@ PIVOTCON_AXIS_Z
@ PIVOTCON_AXIS_Z_NEG
@ PIVOTCON_AXIS_Y
@ PIVOTCON_AXIS_NONE
@ PIVOTCON_AXIS_Y_NEG
@ SAMEVOL_SINGLE_AXIS
@ SAMEVOL_STRICT
@ SAMEVOL_UNIFORM
@ PIVOTCON_FLAG_OFFSET_ABS
@ CONSTRAINT_EULER_XZY
@ CONSTRAINT_EULER_YXZ
@ CONSTRAINT_EULER_ZYX
@ CONSTRAINT_EULER_AUTO
@ CONSTRAINT_EULER_ZXY
@ CONSTRAINT_EULER_YZX
@ CONSTRAINT_EULER_XYZ
@ TRANSLIKE_REMOVE_TARGET_SHEAR
@ LIMITDIST_TRANSFORM
@ STRETCHTOCON_USE_BULGE_MAX
@ STRETCHTOCON_USE_BULGE_MIN
@ ROTLIKE_Y_INVERT
@ ROTLIKE_Z_INVERT
@ ROTLIKE_X_INVERT
@ LOCLIKE_Z_INVERT
@ LOCLIKE_Y_INVERT
@ LOCLIKE_OFFSET
@ LOCLIKE_X_INVERT
@ CHILDOF_ROTY
@ CHILDOF_LOCZ
@ CHILDOF_ROTX
@ CHILDOF_SIZEX
@ CHILDOF_SIZEZ
@ CHILDOF_LOCX
@ CHILDOF_SIZEY
@ CHILDOF_ROTZ
@ CHILDOF_SET_INVERSE
@ CHILDOF_LOCY
@ CONSTRAINT_SPLINEIK_XZS_VOLUMETRIC
@ CONSTRAINT_SPLINEIK_XZS_ORIGINAL
@ CONSTRAINT_SPLINEIK_XZS_NONE
@ CONSTRAINT_SPLINEIK_XZS_INVERSE
@ TRANS_SCALE
@ TRANS_ROTATION
@ TRANS_LOCATION
@ CLAMPTO_AUTO
@ TRANS_MIXROT_REPLACE
@ TRANS_MIXROT_ADD
@ TRANS_MIXROT_BEFORE
@ TRANS_MIXROT_AFTER
@ FOLLOWTRACK_FRAME_CROP
@ FOLLOWTRACK_FRAME_FIT
@ FOLLOWTRACK_FRAME_STRETCH
@ MOD_SHRINKWRAP_TARGET_PROJECT
@ MOD_SHRINKWRAP_NEAREST_VERTEX
@ MOD_SHRINKWRAP_PROJECT
@ MOD_SHRINKWRAP_NEAREST_SURFACE
Object is a sort of wrapper for general info.
@ OB_CAMERA
@ OB_ARMATURE
@ OB_MESH
#define MINAFRAME
#define MAXFRAME
struct ListBase * ED_object_constraint_list_from_constraint(struct Object *ob, struct bConstraint *con, struct bPoseChannel **r_pchan)
void ED_object_constraint_tag_update(struct Main *bmain, struct Object *ob, struct bConstraint *con)
void ED_object_constraint_dependency_tag_update(struct Main *bmain, struct Object *ob, struct bConstraint *con)
Read Guarded memory(de)allocation.
#define RNA_MAX_ARRAY_DIMENSION
Definition: RNA_define.h:28
@ PARM_RNAPTR
Definition: RNA_types.h:354
@ PARM_REQUIRED
Definition: RNA_types.h:352
@ FUNC_USE_REPORTS
Definition: RNA_types.h:663
@ FUNC_USE_MAIN
Definition: RNA_types.h:661
@ FUNC_USE_SELF_ID
Definition: RNA_types.h:650
@ PROP_FLOAT
Definition: RNA_types.h:61
@ PROP_BOOLEAN
Definition: RNA_types.h:59
@ PROP_ENUM
Definition: RNA_types.h:63
@ PROP_INT
Definition: RNA_types.h:60
@ PROP_STRING
Definition: RNA_types.h:62
@ PROP_POINTER
Definition: RNA_types.h:64
@ PROP_COLLECTION
Definition: RNA_types.h:65
#define RNA_ENUM_ITEM_SEPR
Definition: RNA_types.h:483
#define RNA_TRANSLATION_PREC_DEFAULT
Definition: RNA_types.h:117
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition: RNA_types.h:312
@ PROP_THICK_WRAP
Definition: RNA_types.h:285
@ PROP_DYNAMIC
Definition: RNA_types.h:290
@ PROP_ANIMATABLE
Definition: RNA_types.h:202
@ PROP_EDITABLE
Definition: RNA_types.h:189
@ PROP_NEVER_NULL
Definition: RNA_types.h:239
@ PROP_NO_DEG_UPDATE
Definition: RNA_types.h:301
@ PROP_ID_SELF_CHECK
Definition: RNA_types.h:232
@ PROP_ID_REFCOUNT
Definition: RNA_types.h:226
#define RNA_ENUM_ITEM_HEADING(name, description)
Definition: RNA_types.h:477
@ PROP_TIME
Definition: RNA_types.h:146
@ PROP_MATRIX
Definition: RNA_types.h:158
@ PROP_DISTANCE
Definition: RNA_types.h:149
@ PROP_ANGLE
Definition: RNA_types.h:145
@ PROP_NONE
Definition: RNA_types.h:126
@ PROP_FACTOR
Definition: RNA_types.h:144
@ PROP_TRANSLATION
Definition: RNA_types.h:154
#define C
Definition: RandGen.cpp:25
#define ND_POSE
Definition: WM_types.h:407
#define ND_CONSTRAINT
Definition: WM_types.h:413
#define NA_RENAME
Definition: WM_types.h:527
#define NC_OBJECT
Definition: WM_types.h:329
Scene scene
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
T length(const vec_base< T, Size > &a)
static const EnumPropertyItem mode_items[]
Definition: paint_mask.c:59
static void rna_def_constraint_rotate_like(BlenderRNA *brna)
static void rna_def_constraint_same_volume(BlenderRNA *brna)
static const EnumPropertyItem constraint_distance_items[]
static void rna_def_constraint_location_limit(BlenderRNA *brna)
static const EnumPropertyItem owner_space_pchan_items[]
static void rna_def_constraint_stretch_to(BlenderRNA *brna)
static void rna_def_constraint_follow_track(BlenderRNA *brna)
static void rna_def_constraint_size_limit(BlenderRNA *brna)
static void rna_def_constraint_python(BlenderRNA *brna)
static void rna_def_constraint_object_solver(BlenderRNA *brna)
static void rna_def_constraint_track_to(BlenderRNA *brna)
static void rna_def_constraint_transform(BlenderRNA *brna)
static void rna_def_constraint_locate_like(BlenderRNA *brna)
static void rna_def_constraint_rotation_limit(BlenderRNA *brna)
static void rna_def_constraint_headtail_common(StructRNA *srna)
static void rna_def_constrainttarget(BlenderRNA *brna)
static void rna_def_constraint_distance_limit(BlenderRNA *brna)
static void rna_def_constraint_transform_like(BlenderRNA *brna)
static void rna_def_constraint_kinematic(BlenderRNA *brna)
static const EnumPropertyItem target_space_pchan_items[]
static void rna_def_constraint_shrinkwrap(BlenderRNA *brna)
static void rna_def_constraint_target_common(StructRNA *srna)
static void rna_def_constraint_follow_path(BlenderRNA *brna)
static void rna_def_constraint_action(BlenderRNA *brna)
static void rna_def_constraint_childof(BlenderRNA *brna)
static void rna_def_constraint_locked_track(BlenderRNA *brna)
static void rna_def_constraint_damped_track(BlenderRNA *brna)
static void rna_def_constraint_minmax(BlenderRNA *brna)
static void rna_def_constraint_size_like(BlenderRNA *brna)
static void rna_def_constraint_spline_ik(BlenderRNA *brna)
static void rna_def_constrainttarget_bone(BlenderRNA *brna)
static void rna_def_constraint_armature_deform_targets(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_constraint(BlenderRNA *brna)
static void rna_def_constraint_clamp_to(BlenderRNA *brna)
static const EnumPropertyItem euler_order_items[]
static void rna_def_constraint_pivot(BlenderRNA *brna)
static const EnumPropertyItem track_axis_items[]
static void rna_def_constraint_armature_deform(BlenderRNA *brna)
static void rna_def_constraint_camera_solver(BlenderRNA *brna)
const EnumPropertyItem rna_enum_constraint_type_items[]
static void rna_def_constraint_transform_cache(BlenderRNA *brna)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
Definition: rna_define.c:1148
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2740
void RNA_define_lib_overridable(const bool make_overridable)
Definition: rna_define.c:742
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
Definition: rna_define.c:1193
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3493
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4170
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2236
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1526
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
Definition: rna_define.c:3285
void RNA_def_property_float_default(PropertyRNA *prop, float value)
Definition: rna_define.c:2022
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4312
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3126
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1645
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2695
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
Definition: rna_define.c:1653
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4273
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
Definition: rna_define.c:3474
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1237
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2944
void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength)
Definition: rna_define.c:2926
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
Definition: rna_define.c:1598
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1872
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1048
void RNA_def_property_array(PropertyRNA *prop, int length)
Definition: rna_define.c:1539
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
Definition: rna_define.c:1737
void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const char *propname)
Definition: rna_define.c:1075
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1772
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
Definition: rna_define.c:2769
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4347
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
Definition: rna_define.c:2900
const int rna_matrix_dimsize_4x4[]
Definition: rna_define.c:1595
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3224
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1257
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2669
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
Definition: rna_define.c:1103
void RNA_def_function_flag(FunctionRNA *func, int flag)
Definition: rna_define.c:4342
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1495
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
Definition: rna_define.c:3385
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1028
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2601
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
Definition: rna_define.c:1245
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2493
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
Definition: rna_define.c:1664
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2343
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
Definition: rna_define.c:2327
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
Definition: rna_define.c:1503
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1518
const EnumPropertyItem rna_enum_driver_target_rotation_mode_items[]
Definition: rna_fcurve.c:137
const EnumPropertyItem rna_enum_axis_xyz_items[]
Definition: rna_modifier.c:615
const EnumPropertyItem rna_enum_modifier_shrinkwrap_mode_items[]
Definition: rna_modifier.c:347
const EnumPropertyItem rna_enum_object_axis_items[]
Definition: rna_object.c:297
#define min(a, b)
Definition: sort.c:35
Definition: DNA_ID.h:368
char name[66]
Definition: DNA_ID.h:378
Definition: BKE_main.h:121
ListBase constraints
struct bPose * pose
void * data
Definition: RNA_types.h:38
struct ID * owner_id
Definition: RNA_types.h:36
struct bConstraintTarget * next
short flag
float max
#define N_(msgid)
PointerRNA * ptr
Definition: wm_files.c:3480