4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * Contributor(s): Blender Foundation (2008), Joshua Leung, Roland Hess
22 * ***** END GPL LICENSE BLOCK *****
27 #include "RNA_define.h"
28 #include "RNA_types.h"
30 #include "DNA_action_types.h"
31 #include "DNA_constraint_types.h"
32 #include "DNA_modifier_types.h"
33 #include "DNA_object_types.h"
34 #include "DNA_scene_types.h"
38 EnumPropertyItem constraint_type_items[] ={
39 {CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", 0, "Child Of", ""},
40 {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", 0, "Transformation", ""},
42 {CONSTRAINT_TYPE_LOCLIKE, "COPY_LOCATION", 0, "Copy Location", ""},
43 {CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", 0, "Copy Rotation", ""},
44 {CONSTRAINT_TYPE_SIZELIKE, "COPY_SCALE", 0, "Copy Scale", ""},
46 {CONSTRAINT_TYPE_LOCLIMIT, "LIMIT_LOCATION", 0, "Limit Location", ""},
47 {CONSTRAINT_TYPE_ROTLIMIT, "LIMIT_ROTATION", 0, "Limit Rotation", ""},
48 {CONSTRAINT_TYPE_SIZELIMIT, "LIMIT_SCALE", 0, "Limit Scale", ""},
49 {CONSTRAINT_TYPE_DISTLIMIT, "LIMIT_DISTANCE", 0, "Limit Distance", ""},
51 {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", 0, "Track To", ""},
52 {CONSTRAINT_TYPE_LOCKTRACK, "LOCKED_TRACK", 0, "Locked Track", ""},
54 {CONSTRAINT_TYPE_MINMAX, "FLOOR", 0, "Floor", ""},
55 {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", 0, "Shrinkwrap", ""},
56 {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", 0, "Follow Path", ""},
58 {CONSTRAINT_TYPE_CLAMPTO, "CLAMP_TO", 0, "Clamp To", ""},
59 {CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO", 0, "Stretch To", ""},
61 {CONSTRAINT_TYPE_KINEMATIC, "IK", 0, "IK", ""},
62 {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", 0, "Rigid Body Joint", ""},
64 {CONSTRAINT_TYPE_ACTION, "ACTION", 0, "Action", ""},
66 {CONSTRAINT_TYPE_PYTHON, "SCRIPT", 0, "Script", ""},
68 {CONSTRAINT_TYPE_NULL, "NULL", 0, "Null", ""},
69 {0, NULL, 0, NULL, NULL}};
74 #include "BKE_action.h"
75 #include "BKE_constraint.h"
76 #include "BKE_context.h"
77 #include "BKE_depsgraph.h"
79 #include "ED_object.h"
81 StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
83 bConstraint *con= (bConstraint*)ptr->data;
86 case CONSTRAINT_TYPE_CHILDOF:
87 return &RNA_ChildOfConstraint;
88 case CONSTRAINT_TYPE_TRACKTO:
89 return &RNA_TrackToConstraint;
90 case CONSTRAINT_TYPE_KINEMATIC:
91 return &RNA_KinematicConstraint;
92 case CONSTRAINT_TYPE_FOLLOWPATH:
93 return &RNA_FollowPathConstraint;
94 case CONSTRAINT_TYPE_ROTLIKE:
95 return &RNA_CopyRotationConstraint;
96 case CONSTRAINT_TYPE_LOCLIKE:
97 return &RNA_CopyLocationConstraint;
98 case CONSTRAINT_TYPE_SIZELIKE:
99 return &RNA_CopyScaleConstraint;
100 case CONSTRAINT_TYPE_PYTHON:
101 return &RNA_PythonConstraint;
102 case CONSTRAINT_TYPE_ACTION:
103 return &RNA_ActionConstraint;
104 case CONSTRAINT_TYPE_LOCKTRACK:
105 return &RNA_LockedTrackConstraint;
106 case CONSTRAINT_TYPE_STRETCHTO:
107 return &RNA_StretchToConstraint;
108 case CONSTRAINT_TYPE_MINMAX:
109 return &RNA_FloorConstraint;
110 case CONSTRAINT_TYPE_RIGIDBODYJOINT:
111 return &RNA_RigidBodyJointConstraint;
112 case CONSTRAINT_TYPE_CLAMPTO:
113 return &RNA_ClampToConstraint;
114 case CONSTRAINT_TYPE_TRANSFORM:
115 return &RNA_TransformConstraint;
116 case CONSTRAINT_TYPE_ROTLIMIT:
117 return &RNA_LimitRotationConstraint;
118 case CONSTRAINT_TYPE_LOCLIMIT:
119 return &RNA_LimitLocationConstraint;
120 case CONSTRAINT_TYPE_SIZELIMIT:
121 return &RNA_LimitScaleConstraint;
122 case CONSTRAINT_TYPE_DISTLIMIT:
123 return &RNA_LimitDistanceConstraint;
124 case CONSTRAINT_TYPE_SHRINKWRAP:
125 return &RNA_ShrinkwrapConstraint;
127 return &RNA_UnknownType;
131 static char *rna_Constraint_path(PointerRNA *ptr)
133 return BLI_sprintfN("constraints[%s]", ((bConstraint*)ptr->data)->name);
136 static void rna_Constraint_update(bContext *C, PointerRNA *ptr)
138 Scene *scene= CTX_data_scene(C);
139 Object *ob= ptr->id.data;
141 if(ob->pose) update_pose_constraint_flags(ob->pose);
143 object_test_constraints(ob);
145 if(ob->type==OB_ARMATURE) DAG_object_flush_update(scene, ob, OB_RECALC_DATA|OB_RECALC_OB);
146 else DAG_object_flush_update(scene, ob, OB_RECALC_OB);
149 static void rna_Constraint_dependency_update(bContext *C, PointerRNA *ptr)
151 Object *ob= ptr->id.data;
153 rna_Constraint_update(C, ptr);
155 if(ob->pose) ob->pose->flag |= POSE_RECALC; // checks & sorts pose channels
156 DAG_scene_sort(CTX_data_scene(C));
159 static void rna_Constraint_influence_update(bContext *C, PointerRNA *ptr)
161 Object *ob= ptr->id.data;
164 ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
166 rna_Constraint_update(C, ptr);
169 static EnumPropertyItem space_pchan_items[] = {
170 {0, "WORLD", 0, "World Space", ""},
171 {2, "POSE", 0, "Pose Space", ""},
172 {3, "LOCAL_WITH_PARENT", 0, "Local With Parent", ""},
173 {1, "LOCAL", 0, "Local Space", ""},
174 {0, NULL, 0, NULL, NULL}};
176 static EnumPropertyItem space_object_items[] = {
177 {0, "WORLD", 0, "World Space", ""},
178 {1, "LOCAL", 0, "Local (Without Parent) Space", ""},
179 {0, NULL, 0, NULL, NULL}};
181 static EnumPropertyItem *rna_Constraint_owner_space_itemf(PointerRNA *ptr)
183 Object *ob= (Object*)ptr->id.data;
184 bConstraint *con= (bConstraint*)ptr->data;
186 if(BLI_findindex(&ob->constraints, con) == -1)
187 return space_pchan_items;
189 return space_object_items;
192 static EnumPropertyItem *rna_Constraint_target_space_itemf(PointerRNA *ptr)
194 bConstraint *con= (bConstraint*)ptr->data;
195 bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
196 ListBase targets = {NULL, NULL};
197 bConstraintTarget *ct;
199 if(cti && cti->get_constraint_targets) {
200 cti->get_constraint_targets(con, &targets);
202 for(ct=targets.first; ct; ct= ct->next)
203 if(ct->tar && ct->tar->type == OB_ARMATURE)
206 if(cti->flush_constraint_targets)
207 cti->flush_constraint_targets(con, &targets, 1);
210 return space_pchan_items;
213 return space_object_items;
218 static void rna_def_constrainttarget(BlenderRNA *brna)
223 srna= RNA_def_struct(brna, "ConstraintTarget", NULL);
224 RNA_def_struct_ui_text(srna, "Constraint Target", "Target object for multi-target constraints.");
225 RNA_def_struct_sdna(srna, "bConstraintTarget");
227 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
228 RNA_def_property_pointer_sdna(prop, NULL, "tar");
229 RNA_def_property_ui_text(prop, "Target", "Target Object");
230 RNA_def_property_flag(prop, PROP_EDITABLE);
231 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
233 prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
234 RNA_def_property_string_sdna(prop, NULL, "subtarget");
235 RNA_def_property_ui_text(prop, "Sub-Target", "");
236 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
238 // space, flag and type still to do
241 static void rna_def_constraint_childof(BlenderRNA *brna)
246 srna= RNA_def_struct(brna, "ChildOfConstraint", "Constraint");
247 RNA_def_struct_ui_text(srna, "Child Of Constraint", "Creates constraint-based parent-child relationship.");
248 RNA_def_struct_sdna_from(srna, "bChildOfConstraint", "data");
250 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
251 RNA_def_property_pointer_sdna(prop, NULL, "tar");
252 RNA_def_property_ui_text(prop, "Target", "Target Object");
253 RNA_def_property_flag(prop, PROP_EDITABLE);
254 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
256 prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
257 RNA_def_property_string_sdna(prop, NULL, "subtarget");
258 RNA_def_property_ui_text(prop, "Sub-Target", "");
259 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
261 prop= RNA_def_property(srna, "locationx", PROP_BOOLEAN, PROP_NONE);
262 RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_LOCX);
263 RNA_def_property_ui_text(prop, "Location X", "Use X Location of Parent.");
264 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
266 prop= RNA_def_property(srna, "locationy", PROP_BOOLEAN, PROP_NONE);
267 RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_LOCY);
268 RNA_def_property_ui_text(prop, "Location Y", "Use Y Location of Parent.");
269 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
271 prop= RNA_def_property(srna, "locationz", PROP_BOOLEAN, PROP_NONE);
272 RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_LOCZ);
273 RNA_def_property_ui_text(prop, "Location Z", "Use Z Location of Parent.");
274 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
276 prop= RNA_def_property(srna, "rotationx", PROP_BOOLEAN, PROP_NONE);
277 RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_ROTX);
278 RNA_def_property_ui_text(prop, "Rotation X", "Use X Rotation of Parent.");
279 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
281 prop= RNA_def_property(srna, "rotationy", PROP_BOOLEAN, PROP_NONE);
282 RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_ROTY);
283 RNA_def_property_ui_text(prop, "Rotation Y", "Use Y Rotation of Parent.");
284 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
286 prop= RNA_def_property(srna, "rotationz", PROP_BOOLEAN, PROP_NONE);
287 RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_ROTZ);
288 RNA_def_property_ui_text(prop, "Rotation Z", "Use Z Rotation of Parent.");
289 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
291 prop= RNA_def_property(srna, "sizex", PROP_BOOLEAN, PROP_NONE);
292 RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SIZEX);
293 RNA_def_property_ui_text(prop, "Size X", "Use X Scale of Parent.");
294 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
296 prop= RNA_def_property(srna, "sizey", PROP_BOOLEAN, PROP_NONE);
297 RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SIZEY);
298 RNA_def_property_ui_text(prop, "Size Y", "Use Y Scale of Parent.");
299 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
301 prop= RNA_def_property(srna, "sizez", PROP_BOOLEAN, PROP_NONE);
302 RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SIZEZ);
303 RNA_def_property_ui_text(prop, "Size Z", "Use Z Scale of Parent.");
304 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
307 static void rna_def_constraint_python(BlenderRNA *brna)
312 srna= RNA_def_struct(brna, "PythonConstraint", "Constraint");
313 RNA_def_struct_ui_text(srna, "Python Constraint", "Uses Python script for constraint evaluation.");
314 RNA_def_struct_sdna_from(srna, "bPythonConstraint", "data");
316 prop= RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
317 RNA_def_property_collection_sdna(prop, NULL, "targets", NULL);
318 RNA_def_property_struct_type(prop, "ConstraintTarget");
319 RNA_def_property_ui_text(prop, "Targets", "Target Objects.");
321 prop= RNA_def_property(srna, "number_of_targets", PROP_INT, PROP_NONE);
322 RNA_def_property_int_sdna(prop, NULL, "tarnum");
323 RNA_def_property_ui_text(prop, "Number of Targets", "Usually only 1-3 are needed.");
324 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
326 prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
327 RNA_def_property_ui_text(prop, "Script", "The text object that contains the Python script.");
328 RNA_def_property_flag(prop, PROP_EDITABLE);
329 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
331 prop= RNA_def_property(srna, "use_targets", PROP_BOOLEAN, PROP_NONE);
332 RNA_def_property_boolean_sdna(prop, NULL, "flag", PYCON_USETARGETS);
333 RNA_def_property_ui_text(prop, "Use Targets", "Use the targets indicated in the constraint panel.");
334 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
336 prop= RNA_def_property(srna, "script_error", PROP_BOOLEAN, PROP_NONE);
337 RNA_def_property_boolean_sdna(prop, NULL, "flag", PYCON_SCRIPTERROR);
338 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
339 RNA_def_property_ui_text(prop, "Script Error", "The linked Python script has thrown an error.");
342 static void rna_def_constraint_kinematic(BlenderRNA *brna)
347 srna= RNA_def_struct(brna, "KinematicConstraint", "Constraint");
348 RNA_def_struct_ui_text(srna, "Kinematic Constraint", "Inverse Kinematics.");
349 RNA_def_struct_sdna_from(srna, "bKinematicConstraint", "data");
351 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
352 RNA_def_property_pointer_sdna(prop, NULL, "tar");
353 RNA_def_property_ui_text(prop, "Target", "Target Object");
354 RNA_def_property_flag(prop, PROP_EDITABLE);
355 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
357 prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
358 RNA_def_property_string_sdna(prop, NULL, "subtarget");
359 RNA_def_property_ui_text(prop, "Sub-Target", "");
360 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
362 prop= RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
363 RNA_def_property_range(prop, 1, 10000);
364 RNA_def_property_ui_text(prop, "Iterations", "Maximum number of solving iterations.");
365 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
367 prop= RNA_def_property(srna, "pole_target", PROP_POINTER, PROP_NONE);
368 RNA_def_property_pointer_sdna(prop, NULL, "poletar");
369 RNA_def_property_ui_text(prop, "Pole Target", "Object for pole rotation.");
370 RNA_def_property_flag(prop, PROP_EDITABLE);
371 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
373 prop= RNA_def_property(srna, "pole_subtarget", PROP_STRING, PROP_NONE);
374 RNA_def_property_string_sdna(prop, NULL, "polesubtarget");
375 RNA_def_property_ui_text(prop, "Pole Sub-Target", "");
376 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
378 prop= RNA_def_property(srna, "pole_angle", PROP_FLOAT, PROP_NONE);
379 RNA_def_property_float_sdna(prop, NULL, "poleangle");
380 RNA_def_property_range(prop, 0.0, 180.f);
381 RNA_def_property_ui_text(prop, "Pole Angle", "Pole rotation offset.");
382 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
384 prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
385 RNA_def_property_range(prop, 0.01, 1.f);
386 RNA_def_property_ui_text(prop, "Weight", "For Tree-IK: Weight of position control for this target.");
388 prop= RNA_def_property(srna, "orient_weight", PROP_FLOAT, PROP_NONE);
389 RNA_def_property_float_sdna(prop, NULL, "orientweight");
390 RNA_def_property_range(prop, 0.01, 1.f);
391 RNA_def_property_ui_text(prop, "Orientation Weight", "For Tree-IK: Weight of orientation control for this target.");
392 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
394 prop= RNA_def_property(srna, "chain_length", PROP_INT, PROP_NONE);
395 RNA_def_property_int_sdna(prop, NULL, "rootbone");
396 RNA_def_property_range(prop, 0, 255);
397 RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the IK effect - 0 uses all bones.");
398 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
400 prop= RNA_def_property(srna, "tail", PROP_BOOLEAN, PROP_NONE);
401 RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_TIP);
402 RNA_def_property_ui_text(prop, "Use Tail", "Include bone's tail as last element in chain.");
403 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
405 prop= RNA_def_property(srna, "rotation", PROP_BOOLEAN, PROP_NONE);
406 RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_ROT);
407 RNA_def_property_ui_text(prop, "Rotation", "Chain follows rotation of target.");
408 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
410 prop= RNA_def_property(srna, "targetless", PROP_BOOLEAN, PROP_NONE);
411 RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_AUTO);
412 RNA_def_property_ui_text(prop, "Targetless", "Use targetless IK.");
413 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
415 prop= RNA_def_property(srna, "stretch", PROP_BOOLEAN, PROP_NONE);
416 RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_STRETCH);
417 RNA_def_property_ui_text(prop, "Stretch", "Enable IK Stretching.");
418 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
421 static void rna_def_constraint_track_to(BlenderRNA *brna)
426 static EnumPropertyItem track_items[] = {
427 {TRACK_X, "TRACK_X", 0, "X", ""},
428 {TRACK_Y, "TRACK_Y", 0, "Y", ""},
429 {TRACK_Z, "TRACK_Z", 0, "Z", ""},
430 {TRACK_nX, "TRACK_NEGATIVE_X", 0, "-X", ""},
431 {TRACK_nY, "TRACK_NEGATIVE_Y", 0, "-Y", ""},
432 {TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""},
433 {0, NULL, 0, NULL, NULL}};
435 static EnumPropertyItem up_items[] = {
436 {TRACK_X, "UP_X", 0, "X", ""},
437 {TRACK_Y, "UP_Y", 0, "Y", ""},
438 {TRACK_Z, "UP_Z", 0, "Z", ""},
439 {0, NULL, 0, NULL, NULL}};
441 srna= RNA_def_struct(brna, "TrackToConstraint", "Constraint");
442 RNA_def_struct_ui_text(srna, "Track To Constraint", "Aims the constrained object toward the target.");
443 RNA_def_struct_sdna_from(srna, "bTrackToConstraint", "data");
445 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
446 RNA_def_property_pointer_sdna(prop, NULL, "tar");
447 RNA_def_property_ui_text(prop, "Target", "Target Object");
448 RNA_def_property_flag(prop, PROP_EDITABLE);
449 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
451 prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
452 RNA_def_property_string_sdna(prop, NULL, "subtarget");
453 RNA_def_property_ui_text(prop, "Sub-Target", "");
454 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
456 prop= RNA_def_property(srna, "track", PROP_ENUM, PROP_NONE);
457 RNA_def_property_enum_sdna(prop, NULL, "reserved1");
458 RNA_def_property_enum_items(prop, track_items);
459 RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object.");
460 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
462 prop= RNA_def_property(srna, "up", PROP_ENUM, PROP_NONE);
463 RNA_def_property_enum_sdna(prop, NULL, "reserved2");
464 RNA_def_property_enum_items(prop, up_items);
465 RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward.");
466 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
468 prop= RNA_def_property(srna, "target_z", PROP_BOOLEAN, PROP_NONE);
469 RNA_def_property_boolean_sdna(prop, NULL, "flags", TARGET_Z_UP);
470 RNA_def_property_ui_text(prop, "Target Z", "Target's Z axis, not World Z axis, will constraint the Up direction.");
471 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
474 static void rna_def_constraint_rotate_like(BlenderRNA *brna)
479 srna= RNA_def_struct(brna, "CopyRotationConstraint", "Constraint");
480 RNA_def_struct_ui_text(srna, "Copy Rotation Constraint", "Copies the rotation of the target.");
481 RNA_def_struct_sdna_from(srna, "bRotateLikeConstraint", "data");
483 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
484 RNA_def_property_pointer_sdna(prop, NULL, "tar");
485 RNA_def_property_ui_text(prop, "Target", "Target Object");
486 RNA_def_property_flag(prop, PROP_EDITABLE);
487 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
489 prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
490 RNA_def_property_string_sdna(prop, NULL, "subtarget");
491 RNA_def_property_ui_text(prop, "Sub-Target", "");
492 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
494 prop= RNA_def_property(srna, "rotate_like_x", PROP_BOOLEAN, PROP_NONE);
495 RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_X);
496 RNA_def_property_ui_text(prop, "Like X", "Copy the target's X rotation.");
497 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
499 prop= RNA_def_property(srna, "rotate_like_y", PROP_BOOLEAN, PROP_NONE);
500 RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_Y);
501 RNA_def_property_ui_text(prop, "Like Y", "Copy the target's Y rotation.");
502 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
504 prop= RNA_def_property(srna, "rotate_like_z", PROP_BOOLEAN, PROP_NONE);
505 RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_Z);
506 RNA_def_property_ui_text(prop, "Like Z", "Copy the target's Z rotation.");
507 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
509 prop= RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE);
510 RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_X_INVERT);
511 RNA_def_property_ui_text(prop, "Invert X", "Invert the X rotation.");
512 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
514 prop= RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE);
515 RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_Y_INVERT);
516 RNA_def_property_ui_text(prop, "Invert Y", "Invert the Y rotation.");
517 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
519 prop= RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
520 RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_Z_INVERT);
521 RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z rotation.");
522 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
524 prop= RNA_def_property(srna, "offset", PROP_BOOLEAN, PROP_NONE);
525 RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_OFFSET);
526 RNA_def_property_ui_text(prop, "Offset", "Add original rotation into copied rotation.");
527 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
530 static void rna_def_constraint_locate_like(BlenderRNA *brna)
535 srna= RNA_def_struct(brna, "CopyLocationConstraint", "Constraint");
536 RNA_def_struct_ui_text(srna, "Copy Location Constraint", "Copies the location of the target.");
537 RNA_def_struct_sdna_from(srna, "bLocateLikeConstraint", "data");
539 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
540 RNA_def_property_pointer_sdna(prop, NULL, "tar");
541 RNA_def_property_flag(prop, PROP_EDITABLE);
542 RNA_def_property_ui_text(prop, "Target", "Target Object");
543 RNA_def_property_flag(prop, PROP_EDITABLE);
544 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
546 prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
547 RNA_def_property_string_sdna(prop, NULL, "subtarget");
548 RNA_def_property_ui_text(prop, "Sub-Target", "");
549 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
551 prop= RNA_def_property(srna, "locate_like_x", PROP_BOOLEAN, PROP_NONE);
552 RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_X);
553 RNA_def_property_ui_text(prop, "Like X", "Copy the target's X location.");
554 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
556 prop= RNA_def_property(srna, "locate_like_y", PROP_BOOLEAN, PROP_NONE);
557 RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Y);
558 RNA_def_property_ui_text(prop, "Like Y", "Copy the target's Y location.");
559 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
561 prop= RNA_def_property(srna, "locate_like_z", PROP_BOOLEAN, PROP_NONE);
562 RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Z);
563 RNA_def_property_ui_text(prop, "Like Z", "Copy the target's Z location.");
564 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
566 prop= RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE);
567 RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_X_INVERT);
568 RNA_def_property_ui_text(prop, "Invert X", "Invert the X location.");
569 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
571 prop= RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE);
572 RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Y_INVERT);
573 RNA_def_property_ui_text(prop, "Invert Y", "Invert the Y location.");
574 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
576 prop= RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
577 RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Z_INVERT);
578 RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z location.");
579 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
581 prop= RNA_def_property(srna, "offset", PROP_BOOLEAN, PROP_NONE);
582 RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_OFFSET);
583 RNA_def_property_ui_text(prop, "Offset", "Add original location into copied location.");
584 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
586 RNA_def_struct_sdna(srna, "bConstraint");
588 prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_PERCENTAGE);
589 RNA_def_property_float_sdna(prop, NULL, "headtail");
590 RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1.");
591 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
594 static void rna_def_constraint_minmax(BlenderRNA *brna)
599 static EnumPropertyItem minmax_items[] = {
600 {LOCLIKE_X, "FLOOR_X", 0, "X", ""},
601 {LOCLIKE_Y, "FLOOR_Y", 0, "Y", ""},
602 {LOCLIKE_Z, "FLOOR_Z", 0, "Z", ""},
603 {LOCLIKE_X_INVERT, "FLOOR_NEGATIVE_X", 0, "-X", ""},
604 {LOCLIKE_Y_INVERT, "FLOOR_NEGATIVE_Y", 0, "-Y", ""},
605 {LOCLIKE_Z_INVERT, "FLOOR_NEGATIVE_Z", 0, "-Z", ""},
606 {0, NULL, 0, NULL, NULL}};
608 srna= RNA_def_struct(brna, "FloorConstraint", "Constraint");
609 RNA_def_struct_ui_text(srna, "Floor Constraint", "Uses the target object for location limitation.");
610 RNA_def_struct_sdna_from(srna, "bMinMaxConstraint","data");
612 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
613 RNA_def_property_pointer_sdna(prop, NULL, "tar");
614 RNA_def_property_ui_text(prop, "Target", "Target Object");
615 RNA_def_property_flag(prop, PROP_EDITABLE);
616 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
618 prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
619 RNA_def_property_string_sdna(prop, NULL, "subtarget");
620 RNA_def_property_ui_text(prop, "Sub-Target", "");
621 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
623 prop= RNA_def_property(srna, "floor_location", PROP_ENUM, PROP_NONE);
624 RNA_def_property_enum_sdna(prop, NULL, "minmaxflag");
625 RNA_def_property_enum_items(prop, minmax_items);
626 RNA_def_property_ui_text(prop, "Floor Location", "Location of target that object will not pass through.");
627 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
629 prop= RNA_def_property(srna, "sticky", PROP_BOOLEAN, PROP_NONE);
630 RNA_def_property_boolean_sdna(prop, NULL, "flag", MINMAX_STICKY);
631 RNA_def_property_ui_text(prop, "Sticky", "Immobilize object while constrained.");
632 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
634 prop= RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE);
635 RNA_def_property_boolean_sdna(prop, NULL, "flag", MINMAX_USEROT);
636 RNA_def_property_ui_text(prop, "Use Rotation", "Use the target's rotation to determine floor.");
637 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
639 prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
640 RNA_def_property_range(prop, 0.0, 100.f);
641 RNA_def_property_ui_text(prop, "Offset", "Offset of floor from object center.");
642 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
645 static void rna_def_constraint_size_like(BlenderRNA *brna)
650 srna= RNA_def_struct(brna, "CopyScaleConstraint", "Constraint");
651 RNA_def_struct_ui_text(srna, "Copy Scale Constraint", "Copies the scale of the target.");
652 RNA_def_struct_sdna_from(srna, "bSizeLikeConstraint", "data");
654 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
655 RNA_def_property_pointer_sdna(prop, NULL, "tar");
656 RNA_def_property_flag(prop, PROP_EDITABLE);
657 RNA_def_property_ui_text(prop, "Target", "Target Object");
658 RNA_def_property_flag(prop, PROP_EDITABLE);
659 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
661 prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
662 RNA_def_property_string_sdna(prop, NULL, "subtarget");
663 RNA_def_property_ui_text(prop, "Sub-Target", "");
664 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
666 prop= RNA_def_property(srna, "size_like_x", PROP_BOOLEAN, PROP_NONE);
667 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_X);
668 RNA_def_property_ui_text(prop, "Like X", "Copy the target's X scale.");
669 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
671 prop= RNA_def_property(srna, "size_like_y", PROP_BOOLEAN, PROP_NONE);
672 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_Y);
673 RNA_def_property_ui_text(prop, "Like Y", "Copy the target's Y scale.");
674 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
676 prop= RNA_def_property(srna, "size_like_z", PROP_BOOLEAN, PROP_NONE);
677 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_Z);
678 RNA_def_property_ui_text(prop, "Like Z", "Copy the target's Z scale.");
679 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
681 prop= RNA_def_property(srna, "offset", PROP_BOOLEAN, PROP_NONE);
682 RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_OFFSET);
683 RNA_def_property_ui_text(prop, "Offset", "Add original scale into copied scale.");
684 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
687 static void rna_def_constraint_action(BlenderRNA *brna)
692 static EnumPropertyItem transform_channel_items[] = {
693 {00, "ROTATION_X", 0, "Rotation X", ""},
694 {01, "ROTATION_Y", 0, "Rotation Y", ""},
695 {02, "ROTATION_Z", 0, "Rotation Z", ""},
696 {10, "SIZE_X", 0, "Scale X", ""},
697 {11, "SIZE_Y", 0, "Scale Y", ""},
698 {12, "SIZE_Z", 0, "Scale Z", ""},
699 {20, "LOCATION_X", 0, "Location X", ""},
700 {21, "LOCATION_Y", 0, "Location Y", ""},
701 {22, "LOCATION_Z", 0, "Location Z", ""},
702 {0, NULL, 0, NULL, NULL}};
704 srna= RNA_def_struct(brna, "ActionConstraint", "Constraint");
705 RNA_def_struct_ui_text(srna, "Action Constraint", "Map an action to the transform axes of a bone.");
706 RNA_def_struct_sdna_from(srna, "bActionConstraint", "data");
708 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
709 RNA_def_property_pointer_sdna(prop, NULL, "tar");
710 RNA_def_property_ui_text(prop, "Target", "Target Object");
711 RNA_def_property_flag(prop, PROP_EDITABLE);
712 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
714 prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
715 RNA_def_property_string_sdna(prop, NULL, "subtarget");
716 RNA_def_property_ui_text(prop, "Sub-Target", "");
717 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
719 prop= RNA_def_property(srna, "transform_channel", PROP_ENUM, PROP_NONE);
720 RNA_def_property_enum_sdna(prop, NULL, "type");
721 RNA_def_property_enum_items(prop, transform_channel_items);
722 RNA_def_property_ui_text(prop, "Transform Channel", "Transformation channel from the target that is used to key the Action.");
723 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
725 prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
726 RNA_def_property_pointer_sdna(prop, NULL, "act");
727 RNA_def_property_ui_text(prop, "Action", "");
728 RNA_def_property_flag(prop, PROP_EDITABLE);
729 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
731 prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
732 RNA_def_property_int_sdna(prop, NULL, "start");
733 RNA_def_property_range(prop, MINFRAME, MAXFRAME);
734 RNA_def_property_ui_text(prop, "Start Frame", "First frame of the Action to use.");
735 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
737 prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE);
738 RNA_def_property_int_sdna(prop, NULL, "end");
739 RNA_def_property_range(prop, MINFRAME, MAXFRAME);
740 RNA_def_property_ui_text(prop, "End Frame", "Last frame of the Action to use.");
741 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
743 prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_NONE);
744 RNA_def_property_float_sdna(prop, NULL, "max");
745 RNA_def_property_range(prop, 0.0, 1000.f);
746 RNA_def_property_ui_text(prop, "Maximum", "Maximum value for target channel range.");
747 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
749 prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_NONE);
750 RNA_def_property_float_sdna(prop, NULL, "min");
751 RNA_def_property_range(prop, 0.0, 1000.f);
752 RNA_def_property_ui_text(prop, "Minimum", "Minimum value for target channel range.");
753 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
756 static void rna_def_constraint_locked_track(BlenderRNA *brna)
761 static EnumPropertyItem locktrack_items[] = {
762 {TRACK_X, "TRACK_X", 0, "X", ""},
763 {TRACK_Y, "TRACK_Y", 0, "Y", ""},
764 {TRACK_Z, "TRACK_Z", 0, "Z", ""},
765 {TRACK_nX, "TRACK_NEGATIVE_X", 0, "-X", ""},
766 {TRACK_nY, "TRACK_NEGATIVE_Y", 0, "-Y", ""},
767 {TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""},
768 {0, NULL, 0, NULL, NULL}};
770 static EnumPropertyItem lock_items[] = {
771 {TRACK_X, "LOCK_X", 0, "X", ""},
772 {TRACK_Y, "LOCK_Y", 0, "Y", ""},
773 {TRACK_Z, "LOCK_Z", 0, "Z", ""},
774 {0, NULL, 0, NULL, NULL}};
776 srna= RNA_def_struct(brna, "LockedTrackConstraint", "Constraint");
777 RNA_def_struct_ui_text(srna, "Locked Track Constraint", "Points toward the target along the track axis, while locking the other axis.");
778 RNA_def_struct_sdna_from(srna, "bLockTrackConstraint", "data");
780 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
781 RNA_def_property_pointer_sdna(prop, NULL, "tar");
782 RNA_def_property_ui_text(prop, "Target", "Target Object");
783 RNA_def_property_flag(prop, PROP_EDITABLE);
784 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
786 prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
787 RNA_def_property_string_sdna(prop, NULL, "subtarget");
788 RNA_def_property_ui_text(prop, "Sub-Target", "");
789 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
791 prop= RNA_def_property(srna, "track", PROP_ENUM, PROP_NONE);
792 RNA_def_property_enum_sdna(prop, NULL, "trackflag");
793 RNA_def_property_enum_items(prop, locktrack_items);
794 RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object.");
795 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
797 prop= RNA_def_property(srna, "locked", PROP_ENUM, PROP_NONE);
798 RNA_def_property_enum_sdna(prop, NULL, "lockflag");
799 RNA_def_property_enum_items(prop, lock_items);
800 RNA_def_property_ui_text(prop, "Locked Axis", "Axis that points upward.");
801 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
804 static void rna_def_constraint_follow_path(BlenderRNA *brna)
809 static EnumPropertyItem forwardpath_items[] = {
810 {TRACK_X, "FORWARD_X", 0, "X", ""},
811 {TRACK_Y, "FORWARD_Y", 0, "Y", ""},
812 {TRACK_Z, "FORWARD_Z", 0, "Z", ""},
813 {TRACK_nX, "TRACK_NEGATIVE_X", 0, "-X", ""},
814 {TRACK_nY, "TRACK_NEGATIVE_Y", 0, "-Y", ""},
815 {TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""},
816 {0, NULL, 0, NULL, NULL}};
818 static EnumPropertyItem pathup_items[] = {
819 {TRACK_X, "UP_X", 0, "X", ""},
820 {TRACK_Y, "UP_Y", 0, "Y", ""},
821 {TRACK_Z, "UP_Z", 0, "Z", ""},
822 {0, NULL, 0, NULL, NULL}};
824 srna= RNA_def_struct(brna, "FollowPathConstraint", "Constraint");
825 RNA_def_struct_ui_text(srna, "Follow Path Constraint", "Locks motion to the target path.");
826 RNA_def_struct_sdna_from(srna, "bFollowPathConstraint", "data");
828 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
829 RNA_def_property_pointer_sdna(prop, NULL, "tar");
830 RNA_def_property_ui_text(prop, "Target", "Target Object");
831 RNA_def_property_flag(prop, PROP_EDITABLE);
832 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
834 prop= RNA_def_property(srna, "offset", PROP_INT, PROP_NONE);
835 RNA_def_property_range(prop, -300000.0, 300000.f);
836 RNA_def_property_ui_text(prop, "Offset", "Offset from the position corresponding to the time frame.");
837 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
839 prop= RNA_def_property(srna, "forward", PROP_ENUM, PROP_NONE);
840 RNA_def_property_enum_sdna(prop, NULL, "trackflag");
841 RNA_def_property_enum_items(prop, forwardpath_items);
842 RNA_def_property_ui_text(prop, "Forward Axis", "Axis that points forward along the path.");
843 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
845 prop= RNA_def_property(srna, "up", PROP_ENUM, PROP_NONE);
846 RNA_def_property_enum_sdna(prop, NULL, "upflag");
847 RNA_def_property_enum_items(prop, pathup_items);
848 RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward.");
849 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
851 prop= RNA_def_property(srna, "curve_follow", PROP_BOOLEAN, PROP_NONE);
852 RNA_def_property_boolean_sdna(prop, NULL, "followflag", 1);
853 RNA_def_property_ui_text(prop, "Follow Curve", "Object will follow the heading and banking of the curve.");
854 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
857 static void rna_def_constraint_stretch_to(BlenderRNA *brna)
862 static EnumPropertyItem volume_items[] = {
863 {VOLUME_XZ, "VOLUME_XZX", 0, "XZ", ""},
864 {VOLUME_X, "VOLUME_X", 0, "Y", ""},
865 {VOLUME_Z, "VOLUME_Z", 0, "Z", ""},
866 {NO_VOLUME, "NO_VOLUME", 0, "None", ""},
867 {0, NULL, 0, NULL, NULL}};
869 static EnumPropertyItem plane_items[] = {
870 {PLANE_X, "PLANE_X", 0, "X", "Keep X Axis"},
871 {PLANE_Z, "PLANE_Z", 0, "Z", "Keep Z Axis"},
872 {0, NULL, 0, NULL, NULL}};
874 srna= RNA_def_struct(brna, "StretchToConstraint", "Constraint");
875 RNA_def_struct_ui_text(srna, "Stretch To Constraint", "Stretches to meet the target object.");
876 RNA_def_struct_sdna_from(srna, "bStretchToConstraint", "data");
878 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
879 RNA_def_property_pointer_sdna(prop, NULL, "tar");
880 RNA_def_property_ui_text(prop, "Target", "Target Object");
881 RNA_def_property_flag(prop, PROP_EDITABLE);
882 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
884 prop= RNA_def_property(srna, "volume", PROP_ENUM, PROP_NONE);
885 RNA_def_property_enum_sdna(prop, NULL, "volmode");
886 RNA_def_property_enum_items(prop, volume_items);
887 RNA_def_property_ui_text(prop, "Maintain Volume", "Maintain the object's volume as it stretches.");
888 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
890 prop= RNA_def_property(srna, "keep_axis", PROP_ENUM, PROP_NONE);
891 RNA_def_property_enum_sdna(prop, NULL, "plane");
892 RNA_def_property_enum_items(prop, plane_items);
893 RNA_def_property_ui_text(prop, "Keep Axis", "Axis to maintain during stretch.");
894 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
896 prop= RNA_def_property(srna, "original_length", PROP_FLOAT, PROP_NONE);
897 RNA_def_property_float_sdna(prop, NULL, "orglength");
898 RNA_def_property_range(prop, 0.0, 100.f);
899 RNA_def_property_ui_text(prop, "Original Length", "Length at rest position.");
900 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
902 prop= RNA_def_property(srna, "bulge", PROP_FLOAT, PROP_NONE);
903 RNA_def_property_range(prop, 0.0, 100.f);
904 RNA_def_property_ui_text(prop, "Volume Variation", "Factor between volume variation and stretching.");
905 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
908 static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna)
913 static EnumPropertyItem pivot_items[] = {
914 {CONSTRAINT_RB_BALL, "BALL", 0, "Ball", ""},
915 {CONSTRAINT_RB_HINGE, "HINGE", 0, "Hinge", ""},
916 {CONSTRAINT_RB_CONETWIST, "CONE_TWIST", 0, "Cone Twist", ""},
917 {CONSTRAINT_RB_GENERIC6DOF, "GENERIC_6_DOF", 0, "Generic 6 DoF", ""},
918 {0, NULL, 0, NULL, NULL}};
920 srna= RNA_def_struct(brna, "RigidBodyJointConstraint", "Constraint");
921 RNA_def_struct_ui_text(srna, "Rigid Body Joint Constraint", "For use with the Game Engine.");
922 RNA_def_struct_sdna_from(srna, "bRigidBodyJointConstraint", "data");
924 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
925 RNA_def_property_pointer_sdna(prop, NULL, "tar");
926 RNA_def_property_ui_text(prop, "Target", "Target Object.");
927 RNA_def_property_flag(prop, PROP_EDITABLE);
928 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
930 prop= RNA_def_property(srna, "child", PROP_POINTER, PROP_NONE);
931 RNA_def_property_ui_text(prop, "Child Object", "Child object.");
932 RNA_def_property_flag(prop, PROP_EDITABLE);
933 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
935 prop= RNA_def_property(srna, "pivot_type", PROP_ENUM, PROP_NONE);
936 RNA_def_property_enum_sdna(prop, NULL, "type");
937 RNA_def_property_enum_items(prop, pivot_items);
938 RNA_def_property_ui_text(prop, "Pivot Type", "");
939 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
941 prop= RNA_def_property(srna, "pivot_x", PROP_FLOAT, PROP_NONE);
942 RNA_def_property_float_sdna(prop, NULL, "pivX");
943 RNA_def_property_range(prop, -1000.0, 1000.f);
944 RNA_def_property_ui_text(prop, "Pivot X", "Offset pivot on X.");
945 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
947 prop= RNA_def_property(srna, "pivot_y", PROP_FLOAT, PROP_NONE);
948 RNA_def_property_float_sdna(prop, NULL, "pivY");
949 RNA_def_property_range(prop, -1000.0, 1000.f);
950 RNA_def_property_ui_text(prop, "Pivot Y", "Offset pivot on Y.");
951 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
953 prop= RNA_def_property(srna, "pivot_z", PROP_FLOAT, PROP_NONE);
954 RNA_def_property_float_sdna(prop, NULL, "pivZ");
955 RNA_def_property_range(prop, -1000.0, 1000.f);
956 RNA_def_property_ui_text(prop, "Pivot Z", "Offset pivot on Z.");
957 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
959 prop= RNA_def_property(srna, "axis_x", PROP_FLOAT, PROP_NONE);
960 RNA_def_property_float_sdna(prop, NULL, "axX");
961 RNA_def_property_range(prop, -360.0, 360.f);
962 RNA_def_property_ui_text(prop, "Axis X", "Rotate pivot on X axis in degrees.");
963 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
965 prop= RNA_def_property(srna, "axis_y", PROP_FLOAT, PROP_NONE);
966 RNA_def_property_float_sdna(prop, NULL, "axY");
967 RNA_def_property_range(prop, -360.0, 360.f);
968 RNA_def_property_ui_text(prop, "Axis Y", "Rotate pivot on Y axis in degrees.");
969 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
971 prop= RNA_def_property(srna, "axis_z", PROP_FLOAT, PROP_NONE);
972 RNA_def_property_float_sdna(prop, NULL, "axZ");
973 RNA_def_property_range(prop, -360.0, 360.f);
974 RNA_def_property_ui_text(prop, "Axis Z", "Rotate pivot on Z axis in degrees.");
975 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
977 /* XXX not sure how to wrap the two 6 element arrays for the generic joint */
981 prop= RNA_def_property(srna, "disable_linked_collision", PROP_BOOLEAN, PROP_NONE);
982 RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DISABLE_LINKED_COLLISION);
983 RNA_def_property_ui_text(prop, "Disable Linked Collision", "Disable collision between linked bodies.");
984 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
986 prop= RNA_def_property(srna, "draw_pivot", PROP_BOOLEAN, PROP_NONE);
987 RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DRAW_PIVOT);
988 RNA_def_property_ui_text(prop, "Draw Pivot", "Display the pivot point and rotation in 3D view.");
989 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
992 static void rna_def_constraint_clamp_to(BlenderRNA *brna)
997 static EnumPropertyItem clamp_items[] = {
998 {CLAMPTO_AUTO, "CLAMPTO_AUTO", 0, "Auto", ""},
999 {CLAMPTO_X, "CLAMPTO_X", 0, "X", ""},
1000 {CLAMPTO_Y, "CLAMPTO_Y", 0, "Y", ""},
1001 {CLAMPTO_Z, "CLAMPTO_Z", 0, "Z", ""},
1002 {0, NULL, 0, NULL, NULL}};
1004 srna= RNA_def_struct(brna, "ClampToConstraint", "Constraint");
1005 RNA_def_struct_ui_text(srna, "Clamp To Constraint", "Constrains an object's location to the nearest point along the target path.");
1006 RNA_def_struct_sdna_from(srna, "bClampToConstraint", "data");
1008 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
1009 RNA_def_property_pointer_sdna(prop, NULL, "tar");
1010 RNA_def_property_ui_text(prop, "Target", "Target Object");
1011 RNA_def_property_flag(prop, PROP_EDITABLE);
1012 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
1014 prop= RNA_def_property(srna, "main_axis", PROP_ENUM, PROP_NONE);
1015 RNA_def_property_enum_sdna(prop, NULL, "flag");
1016 RNA_def_property_enum_items(prop, clamp_items);
1017 RNA_def_property_ui_text(prop, "Main Axis", "Main axis of movement.");
1018 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1020 prop= RNA_def_property(srna, "cyclic", PROP_BOOLEAN, PROP_NONE);
1021 RNA_def_property_boolean_sdna(prop, NULL, "flag2", CLAMPTO_CYCLIC);
1022 RNA_def_property_ui_text(prop, "Cyclic", "Treat curve as cyclic curve (no clamping to curve bounding box.");
1023 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1026 static void rna_def_constraint_transform(BlenderRNA *brna)
1031 static EnumPropertyItem transform_items[] = {
1032 {0, "LOCATION", 0, "Loc", ""},
1033 {1, "ROTATION", 0, "Rot", ""},
1034 {2, "SCALE", 0, "Scale", ""},
1035 {0, NULL, 0, NULL, NULL}};
1037 static EnumPropertyItem axis_map_items[] = {
1038 {0, "X", 0, "X", ""},
1039 {1, "Y", 0, "Y", ""},
1040 {2, "Z", 0, "Z", ""},
1041 {0, NULL, 0, NULL, NULL}};
1043 srna= RNA_def_struct(brna, "TransformConstraint", "Constraint");
1044 RNA_def_struct_ui_text(srna, "Transformation Constraint", "Maps transformations of the target to the object.");
1045 RNA_def_struct_sdna_from(srna, "bTransformConstraint", "data");
1047 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
1048 RNA_def_property_pointer_sdna(prop, NULL, "tar");
1049 RNA_def_property_ui_text(prop, "Target", "Target Object");
1050 RNA_def_property_flag(prop, PROP_EDITABLE);
1051 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
1053 prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
1054 RNA_def_property_string_sdna(prop, NULL, "subtarget");
1055 RNA_def_property_ui_text(prop, "Sub-Target", "");
1056 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
1058 prop= RNA_def_property(srna, "map_from", PROP_ENUM, PROP_NONE);
1059 RNA_def_property_enum_sdna(prop, NULL, "from");
1060 RNA_def_property_enum_items(prop, transform_items);
1061 RNA_def_property_ui_text(prop, "Map From", "The transformation type to use from the target.");
1062 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1064 prop= RNA_def_property(srna, "map_to", PROP_ENUM, PROP_NONE);
1065 RNA_def_property_enum_sdna(prop, NULL, "to");
1066 RNA_def_property_enum_items(prop, transform_items);
1067 RNA_def_property_ui_text(prop, "Map To", "The transformation type to affect of the constrained object.");
1068 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1070 prop= RNA_def_property(srna, "map_to_x_from", PROP_ENUM, PROP_NONE);
1071 RNA_def_property_enum_sdna(prop, NULL, "map[0]");
1072 RNA_def_property_enum_items(prop, axis_map_items);
1073 RNA_def_property_ui_text(prop, "Map To X From", "The source axis constrained object's X axis uses.");
1074 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1076 prop= RNA_def_property(srna, "map_to_y_from", PROP_ENUM, PROP_NONE);
1077 RNA_def_property_enum_sdna(prop, NULL, "map[1]");
1078 RNA_def_property_enum_items(prop, axis_map_items);
1079 RNA_def_property_ui_text(prop, "Map To Y From", "The source axis constrained object's Y axis uses.");
1080 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1082 prop= RNA_def_property(srna, "map_to_z_from", PROP_ENUM, PROP_NONE);
1083 RNA_def_property_enum_sdna(prop, NULL, "map[2]");
1084 RNA_def_property_enum_items(prop, axis_map_items);
1085 RNA_def_property_ui_text(prop, "Map To Z From", "The source axis constrained object's Z axis uses.");
1086 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1088 prop= RNA_def_property(srna, "extrapolate_motion", PROP_BOOLEAN, PROP_NONE);
1089 RNA_def_property_boolean_sdna(prop, NULL, "expo", CLAMPTO_CYCLIC);
1090 RNA_def_property_ui_text(prop, "Extrapolate Motion", "Extrapolate ranges.");
1091 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1093 prop= RNA_def_property(srna, "from_min_x", PROP_FLOAT, PROP_NONE);
1094 RNA_def_property_float_sdna(prop, NULL, "from_min[0]");
1095 RNA_def_property_range(prop, 0.0, 1000.f);
1096 RNA_def_property_ui_text(prop, "From Minimum X", "Bottom range of X axis source motion.");
1097 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1099 prop= RNA_def_property(srna, "from_min_y", PROP_FLOAT, PROP_NONE);
1100 RNA_def_property_float_sdna(prop, NULL, "from_min[1]");
1101 RNA_def_property_range(prop, 0.0, 1000.f);
1102 RNA_def_property_ui_text(prop, "From Minimum Y", "Bottom range of Y axis source motion.");
1103 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1105 prop= RNA_def_property(srna, "from_min_z", PROP_FLOAT, PROP_NONE);
1106 RNA_def_property_float_sdna(prop, NULL, "from_min[2]");
1107 RNA_def_property_range(prop, 0.0, 1000.f);
1108 RNA_def_property_ui_text(prop, "From Minimum Z", "Bottom range of Z axis source motion.");
1109 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1111 prop= RNA_def_property(srna, "from_max_x", PROP_FLOAT, PROP_NONE);
1112 RNA_def_property_float_sdna(prop, NULL, "from_max[0]");
1113 RNA_def_property_range(prop, 0.0, 1000.f);
1114 RNA_def_property_ui_text(prop, "From Maximum X", "Top range of X axis source motion.");
1115 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1117 prop= RNA_def_property(srna, "from_max_y", PROP_FLOAT, PROP_NONE);
1118 RNA_def_property_float_sdna(prop, NULL, "from_max[1]");
1119 RNA_def_property_range(prop, 0.0, 1000.f);
1120 RNA_def_property_ui_text(prop, "From Maximum Y", "Top range of Y axis source motion.");
1121 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1123 prop= RNA_def_property(srna, "from_max_z", PROP_FLOAT, PROP_NONE);
1124 RNA_def_property_float_sdna(prop, NULL, "from_max[2]");
1125 RNA_def_property_range(prop, 0.0, 1000.f);
1126 RNA_def_property_ui_text(prop, "From Maximum Z", "Top range of Z axis source motion.");
1127 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1129 prop= RNA_def_property(srna, "to_min_x", PROP_FLOAT, PROP_NONE);
1130 RNA_def_property_float_sdna(prop, NULL, "to_min[0]");
1131 RNA_def_property_range(prop, 0.0, 1000.f);
1132 RNA_def_property_ui_text(prop, "To Minimum X", "Bottom range of X axis destination motion.");
1133 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1135 prop= RNA_def_property(srna, "to_min_y", PROP_FLOAT, PROP_NONE);
1136 RNA_def_property_float_sdna(prop, NULL, "to_min[1]");
1137 RNA_def_property_range(prop, 0.0, 1000.f);
1138 RNA_def_property_ui_text(prop, "To Minimum Y", "Bottom range of Y axis destination motion.");
1139 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1141 prop= RNA_def_property(srna, "to_min_z", PROP_FLOAT, PROP_NONE);
1142 RNA_def_property_float_sdna(prop, NULL, "to_min[2]");
1143 RNA_def_property_range(prop, 0.0, 1000.f);
1144 RNA_def_property_ui_text(prop, "To Minimum Z", "Bottom range of Z axis destination motion.");
1145 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1147 prop= RNA_def_property(srna, "to_max_x", PROP_FLOAT, PROP_NONE);
1148 RNA_def_property_float_sdna(prop, NULL, "to_max[0]");
1149 RNA_def_property_range(prop, 0.0, 1000.f);
1150 RNA_def_property_ui_text(prop, "To Maximum X", "Top range of X axis destination motion.");
1151 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1153 prop= RNA_def_property(srna, "to_max_y", PROP_FLOAT, PROP_NONE);
1154 RNA_def_property_float_sdna(prop, NULL, "to_max[1]");
1155 RNA_def_property_range(prop, 0.0, 1000.f);
1156 RNA_def_property_ui_text(prop, "To Maximum Y", "Top range of Y axis destination motion.");
1157 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1159 prop= RNA_def_property(srna, "to_max_z", PROP_FLOAT, PROP_NONE);
1160 RNA_def_property_float_sdna(prop, NULL, "to_max[2]");
1161 RNA_def_property_range(prop, 0.0, 1000.f);
1162 RNA_def_property_ui_text(prop, "To Maximum Z", "Top range of Z axis destination motion.");
1163 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1166 static void rna_def_constraint_location_limit(BlenderRNA *brna)
1171 srna= RNA_def_struct(brna, "LimitLocationConstraint", "Constraint");
1172 RNA_def_struct_ui_text(srna, "Limit Location Constraint", "Limits the location of the constrained object.");
1173 RNA_def_struct_sdna_from(srna, "bLocLimitConstraint", "data");
1175 prop= RNA_def_property(srna, "use_minimum_x", PROP_BOOLEAN, PROP_NONE);
1176 RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMIN);
1177 RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value.");
1178 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1180 prop= RNA_def_property(srna, "use_minimum_y", PROP_BOOLEAN, PROP_NONE);
1181 RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMIN);
1182 RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value.");
1183 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1185 prop= RNA_def_property(srna, "use_minimum_z", PROP_BOOLEAN, PROP_NONE);
1186 RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMIN);
1187 RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value.");
1188 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1190 prop= RNA_def_property(srna, "use_maximum_x", PROP_BOOLEAN, PROP_NONE);
1191 RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMAX);
1192 RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value.");
1193 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1195 prop= RNA_def_property(srna, "use_maximum_y", PROP_BOOLEAN, PROP_NONE);
1196 RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMAX);
1197 RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value.");
1198 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1200 prop= RNA_def_property(srna, "use_maximum_z", PROP_BOOLEAN, PROP_NONE);
1201 RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMAX);
1202 RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value.");
1203 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1205 prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_NONE);
1206 RNA_def_property_float_sdna(prop, NULL, "xmin");
1207 RNA_def_property_range(prop, -1000.0, 1000.f);
1208 RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow.");
1209 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1211 prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_NONE);
1212 RNA_def_property_float_sdna(prop, NULL, "ymin");
1213 RNA_def_property_range(prop, -1000.0, 1000.f);
1214 RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow.");
1215 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1217 prop= RNA_def_property(srna, "minimum_z", PROP_FLOAT, PROP_NONE);
1218 RNA_def_property_float_sdna(prop, NULL, "zmin");
1219 RNA_def_property_range(prop, -1000.0, 1000.f);
1220 RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow.");
1221 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1223 prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_NONE);
1224 RNA_def_property_float_sdna(prop, NULL, "xmax");
1225 RNA_def_property_range(prop, -1000.0, 1000.f);
1226 RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow.");
1227 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1229 prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_NONE);
1230 RNA_def_property_float_sdna(prop, NULL, "ymax");
1231 RNA_def_property_range(prop, -1000.0, 1000.f);
1232 RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow.");
1233 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1235 prop= RNA_def_property(srna, "maximum_z", PROP_FLOAT, PROP_NONE);
1236 RNA_def_property_float_sdna(prop, NULL, "zmax");
1237 RNA_def_property_range(prop, -1000.0, 1000.f);
1238 RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow.");
1239 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1241 prop= RNA_def_property(srna, "limit_transform", PROP_BOOLEAN, PROP_NONE);
1242 RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM);
1243 RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well.");
1244 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1247 static void rna_def_constraint_rotation_limit(BlenderRNA *brna)
1252 srna= RNA_def_struct(brna, "LimitRotationConstraint", "Constraint");
1253 RNA_def_struct_ui_text(srna, "Limit Rotation Constraint", "Limits the rotation of the constrained object.");
1254 RNA_def_struct_sdna_from(srna, "bRotLimitConstraint", "data");
1256 prop= RNA_def_property(srna, "use_limit_x", PROP_BOOLEAN, PROP_NONE);
1257 RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XROT);
1258 RNA_def_property_ui_text(prop, "Limit X", "Use the minimum X value.");
1259 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1261 prop= RNA_def_property(srna, "use_limit_y", PROP_BOOLEAN, PROP_NONE);
1262 RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YROT);
1263 RNA_def_property_ui_text(prop, "Limit Y", "Use the minimum Y value.");
1264 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1266 prop= RNA_def_property(srna, "use_limit_z", PROP_BOOLEAN, PROP_NONE);
1267 RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZROT);
1268 RNA_def_property_ui_text(prop, "Limit Z", "Use the minimum Z value.");
1269 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1271 prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_NONE);
1272 RNA_def_property_float_sdna(prop, NULL, "xmin");
1273 RNA_def_property_range(prop, -1000.0, 1000.f);
1274 RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow.");
1275 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1277 prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_NONE);
1278 RNA_def_property_float_sdna(prop, NULL, "ymin");
1279 RNA_def_property_range(prop, -1000.0, 1000.f);
1280 RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow.");
1281 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1283 prop= RNA_def_property(srna, "minimum_z", PROP_FLOAT, PROP_NONE);
1284 RNA_def_property_float_sdna(prop, NULL, "zmin");
1285 RNA_def_property_range(prop, -1000.0, 1000.f);
1286 RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow.");
1287 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1289 prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_NONE);
1290 RNA_def_property_float_sdna(prop, NULL, "xmax");
1291 RNA_def_property_range(prop, -1000.0, 1000.f);
1292 RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow.");
1293 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1295 prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_NONE);
1296 RNA_def_property_float_sdna(prop, NULL, "ymax");
1297 RNA_def_property_range(prop, -1000.0, 1000.f);
1298 RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow.");
1299 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1301 prop= RNA_def_property(srna, "maximum_z", PROP_FLOAT, PROP_NONE);
1302 RNA_def_property_float_sdna(prop, NULL, "zmax");
1303 RNA_def_property_range(prop, -1000.0, 1000.f);
1304 RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow.");
1305 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1307 prop= RNA_def_property(srna, "limit_transform", PROP_BOOLEAN, PROP_NONE);
1308 RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM);
1309 RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well.");
1310 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1313 static void rna_def_constraint_size_limit(BlenderRNA *brna)
1318 srna= RNA_def_struct(brna, "LimitScaleConstraint", "Constraint");
1319 RNA_def_struct_ui_text(srna, "Limit Size Constraint", "Limits the scaling of the constrained object.");
1320 RNA_def_struct_sdna_from(srna, "bSizeLimitConstraint", "data");
1322 prop= RNA_def_property(srna, "use_minimum_x", PROP_BOOLEAN, PROP_NONE);
1323 RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMIN);
1324 RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value.");
1325 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1327 prop= RNA_def_property(srna, "use_minimum_y", PROP_BOOLEAN, PROP_NONE);
1328 RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMIN);
1329 RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value.");
1330 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1332 prop= RNA_def_property(srna, "use_minimum_z", PROP_BOOLEAN, PROP_NONE);
1333 RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMIN);
1334 RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value.");
1335 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1337 prop= RNA_def_property(srna, "use_maximum_x", PROP_BOOLEAN, PROP_NONE);
1338 RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMAX);
1339 RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value.");
1340 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1342 prop= RNA_def_property(srna, "use_maximum_y", PROP_BOOLEAN, PROP_NONE);
1343 RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMAX);
1344 RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value.");
1345 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1347 prop= RNA_def_property(srna, "use_maximum_z", PROP_BOOLEAN, PROP_NONE);
1348 RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMAX);
1349 RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value.");
1350 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1352 prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_NONE);
1353 RNA_def_property_float_sdna(prop, NULL, "xmin");
1354 RNA_def_property_range(prop, -1000.0, 1000.f);
1355 RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow.");
1356 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1358 prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_NONE);
1359 RNA_def_property_float_sdna(prop, NULL, "ymin");
1360 RNA_def_property_range(prop, -1000.0, 1000.f);
1361 RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow.");
1362 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1364 prop= RNA_def_property(srna, "minimum_z", PROP_FLOAT, PROP_NONE);
1365 RNA_def_property_float_sdna(prop, NULL, "zmin");
1366 RNA_def_property_range(prop, -1000.0, 1000.f);
1367 RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow.");
1368 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1370 prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_NONE);
1371 RNA_def_property_float_sdna(prop, NULL, "xmax");
1372 RNA_def_property_range(prop, -1000.0, 1000.f);
1373 RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow.");
1374 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1376 prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_NONE);
1377 RNA_def_property_float_sdna(prop, NULL, "ymax");
1378 RNA_def_property_range(prop, -1000.0, 1000.f);
1379 RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow.");
1380 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1382 prop= RNA_def_property(srna, "maximum_z", PROP_FLOAT, PROP_NONE);
1383 RNA_def_property_float_sdna(prop, NULL, "zmax");
1384 RNA_def_property_range(prop, -1000.0, 1000.f);
1385 RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow.");
1386 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1388 prop= RNA_def_property(srna, "limit_transform", PROP_BOOLEAN, PROP_NONE);
1389 RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM);
1390 RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well.");
1391 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1394 static void rna_def_constraint_distance_limit(BlenderRNA *brna)
1399 static EnumPropertyItem distance_items[] = {
1400 {LIMITDIST_INSIDE, "LIMITDIST_INSIDE", 0, "Inside", ""},
1401 {LIMITDIST_OUTSIDE, "LIMITDIST_OUTSIDE", 0, "Outside", ""},
1402 {LIMITDIST_ONSURFACE, "LIMITDIST_ONSURFACE", 0, "On Surface", ""},
1403 {0, NULL, 0, NULL, NULL}};
1405 srna= RNA_def_struct(brna, "LimitDistanceConstraint", "Constraint");
1406 RNA_def_struct_ui_text(srna, "Limit Distance Constraint", "Limits the distance from target object.");
1407 RNA_def_struct_sdna_from(srna, "bDistLimitConstraint", "data");
1409 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
1410 RNA_def_property_pointer_sdna(prop, NULL, "tar");
1411 RNA_def_property_ui_text(prop, "Target", "Target Object");
1412 RNA_def_property_flag(prop, PROP_EDITABLE);
1413 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
1415 prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
1416 RNA_def_property_string_sdna(prop, NULL, "subtarget");
1417 RNA_def_property_ui_text(prop, "Sub-Target", "");
1418 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
1420 prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
1421 RNA_def_property_float_sdna(prop, NULL, "dist");
1422 RNA_def_property_range(prop, 0.0, 100.f);
1423 RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere.");
1424 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1426 prop= RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE);
1427 RNA_def_property_enum_sdna(prop, NULL, "mode");
1428 RNA_def_property_enum_items(prop, distance_items);
1429 RNA_def_property_ui_text(prop, "Limit Mode", "Distances in relation to sphere of influence to allow.");
1430 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1433 static void rna_def_constraint_shrinkwrap(BlenderRNA *brna)
1438 static EnumPropertyItem type_items[] = {
1439 {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACE", 0, "Nearest Surface Point", ""},
1440 {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", ""},
1441 {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", ""},
1442 {0, NULL, 0, NULL, NULL}};
1444 srna= RNA_def_struct(brna, "ShrinkwrapConstraint", "Constraint");
1445 RNA_def_struct_ui_text(srna, "Shrinkwrap Constraint", "Creates constraint-based shrinkwrap relationship.");
1446 RNA_def_struct_sdna_from(srna, "bShrinkwrapConstraint", "data");
1448 prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
1449 RNA_def_property_pointer_sdna(prop, NULL, "target");
1450 RNA_def_property_ui_text(prop, "Target", "Target Object");
1451 RNA_def_property_flag(prop, PROP_EDITABLE);
1452 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
1454 prop= RNA_def_property(srna, "shrinkwrap_type", PROP_ENUM, PROP_NONE);
1455 RNA_def_property_enum_sdna(prop, NULL, "shrinkType");
1456 RNA_def_property_enum_items(prop, type_items);
1457 RNA_def_property_ui_text(prop, "Shrinkwrap Type", "Selects type of shrinkwrap algorithm for target position");
1458 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1460 prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
1461 RNA_def_property_float_sdna(prop, NULL, "dist");
1462 RNA_def_property_range(prop, 0.0, 100.f);
1463 RNA_def_property_ui_text(prop, "Distance", "Distance to Target.");
1464 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1466 prop= RNA_def_property(srna, "axis_x", PROP_BOOLEAN, PROP_NONE);
1467 RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS);
1468 RNA_def_property_ui_text(prop, "Axis X", "Projection over X Axis");
1469 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1471 prop= RNA_def_property(srna, "axis_y", PROP_BOOLEAN, PROP_NONE);
1472 RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS);
1473 RNA_def_property_ui_text(prop, "Axis Y", "Projection over Y Axis");
1474 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1476 prop= RNA_def_property(srna, "axis_z", PROP_BOOLEAN, PROP_NONE);
1477 RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS);
1478 RNA_def_property_ui_text(prop, "Axis Z", "Projection over Z Axis");
1479 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
1482 /* base struct for constraints */
1483 void RNA_def_constraint(BlenderRNA *brna)
1489 srna= RNA_def_struct(brna, "Constraint", NULL );
1490 RNA_def_struct_ui_text(srna, "Constraint", "Constraint modifying the transformation of objects and bones.");
1491 RNA_def_struct_refine_func(srna, "rna_ConstraintType_refine");
1492 RNA_def_struct_path_func(srna, "rna_Constraint_path");
1493 RNA_def_struct_sdna(srna, "bConstraint");
1496 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1497 RNA_def_property_ui_text(prop, "Name", "");
1498 RNA_def_struct_name_property(srna, prop);
1501 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1502 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1503 RNA_def_property_enum_sdna(prop, NULL, "type");
1504 RNA_def_property_enum_items(prop, constraint_type_items);
1505 RNA_def_property_ui_text(prop, "Type", "");
1507 prop= RNA_def_property(srna, "owner_space", PROP_ENUM, PROP_NONE);
1508 RNA_def_property_enum_sdna(prop, NULL, "ownspace");
1509 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_owner_space_itemf");
1510 RNA_def_property_ui_text(prop, "Owner Space", "Space that owner is evaluated in.");
1512 prop= RNA_def_property(srna, "target_space", PROP_ENUM, PROP_NONE);
1513 RNA_def_property_enum_sdna(prop, NULL, "tarspace");
1514 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_target_space_itemf");
1515 RNA_def_property_ui_text(prop, "Target Space", "Space that target is evaluated in.");
1518 // XXX do we want to wrap this?
1519 prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
1520 RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_EXPAND);
1521 RNA_def_property_ui_text(prop, "Expanded", "Constraint's panel is expanded in UI.");
1523 // XXX this is really an internal flag, but it may be useful for some tools to be able to access this...
1524 prop= RNA_def_property(srna, "disabled", PROP_BOOLEAN, PROP_NONE);
1525 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1526 RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DISABLE);
1527 RNA_def_property_ui_text(prop, "Disabled", "Constraint has invalid settings and will not be evaluated.");
1529 // TODO: setting this to true must ensure that all others in stack are turned off too...
1530 prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
1531 RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_ACTIVE);
1532 RNA_def_property_ui_text(prop, "Active", "Constraint is the one being edited ");
1534 prop= RNA_def_property(srna, "proxy_local", PROP_BOOLEAN, PROP_NONE);
1535 RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_PROXY_LOCAL);
1536 RNA_def_property_ui_text(prop, "Proxy Local", "Constraint was added in this proxy instance (i.e. did not belong to source Armature).");
1539 prop= RNA_def_property(srna, "influence", PROP_FLOAT, PROP_PERCENTAGE);
1540 RNA_def_property_float_sdna(prop, NULL, "enforce");
1541 RNA_def_property_range(prop, 0.0f, 1.0f);
1542 RNA_def_property_ui_text(prop, "Influence", "Amount of influence constraint will have on the final solution.");
1543 RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_influence_update");
1546 rna_def_constrainttarget(brna);
1548 rna_def_constraint_childof(brna);
1549 rna_def_constraint_python(brna);
1550 rna_def_constraint_stretch_to(brna);
1551 rna_def_constraint_follow_path(brna);
1552 rna_def_constraint_locked_track(brna);
1553 rna_def_constraint_action(brna);
1554 rna_def_constraint_size_like(brna);
1555 rna_def_constraint_locate_like(brna);
1556 rna_def_constraint_rotate_like(brna);
1557 rna_def_constraint_minmax(brna);
1558 rna_def_constraint_track_to(brna);
1559 rna_def_constraint_kinematic(brna);
1560 rna_def_constraint_rigid_body_joint(brna);
1561 rna_def_constraint_clamp_to(brna);
1562 rna_def_constraint_distance_limit(brna);
1563 rna_def_constraint_size_limit(brna);
1564 rna_def_constraint_rotation_limit(brna);
1565 rna_def_constraint_location_limit(brna);
1566 rna_def_constraint_transform(brna);
1567 rna_def_constraint_shrinkwrap(brna);