Blender V4.3
rna_constraint.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <cstdlib>
10
11#include "MEM_guardedalloc.h"
12
13#include "BLI_math_rotation.h"
14
15#include "BLT_translation.hh"
16
17#include "DNA_action_types.h"
19#include "DNA_modifier_types.h"
20#include "DNA_object_types.h"
21#include "DNA_scene_types.h"
22
23#include "RNA_define.hh"
24#include "RNA_enum_types.hh"
25
26#include "rna_internal.hh"
27
28#include "WM_types.hh"
29
30#include "ED_object.hh"
31
32#ifdef WITH_ANIM_BAKLAVA
33# include "ANIM_action.hh"
34# include "rna_action_tools.hh"
35#endif
36
37/* Please keep the names in sync with `constraint.cc`. */
39 RNA_ENUM_ITEM_HEADING(N_("Motion Tracking"), nullptr),
40 {CONSTRAINT_TYPE_CAMERASOLVER, "CAMERA_SOLVER", ICON_CON_CAMERASOLVER, "Camera Solver", ""},
41 {CONSTRAINT_TYPE_FOLLOWTRACK, "FOLLOW_TRACK", ICON_CON_FOLLOWTRACK, "Follow Track", ""},
42 {CONSTRAINT_TYPE_OBJECTSOLVER, "OBJECT_SOLVER", ICON_CON_OBJECTSOLVER, "Object Solver", ""},
43
44 RNA_ENUM_ITEM_HEADING(N_("Transform"), nullptr),
46 "COPY_LOCATION",
47 ICON_CON_LOCLIKE,
48 "Copy Location",
49 "Copy the location of a target (with an optional offset), so that they move together"},
51 "COPY_ROTATION",
52 ICON_CON_ROTLIKE,
53 "Copy Rotation",
54 "Copy the rotation of a target (with an optional offset), so that they rotate together"},
56 "COPY_SCALE",
57 ICON_CON_SIZELIKE,
58 "Copy Scale",
59 "Copy the scale factors of a target (with an optional offset), so that they are scaled by "
60 "the same amount"},
62 "COPY_TRANSFORMS",
63 ICON_CON_TRANSLIKE,
64 "Copy Transforms",
65 "Copy all the transformations of a target, so that they move together"},
67 "LIMIT_DISTANCE",
68 ICON_CON_DISTLIMIT,
69 "Limit Distance",
70 "Restrict movements to within a certain distance of a target (at the time of constraint "
71 "evaluation only)"},
73 "LIMIT_LOCATION",
74 ICON_CON_LOCLIMIT,
75 "Limit Location",
76 "Restrict movement along each axis within given ranges"},
78 "LIMIT_ROTATION",
79 ICON_CON_ROTLIMIT,
80 "Limit Rotation",
81 "Restrict rotation along each axis within given ranges"},
83 "LIMIT_SCALE",
84 ICON_CON_SIZELIMIT,
85 "Limit Scale",
86 "Restrict scaling along each axis with given ranges"},
88 "MAINTAIN_VOLUME",
89 ICON_CON_SAMEVOL,
90 "Maintain Volume",
91 "Compensate for scaling one axis by applying suitable scaling to the other two axes"},
93 "TRANSFORM",
94 ICON_CON_TRANSFORM,
95 "Transformation",
96 "Use one transform property from target to control another (or same) property on owner"},
98 "TRANSFORM_CACHE",
99 ICON_CON_TRANSFORM_CACHE,
100 "Transform Cache",
101 "Look up the transformation matrix from an external file"},
102
103 RNA_ENUM_ITEM_HEADING(N_("Tracking"), nullptr),
105 "CLAMP_TO",
106 ICON_CON_CLAMPTO,
107 "Clamp To",
108 "Restrict movements to lie along a curve by remapping location along curve's longest axis"},
110 "DAMPED_TRACK",
111 ICON_CON_TRACKTO,
112 "Damped Track",
113 "Point towards a target by performing the smallest rotation necessary"},
115 "IK",
116 ICON_CON_KINEMATIC,
117 "Inverse Kinematics",
118 "Control a chain of bones by specifying the endpoint target (Bones only)"},
120 "LOCKED_TRACK",
121 ICON_CON_LOCKTRACK,
122 "Locked Track",
123 "Rotate around the specified ('locked') axis to point towards a target"},
125 "SPLINE_IK",
126 ICON_CON_SPLINEIK,
127 "Spline IK",
128 "Align chain of bones along a curve (Bones only)"},
130 "STRETCH_TO",
131 ICON_CON_STRETCHTO,
132 "Stretch To",
133 "Stretch along Y-Axis to point towards a target"},
135 "TRACK_TO",
136 ICON_CON_TRACKTO,
137 "Track To",
138 "Legacy tracking constraint prone to twisting artifacts"},
139
140 RNA_ENUM_ITEM_HEADING(N_("Relationship"), nullptr),
142 "ACTION",
143 ICON_ACTION,
144 "Action",
145 "Use transform property of target to look up pose for owner from an Action"},
147 "ARMATURE",
148 ICON_CON_ARMATURE,
149 "Armature",
150 "Apply weight-blended transformation from multiple bones like the Armature modifier"},
152 "CHILD_OF",
153 ICON_CON_CHILDOF,
154 "Child Of",
155 "Make target the 'detachable' parent of owner"},
157 "FLOOR",
158 ICON_CON_FLOOR,
159 "Floor",
160 "Use position (and optionally rotation) of target to define a 'wall' or 'floor' that the "
161 "owner cannot cross"},
163 "FOLLOW_PATH",
164 ICON_CON_FOLLOWPATH,
165 "Follow Path",
166 "Use to animate an object/bone following a path"},
168 "PIVOT",
169 ICON_CON_PIVOT,
170 "Pivot",
171 "Change pivot point for transforms (buggy)"},
172#if 0
173 {CONSTRAINT_TYPE_RIGIDBODYJOINT,
174 "RIGID_BODY_JOINT",
175 ICON_CONSTRAINT_DATA,
176 "Rigid Body Joint",
177 "Use to define a Rigid Body Constraint (for Game Engine use only)"},
179 "SCRIPT",
180 ICON_CONSTRAINT_DATA,
181 "Script",
182 "Custom constraint(s) written in Python (Not yet implemented)"},
183#endif
185 "SHRINKWRAP",
186 ICON_CON_SHRINKWRAP,
187 "Shrinkwrap",
188 "Restrict movements to surface of target mesh"},
189 {0, nullptr, 0, nullptr, nullptr},
190};
191
194 "WORLD",
195 0,
196 "World Space",
197 "The transformation of the target is evaluated relative to the world "
198 "coordinate system"},
200 "CUSTOM",
201 0,
202 "Custom Space",
203 "The transformation of the target is evaluated relative to a custom object/bone/vertex "
204 "group"},
207 "POSE",
208 0,
209 "Pose Space",
210 "The transformation of the target is only evaluated in the Pose Space, "
211 "the target armature object transformation is ignored"},
213 "LOCAL_WITH_PARENT",
214 0,
215 "Local With Parent",
216 "The transformation of the target bone is evaluated relative to its rest pose "
217 "local coordinate system, thus including the parent-induced transformation"},
219 "LOCAL",
220 0,
221 "Local Space",
222 "The transformation of the target is evaluated relative to its local "
223 "coordinate system"},
225 "LOCAL_OWNER_ORIENT",
226 0,
227 "Local Space (Owner Orientation)",
228 "The transformation of the target bone is evaluated relative to its local coordinate "
229 "system, followed by a correction for the difference in target and owner rest pose "
230 "orientations. When applied as local transform to the owner produces the same global "
231 "motion as the target if the parents are still in rest pose."},
232 {0, nullptr, 0, nullptr, nullptr},
233};
234
237 "WORLD",
238 0,
239 "World Space",
240 "The constraint is applied relative to the world coordinate system"},
242 "CUSTOM",
243 0,
244 "Custom Space",
245 "The constraint is applied in local space of a custom object/bone/vertex group"},
248 "POSE",
249 0,
250 "Pose Space",
251 "The constraint is applied in Pose Space, the object transformation is ignored"},
253 "LOCAL_WITH_PARENT",
254 0,
255 "Local With Parent",
256 "The constraint is applied relative to the rest pose local coordinate system "
257 "of the bone, thus including the parent-induced transformation"},
259 "LOCAL",
260 0,
261 "Local Space",
262 "The constraint is applied relative to the local coordinate system of the object"},
263 {0, nullptr, 0, nullptr, nullptr},
264};
265
267 {TRACK_X, "TRACK_X", 0, "X", ""},
268 {TRACK_Y, "TRACK_Y", 0, "Y", ""},
269 {TRACK_Z, "TRACK_Z", 0, "Z", ""},
270 {TRACK_nX, "TRACK_NEGATIVE_X", 0, "-X", ""},
271 {TRACK_nY, "TRACK_NEGATIVE_Y", 0, "-Y", ""},
272 {TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""},
273 {0, nullptr, 0, nullptr, nullptr},
274};
275
277 {CONSTRAINT_EULER_AUTO, "AUTO", 0, "Default", "Euler using the default rotation order"},
278 {CONSTRAINT_EULER_XYZ, "XYZ", 0, "XYZ Euler", "Euler using the XYZ rotation order"},
279 {CONSTRAINT_EULER_XZY, "XZY", 0, "XZY Euler", "Euler using the XZY rotation order"},
280 {CONSTRAINT_EULER_YXZ, "YXZ", 0, "YXZ Euler", "Euler using the YXZ rotation order"},
281 {CONSTRAINT_EULER_YZX, "YZX", 0, "YZX Euler", "Euler using the YZX rotation order"},
282 {CONSTRAINT_EULER_ZXY, "ZXY", 0, "ZXY Euler", "Euler using the ZXY rotation order"},
283 {CONSTRAINT_EULER_ZYX, "ZYX", 0, "ZYX Euler", "Euler using the ZYX rotation order"},
284 {0, nullptr, 0, nullptr, nullptr},
285};
286
287#ifdef RNA_RUNTIME
288
289static const EnumPropertyItem owner_space_object_items[] = {
291 "WORLD",
292 0,
293 "World Space",
294 "The constraint is applied relative to the world coordinate system"},
296 "CUSTOM",
297 0,
298 "Custom Space",
299 "The constraint is applied in local space of a custom object/bone/vertex group"},
301 "LOCAL",
302 0,
303 "Local Space",
304 "The constraint is applied relative to the local coordinate system of the object"},
305 {0, nullptr, 0, nullptr, nullptr},
306};
307
308static const EnumPropertyItem target_space_object_items[] = {
310 "WORLD",
311 0,
312 "World Space",
313 "The transformation of the target is evaluated relative to the world coordinate system"},
315 "CUSTOM",
316 0,
317 "Custom Space",
318 "The transformation of the target is evaluated relative to a custom object/bone/vertex "
319 "group"},
321 "LOCAL",
322 0,
323 "Local Space",
324 "The transformation of the target is evaluated relative to its local coordinate system"},
325 {0, nullptr, 0, nullptr, nullptr},
326};
327
328# include <fmt/format.h>
329
330# include "DNA_cachefile_types.h"
331
332# include "BKE_action.hh"
333# include "BKE_animsys.h"
334# include "BKE_constraint.h"
335# include "BKE_context.hh"
336
337# ifdef WITH_ALEMBIC
338# include "ABC_alembic.h"
339# endif
340
341static StructRNA *rna_ConstraintType_refine(PointerRNA *ptr)
342{
343 bConstraint *con = (bConstraint *)ptr->data;
344
345 switch (con->type) {
347 return &RNA_ChildOfConstraint;
349 return &RNA_TrackToConstraint;
351 return &RNA_KinematicConstraint;
353 return &RNA_FollowPathConstraint;
355 return &RNA_CopyRotationConstraint;
357 return &RNA_CopyLocationConstraint;
359 return &RNA_CopyScaleConstraint;
361 return &RNA_MaintainVolumeConstraint;
363 return &RNA_PythonConstraint;
365 return &RNA_ArmatureConstraint;
367 return &RNA_ActionConstraint;
369 return &RNA_LockedTrackConstraint;
371 return &RNA_StretchToConstraint;
373 return &RNA_FloorConstraint;
375 return &RNA_ClampToConstraint;
377 return &RNA_TransformConstraint;
379 return &RNA_LimitRotationConstraint;
381 return &RNA_LimitLocationConstraint;
383 return &RNA_LimitScaleConstraint;
385 return &RNA_LimitDistanceConstraint;
387 return &RNA_ShrinkwrapConstraint;
389 return &RNA_DampedTrackConstraint;
391 return &RNA_SplineIKConstraint;
393 return &RNA_CopyTransformsConstraint;
395 return &RNA_PivotConstraint;
397 return &RNA_FollowTrackConstraint;
399 return &RNA_CameraSolverConstraint;
401 return &RNA_ObjectSolverConstraint;
403 return &RNA_TransformCacheConstraint;
404 default:
405 return &RNA_UnknownType;
406 }
407}
408
409static void rna_ConstraintTargetBone_target_set(PointerRNA *ptr,
410 PointerRNA value,
411 ReportList * /*reports*/)
412{
414 Object *ob = static_cast<Object *>(value.data);
415
416 if (!ob || ob->type == OB_ARMATURE) {
417 id_lib_extern((ID *)ob);
418 tgt->tar = ob;
419 }
420}
421
422static void rna_Constraint_name_set(PointerRNA *ptr, const char *value)
423{
424 bConstraint *con = static_cast<bConstraint *>(ptr->data);
425 char oldname[sizeof(con->name)];
426
427 /* make a copy of the old name first */
428 STRNCPY(oldname, con->name);
429
430 /* copy the new name into the name slot */
431 STRNCPY_UTF8(con->name, value);
432
433 /* make sure name is unique */
434 if (ptr->owner_id) {
435 Object *ob = (Object *)ptr->owner_id;
437
438 /* if we have the list, check for unique name, otherwise give up */
439 if (list) {
441 }
442 }
443
444 /* fix all the animation data which may link to this */
445 BKE_animdata_fix_paths_rename_all(nullptr, "constraints", oldname, con->name);
446}
447
448static std::optional<std::string> rna_Constraint_do_compute_path(Object *ob, bConstraint *con)
449{
450 bPoseChannel *pchan;
452
453 if (lb == nullptr) {
454 printf("%s: internal error, constraint '%s' not found in object '%s'\n",
455 __func__,
456 con->name,
457 ob->id.name);
458 }
459
460 if (pchan) {
461 char name_esc_pchan[sizeof(pchan->name) * 2];
462 char name_esc_const[sizeof(con->name) * 2];
463 BLI_str_escape(name_esc_pchan, pchan->name, sizeof(name_esc_pchan));
464 BLI_str_escape(name_esc_const, con->name, sizeof(name_esc_const));
465 return fmt::format("pose.bones[\"{}\"].constraints[\"{}\"]", name_esc_pchan, name_esc_const);
466 }
467 char name_esc_const[sizeof(con->name) * 2];
468 BLI_str_escape(name_esc_const, con->name, sizeof(name_esc_const));
469 return fmt::format("constraints[\"{}\"]", name_esc_const);
470}
471
472static std::optional<std::string> rna_Constraint_path(const PointerRNA *ptr)
473{
474 Object *ob = (Object *)ptr->owner_id;
475 bConstraint *con = static_cast<bConstraint *>(ptr->data);
476
477 return rna_Constraint_do_compute_path(ob, con);
478}
479
480static bConstraint *rna_constraint_from_target(const PointerRNA *ptr)
481{
482 Object *ob = (Object *)ptr->owner_id;
483 bConstraintTarget *tgt = static_cast<bConstraintTarget *>(ptr->data);
484
485 return BKE_constraint_find_from_target(ob, tgt, nullptr);
486}
487
488static std::optional<std::string> rna_ConstraintTarget_path(const PointerRNA *ptr)
489{
490 Object *ob = (Object *)ptr->owner_id;
491 bConstraintTarget *tgt = static_cast<bConstraintTarget *>(ptr->data);
492 bConstraint *con = rna_constraint_from_target(ptr);
493 int index = -1;
494
495 if (con != nullptr) {
496 if (con->type == CONSTRAINT_TYPE_ARMATURE) {
497 bArmatureConstraint *acon = static_cast<bArmatureConstraint *>(con->data);
498 index = BLI_findindex(&acon->targets, tgt);
499 }
500 else if (con->type == CONSTRAINT_TYPE_PYTHON) {
501 bPythonConstraint *pcon = static_cast<bPythonConstraint *>(con->data);
502 index = BLI_findindex(&pcon->targets, tgt);
503 }
504 }
505
506 if (index >= 0) {
507 return fmt::format(
508 "{}.targets[{}]", rna_Constraint_do_compute_path(ob, con).value_or(""), index);
509 }
510 printf("%s: internal error, constraint '%s' of object '%s' does not contain the target\n",
511 __func__,
512 con->name,
513 ob->id.name);
514
515 return std::nullopt;
516}
517
518static void rna_Constraint_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
519{
521 bmain, (Object *)ptr->owner_id, static_cast<bConstraint *>(ptr->data));
522}
523
524static void rna_Constraint_dependency_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
525{
527 bmain, (Object *)ptr->owner_id, static_cast<bConstraint *>(ptr->data));
528}
529
530static void rna_ConstraintTarget_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
531{
533 bmain, (Object *)ptr->owner_id, rna_constraint_from_target(ptr));
534}
535
536static void rna_ConstraintTarget_dependency_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
537{
539 bmain, (Object *)ptr->owner_id, rna_constraint_from_target(ptr));
540}
541
542static void rna_Constraint_influence_update(Main *bmain, Scene *scene, PointerRNA *ptr)
543{
544 Object *ob = (Object *)ptr->owner_id;
545
546 if (ob->pose) {
548 }
549
550 rna_Constraint_update(bmain, scene, ptr);
551}
552
553/* Update only needed so this isn't overwritten on first evaluation. */
554static void rna_Constraint_childof_inverse_matrix_update(Main *bmain,
555 Scene *scene,
557{
558 bConstraint *con = static_cast<bConstraint *>(ptr->data);
559 bChildOfConstraint *data = static_cast<bChildOfConstraint *>(con->data);
560 data->flag &= ~CHILDOF_SET_INVERSE;
561 rna_Constraint_update(bmain, scene, ptr);
562}
563
564static void rna_Constraint_ik_type_set(PointerRNA *ptr, int value)
565{
566 bConstraint *con = static_cast<bConstraint *>(ptr->data);
567 bKinematicConstraint *ikdata = static_cast<bKinematicConstraint *>(con->data);
568
569 if (ikdata->type != value) {
570 /* the type of IK constraint has changed, set suitable default values */
571 /* in case constraints reuse same fields incompatible */
572 switch (value) {
574 break;
576 break;
577 }
578 ikdata->type = value;
579 }
580}
581
582/* DEPRECATED: use_offset replaced with mix_mode */
583static bool rna_Constraint_RotLike_use_offset_get(PointerRNA *ptr)
584{
585 bConstraint *con = static_cast<bConstraint *>(ptr->data);
586 bRotateLikeConstraint *rotlike = static_cast<bRotateLikeConstraint *>(con->data);
587 return rotlike->mix_mode != ROTLIKE_MIX_REPLACE;
588}
589
590static void rna_Constraint_RotLike_use_offset_set(PointerRNA *ptr, bool value)
591{
592 bConstraint *con = static_cast<bConstraint *>(ptr->data);
593 bRotateLikeConstraint *rotlike = static_cast<bRotateLikeConstraint *>(con->data);
594 bool curval = (rotlike->mix_mode != ROTLIKE_MIX_REPLACE);
595 if (curval != value) {
596 rotlike->mix_mode = (value ? ROTLIKE_MIX_OFFSET : ROTLIKE_MIX_REPLACE);
597 }
598}
599
600static const EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext * /*C*/,
602 PropertyRNA * /*prop*/,
603 bool * /*r_free*/)
604{
605 Object *ob = (Object *)ptr->owner_id;
606 bConstraint *con = (bConstraint *)ptr->data;
607
608 if (BLI_findindex(&ob->constraints, con) == -1) {
610 }
611 else {
612 /* object */
613 return owner_space_object_items;
614 }
615}
616
617static const EnumPropertyItem *rna_Constraint_target_space_itemf(bContext * /*C*/,
619 PropertyRNA * /*prop*/,
620 bool * /*r_free*/)
621{
622 bConstraint *con = (bConstraint *)ptr->data;
623 ListBase targets = {nullptr, nullptr};
625
626 if (BKE_constraint_targets_get(con, &targets)) {
627 for (ct = static_cast<bConstraintTarget *>(targets.first); ct; ct = ct->next) {
628 if (ct->tar && ct->tar->type == OB_ARMATURE && !(ct->flag & CONSTRAINT_TAR_CUSTOM_SPACE)) {
629 break;
630 }
631 }
632
633 BKE_constraint_targets_flush(con, &targets, 1);
634
635 if (ct) {
637 }
638 }
639
640 return target_space_object_items;
641}
642
643static bConstraintTarget *rna_ArmatureConstraint_target_new(ID *id, bConstraint *con, Main *bmain)
644{
645 bArmatureConstraint *acon = static_cast<bArmatureConstraint *>(con->data);
646 bConstraintTarget *tgt = static_cast<bConstraintTarget *>(
647 MEM_callocN(sizeof(bConstraintTarget), "Constraint Target"));
648
649 tgt->weight = 1.0f;
650 BLI_addtail(&acon->targets, tgt);
651
653 return tgt;
654}
655
656static void rna_ArmatureConstraint_target_remove(
657 ID *id, bConstraint *con, Main *bmain, ReportList *reports, PointerRNA *target_ptr)
658{
659 bArmatureConstraint *acon = static_cast<bArmatureConstraint *>(con->data);
660 bConstraintTarget *tgt = static_cast<bConstraintTarget *>(target_ptr->data);
661
662 if (BLI_findindex(&acon->targets, tgt) == -1) {
663 BKE_report(reports, RPT_ERROR, "Target is not in the constraint target list");
664 return;
665 }
666
667 BLI_freelinkN(&acon->targets, tgt);
668
670}
671
672static void rna_ArmatureConstraint_target_clear(ID *id, bConstraint *con, Main *bmain)
673{
674 bArmatureConstraint *acon = static_cast<bArmatureConstraint *>(con->data);
675
676 BLI_freelistN(&acon->targets);
677
679}
680
681static void rna_ActionConstraint_mix_mode_set(PointerRNA *ptr, int value)
682{
683 bConstraint *con = (bConstraint *)ptr->data;
685
686 acon->mix_mode = value;
687
688 /* The After mode can be computed in world space for efficiency
689 * and backward compatibility, while Before or Split requires Local. */
692 }
693 else {
695 }
696}
697
698static void rna_ActionConstraint_minmax_range(
699 PointerRNA *ptr, float *min, float *max, float * /*softmin*/, float * /*softmax*/)
700{
701 bConstraint *con = (bConstraint *)ptr->data;
703
704 /* 0, 1, 2 = magic numbers for rotX, rotY, rotZ */
705 if (ELEM(acon->type, 0, 1, 2)) {
706 *min = -180.0f;
707 *max = 180.0f;
708 }
709 else {
710 *min = -1000.0f;
711 *max = 1000.0f;
712 }
713}
714
715# ifdef WITH_ANIM_BAKLAVA
716static void rna_ActionConstraint_action_slot_handle_set(
717 PointerRNA *ptr, const blender::animrig::slot_handle_t new_slot_handle)
718{
719 bConstraint *con = (bConstraint *)ptr->data;
721
722 rna_generic_action_slot_handle_set(new_slot_handle,
723 *ptr->owner_id,
724 acon->act,
725 acon->action_slot_handle,
726 acon->action_slot_name);
727}
728
729static PointerRNA rna_ActionConstraint_action_slot_get(PointerRNA *ptr)
730{
731 bConstraint *con = (bConstraint *)ptr->data;
733
734 return rna_generic_action_slot_get(acon->act, acon->action_slot_handle);
735}
736
737static void rna_ActionConstraint_action_slot_set(PointerRNA *ptr,
738 PointerRNA value,
739 ReportList *reports)
740{
741 bConstraint *con = (bConstraint *)ptr->data;
743
744 rna_generic_action_slot_set(
745 value, *ptr->owner_id, acon->act, acon->action_slot_handle, acon->action_slot_name, reports);
746}
747
748static void rna_iterator_ActionConstraint_action_slots_begin(CollectionPropertyIterator *iter,
750{
751 bConstraint *con = (bConstraint *)ptr->data;
753
754 rna_iterator_generic_action_slots_begin(iter, acon->act);
755}
756# endif /* WITH_ANIM_BAKLAVA */
757
758static int rna_SplineIKConstraint_joint_bindings_get_length(const PointerRNA *ptr,
759 int length[RNA_MAX_ARRAY_DIMENSION])
760{
761 const bConstraint *con = (bConstraint *)ptr->data;
762 const bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data;
763
764 if (ikData) {
765 length[0] = ikData->numpoints;
766 }
767 else {
768 length[0] = 0;
769 }
770
771 return length[0];
772}
773
774static void rna_SplineIKConstraint_joint_bindings_get(PointerRNA *ptr, float *values)
775{
776 bConstraint *con = (bConstraint *)ptr->data;
778
779 memcpy(values, ikData->points, ikData->numpoints * sizeof(float));
780}
781
782static void rna_SplineIKConstraint_joint_bindings_set(PointerRNA *ptr, const float *values)
783{
784 bConstraint *con = (bConstraint *)ptr->data;
786
787 memcpy(ikData->points, values, ikData->numpoints * sizeof(float));
788}
789
790static int rna_ShrinkwrapConstraint_face_cull_get(PointerRNA *ptr)
791{
792 bConstraint *con = (bConstraint *)ptr->data;
794 return swc->flag & CON_SHRINKWRAP_PROJECT_CULL_MASK;
795}
796
797static void rna_ShrinkwrapConstraint_face_cull_set(PointerRNA *ptr, int value)
798{
799 bConstraint *con = (bConstraint *)ptr->data;
801 swc->flag = (swc->flag & ~CON_SHRINKWRAP_PROJECT_CULL_MASK) | value;
802}
803
804static bool rna_Constraint_cameraObject_poll(PointerRNA *ptr, PointerRNA value)
805{
806 Object *ob = (Object *)value.data;
807
808 if (ob) {
809 if (ob->type == OB_CAMERA && ob != (Object *)ptr->owner_id) {
810 return 1;
811 }
812 }
813
814 return 0;
815}
816
817static void rna_Constraint_followTrack_camera_set(PointerRNA *ptr,
818 PointerRNA value,
819 ReportList * /*reports*/)
820{
821 bConstraint *con = (bConstraint *)ptr->data;
823 Object *ob = (Object *)value.data;
824
825 if (ob) {
826 if (ob->type == OB_CAMERA && ob != (Object *)ptr->owner_id) {
827 data->camera = ob;
828 id_lib_extern((ID *)ob);
829 }
830 }
831 else {
832 data->camera = nullptr;
833 }
834}
835
836static void rna_Constraint_followTrack_depthObject_set(PointerRNA *ptr,
837 PointerRNA value,
838 ReportList * /*reports*/)
839{
840 bConstraint *con = (bConstraint *)ptr->data;
842 Object *ob = (Object *)value.data;
843
844 if (ob) {
845 if (ob->type == OB_MESH && ob != (Object *)ptr->owner_id) {
846 data->depth_ob = ob;
847 id_lib_extern((ID *)ob);
848 }
849 }
850 else {
851 data->depth_ob = nullptr;
852 }
853}
854
855static bool rna_Constraint_followTrack_depthObject_poll(PointerRNA *ptr, PointerRNA value)
856{
857 Object *ob = (Object *)value.data;
858
859 if (ob) {
860 if (ob->type == OB_MESH && ob != (Object *)ptr->owner_id) {
861 return 1;
862 }
863 }
864
865 return 0;
866}
867
868static void rna_Constraint_objectSolver_camera_set(PointerRNA *ptr,
869 PointerRNA value,
870 ReportList * /*reports*/)
871{
872 bConstraint *con = (bConstraint *)ptr->data;
874 Object *ob = (Object *)value.data;
875
876 if (ob) {
877 if (ob->type == OB_CAMERA && ob != (Object *)ptr->owner_id) {
878 data->camera = ob;
879 id_lib_extern((ID *)ob);
880 }
881 }
882 else {
883 data->camera = nullptr;
884 }
885}
886
887#else
888
891 "LIMITDIST_INSIDE",
892 0,
893 "Inside",
894 "The object is constrained inside a virtual sphere around the target object, "
895 "with a radius defined by the limit distance"},
897 "LIMITDIST_OUTSIDE",
898 0,
899 "Outside",
900 "The object is constrained outside a virtual sphere around the target object, "
901 "with a radius defined by the limit distance"},
903 "LIMITDIST_ONSURFACE",
904 0,
905 "On Surface",
906 "The object is constrained on the surface of a virtual sphere around the target object, "
907 "with a radius defined by the limit distance"},
908 {0, nullptr, 0, nullptr, nullptr},
909};
910
912{
913 PropertyRNA *prop;
914
916
917 prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
918 RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
919 RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head is 0, Tail is 1");
920 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
921
922 prop = RNA_def_property(srna, "use_bbone_shape", PROP_BOOLEAN, PROP_NONE);
923 RNA_def_property_boolean_sdna(prop, "bConstraint", "flag", CONSTRAINT_BBONE_SHAPE);
925 "Follow B-Bone",
926 "Follow shape of B-Bone segments when calculating Head/Tail position");
927 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
928
930}
931
933{
934 PropertyRNA *prop;
935
937
938 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
939 RNA_def_property_pointer_sdna(prop, nullptr, "tar");
940 RNA_def_property_ui_text(prop, "Target", "Target object");
942 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
943
944 prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
945 RNA_def_property_string_sdna(prop, nullptr, "subtarget");
946 RNA_def_property_ui_text(prop, "Sub-Target", "Armature bone, mesh or lattice vertex group, ...");
947 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
948
950}
951
953{
954 StructRNA *srna;
955 PropertyRNA *prop;
956
957 srna = RNA_def_struct(brna, "ConstraintTarget", nullptr);
958 RNA_def_struct_ui_text(srna, "Constraint Target", "Target object for multi-target constraints");
959 RNA_def_struct_path_func(srna, "rna_ConstraintTarget_path");
960 RNA_def_struct_sdna(srna, "bConstraintTarget");
961
963
964 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
965 RNA_def_property_pointer_sdna(prop, nullptr, "tar");
966 RNA_def_property_ui_text(prop, "Target", "Target object");
969 prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_dependency_update");
970
971 prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
972 RNA_def_property_string_sdna(prop, nullptr, "subtarget");
973 RNA_def_property_ui_text(prop, "Sub-Target", "Armature bone, mesh or lattice vertex group, ...");
975 prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_dependency_update");
976
977 /* space, flag and type still to do. */
978
980}
981
983{
984 StructRNA *srna;
985 PropertyRNA *prop;
986
987 srna = RNA_def_struct(brna, "ConstraintTargetBone", nullptr);
989 srna, "Constraint Target Bone", "Target bone for multi-target constraints");
990 RNA_def_struct_path_func(srna, "rna_ConstraintTarget_path");
991 RNA_def_struct_sdna(srna, "bConstraintTarget");
992
994
995 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
996 RNA_def_property_pointer_sdna(prop, nullptr, "tar");
997 RNA_def_property_ui_text(prop, "Target", "Target armature");
999 prop, nullptr, "rna_ConstraintTargetBone_target_set", nullptr, "rna_Armature_object_poll");
1002 prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_dependency_update");
1003
1004 prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
1005 RNA_def_property_string_sdna(prop, nullptr, "subtarget");
1006 RNA_def_property_ui_text(prop, "Sub-Target", "Target armature bone");
1008 prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_dependency_update");
1009
1010 prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
1011 RNA_def_property_float_sdna(prop, nullptr, "weight");
1012 RNA_def_property_range(prop, 0.0f, 1.0f);
1013 RNA_def_property_ui_text(prop, "Blend Weight", "Blending weight of this bone");
1014 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_update");
1015
1017}
1018
1020{
1021 StructRNA *srna;
1022 PropertyRNA *prop;
1023
1024 srna = RNA_def_struct(brna, "ChildOfConstraint", "Constraint");
1026 srna, "Child Of Constraint", "Create constraint-based parent-child relationship");
1027 RNA_def_struct_sdna_from(srna, "bChildOfConstraint", "data");
1028 RNA_def_struct_ui_icon(srna, ICON_CON_CHILDOF);
1029
1031
1033
1034 prop = RNA_def_property(srna, "use_location_x", PROP_BOOLEAN, PROP_NONE);
1035 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CHILDOF_LOCX);
1036 RNA_def_property_ui_text(prop, "Location X", "Use X Location of Parent");
1037 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1038
1039 prop = RNA_def_property(srna, "use_location_y", PROP_BOOLEAN, PROP_NONE);
1040 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CHILDOF_LOCY);
1041 RNA_def_property_ui_text(prop, "Location Y", "Use Y Location of Parent");
1042 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1043
1044 prop = RNA_def_property(srna, "use_location_z", PROP_BOOLEAN, PROP_NONE);
1045 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CHILDOF_LOCZ);
1046 RNA_def_property_ui_text(prop, "Location Z", "Use Z Location of Parent");
1047 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1048
1049 prop = RNA_def_property(srna, "use_rotation_x", PROP_BOOLEAN, PROP_NONE);
1050 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CHILDOF_ROTX);
1051 RNA_def_property_ui_text(prop, "Rotation X", "Use X Rotation of Parent");
1052 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1053
1054 prop = RNA_def_property(srna, "use_rotation_y", PROP_BOOLEAN, PROP_NONE);
1055 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CHILDOF_ROTY);
1056 RNA_def_property_ui_text(prop, "Rotation Y", "Use Y Rotation of Parent");
1057 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1058
1059 prop = RNA_def_property(srna, "use_rotation_z", PROP_BOOLEAN, PROP_NONE);
1060 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CHILDOF_ROTZ);
1061 RNA_def_property_ui_text(prop, "Rotation Z", "Use Z Rotation of Parent");
1062 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1063
1064 prop = RNA_def_property(srna, "use_scale_x", PROP_BOOLEAN, PROP_NONE);
1065 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CHILDOF_SIZEX);
1066 RNA_def_property_ui_text(prop, "Scale X", "Use X Scale of Parent");
1067 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1068
1069 prop = RNA_def_property(srna, "use_scale_y", PROP_BOOLEAN, PROP_NONE);
1070 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CHILDOF_SIZEY);
1071 RNA_def_property_ui_text(prop, "Scale Y", "Use Y Scale of Parent");
1072 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1073
1074 prop = RNA_def_property(srna, "use_scale_z", PROP_BOOLEAN, PROP_NONE);
1075 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CHILDOF_SIZEZ);
1076 RNA_def_property_ui_text(prop, "Scale Z", "Use Z Scale of Parent");
1077 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1078
1079 prop = RNA_def_property(srna, "set_inverse_pending", PROP_BOOLEAN, PROP_NONE);
1080 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CHILDOF_SET_INVERSE);
1082 prop, "Set Inverse Pending", "Set to true to request recalculation of the inverse matrix");
1083 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1084
1085 prop = RNA_def_property(srna, "inverse_matrix", PROP_FLOAT, PROP_MATRIX);
1086 RNA_def_property_float_sdna(prop, nullptr, "invmat");
1089 RNA_def_property_ui_text(prop, "Inverse Matrix", "Transformation matrix to apply before");
1091 prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_childof_inverse_matrix_update");
1092
1094}
1095
1097{
1098 StructRNA *srna;
1099 PropertyRNA *prop;
1100
1101 srna = RNA_def_struct(brna, "PythonConstraint", "Constraint");
1102 RNA_def_struct_ui_text(srna, "Python Constraint", "Use Python script for constraint evaluation");
1103 RNA_def_struct_sdna_from(srna, "bPythonConstraint", "data");
1104
1106
1107 prop = RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
1108 RNA_def_property_collection_sdna(prop, nullptr, "targets", nullptr);
1109 RNA_def_property_struct_type(prop, "ConstraintTarget");
1110 RNA_def_property_ui_text(prop, "Targets", "Target Objects");
1111
1112 prop = RNA_def_property(srna, "target_count", PROP_INT, PROP_NONE);
1113 RNA_def_property_int_sdna(prop, nullptr, "tarnum");
1114 RNA_def_property_ui_text(prop, "Number of Targets", "Usually only 1 to 3 are needed");
1115 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1116
1117 prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
1118 RNA_def_property_ui_text(prop, "Script", "The text object that contains the Python script");
1120 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1121
1122 prop = RNA_def_property(srna, "use_targets", PROP_BOOLEAN, PROP_NONE);
1123 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PYCON_USETARGETS);
1125 prop, "Use Targets", "Use the targets indicated in the constraint panel");
1126 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1127
1128 prop = RNA_def_property(srna, "has_script_error", PROP_BOOLEAN, PROP_NONE);
1129 RNA_def_property_boolean_sdna(prop, nullptr, "flag", PYCON_SCRIPTERROR);
1131 RNA_def_property_ui_text(prop, "Script Error", "The linked Python script has thrown an error");
1132
1134}
1135
1137{
1138 StructRNA *srna;
1139 FunctionRNA *func;
1140 PropertyRNA *parm;
1141
1142 RNA_def_property_srna(cprop, "ArmatureConstraintTargets");
1143 srna = RNA_def_struct(brna, "ArmatureConstraintTargets", nullptr);
1144 RNA_def_struct_sdna(srna, "bConstraint");
1146 srna, "Armature Deform Constraint Targets", "Collection of target bones and weights");
1147 RNA_def_struct_ui_icon(srna, ICON_CON_ARMATURE);
1148
1149 func = RNA_def_function(srna, "new", "rna_ArmatureConstraint_target_new");
1151 RNA_def_function_ui_description(func, "Add a new target to the constraint");
1152 parm = RNA_def_pointer(func, "target", "ConstraintTargetBone", "", "New target bone");
1153 RNA_def_function_return(func, parm);
1154
1155 func = RNA_def_function(srna, "remove", "rna_ArmatureConstraint_target_remove");
1157 RNA_def_function_ui_description(func, "Delete target from the constraint");
1158 parm = RNA_def_pointer(func, "target", "ConstraintTargetBone", "", "Target to remove");
1161
1162 func = RNA_def_function(srna, "clear", "rna_ArmatureConstraint_target_clear");
1164 RNA_def_function_ui_description(func, "Delete all targets from object");
1165}
1166
1168{
1169 StructRNA *srna;
1170 PropertyRNA *prop;
1171
1172 srna = RNA_def_struct(brna, "ArmatureConstraint", "Constraint");
1174 srna, "Armature Constraint", "Applies transformations done by the Armature modifier");
1175 RNA_def_struct_sdna_from(srna, "bArmatureConstraint", "data");
1176 RNA_def_struct_ui_icon(srna, ICON_CON_ARMATURE);
1177
1179
1180 prop = RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
1181 RNA_def_property_collection_sdna(prop, nullptr, "targets", nullptr);
1182 RNA_def_property_struct_type(prop, "ConstraintTargetBone");
1183 RNA_def_property_ui_text(prop, "Targets", "Target Bones");
1185
1186 prop = RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE);
1189 prop, "Preserve Volume", "Deform rotation interpolation with quaternions");
1190 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1191
1192 prop = RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE);
1195 prop,
1196 "Use Envelopes",
1197 "Multiply weights by envelope for all bones, instead of acting like Vertex Group based "
1198 "blending. "
1199 "The specified weights are still used, and only the listed bones are considered.");
1200 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1201
1202 prop = RNA_def_property(srna, "use_current_location", PROP_BOOLEAN, PROP_NONE);
1205 "Use Current Location",
1206 "Use the current bone location for envelopes and choosing B-Bone "
1207 "segments instead of rest position");
1208 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1209
1211}
1212
1214{
1215 StructRNA *srna;
1216 PropertyRNA *prop;
1217
1218 static const EnumPropertyItem constraint_ik_axisref_items[] = {
1219 {0, "BONE", 0, "Bone", ""},
1220 {CONSTRAINT_IK_TARGETAXIS, "TARGET", 0, "Target", ""},
1221 {0, nullptr, 0, nullptr, nullptr},
1222 };
1223
1224 static const EnumPropertyItem constraint_ik_type_items[] = {
1225 {CONSTRAINT_IK_COPYPOSE, "COPY_POSE", 0, "Copy Pose", ""},
1226 {CONSTRAINT_IK_DISTANCE, "DISTANCE", 0, "Distance", ""},
1227 {0, nullptr, 0, nullptr, nullptr},
1228 };
1229
1230 srna = RNA_def_struct(brna, "KinematicConstraint", "Constraint");
1231 RNA_def_struct_ui_text(srna, "Kinematic Constraint", "Inverse Kinematics");
1232 RNA_def_struct_sdna_from(srna, "bKinematicConstraint", "data");
1233 RNA_def_struct_ui_icon(srna, ICON_CON_KINEMATIC);
1234
1236
1238
1239 prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
1240 RNA_def_property_range(prop, 0, 10000);
1241 RNA_def_property_ui_text(prop, "Iterations", "Maximum number of solving iterations");
1242 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1243
1244 prop = RNA_def_property(srna, "pole_target", PROP_POINTER, PROP_NONE);
1245 RNA_def_property_pointer_sdna(prop, nullptr, "poletar");
1246 RNA_def_property_ui_text(prop, "Pole Target", "Object for pole rotation");
1248 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1249
1250 prop = RNA_def_property(srna, "pole_subtarget", PROP_STRING, PROP_NONE);
1251 RNA_def_property_string_sdna(prop, nullptr, "polesubtarget");
1252 RNA_def_property_ui_text(prop, "Pole Sub-Target", "");
1253 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1254
1255 prop = RNA_def_property(srna, "pole_angle", PROP_FLOAT, PROP_ANGLE);
1256 RNA_def_property_float_sdna(prop, nullptr, "poleangle");
1258 RNA_def_property_ui_range(prop, -M_PI, M_PI, 10, 4);
1259 RNA_def_property_ui_text(prop, "Pole Angle", "Pole rotation offset");
1260 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1261
1262 prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
1263 RNA_def_property_range(prop, 0.01, 1.0f);
1265 prop, "Weight", "For Tree-IK: Weight of position control for this target");
1266
1267 prop = RNA_def_property(srna, "orient_weight", PROP_FLOAT, PROP_NONE);
1268 RNA_def_property_float_sdna(prop, nullptr, "orientweight");
1269 RNA_def_property_range(prop, 0.01, 1.0f);
1271 prop, "Orientation Weight", "For Tree-IK: Weight of orientation control for this target");
1272 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1273
1274 prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE);
1275 RNA_def_property_int_sdna(prop, nullptr, "rootbone");
1276 /* Changing the IK chain length requires a rebuild of depsgraph relations. This makes it
1277 * unsuitable for animation. */
1279 RNA_def_property_range(prop, 0, 255);
1281 prop, "Chain Length", "How many bones are included in the IK effect - 0 uses all bones");
1282 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1283
1284 prop = RNA_def_property(srna, "use_tail", PROP_BOOLEAN, PROP_NONE);
1285 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CONSTRAINT_IK_TIP);
1286 RNA_def_property_ui_text(prop, "Use Tail", "Include bone's tail as last element in chain");
1287 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1288
1289 prop = RNA_def_property(srna, "reference_axis", PROP_ENUM, PROP_NONE);
1290 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
1291 RNA_def_property_enum_items(prop, constraint_ik_axisref_items);
1293 prop, "Axis Reference", "Constraint axis Lock options relative to Bone or Target reference");
1294 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1295
1296 prop = RNA_def_property(srna, "use_location", PROP_BOOLEAN, PROP_NONE);
1297 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CONSTRAINT_IK_POS);
1298 RNA_def_property_ui_text(prop, "Position", "Chain follows position of target");
1299 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1300
1301 prop = RNA_def_property(srna, "lock_location_x", PROP_BOOLEAN, PROP_NONE);
1303 RNA_def_property_ui_text(prop, "Lock X Pos", "Constraint position along X axis");
1304 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1305
1306 prop = RNA_def_property(srna, "lock_location_y", PROP_BOOLEAN, PROP_NONE);
1308 RNA_def_property_ui_text(prop, "Lock Y Pos", "Constraint position along Y axis");
1309 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1310
1311 prop = RNA_def_property(srna, "lock_location_z", PROP_BOOLEAN, PROP_NONE);
1313 RNA_def_property_ui_text(prop, "Lock Z Pos", "Constraint position along Z axis");
1314 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1315
1316 prop = RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE);
1317 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CONSTRAINT_IK_ROT);
1318 RNA_def_property_ui_text(prop, "Rotation", "Chain follows rotation of target");
1319 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1320
1321 prop = RNA_def_property(srna, "lock_rotation_x", PROP_BOOLEAN, PROP_NONE);
1323 RNA_def_property_ui_text(prop, "Lock X Rotation", "Constraint rotation along X axis");
1324 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1325
1326 prop = RNA_def_property(srna, "lock_rotation_y", PROP_BOOLEAN, PROP_NONE);
1328 RNA_def_property_ui_text(prop, "Lock Y Rotation", "Constraint rotation along Y axis");
1329 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1330
1331 prop = RNA_def_property(srna, "lock_rotation_z", PROP_BOOLEAN, PROP_NONE);
1333 RNA_def_property_ui_text(prop, "Lock Z Rotation", "Constraint rotation along Z axis");
1334 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update");
1335
1336 prop = RNA_def_property(srna, "use_stretch", PROP_BOOLEAN, PROP_NONE);
1338 RNA_def_property_ui_text(prop, "Stretch", "Enable IK Stretching");
1339 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1340
1341 prop = RNA_def_property(srna, "ik_type", PROP_ENUM, PROP_NONE);
1342 RNA_def_property_enum_sdna(prop, nullptr, "type");
1343 RNA_def_property_enum_funcs(prop, nullptr, "rna_Constraint_ik_type_set", nullptr);
1344 RNA_def_property_enum_items(prop, constraint_ik_type_items);
1345 RNA_def_property_ui_text(prop, "IK Type", "");
1346 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1347
1348 prop = RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE);
1349 RNA_def_property_enum_sdna(prop, nullptr, "mode");
1352 prop, "Limit Mode", "Distances in relation to sphere of influence to allow");
1353 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
1354
1355 prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
1356 RNA_def_property_float_sdna(prop, nullptr, "dist");
1357 RNA_def_property_range(prop, 0.0, 100.0f);
1358 RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere");
1359 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1360
1362}
1363
1365{
1366 StructRNA *srna;
1367 PropertyRNA *prop;
1368
1369 static const EnumPropertyItem up_items[] = {
1370 {TRACK_X, "UP_X", 0, "X", ""},
1371 {TRACK_Y, "UP_Y", 0, "Y", ""},
1372 {TRACK_Z, "UP_Z", 0, "Z", ""},
1373 {0, nullptr, 0, nullptr, nullptr},
1374 };
1375
1376 srna = RNA_def_struct(brna, "TrackToConstraint", "Constraint");
1378 srna, "Track To Constraint", "Aim the constrained object toward the target");
1379
1381
1382 RNA_def_struct_sdna_from(srna, "bTrackToConstraint", "data");
1383
1385
1386 RNA_def_struct_ui_icon(srna, ICON_CON_TRACKTO);
1387
1389
1390 prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
1391 RNA_def_property_enum_sdna(prop, nullptr, "reserved1");
1393 RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object");
1394 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1395
1396 prop = RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
1397 RNA_def_property_enum_sdna(prop, nullptr, "reserved2");
1398 RNA_def_property_enum_items(prop, up_items);
1399 RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward");
1400 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1401
1402 prop = RNA_def_property(srna, "use_target_z", PROP_BOOLEAN, PROP_NONE);
1403 RNA_def_property_boolean_sdna(prop, nullptr, "flags", TARGET_Z_UP);
1405 prop, "Target Z", "Target's Z axis, not World Z axis, will constraint the Up direction");
1406 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1407
1409}
1410
1412{
1413 StructRNA *srna;
1414 PropertyRNA *prop;
1415
1416 srna = RNA_def_struct(brna, "CopyLocationConstraint", "Constraint");
1417 RNA_def_struct_ui_text(srna, "Copy Location Constraint", "Copy the location of the target");
1418 RNA_def_struct_ui_icon(srna, ICON_CON_LOCLIKE);
1419
1421
1422 RNA_def_struct_sdna_from(srna, "bLocateLikeConstraint", "data");
1423
1425
1427
1428 prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
1429 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LOCLIKE_X);
1430 RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X location");
1431 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1432
1433 prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
1434 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LOCLIKE_Y);
1435 RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y location");
1436 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1437
1438 prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
1439 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LOCLIKE_Z);
1440 RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z location");
1441 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1442
1443 prop = RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE);
1444 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LOCLIKE_X_INVERT);
1445 RNA_def_property_ui_text(prop, "Invert X", "Invert the X location");
1446 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1447
1448 prop = RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE);
1449 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LOCLIKE_Y_INVERT);
1450 RNA_def_property_ui_text(prop, "Invert Y", "Invert the Y location");
1451 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1452
1453 prop = RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
1454 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LOCLIKE_Z_INVERT);
1455 RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z location");
1456 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1457
1458 prop = RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
1459 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LOCLIKE_OFFSET);
1460 RNA_def_property_ui_text(prop, "Offset", "Add original location into copied location");
1461 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1462
1464}
1465
1467{
1468 StructRNA *srna;
1469 PropertyRNA *prop;
1470
1471 static const EnumPropertyItem mix_mode_items[] = {
1472 {ROTLIKE_MIX_REPLACE, "REPLACE", 0, "Replace", "Replace the original rotation with copied"},
1473 {ROTLIKE_MIX_ADD, "ADD", 0, "Add", "Add euler component values together"},
1475 "BEFORE",
1476 0,
1477 "Before Original",
1478 "Apply copied rotation before original, as if the constraint target is a parent"},
1480 "AFTER",
1481 0,
1482 "After Original",
1483 "Apply copied rotation after original, as if the constraint target is a child"},
1485 "OFFSET",
1486 0,
1487 "Offset (Legacy)",
1488 "Combine rotations like the original Offset checkbox. Does not work well for "
1489 "multiple axis rotations."},
1490 {0, nullptr, 0, nullptr, nullptr},
1491 };
1492
1493 srna = RNA_def_struct(brna, "CopyRotationConstraint", "Constraint");
1494 RNA_def_struct_ui_text(srna, "Copy Rotation Constraint", "Copy the rotation of the target");
1495 RNA_def_struct_sdna_from(srna, "bRotateLikeConstraint", "data");
1496 RNA_def_struct_ui_icon(srna, ICON_CON_ROTLIKE);
1497
1499
1501
1502 prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
1503 RNA_def_property_boolean_sdna(prop, nullptr, "flag", ROTLIKE_X);
1504 RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X rotation");
1505 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1506
1507 prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
1508 RNA_def_property_boolean_sdna(prop, nullptr, "flag", ROTLIKE_Y);
1509 RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y rotation");
1510 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1511
1512 prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
1513 RNA_def_property_boolean_sdna(prop, nullptr, "flag", ROTLIKE_Z);
1514 RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z rotation");
1515 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1516
1517 prop = RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE);
1518 RNA_def_property_boolean_sdna(prop, nullptr, "flag", ROTLIKE_X_INVERT);
1519 RNA_def_property_ui_text(prop, "Invert X", "Invert the X rotation");
1520 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1521
1522 prop = RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE);
1523 RNA_def_property_boolean_sdna(prop, nullptr, "flag", ROTLIKE_Y_INVERT);
1524 RNA_def_property_ui_text(prop, "Invert Y", "Invert the Y rotation");
1525 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1526
1527 prop = RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
1528 RNA_def_property_boolean_sdna(prop, nullptr, "flag", ROTLIKE_Z_INVERT);
1529 RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z rotation");
1530 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1531
1532 prop = RNA_def_property(srna, "euler_order", PROP_ENUM, PROP_NONE);
1533 RNA_def_property_enum_sdna(prop, nullptr, "euler_order");
1535 RNA_def_property_ui_text(prop, "Euler Order", "Explicitly specify the euler rotation order");
1536 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1537
1538 prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
1539 RNA_def_property_enum_sdna(prop, nullptr, "mix_mode");
1540 RNA_def_property_enum_items(prop, mix_mode_items);
1542 prop, "Mix Mode", "Specify how the copied and existing rotations are combined");
1543 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1544
1545 /* DEPRECATED: replaced with mix_mode */
1546 prop = RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
1548 prop, "rna_Constraint_RotLike_use_offset_get", "rna_Constraint_RotLike_use_offset_set");
1550 prop, "Offset", "DEPRECATED: Add original rotation into copied rotation");
1551 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1552
1554}
1555
1557{
1558 StructRNA *srna;
1559 PropertyRNA *prop;
1560
1561 srna = RNA_def_struct(brna, "CopyScaleConstraint", "Constraint");
1562 RNA_def_struct_ui_text(srna, "Copy Scale Constraint", "Copy the scale of the target");
1563 RNA_def_struct_sdna_from(srna, "bSizeLikeConstraint", "data");
1564 RNA_def_struct_ui_icon(srna, ICON_CON_SIZELIKE);
1565
1567
1569
1570 prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
1571 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIZELIKE_X);
1572 RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X scale");
1573 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1574
1575 prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
1576 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIZELIKE_Y);
1577 RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y scale");
1578 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1579
1580 prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
1581 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIZELIKE_Z);
1582 RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z scale");
1583 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1584
1585 prop = RNA_def_property(srna, "power", PROP_FLOAT, PROP_NONE);
1586 RNA_def_property_float_sdna(prop, nullptr, "power");
1589 RNA_def_property_ui_text(prop, "Power", "Raise the target's scale to the specified power");
1590 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1591
1592 prop = RNA_def_property(srna, "use_make_uniform", PROP_BOOLEAN, PROP_NONE);
1593 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIZELIKE_UNIFORM);
1595 "Make Uniform",
1596 "Redistribute the copied change in volume equally "
1597 "between the three axes of the owner");
1598 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1599
1600 prop = RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
1601 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIZELIKE_OFFSET);
1602 RNA_def_property_ui_text(prop, "Offset", "Combine original scale with copied scale");
1603 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1604
1605 prop = RNA_def_property(srna, "use_add", PROP_BOOLEAN, PROP_NONE);
1608 prop,
1609 "Additive",
1610 "Use addition instead of multiplication to combine scale (2.7 compatibility)");
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 axis_items[] = {
1622 {SAMEVOL_X, "SAMEVOL_X", 0, "X", ""},
1623 {SAMEVOL_Y, "SAMEVOL_Y", 0, "Y", ""},
1624 {SAMEVOL_Z, "SAMEVOL_Z", 0, "Z", ""},
1625 {0, nullptr, 0, nullptr, nullptr},
1626 };
1627
1628 static const EnumPropertyItem mode_items[] = {
1630 "STRICT",
1631 0,
1632 "Strict",
1633 "Volume is strictly preserved, overriding the scaling of non-free axes"},
1635 "UNIFORM",
1636 0,
1637 "Uniform",
1638 "Volume is preserved when the object is scaled uniformly. "
1639 "Deviations from uniform scale on non-free axes are passed through."},
1641 "SINGLE_AXIS",
1642 0,
1643 "Single Axis",
1644 "Volume is preserved when the object is scaled only on the free axis. "
1645 "Non-free axis scaling is passed through."},
1646 {0, nullptr, 0, nullptr, nullptr},
1647 };
1648
1649 srna = RNA_def_struct(brna, "MaintainVolumeConstraint", "Constraint");
1651 "Maintain Volume Constraint",
1652 "Maintain a constant volume along a single scaling axis");
1653 RNA_def_struct_sdna_from(srna, "bSameVolumeConstraint", "data");
1654 RNA_def_struct_ui_icon(srna, ICON_CON_SAMEVOL);
1655
1657
1658 prop = RNA_def_property(srna, "free_axis", PROP_ENUM, PROP_NONE);
1659 RNA_def_property_enum_sdna(prop, nullptr, "free_axis");
1660 RNA_def_property_enum_items(prop, axis_items);
1661 RNA_def_property_ui_text(prop, "Free Axis", "The free scaling axis of the object");
1662 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1663
1664 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1665 RNA_def_property_enum_sdna(prop, nullptr, "mode");
1666 RNA_def_property_enum_items(prop, mode_items);
1668 prop, "Mode", "The way the constraint treats original non-free axis scaling");
1669 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1670
1671 prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
1672 RNA_def_property_range(prop, 0.0f, FLT_MAX);
1673 RNA_def_property_ui_range(prop, 0.001f, 100.0f, 1, 3);
1674 RNA_def_property_ui_text(prop, "Volume", "Volume of the bone at rest");
1675 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1676
1678}
1679
1681{
1682 StructRNA *srna;
1683 PropertyRNA *prop;
1684
1685 static const EnumPropertyItem mix_mode_items[] = {
1687 "REPLACE",
1688 0,
1689 "Replace",
1690 "Replace the original transformation with copied"},
1693 "BEFORE_FULL",
1694 0,
1695 "Before Original (Full)",
1696 "Apply copied transformation before original, using simple matrix multiplication as if "
1697 "the constraint target is a parent in Full Inherit Scale mode. "
1698 "Will create shear when combining rotation and non-uniform scale."},
1700 "BEFORE",
1701 0,
1702 "Before Original (Aligned)",
1703 "Apply copied transformation before original, as if the constraint target is a parent in "
1704 "Aligned Inherit Scale mode. This effectively uses Full for location and Split Channels "
1705 "for rotation and scale."},
1707 "BEFORE_SPLIT",
1708 0,
1709 "Before Original (Split Channels)",
1710 "Apply copied transformation before original, handling location, rotation and scale "
1711 "separately, similar to a sequence of three Copy constraints"},
1714 "AFTER_FULL",
1715 0,
1716 "After Original (Full)",
1717 "Apply copied transformation after original, using simple matrix multiplication as if "
1718 "the constraint target is a child in Full Inherit Scale mode. "
1719 "Will create shear when combining rotation and non-uniform scale."},
1721 "AFTER",
1722 0,
1723 "After Original (Aligned)",
1724 "Apply copied transformation after original, as if the constraint target is a child in "
1725 "Aligned Inherit Scale mode. This effectively uses Full for location and Split Channels "
1726 "for rotation and scale."},
1728 "AFTER_SPLIT",
1729 0,
1730 "After Original (Split Channels)",
1731 "Apply copied transformation after original, handling location, rotation and scale "
1732 "separately, similar to a sequence of three Copy constraints"},
1733 {0, nullptr, 0, nullptr, nullptr},
1734 };
1735
1736 srna = RNA_def_struct(brna, "CopyTransformsConstraint", "Constraint");
1738 srna, "Copy Transforms Constraint", "Copy all the transforms of the target");
1739
1741
1742 RNA_def_struct_sdna_from(srna, "bTransLikeConstraint", "data");
1743
1744 RNA_def_struct_ui_icon(srna, ICON_CON_TRANSLIKE);
1745
1747
1749
1750 prop = RNA_def_property(srna, "remove_target_shear", PROP_BOOLEAN, PROP_NONE);
1753 prop, "Remove Target Shear", "Remove shear from the target transformation before combining");
1754 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1755
1756 prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
1757 RNA_def_property_enum_sdna(prop, nullptr, "mix_mode");
1758 RNA_def_property_enum_items(prop, mix_mode_items);
1760 prop, "Mix Mode", "Specify how the copied and existing transformations are combined");
1761 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1762
1764}
1765
1767{
1768 StructRNA *srna;
1769 PropertyRNA *prop;
1770
1771 static const EnumPropertyItem minmax_items[] = {
1772 {TRACK_X, "FLOOR_X", 0, "X", ""},
1773 {TRACK_Y, "FLOOR_Y", 0, "Y", ""},
1774 {TRACK_Z, "FLOOR_Z", 0, "Z", ""},
1775 {TRACK_nX, "FLOOR_NEGATIVE_X", 0, "-X", ""},
1776 {TRACK_nY, "FLOOR_NEGATIVE_Y", 0, "-Y", ""},
1777 {TRACK_nZ, "FLOOR_NEGATIVE_Z", 0, "-Z", ""},
1778 {0, nullptr, 0, nullptr, nullptr},
1779 };
1780
1781 srna = RNA_def_struct(brna, "FloorConstraint", "Constraint");
1783 srna, "Floor Constraint", "Use the target object for location limitation");
1784 RNA_def_struct_sdna_from(srna, "bMinMaxConstraint", "data");
1785 RNA_def_struct_ui_icon(srna, ICON_CON_FLOOR);
1786
1788
1790
1791 prop = RNA_def_property(srna, "floor_location", PROP_ENUM, PROP_NONE);
1792 RNA_def_property_enum_sdna(prop, nullptr, "minmaxflag");
1793 RNA_def_property_enum_items(prop, minmax_items);
1795 prop, "Floor Location", "Location of target that object will not pass through");
1796 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1797
1798 prop = RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE);
1799 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MINMAX_USEROT);
1800 RNA_def_property_ui_text(prop, "Use Rotation", "Use the target's rotation to determine floor");
1801 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1802
1803 prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_DISTANCE);
1804 RNA_def_property_ui_range(prop, -100.0f, 100.0f, 1, -1);
1805 RNA_def_property_ui_text(prop, "Offset", "Offset of floor from object origin");
1806 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1807
1809}
1810
1812{
1813 StructRNA *srna;
1814 PropertyRNA *prop;
1815
1816 static const EnumPropertyItem transform_channel_items[] = {
1817 {20, "LOCATION_X", 0, "X Location", ""},
1818 {21, "LOCATION_Y", 0, "Y Location", ""},
1819 {22, "LOCATION_Z", 0, "Z Location", ""},
1820 {00, "ROTATION_X", 0, "X Rotation", ""},
1821 {01, "ROTATION_Y", 0, "Y Rotation", ""},
1822 {02, "ROTATION_Z", 0, "Z Rotation", ""},
1823 {10, "SCALE_X", 0, "X Scale", ""},
1824 {11, "SCALE_Y", 0, "Y Scale", ""},
1825 {12, "SCALE_Z", 0, "Z Scale", ""},
1826 {0, nullptr, 0, nullptr, nullptr},
1827 };
1828
1829 static const EnumPropertyItem mix_mode_items[] = {
1831 "BEFORE_FULL",
1832 0,
1833 "Before Original (Full)",
1834 "Apply the action channels before the original transformation, as if applied to an "
1835 "imaginary parent in Full Inherit Scale mode. Will create shear when combining rotation "
1836 "and non-uniform scale."},
1838 "BEFORE",
1839 0,
1840 "Before Original (Aligned)",
1841 "Apply the action channels before the original transformation, as if applied to an "
1842 "imaginary parent in Aligned Inherit Scale mode. This effectively uses Full for location "
1843 "and Split Channels for rotation and scale."},
1845 "BEFORE_SPLIT",
1846 0,
1847 "Before Original (Split Channels)",
1848 "Apply the action channels before the original transformation, handling location, rotation "
1849 "and scale separately"},
1852 "AFTER_FULL",
1853 0,
1854 "After Original (Full)",
1855 "Apply the action channels after the original transformation, as if applied to an "
1856 "imaginary child in Full Inherit Scale mode. Will create shear when combining rotation "
1857 "and non-uniform scale."},
1859 "AFTER",
1860 0,
1861 "After Original (Aligned)",
1862 "Apply the action channels after the original transformation, as if applied to an "
1863 "imaginary child in Aligned Inherit Scale mode. This effectively uses Full for location "
1864 "and Split Channels for rotation and scale."},
1866 "AFTER_SPLIT",
1867 0,
1868 "After Original (Split Channels)",
1869 "Apply the action channels after the original transformation, handling location, rotation "
1870 "and scale separately"},
1871 {0, nullptr, 0, nullptr, nullptr},
1872 };
1873
1874 srna = RNA_def_struct(brna, "ActionConstraint", "Constraint");
1876 srna, "Action Constraint", "Map an action to the transform axes of a bone");
1877 RNA_def_struct_sdna_from(srna, "bActionConstraint", "data");
1878 RNA_def_struct_ui_icon(srna, ICON_ACTION);
1879
1881
1883
1884 prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
1885 RNA_def_property_enum_sdna(prop, nullptr, "mix_mode");
1886 RNA_def_property_enum_items(prop, mix_mode_items);
1887 RNA_def_property_enum_funcs(prop, nullptr, "rna_ActionConstraint_mix_mode_set", nullptr);
1889 prop,
1890 "Mix Mode",
1891 "Specify how existing transformations and the action channels are combined");
1892 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1893
1894 prop = RNA_def_property(srna, "transform_channel", PROP_ENUM, PROP_NONE);
1895 RNA_def_property_enum_sdna(prop, nullptr, "type");
1896 RNA_def_property_enum_items(prop, transform_channel_items);
1898 prop,
1899 "Transform Channel",
1900 "Transformation channel from the target that is used to key the Action");
1901 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1902
1903 prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
1904 RNA_def_property_pointer_sdna(prop, nullptr, "act");
1905 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_Action_id_poll");
1906 RNA_def_property_ui_text(prop, "Action", "The constraining action");
1908 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1909
1910# ifdef WITH_ANIM_BAKLAVA
1911 /* This property is not necessary for the Python API (that is better off using
1912 * slot references/pointers directly), but it is needed for library overrides
1913 * to work. */
1914 prop = RNA_def_property(srna, "action_slot_handle", PROP_INT, PROP_NONE);
1915 RNA_def_property_int_sdna(prop, nullptr, "action_slot_handle");
1917 prop, nullptr, "rna_ActionConstraint_action_slot_handle_set", nullptr);
1919 "Action Slot Handle",
1920 "A number that identifies which sub-set of the Action is considered "
1921 "to be for this Action Constraint");
1923 RNA_def_property_update(prop, NC_ANIMATION | ND_NLA_ACTCHANGE, "rna_Constraint_update");
1924
1925 prop = RNA_def_property(srna, "action_slot_name", PROP_STRING, PROP_NONE);
1926 RNA_def_property_string_sdna(prop, nullptr, "action_slot_name");
1928 prop,
1929 "Action Slot Name",
1930 "The name of the action slot. The slot identifies which sub-set of the Action "
1931 "is considered to be for this constraint, and its name is used to find the right slot "
1932 "when assigning an Action.");
1933
1934 prop = RNA_def_property(srna, "action_slot", PROP_POINTER, PROP_NONE);
1935 RNA_def_property_struct_type(prop, "ActionSlot");
1939 prop,
1940 "Action Slot",
1941 "The slot identifies which sub-set of the Action is considered to be for this "
1942 "strip, and its name is used to find the right slot when assigning another Action");
1944 "rna_ActionConstraint_action_slot_get",
1945 "rna_ActionConstraint_action_slot_set",
1946 nullptr,
1947 nullptr);
1948 RNA_def_property_update(prop, NC_ANIMATION | ND_NLA_ACTCHANGE, "rna_Constraint_update");
1949 /* `strip.action_slot` is exposed to RNA as a pointer for things like the action slot selector in
1950 * the GUI. The ground truth of the assigned slot, however, is `action_slot_handle` declared
1951 * above. That property is used for library override operations, and this pointer property should
1952 * just be ignored.
1953 *
1954 * This needs PROPOVERRIDE_IGNORE; PROPOVERRIDE_NO_COMPARISON is not suitable here. This property
1955 * should act as if it is an overridable property (as from the user's perspective, it is), but an
1956 * override operation should not be created for it. It will be created for `action_slot_handle`,
1957 * and that's enough. */
1959
1960 prop = RNA_def_property(srna, "action_slots", PROP_COLLECTION, PROP_NONE);
1961 RNA_def_property_struct_type(prop, "ActionSlot");
1963 "rna_iterator_ActionConstraint_action_slots_begin",
1964 "rna_iterator_array_next",
1965 "rna_iterator_array_end",
1966 "rna_iterator_array_dereference_get",
1967 nullptr,
1968 nullptr,
1969 nullptr,
1970 nullptr);
1972 prop, "Action Slots", "The list of action slots suitable for this NLA strip");
1973# endif /* WITH_ANIM_BAKLAVA */
1974
1975 prop = RNA_def_property(srna, "use_bone_object_action", PROP_BOOLEAN, PROP_NONE);
1978 "Object Action",
1979 "Bones only: apply the object's transformation channels of the action "
1980 "to the constrained bone, instead of bone's channels");
1981 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1982
1983 prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
1984 RNA_def_property_int_sdna(prop, nullptr, "start");
1986 RNA_def_property_ui_text(prop, "Start Frame", "First frame of the Action to use");
1987 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1988
1989 prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
1990 RNA_def_property_int_sdna(prop, nullptr, "end");
1992 RNA_def_property_ui_text(prop, "End Frame", "Last frame of the Action to use");
1993 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
1994
1995 prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
1996 RNA_def_property_float_sdna(prop, nullptr, "max");
1997 RNA_def_property_range(prop, -1000.0f, 1000.0f);
1998 RNA_def_property_ui_text(prop, "Maximum", "Maximum value for target channel range");
1999 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2000 RNA_def_property_float_funcs(prop, nullptr, nullptr, "rna_ActionConstraint_minmax_range");
2001
2002 prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
2003 RNA_def_property_float_sdna(prop, nullptr, "min");
2004 RNA_def_property_range(prop, -1000.0f, 1000.0f);
2005 RNA_def_property_ui_text(prop, "Minimum", "Minimum value for target channel range");
2006 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2007 RNA_def_property_float_funcs(prop, nullptr, nullptr, "rna_ActionConstraint_minmax_range");
2008
2009 prop = RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_FACTOR);
2010 RNA_def_property_float_sdna(prop, nullptr, "eval_time");
2011 RNA_def_property_range(prop, 0.0f, 1.0f);
2013 prop, "Evaluation Time", "Interpolates between Action Start and End frames");
2014 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2015
2016 prop = RNA_def_property(srna, "use_eval_time", PROP_BOOLEAN, PROP_NONE);
2019 "Use Evaluation Time",
2020 "Interpolate between Action Start and End frames, with the Evaluation "
2021 "Time slider instead of the Target object/bone");
2022 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2023
2025}
2026
2028{
2029 StructRNA *srna;
2030 PropertyRNA *prop;
2031
2032 static const EnumPropertyItem lock_items[] = {
2033 {TRACK_X, "LOCK_X", 0, "X", ""},
2034 {TRACK_Y, "LOCK_Y", 0, "Y", ""},
2035 {TRACK_Z, "LOCK_Z", 0, "Z", ""},
2036 {0, nullptr, 0, nullptr, nullptr},
2037 };
2038
2039 srna = RNA_def_struct(brna, "LockedTrackConstraint", "Constraint");
2041 srna,
2042 "Locked Track Constraint",
2043 "Point toward the target along the track axis, while locking the other axis");
2044 RNA_def_struct_ui_icon(srna, ICON_CON_LOCKTRACK);
2045
2047
2048 RNA_def_struct_sdna_from(srna, "bLockTrackConstraint", "data");
2049
2051
2053
2054 prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
2055 RNA_def_property_enum_sdna(prop, nullptr, "trackflag");
2057 RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object");
2058 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2059
2060 prop = RNA_def_property(srna, "lock_axis", PROP_ENUM, PROP_NONE);
2061 RNA_def_property_enum_sdna(prop, nullptr, "lockflag");
2062 RNA_def_property_enum_items(prop, lock_items);
2063 RNA_def_property_ui_text(prop, "Locked Axis", "Axis that points upward");
2064 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2065
2067}
2068
2070{
2071 StructRNA *srna;
2072 PropertyRNA *prop;
2073
2074 static const EnumPropertyItem forwardpath_items[] = {
2075 {TRACK_X, "FORWARD_X", 0, "X", ""},
2076 {TRACK_Y, "FORWARD_Y", 0, "Y", ""},
2077 {TRACK_Z, "FORWARD_Z", 0, "Z", ""},
2078 {TRACK_nX, "TRACK_NEGATIVE_X", 0, "-X", ""},
2079 {TRACK_nY, "TRACK_NEGATIVE_Y", 0, "-Y", ""},
2080 {TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""},
2081 {0, nullptr, 0, nullptr, nullptr},
2082 };
2083
2084 static const EnumPropertyItem pathup_items[] = {
2085 {TRACK_X, "UP_X", 0, "X", ""},
2086 {TRACK_Y, "UP_Y", 0, "Y", ""},
2087 {TRACK_Z, "UP_Z", 0, "Z", ""},
2088 {0, nullptr, 0, nullptr, nullptr},
2089 };
2090
2091 srna = RNA_def_struct(brna, "FollowPathConstraint", "Constraint");
2092 RNA_def_struct_ui_text(srna, "Follow Path Constraint", "Lock motion to the target path");
2093 RNA_def_struct_sdna_from(srna, "bFollowPathConstraint", "data");
2094 RNA_def_struct_ui_icon(srna, ICON_CON_FOLLOWPATH);
2095
2097
2098 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
2099 RNA_def_property_pointer_sdna(prop, nullptr, "tar");
2100 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_Curve_object_poll");
2101 RNA_def_property_ui_text(prop, "Target", "Target Curve object");
2103 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
2104
2105 prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TIME);
2108 prop, "Offset", "Offset from the position corresponding to the time frame");
2109 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2110
2111 prop = RNA_def_property(srna, "offset_factor", PROP_FLOAT, PROP_FACTOR);
2112 RNA_def_property_float_sdna(prop, nullptr, "offset_fac");
2114 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 3);
2116 prop, "Offset Factor", "Percentage value defining target position along length of curve");
2117 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2118
2119 prop = RNA_def_property(srna, "forward_axis", PROP_ENUM, PROP_NONE);
2120 RNA_def_property_enum_sdna(prop, nullptr, "trackflag");
2121 RNA_def_property_enum_items(prop, forwardpath_items);
2122 RNA_def_property_ui_text(prop, "Forward Axis", "Axis that points forward along the path");
2123 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2124
2125 prop = RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
2126 RNA_def_property_enum_sdna(prop, nullptr, "upflag");
2127 RNA_def_property_enum_items(prop, pathup_items);
2128 RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward");
2129 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2130
2131 prop = RNA_def_property(srna, "use_curve_follow", PROP_BOOLEAN, PROP_NONE);
2132 RNA_def_property_boolean_sdna(prop, nullptr, "followflag", FOLLOWPATH_FOLLOW);
2134 prop, "Follow Curve", "Object will follow the heading and banking of the curve");
2135 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2136
2137 prop = RNA_def_property(srna, "use_fixed_location", PROP_BOOLEAN, PROP_NONE);
2138 RNA_def_property_boolean_sdna(prop, nullptr, "followflag", FOLLOWPATH_STATIC);
2140 prop,
2141 "Fixed Position",
2142 "Object will stay locked to a single point somewhere along the length of the curve "
2143 "regardless of time");
2144 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2145
2146 prop = RNA_def_property(srna, "use_curve_radius", PROP_BOOLEAN, PROP_NONE);
2147 RNA_def_property_boolean_sdna(prop, nullptr, "followflag", FOLLOWPATH_RADIUS);
2148 RNA_def_property_ui_text(prop, "Curve Radius", "Object is scaled by the curve radius");
2149 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2150
2152}
2153
2155{
2156 StructRNA *srna;
2157 PropertyRNA *prop;
2158
2159 static const EnumPropertyItem volume_items[] = {
2160 {VOLUME_XZ, "VOLUME_XZX", 0, "XZ", ""},
2161 {VOLUME_X, "VOLUME_X", 0, "X", ""},
2162 {VOLUME_Z, "VOLUME_Z", 0, "Z", ""},
2163 {NO_VOLUME, "NO_VOLUME", 0, "None", ""},
2164 {0, nullptr, 0, nullptr, nullptr},
2165 };
2166
2167 static const EnumPropertyItem plane_items[] = {
2168 {PLANE_X, "PLANE_X", 0, "XZ", "Rotate around local X, then Z"},
2169 {PLANE_Z, "PLANE_Z", 0, "ZX", "Rotate around local Z, then X"},
2170 {SWING_Y,
2171 "SWING_Y",
2172 0,
2173 "Swing",
2174 "Use the smallest single axis rotation, similar to Damped Track"},
2175 {0, nullptr, 0, nullptr, nullptr},
2176 };
2177
2178 srna = RNA_def_struct(brna, "StretchToConstraint", "Constraint");
2179 RNA_def_struct_ui_text(srna, "Stretch To Constraint", "Stretch to meet the target object");
2180 RNA_def_struct_ui_icon(srna, ICON_CON_STRETCHTO);
2181
2183
2184 RNA_def_struct_sdna_from(srna, "bStretchToConstraint", "data");
2185
2187
2189
2190 prop = RNA_def_property(srna, "volume", PROP_ENUM, PROP_NONE);
2191 RNA_def_property_enum_sdna(prop, nullptr, "volmode");
2192 RNA_def_property_enum_items(prop, volume_items);
2194 prop, "Maintain Volume", "Maintain the object's volume as it stretches");
2195 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2196
2197 prop = RNA_def_property(srna, "keep_axis", PROP_ENUM, PROP_NONE);
2198 RNA_def_property_enum_sdna(prop, nullptr, "plane");
2199 RNA_def_property_enum_items(prop, plane_items);
2200 RNA_def_property_ui_text(prop, "Keep Axis", "The rotation type and axis order to use");
2201 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2202
2203 prop = RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_DISTANCE);
2204 RNA_def_property_float_sdna(prop, nullptr, "orglength");
2205 RNA_def_property_range(prop, 0.0f, 1000.0f);
2207 RNA_def_property_ui_text(prop, "Original Length", "Length at rest position");
2208 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2209
2210 prop = RNA_def_property(srna, "bulge", PROP_FLOAT, PROP_NONE);
2211 RNA_def_property_range(prop, 0.0, 100.0f);
2213 prop, "Volume Variation", "Factor between volume variation and stretching");
2214 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2215
2216 prop = RNA_def_property(srna, "use_bulge_min", PROP_BOOLEAN, PROP_NONE);
2219 prop, "Use Volume Variation Minimum", "Use lower limit for volume variation");
2220 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2221
2222 prop = RNA_def_property(srna, "use_bulge_max", PROP_BOOLEAN, PROP_NONE);
2225 prop, "Use Volume Variation Maximum", "Use upper limit for volume variation");
2226 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2227
2228 prop = RNA_def_property(srna, "bulge_min", PROP_FLOAT, PROP_NONE);
2229 RNA_def_property_range(prop, 0.0, 1.0f);
2230 RNA_def_property_ui_text(prop, "Volume Variation Minimum", "Minimum volume stretching factor");
2231 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2232
2233 prop = RNA_def_property(srna, "bulge_max", PROP_FLOAT, PROP_NONE);
2234 RNA_def_property_range(prop, 1.0, 100.0f);
2235 RNA_def_property_ui_text(prop, "Volume Variation Maximum", "Maximum volume stretching factor");
2236 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2237
2238 prop = RNA_def_property(srna, "bulge_smooth", PROP_FLOAT, PROP_FACTOR);
2239 RNA_def_property_range(prop, 0.0, 1.0f);
2241 prop, "Volume Variation Smoothness", "Strength of volume stretching clamping");
2242 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2243
2245}
2246
2248{
2249 StructRNA *srna;
2250 PropertyRNA *prop;
2251
2252 static const EnumPropertyItem clamp_items[] = {
2253 {CLAMPTO_AUTO, "CLAMPTO_AUTO", 0, "Auto", ""},
2254 {CLAMPTO_X, "CLAMPTO_X", 0, "X", ""},
2255 {CLAMPTO_Y, "CLAMPTO_Y", 0, "Y", ""},
2256 {CLAMPTO_Z, "CLAMPTO_Z", 0, "Z", ""},
2257 {0, nullptr, 0, nullptr, nullptr},
2258 };
2259
2260 srna = RNA_def_struct(brna, "ClampToConstraint", "Constraint");
2262 srna,
2263 "Clamp To Constraint",
2264 "Constrain an object's location to the nearest point along the target path");
2265 RNA_def_struct_sdna_from(srna, "bClampToConstraint", "data");
2266 RNA_def_struct_ui_icon(srna, ICON_CON_CLAMPTO);
2267
2269
2270 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
2271 RNA_def_property_pointer_sdna(prop, nullptr, "tar");
2272 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_Curve_object_poll");
2273 RNA_def_property_ui_text(prop, "Target", "Target Object (Curves only)");
2275 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
2276
2277 prop = RNA_def_property(srna, "main_axis", PROP_ENUM, PROP_NONE);
2278 RNA_def_property_enum_sdna(prop, nullptr, "flag");
2279 RNA_def_property_enum_items(prop, clamp_items);
2280 RNA_def_property_ui_text(prop, "Main Axis", "Main axis of movement");
2281 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2282
2283 prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
2284 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", CLAMPTO_CYCLIC);
2286 prop, "Cyclic", "Treat curve as cyclic curve (no clamping to curve bounding box)");
2287 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2288
2290}
2291
2293{
2294 StructRNA *srna;
2295 PropertyRNA *prop;
2296
2297 static const EnumPropertyItem transform_items[] = {
2298 {TRANS_LOCATION, "LOCATION", 0, "Location", ""},
2299 {TRANS_ROTATION, "ROTATION", 0, "Rotation", ""},
2300 {TRANS_SCALE, "SCALE", 0, "Scale", ""},
2301 {0, nullptr, 0, nullptr, nullptr},
2302 };
2303
2304 static const EnumPropertyItem mix_mode_loc_items[] = {
2305 {TRANS_MIXLOC_REPLACE, "REPLACE", 0, "Replace", "Replace component values"},
2306 {TRANS_MIXLOC_ADD, "ADD", 0, "Add", "Add component values together"},
2307 {0, nullptr, 0, nullptr, nullptr},
2308 };
2309
2310 static const EnumPropertyItem mix_mode_rot_items[] = {
2311 {TRANS_MIXROT_REPLACE, "REPLACE", 0, "Replace", "Replace component values"},
2312 {TRANS_MIXROT_ADD, "ADD", 0, "Add", "Add component values together"},
2314 "BEFORE",
2315 0,
2316 "Before Original",
2317 "Apply new rotation before original, as if it was on a parent"},
2319 "AFTER",
2320 0,
2321 "After Original",
2322 "Apply new rotation after original, as if it was on a child"},
2323 {0, nullptr, 0, nullptr, nullptr},
2324 };
2325
2326 static const EnumPropertyItem mix_mode_scale_items[] = {
2327 {TRANS_MIXSCALE_REPLACE, "REPLACE", 0, "Replace", "Replace component values"},
2328 {TRANS_MIXSCALE_MULTIPLY, "MULTIPLY", 0, "Multiply", "Multiply component values together"},
2329 {0, nullptr, 0, nullptr, nullptr},
2330 };
2331
2332 srna = RNA_def_struct(brna, "TransformConstraint", "Constraint");
2334 srna, "Transformation Constraint", "Map transformations of the target to the object");
2335 RNA_def_struct_sdna_from(srna, "bTransformConstraint", "data");
2336 RNA_def_struct_ui_icon(srna, ICON_CON_TRANSFORM);
2337
2339
2341
2342 prop = RNA_def_property(srna, "map_from", PROP_ENUM, PROP_NONE);
2343 RNA_def_property_enum_sdna(prop, nullptr, "from");
2344 RNA_def_property_enum_items(prop, transform_items);
2345 RNA_def_property_ui_text(prop, "Map From", "The transformation type to use from the target");
2346 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2347
2348 prop = RNA_def_property(srna, "map_to", PROP_ENUM, PROP_NONE);
2349 RNA_def_property_enum_sdna(prop, nullptr, "to");
2350 RNA_def_property_enum_items(prop, transform_items);
2352 prop, "Map To", "The transformation type to affect on the constrained object");
2353 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2354
2355 prop = RNA_def_property(srna, "map_to_x_from", PROP_ENUM, PROP_NONE);
2356 RNA_def_property_enum_sdna(prop, nullptr, "map[0]");
2359 prop, "Map To X From", "The source axis constrained object's X axis uses");
2360 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2361
2362 prop = RNA_def_property(srna, "map_to_y_from", PROP_ENUM, PROP_NONE);
2363 RNA_def_property_enum_sdna(prop, nullptr, "map[1]");
2366 prop, "Map To Y From", "The source axis constrained object's Y axis uses");
2367 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2368
2369 prop = RNA_def_property(srna, "map_to_z_from", PROP_ENUM, PROP_NONE);
2370 RNA_def_property_enum_sdna(prop, nullptr, "map[2]");
2373 prop, "Map To Z From", "The source axis constrained object's Z axis uses");
2374 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2375
2376 prop = RNA_def_property(srna, "use_motion_extrapolate", PROP_BOOLEAN, PROP_NONE);
2377 RNA_def_property_boolean_sdna(prop, nullptr, "expo", CLAMPTO_CYCLIC);
2378 RNA_def_property_ui_text(prop, "Extrapolate Motion", "Extrapolate ranges");
2379 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2380
2381 prop = RNA_def_property(srna, "from_rotation_mode", PROP_ENUM, PROP_NONE);
2382 RNA_def_property_enum_sdna(prop, nullptr, "from_rotation_mode");
2384 RNA_def_property_ui_text(prop, "From Mode", "Specify the type of rotation channels to use");
2385 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2386
2387 prop = RNA_def_property(srna, "to_euler_order", PROP_ENUM, PROP_NONE);
2388 RNA_def_property_enum_sdna(prop, nullptr, "to_euler_order");
2390 RNA_def_property_ui_text(prop, "To Order", "Explicitly specify the output euler rotation order");
2391 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2392
2393 /* Loc */
2394 prop = RNA_def_property(srna, "from_min_x", PROP_FLOAT, PROP_DISTANCE);
2395 RNA_def_property_float_sdna(prop, nullptr, "from_min[0]");
2396 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2397 RNA_def_property_ui_text(prop, "From Minimum X", "Bottom range of X axis source motion");
2398 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2399
2400 prop = RNA_def_property(srna, "from_min_y", PROP_FLOAT, PROP_DISTANCE);
2401 RNA_def_property_float_sdna(prop, nullptr, "from_min[1]");
2402 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2403 RNA_def_property_ui_text(prop, "From Minimum Y", "Bottom range of Y axis source motion");
2404 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2405
2406 prop = RNA_def_property(srna, "from_min_z", PROP_FLOAT, PROP_DISTANCE);
2407 RNA_def_property_float_sdna(prop, nullptr, "from_min[2]");
2408 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2409 RNA_def_property_ui_text(prop, "From Minimum Z", "Bottom range of Z axis source motion");
2410 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2411
2412 prop = RNA_def_property(srna, "from_max_x", PROP_FLOAT, PROP_DISTANCE);
2413 RNA_def_property_float_sdna(prop, nullptr, "from_max[0]");
2414 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2415 RNA_def_property_ui_text(prop, "From Maximum X", "Top range of X axis source motion");
2416 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2417
2418 prop = RNA_def_property(srna, "from_max_y", PROP_FLOAT, PROP_DISTANCE);
2419 RNA_def_property_float_sdna(prop, nullptr, "from_max[1]");
2420 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2421 RNA_def_property_ui_text(prop, "From Maximum Y", "Top range of Y axis source motion");
2422 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2423
2424 prop = RNA_def_property(srna, "from_max_z", PROP_FLOAT, PROP_DISTANCE);
2425 RNA_def_property_float_sdna(prop, nullptr, "from_max[2]");
2426 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2427 RNA_def_property_ui_text(prop, "From Maximum Z", "Top range of Z axis source motion");
2428 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2429
2430 prop = RNA_def_property(srna, "to_min_x", PROP_FLOAT, PROP_DISTANCE);
2431 RNA_def_property_float_sdna(prop, nullptr, "to_min[0]");
2432 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2433 RNA_def_property_ui_text(prop, "To Minimum X", "Bottom range of X axis destination motion");
2434 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2435
2436 prop = RNA_def_property(srna, "to_min_y", PROP_FLOAT, PROP_DISTANCE);
2437 RNA_def_property_float_sdna(prop, nullptr, "to_min[1]");
2438 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2439 RNA_def_property_ui_text(prop, "To Minimum Y", "Bottom range of Y axis destination motion");
2440 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2441
2442 prop = RNA_def_property(srna, "to_min_z", PROP_FLOAT, PROP_DISTANCE);
2443 RNA_def_property_float_sdna(prop, nullptr, "to_min[2]");
2444 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2445 RNA_def_property_ui_text(prop, "To Minimum Z", "Bottom range of Z axis destination motion");
2446 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2447
2448 prop = RNA_def_property(srna, "to_max_x", PROP_FLOAT, PROP_DISTANCE);
2449 RNA_def_property_float_sdna(prop, nullptr, "to_max[0]");
2450 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2451 RNA_def_property_ui_text(prop, "To Maximum X", "Top range of X axis destination motion");
2452 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2453
2454 prop = RNA_def_property(srna, "to_max_y", PROP_FLOAT, PROP_DISTANCE);
2455 RNA_def_property_float_sdna(prop, nullptr, "to_max[1]");
2456 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2457 RNA_def_property_ui_text(prop, "To Maximum Y", "Top range of Y axis destination motion");
2458 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2459
2460 prop = RNA_def_property(srna, "to_max_z", PROP_FLOAT, PROP_DISTANCE);
2461 RNA_def_property_float_sdna(prop, nullptr, "to_max[2]");
2462 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2463 RNA_def_property_ui_text(prop, "To Maximum Z", "Top range of Z axis destination motion");
2464 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2465
2466 prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
2467 RNA_def_property_enum_sdna(prop, nullptr, "mix_mode_loc");
2468 RNA_def_property_enum_items(prop, mix_mode_loc_items);
2470 prop, "Location Mix Mode", "Specify how to combine the new location with original");
2471 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2472
2473 /* Rot */
2474 prop = RNA_def_property(srna, "from_min_x_rot", PROP_FLOAT, PROP_ANGLE);
2475 RNA_def_property_float_sdna(prop, nullptr, "from_min_rot[0]");
2476 RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2477 RNA_def_property_ui_text(prop, "From Minimum X", "Bottom range of X axis source motion");
2478 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2479
2480 prop = RNA_def_property(srna, "from_min_y_rot", PROP_FLOAT, PROP_ANGLE);
2481 RNA_def_property_float_sdna(prop, nullptr, "from_min_rot[1]");
2482 RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2483 RNA_def_property_ui_text(prop, "From Minimum Y", "Bottom range of Y axis source motion");
2484 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2485
2486 prop = RNA_def_property(srna, "from_min_z_rot", PROP_FLOAT, PROP_ANGLE);
2487 RNA_def_property_float_sdna(prop, nullptr, "from_min_rot[2]");
2488 RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2489 RNA_def_property_ui_text(prop, "From Minimum Z", "Bottom range of Z axis source motion");
2490 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2491
2492 prop = RNA_def_property(srna, "from_max_x_rot", PROP_FLOAT, PROP_ANGLE);
2493 RNA_def_property_float_sdna(prop, nullptr, "from_max_rot[0]");
2494 RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2495 RNA_def_property_ui_text(prop, "From Maximum X", "Top range of X axis source motion");
2496 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2497
2498 prop = RNA_def_property(srna, "from_max_y_rot", PROP_FLOAT, PROP_ANGLE);
2499 RNA_def_property_float_sdna(prop, nullptr, "from_max_rot[1]");
2500 RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2501 RNA_def_property_ui_text(prop, "From Maximum Y", "Top range of Y axis source motion");
2502 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2503
2504 prop = RNA_def_property(srna, "from_max_z_rot", PROP_FLOAT, PROP_ANGLE);
2505 RNA_def_property_float_sdna(prop, nullptr, "from_max_rot[2]");
2506 RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2507 RNA_def_property_ui_text(prop, "From Maximum Z", "Top range of Z axis source motion");
2508 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2509
2510 prop = RNA_def_property(srna, "to_min_x_rot", PROP_FLOAT, PROP_ANGLE);
2511 RNA_def_property_float_sdna(prop, nullptr, "to_min_rot[0]");
2512 RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2513 RNA_def_property_ui_text(prop, "To Minimum X", "Bottom range of X axis destination motion");
2514 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2515
2516 prop = RNA_def_property(srna, "to_min_y_rot", PROP_FLOAT, PROP_ANGLE);
2517 RNA_def_property_float_sdna(prop, nullptr, "to_min_rot[1]");
2518 RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2519 RNA_def_property_ui_text(prop, "To Minimum Y", "Bottom range of Y axis destination motion");
2520 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2521
2522 prop = RNA_def_property(srna, "to_min_z_rot", PROP_FLOAT, PROP_ANGLE);
2523 RNA_def_property_float_sdna(prop, nullptr, "to_min_rot[2]");
2524 RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2525 RNA_def_property_ui_text(prop, "To Minimum Z", "Bottom range of Z axis destination motion");
2526 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2527
2528 prop = RNA_def_property(srna, "to_max_x_rot", PROP_FLOAT, PROP_ANGLE);
2529 RNA_def_property_float_sdna(prop, nullptr, "to_max_rot[0]");
2530 RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2531 RNA_def_property_ui_text(prop, "To Maximum X", "Top range of X axis destination motion");
2532 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2533
2534 prop = RNA_def_property(srna, "to_max_y_rot", PROP_FLOAT, PROP_ANGLE);
2535 RNA_def_property_float_sdna(prop, nullptr, "to_max_rot[1]");
2536 RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2537 RNA_def_property_ui_text(prop, "To Maximum Y", "Top range of Y axis destination motion");
2538 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2539
2540 prop = RNA_def_property(srna, "to_max_z_rot", PROP_FLOAT, PROP_ANGLE);
2541 RNA_def_property_float_sdna(prop, nullptr, "to_max_rot[2]");
2542 RNA_def_property_ui_range(prop, DEG2RADF(-180.0f), DEG2RADF(180.0f), 10, 3);
2543 RNA_def_property_ui_text(prop, "To Maximum Z", "Top range of Z axis destination motion");
2544 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2545
2546 prop = RNA_def_property(srna, "mix_mode_rot", PROP_ENUM, PROP_NONE);
2547 RNA_def_property_enum_sdna(prop, nullptr, "mix_mode_rot");
2548 RNA_def_property_enum_items(prop, mix_mode_rot_items);
2550 prop, "Rotation Mix Mode", "Specify how to combine the new rotation with original");
2551 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2552
2553 /* Scale */
2554 prop = RNA_def_property(srna, "from_min_x_scale", PROP_FLOAT, PROP_NONE);
2555 RNA_def_property_float_sdna(prop, nullptr, "from_min_scale[0]");
2556 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2557 RNA_def_property_ui_text(prop, "From Minimum X", "Bottom range of X axis source motion");
2558 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2559
2560 prop = RNA_def_property(srna, "from_min_y_scale", PROP_FLOAT, PROP_NONE);
2561 RNA_def_property_float_sdna(prop, nullptr, "from_min_scale[1]");
2562 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2563 RNA_def_property_ui_text(prop, "From Minimum Y", "Bottom range of Y axis source motion");
2564 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2565
2566 prop = RNA_def_property(srna, "from_min_z_scale", PROP_FLOAT, PROP_NONE);
2567 RNA_def_property_float_sdna(prop, nullptr, "from_min_scale[2]");
2568 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2569 RNA_def_property_ui_text(prop, "From Minimum Z", "Bottom range of Z axis source motion");
2570 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2571
2572 prop = RNA_def_property(srna, "from_max_x_scale", PROP_FLOAT, PROP_NONE);
2573 RNA_def_property_float_sdna(prop, nullptr, "from_max_scale[0]");
2574 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2575 RNA_def_property_ui_text(prop, "From Maximum X", "Top range of X axis source motion");
2576 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2577
2578 prop = RNA_def_property(srna, "from_max_y_scale", PROP_FLOAT, PROP_NONE);
2579 RNA_def_property_float_sdna(prop, nullptr, "from_max_scale[1]");
2580 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2581 RNA_def_property_ui_text(prop, "From Maximum Y", "Top range of Y axis source motion");
2582 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2583
2584 prop = RNA_def_property(srna, "from_max_z_scale", PROP_FLOAT, PROP_NONE);
2585 RNA_def_property_float_sdna(prop, nullptr, "from_max_scale[2]");
2586 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2587 RNA_def_property_ui_text(prop, "From Maximum Z", "Top range of Z axis source motion");
2588 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2589
2590 prop = RNA_def_property(srna, "to_min_x_scale", PROP_FLOAT, PROP_NONE);
2591 RNA_def_property_float_sdna(prop, nullptr, "to_min_scale[0]");
2592 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2593 RNA_def_property_ui_text(prop, "To Minimum X", "Bottom range of X axis destination motion");
2594 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2595
2596 prop = RNA_def_property(srna, "to_min_y_scale", PROP_FLOAT, PROP_NONE);
2597 RNA_def_property_float_sdna(prop, nullptr, "to_min_scale[1]");
2598 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2599 RNA_def_property_ui_text(prop, "To Minimum Y", "Bottom range of Y axis destination motion");
2600 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2601
2602 prop = RNA_def_property(srna, "to_min_z_scale", PROP_FLOAT, PROP_NONE);
2603 RNA_def_property_float_sdna(prop, nullptr, "to_min_scale[2]");
2604 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2605 RNA_def_property_ui_text(prop, "To Minimum Z", "Bottom range of Z axis destination motion");
2606 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2607
2608 prop = RNA_def_property(srna, "to_max_x_scale", PROP_FLOAT, PROP_NONE);
2609 RNA_def_property_float_sdna(prop, nullptr, "to_max_scale[0]");
2610 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2611 RNA_def_property_ui_text(prop, "To Maximum X", "Top range of X axis destination motion");
2612 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2613
2614 prop = RNA_def_property(srna, "to_max_y_scale", PROP_FLOAT, PROP_NONE);
2615 RNA_def_property_float_sdna(prop, nullptr, "to_max_scale[1]");
2616 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2617 RNA_def_property_ui_text(prop, "To Maximum Y", "Top range of Y axis destination motion");
2618 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2619
2620 prop = RNA_def_property(srna, "to_max_z_scale", PROP_FLOAT, PROP_NONE);
2621 RNA_def_property_float_sdna(prop, nullptr, "to_max_scale[2]");
2622 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2623 RNA_def_property_ui_text(prop, "To Maximum Z", "Top range of Z axis destination motion");
2624 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2625
2626 prop = RNA_def_property(srna, "mix_mode_scale", PROP_ENUM, PROP_NONE);
2627 RNA_def_property_enum_sdna(prop, nullptr, "mix_mode_scale");
2628 RNA_def_property_enum_items(prop, mix_mode_scale_items);
2630 prop, "Scale Mix Mode", "Specify how to combine the new scale with original");
2631 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2632
2634}
2635
2637{
2638 StructRNA *srna;
2639 PropertyRNA *prop;
2640
2641 srna = RNA_def_struct(brna, "LimitLocationConstraint", "Constraint");
2643 srna, "Limit Location Constraint", "Limit the location of the constrained object");
2644 RNA_def_struct_sdna_from(srna, "bLocLimitConstraint", "data");
2645 RNA_def_struct_ui_icon(srna, ICON_CON_LOCLIMIT);
2646
2648
2649 prop = RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE);
2650 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LIMIT_XMIN);
2651 RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value");
2652 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2653
2654 prop = RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE);
2655 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LIMIT_YMIN);
2656 RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value");
2657 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2658
2659 prop = RNA_def_property(srna, "use_min_z", PROP_BOOLEAN, PROP_NONE);
2660 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LIMIT_ZMIN);
2661 RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value");
2662 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2663
2664 prop = RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE);
2665 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LIMIT_XMAX);
2666 RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value");
2667 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2668
2669 prop = RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE);
2670 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LIMIT_YMAX);
2671 RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value");
2672 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2673
2674 prop = RNA_def_property(srna, "use_max_z", PROP_BOOLEAN, PROP_NONE);
2675 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LIMIT_ZMAX);
2676 RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value");
2677 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2678
2679 prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_DISTANCE);
2680 RNA_def_property_float_sdna(prop, nullptr, "xmin");
2681 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2682 RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
2683 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2684
2685 prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_DISTANCE);
2686 RNA_def_property_float_sdna(prop, nullptr, "ymin");
2687 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2688 RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
2689 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2690
2691 prop = RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_DISTANCE);
2692 RNA_def_property_float_sdna(prop, nullptr, "zmin");
2693 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2694 RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow");
2695 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2696
2697 prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_DISTANCE);
2698 RNA_def_property_float_sdna(prop, nullptr, "xmax");
2699 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2700 RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
2701 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2702
2703 prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_DISTANCE);
2704 RNA_def_property_float_sdna(prop, nullptr, "ymax");
2705 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2706 RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
2707 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2708
2709 prop = RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_DISTANCE);
2710 RNA_def_property_float_sdna(prop, nullptr, "zmax");
2711 RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3);
2712 RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow");
2713 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2714
2715 prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
2716 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", LIMIT_TRANSFORM);
2718 prop, "Affect Transform", "Transform tools are affected by this constraint as well");
2719 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2720
2722}
2723
2725{
2726 StructRNA *srna;
2727 PropertyRNA *prop;
2728
2729 srna = RNA_def_struct(brna, "LimitRotationConstraint", "Constraint");
2731 srna, "Limit Rotation Constraint", "Limit the rotation of the constrained object");
2732 RNA_def_struct_sdna_from(srna, "bRotLimitConstraint", "data");
2733 RNA_def_struct_ui_icon(srna, ICON_CON_ROTLIMIT);
2734
2736
2737 prop = RNA_def_property(srna, "use_limit_x", PROP_BOOLEAN, PROP_NONE);
2738 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LIMIT_XROT);
2739 RNA_def_property_ui_text(prop, "Limit X", "Use the minimum X value");
2740 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2741
2742 prop = RNA_def_property(srna, "use_limit_y", PROP_BOOLEAN, PROP_NONE);
2743 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LIMIT_YROT);
2744 RNA_def_property_ui_text(prop, "Limit Y", "Use the minimum Y value");
2745 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2746
2747 prop = RNA_def_property(srna, "use_limit_z", PROP_BOOLEAN, PROP_NONE);
2748 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LIMIT_ZROT);
2749 RNA_def_property_ui_text(prop, "Limit Z", "Use the minimum Z value");
2750 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2751
2752 prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_ANGLE);
2753 RNA_def_property_float_sdna(prop, nullptr, "xmin");
2754 RNA_def_property_range(prop, -1000.0, 1000.0f);
2755 RNA_def_property_ui_range(prop, -2 * M_PI, 2 * M_PI, 10.0f, 1.0f);
2756 RNA_def_property_ui_text(prop, "Minimum X", "Lower X angle bound");
2757 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2758
2759 prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_ANGLE);
2760 RNA_def_property_float_sdna(prop, nullptr, "ymin");
2761 RNA_def_property_range(prop, -1000.0, 1000.0f);
2762 RNA_def_property_ui_range(prop, -2 * M_PI, 2 * M_PI, 10.0f, 1.0f);
2763 RNA_def_property_ui_text(prop, "Minimum Y", "Lower Y angle bound");
2764 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2765
2766 prop = RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_ANGLE);
2767 RNA_def_property_float_sdna(prop, nullptr, "zmin");
2768 RNA_def_property_range(prop, -1000.0, 1000.0f);
2769 RNA_def_property_ui_range(prop, -2 * M_PI, 2 * M_PI, 10.0f, 1.0f);
2770 RNA_def_property_ui_text(prop, "Minimum Z", "Lower Z angle bound");
2771 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2772
2773 prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_ANGLE);
2774 RNA_def_property_float_sdna(prop, nullptr, "xmax");
2775 RNA_def_property_range(prop, -1000.0, 1000.0f);
2776 RNA_def_property_ui_range(prop, -2 * M_PI, 2 * M_PI, 10.0f, 1.0f);
2777 RNA_def_property_ui_text(prop, "Maximum X", "Upper X angle bound");
2778 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2779
2780 prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_ANGLE);
2781 RNA_def_property_float_sdna(prop, nullptr, "ymax");
2782 RNA_def_property_range(prop, -1000.0, 1000.0f);
2783 RNA_def_property_ui_range(prop, -2 * M_PI, 2 * M_PI, 10.0f, 1.0f);
2784 RNA_def_property_ui_text(prop, "Maximum Y", "Upper Y angle bound");
2785 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2786
2787 prop = RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_ANGLE);
2788 RNA_def_property_float_sdna(prop, nullptr, "zmax");
2789 RNA_def_property_range(prop, -1000.0, 1000.0f);
2790 RNA_def_property_ui_range(prop, -2 * M_PI, 2 * M_PI, 10.0f, 1.0f);
2791 RNA_def_property_ui_text(prop, "Maximum Z", "Upper Z angle bound");
2792 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2793
2794 prop = RNA_def_property(srna, "euler_order", PROP_ENUM, PROP_NONE);
2795 RNA_def_property_enum_sdna(prop, nullptr, "euler_order");
2797 RNA_def_property_ui_text(prop, "Euler Order", "Explicitly specify the euler rotation order");
2798 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2799
2800 prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
2801 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", LIMIT_TRANSFORM);
2803 prop, "Affect Transform", "Transform tools are affected by this constraint as well");
2804 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2805
2806 prop = RNA_def_property(srna, "use_legacy_behavior", PROP_BOOLEAN, PROP_NONE);
2809 prop,
2810 "Legacy Behavior",
2811 "Use the old semi-broken behavior that doesn't understand that rotations loop around");
2812 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2813
2815}
2816
2818{
2819 StructRNA *srna;
2820 PropertyRNA *prop;
2821
2822 srna = RNA_def_struct(brna, "LimitScaleConstraint", "Constraint");
2824 srna, "Limit Size Constraint", "Limit the scaling of the constrained object");
2825 RNA_def_struct_sdna_from(srna, "bSizeLimitConstraint", "data");
2826 RNA_def_struct_ui_icon(srna, ICON_CON_SIZELIMIT);
2827
2829
2830 prop = RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE);
2831 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LIMIT_XMIN);
2832 RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value");
2833 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2834
2835 prop = RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE);
2836 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LIMIT_YMIN);
2837 RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value");
2838 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2839
2840 prop = RNA_def_property(srna, "use_min_z", PROP_BOOLEAN, PROP_NONE);
2841 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LIMIT_ZMIN);
2842 RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value");
2843 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2844
2845 prop = RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE);
2846 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LIMIT_XMAX);
2847 RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value");
2848 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2849
2850 prop = RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE);
2851 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LIMIT_YMAX);
2852 RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value");
2853 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2854
2855 prop = RNA_def_property(srna, "use_max_z", PROP_BOOLEAN, PROP_NONE);
2856 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LIMIT_ZMAX);
2857 RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value");
2858 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2859
2860 prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_NONE);
2861 RNA_def_property_float_sdna(prop, nullptr, "xmin");
2862 RNA_def_property_range(prop, -1000.0, 1000.0f);
2863 RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
2864 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2865
2866 prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_NONE);
2867 RNA_def_property_float_sdna(prop, nullptr, "ymin");
2868 RNA_def_property_range(prop, -1000.0, 1000.0f);
2869 RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
2870 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2871
2872 prop = RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_NONE);
2873 RNA_def_property_float_sdna(prop, nullptr, "zmin");
2874 RNA_def_property_range(prop, -1000.0, 1000.0f);
2875 RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow");
2876 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2877
2878 prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_NONE);
2879 RNA_def_property_float_sdna(prop, nullptr, "xmax");
2880 RNA_def_property_range(prop, -1000.0, 1000.0f);
2881 RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
2882 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2883
2884 prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_NONE);
2885 RNA_def_property_float_sdna(prop, nullptr, "ymax");
2886 RNA_def_property_range(prop, -1000.0, 1000.0f);
2887 RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
2888 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2889
2890 prop = RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_NONE);
2891 RNA_def_property_float_sdna(prop, nullptr, "zmax");
2892 RNA_def_property_range(prop, -1000.0, 1000.0f);
2893 RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow");
2894 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2895
2896 prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
2897 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", LIMIT_TRANSFORM);
2899 prop, "Affect Transform", "Transform tools are affected by this constraint as well");
2900 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2901
2903}
2904
2906{
2907 StructRNA *srna;
2908 PropertyRNA *prop;
2909
2910 srna = RNA_def_struct(brna, "LimitDistanceConstraint", "Constraint");
2912 srna, "Limit Distance Constraint", "Limit the distance from target object");
2913
2915
2916 RNA_def_struct_sdna_from(srna, "bDistLimitConstraint", "data");
2917 RNA_def_struct_ui_icon(srna, ICON_CON_DISTLIMIT);
2918
2920
2922
2923 prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
2924 RNA_def_property_float_sdna(prop, nullptr, "dist");
2925 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 10, 3);
2926 RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere");
2927 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2928
2929 prop = RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE);
2930 RNA_def_property_enum_sdna(prop, nullptr, "mode");
2933 prop, "Limit Mode", "Distances in relation to sphere of influence to allow");
2934 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2935
2936 prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE);
2937 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LIMITDIST_TRANSFORM);
2939 prop, "Affect Transform", "Transforms are affected by this constraint as well");
2940 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
2941
2943}
2944
2946{
2947 StructRNA *srna;
2948 PropertyRNA *prop;
2949
2950 static const EnumPropertyItem type_items[] = {
2952 "NEAREST_SURFACE",
2953 0,
2954 "Nearest Surface Point",
2955 "Shrink the location to the nearest target surface"},
2957 "PROJECT",
2958 0,
2959 "Project",
2960 "Shrink the location to the nearest target surface along a given axis"},
2962 "NEAREST_VERTEX",
2963 0,
2964 "Nearest Vertex",
2965 "Shrink the location to the nearest target vertex"},
2967 "TARGET_PROJECT",
2968 0,
2969 "Target Normal Project",
2970 "Shrink the location to the nearest target surface "
2971 "along the interpolated vertex normals of the target"},
2972 {0, nullptr, 0, nullptr, nullptr},
2973 };
2974
2975 static const EnumPropertyItem shrink_face_cull_items[] = {
2976 {0, "OFF", 0, "Off", "No culling"},
2978 "FRONT",
2979 0,
2980 "Front",
2981 "No projection when in front of the face"},
2983 "BACK",
2984 0,
2985 "Back",
2986 "No projection when behind the face"},
2987 {0, nullptr, 0, nullptr, nullptr},
2988 };
2989
2990 srna = RNA_def_struct(brna, "ShrinkwrapConstraint", "Constraint");
2992 srna, "Shrinkwrap Constraint", "Create constraint-based shrinkwrap relationship");
2993 RNA_def_struct_sdna_from(srna, "bShrinkwrapConstraint", "data");
2994 RNA_def_struct_ui_icon(srna, ICON_CON_SHRINKWRAP);
2995
2997
2998 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
2999 RNA_def_property_pointer_sdna(prop, nullptr, "target"); /* TODO: mesh type. */
3000 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_Mesh_object_poll");
3001 RNA_def_property_ui_text(prop, "Target", "Target Mesh object");
3003 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3004
3005 prop = RNA_def_property(srna, "shrinkwrap_type", PROP_ENUM, PROP_NONE);
3006 RNA_def_property_enum_sdna(prop, nullptr, "shrinkType");
3007 RNA_def_property_enum_items(prop, type_items);
3009 prop, "Shrinkwrap Type", "Select type of shrinkwrap algorithm for target position");
3010 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3011
3012 prop = RNA_def_property(srna, "wrap_mode", PROP_ENUM, PROP_NONE);
3013 RNA_def_property_enum_sdna(prop, nullptr, "shrinkMode");
3016 prop, "Snap Mode", "Select how to constrain the object to the target surface");
3017 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3018
3019 prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
3020 RNA_def_property_float_sdna(prop, nullptr, "dist");
3021 RNA_def_property_range(prop, 0.0f, FLT_MAX);
3022 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 10, 3);
3023 RNA_def_property_ui_text(prop, "Distance", "Distance to Target");
3024 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3025
3026 prop = RNA_def_property(srna, "project_axis", PROP_ENUM, PROP_NONE);
3027 RNA_def_property_enum_sdna(prop, nullptr, "projAxis");
3029 RNA_def_property_ui_text(prop, "Project Axis", "Axis constrain to");
3030 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3031
3032 prop = RNA_def_property(srna, "project_axis_space", PROP_ENUM, PROP_NONE);
3033 RNA_def_property_enum_sdna(prop, nullptr, "projAxisSpace");
3035 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_Constraint_owner_space_itemf");
3036 RNA_def_property_ui_text(prop, "Axis Space", "Space for the projection axis");
3037
3038 prop = RNA_def_property(srna, "project_limit", PROP_FLOAT, PROP_DISTANCE);
3039 RNA_def_property_float_sdna(prop, nullptr, "projLimit");
3040 RNA_def_property_range(prop, 0.0f, FLT_MAX);
3041 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 10, 3);
3043 prop, "Project Distance", "Limit the distance used for projection (zero disables)");
3044 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3045
3046 prop = RNA_def_property(srna, "use_project_opposite", PROP_BOOLEAN, PROP_NONE);
3049 prop, "Project Opposite", "Project in both specified and opposite directions");
3050 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3051
3052 prop = RNA_def_property(srna, "cull_face", PROP_ENUM, PROP_NONE);
3053 RNA_def_property_enum_sdna(prop, nullptr, "flag");
3054 RNA_def_property_enum_items(prop, shrink_face_cull_items);
3056 "rna_ShrinkwrapConstraint_face_cull_get",
3057 "rna_ShrinkwrapConstraint_face_cull_set",
3058 nullptr);
3060 prop,
3061 "Face Cull",
3062 "Stop vertices from projecting to a face on the target when facing towards/away");
3063 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3064
3065 prop = RNA_def_property(srna, "use_invert_cull", PROP_BOOLEAN, PROP_NONE);
3068 prop, "Invert Cull", "When projecting in the opposite direction invert the face cull mode");
3069 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3070
3071 prop = RNA_def_property(srna, "use_track_normal", PROP_BOOLEAN, PROP_NONE);
3074 prop, "Align Axis To Normal", "Align the specified axis to the surface normal");
3075 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3076
3077 prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
3078 RNA_def_property_enum_sdna(prop, nullptr, "trackAxis");
3080 RNA_def_property_ui_text(prop, "Track Axis", "Axis that is aligned to the normal");
3081 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3082
3084}
3085
3087{
3088 StructRNA *srna;
3089 PropertyRNA *prop;
3090
3091 srna = RNA_def_struct(brna, "DampedTrackConstraint", "Constraint");
3093 srna, "Damped Track Constraint", "Point toward target by taking the shortest rotation path");
3094 RNA_def_struct_ui_icon(srna, ICON_CON_TRACKTO);
3095
3097
3098 RNA_def_struct_sdna_from(srna, "bDampTrackConstraint", "data");
3099
3101
3103
3104 prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
3105 RNA_def_property_enum_sdna(prop, nullptr, "trackflag");
3107 RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object");
3108 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3109
3111}
3112
3114{
3115 StructRNA *srna;
3116 PropertyRNA *prop;
3117
3118 static const EnumPropertyItem splineik_xz_scale_mode[] = {
3119 {CONSTRAINT_SPLINEIK_XZS_NONE, "NONE", 0, "None", "Don't scale the X and Z axes"},
3121 "BONE_ORIGINAL",
3122 0,
3123 "Bone Original",
3124 "Use the original scaling of the bones"},
3126 "INVERSE_PRESERVE",
3127 0,
3128 "Inverse Scale",
3129 "Scale of the X and Z axes is the inverse of the Y-Scale"},
3131 "VOLUME_PRESERVE",
3132 0,
3133 "Volume Preservation",
3134 "Scale of the X and Z axes are adjusted to preserve the volume of the bones"},
3135 {0, nullptr, 0, nullptr, nullptr},
3136 };
3137
3138 static const EnumPropertyItem splineik_y_scale_mode[] = {
3139 {CONSTRAINT_SPLINEIK_YS_NONE, "NONE", 0, "None", "Don't scale in the Y axis"},
3141 "FIT_CURVE",
3142 0,
3143 "Fit Curve",
3144 "Scale the bones to fit the entire length of the curve"},
3146 "BONE_ORIGINAL",
3147 0,
3148 "Bone Original",
3149 "Use the original Y scale of the bone"},
3150 {0, nullptr, 0, nullptr, nullptr},
3151 };
3152
3153 srna = RNA_def_struct(brna, "SplineIKConstraint", "Constraint");
3154 RNA_def_struct_ui_text(srna, "Spline IK Constraint", "Align 'n' bones along a curve");
3155 RNA_def_struct_sdna_from(srna, "bSplineIKConstraint", "data");
3156 RNA_def_struct_ui_icon(srna, ICON_CON_SPLINEIK);
3157
3159
3160 /* target chain */
3161 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
3162 RNA_def_property_pointer_sdna(prop, nullptr, "tar");
3163 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_Curve_object_poll");
3164 RNA_def_property_ui_text(prop, "Target", "Curve that controls this relationship");
3166 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3167
3168 prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE);
3169 RNA_def_property_int_sdna(prop, nullptr, "chainlen");
3170 /* Changing the IK chain length requires a rebuild of depsgraph relations. This makes it
3171 * unsuitable for animation. */
3173 /* TODO: this should really check the max length of the chain the constraint is attached to */
3174 RNA_def_property_range(prop, 1, 255);
3175 RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the chain");
3176 /* XXX: this update goes wrong... needs extra flush? */
3177 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3178
3179 /* direct access to bindings */
3180 /* NOTE: only to be used by experienced users */
3181 prop = RNA_def_property(srna, "joint_bindings", PROP_FLOAT, PROP_FACTOR);
3182 RNA_def_property_array(prop, 32); /* XXX this is the maximum value allowed - why? */
3184 RNA_def_property_dynamic_array_funcs(prop, "rna_SplineIKConstraint_joint_bindings_get_length");
3186 "rna_SplineIKConstraint_joint_bindings_get",
3187 "rna_SplineIKConstraint_joint_bindings_set",
3188 nullptr);
3190 prop,
3191 "Joint Bindings",
3192 "(EXPERIENCED USERS ONLY) The relative positions of the joints along the chain, "
3193 "as percentages");
3194 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3195
3196 /* settings */
3197 prop = RNA_def_property(srna, "use_chain_offset", PROP_BOOLEAN, PROP_NONE);
3200 prop, "Chain Offset", "Offset the entire chain relative to the root joint");
3201 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3202
3203 prop = RNA_def_property(srna, "use_even_divisions", PROP_BOOLEAN, PROP_NONE);
3206 "Even Divisions",
3207 "Ignore the relative lengths of the bones when fitting to the curve");
3208 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3209
3210 prop = RNA_def_property(srna, "use_curve_radius", PROP_BOOLEAN, PROP_NONE);
3213 prop,
3214 "Use Curve Radius",
3215 "Average radius of the endpoints is used to tweak the X and Z Scaling of the bones, "
3216 "on top of XZ Scale mode");
3217 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3218
3219 /* xz scaling mode */
3220 prop = RNA_def_property(srna, "xz_scale_mode", PROP_ENUM, PROP_NONE);
3221 RNA_def_property_enum_sdna(prop, nullptr, "xzScaleMode");
3222 RNA_def_property_enum_items(prop, splineik_xz_scale_mode);
3224 prop,
3225 "XZ Scale Mode",
3226 "Method used for determining the scaling of the X and Z axes of the bones");
3227 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3228
3229 /* y scaling mode */
3230 prop = RNA_def_property(srna, "y_scale_mode", PROP_ENUM, PROP_NONE);
3231 RNA_def_property_enum_sdna(prop, nullptr, "yScaleMode");
3232 RNA_def_property_enum_items(prop, splineik_y_scale_mode);
3234 "Y Scale Mode",
3235 "Method used for determining the scaling of the Y axis of the bones, "
3236 "on top of the shape and scaling of the curve itself");
3237 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3238
3239 /* take original scaling of the bone into account in volume preservation */
3240 prop = RNA_def_property(srna, "use_original_scale", PROP_BOOLEAN, PROP_NONE);
3243 prop, "Use Original Scale", "Apply volume preservation over the original scaling");
3244 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3245
3246 /* Volume preservation for "volumetric" scale mode. */
3247 prop = RNA_def_property(srna, "bulge", PROP_FLOAT, PROP_NONE);
3248 RNA_def_property_range(prop, 0.0, 100.0f);
3250 prop, "Volume Variation", "Factor between volume variation and stretching");
3251 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3252
3253 prop = RNA_def_property(srna, "use_bulge_min", PROP_BOOLEAN, PROP_NONE);
3256 prop, "Use Volume Variation Minimum", "Use lower limit for volume variation");
3257 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3258
3259 prop = RNA_def_property(srna, "use_bulge_max", PROP_BOOLEAN, PROP_NONE);
3262 prop, "Use Volume Variation Maximum", "Use upper limit for volume variation");
3263 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3264
3265 prop = RNA_def_property(srna, "bulge_min", PROP_FLOAT, PROP_NONE);
3266 RNA_def_property_range(prop, 0.0, 1.0f);
3267 RNA_def_property_ui_text(prop, "Volume Variation Minimum", "Minimum volume stretching factor");
3268 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3269
3270 prop = RNA_def_property(srna, "bulge_max", PROP_FLOAT, PROP_NONE);
3271 RNA_def_property_range(prop, 1.0, 100.0f);
3272 RNA_def_property_ui_text(prop, "Volume Variation Maximum", "Maximum volume stretching factor");
3273 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3274
3275 prop = RNA_def_property(srna, "bulge_smooth", PROP_FLOAT, PROP_FACTOR);
3276 RNA_def_property_range(prop, 0.0, 1.0f);
3278 prop, "Volume Variation Smoothness", "Strength of volume stretching clamping");
3279 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3280
3282}
3283
3285{
3286 StructRNA *srna;
3287 PropertyRNA *prop;
3288
3289 static const EnumPropertyItem pivot_rotAxis_items[] = {
3290 {PIVOTCON_AXIS_NONE, "ALWAYS_ACTIVE", 0, "Always", "Use the pivot point in every rotation"},
3292 "NX",
3293 0,
3294 "-X Rotation",
3295 "Use the pivot point in the negative rotation range around the X-axis"},
3297 "NY",
3298 0,
3299 "-Y Rotation",
3300 "Use the pivot point in the negative rotation range around the Y-axis"},
3302 "NZ",
3303 0,
3304 "-Z Rotation",
3305 "Use the pivot point in the negative rotation range around the Z-axis"},
3307 "X",
3308 0,
3309 "X Rotation",
3310 "Use the pivot point in the positive rotation range around the X-axis"},
3312 "Y",
3313 0,
3314 "Y Rotation",
3315 "Use the pivot point in the positive rotation range around the Y-axis"},
3317 "Z",
3318 0,
3319 "Z Rotation",
3320 "Use the pivot point in the positive rotation range around the Z-axis"},
3321 {0, nullptr, 0, nullptr, nullptr},
3322 };
3323
3324 srna = RNA_def_struct(brna, "PivotConstraint", "Constraint");
3325 RNA_def_struct_ui_text(srna, "Pivot Constraint", "Rotate around a different point");
3326
3328
3329 RNA_def_struct_sdna_from(srna, "bPivotConstraint", "data");
3330
3331 RNA_def_struct_ui_icon(srna, ICON_CON_PIVOT);
3332
3334
3335 /* target-defined pivot */
3336 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
3337 RNA_def_property_pointer_sdna(prop, nullptr, "tar");
3339 prop, "Target", "Target Object, defining the position of the pivot when defined");
3341 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3342
3343 prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
3344 RNA_def_property_string_sdna(prop, nullptr, "subtarget");
3345 RNA_def_property_ui_text(prop, "Sub-Target", "");
3346 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3347
3348 /* pivot offset */
3349 prop = RNA_def_property(srna, "use_relative_location", PROP_BOOLEAN, PROP_NONE);
3352 prop,
3353 "Use Relative Offset",
3354 "Offset will be an absolute point in space instead of relative to the target");
3355 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3356
3357 prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION);
3358 RNA_def_property_float_sdna(prop, nullptr, "offset");
3360 "Offset",
3361 "Offset of pivot from target (when set), or from owner's location "
3362 "(when Fixed Position is off), or the absolute pivot point");
3363 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3364
3365 /* rotation-based activation */
3366 prop = RNA_def_property(srna, "rotation_range", PROP_ENUM, PROP_NONE);
3367 RNA_def_property_enum_sdna(prop, nullptr, "rotAxis");
3368 RNA_def_property_enum_items(prop, pivot_rotAxis_items);
3370 prop, "Enabled Rotation Range", "Rotation range on which pivoting should occur");
3371 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3372
3374}
3375
3377{
3378 StructRNA *srna;
3379 PropertyRNA *prop;
3380
3381 static const EnumPropertyItem frame_method_items[] = {
3382 {FOLLOWTRACK_FRAME_STRETCH, "STRETCH", 0, "Stretch", ""},
3383 {FOLLOWTRACK_FRAME_FIT, "FIT", 0, "Fit", ""},
3384 {FOLLOWTRACK_FRAME_CROP, "CROP", 0, "Crop", ""},
3385 {0, nullptr, 0, nullptr, nullptr},
3386 };
3387
3388 srna = RNA_def_struct(brna, "FollowTrackConstraint", "Constraint");
3390 srna, "Follow Track Constraint", "Lock motion to the target motion track");
3391 RNA_def_struct_sdna_from(srna, "bFollowTrackConstraint", "data");
3392 RNA_def_struct_ui_icon(srna, ICON_CON_FOLLOWTRACK);
3393
3395
3396 /* movie clip */
3397 prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
3398 RNA_def_property_pointer_sdna(prop, nullptr, "clip");
3399 RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from");
3401 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3402
3403 /* track */
3404 prop = RNA_def_property(srna, "track", PROP_STRING, PROP_NONE);
3405 RNA_def_property_string_sdna(prop, nullptr, "track");
3406 RNA_def_property_ui_text(prop, "Track", "Movie tracking track to follow");
3408 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3409
3410 /* use default clip */
3411 prop = RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE);
3413 RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene");
3414 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3415
3416 /* use 3d position */
3417 prop = RNA_def_property(srna, "use_3d_position", PROP_BOOLEAN, PROP_NONE);
3419 RNA_def_property_ui_text(prop, "3D Position", "Use 3D position of track to parent to");
3420 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3421
3422 /* object */
3423 prop = RNA_def_property(srna, "object", PROP_STRING, PROP_NONE);
3424 RNA_def_property_string_sdna(prop, nullptr, "object");
3426 prop, "Object", "Movie tracking object to follow (if empty, camera object is used)");
3427 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3428
3429 /* camera */
3430 prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
3431 RNA_def_property_pointer_sdna(prop, nullptr, "camera");
3433 prop, "Camera", "Camera to which motion is parented (if empty active scene camera is used)");
3435 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3437 nullptr,
3438 "rna_Constraint_followTrack_camera_set",
3439 nullptr,
3440 "rna_Constraint_cameraObject_poll");
3441
3442 /* depth object */
3443 prop = RNA_def_property(srna, "depth_object", PROP_POINTER, PROP_NONE);
3444 RNA_def_property_pointer_sdna(prop, nullptr, "depth_ob");
3446 prop,
3447 "Depth Object",
3448 "Object used to define depth in camera space by projecting onto surface of this object");
3450 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3452 nullptr,
3453 "rna_Constraint_followTrack_depthObject_set",
3454 nullptr,
3455 "rna_Constraint_followTrack_depthObject_poll");
3456
3457 /* frame method */
3458 prop = RNA_def_property(srna, "frame_method", PROP_ENUM, PROP_NONE);
3459 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "frame_method");
3460 RNA_def_property_enum_items(prop, frame_method_items);
3461 RNA_def_property_ui_text(prop, "Frame Method", "How the footage fits in the camera frame");
3462 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3463
3464 /* use undistortion */
3465 prop = RNA_def_property(srna, "use_undistorted_position", PROP_BOOLEAN, PROP_NONE);
3467 RNA_def_property_ui_text(prop, "Undistort", "Parent to undistorted position of 2D track");
3468 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3469
3471}
3472
3474{
3475 StructRNA *srna;
3476 PropertyRNA *prop;
3477
3478 srna = RNA_def_struct(brna, "CameraSolverConstraint", "Constraint");
3480 srna, "Camera Solver Constraint", "Lock motion to the reconstructed camera movement");
3481 RNA_def_struct_sdna_from(srna, "bCameraSolverConstraint", "data");
3482 RNA_def_struct_ui_icon(srna, ICON_CON_CAMERASOLVER);
3483
3485
3486 /* movie clip */
3487 prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
3488 RNA_def_property_pointer_sdna(prop, nullptr, "clip");
3489 RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from");
3491 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3492
3493 /* use default clip */
3494 prop = RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE);
3496 RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene");
3497 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3498
3500}
3501
3503{
3504 StructRNA *srna;
3505 PropertyRNA *prop;
3506
3507 srna = RNA_def_struct(brna, "ObjectSolverConstraint", "Constraint");
3509 srna, "Object Solver Constraint", "Lock motion to the reconstructed object movement");
3510 RNA_def_struct_sdna_from(srna, "bObjectSolverConstraint", "data");
3511 RNA_def_struct_ui_icon(srna, ICON_CON_OBJECTSOLVER);
3512
3514
3515 /* movie clip */
3516 prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
3517 RNA_def_property_pointer_sdna(prop, nullptr, "clip");
3518 RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from");
3520 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3521
3522 /* use default clip */
3523 prop = RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE);
3525 RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene");
3526 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3527
3528 prop = RNA_def_property(srna, "set_inverse_pending", PROP_BOOLEAN, PROP_NONE);
3531 prop, "Set Inverse Pending", "Set to true to request recalculation of the inverse matrix");
3532 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3533
3534 /* object */
3535 prop = RNA_def_property(srna, "object", PROP_STRING, PROP_NONE);
3536 RNA_def_property_string_sdna(prop, nullptr, "object");
3537 RNA_def_property_ui_text(prop, "Object", "Movie tracking object to follow");
3538 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3539
3540 /* camera */
3541 prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
3542 RNA_def_property_pointer_sdna(prop, nullptr, "camera");
3544 prop, "Camera", "Camera to which motion is parented (if empty active scene camera is used)");
3546 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3548 nullptr,
3549 "rna_Constraint_objectSolver_camera_set",
3550 nullptr,
3551 "rna_Constraint_cameraObject_poll");
3552
3554}
3555
3557{
3558 StructRNA *srna;
3559 PropertyRNA *prop;
3560
3561 srna = RNA_def_struct(brna, "TransformCacheConstraint", "Constraint");
3563 srna, "Transform Cache Constraint", "Look up transformation from an external file");
3564 RNA_def_struct_sdna_from(srna, "bTransformCacheConstraint", "data");
3565 RNA_def_struct_ui_icon(srna, ICON_CON_TRANSFORM_CACHE);
3566
3568
3569 prop = RNA_def_property(srna, "cache_file", PROP_POINTER, PROP_NONE);
3570 RNA_def_property_pointer_sdna(prop, nullptr, "cache_file");
3571 RNA_def_property_struct_type(prop, "CacheFile");
3572 RNA_def_property_ui_text(prop, "Cache File", "");
3574 RNA_def_property_update(prop, 0, "rna_Constraint_dependency_update");
3575
3576 prop = RNA_def_property(srna, "object_path", PROP_STRING, PROP_NONE);
3578 prop,
3579 "Object Path",
3580 "Path to the object in the Alembic archive used to lookup the transform matrix");
3581 RNA_def_property_update(prop, 0, "rna_Constraint_update");
3582
3584}
3585
3586/* Define the base struct for constraints. */
3587
3589{
3590 StructRNA *srna;
3591 PropertyRNA *prop;
3592
3593 /* data */
3594 srna = RNA_def_struct(brna, "Constraint", nullptr);
3596 srna, "Constraint", "Constraint modifying the transformation of objects and bones");
3597 RNA_def_struct_refine_func(srna, "rna_ConstraintType_refine");
3598 RNA_def_struct_path_func(srna, "rna_Constraint_path");
3599 RNA_def_struct_sdna(srna, "bConstraint");
3600 RNA_def_struct_ui_icon(srna, ICON_CONSTRAINT);
3601
3602 /* strings */
3603 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
3604 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_Constraint_name_set");
3605 RNA_def_property_ui_text(prop, "Name", "Constraint name");
3606 RNA_def_struct_name_property(srna, prop);
3608
3609 /* enums */
3610 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
3612 RNA_def_property_enum_sdna(prop, nullptr, "type");
3614 RNA_def_property_ui_text(prop, "Type", "");
3615
3616 prop = RNA_def_boolean(srna,
3617 "is_override_data",
3618 false,
3619 "Override Constraint",
3620 "In a local override object, whether this constraint comes from the "
3621 "linked reference object, or is local to the override");
3624
3626
3627 prop = RNA_def_property(srna, "owner_space", PROP_ENUM, PROP_NONE);
3628 RNA_def_property_enum_sdna(prop, nullptr, "ownspace");
3630 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_Constraint_owner_space_itemf");
3631 RNA_def_property_ui_text(prop, "Owner Space", "Space that owner is evaluated in");
3632 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3633
3634 prop = RNA_def_property(srna, "target_space", PROP_ENUM, PROP_NONE);
3635 RNA_def_property_enum_sdna(prop, nullptr, "tarspace");
3637 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_Constraint_target_space_itemf");
3638 RNA_def_property_ui_text(prop, "Target Space", "Space that target is evaluated in");
3639 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3640
3641 prop = RNA_def_property(srna, "space_object", PROP_POINTER, PROP_NONE);
3642 RNA_def_property_pointer_sdna(prop, nullptr, "space_object");
3643 RNA_def_property_ui_text(prop, "Object", "Object for Custom Space");
3646 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3647
3648 prop = RNA_def_property(srna, "space_subtarget", PROP_STRING, PROP_NONE);
3649 RNA_def_property_string_sdna(prop, nullptr, "space_subtarget");
3650 RNA_def_property_ui_text(prop, "Sub-Target", "Armature bone, mesh or lattice vertex group, ...");
3651 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
3652
3653 /* flags */
3654 prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
3655 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CONSTRAINT_OFF);
3656 RNA_def_property_ui_text(prop, "Disable", "Enable/Disable Constraint");
3657 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3658 RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
3659
3660 prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
3662 RNA_def_property_ui_text(prop, "Enabled", "Use the results of this constraint");
3663 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
3664 RNA_def_property_ui_icon(prop, ICON_HIDE_ON, 1);
3665
3666 prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
3668 RNA_def_property_boolean_sdna(prop, nullptr, "ui_expand_flag", 0);
3669 RNA_def_property_ui_text(prop, "Expanded", "Constraint's panel is expanded in UI");
3670 RNA_def_property_ui_icon(prop, ICON_RIGHTARROW, 1);
3671
3672 /* XXX this is really an internal flag,
3673 * but it may be useful for some tools to be able to access this... */
3674 prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
3677 RNA_def_property_ui_text(prop, "Valid", "Constraint has valid settings and can be evaluated");
3678
3679 /* TODO: setting this to true must ensure that all others in stack are turned off too... */
3680 prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
3681 RNA_def_property_boolean_sdna(prop, nullptr, "flag", CONSTRAINT_ACTIVE);
3682 RNA_def_property_ui_text(prop, "Active", "Constraint is the one being edited");
3683
3684 /* values */
3685 prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR);
3686 RNA_def_property_float_sdna(prop, nullptr, "enforce");
3687 RNA_def_property_range(prop, 0.0f, 1.0f);
3689 prop, "Influence", "Amount of influence constraint will have on the final solution");
3690 RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_influence_update");
3691
3692 /* readonly values */
3693 prop = RNA_def_property(srna, "error_location", PROP_FLOAT, PROP_NONE);
3694 RNA_def_property_float_sdna(prop, nullptr, "lin_error");
3697 prop,
3698 "Lin error",
3699 "Amount of residual error in Blender space unit for constraints that work on position");
3700
3701 prop = RNA_def_property(srna, "error_rotation", PROP_FLOAT, PROP_NONE);
3702 RNA_def_property_float_sdna(prop, nullptr, "rot_error");
3705 prop,
3706 "Rotation error",
3707 "Amount of residual error in radians for constraints that work on orientation");
3708
3710
3711 /* pointers */
3714
3744}
3745
3746#endif
Functions and classes to work with Actions.
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)
struct bConstraint * BKE_constraint_find_from_target(struct Object *ob, struct bConstraintTarget *tgt, struct bPoseChannel **r_pchan)
void BKE_constraint_targets_flush(struct bConstraint *con, struct ListBase *targets, bool no_copy)
int BKE_constraint_targets_get(struct bConstraint *con, struct ListBase *r_targets)
void BKE_constraint_unique_name(struct bConstraint *con, struct ListBase *list)
void id_lib_extern(ID *id)
Definition lib_id.cc:283
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:125
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:269
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:496
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:110
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define M_PI
#define DEG2RADF(_deg)
#define STRNCPY(dst, src)
Definition BLI_string.h:593
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define STRNCPY_UTF8(dst, src)
#define ELEM(...)
#define BLT_I18NCONTEXT_ID_MOVIECLIP
@ POSE_LOCKED
@ POSE_DO_UNLOCK
@ CONSTRAINT_BBONE_SHAPE
@ CONSTRAINT_OFF
@ CONSTRAINT_OVERRIDE_LIBRARY_LOCAL
@ CONSTRAINT_ACTIVE
@ CONSTRAINT_DISABLE
@ SIZELIKE_MULTIPLY
@ SIZELIKE_UNIFORM
@ SIZELIKE_OFFSET
@ CONSTRAINT_IK_ROT
@ CONSTRAINT_IK_NO_ROT_X
@ CONSTRAINT_IK_TARGETAXIS
@ CONSTRAINT_IK_NO_POS_Z
@ CONSTRAINT_IK_NO_POS_Y
@ CONSTRAINT_IK_NO_ROT_Y
@ CONSTRAINT_IK_POS
@ CONSTRAINT_IK_NO_POS_X
@ CONSTRAINT_IK_NO_ROT_Z
@ CONSTRAINT_IK_STRETCH
@ CONSTRAINT_IK_TIP
@ CONSTRAINT_TAR_CUSTOM_SPACE
@ ROTLIKE_MIX_OFFSET
@ ROTLIKE_MIX_BEFORE
@ ROTLIKE_MIX_AFTER
@ ROTLIKE_MIX_REPLACE
@ ROTLIKE_MIX_ADD
@ CONSTRAINT_TYPE_TRACKTO
@ CONSTRAINT_TYPE_PIVOT
@ CONSTRAINT_TYPE_CHILDOF
@ CONSTRAINT_TYPE_TRANSFORM
@ CONSTRAINT_TYPE_FOLLOWTRACK
@ CONSTRAINT_TYPE_OBJECTSOLVER
@ CONSTRAINT_TYPE_ARMATURE
@ CONSTRAINT_TYPE_LOCLIKE
@ CONSTRAINT_TYPE_SHRINKWRAP
@ CONSTRAINT_TYPE_MINMAX
@ CONSTRAINT_TYPE_ROTLIMIT
@ CONSTRAINT_TYPE_CAMERASOLVER
@ CONSTRAINT_TYPE_ROTLIKE
@ CONSTRAINT_TYPE_SPLINEIK
@ CONSTRAINT_TYPE_PYTHON
@ CONSTRAINT_TYPE_KINEMATIC
@ CONSTRAINT_TYPE_DISTLIMIT
@ CONSTRAINT_TYPE_TRANSLIKE
@ CONSTRAINT_TYPE_LOCLIMIT
@ CONSTRAINT_TYPE_CLAMPTO
@ CONSTRAINT_TYPE_LOCKTRACK
@ CONSTRAINT_TYPE_SIZELIMIT
@ CONSTRAINT_TYPE_ACTION
@ CONSTRAINT_TYPE_FOLLOWPATH
@ CONSTRAINT_TYPE_STRETCHTO
@ CONSTRAINT_TYPE_SIZELIKE
@ CONSTRAINT_TYPE_SAMEVOL
@ CONSTRAINT_TYPE_DAMPTRACK
@ CONSTRAINT_TYPE_TRANSFORM_CACHE
@ LIMITDIST_INSIDE
@ LIMITDIST_OUTSIDE
@ LIMITDIST_ONSURFACE
@ CONSTRAINT_ARMATURE_QUATERNION
@ CONSTRAINT_ARMATURE_ENVELOPE
@ CONSTRAINT_ARMATURE_CUR_LOCATION
@ CAMERASOLVER_ACTIVECLIP
@ FOLLOWTRACK_USE_UNDISTORTION
@ FOLLOWTRACK_USE_3D_POSITION
@ FOLLOWTRACK_ACTIVECLIP
@ ACTCON_BONE_USE_OBJECT_ACTION
@ ACTCON_USE_EVAL_TIME
@ LIMIT_ROT_LEGACY_BEHAVIOR
#define CON_SHRINKWRAP_PROJECT_CULL_MASK
@ TRANS_MIXSCALE_MULTIPLY
@ TRANS_MIXSCALE_REPLACE
@ CONSTRAINT_SPLINEIK_YS_NONE
@ CONSTRAINT_SPLINEIK_YS_FIT_CURVE
@ CONSTRAINT_SPLINEIK_YS_ORIGINAL
@ TRANS_MIXLOC_ADD
@ TRANS_MIXLOC_REPLACE
@ CONSTRAINT_SPACE_CUSTOM
@ CONSTRAINT_SPACE_POSE
@ CONSTRAINT_SPACE_WORLD
@ CONSTRAINT_SPACE_OWNLOCAL
@ CONSTRAINT_SPACE_LOCAL
@ CONSTRAINT_SPACE_PARLOCAL
@ ACTCON_MIX_BEFORE
@ ACTCON_MIX_BEFORE_SPLIT
@ ACTCON_MIX_BEFORE_FULL
@ ACTCON_MIX_AFTER_FULL
@ ACTCON_MIX_AFTER_SPLIT
@ ACTCON_MIX_AFTER
@ FOLLOWPATH_FOLLOW
@ FOLLOWPATH_RADIUS
@ FOLLOWPATH_STATIC
@ LIMIT_TRANSFORM
@ PYCON_USETARGETS
@ PYCON_SCRIPTERROR
@ CONSTRAINT_SPLINEIK_EVENSPLITS
@ CONSTRAINT_SPLINEIK_USE_BULGE_MAX
@ CONSTRAINT_SPLINEIK_USE_ORIGINAL_SCALE
@ CONSTRAINT_SPLINEIK_USE_BULGE_MIN
@ CONSTRAINT_SPLINEIK_NO_CURVERAD
@ CONSTRAINT_SPLINEIK_NO_ROOT
@ TRANSLIKE_MIX_AFTER
@ TRANSLIKE_MIX_AFTER_FULL
@ TRANSLIKE_MIX_BEFORE
@ TRANSLIKE_MIX_BEFORE_SPLIT
@ TRANSLIKE_MIX_REPLACE
@ TRANSLIKE_MIX_BEFORE_FULL
@ TRANSLIKE_MIX_AFTER_SPLIT
@ OBJECTSOLVER_SET_INVERSE
@ CON_SHRINKWRAP_PROJECT_INVERT_CULL
@ CON_SHRINKWRAP_PROJECT_OPPOSITE
@ CON_SHRINKWRAP_PROJECT_CULL_FRONTFACE
@ CON_SHRINKWRAP_PROJECT_CULL_BACKFACE
@ CON_SHRINKWRAP_TRACK_NORMAL
@ CLAMPTO_CYCLIC
@ CONSTRAINT_IK_COPYPOSE
@ CONSTRAINT_IK_DISTANCE
@ PIVOTCON_AXIS_X_NEG
@ PIVOTCON_AXIS_X
@ PIVOTCON_AXIS_Z
@ PIVOTCON_AXIS_Z_NEG
@ PIVOTCON_AXIS_Y
@ PIVOTCON_AXIS_NONE
@ PIVOTCON_AXIS_Y_NEG
@ SAMEVOL_SINGLE_AXIS
@ SAMEVOL_STRICT
@ SAMEVOL_UNIFORM
@ PIVOTCON_FLAG_OFFSET_ABS
@ CONSTRAINT_EULER_XZY
@ CONSTRAINT_EULER_YXZ
@ CONSTRAINT_EULER_ZYX
@ CONSTRAINT_EULER_AUTO
@ CONSTRAINT_EULER_ZXY
@ CONSTRAINT_EULER_YZX
@ CONSTRAINT_EULER_XYZ
@ TRANSLIKE_REMOVE_TARGET_SHEAR
@ LIMITDIST_TRANSFORM
@ STRETCHTOCON_USE_BULGE_MAX
@ STRETCHTOCON_USE_BULGE_MIN
@ ROTLIKE_Y_INVERT
@ ROTLIKE_Z_INVERT
@ ROTLIKE_X_INVERT
@ LOCLIKE_Z_INVERT
@ LOCLIKE_Y_INVERT
@ LOCLIKE_OFFSET
@ LOCLIKE_X_INVERT
@ CHILDOF_SET_INVERSE
@ CONSTRAINT_SPLINEIK_XZS_VOLUMETRIC
@ CONSTRAINT_SPLINEIK_XZS_ORIGINAL
@ CONSTRAINT_SPLINEIK_XZS_NONE
@ CONSTRAINT_SPLINEIK_XZS_INVERSE
@ TRANS_ROTATION
@ TRANS_LOCATION
@ 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
Read Guarded memory(de)allocation.
#define RNA_MAX_ARRAY_DIMENSION
Definition RNA_define.hh:26
ParameterFlag
Definition RNA_types.hh:396
@ PARM_RNAPTR
Definition RNA_types.hh:399
@ PARM_REQUIRED
Definition RNA_types.hh:397
@ FUNC_USE_REPORTS
Definition RNA_types.hh:680
@ FUNC_USE_MAIN
Definition RNA_types.hh:678
@ FUNC_USE_SELF_ID
Definition RNA_types.hh:667
@ PROP_FLOAT
Definition RNA_types.hh:67
@ PROP_BOOLEAN
Definition RNA_types.hh:65
@ PROP_ENUM
Definition RNA_types.hh:69
@ PROP_INT
Definition RNA_types.hh:66
@ PROP_STRING
Definition RNA_types.hh:68
@ PROP_POINTER
Definition RNA_types.hh:70
@ PROP_COLLECTION
Definition RNA_types.hh:71
#define RNA_ENUM_ITEM_SEPR
Definition RNA_types.hh:528
#define RNA_TRANSLATION_PREC_DEFAULT
Definition RNA_types.hh:127
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:355
@ PROPOVERRIDE_IGNORE
Definition RNA_types.hh:375
@ PROP_THICK_WRAP
Definition RNA_types.hh:312
@ PROP_DYNAMIC
Definition RNA_types.hh:317
@ PROP_ANIMATABLE
Definition RNA_types.hh:220
@ PROP_EDITABLE
Definition RNA_types.hh:207
@ PROP_NEVER_NULL
Definition RNA_types.hh:266
@ PROP_NO_DEG_UPDATE
Definition RNA_types.hh:328
@ PROP_ID_SELF_CHECK
Definition RNA_types.hh:259
@ PROP_ID_REFCOUNT
Definition RNA_types.hh:253
#define RNA_ENUM_ITEM_HEADING(name, description)
Definition RNA_types.hh:522
@ PROP_TIME
Definition RNA_types.hh:156
@ PROP_MATRIX
Definition RNA_types.hh:168
@ PROP_DISTANCE
Definition RNA_types.hh:159
@ PROP_ANGLE
Definition RNA_types.hh:155
@ PROP_NONE
Definition RNA_types.hh:136
@ PROP_FACTOR
Definition RNA_types.hh:154
@ PROP_TRANSLATION
Definition RNA_types.hh:164
#define ND_NLA_ACTCHANGE
Definition WM_types.hh:465
#define NC_ANIMATION
Definition WM_types.hh:355
#define ND_POSE
Definition WM_types.hh:425
#define ND_CONSTRAINT
Definition WM_types.hh:431
#define NA_RENAME
Definition WM_types.hh:554
#define NC_OBJECT
Definition WM_types.hh:346
#define printf
void *(* MEM_callocN)(size_t len, const char *str)
Definition mallocn.cc:42
decltype(::ActionSlot::handle) slot_handle_t
void constraint_dependency_tag_update(Main *bmain, Object *ob, bConstraint *con)
void constraint_tag_update(Main *bmain, Object *ob, bConstraint *con)
ListBase * constraint_list_from_constraint(Object *ob, bConstraint *con, bPoseChannel **r_pchan)
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_name_property(StructRNA *srna, PropertyRNA *prop)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_define_lib_overridable(const bool make_overridable)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength)
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const char *propname)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
const int rna_matrix_dimsize_4x4[]
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
const EnumPropertyItem rna_enum_driver_target_rotation_mode_items[]
const EnumPropertyItem rna_enum_axis_xyz_items[]
const EnumPropertyItem rna_enum_modifier_shrinkwrap_mode_items[]
const EnumPropertyItem rna_enum_object_axis_items[]
#define min(a, b)
Definition sort.c:32
#define FLT_MAX
Definition stdcycles.h:14
Definition DNA_ID.h:413
char name[66]
Definition DNA_ID.h:425
void * first
ListBase constraints
struct bPose * pose
ID * owner_id
Definition RNA_types.hh:40
void * data
Definition RNA_types.hh:42
struct bConstraintTarget * next
#define N_(msgid)
PointerRNA * ptr
Definition wm_files.cc:4126