Blender  V2.93
rna_constraint.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #include <stdlib.h>
22 
23 #include "BLI_math.h"
24 
25 #include "MEM_guardedalloc.h"
26 
27 #include "BLT_translation.h"
28 
29 #include "DNA_action_types.h"
30 #include "DNA_constraint_types.h"
31 #include "DNA_modifier_types.h"
32 #include "DNA_object_types.h"
33 #include "DNA_scene_types.h"
34 
35 #include "RNA_define.h"
36 #include "RNA_enum_types.h"
37 
38 #include "rna_internal.h"
39 
40 #include "WM_types.h"
41 
42 #include "ED_object.h"
43 
44 /* please keep the names in sync with constraint.c */
46  {0, "", 0, N_("Motion Tracking"), ""},
47  {CONSTRAINT_TYPE_CAMERASOLVER, "CAMERA_SOLVER", ICON_CON_CAMERASOLVER, "Camera Solver", ""},
48  {CONSTRAINT_TYPE_FOLLOWTRACK, "FOLLOW_TRACK", ICON_CON_FOLLOWTRACK, "Follow Track", ""},
49  {CONSTRAINT_TYPE_OBJECTSOLVER, "OBJECT_SOLVER", ICON_CON_OBJECTSOLVER, "Object Solver", ""},
50  {0, "", 0, N_("Transform"), ""},
52  "COPY_LOCATION",
53  ICON_CON_LOCLIKE,
54  "Copy Location",
55  "Copy the location of a target (with an optional offset), so that they move together"},
57  "COPY_ROTATION",
58  ICON_CON_ROTLIKE,
59  "Copy Rotation",
60  "Copy the rotation of a target (with an optional offset), so that they rotate together"},
62  "COPY_SCALE",
63  ICON_CON_SIZELIKE,
64  "Copy Scale",
65  "Copy the scale factors of a target (with an optional offset), so that they are scaled by "
66  "the same amount"},
68  "COPY_TRANSFORMS",
69  ICON_CON_TRANSLIKE,
70  "Copy Transforms",
71  "Copy all the transformations of a target, so that they move together"},
73  "LIMIT_DISTANCE",
74  ICON_CON_DISTLIMIT,
75  "Limit Distance",
76  "Restrict movements to within a certain distance of a target (at the time of constraint "
77  "evaluation only)"},
79  "LIMIT_LOCATION",
80  ICON_CON_LOCLIMIT,
81  "Limit Location",
82  "Restrict movement along each axis within given ranges"},
84  "LIMIT_ROTATION",
85  ICON_CON_ROTLIMIT,
86  "Limit Rotation",
87  "Restrict rotation along each axis within given ranges"},
89  "LIMIT_SCALE",
90  ICON_CON_SIZELIMIT,
91  "Limit Scale",
92  "Restrict scaling along each axis with given ranges"},
94  "MAINTAIN_VOLUME",
95  ICON_CON_SAMEVOL,
96  "Maintain Volume",
97  "Compensate for scaling one axis by applying suitable scaling to the other two axes"},
99  "TRANSFORM",
100  ICON_CON_TRANSFORM,
101  "Transformation",
102  "Use one transform property from target to control another (or same) property on owner"},
104  "TRANSFORM_CACHE",
105  ICON_CON_TRANSFORM_CACHE,
106  "Transform Cache",
107  "Look up the transformation matrix from an external file"},
108  {0, "", 0, N_("Tracking"), ""},
110  "CLAMP_TO",
111  ICON_CON_CLAMPTO,
112  "Clamp To",
113  "Restrict movements to lie along a curve by remapping location along curve's longest axis"},
115  "DAMPED_TRACK",
116  ICON_CON_TRACKTO,
117  "Damped Track",
118  "Point towards a target by performing the smallest rotation necessary"},
120  "IK",
121  ICON_CON_KINEMATIC,
122  "Inverse Kinematics",
123  "Control a chain of bones by specifying the endpoint target (Bones only)"},
125  "LOCKED_TRACK",
126  ICON_CON_LOCKTRACK,
127  "Locked Track",
128  "Rotate around the specified ('locked') axis to point towards a target"},
130  "SPLINE_IK",
131  ICON_CON_SPLINEIK,
132  "Spline IK",
133  "Align chain of bones along a curve (Bones only)"},
135  "STRETCH_TO",
136  ICON_CON_STRETCHTO,
137  "Stretch To",
138  "Stretch along Y-Axis to point towards a target"},
140  "TRACK_TO",
141  ICON_CON_TRACKTO,
142  "Track To",
143  "Legacy tracking constraint prone to twisting artifacts"},
144  {0, "", 0, N_("Relationship"), ""},
146  "ACTION",
147  ICON_ACTION,
148  "Action",
149  "Use transform property of target to look up pose for owner from an Action"},
151  "ARMATURE",
152  ICON_CON_ARMATURE,
153  "Armature",
154  "Apply weight-blended transformation from multiple bones like the Armature modifier"},
156  "CHILD_OF",
157  ICON_CON_CHILDOF,
158  "Child Of",
159  "Make target the 'detachable' parent of owner"},
161  "FLOOR",
162  ICON_CON_FLOOR,
163  "Floor",
164  "Use position (and optionally rotation) of target to define a 'wall' or 'floor' that the "
165  "owner can not cross"},
167  "FOLLOW_PATH",
168  ICON_CON_FOLLOWPATH,
169  "Follow Path",
170  "Use to animate an object/bone following a path"},
172  "PIVOT",
173  ICON_CON_PIVOT,
174  "Pivot",
175  "Change pivot point for transforms (buggy)"},
176 #if 0
177  {CONSTRAINT_TYPE_RIGIDBODYJOINT,
178  "RIGID_BODY_JOINT",
179  ICON_CONSTRAINT_DATA,
180  "Rigid Body Joint",
181  "Use to define a Rigid Body Constraint (for Game Engine use only)"},
183  "SCRIPT",
184  ICON_CONSTRAINT_DATA,
185  "Script",
186  "Custom constraint(s) written in Python (Not yet implemented)"},
187 #endif
189  "SHRINKWRAP",
190  ICON_CON_SHRINKWRAP,
191  "Shrinkwrap",
192  "Restrict movements to surface of target mesh"},
193  {0, NULL, 0, NULL, NULL},
194 };
195 
198  "WORLD",
199  0,
200  "World Space",
201  "The transformation of the target is evaluated relative to the world "
202  "coordinate system"},
204  "CUSTOM",
205  0,
206  "Custom Space",
207  "The transformation of the target is evaluated relative to a custom object/bone/vertex "
208  "group"},
210  "POSE",
211  0,
212  "Pose Space",
213  "The transformation of the target is only evaluated in the Pose Space, "
214  "the target armature object transformation is ignored"},
216  "LOCAL_WITH_PARENT",
217  0,
218  "Local With Parent",
219  "The transformation of the target bone is evaluated relative to its rest pose "
220  "local coordinate system, thus including the parent-induced transformation"},
222  "LOCAL",
223  0,
224  "Local Space",
225  "The transformation of the target is evaluated relative to its local "
226  "coordinate system"},
227  {0, NULL, 0, NULL, NULL},
228 };
229 
232  "WORLD",
233  0,
234  "World Space",
235  "The constraint is applied relative to the world coordinate system"},
237  "CUSTOM",
238  0,
239  "Custom Space",
240  "The constraint is applied in local space of a custom object/bone/vertex group"},
242  "POSE",
243  0,
244  "Pose Space",
245  "The constraint is applied in Pose Space, the object transformation is ignored"},
247  "LOCAL_WITH_PARENT",
248  0,
249  "Local With Parent",
250  "The constraint is applied relative to the rest pose local coordinate system "
251  "of the bone, thus including the parent-induced transformation"},
253  "LOCAL",
254  0,
255  "Local Space",
256  "The constraint is applied relative to the local coordinate system of the object"},
257  {0, NULL, 0, NULL, NULL},
258 };
259 
261  {TRACK_X, "TRACK_X", 0, "X", ""},
262  {TRACK_Y, "TRACK_Y", 0, "Y", ""},
263  {TRACK_Z, "TRACK_Z", 0, "Z", ""},
264  {TRACK_nX, "TRACK_NEGATIVE_X", 0, "-X", ""},
265  {TRACK_nY, "TRACK_NEGATIVE_Y", 0, "-Y", ""},
266  {TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""},
267  {0, NULL, 0, NULL, NULL},
268 };
269 
271  {CONSTRAINT_EULER_AUTO, "AUTO", 0, "Default", "Euler using the default rotation order"},
272  {CONSTRAINT_EULER_XYZ, "XYZ", 0, "XYZ Euler", "Euler using the XYZ rotation order"},
273  {CONSTRAINT_EULER_XZY, "XZY", 0, "XZY Euler", "Euler using the XZY rotation order"},
274  {CONSTRAINT_EULER_YXZ, "YXZ", 0, "YXZ Euler", "Euler using the YXZ rotation order"},
275  {CONSTRAINT_EULER_YZX, "YZX", 0, "YZX Euler", "Euler using the YZX rotation order"},
276  {CONSTRAINT_EULER_ZXY, "ZXY", 0, "ZXY Euler", "Euler using the ZXY rotation order"},
277  {CONSTRAINT_EULER_ZYX, "ZYX", 0, "ZYX Euler", "Euler using the ZYX rotation order"},
278  {0, NULL, 0, NULL, NULL},
279 };
280 
281 #ifdef RNA_RUNTIME
282 
283 static const EnumPropertyItem space_object_items[] = {
285  "WORLD",
286  0,
287  "World Space",
288  "The transformation of the target is evaluated relative to the world coordinate system"},
290  "CUSTOM",
291  0,
292  "Custom Space",
293  "The transformation of the target is evaluated relative to a custom object/bone/vertex "
294  "group"},
296  "LOCAL",
297  0,
298  "Local Space",
299  "The transformation of the target is evaluated relative to its local coordinate system"},
300  {0, NULL, 0, NULL, NULL},
301 };
302 
303 # include "DNA_cachefile_types.h"
304 
305 # include "BKE_action.h"
306 # include "BKE_animsys.h"
307 # include "BKE_constraint.h"
308 # include "BKE_context.h"
309 
310 # ifdef WITH_ALEMBIC
311 # include "ABC_alembic.h"
312 # endif
313 
314 static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
315 {
316  bConstraint *con = (bConstraint *)ptr->data;
317 
318  switch (con->type) {
320  return &RNA_ChildOfConstraint;
322  return &RNA_TrackToConstraint;
324  return &RNA_KinematicConstraint;
326  return &RNA_FollowPathConstraint;
332  return &RNA_CopyScaleConstraint;
334  return &RNA_MaintainVolumeConstraint;
336  return &RNA_PythonConstraint;
338  return &RNA_ArmatureConstraint;
340  return &RNA_ActionConstraint;
344  return &RNA_StretchToConstraint;
346  return &RNA_FloorConstraint;
348  return &RNA_ClampToConstraint;
350  return &RNA_TransformConstraint;
356  return &RNA_LimitScaleConstraint;
360  return &RNA_ShrinkwrapConstraint;
364  return &RNA_SplineIKConstraint;
368  return &RNA_PivotConstraint;
370  return &RNA_FollowTrackConstraint;
372  return &RNA_CameraSolverConstraint;
374  return &RNA_ObjectSolverConstraint;
376  return &RNA_TransformCacheConstraint;
377  default:
378  return &RNA_UnknownType;
379  }
380 }
381 
382 static void rna_ConstraintTargetBone_target_set(PointerRNA *ptr,
383  PointerRNA value,
384  struct ReportList *UNUSED(reports))
385 {
387  Object *ob = value.data;
388 
389  if (!ob || ob->type == OB_ARMATURE) {
390  id_lib_extern((ID *)ob);
391  tgt->tar = ob;
392  }
393 }
394 
395 static void rna_Constraint_name_set(PointerRNA *ptr, const char *value)
396 {
397  bConstraint *con = ptr->data;
398  char oldname[sizeof(con->name)];
399 
400  /* make a copy of the old name first */
401  BLI_strncpy(oldname, con->name, sizeof(con->name));
402 
403  /* copy the new name into the name slot */
404  BLI_strncpy_utf8(con->name, value, sizeof(con->name));
405 
406  /* make sure name is unique */
407  if (ptr->owner_id) {
408  Object *ob = (Object *)ptr->owner_id;
410 
411  /* if we have the list, check for unique name, otherwise give up */
412  if (list) {
413  BKE_constraint_unique_name(con, list);
414  }
415  }
416 
417  /* fix all the animation data which may link to this */
418  BKE_animdata_fix_paths_rename_all(NULL, "constraints", oldname, con->name);
419 }
420 
421 static char *rna_Constraint_do_compute_path(Object *ob, bConstraint *con)
422 {
423  bPoseChannel *pchan;
425 
426  if (lb == NULL) {
427  printf("%s: internal error, constraint '%s' not found in object '%s'\n",
428  __func__,
429  con->name,
430  ob->id.name);
431  }
432 
433  if (pchan) {
434  char name_esc_pchan[sizeof(pchan->name) * 2];
435  char name_esc_const[sizeof(con->name) * 2];
436  BLI_str_escape(name_esc_pchan, pchan->name, sizeof(name_esc_pchan));
437  BLI_str_escape(name_esc_const, con->name, sizeof(name_esc_const));
438  return BLI_sprintfN("pose.bones[\"%s\"].constraints[\"%s\"]", name_esc_pchan, name_esc_const);
439  }
440  else {
441  char name_esc_const[sizeof(con->name) * 2];
442  BLI_str_escape(name_esc_const, con->name, sizeof(name_esc_const));
443  return BLI_sprintfN("constraints[\"%s\"]", name_esc_const);
444  }
445 }
446 
447 static char *rna_Constraint_path(PointerRNA *ptr)
448 {
449  Object *ob = (Object *)ptr->owner_id;
450  bConstraint *con = ptr->data;
451 
452  return rna_Constraint_do_compute_path(ob, con);
453 }
454 
455 static bConstraint *rna_constraint_from_target(PointerRNA *ptr)
456 {
457  Object *ob = (Object *)ptr->owner_id;
458  bConstraintTarget *tgt = ptr->data;
459 
460  return BKE_constraint_find_from_target(ob, tgt, NULL);
461 }
462 
463 static char *rna_ConstraintTarget_path(PointerRNA *ptr)
464 {
465  Object *ob = (Object *)ptr->owner_id;
466  bConstraintTarget *tgt = ptr->data;
467  bConstraint *con = rna_constraint_from_target(ptr);
468  int index = -1;
469 
470  if (con != NULL) {
471  if (con->type == CONSTRAINT_TYPE_ARMATURE) {
472  bArmatureConstraint *acon = con->data;
473  index = BLI_findindex(&acon->targets, tgt);
474  }
475  else if (con->type == CONSTRAINT_TYPE_PYTHON) {
476  bPythonConstraint *pcon = con->data;
477  index = BLI_findindex(&pcon->targets, tgt);
478  }
479  }
480 
481  if (index >= 0) {
482  char *con_path = rna_Constraint_do_compute_path(ob, con);
483  char *result = BLI_sprintfN("%s.targets[%d]", con_path, index);
484 
485  MEM_freeN(con_path);
486  return result;
487  }
488  else {
489  printf("%s: internal error, constraint '%s' of object '%s' does not contain the target\n",
490  __func__,
491  con->name,
492  ob->id.name);
493  }
494 
495  return NULL;
496 }
497 
498 static void rna_Constraint_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
499 {
501 }
502 
503 static void rna_Constraint_dependency_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
504 {
506 }
507 
508 static void rna_ConstraintTarget_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
509 {
510  ED_object_constraint_tag_update(bmain, (Object *)ptr->owner_id, rna_constraint_from_target(ptr));
511 }
512 
513 static void rna_ConstraintTarget_dependency_update(Main *bmain,
514  Scene *UNUSED(scene),
515  PointerRNA *ptr)
516 {
518  bmain, (Object *)ptr->owner_id, rna_constraint_from_target(ptr));
519 }
520 
521 static void rna_Constraint_influence_update(Main *bmain, Scene *scene, PointerRNA *ptr)
522 {
523  Object *ob = (Object *)ptr->owner_id;
524 
525  if (ob->pose) {
526  ob->pose->flag |= (POSE_LOCKED | POSE_DO_UNLOCK);
527  }
528 
529  rna_Constraint_update(bmain, scene, ptr);
530 }
531 
532 /* Update only needed so this isn't overwritten on first evaluation. */
533 static void rna_Constraint_childof_inverse_matrix_update(Main *bmain,
534  Scene *scene,
535  PointerRNA *ptr)
536 {
537  bConstraint *con = ptr->data;
538  bChildOfConstraint *data = con->data;
539  data->flag &= ~CHILDOF_SET_INVERSE;
540  rna_Constraint_update(bmain, scene, ptr);
541 }
542 
543 static void rna_Constraint_ik_type_set(struct PointerRNA *ptr, int value)
544 {
545  bConstraint *con = ptr->data;
546  bKinematicConstraint *ikdata = con->data;
547 
548  if (ikdata->type != value) {
549  /* the type of IK constraint has changed, set suitable default values */
550  /* in case constraints reuse same fields incompatible */
551  switch (value) {
553  break;
555  break;
556  }
557  ikdata->type = value;
558  }
559 }
560 
561 /* DEPRECATED: use_offset replaced with mix_mode */
562 static bool rna_Constraint_RotLike_use_offset_get(struct PointerRNA *ptr)
563 {
564  bConstraint *con = ptr->data;
565  bRotateLikeConstraint *rotlike = con->data;
566  return rotlike->mix_mode != ROTLIKE_MIX_REPLACE;
567 }
568 
569 static void rna_Constraint_RotLike_use_offset_set(struct PointerRNA *ptr, bool value)
570 {
571  bConstraint *con = ptr->data;
572  bRotateLikeConstraint *rotlike = con->data;
573  bool curval = (rotlike->mix_mode != ROTLIKE_MIX_REPLACE);
574  if (curval != value) {
575  rotlike->mix_mode = (value ? ROTLIKE_MIX_OFFSET : ROTLIKE_MIX_REPLACE);
576  }
577 }
578 
579 static const EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext *UNUSED(C),
580  PointerRNA *ptr,
581  PropertyRNA *UNUSED(prop),
582  bool *UNUSED(r_free))
583 {
584  Object *ob = (Object *)ptr->owner_id;
585  bConstraint *con = (bConstraint *)ptr->data;
586 
587  if (BLI_findindex(&ob->constraints, con) == -1) {
589  }
590  else {
591  /* object */
592  return space_object_items;
593  }
594 }
595 
596 static const EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *UNUSED(C),
597  PointerRNA *ptr,
598  PropertyRNA *UNUSED(prop),
599  bool *UNUSED(r_free))
600 {
601  bConstraint *con = (bConstraint *)ptr->data;
603  ListBase targets = {NULL, NULL};
604  bConstraintTarget *ct;
605 
606  if (cti && cti->get_constraint_targets) {
607  cti->get_constraint_targets(con, &targets);
608 
609  for (ct = targets.first; ct; ct = ct->next) {
610  if (ct->tar && ct->tar->type == OB_ARMATURE) {
611  break;
612  }
613  }
614 
615  if (cti->flush_constraint_targets) {
616  cti->flush_constraint_targets(con, &targets, 1);
617  }
618 
619  if (ct) {
621  }
622  }
623 
624  return space_object_items;
625 }
626 
627 static bConstraintTarget *rna_ArmatureConstraint_target_new(ID *id, bConstraint *con, Main *bmain)
628 {
629  bArmatureConstraint *acon = con->data;
630  bConstraintTarget *tgt = MEM_callocN(sizeof(bConstraintTarget), "Constraint Target");
631 
632  tgt->weight = 1.0f;
633  BLI_addtail(&acon->targets, tgt);
634 
636  return tgt;
637 }
638 
639 static void rna_ArmatureConstraint_target_remove(
640  ID *id, bConstraint *con, Main *bmain, ReportList *reports, PointerRNA *target_ptr)
641 {
642  bArmatureConstraint *acon = con->data;
643  bConstraintTarget *tgt = target_ptr->data;
644 
645  if (BLI_findindex(&acon->targets, tgt) < 0) {
646  BKE_report(reports, RPT_ERROR, "Target is not in the constraint target list");
647  return;
648  }
649 
650  BLI_freelinkN(&acon->targets, tgt);
651 
653 }
654 
655 static void rna_ArmatureConstraint_target_clear(ID *id, bConstraint *con, Main *bmain)
656 {
657  bArmatureConstraint *acon = con->data;
658 
659  BLI_freelistN(&acon->targets);
660 
662 }
663 
664 static void rna_ActionConstraint_mix_mode_set(PointerRNA *ptr, int value)
665 {
666  bConstraint *con = (bConstraint *)ptr->data;
667  bActionConstraint *acon = (bActionConstraint *)con->data;
668 
669  acon->mix_mode = value;
670 
671  /* The After mode can be computed in world space for efficiency
672  * and backward compatibility, while Before requires Local. */
675  }
676  else {
678  }
679 }
680 
681 static void rna_ActionConstraint_minmax_range(
682  PointerRNA *ptr, float *min, float *max, float *UNUSED(softmin), float *UNUSED(softmax))
683 {
684  bConstraint *con = (bConstraint *)ptr->data;
685  bActionConstraint *acon = (bActionConstraint *)con->data;
686 
687  /* 0, 1, 2 = magic numbers for rotX, rotY, rotZ */
688  if (ELEM(acon->type, 0, 1, 2)) {
689  *min = -180.0f;
690  *max = 180.0f;
691  }
692  else {
693  *min = -1000.0f;
694  *max = 1000.0f;
695  }
696 }
697 
698 static int rna_SplineIKConstraint_joint_bindings_get_length(PointerRNA *ptr,
700 {
701  bConstraint *con = (bConstraint *)ptr->data;
702  bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data;
703 
704  if (ikData) {
705  length[0] = ikData->numpoints;
706  }
707  else {
708  length[0] = 0;
709  }
710 
711  return length[0];
712 }
713 
714 static void rna_SplineIKConstraint_joint_bindings_get(PointerRNA *ptr, float *values)
715 {
716  bConstraint *con = (bConstraint *)ptr->data;
717  bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data;
718 
719  memcpy(values, ikData->points, ikData->numpoints * sizeof(float));
720 }
721 
722 static void rna_SplineIKConstraint_joint_bindings_set(PointerRNA *ptr, const float *values)
723 {
724  bConstraint *con = (bConstraint *)ptr->data;
725  bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data;
726 
727  memcpy(ikData->points, values, ikData->numpoints * sizeof(float));
728 }
729 
730 static int rna_ShrinkwrapConstraint_face_cull_get(PointerRNA *ptr)
731 {
732  bConstraint *con = (bConstraint *)ptr->data;
734  return swc->flag & CON_SHRINKWRAP_PROJECT_CULL_MASK;
735 }
736 
737 static void rna_ShrinkwrapConstraint_face_cull_set(struct PointerRNA *ptr, int value)
738 {
739  bConstraint *con = (bConstraint *)ptr->data;
741  swc->flag = (swc->flag & ~CON_SHRINKWRAP_PROJECT_CULL_MASK) | value;
742 }
743 
744 static bool rna_Constraint_cameraObject_poll(PointerRNA *ptr, PointerRNA value)
745 {
746  Object *ob = (Object *)value.data;
747 
748  if (ob) {
749  if (ob->type == OB_CAMERA && ob != (Object *)ptr->owner_id) {
750  return 1;
751  }
752  }
753 
754  return 0;
755 }
756 
757 static void rna_Constraint_followTrack_camera_set(PointerRNA *ptr,
758  PointerRNA value,
759  struct ReportList *UNUSED(reports))
760 {
761  bConstraint *con = (bConstraint *)ptr->data;
763  Object *ob = (Object *)value.data;
764 
765  if (ob) {
766  if (ob->type == OB_CAMERA && ob != (Object *)ptr->owner_id) {
767  data->camera = ob;
768  id_lib_extern((ID *)ob);
769  }
770  }
771  else {
772  data->camera = NULL;
773  }
774 }
775 
776 static void rna_Constraint_followTrack_depthObject_set(PointerRNA *ptr,
777  PointerRNA value,
778  struct ReportList *UNUSED(reports))
779 {
780  bConstraint *con = (bConstraint *)ptr->data;
782  Object *ob = (Object *)value.data;
783 
784  if (ob) {
785  if (ob->type == OB_MESH && ob != (Object *)ptr->owner_id) {
786  data->depth_ob = ob;
787  id_lib_extern((ID *)ob);
788  }
789  }
790  else {
791  data->depth_ob = NULL;
792  }
793 }
794 
795 static bool rna_Constraint_followTrack_depthObject_poll(PointerRNA *ptr, PointerRNA value)
796 {
797  Object *ob = (Object *)value.data;
798 
799  if (ob) {
800  if (ob->type == OB_MESH && ob != (Object *)ptr->owner_id) {
801  return 1;
802  }
803  }
804 
805  return 0;
806 }
807 
808 static void rna_Constraint_objectSolver_camera_set(PointerRNA *ptr,
809  PointerRNA value,
810  struct ReportList *UNUSED(reports))
811 {
812  bConstraint *con = (bConstraint *)ptr->data;
814  Object *ob = (Object *)value.data;
815 
816  if (ob) {
817  if (ob->type == OB_CAMERA && ob != (Object *)ptr->owner_id) {
818  data->camera = ob;
819  id_lib_extern((ID *)ob);
820  }
821  }
822  else {
823  data->camera = NULL;
824  }
825 }
826 
827 #else
828 
831  "LIMITDIST_INSIDE",
832  0,
833  "Inside",
834  "The object is constrained inside a virtual sphere around the target object, "
835  "with a radius defined by the limit distance"},
837  "LIMITDIST_OUTSIDE",
838  0,
839  "Outside",
840  "The object is constrained outside a virtual sphere around the target object, "
841  "with a radius defined by the limit distance"},
843  "LIMITDIST_ONSURFACE",
844  0,
845  "On Surface",
846  "The object is constrained on the surface of a virtual sphere around the target object, "
847  "with a radius defined by the limit distance"},
848  {0, NULL, 0, NULL, NULL},
849 };
850 
852 {
853  PropertyRNA *prop;
854 
856 
857  prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
858  RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
859  RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head is 0, Tail is 1");
860  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
861 
862  prop = RNA_def_property(srna, "use_bbone_shape", PROP_BOOLEAN, PROP_NONE);
863  RNA_def_property_boolean_sdna(prop, "bConstraint", "flag", CONSTRAINT_BBONE_SHAPE);
865  "Follow B-Bone",
866  "Follow shape of B-Bone segments when calculating Head/Tail position");
867  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
868 
870 }
871 
873 {
874  PropertyRNA *prop;
875 
877 
878  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
879  RNA_def_property_pointer_sdna(prop, NULL, "tar");
880  RNA_def_property_ui_text(prop, "Target", "Target object");
882  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
883 
884  prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
885  RNA_def_property_string_sdna(prop, NULL, "subtarget");
886  RNA_def_property_ui_text(prop, "Sub-Target", "Armature bone, mesh or lattice vertex group, ...");
887  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
888 
890 }
891 
893 {
894  StructRNA *srna;
895  PropertyRNA *prop;
896 
897  srna = RNA_def_struct(brna, "ConstraintTarget", NULL);
898  RNA_def_struct_ui_text(srna, "Constraint Target", "Target object for multi-target constraints");
899  RNA_def_struct_path_func(srna, "rna_ConstraintTarget_path");
900  RNA_def_struct_sdna(srna, "bConstraintTarget");
901 
903 
904  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
905  RNA_def_property_pointer_sdna(prop, NULL, "tar");
906  RNA_def_property_ui_text(prop, "Target", "Target object");
909  prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_dependency_update");
910 
911  prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
912  RNA_def_property_string_sdna(prop, NULL, "subtarget");
913  RNA_def_property_ui_text(prop, "Sub-Target", "Armature bone, mesh or lattice vertex group, ...");
915  prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_dependency_update");
916 
917  /* space, flag and type still to do */
918 
920 }
921 
923 {
924  StructRNA *srna;
925  PropertyRNA *prop;
926 
927  srna = RNA_def_struct(brna, "ConstraintTargetBone", NULL);
929  srna, "Constraint Target Bone", "Target bone for multi-target constraints");
930  RNA_def_struct_path_func(srna, "rna_ConstraintTarget_path");
931  RNA_def_struct_sdna(srna, "bConstraintTarget");
932 
934 
935  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
936  RNA_def_property_pointer_sdna(prop, NULL, "tar");
937  RNA_def_property_ui_text(prop, "Target", "Target armature");
939  prop, NULL, "rna_ConstraintTargetBone_target_set", NULL, "rna_Armature_object_poll");
942  prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_dependency_update");
943 
944  prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
945  RNA_def_property_string_sdna(prop, NULL, "subtarget");
946  RNA_def_property_ui_text(prop, "Sub-Target", "Target armature bone");
948  prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_dependency_update");
949 
950  prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
951  RNA_def_property_float_sdna(prop, NULL, "weight");
952  RNA_def_property_range(prop, 0.0f, 1.0f);
953  RNA_def_property_ui_text(prop, "Blend Weight", "Blending weight of this bone");
954  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_update");
955 
957 }
958 
960 {
961  StructRNA *srna;
962  PropertyRNA *prop;
963 
964  srna = RNA_def_struct(brna, "ChildOfConstraint", "Constraint");
966  srna, "Child Of Constraint", "Create constraint-based parent-child relationship");
967  RNA_def_struct_sdna_from(srna, "bChildOfConstraint", "data");
968  RNA_def_struct_ui_icon(srna, ICON_CON_CHILDOF);
969 
971 
973 
974  prop = RNA_def_property(srna, "use_location_x", PROP_BOOLEAN, PROP_NONE);
976  RNA_def_property_ui_text(prop, "Location X", "Use X Location of Parent");
977  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
978 
979  prop = RNA_def_property(srna, "use_location_y", PROP_BOOLEAN, PROP_NONE);
981  RNA_def_property_ui_text(prop, "Location Y", "Use Y Location of Parent");
982  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
983 
984  prop = RNA_def_property(srna, "use_location_z", PROP_BOOLEAN, PROP_NONE);
986  RNA_def_property_ui_text(prop, "Location Z", "Use Z Location of Parent");
987  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
988 
989  prop = RNA_def_property(srna, "use_rotation_x", PROP_BOOLEAN, PROP_NONE);
991  RNA_def_property_ui_text(prop, "Rotation X", "Use X Rotation of Parent");
992  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
993 
994  prop = RNA_def_property(srna, "use_rotation_y", PROP_BOOLEAN, PROP_NONE);
996  RNA_def_property_ui_text(prop, "Rotation Y", "Use Y Rotation of Parent");
997  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
998 
999  prop = RNA_def_property(srna, "use_rotation_z", PROP_BOOLEAN, PROP_NONE);
1001  RNA_def_property_ui_text(prop, "Rotation Z", "Use Z Rotation of Parent");
1002  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1003 
1004  prop = RNA_def_property(srna, "use_scale_x", PROP_BOOLEAN, PROP_NONE);
1006  RNA_def_property_ui_text(prop, "Scale X", "Use X Scale of Parent");
1007  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1008 
1009  prop = RNA_def_property(srna, "use_scale_y", PROP_BOOLEAN, PROP_NONE);
1011  RNA_def_property_ui_text(prop, "Scale Y", "Use Y Scale of Parent");
1012  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1013 
1014  prop = RNA_def_property(srna, "use_scale_z", PROP_BOOLEAN, PROP_NONE);
1016  RNA_def_property_ui_text(prop, "Scale Z", "Use Z Scale of Parent");
1017  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1018 
1019  prop = RNA_def_property(srna, "set_inverse_pending", PROP_BOOLEAN, PROP_NONE);
1022  prop, "Set Inverse Pending", "Set to true to request recalculation of the inverse matrix");
1023  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1024 
1025  prop = RNA_def_property(srna, "inverse_matrix", PROP_FLOAT, PROP_MATRIX);
1026  RNA_def_property_float_sdna(prop, NULL, "invmat");
1029  RNA_def_property_ui_text(prop, "Inverse Matrix", "Transformation matrix to apply before");
1031  prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_childof_inverse_matrix_update");
1032 
1034 }
1035 
1037 {
1038  StructRNA *srna;
1039  PropertyRNA *prop;
1040 
1041  srna = RNA_def_struct(brna, "PythonConstraint", "Constraint");
1042  RNA_def_struct_ui_text(srna, "Python Constraint", "Use Python script for constraint evaluation");
1043  RNA_def_struct_sdna_from(srna, "bPythonConstraint", "data");
1044 
1046 
1047  prop = RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
1048  RNA_def_property_collection_sdna(prop, NULL, "targets", NULL);
1049  RNA_def_property_struct_type(prop, "ConstraintTarget");
1050  RNA_def_property_ui_text(prop, "Targets", "Target Objects");
1051 
1052  prop = RNA_def_property(srna, "target_count", PROP_INT, PROP_NONE);
1053  RNA_def_property_int_sdna(prop, NULL, "tarnum");
1054  RNA_def_property_ui_text(prop, "Number of Targets", "Usually only 1 to 3 are needed");
1055  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1056 
1057  prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
1058  RNA_def_property_ui_text(prop, "Script", "The text object that contains the Python script");
1060  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1061 
1062  prop = RNA_def_property(srna, "use_targets", PROP_BOOLEAN, PROP_NONE);
1065  prop, "Use Targets", "Use the targets indicated in the constraint panel");
1066  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1067 
1068  prop = RNA_def_property(srna, "has_script_error", PROP_BOOLEAN, PROP_NONE);
1071  RNA_def_property_ui_text(prop, "Script Error", "The linked Python script has thrown an error");
1072 
1074 }
1075 
1077 {
1078  StructRNA *srna;
1079  FunctionRNA *func;
1080  PropertyRNA *parm;
1081 
1082  RNA_def_property_srna(cprop, "ArmatureConstraintTargets");
1083  srna = RNA_def_struct(brna, "ArmatureConstraintTargets", NULL);
1084  RNA_def_struct_sdna(srna, "bConstraint");
1086  srna, "Armature Deform Constraint Targets", "Collection of target bones and weights");
1087  RNA_def_struct_ui_icon(srna, ICON_CON_ARMATURE);
1088 
1089  func = RNA_def_function(srna, "new", "rna_ArmatureConstraint_target_new");
1091  RNA_def_function_ui_description(func, "Add a new target to the constraint");
1092  parm = RNA_def_pointer(func, "target", "ConstraintTargetBone", "", "New target bone");
1093  RNA_def_function_return(func, parm);
1094 
1095  func = RNA_def_function(srna, "remove", "rna_ArmatureConstraint_target_remove");
1097  RNA_def_function_ui_description(func, "Delete target from the constraint");
1098  parm = RNA_def_pointer(func, "target", "ConstraintTargetBone", "", "Target to remove");
1101 
1102  func = RNA_def_function(srna, "clear", "rna_ArmatureConstraint_target_clear");
1104  RNA_def_function_ui_description(func, "Delete all targets from object");
1105 }
1106 
1108 {
1109  StructRNA *srna;
1110  PropertyRNA *prop;
1111 
1112  srna = RNA_def_struct(brna, "ArmatureConstraint", "Constraint");
1114  srna, "Armature Constraint", "Applies transformations done by the Armature modifier");
1115  RNA_def_struct_sdna_from(srna, "bArmatureConstraint", "data");
1116  RNA_def_struct_ui_icon(srna, ICON_CON_ARMATURE);
1117 
1119 
1120  prop = RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
1121  RNA_def_property_collection_sdna(prop, NULL, "targets", NULL);
1122  RNA_def_property_struct_type(prop, "ConstraintTargetBone");
1123  RNA_def_property_ui_text(prop, "Targets", "Target Bones");
1125 
1126  prop = RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE);
1129  prop, "Preserve Volume", "Deform rotation interpolation with quaternions");
1130  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1131 
1132  prop = RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE);
1135  prop,
1136  "Use Envelopes",
1137  "Multiply weights by envelope for all bones, instead of acting like Vertex Group based "
1138  "blending. "
1139  "The specified weights are still used, and only the listed bones are considered");
1140  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1141 
1142  prop = RNA_def_property(srna, "use_current_location", PROP_BOOLEAN, PROP_NONE);
1145  "Use Current Location",
1146  "Use the current bone location for envelopes and choosing B-Bone "
1147  "segments instead of rest position");
1148  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1149 
1151 }
1152 
1154 {
1155  StructRNA *srna;
1156  PropertyRNA *prop;
1157 
1158  static const EnumPropertyItem constraint_ik_axisref_items[] = {
1159  {0, "BONE", 0, "Bone", ""},
1160  {CONSTRAINT_IK_TARGETAXIS, "TARGET", 0, "Target", ""},
1161  {0, NULL, 0, NULL, NULL},
1162  };
1163 
1164  static const EnumPropertyItem constraint_ik_type_items[] = {
1165  {CONSTRAINT_IK_COPYPOSE, "COPY_POSE", 0, "Copy Pose", ""},
1166  {CONSTRAINT_IK_DISTANCE, "DISTANCE", 0, "Distance", ""},
1167  {0, NULL, 0, NULL, NULL},
1168  };
1169 
1170  srna = RNA_def_struct(brna, "KinematicConstraint", "Constraint");
1171  RNA_def_struct_ui_text(srna, "Kinematic Constraint", "Inverse Kinematics");
1172  RNA_def_struct_sdna_from(srna, "bKinematicConstraint", "data");
1173  RNA_def_struct_ui_icon(srna, ICON_CON_KINEMATIC);
1174 
1176 
1178 
1179  prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
1180  RNA_def_property_range(prop, 0, 10000);
1181  RNA_def_property_ui_text(prop, "Iterations", "Maximum number of solving iterations");
1182  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1183 
1184  prop = RNA_def_property(srna, "pole_target", PROP_POINTER, PROP_NONE);
1185  RNA_def_property_pointer_sdna(prop, NULL, "poletar");
1186  RNA_def_property_ui_text(prop, "Pole Target", "Object for pole rotation");
1188  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1189 
1190  prop = RNA_def_property(srna, "pole_subtarget", PROP_STRING, PROP_NONE);
1191  RNA_def_property_string_sdna(prop, NULL, "polesubtarget");
1192  RNA_def_property_ui_text(prop, "Pole Sub-Target", "");
1193  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1194 
1195  prop = RNA_def_property(srna, "pole_angle", PROP_FLOAT, PROP_ANGLE);
1196  RNA_def_property_float_sdna(prop, NULL, "poleangle");
1197  RNA_def_property_range(prop, -M_PI, M_PI);
1198  RNA_def_property_ui_range(prop, -M_PI, M_PI, 10, 4);
1199  RNA_def_property_ui_text(prop, "Pole Angle", "Pole rotation offset");
1200  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1201 
1202  prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
1203  RNA_def_property_range(prop, 0.01, 1.0f);
1205  prop, "Weight", "For Tree-IK: Weight of position control for this target");
1206 
1207  prop = RNA_def_property(srna, "orient_weight", PROP_FLOAT, PROP_NONE);
1208  RNA_def_property_float_sdna(prop, NULL, "orientweight");
1209  RNA_def_property_range(prop, 0.01, 1.0f);
1211  prop, "Orientation Weight", "For Tree-IK: Weight of orientation control for this target");
1212  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1213 
1214  prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE);
1215  RNA_def_property_int_sdna(prop, NULL, "rootbone");
1216  RNA_def_property_range(prop, 0, 255);
1218  prop, "Chain Length", "How many bones are included in the IK effect - 0 uses all bones");
1219  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1220 
1221  prop = RNA_def_property(srna, "use_tail", PROP_BOOLEAN, PROP_NONE);
1223  RNA_def_property_ui_text(prop, "Use Tail", "Include bone's tail as last element in chain");
1224  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1225 
1226  prop = RNA_def_property(srna, "reference_axis", PROP_ENUM, PROP_NONE);
1228  RNA_def_property_enum_items(prop, constraint_ik_axisref_items);
1230  prop, "Axis Reference", "Constraint axis Lock options relative to Bone or Target reference");
1231  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1232 
1233  prop = RNA_def_property(srna, "use_location", PROP_BOOLEAN, PROP_NONE);
1235  RNA_def_property_ui_text(prop, "Position", "Chain follows position of target");
1236  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1237 
1238  prop = RNA_def_property(srna, "lock_location_x", PROP_BOOLEAN, PROP_NONE);
1240  RNA_def_property_ui_text(prop, "Lock X Pos", "Constraint position along X axis");
1241  RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1242 
1243  prop = RNA_def_property(srna, "lock_location_y", PROP_BOOLEAN, PROP_NONE);
1245  RNA_def_property_ui_text(prop, "Lock Y Pos", "Constraint position along Y axis");
1246  RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1247 
1248  prop = RNA_def_property(srna, "lock_location_z", PROP_BOOLEAN, PROP_NONE);
1250  RNA_def_property_ui_text(prop, "Lock Z Pos", "Constraint position along Z axis");
1251  RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1252 
1253  prop = RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE);
1255  RNA_def_property_ui_text(prop, "Rotation", "Chain follows rotation of target");
1256  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1257 
1258  prop = RNA_def_property(srna, "lock_rotation_x", PROP_BOOLEAN, PROP_NONE);
1260  RNA_def_property_ui_text(prop, "Lock X Rotation", "Constraint rotation along X axis");
1261  RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1262 
1263  prop = RNA_def_property(srna, "lock_rotation_y", PROP_BOOLEAN, PROP_NONE);
1265  RNA_def_property_ui_text(prop, "Lock Y Rotation", "Constraint rotation along Y axis");
1266  RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1267 
1268  prop = RNA_def_property(srna, "lock_rotation_z", PROP_BOOLEAN, PROP_NONE);
1270  RNA_def_property_ui_text(prop, "Lock Z Rotation", "Constraint rotation along Z axis");
1271  RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1272 
1273  prop = RNA_def_property(srna, "use_stretch", PROP_BOOLEAN, PROP_NONE);
1275  RNA_def_property_ui_text(prop, "Stretch", "Enable IK Stretching");
1276  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1277 
1278  prop = RNA_def_property(srna, "ik_type", PROP_ENUM, PROP_NONE);
1279  RNA_def_property_enum_sdna(prop, NULL, "type");
1280  RNA_def_property_enum_funcs(prop, NULL, "rna_Constraint_ik_type_set", NULL);
1281  RNA_def_property_enum_items(prop, constraint_ik_type_items);
1282  RNA_def_property_ui_text(prop, "IK Type", "");
1283  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1284 
1285  prop = RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE);
1286  RNA_def_property_enum_sdna(prop, NULL, "mode");
1289  prop, "Limit Mode", "Distances in relation to sphere of influence to allow");
1290  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1291 
1292  prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
1293  RNA_def_property_float_sdna(prop, NULL, "dist");
1294  RNA_def_property_range(prop, 0.0, 100.0f);
1295  RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere");
1296  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1297 
1299 }
1300 
1302 {
1303  StructRNA *srna;
1304  PropertyRNA *prop;
1305 
1306  static const EnumPropertyItem up_items[] = {
1307  {TRACK_X, "UP_X", 0, "X", ""},
1308  {TRACK_Y, "UP_Y", 0, "Y", ""},
1309  {TRACK_Z, "UP_Z", 0, "Z", ""},
1310  {0, NULL, 0, NULL, NULL},
1311  };
1312 
1313  srna = RNA_def_struct(brna, "TrackToConstraint", "Constraint");
1315  srna, "Track To Constraint", "Aim the constrained object toward the target");
1316 
1318 
1319  RNA_def_struct_sdna_from(srna, "bTrackToConstraint", "data");
1320 
1322 
1323  RNA_def_struct_ui_icon(srna, ICON_CON_TRACKTO);
1324 
1326 
1327  prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
1328  RNA_def_property_enum_sdna(prop, NULL, "reserved1");
1330  RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object");
1331  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1332 
1333  prop = RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
1334  RNA_def_property_enum_sdna(prop, NULL, "reserved2");
1335  RNA_def_property_enum_items(prop, up_items);
1336  RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward");
1337  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1338 
1339  prop = RNA_def_property(srna, "use_target_z", PROP_BOOLEAN, PROP_NONE);
1342  prop, "Target Z", "Target's Z axis, not World Z axis, will constraint the Up direction");
1343  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1344 
1346 }
1347 
1349 {
1350  StructRNA *srna;
1351  PropertyRNA *prop;
1352 
1353  srna = RNA_def_struct(brna, "CopyLocationConstraint", "Constraint");
1354  RNA_def_struct_ui_text(srna, "Copy Location Constraint", "Copy the location of the target");
1355  RNA_def_struct_ui_icon(srna, ICON_CON_LOCLIKE);
1356 
1358 
1359  RNA_def_struct_sdna_from(srna, "bLocateLikeConstraint", "data");
1360 
1362 
1364 
1365  prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
1367  RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X location");
1368  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1369 
1370  prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
1372  RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y location");
1373  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1374 
1375  prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
1377  RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z location");
1378  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1379 
1380  prop = RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE);
1382  RNA_def_property_ui_text(prop, "Invert X", "Invert the X location");
1383  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1384 
1385  prop = RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE);
1387  RNA_def_property_ui_text(prop, "Invert Y", "Invert the Y location");
1388  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1389 
1390  prop = RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
1392  RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z location");
1393  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1394 
1395  prop = RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
1397  RNA_def_property_ui_text(prop, "Offset", "Add original location into copied location");
1398  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1399 
1401 }
1402 
1404 {
1405  StructRNA *srna;
1406  PropertyRNA *prop;
1407 
1408  static const EnumPropertyItem mix_mode_items[] = {
1409  {ROTLIKE_MIX_REPLACE, "REPLACE", 0, "Replace", "Replace the original rotation with copied"},
1410  {ROTLIKE_MIX_ADD, "ADD", 0, "Add", "Add euler component values together"},
1412  "BEFORE",
1413  0,
1414  "Before Original",
1415  "Apply copied rotation before original, as if the constraint target is a parent"},
1417  "AFTER",
1418  0,
1419  "After Original",
1420  "Apply copied rotation after original, as if the constraint target is a child"},
1422  "OFFSET",
1423  0,
1424  "Offset (Legacy)",
1425  "Combine rotations like the original Offset checkbox. Does not work well for "
1426  "multiple axis rotations"},
1427  {0, NULL, 0, NULL, NULL},
1428  };
1429 
1430  srna = RNA_def_struct(brna, "CopyRotationConstraint", "Constraint");
1431  RNA_def_struct_ui_text(srna, "Copy Rotation Constraint", "Copy the rotation of the target");
1432  RNA_def_struct_sdna_from(srna, "bRotateLikeConstraint", "data");
1433  RNA_def_struct_ui_icon(srna, ICON_CON_ROTLIKE);
1434 
1436 
1438 
1439  prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
1441  RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X rotation");
1442  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1443 
1444  prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
1446  RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y rotation");
1447  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1448 
1449  prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
1451  RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z rotation");
1452  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1453 
1454  prop = RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE);
1456  RNA_def_property_ui_text(prop, "Invert X", "Invert the X rotation");
1457  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1458 
1459  prop = RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE);
1461  RNA_def_property_ui_text(prop, "Invert Y", "Invert the Y rotation");
1462  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1463 
1464  prop = RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
1466  RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z rotation");
1467  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1468 
1469  prop = RNA_def_property(srna, "euler_order", PROP_ENUM, PROP_NONE);
1470  RNA_def_property_enum_sdna(prop, NULL, "euler_order");
1472  RNA_def_property_ui_text(prop, "Euler Order", "Explicitly specify the euler rotation order");
1473  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1474 
1475  prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
1476  RNA_def_property_enum_sdna(prop, NULL, "mix_mode");
1477  RNA_def_property_enum_items(prop, mix_mode_items);
1479  prop, "Mix Mode", "Specify how the copied and existing rotations are combined");
1480  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1481 
1482  /* DEPRECATED: replaced with mix_mode */
1483  prop = RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
1485  prop, "rna_Constraint_RotLike_use_offset_get", "rna_Constraint_RotLike_use_offset_set");
1487  prop, "Offset", "DEPRECATED: Add original rotation into copied rotation");
1488  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1489 
1491 }
1492 
1494 {
1495  StructRNA *srna;
1496  PropertyRNA *prop;
1497 
1498  srna = RNA_def_struct(brna, "CopyScaleConstraint", "Constraint");
1499  RNA_def_struct_ui_text(srna, "Copy Scale Constraint", "Copy the scale of the target");
1500  RNA_def_struct_sdna_from(srna, "bSizeLikeConstraint", "data");
1501  RNA_def_struct_ui_icon(srna, ICON_CON_SIZELIKE);
1502 
1504 
1506 
1507  prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
1509  RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X scale");
1510  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1511 
1512  prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
1514  RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y scale");
1515  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1516 
1517  prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
1519  RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z scale");
1520  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1521 
1522  prop = RNA_def_property(srna, "power", PROP_FLOAT, PROP_NONE);
1523  RNA_def_property_float_sdna(prop, NULL, "power");
1524  RNA_def_property_float_default(prop, 1.0f);
1525  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 3);
1526  RNA_def_property_ui_text(prop, "Power", "Raise the target's scale to the specified power");
1527  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1528 
1529  prop = RNA_def_property(srna, "use_make_uniform", PROP_BOOLEAN, PROP_NONE);
1532  "Make Uniform",
1533  "Redistribute the copied change in volume equally "
1534  "between the three axes of the owner");
1535  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1536 
1537  prop = RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
1539  RNA_def_property_ui_text(prop, "Offset", "Combine original scale with copied scale");
1540  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1541 
1542  prop = RNA_def_property(srna, "use_add", PROP_BOOLEAN, PROP_NONE);
1545  prop,
1546  "Additive",
1547  "Use addition instead of multiplication to combine scale (2.7 compatibility)");
1548  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1549 
1551 }
1552 
1554 {
1555  StructRNA *srna;
1556  PropertyRNA *prop;
1557 
1558  static const EnumPropertyItem axis_items[] = {
1559  {SAMEVOL_X, "SAMEVOL_X", 0, "X", ""},
1560  {SAMEVOL_Y, "SAMEVOL_Y", 0, "Y", ""},
1561  {SAMEVOL_Z, "SAMEVOL_Z", 0, "Z", ""},
1562  {0, NULL, 0, NULL, NULL},
1563  };
1564 
1565  static const EnumPropertyItem mode_items[] = {
1566  {SAMEVOL_STRICT,
1567  "STRICT",
1568  0,
1569  "Strict",
1570  "Volume is strictly preserved, overriding the scaling of non-free axes"},
1571  {SAMEVOL_UNIFORM,
1572  "UNIFORM",
1573  0,
1574  "Uniform",
1575  "Volume is preserved when the object is scaled uniformly. "
1576  "Deviations from uniform scale on non-free axes are passed through"},
1578  "SINGLE_AXIS",
1579  0,
1580  "Single Axis",
1581  "Volume is preserved when the object is scaled only on the free axis. "
1582  "Non-free axis scaling is passed through"},
1583  {0, NULL, 0, NULL, NULL},
1584  };
1585 
1586  srna = RNA_def_struct(brna, "MaintainVolumeConstraint", "Constraint");
1588  "Maintain Volume Constraint",
1589  "Maintain a constant volume along a single scaling axis");
1590  RNA_def_struct_sdna_from(srna, "bSameVolumeConstraint", "data");
1591  RNA_def_struct_ui_icon(srna, ICON_CON_SAMEVOL);
1592 
1594 
1595  prop = RNA_def_property(srna, "free_axis", PROP_ENUM, PROP_NONE);
1596  RNA_def_property_enum_sdna(prop, NULL, "free_axis");
1597  RNA_def_property_enum_items(prop, axis_items);
1598  RNA_def_property_ui_text(prop, "Free Axis", "The free scaling axis of the object");
1599  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1600 
1601  prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1602  RNA_def_property_enum_sdna(prop, NULL, "mode");
1605  prop, "Mode", "The way the constraint treats original non-free axis scaling");
1606  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1607 
1608  prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_DISTANCE);
1609  RNA_def_property_range(prop, 0.001f, 100.0f);
1610  RNA_def_property_ui_text(prop, "Volume", "Volume of the bone at rest");
1611  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1612 
1614 }
1615 
1617 {
1618  StructRNA *srna;
1619  PropertyRNA *prop;
1620 
1621  static const EnumPropertyItem mix_mode_items[] = {
1623  "REPLACE",
1624  0,
1625  "Replace",
1626  "Replace the original transformation with copied"},
1628  "BEFORE",
1629  0,
1630  "Before Original",
1631  "Apply copied transformation before original, as if the constraint target is a parent. "
1632  "Scale is handled specially to avoid creating shear"},
1634  "AFTER",
1635  0,
1636  "After Original",
1637  "Apply copied transformation after original, as if the constraint target is a child. "
1638  "Scale is handled specially to avoid creating shear"},
1639  {0, NULL, 0, NULL, NULL},
1640  };
1641 
1642  srna = RNA_def_struct(brna, "CopyTransformsConstraint", "Constraint");
1644  srna, "Copy Transforms Constraint", "Copy all the transforms of the target");
1645 
1647 
1648  RNA_def_struct_sdna_from(srna, "bTransLikeConstraint", "data");
1649 
1650  RNA_def_struct_ui_icon(srna, ICON_CON_TRANSLIKE);
1651 
1653 
1655 
1656  prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
1657  RNA_def_property_enum_sdna(prop, NULL, "mix_mode");
1658  RNA_def_property_enum_items(prop, mix_mode_items);
1660  prop, "Mix Mode", "Specify how the copied and existing transformations are combined");
1661  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1662 
1664 }
1665 
1667 {
1668  StructRNA *srna;
1669  PropertyRNA *prop;
1670 
1671  static const EnumPropertyItem minmax_items[] = {
1672  {TRACK_X, "FLOOR_X", 0, "X", ""},
1673  {TRACK_Y, "FLOOR_Y", 0, "Y", ""},
1674  {TRACK_Z, "FLOOR_Z", 0, "Z", ""},
1675  {TRACK_nX, "FLOOR_NEGATIVE_X", 0, "-X", ""},
1676  {TRACK_nY, "FLOOR_NEGATIVE_Y", 0, "-Y", ""},
1677  {TRACK_nZ, "FLOOR_NEGATIVE_Z", 0, "-Z", ""},
1678  {0, NULL, 0, NULL, NULL},
1679  };
1680 
1681  srna = RNA_def_struct(brna, "FloorConstraint", "Constraint");
1683  srna, "Floor Constraint", "Use the target object for location limitation");
1684  RNA_def_struct_sdna_from(srna, "bMinMaxConstraint", "data");
1685  RNA_def_struct_ui_icon(srna, ICON_CON_FLOOR);
1686 
1688 
1690 
1691  prop = RNA_def_property(srna, "floor_location", PROP_ENUM, PROP_NONE);
1692  RNA_def_property_enum_sdna(prop, NULL, "minmaxflag");
1693  RNA_def_property_enum_items(prop, minmax_items);
1695  prop, "Floor Location", "Location of target that object will not pass through");
1696  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1697 
1698  prop = RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE);
1700  RNA_def_property_ui_text(prop, "Use Rotation", "Use the target's rotation to determine floor");
1701  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1702 
1703  prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_DISTANCE);
1704  RNA_def_property_ui_range(prop, -100.0f, 100.0f, 1, -1);
1705  RNA_def_property_ui_text(prop, "Offset", "Offset of floor from object origin");
1706  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1707 
1709 }
1710 
1712 {
1713  StructRNA *srna;
1714  PropertyRNA *prop;
1715 
1716  static const EnumPropertyItem transform_channel_items[] = {
1717  {20, "LOCATION_X", 0, "X Location", ""},
1718  {21, "LOCATION_Y", 0, "Y Location", ""},
1719  {22, "LOCATION_Z", 0, "Z Location", ""},
1720  {00, "ROTATION_X", 0, "X Rotation", ""},
1721  {01, "ROTATION_Y", 0, "Y Rotation", ""},
1722  {02, "ROTATION_Z", 0, "Z Rotation", ""},
1723  {10, "SCALE_X", 0, "X Scale", ""},
1724  {11, "SCALE_Y", 0, "Y Scale", ""},
1725  {12, "SCALE_Z", 0, "Z Scale", ""},
1726  {0, NULL, 0, NULL, NULL},
1727  };
1728 
1729  static const EnumPropertyItem mix_mode_items[] = {
1731  "BEFORE",
1732  0,
1733  "Before Original",
1734  "Apply the action channels before the original transformation, "
1735  "as if applied to an imaginary parent with Aligned Inherit Scale"},
1737  "AFTER",
1738  0,
1739  "After Original",
1740  "Apply the action channels after the original transformation, "
1741  "as if applied to an imaginary child with Aligned Inherit Scale"},
1743  "AFTER_FULL",
1744  0,
1745  "After Original (Full Scale)",
1746  "Apply the action channels after the original transformation, as if "
1747  "applied to an imaginary child with Full Inherit Scale. This mode "
1748  "can create shear and is provided only for backward compatibility"},
1749  {0, NULL, 0, NULL, NULL},
1750  };
1751 
1752  srna = RNA_def_struct(brna, "ActionConstraint", "Constraint");
1754  srna, "Action Constraint", "Map an action to the transform axes of a bone");
1755  RNA_def_struct_sdna_from(srna, "bActionConstraint", "data");
1756  RNA_def_struct_ui_icon(srna, ICON_ACTION);
1757 
1759 
1761 
1762  prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
1763  RNA_def_property_enum_sdna(prop, NULL, "mix_mode");
1764  RNA_def_property_enum_items(prop, mix_mode_items);
1765  RNA_def_property_enum_funcs(prop, NULL, "rna_ActionConstraint_mix_mode_set", NULL);
1767  prop,
1768  "Mix Mode",
1769  "Specify how existing transformations and the action channels are combined");
1770  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1771 
1772  prop = RNA_def_property(srna, "transform_channel", PROP_ENUM, PROP_NONE);
1773  RNA_def_property_enum_sdna(prop, NULL, "type");
1774  RNA_def_property_enum_items(prop, transform_channel_items);
1776  prop,
1777  "Transform Channel",
1778  "Transformation channel from the target that is used to key the Action");
1779  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1780 
1781  prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
1782  RNA_def_property_pointer_sdna(prop, NULL, "act");
1783  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Action_id_poll");
1784  RNA_def_property_ui_text(prop, "Action", "The constraining action");
1786  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1787 
1788  prop = RNA_def_property(srna, "use_bone_object_action", PROP_BOOLEAN, PROP_NONE);
1791  "Object Action",
1792  "Bones only: apply the object's transformation channels of the action "
1793  "to the constrained bone, instead of bone's channels");
1794  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1795 
1796  prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
1797  RNA_def_property_int_sdna(prop, NULL, "start");
1799  RNA_def_property_ui_text(prop, "Start Frame", "First frame of the Action to use");
1800  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1801 
1802  prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
1803  RNA_def_property_int_sdna(prop, NULL, "end");
1805  RNA_def_property_ui_text(prop, "End Frame", "Last frame of the Action to use");
1806  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1807 
1808  prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
1809  RNA_def_property_float_sdna(prop, NULL, "max");
1810  RNA_def_property_range(prop, -1000.0f, 1000.0f);
1811  RNA_def_property_ui_text(prop, "Maximum", "Maximum value for target channel range");
1812  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1813  RNA_def_property_float_funcs(prop, NULL, NULL, "rna_ActionConstraint_minmax_range");
1814 
1815  prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
1816  RNA_def_property_float_sdna(prop, NULL, "min");
1817  RNA_def_property_range(prop, -1000.0f, 1000.0f);
1818  RNA_def_property_ui_text(prop, "Minimum", "Minimum value for target channel range");
1819  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1820  RNA_def_property_float_funcs(prop, NULL, NULL, "rna_ActionConstraint_minmax_range");
1821 
1822  prop = RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_FACTOR);
1823  RNA_def_property_float_sdna(prop, NULL, "eval_time");
1824  RNA_def_property_range(prop, 0.0f, 1.0f);
1826  prop, "Evaluation Time", "Interpolates between Action Start and End frames");
1827  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1828 
1829  prop = RNA_def_property(srna, "use_eval_time", PROP_BOOLEAN, PROP_NONE);
1832  "Use Evaluation Time",
1833  "Interpolate between Action Start and End frames, with the Evaluation "
1834  "Time slider instead of the Target object/bone");
1835  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1836 
1838 }
1839 
1841 {
1842  StructRNA *srna;
1843  PropertyRNA *prop;
1844 
1845  static const EnumPropertyItem lock_items[] = {
1846  {TRACK_X, "LOCK_X", 0, "X", ""},
1847  {TRACK_Y, "LOCK_Y", 0, "Y", ""},
1848  {TRACK_Z, "LOCK_Z", 0, "Z", ""},
1849  {0, NULL, 0, NULL, NULL},
1850  };
1851 
1852  srna = RNA_def_struct(brna, "LockedTrackConstraint", "Constraint");
1854  srna,
1855  "Locked Track Constraint",
1856  "Point toward the target along the track axis, while locking the other axis");
1857  RNA_def_struct_ui_icon(srna, ICON_CON_LOCKTRACK);
1858 
1860 
1861  RNA_def_struct_sdna_from(srna, "bLockTrackConstraint", "data");
1862 
1864 
1866 
1867  prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
1868  RNA_def_property_enum_sdna(prop, NULL, "trackflag");
1870  RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object");
1871  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1872 
1873  prop = RNA_def_property(srna, "lock_axis", PROP_ENUM, PROP_NONE);
1874  RNA_def_property_enum_sdna(prop, NULL, "lockflag");
1875  RNA_def_property_enum_items(prop, lock_items);
1876  RNA_def_property_ui_text(prop, "Locked Axis", "Axis that points upward");
1877  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1878 
1880 }
1881 
1883 {
1884  StructRNA *srna;
1885  PropertyRNA *prop;
1886 
1887  static const EnumPropertyItem forwardpath_items[] = {
1888  {TRACK_X, "FORWARD_X", 0, "X", ""},
1889  {TRACK_Y, "FORWARD_Y", 0, "Y", ""},
1890  {TRACK_Z, "FORWARD_Z", 0, "Z", ""},
1891  {TRACK_nX, "TRACK_NEGATIVE_X", 0, "-X", ""},
1892  {TRACK_nY, "TRACK_NEGATIVE_Y", 0, "-Y", ""},
1893  {TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""},
1894  {0, NULL, 0, NULL, NULL},
1895  };
1896 
1897  static const EnumPropertyItem pathup_items[] = {
1898  {TRACK_X, "UP_X", 0, "X", ""},
1899  {TRACK_Y, "UP_Y", 0, "Y", ""},
1900  {TRACK_Z, "UP_Z", 0, "Z", ""},
1901  {0, NULL, 0, NULL, NULL},
1902  };
1903 
1904  srna = RNA_def_struct(brna, "FollowPathConstraint", "Constraint");
1905  RNA_def_struct_ui_text(srna, "Follow Path Constraint", "Lock motion to the target path");
1906  RNA_def_struct_sdna_from(srna, "bFollowPathConstraint", "data");
1907  RNA_def_struct_ui_icon(srna, ICON_CON_FOLLOWPATH);
1908 
1910 
1911  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
1912  RNA_def_property_pointer_sdna(prop, NULL, "tar");
1913  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll");
1914  RNA_def_property_ui_text(prop, "Target", "Target Curve object");
1916  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1917 
1918  prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TIME);
1921  prop, "Offset", "Offset from the position corresponding to the time frame");
1922  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1923 
1924  prop = RNA_def_property(srna, "offset_factor", PROP_FLOAT, PROP_FACTOR);
1925  RNA_def_property_float_sdna(prop, NULL, "offset_fac");
1926  RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
1927  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 3);
1929  prop, "Offset Factor", "Percentage value defining target position along length of curve");
1930  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1931 
1932  prop = RNA_def_property(srna, "forward_axis", PROP_ENUM, PROP_NONE);
1933  RNA_def_property_enum_sdna(prop, NULL, "trackflag");
1934  RNA_def_property_enum_items(prop, forwardpath_items);
1935  RNA_def_property_ui_text(prop, "Forward Axis", "Axis that points forward along the path");
1936  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1937 
1938  prop = RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
1939  RNA_def_property_enum_sdna(prop, NULL, "upflag");
1940  RNA_def_property_enum_items(prop, pathup_items);
1941  RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward");
1942  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1943 
1944  prop = RNA_def_property(srna, "use_curve_follow", PROP_BOOLEAN, PROP_NONE);
1947  prop, "Follow Curve", "Object will follow the heading and banking of the curve");
1948  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1949 
1950  prop = RNA_def_property(srna, "use_fixed_location", PROP_BOOLEAN, PROP_NONE);
1953  prop,
1954  "Fixed Position",
1955  "Object will stay locked to a single point somewhere along the length of the curve "
1956  "regardless of time");
1957  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1958 
1959  prop = RNA_def_property(srna, "use_curve_radius", PROP_BOOLEAN, PROP_NONE);
1961  RNA_def_property_ui_text(prop, "Curve Radius", "Object is scaled by the curve radius");
1962  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1963 
1965 }
1966 
1968 {
1969  StructRNA *srna;
1970  PropertyRNA *prop;
1971 
1972  static const EnumPropertyItem volume_items[] = {
1973  {VOLUME_XZ, "VOLUME_XZX", 0, "XZ", ""},
1974  {VOLUME_X, "VOLUME_X", 0, "X", ""},
1975  {VOLUME_Z, "VOLUME_Z", 0, "Z", ""},
1976  {NO_VOLUME, "NO_VOLUME", 0, "None", ""},
1977  {0, NULL, 0, NULL, NULL},
1978  };
1979 
1980  static const EnumPropertyItem plane_items[] = {
1981  {PLANE_X, "PLANE_X", 0, "XZ", "Rotate around local X, then Z"},
1982  {PLANE_Z, "PLANE_Z", 0, "ZX", "Rotate around local Z, then X"},
1983  {SWING_Y,
1984  "SWING_Y",
1985  0,
1986  "Swing",
1987  "Use the smallest single axis rotation, similar to Damped Track"},
1988  {0, NULL, 0, NULL, NULL},
1989  };
1990 
1991  srna = RNA_def_struct(brna, "StretchToConstraint", "Constraint");
1992  RNA_def_struct_ui_text(srna, "Stretch To Constraint", "Stretch to meet the target object");
1993  RNA_def_struct_ui_icon(srna, ICON_CON_STRETCHTO);
1994 
1996 
1997  RNA_def_struct_sdna_from(srna, "bStretchToConstraint", "data");
1998 
2000 
2002 
2003  prop = RNA_def_property(srna, "volume", PROP_ENUM, PROP_NONE);
2004  RNA_def_property_enum_sdna(prop, NULL, "volmode");
2005  RNA_def_property_enum_items(prop, volume_items);
2007  prop, "Maintain Volume", "Maintain the object's volume as it stretches");
2008  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2009 
2010  prop = RNA_def_property(srna, "keep_axis", PROP_ENUM, PROP_NONE);
2011  RNA_def_property_enum_sdna(prop, NULL, "plane");
2012  RNA_def_property_enum_items(prop, plane_items);
2013  RNA_def_property_ui_text(prop, "Keep Axis", "The rotation type and axis order to use");
2014  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2015 
2016  prop = RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_DISTANCE);
2017  RNA_def_property_float_sdna(prop, NULL, "orglength");
2018  RNA_def_property_range(prop, 0.0f, 1000.0f);
2020  RNA_def_property_ui_text(prop, "Original Length", "Length at rest position");
2021  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2022 
2023  prop = RNA_def_property(srna, "bulge", PROP_FLOAT, PROP_NONE);
2024  RNA_def_property_range(prop, 0.0, 100.0f);
2026  prop, "Volume Variation", "Factor between volume variation and stretching");
2027  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2028 
2029  prop = RNA_def_property(srna, "use_bulge_min", PROP_BOOLEAN, PROP_NONE);
2032  prop, "Use Volume Variation Minimum", "Use lower limit for volume variation");
2033  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2034 
2035  prop = RNA_def_property(srna, "use_bulge_max", PROP_BOOLEAN, PROP_NONE);
2038  prop, "Use Volume Variation Maximum", "Use upper limit for volume variation");
2039  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2040 
2041  prop = RNA_def_property(srna, "bulge_min", PROP_FLOAT, PROP_NONE);
2042  RNA_def_property_range(prop, 0.0, 1.0f);
2043  RNA_def_property_ui_text(prop, "Volume Variation Minimum", "Minimum volume stretching factor");
2044  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2045 
2046  prop = RNA_def_property(srna, "bulge_max", PROP_FLOAT, PROP_NONE);
2047  RNA_def_property_range(prop, 1.0, 100.0f);
2048  RNA_def_property_ui_text(prop, "Volume Variation Maximum", "Maximum volume stretching factor");
2049  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2050 
2051  prop = RNA_def_property(srna, "bulge_smooth", PROP_FLOAT, PROP_FACTOR);
2052  RNA_def_property_range(prop, 0.0, 1.0f);
2054  prop, "Volume Variation Smoothness", "Strength of volume stretching clamping");
2055  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2056 
2058 }
2059 
2061 {
2062  StructRNA *srna;
2063  PropertyRNA *prop;
2064 
2065  static const EnumPropertyItem clamp_items[] = {
2066  {CLAMPTO_AUTO, "CLAMPTO_AUTO", 0, "Auto", ""},
2067  {CLAMPTO_X, "CLAMPTO_X", 0, "X", ""},
2068  {CLAMPTO_Y, "CLAMPTO_Y", 0, "Y", ""},
2069  {CLAMPTO_Z, "CLAMPTO_Z", 0, "Z", ""},
2070  {0, NULL, 0, NULL, NULL},
2071  };
2072 
2073  srna = RNA_def_struct(brna, "ClampToConstraint", "Constraint");
2075  srna,
2076  "Clamp To Constraint",
2077  "Constrain an object's location to the nearest point along the target path");
2078  RNA_def_struct_sdna_from(srna, "bClampToConstraint", "data");
2079  RNA_def_struct_ui_icon(srna, ICON_CON_CLAMPTO);
2080 
2082 
2083  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
2084  RNA_def_property_pointer_sdna(prop, NULL, "tar");
2085  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll");
2086  RNA_def_property_ui_text(prop, "Target", "Target Object (Curves only)");
2088  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
2089 
2090  prop = RNA_def_property(srna, "main_axis", PROP_ENUM, PROP_NONE);
2091  RNA_def_property_enum_sdna(prop, NULL, "flag");
2092  RNA_def_property_enum_items(prop, clamp_items);
2093  RNA_def_property_ui_text(prop, "Main Axis", "Main axis of movement");
2094  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2095 
2096  prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
2099  prop, "Cyclic", "Treat curve as cyclic curve (no clamping to curve bounding box)");
2100  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2101 
2103 }
2104 
2106 {
2107  StructRNA *srna;
2108  PropertyRNA *prop;
2109 
2110  static const EnumPropertyItem transform_items[] = {
2111  {TRANS_LOCATION, "LOCATION", 0, "Location", ""},
2112  {TRANS_ROTATION, "ROTATION", 0, "Rotation", ""},
2113  {TRANS_SCALE, "SCALE", 0, "Scale", ""},
2114  {0, NULL, 0, NULL, NULL},
2115  };
2116 
2117  static const EnumPropertyItem mix_mode_loc_items[] = {
2118  {TRANS_MIXLOC_REPLACE, "REPLACE", 0, "Replace", "Replace component values"},
2119  {TRANS_MIXLOC_ADD, "ADD", 0, "Add", "Add component values together"},
2120  {0, NULL, 0, NULL, NULL},
2121  };
2122 
2123  static const EnumPropertyItem mix_mode_rot_items[] = {
2124  {TRANS_MIXROT_REPLACE, "REPLACE", 0, "Replace", "Replace component values"},
2125  {TRANS_MIXROT_ADD, "ADD", 0, "Add", "Add component values together"},
2127  "BEFORE",
2128  0,
2129  "Before Original",
2130  "Apply new rotation before original, as if it was on a parent"},
2132  "AFTER",
2133  0,
2134  "After Original",
2135  "Apply new rotation after original, as if it was on a child"},
2136  {0, NULL, 0, NULL, NULL},
2137  };
2138 
2139  static const EnumPropertyItem mix_mode_scale_items[] = {
2140  {TRANS_MIXSCALE_REPLACE, "REPLACE", 0, "Replace", "Replace component values"},
2141  {TRANS_MIXSCALE_MULTIPLY, "MULTIPLY", 0, "Multiply", "Multiply component values together"},
2142  {0, NULL, 0, NULL, NULL},
2143  };
2144 
2145  srna = RNA_def_struct(brna, "TransformConstraint", "Constraint");
2147  srna, "Transformation Constraint", "Map transformations of the target to the object");
2148  RNA_def_struct_sdna_from(srna, "bTransformConstraint", "data");
2149  RNA_def_struct_ui_icon(srna, ICON_CON_TRANSFORM);
2150 
2152 
2154 
2155  prop = RNA_def_property(srna, "map_from", PROP_ENUM, PROP_NONE);
2156  RNA_def_property_enum_sdna(prop, NULL, "from");
2157  RNA_def_property_enum_items(prop, transform_items);
2158  RNA_def_property_ui_text(prop, "Map From", "The transformation type to use from the target");
2159  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2160 
2161  prop = RNA_def_property(srna, "map_to", PROP_ENUM, PROP_NONE);
2162  RNA_def_property_enum_sdna(prop, NULL, "to");
2163  RNA_def_property_enum_items(prop, transform_items);
2165  prop, "Map To", "The transformation type to affect of the constrained object");
2166  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2167 
2168  prop = RNA_def_property(srna, "map_to_x_from", PROP_ENUM, PROP_NONE);
2169  RNA_def_property_enum_sdna(prop, NULL, "map[0]");
2172  prop, "Map To X From", "The source axis constrained object's X axis uses");
2173  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2174 
2175  prop = RNA_def_property(srna, "map_to_y_from", PROP_ENUM, PROP_NONE);
2176  RNA_def_property_enum_sdna(prop, NULL, "map[1]");
2179  prop, "Map To Y From", "The source axis constrained object's Y axis uses");
2180  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2181 
2182  prop = RNA_def_property(srna, "map_to_z_from", PROP_ENUM, PROP_NONE);
2183  RNA_def_property_enum_sdna(prop, NULL, "map[2]");
2186  prop, "Map To Z From", "The source axis constrained object's Z axis uses");
2187  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2188 
2189  prop = RNA_def_property(srna, "use_motion_extrapolate", PROP_BOOLEAN, PROP_NONE);
2191  RNA_def_property_ui_text(prop, "Extrapolate Motion", "Extrapolate ranges");
2192  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2193 
2194  prop = RNA_def_property(srna, "from_rotation_mode", PROP_ENUM, PROP_NONE);
2195  RNA_def_property_enum_sdna(prop, NULL, "from_rotation_mode");
2197  RNA_def_property_ui_text(prop, "From Mode", "Specify the type of rotation channels to use");
2198  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2199 
2200  prop = RNA_def_property(srna, "to_euler_order", PROP_ENUM, PROP_NONE);
2201  RNA_def_property_enum_sdna(prop, NULL, "to_euler_order");
2203  RNA_def_property_ui_text(prop, "To Order", "Explicitly specify the output euler rotation order");
2204  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2205 
2206  /* Loc */
2207  prop = RNA_def_property(srna, "from_min_x", PROP_FLOAT, PROP_DISTANCE);
2208  RNA_def_property_float_sdna(prop, NULL, "from_min[0]");
2209  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2210  RNA_def_property_ui_text(prop, "From Minimum X", "Bottom range of X axis source motion");
2211  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2212 
2213  prop = RNA_def_property(srna, "from_min_y", PROP_FLOAT, PROP_DISTANCE);
2214  RNA_def_property_float_sdna(prop, NULL, "from_min[1]");
2215  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2216  RNA_def_property_ui_text(prop, "From Minimum Y", "Bottom range of Y axis source motion");
2217  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2218 
2219  prop = RNA_def_property(srna, "from_min_z", PROP_FLOAT, PROP_DISTANCE);
2220  RNA_def_property_float_sdna(prop, NULL, "from_min[2]");
2221  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2222  RNA_def_property_ui_text(prop, "From Minimum Z", "Bottom range of Z axis source motion");
2223  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2224 
2225  prop = RNA_def_property(srna, "from_max_x", PROP_FLOAT, PROP_DISTANCE);
2226  RNA_def_property_float_sdna(prop, NULL, "from_max[0]");
2227  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2228  RNA_def_property_ui_text(prop, "From Maximum X", "Top range of X axis source motion");
2229  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2230 
2231  prop = RNA_def_property(srna, "from_max_y", PROP_FLOAT, PROP_DISTANCE);
2232  RNA_def_property_float_sdna(prop, NULL, "from_max[1]");
2233  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2234  RNA_def_property_ui_text(prop, "From Maximum Y", "Top range of Y axis source motion");
2235  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2236 
2237  prop = RNA_def_property(srna, "from_max_z", PROP_FLOAT, PROP_DISTANCE);
2238  RNA_def_property_float_sdna(prop, NULL, "from_max[2]");
2239  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2240  RNA_def_property_ui_text(prop, "From Maximum Z", "Top range of Z axis source motion");
2241  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2242 
2243  prop = RNA_def_property(srna, "to_min_x", PROP_FLOAT, PROP_DISTANCE);
2244  RNA_def_property_float_sdna(prop, NULL, "to_min[0]");
2245  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2246  RNA_def_property_ui_text(prop, "To Minimum X", "Bottom range of X axis destination motion");
2247  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2248 
2249  prop = RNA_def_property(srna, "to_min_y", PROP_FLOAT, PROP_DISTANCE);
2250  RNA_def_property_float_sdna(prop, NULL, "to_min[1]");
2251  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2252  RNA_def_property_ui_text(prop, "To Minimum Y", "Bottom range of Y axis destination motion");
2253  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2254 
2255  prop = RNA_def_property(srna, "to_min_z", PROP_FLOAT, PROP_DISTANCE);
2256  RNA_def_property_float_sdna(prop, NULL, "to_min[2]");
2257  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2258  RNA_def_property_ui_text(prop, "To Minimum Z", "Bottom range of Z axis destination motion");
2259  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2260 
2261  prop = RNA_def_property(srna, "to_max_x", PROP_FLOAT, PROP_DISTANCE);
2262  RNA_def_property_float_sdna(prop, NULL, "to_max[0]");
2263  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2264  RNA_def_property_ui_text(prop, "To Maximum X", "Top range of X axis destination motion");
2265  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2266 
2267  prop = RNA_def_property(srna, "to_max_y", PROP_FLOAT, PROP_DISTANCE);
2268  RNA_def_property_float_sdna(prop, NULL, "to_max[1]");
2269  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2270  RNA_def_property_ui_text(prop, "To Maximum Y", "Top range of Y axis destination motion");
2271  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2272 
2273  prop = RNA_def_property(srna, "to_max_z", PROP_FLOAT, PROP_DISTANCE);
2274  RNA_def_property_float_sdna(prop, NULL, "to_max[2]");
2275  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2276  RNA_def_property_ui_text(prop, "To Maximum Z", "Top range of Z axis destination motion");
2277  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2278 
2279  prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
2280  RNA_def_property_enum_sdna(prop, NULL, "mix_mode_loc");
2281  RNA_def_property_enum_items(prop, mix_mode_loc_items);
2283  prop, "Location Mix Mode", "Specify how to combine the new location with original");
2284  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2285 
2286  /* Rot */
2287  prop = RNA_def_property(srna, "from_min_x_rot", PROP_FLOAT, PROP_ANGLE);
2288  RNA_def_property_float_sdna(prop, NULL, "from_min_rot[0]");
2289  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2290  RNA_def_property_ui_text(prop, "From Minimum X", "Bottom range of X axis source motion");
2291  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2292 
2293  prop = RNA_def_property(srna, "from_min_y_rot", PROP_FLOAT, PROP_ANGLE);
2294  RNA_def_property_float_sdna(prop, NULL, "from_min_rot[1]");
2295  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2296  RNA_def_property_ui_text(prop, "From Minimum Y", "Bottom range of Y axis source motion");
2297  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2298 
2299  prop = RNA_def_property(srna, "from_min_z_rot", PROP_FLOAT, PROP_ANGLE);
2300  RNA_def_property_float_sdna(prop, NULL, "from_min_rot[2]");
2301  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2302  RNA_def_property_ui_text(prop, "From Minimum Z", "Bottom range of Z axis source motion");
2303  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2304 
2305  prop = RNA_def_property(srna, "from_max_x_rot", PROP_FLOAT, PROP_ANGLE);
2306  RNA_def_property_float_sdna(prop, NULL, "from_max_rot[0]");
2307  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2308  RNA_def_property_ui_text(prop, "From Maximum X", "Top range of X axis source motion");
2309  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2310 
2311  prop = RNA_def_property(srna, "from_max_y_rot", PROP_FLOAT, PROP_ANGLE);
2312  RNA_def_property_float_sdna(prop, NULL, "from_max_rot[1]");
2313  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2314  RNA_def_property_ui_text(prop, "From Maximum Y", "Top range of Y axis source motion");
2315  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2316 
2317  prop = RNA_def_property(srna, "from_max_z_rot", PROP_FLOAT, PROP_ANGLE);
2318  RNA_def_property_float_sdna(prop, NULL, "from_max_rot[2]");
2319  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2320  RNA_def_property_ui_text(prop, "From Maximum Z", "Top range of Z axis source motion");
2321  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2322 
2323  prop = RNA_def_property(srna, "to_min_x_rot", PROP_FLOAT, PROP_ANGLE);
2324  RNA_def_property_float_sdna(prop, NULL, "to_min_rot[0]");
2325  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2326  RNA_def_property_ui_text(prop, "To Minimum X", "Bottom range of X axis destination motion");
2327  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2328 
2329  prop = RNA_def_property(srna, "to_min_y_rot", PROP_FLOAT, PROP_ANGLE);
2330  RNA_def_property_float_sdna(prop, NULL, "to_min_rot[1]");
2331  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2332  RNA_def_property_ui_text(prop, "To Minimum Y", "Bottom range of Y axis destination motion");
2333  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2334 
2335  prop = RNA_def_property(srna, "to_min_z_rot", PROP_FLOAT, PROP_ANGLE);
2336  RNA_def_property_float_sdna(prop, NULL, "to_min_rot[2]");
2337  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2338  RNA_def_property_ui_text(prop, "To Minimum Z", "Bottom range of Z axis destination motion");
2339  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2340 
2341  prop = RNA_def_property(srna, "to_max_x_rot", PROP_FLOAT, PROP_ANGLE);
2342  RNA_def_property_float_sdna(prop, NULL, "to_max_rot[0]");
2343  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2344  RNA_def_property_ui_text(prop, "To Maximum X", "Top range of X axis destination motion");
2345  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2346 
2347  prop = RNA_def_property(srna, "to_max_y_rot", PROP_FLOAT, PROP_ANGLE);
2348  RNA_def_property_float_sdna(prop, NULL, "to_max_rot[1]");
2349  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2350  RNA_def_property_ui_text(prop, "To Maximum Y", "Top range of Y axis destination motion");
2351  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2352 
2353  prop = RNA_def_property(srna, "to_max_z_rot", PROP_FLOAT, PROP_ANGLE);
2354  RNA_def_property_float_sdna(prop, NULL, "to_max_rot[2]");
2355  RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2356  RNA_def_property_ui_text(prop, "To Maximum Z", "Top range of Z axis destination motion");
2357  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2358 
2359  prop = RNA_def_property(srna, "mix_mode_rot", PROP_ENUM, PROP_NONE);
2360  RNA_def_property_enum_sdna(prop, NULL, "mix_mode_rot");
2361  RNA_def_property_enum_items(prop, mix_mode_rot_items);
2363  prop, "Rotation Mix Mode", "Specify how to combine the new rotation with original");
2364  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2365 
2366  /* Scale */
2367  prop = RNA_def_property(srna, "from_min_x_scale", PROP_FLOAT, PROP_NONE);
2368  RNA_def_property_float_sdna(prop, NULL, "from_min_scale[0]");
2369  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2370  RNA_def_property_ui_text(prop, "From Minimum X", "Bottom range of X axis source motion");
2371  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2372 
2373  prop = RNA_def_property(srna, "from_min_y_scale", PROP_FLOAT, PROP_NONE);
2374  RNA_def_property_float_sdna(prop, NULL, "from_min_scale[1]");
2375  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2376  RNA_def_property_ui_text(prop, "From Minimum Y", "Bottom range of Y axis source motion");
2377  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2378 
2379  prop = RNA_def_property(srna, "from_min_z_scale", PROP_FLOAT, PROP_NONE);
2380  RNA_def_property_float_sdna(prop, NULL, "from_min_scale[2]");
2381  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2382  RNA_def_property_ui_text(prop, "From Minimum Z", "Bottom range of Z axis source motion");
2383  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2384 
2385  prop = RNA_def_property(srna, "from_max_x_scale", PROP_FLOAT, PROP_NONE);
2386  RNA_def_property_float_sdna(prop, NULL, "from_max_scale[0]");
2387  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2388  RNA_def_property_ui_text(prop, "From Maximum X", "Top range of X axis source motion");
2389  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2390 
2391  prop = RNA_def_property(srna, "from_max_y_scale", PROP_FLOAT, PROP_NONE);
2392  RNA_def_property_float_sdna(prop, NULL, "from_max_scale[1]");
2393  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2394  RNA_def_property_ui_text(prop, "From Maximum Y", "Top range of Y axis source motion");
2395  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2396 
2397  prop = RNA_def_property(srna, "from_max_z_scale", PROP_FLOAT, PROP_NONE);
2398  RNA_def_property_float_sdna(prop, NULL, "from_max_scale[2]");
2399  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2400  RNA_def_property_ui_text(prop, "From Maximum Z", "Top range of Z axis source motion");
2401  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2402 
2403  prop = RNA_def_property(srna, "to_min_x_scale", PROP_FLOAT, PROP_NONE);
2404  RNA_def_property_float_sdna(prop, NULL, "to_min_scale[0]");
2405  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2406  RNA_def_property_ui_text(prop, "To Minimum X", "Bottom range of X axis destination motion");
2407  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2408 
2409  prop = RNA_def_property(srna, "to_min_y_scale", PROP_FLOAT, PROP_NONE);
2410  RNA_def_property_float_sdna(prop, NULL, "to_min_scale[1]");
2411  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2412  RNA_def_property_ui_text(prop, "To Minimum Y", "Bottom range of Y axis destination motion");
2413  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2414 
2415  prop = RNA_def_property(srna, "to_min_z_scale", PROP_FLOAT, PROP_NONE);
2416  RNA_def_property_float_sdna(prop, NULL, "to_min_scale[2]");
2417  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2418  RNA_def_property_ui_text(prop, "To Minimum Z", "Bottom range of Z axis destination motion");
2419  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2420 
2421  prop = RNA_def_property(srna, "to_max_x_scale", PROP_FLOAT, PROP_NONE);
2422  RNA_def_property_float_sdna(prop, NULL, "to_max_scale[0]");
2423  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2424  RNA_def_property_ui_text(prop, "To Maximum X", "Top range of X axis destination motion");
2425  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2426 
2427  prop = RNA_def_property(srna, "to_max_y_scale", PROP_FLOAT, PROP_NONE);
2428  RNA_def_property_float_sdna(prop, NULL, "to_max_scale[1]");
2429  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2430  RNA_def_property_ui_text(prop, "To Maximum Y", "Top range of Y axis destination motion");
2431  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2432 
2433  prop = RNA_def_property(srna, "to_max_z_scale", PROP_FLOAT, PROP_NONE);
2434  RNA_def_property_float_sdna(prop, NULL, "to_max_scale[2]");
2435  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2436  RNA_def_property_ui_text(prop, "To Maximum Z", "Top range of Z axis destination motion");
2437  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2438 
2439  prop = RNA_def_property(srna, "mix_mode_scale", PROP_ENUM, PROP_NONE);
2440  RNA_def_property_enum_sdna(prop, NULL, "mix_mode_scale");
2441  RNA_def_property_enum_items(prop, mix_mode_scale_items);
2443  prop, "Scale Mix Mode", "Specify how to combine the new scale with original");
2444  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2445 
2447 }
2448 
2450 {
2451  StructRNA *srna;
2452  PropertyRNA *prop;
2453 
2454  srna = RNA_def_struct(brna, "LimitLocationConstraint", "Constraint");
2456  srna, "Limit Location Constraint", "Limit the location of the constrained object");
2457  RNA_def_struct_sdna_from(srna, "bLocLimitConstraint", "data");
2458  RNA_def_struct_ui_icon(srna, ICON_CON_LOCLIMIT);
2459 
2461 
2462  prop = RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE);
2464  RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value");
2465  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2466 
2467  prop = RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE);
2469  RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value");
2470  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2471 
2472  prop = RNA_def_property(srna, "use_min_z", PROP_BOOLEAN, PROP_NONE);
2474  RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value");
2475  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2476 
2477  prop = RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE);
2479  RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value");
2480  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2481 
2482  prop = RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE);
2484  RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value");
2485  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2486 
2487  prop = RNA_def_property(srna, "use_max_z", PROP_BOOLEAN, PROP_NONE);
2489  RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value");
2490  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2491 
2492  prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_DISTANCE);
2493  RNA_def_property_float_sdna(prop, NULL, "xmin");
2494  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2495  RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
2496  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2497 
2498  prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_DISTANCE);
2499  RNA_def_property_float_sdna(prop, NULL, "ymin");
2500  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2501  RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
2502  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2503 
2504  prop = RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_DISTANCE);
2505  RNA_def_property_float_sdna(prop, NULL, "zmin");
2506  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2507  RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow");
2508  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2509 
2510  prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_DISTANCE);
2511  RNA_def_property_float_sdna(prop, NULL, "xmax");
2512  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2513  RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
2514  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2515 
2516  prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_DISTANCE);
2517  RNA_def_property_float_sdna(prop, NULL, "ymax");
2518  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2519  RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
2520  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2521 
2522  prop = RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_DISTANCE);
2523  RNA_def_property_float_sdna(prop, NULL, "zmax");
2524  RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2525  RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow");
2526  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2527 
2528  prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
2531  prop, "Affect Transform", "Transform tools are affected by this constraint as well");
2532  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2533 
2535 }
2536 
2538 {
2539  StructRNA *srna;
2540  PropertyRNA *prop;
2541 
2542  srna = RNA_def_struct(brna, "LimitRotationConstraint", "Constraint");
2544  srna, "Limit Rotation Constraint", "Limit the rotation of the constrained object");
2545  RNA_def_struct_sdna_from(srna, "bRotLimitConstraint", "data");
2546  RNA_def_struct_ui_icon(srna, ICON_CON_ROTLIMIT);
2547 
2549 
2550  prop = RNA_def_property(srna, "use_limit_x", PROP_BOOLEAN, PROP_NONE);
2552  RNA_def_property_ui_text(prop, "Limit X", "Use the minimum X value");
2553  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2554 
2555  prop = RNA_def_property(srna, "use_limit_y", PROP_BOOLEAN, PROP_NONE);
2557  RNA_def_property_ui_text(prop, "Limit Y", "Use the minimum Y value");
2558  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2559 
2560  prop = RNA_def_property(srna, "use_limit_z", PROP_BOOLEAN, PROP_NONE);
2562  RNA_def_property_ui_text(prop, "Limit Z", "Use the minimum Z value");
2563  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2564 
2565  prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_ANGLE);
2566  RNA_def_property_float_sdna(prop, NULL, "xmin");
2567  RNA_def_property_range(prop, -1000.0, 1000.0f);
2568  RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
2569  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2570 
2571  prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_ANGLE);
2572  RNA_def_property_float_sdna(prop, NULL, "ymin");
2573  RNA_def_property_range(prop, -1000.0, 1000.0f);
2574  RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
2575  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2576 
2577  prop = RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_ANGLE);
2578  RNA_def_property_float_sdna(prop, NULL, "zmin");
2579  RNA_def_property_range(prop, -1000.0, 1000.0f);
2580  RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow");
2581  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2582 
2583  prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_ANGLE);
2584  RNA_def_property_float_sdna(prop, NULL, "xmax");
2585  RNA_def_property_range(prop, -1000.0, 1000.0f);
2586  RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
2587  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2588 
2589  prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_ANGLE);
2590  RNA_def_property_float_sdna(prop, NULL, "ymax");
2591  RNA_def_property_range(prop, -1000.0, 1000.0f);
2592  RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
2593  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2594 
2595  prop = RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_ANGLE);
2596  RNA_def_property_float_sdna(prop, NULL, "zmax");
2597  RNA_def_property_range(prop, -1000.0, 1000.0f);
2598  RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow");
2599  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2600 
2601  prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
2604  prop, "Affect Transform", "Transform tools are affected by this constraint as well");
2605  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2606 
2608 }
2609 
2611 {
2612  StructRNA *srna;
2613  PropertyRNA *prop;
2614 
2615  srna = RNA_def_struct(brna, "LimitScaleConstraint", "Constraint");
2617  srna, "Limit Size Constraint", "Limit the scaling of the constrained object");
2618  RNA_def_struct_sdna_from(srna, "bSizeLimitConstraint", "data");
2619  RNA_def_struct_ui_icon(srna, ICON_CON_SIZELIMIT);
2620 
2622 
2623  prop = RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE);
2625  RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value");
2626  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2627 
2628  prop = RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE);
2630  RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value");
2631  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2632 
2633  prop = RNA_def_property(srna, "use_min_z", PROP_BOOLEAN, PROP_NONE);
2635  RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value");
2636  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2637 
2638  prop = RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE);
2640  RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value");
2641  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2642 
2643  prop = RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE);
2645  RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value");
2646  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2647 
2648  prop = RNA_def_property(srna, "use_max_z", PROP_BOOLEAN, PROP_NONE);
2650  RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value");
2651  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2652 
2653  prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_NONE);
2654  RNA_def_property_float_sdna(prop, NULL, "xmin");
2655  RNA_def_property_range(prop, -1000.0, 1000.0f);
2656  RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
2657  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2658 
2659  prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_NONE);
2660  RNA_def_property_float_sdna(prop, NULL, "ymin");
2661  RNA_def_property_range(prop, -1000.0, 1000.0f);
2662  RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
2663  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2664 
2665  prop = RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_NONE);
2666  RNA_def_property_float_sdna(prop, NULL, "zmin");
2667  RNA_def_property_range(prop, -1000.0, 1000.0f);
2668  RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow");
2669  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2670 
2671  prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_NONE);
2672  RNA_def_property_float_sdna(prop, NULL, "xmax");
2673  RNA_def_property_range(prop, -1000.0, 1000.0f);
2674  RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
2675  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2676 
2677  prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_NONE);
2678  RNA_def_property_float_sdna(prop, NULL, "ymax");
2679  RNA_def_property_range(prop, -1000.0, 1000.0f);
2680  RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
2681  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2682 
2683  prop = RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_NONE);
2684  RNA_def_property_float_sdna(prop, NULL, "zmax");
2685  RNA_def_property_range(prop, -1000.0, 1000.0f);
2686  RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow");
2687  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2688 
2689  prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
2692  prop, "Affect Transform", "Transform tools are affected by this constraint as well");
2693  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2694 
2696 }
2697 
2699 {
2700  StructRNA *srna;
2701  PropertyRNA *prop;
2702 
2703  srna = RNA_def_struct(brna, "LimitDistanceConstraint", "Constraint");
2705  srna, "Limit Distance Constraint", "Limit the distance from target object");
2706 
2708 
2709  RNA_def_struct_sdna_from(srna, "bDistLimitConstraint", "data");
2710  RNA_def_struct_ui_icon(srna, ICON_CON_DISTLIMIT);
2711 
2713 
2715 
2716  prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
2717  RNA_def_property_float_sdna(prop, NULL, "dist");
2718  RNA_def_property_ui_range(prop, 0.0f, 100.0f, 10, 3);
2719  RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere");
2720  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2721 
2722  prop = RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE);
2723  RNA_def_property_enum_sdna(prop, NULL, "mode");
2726  prop, "Limit Mode", "Distances in relation to sphere of influence to allow");
2727  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2728 
2729  prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
2732  prop, "Affect Transform", "Transforms are affected by this constraint as well");
2733  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2734 
2736 }
2737 
2739 {
2740  StructRNA *srna;
2741  PropertyRNA *prop;
2742 
2743  static const EnumPropertyItem type_items[] = {
2745  "NEAREST_SURFACE",
2746  0,
2747  "Nearest Surface Point",
2748  "Shrink the location to the nearest target surface"},
2750  "PROJECT",
2751  0,
2752  "Project",
2753  "Shrink the location to the nearest target surface along a given axis"},
2755  "NEAREST_VERTEX",
2756  0,
2757  "Nearest Vertex",
2758  "Shrink the location to the nearest target vertex"},
2760  "TARGET_PROJECT",
2761  0,
2762  "Target Normal Project",
2763  "Shrink the location to the nearest target surface "
2764  "along the interpolated vertex normals of the target"},
2765  {0, NULL, 0, NULL, NULL},
2766  };
2767 
2768  static const EnumPropertyItem shrink_face_cull_items[] = {
2769  {0, "OFF", 0, "Off", "No culling"},
2771  "FRONT",
2772  0,
2773  "Front",
2774  "No projection when in front of the face"},
2776  "BACK",
2777  0,
2778  "Back",
2779  "No projection when behind the face"},
2780  {0, NULL, 0, NULL, NULL},
2781  };
2782 
2783  srna = RNA_def_struct(brna, "ShrinkwrapConstraint", "Constraint");
2785  srna, "Shrinkwrap Constraint", "Create constraint-based shrinkwrap relationship");
2786  RNA_def_struct_sdna_from(srna, "bShrinkwrapConstraint", "data");
2787  RNA_def_struct_ui_icon(srna, ICON_CON_SHRINKWRAP);
2788 
2790 
2791  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
2792  RNA_def_property_pointer_sdna(prop, NULL, "target"); /* TODO, mesh type */
2793  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Mesh_object_poll");
2794  RNA_def_property_ui_text(prop, "Target", "Target Mesh object");
2796  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
2797 
2798  prop = RNA_def_property(srna, "shrinkwrap_type", PROP_ENUM, PROP_NONE);
2799  RNA_def_property_enum_sdna(prop, NULL, "shrinkType");
2800  RNA_def_property_enum_items(prop, type_items);
2802  prop, "Shrinkwrap Type", "Select type of shrinkwrap algorithm for target position");
2803  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
2804 
2805  prop = RNA_def_property(srna, "wrap_mode", PROP_ENUM, PROP_NONE);
2806  RNA_def_property_enum_sdna(prop, NULL, "shrinkMode");
2809  prop, "Snap Mode", "Select how to constrain the object to the target surface");
2810  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
2811 
2812  prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
2813  RNA_def_property_float_sdna(prop, NULL, "dist");
2814  RNA_def_property_range(prop, 0.0f, FLT_MAX);
2815  RNA_def_property_ui_range(prop, 0.0f, 100.0f, 10, 3);
2816  RNA_def_property_ui_text(prop, "Distance", "Distance to Target");
2817  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2818 
2819  prop = RNA_def_property(srna, "project_axis", PROP_ENUM, PROP_NONE);
2820  RNA_def_property_enum_sdna(prop, NULL, "projAxis");
2822  RNA_def_property_ui_text(prop, "Project Axis", "Axis constrain to");
2823  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2824 
2825  prop = RNA_def_property(srna, "project_axis_space", PROP_ENUM, PROP_NONE);
2826  RNA_def_property_enum_sdna(prop, NULL, "projAxisSpace");
2828  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_owner_space_itemf");
2829  RNA_def_property_ui_text(prop, "Axis Space", "Space for the projection axis");
2830 
2831  prop = RNA_def_property(srna, "project_limit", PROP_FLOAT, PROP_DISTANCE);
2832  RNA_def_property_float_sdna(prop, NULL, "projLimit");
2833  RNA_def_property_range(prop, 0.0f, FLT_MAX);
2834  RNA_def_property_ui_range(prop, 0.0f, 100.0f, 10, 3);
2836  prop, "Project Distance", "Limit the distance used for projection (zero disables)");
2837  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2838 
2839  prop = RNA_def_property(srna, "use_project_opposite", PROP_BOOLEAN, PROP_NONE);
2842  prop, "Project Opposite", "Project in both specified and opposite directions");
2843  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2844 
2845  prop = RNA_def_property(srna, "cull_face", PROP_ENUM, PROP_NONE);
2846  RNA_def_property_enum_sdna(prop, NULL, "flag");
2847  RNA_def_property_enum_items(prop, shrink_face_cull_items);
2849  "rna_ShrinkwrapConstraint_face_cull_get",
2850  "rna_ShrinkwrapConstraint_face_cull_set",
2851  NULL);
2853  prop,
2854  "Face Cull",
2855  "Stop vertices from projecting to a face on the target when facing towards/away");
2856  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2857 
2858  prop = RNA_def_property(srna, "use_invert_cull", PROP_BOOLEAN, PROP_NONE);
2861  prop, "Invert Cull", "When projecting in the opposite direction invert the face cull mode");
2862  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2863 
2864  prop = RNA_def_property(srna, "use_track_normal", PROP_BOOLEAN, PROP_NONE);
2867  prop, "Align Axis To Normal", "Align the specified axis to the surface normal");
2868  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
2869 
2870  prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
2871  RNA_def_property_enum_sdna(prop, NULL, "trackAxis");
2873  RNA_def_property_ui_text(prop, "Track Axis", "Axis that is aligned to the normal");
2874  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2875 
2877 }
2878 
2880 {
2881  StructRNA *srna;
2882  PropertyRNA *prop;
2883 
2884  srna = RNA_def_struct(brna, "DampedTrackConstraint", "Constraint");
2886  srna, "Damped Track Constraint", "Point toward target by taking the shortest rotation path");
2887  RNA_def_struct_ui_icon(srna, ICON_CON_TRACKTO);
2888 
2890 
2891  RNA_def_struct_sdna_from(srna, "bDampTrackConstraint", "data");
2892 
2894 
2896 
2897  prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
2898  RNA_def_property_enum_sdna(prop, NULL, "trackflag");
2900  RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object");
2901  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2902 
2904 }
2905 
2907 {
2908  StructRNA *srna;
2909  PropertyRNA *prop;
2910 
2911  static const EnumPropertyItem splineik_xz_scale_mode[] = {
2912  {CONSTRAINT_SPLINEIK_XZS_NONE, "NONE", 0, "None", "Don't scale the X and Z axes (Default)"},
2914  "BONE_ORIGINAL",
2915  0,
2916  "Bone Original",
2917  "Use the original scaling of the bones"},
2919  "INVERSE_PRESERVE",
2920  0,
2921  "Inverse Scale",
2922  "Scale of the X and Z axes is the inverse of the Y-Scale"},
2924  "VOLUME_PRESERVE",
2925  0,
2926  "Volume Preservation",
2927  "Scale of the X and Z axes are adjusted to preserve the volume of the bones"},
2928  {0, NULL, 0, NULL, NULL},
2929  };
2930 
2931  static const EnumPropertyItem splineik_y_scale_mode[] = {
2932  {CONSTRAINT_SPLINEIK_YS_NONE, "NONE", 0, "None", "Don't scale in the Y axis"},
2934  "FIT_CURVE",
2935  0,
2936  "Fit Curve",
2937  "Scale the bones to fit the entire length of the curve"},
2939  "BONE_ORIGINAL",
2940  0,
2941  "Bone Original",
2942  "Use the original Y scale of the bone"},
2943  {0, NULL, 0, NULL, NULL},
2944  };
2945 
2946  srna = RNA_def_struct(brna, "SplineIKConstraint", "Constraint");
2947  RNA_def_struct_ui_text(srna, "Spline IK Constraint", "Align 'n' bones along a curve");
2948  RNA_def_struct_sdna_from(srna, "bSplineIKConstraint", "data");
2949  RNA_def_struct_ui_icon(srna, ICON_CON_SPLINEIK);
2950 
2952 
2953  /* target chain */
2954  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
2955  RNA_def_property_pointer_sdna(prop, NULL, "tar");
2956  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll");
2957  RNA_def_property_ui_text(prop, "Target", "Curve that controls this relationship");
2959  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
2960 
2961  prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE);
2962  RNA_def_property_int_sdna(prop, NULL, "chainlen");
2963  /* TODO: this should really check the max length of the chain the constraint is attached to */
2964  RNA_def_property_range(prop, 1, 255);
2965  RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the chain");
2966  /* XXX: this update goes wrong... needs extra flush? */
2967  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
2968 
2969  /* direct access to bindings */
2970  /* NOTE: only to be used by experienced users */
2971  prop = RNA_def_property(srna, "joint_bindings", PROP_FLOAT, PROP_FACTOR);
2972  RNA_def_property_array(prop, 32); /* XXX this is the maximum value allowed - why? */
2974  RNA_def_property_dynamic_array_funcs(prop, "rna_SplineIKConstraint_joint_bindings_get_length");
2976  "rna_SplineIKConstraint_joint_bindings_get",
2977  "rna_SplineIKConstraint_joint_bindings_set",
2978  NULL);
2980  prop,
2981  "Joint Bindings",
2982  "(EXPERIENCED USERS ONLY) The relative positions of the joints along the chain, "
2983  "as percentages");
2984  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2985 
2986  /* settings */
2987  prop = RNA_def_property(srna, "use_chain_offset", PROP_BOOLEAN, PROP_NONE);
2990  prop, "Chain Offset", "Offset the entire chain relative to the root joint");
2991  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2992 
2993  prop = RNA_def_property(srna, "use_even_divisions", PROP_BOOLEAN, PROP_NONE);
2996  "Even Divisions",
2997  "Ignore the relative lengths of the bones when fitting to the curve");
2998  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2999 
3000  prop = RNA_def_property(srna, "use_curve_radius", PROP_BOOLEAN, PROP_NONE);
3003  prop,
3004  "Use Curve Radius",
3005  "Average radius of the endpoints is used to tweak the X and Z Scaling of the bones, "
3006  "on top of XZ Scale mode");
3007  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3008 
3009  /* xz scaling mode */
3010  prop = RNA_def_property(srna, "xz_scale_mode", PROP_ENUM, PROP_NONE);
3011  RNA_def_property_enum_sdna(prop, NULL, "xzScaleMode");
3012  RNA_def_property_enum_items(prop, splineik_xz_scale_mode);
3014  prop,
3015  "XZ Scale Mode",
3016  "Method used for determining the scaling of the X and Z axes of the bones");
3017  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3018 
3019  /* y scaling mode */
3020  prop = RNA_def_property(srna, "y_scale_mode", PROP_ENUM, PROP_NONE);
3021  RNA_def_property_enum_sdna(prop, NULL, "yScaleMode");
3022  RNA_def_property_enum_items(prop, splineik_y_scale_mode);
3024  "Y Scale Mode",
3025  "Method used for determining the scaling of the Y axis of the bones, "
3026  "on top of the shape and scaling of the curve itself");
3027  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3028 
3029  /* take original scaling of the bone into account in volume preservation */
3030  prop = RNA_def_property(srna, "use_original_scale", PROP_BOOLEAN, PROP_NONE);
3033  prop, "Use Original Scale", "Apply volume preservation over the original scaling");
3034  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3035 
3036  /* Volume preservation for "volumetric" scale mode. */
3037  prop = RNA_def_property(srna, "bulge", PROP_FLOAT, PROP_NONE);
3038  RNA_def_property_range(prop, 0.0, 100.0f);
3040  prop, "Volume Variation", "Factor between volume variation and stretching");
3041  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3042 
3043  prop = RNA_def_property(srna, "use_bulge_min", PROP_BOOLEAN, PROP_NONE);
3046  prop, "Use Volume Variation Minimum", "Use lower limit for volume variation");
3047  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3048 
3049  prop = RNA_def_property(srna, "use_bulge_max", PROP_BOOLEAN, PROP_NONE);
3052  prop, "Use Volume Variation Maximum", "Use upper limit for volume variation");
3053  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3054 
3055  prop = RNA_def_property(srna, "bulge_min", PROP_FLOAT, PROP_NONE);
3056  RNA_def_property_range(prop, 0.0, 1.0f);
3057  RNA_def_property_ui_text(prop, "Volume Variation Minimum", "Minimum volume stretching factor");
3058  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3059 
3060  prop = RNA_def_property(srna, "bulge_max", PROP_FLOAT, PROP_NONE);
3061  RNA_def_property_range(prop, 1.0, 100.0f);
3062  RNA_def_property_ui_text(prop, "Volume Variation Maximum", "Maximum volume stretching factor");
3063  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3064 
3065  prop = RNA_def_property(srna, "bulge_smooth", PROP_FLOAT, PROP_FACTOR);
3066  RNA_def_property_range(prop, 0.0, 1.0f);
3068  prop, "Volume Variation Smoothness", "Strength of volume stretching clamping");
3069  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3070 
3072 }
3073 
3075 {
3076  StructRNA *srna;
3077  PropertyRNA *prop;
3078 
3079  static const EnumPropertyItem pivot_rotAxis_items[] = {
3080  {PIVOTCON_AXIS_NONE, "ALWAYS_ACTIVE", 0, "Always", "Use the pivot point in every rotation"},
3082  "NX",
3083  0,
3084  "-X Rotation",
3085  "Use the pivot point in the negative rotation range around the X-axis"},
3087  "NY",
3088  0,
3089  "-Y Rotation",
3090  "Use the pivot point in the negative rotation range around the Y-axis"},
3092  "NZ",
3093  0,
3094  "-Z Rotation",
3095  "Use the pivot point in the negative rotation range around the Z-axis"},
3096  {PIVOTCON_AXIS_X,
3097  "X",
3098  0,
3099  "X Rotation",
3100  "Use the pivot point in the positive rotation range around the X-axis"},
3101  {PIVOTCON_AXIS_Y,
3102  "Y",
3103  0,
3104  "Y Rotation",
3105  "Use the pivot point in the positive rotation range around the Y-axis"},
3106  {PIVOTCON_AXIS_Z,
3107  "Z",
3108  0,
3109  "Z Rotation",
3110  "Use the pivot point in the positive rotation range around the Z-axis"},
3111  {0, NULL, 0, NULL, NULL},
3112  };
3113 
3114  srna = RNA_def_struct(brna, "PivotConstraint", "Constraint");
3115  RNA_def_struct_ui_text(srna, "Pivot Constraint", "Rotate around a different point");
3116 
3118 
3119  RNA_def_struct_sdna_from(srna, "bPivotConstraint", "data");
3120 
3121  RNA_def_struct_ui_icon(srna, ICON_CON_PIVOT);
3122 
3124 
3125  /* target-defined pivot */
3126  prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
3127  RNA_def_property_pointer_sdna(prop, NULL, "tar");
3129  prop, "Target", "Target Object, defining the position of the pivot when defined");
3131  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3132 
3133  prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
3134  RNA_def_property_string_sdna(prop, NULL, "subtarget");
3135  RNA_def_property_ui_text(prop, "Sub-Target", "");
3136  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3137 
3138  /* pivot offset */
3139  prop = RNA_def_property(srna, "use_relative_location", PROP_BOOLEAN, PROP_NONE);
3142  prop,
3143  "Use Relative Offset",
3144  "Offset will be an absolute point in space instead of relative to the target");
3145  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3146 
3147  prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION);
3148  RNA_def_property_float_sdna(prop, NULL, "offset");
3150  "Offset",
3151  "Offset of pivot from target (when set), or from owner's location "
3152  "(when Fixed Position is off), or the absolute pivot point");
3153  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3154 
3155  /* rotation-based activation */
3156  prop = RNA_def_property(srna, "rotation_range", PROP_ENUM, PROP_NONE);
3157  RNA_def_property_enum_sdna(prop, NULL, "rotAxis");
3158  RNA_def_property_enum_items(prop, pivot_rotAxis_items);
3160  prop, "Enabled Rotation Range", "Rotation range on which pivoting should occur");
3161  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3162 
3164 }
3165 
3167 {
3168  StructRNA *srna;
3169  PropertyRNA *prop;
3170 
3171  static const EnumPropertyItem frame_method_items[] = {
3172  {FOLLOWTRACK_FRAME_STRETCH, "STRETCH", 0, "Stretch", ""},
3173  {FOLLOWTRACK_FRAME_FIT, "FIT", 0, "Fit", ""},
3174  {FOLLOWTRACK_FRAME_CROP, "CROP", 0, "Crop", ""},
3175  {0, NULL, 0, NULL, NULL},
3176  };
3177 
3178  srna = RNA_def_struct(brna, "FollowTrackConstraint", "Constraint");
3180  srna, "Follow Track Constraint", "Lock motion to the target motion track");
3181  RNA_def_struct_sdna_from(srna, "bFollowTrackConstraint", "data");
3182  RNA_def_struct_ui_icon(srna, ICON_CON_FOLLOWTRACK);
3183 
3185 
3186  /* movie clip */
3187  prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
3188  RNA_def_property_pointer_sdna(prop, NULL, "clip");
3189  RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from");
3191  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3192 
3193  /* track */
3194  prop = RNA_def_property(srna, "track", PROP_STRING, PROP_NONE);
3195  RNA_def_property_string_sdna(prop, NULL, "track");
3196  RNA_def_property_ui_text(prop, "Track", "Movie tracking track to follow");
3197  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3198 
3199  /* use default clip */
3200  prop = RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE);
3202  RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene");
3203  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3204 
3205  /* use 3d position */
3206  prop = RNA_def_property(srna, "use_3d_position", PROP_BOOLEAN, PROP_NONE);
3208  RNA_def_property_ui_text(prop, "3D Position", "Use 3D position of track to parent to");
3209  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3210 
3211  /* object */
3212  prop = RNA_def_property(srna, "object", PROP_STRING, PROP_NONE);
3213  RNA_def_property_string_sdna(prop, NULL, "object");
3215  prop, "Object", "Movie tracking object to follow (if empty, camera object is used)");
3216  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3217 
3218  /* camera */
3219  prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
3220  RNA_def_property_pointer_sdna(prop, NULL, "camera");
3222  prop, "Camera", "Camera to which motion is parented (if empty active scene camera is used)");
3224  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3226  NULL,
3227  "rna_Constraint_followTrack_camera_set",
3228  NULL,
3229  "rna_Constraint_cameraObject_poll");
3230 
3231  /* depth object */
3232  prop = RNA_def_property(srna, "depth_object", PROP_POINTER, PROP_NONE);
3233  RNA_def_property_pointer_sdna(prop, NULL, "depth_ob");
3235  prop,
3236  "Depth Object",
3237  "Object used to define depth in camera space by projecting onto surface of this object");
3239  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3241  NULL,
3242  "rna_Constraint_followTrack_depthObject_set",
3243  NULL,
3244  "rna_Constraint_followTrack_depthObject_poll");
3245 
3246  /* frame method */
3247  prop = RNA_def_property(srna, "frame_method", PROP_ENUM, PROP_NONE);
3248  RNA_def_property_enum_bitflag_sdna(prop, NULL, "frame_method");
3249  RNA_def_property_enum_items(prop, frame_method_items);
3250  RNA_def_property_ui_text(prop, "Frame Method", "How the footage fits in the camera frame");
3251  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3252 
3253  /* use undistortion */
3254  prop = RNA_def_property(srna, "use_undistorted_position", PROP_BOOLEAN, PROP_NONE);
3256  RNA_def_property_ui_text(prop, "Undistort", "Parent to undistorted position of 2D track");
3257  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3258 
3260 }
3261 
3263 {
3264  StructRNA *srna;
3265  PropertyRNA *prop;
3266 
3267  srna = RNA_def_struct(brna, "CameraSolverConstraint", "Constraint");
3269  srna, "Camera Solver Constraint", "Lock motion to the reconstructed camera movement");
3270  RNA_def_struct_sdna_from(srna, "bCameraSolverConstraint", "data");
3271  RNA_def_struct_ui_icon(srna, ICON_CON_CAMERASOLVER);
3272 
3274 
3275  /* movie clip */
3276  prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
3277  RNA_def_property_pointer_sdna(prop, NULL, "clip");
3278  RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from");
3280  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3281 
3282  /* use default clip */
3283  prop = RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE);
3285  RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene");
3286  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3287 
3289 }
3290 
3292 {
3293  StructRNA *srna;
3294  PropertyRNA *prop;
3295 
3296  srna = RNA_def_struct(brna, "ObjectSolverConstraint", "Constraint");
3298  srna, "Object Solver Constraint", "Lock motion to the reconstructed object movement");
3299  RNA_def_struct_sdna_from(srna, "bObjectSolverConstraint", "data");
3300  RNA_def_struct_ui_icon(srna, ICON_CON_OBJECTSOLVER);
3301 
3303 
3304  /* movie clip */
3305  prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
3306  RNA_def_property_pointer_sdna(prop, NULL, "clip");
3307  RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from");
3309  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3310 
3311  /* use default clip */
3312  prop = RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE);
3314  RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene");
3315  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3316 
3317  prop = RNA_def_property(srna, "set_inverse_pending", PROP_BOOLEAN, PROP_NONE);
3320  prop, "Set Inverse Pending", "Set to true to request recalculation of the inverse matrix");
3321  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3322 
3323  /* object */
3324  prop = RNA_def_property(srna, "object", PROP_STRING, PROP_NONE);
3325  RNA_def_property_string_sdna(prop, NULL, "object");
3326  RNA_def_property_ui_text(prop, "Object", "Movie tracking object to follow");
3327  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3328 
3329  /* camera */
3330  prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
3331  RNA_def_property_pointer_sdna(prop, NULL, "camera");
3333  prop, "Camera", "Camera to which motion is parented (if empty active scene camera is used)");
3335  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3337  NULL,
3338  "rna_Constraint_objectSolver_camera_set",
3339  NULL,
3340  "rna_Constraint_cameraObject_poll");
3341 
3343 }
3344 
3346 {
3347  StructRNA *srna;
3348  PropertyRNA *prop;
3349 
3350  srna = RNA_def_struct(brna, "TransformCacheConstraint", "Constraint");
3352  srna, "Transform Cache Constraint", "Look up transformation from an external file");
3353  RNA_def_struct_sdna_from(srna, "bTransformCacheConstraint", "data");
3354  RNA_def_struct_ui_icon(srna, ICON_CON_TRANSFORM_CACHE);
3355 
3357 
3358  prop = RNA_def_property(srna, "cache_file", PROP_POINTER, PROP_NONE);
3359  RNA_def_property_pointer_sdna(prop, NULL, "cache_file");
3360  RNA_def_property_struct_type(prop, "CacheFile");
3361  RNA_def_property_ui_text(prop, "Cache File", "");
3363  RNA_def_property_update(prop, 0, "rna_Constraint_dependency_update");
3364 
3365  prop = RNA_def_property(srna, "object_path", PROP_STRING, PROP_NONE);
3367  prop,
3368  "Object Path",
3369  "Path to the object in the Alembic archive used to lookup the transform matrix");
3370  RNA_def_property_update(prop, 0, "rna_Constraint_update");
3371 
3373 }
3374 
3375 /* base struct for constraints */
3377 {
3378  StructRNA *srna;
3379  PropertyRNA *prop;
3380 
3381  /* data */
3382  srna = RNA_def_struct(brna, "Constraint", NULL);
3384  srna, "Constraint", "Constraint modifying the transformation of objects and bones");
3385  RNA_def_struct_refine_func(srna, "rna_ConstraintType_refine");
3386  RNA_def_struct_path_func(srna, "rna_Constraint_path");
3387  RNA_def_struct_sdna(srna, "bConstraint");
3388 
3389  /* strings */
3390  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
3391  RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Constraint_name_set");
3392  RNA_def_property_ui_text(prop, "Name", "Constraint name");
3393  RNA_def_struct_name_property(srna, prop);
3395 
3396  /* enums */
3397  prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
3399  RNA_def_property_enum_sdna(prop, NULL, "type");
3401  RNA_def_property_ui_text(prop, "Type", "");
3402 
3404 
3405  prop = RNA_def_property(srna, "owner_space", PROP_ENUM, PROP_NONE);
3406  RNA_def_property_enum_sdna(prop, NULL, "ownspace");
3408  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_owner_space_itemf");
3409  RNA_def_property_ui_text(prop, "Owner Space", "Space that owner is evaluated in");
3410  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3411 
3412  prop = RNA_def_property(srna, "target_space", PROP_ENUM, PROP_NONE);
3413  RNA_def_property_enum_sdna(prop, NULL, "tarspace");
3415  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_target_space_itemf");
3416  RNA_def_property_ui_text(prop, "Target Space", "Space that target is evaluated in");
3417  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3418 
3419  prop = RNA_def_property(srna, "space_object", PROP_POINTER, PROP_NONE);
3420  RNA_def_property_pointer_sdna(prop, NULL, "space_object");
3421  RNA_def_property_ui_text(prop, "Object", "Object for Custom Space");
3424  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3425 
3426  prop = RNA_def_property(srna, "space_subtarget", PROP_STRING, PROP_NONE);
3427  RNA_def_property_string_sdna(prop, NULL, "space_subtarget");
3428  RNA_def_property_ui_text(prop, "Sub-Target", "Armature bone, mesh or lattice vertex group, ...");
3429  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3430 
3431  /* flags */
3432  prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
3434  RNA_def_property_ui_text(prop, "Disable", "Enable/Disable Constraint");
3435  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3436  RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
3437 
3438  prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
3440  RNA_def_property_boolean_sdna(prop, NULL, "ui_expand_flag", 0);
3441  RNA_def_property_ui_text(prop, "Expanded", "Constraint's panel is expanded in UI");
3442  RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);
3443 
3444  /* XXX this is really an internal flag,
3445  * but it may be useful for some tools to be able to access this... */
3446  prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
3449  RNA_def_property_ui_text(prop, "Valid", "Constraint has valid settings and can be evaluated");
3450 
3451  /* TODO: setting this to true must ensure that all others in stack are turned off too... */
3452  prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
3454  RNA_def_property_ui_text(prop, "Active", "Constraint is the one being edited");
3455 
3456  prop = RNA_def_property(srna, "is_proxy_local", PROP_BOOLEAN, PROP_NONE);
3460  prop,
3461  "Proxy Local",
3462  "Constraint was added in this proxy instance (i.e. did not belong to source Armature)");
3463 
3464  /* values */
3465  prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR);
3466  RNA_def_property_float_sdna(prop, NULL, "enforce");
3467  RNA_def_property_range(prop, 0.0f, 1.0f);
3469  prop, "Influence", "Amount of influence constraint will have on the final solution");
3470  RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_influence_update");
3471 
3472  /* readonly values */
3473  prop = RNA_def_property(srna, "error_location", PROP_FLOAT, PROP_NONE);
3474  RNA_def_property_float_sdna(prop, NULL, "lin_error");
3477  prop,
3478  "Lin error",
3479  "Amount of residual error in Blender space unit for constraints that work on position");
3480 
3481  prop = RNA_def_property(srna, "error_rotation", PROP_FLOAT, PROP_NONE);
3482  RNA_def_property_float_sdna(prop, NULL, "rot_error");
3485  prop,
3486  "Rotation error",
3487  "Amount of residual error in radians for constraints that work on orientation");
3488 
3490 
3491  /* pointers */
3494 
3524 }
3525 
3526 #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:1414
struct bConstraint * BKE_constraint_find_from_target(struct Object *ob, struct bConstraintTarget *tgt, struct bPoseChannel **r_pchan)
Definition: constraint.c:5865
const bConstraintTypeInfo * BKE_constraint_typeinfo_get(struct bConstraint *con)
Definition: constraint.c:5435
void BKE_constraint_unique_name(struct bConstraint *con, struct ListBase *list)
Definition: constraint.c:123
void id_lib_extern(struct ID *id)
Definition: lib_id.c:207
void BKE_report(ReportList *reports, ReportType type, const char *message)
Definition: report.c:104
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:281
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:547
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:110
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:38
#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
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, const size_t dst_maxncpy) ATTR_NONNULL()
Definition: string.c:333
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string_utf8.c:258
#define UNUSED(x)
#define ELEM(...)
#define N_(msgid)
@ POSE_LOCKED
@ POSE_DO_UNLOCK
@ CONSTRAINT_BBONE_SHAPE
@ CONSTRAINT_OFF
@ CONSTRAINT_PROXY_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
@ 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_LOCAL
@ CONSTRAINT_SPACE_PARLOCAL
@ ACTCON_MIX_BEFORE
@ ACTCON_MIX_AFTER_FULL
@ 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_BEFORE
@ TRANSLIKE_MIX_REPLACE
@ 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
@ 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.
StructRNA RNA_PythonConstraint
StructRNA RNA_FloorConstraint
StructRNA RNA_CopyRotationConstraint
StructRNA RNA_StretchToConstraint
StructRNA RNA_PivotConstraint
StructRNA RNA_CopyScaleConstraint
StructRNA RNA_ShrinkwrapConstraint
StructRNA RNA_TrackToConstraint
StructRNA RNA_KinematicConstraint
StructRNA RNA_LimitRotationConstraint
StructRNA RNA_LimitLocationConstraint
StructRNA RNA_ChildOfConstraint
StructRNA RNA_TransformConstraint
StructRNA RNA_CopyTransformsConstraint
StructRNA RNA_UnknownType
StructRNA RNA_LimitScaleConstraint
StructRNA RNA_FollowPathConstraint
StructRNA RNA_CopyLocationConstraint
StructRNA RNA_ClampToConstraint
StructRNA RNA_DampedTrackConstraint
StructRNA RNA_LimitDistanceConstraint
StructRNA RNA_LockedTrackConstraint
StructRNA RNA_ActionConstraint
StructRNA RNA_SplineIKConstraint
#define RNA_MAX_ARRAY_DIMENSION
Definition: RNA_define.h:42
@ PARM_RNAPTR
Definition: RNA_types.h:339
@ PARM_REQUIRED
Definition: RNA_types.h:337
@ FUNC_USE_REPORTS
Definition: RNA_types.h:578
@ FUNC_USE_MAIN
Definition: RNA_types.h:576
@ FUNC_USE_SELF_ID
Definition: RNA_types.h:565
@ PROP_FLOAT
Definition: RNA_types.h:75
@ PROP_BOOLEAN
Definition: RNA_types.h:73
@ PROP_ENUM
Definition: RNA_types.h:77
@ PROP_INT
Definition: RNA_types.h:74
@ PROP_STRING
Definition: RNA_types.h:76
@ PROP_POINTER
Definition: RNA_types.h:78
@ PROP_COLLECTION
Definition: RNA_types.h:79
#define RNA_TRANSLATION_PREC_DEFAULT
Definition: RNA_types.h:104
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition: RNA_types.h:297
@ PROP_THICK_WRAP
Definition: RNA_types.h:270
@ PROP_DYNAMIC
Definition: RNA_types.h:275
@ PROP_ANIMATABLE
Definition: RNA_types.h:188
@ PROP_EDITABLE
Definition: RNA_types.h:175
@ PROP_NEVER_NULL
Definition: RNA_types.h:225
@ PROP_NO_DEG_UPDATE
Definition: RNA_types.h:286
@ PROP_ID_SELF_CHECK
Definition: RNA_types.h:218
@ PROP_ID_REFCOUNT
Definition: RNA_types.h:212
@ PROP_TIME
Definition: RNA_types.h:133
@ PROP_MATRIX
Definition: RNA_types.h:144
@ PROP_DISTANCE
Definition: RNA_types.h:135
@ PROP_ANGLE
Definition: RNA_types.h:132
@ PROP_NONE
Definition: RNA_types.h:113
@ PROP_FACTOR
Definition: RNA_types.h:131
@ PROP_TRANSLATION
Definition: RNA_types.h:140
#define C
Definition: RandGen.cpp:39
#define ND_POSE
Definition: WM_types.h:359
#define ND_CONSTRAINT
Definition: WM_types.h:365
#define NA_RENAME
Definition: WM_types.h:466
#define NC_OBJECT
Definition: WM_types.h:280
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
Definition: btQuaternion.h:895
Scene scene
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
static const EnumPropertyItem mode_items[]
Definition: paint_mask.c:75
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:1167
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2762
void RNA_define_lib_overridable(const bool make_overridable)
Definition: rna_define.c:760
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
Definition: rna_define.c:1212
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4159
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2257
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1555
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
Definition: rna_define.c:3312
void RNA_def_property_float_default(PropertyRNA *prop, float value)
Definition: rna_define.c:2042
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4302
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3153
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1676
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2717
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
Definition: rna_define.c:1684
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4262
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
Definition: rna_define.c:3462
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1259
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2971
void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength)
Definition: rna_define.c:2953
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
Definition: rna_define.c:1629
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1892
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1067
void RNA_def_property_array(PropertyRNA *prop, int length)
Definition: rna_define.c:1568
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
Definition: rna_define.c:1757
void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const char *propname)
Definition: rna_define.c:1094
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1792
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
Definition: rna_define.c:2791
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4337
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
Definition: rna_define.c:2927
const int rna_matrix_dimsize_4x4[]
Definition: rna_define.c:1626
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3251
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1279
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2691
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
Definition: rna_define.c:1122
void RNA_def_function_flag(FunctionRNA *func, int flag)
Definition: rna_define.c:4332
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1517
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:3373
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1047
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2623
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
Definition: rna_define.c:1267
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1512
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2515
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
Definition: rna_define.c:1706
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2364
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
Definition: rna_define.c:2348
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
Definition: rna_define.c:1525
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1547
const EnumPropertyItem rna_enum_driver_target_rotation_mode_items[]
Definition: rna_fcurve.c:151
const EnumPropertyItem rna_enum_axis_xyz_items[]
Definition: rna_modifier.c:584
const EnumPropertyItem rna_enum_modifier_shrinkwrap_mode_items[]
Definition: rna_modifier.c:352
const EnumPropertyItem rna_enum_object_axis_items[]
Definition: rna_object.c:302
#define min(a, b)
Definition: sort.c:51
Definition: DNA_ID.h:273
char name[66]
Definition: DNA_ID.h:283
void * first
Definition: DNA_listBase.h:47
Definition: BKE_main.h:116
ListBase constraints
struct bPose * pose
void * data
Definition: RNA_types.h:52
struct ID * owner_id
Definition: RNA_types.h:50
struct bConstraintTarget * next
short flag
float max
PointerRNA * ptr
Definition: wm_files.c:3157