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
22 * ***** END GPL LICENSE BLOCK *****
27 #include "RNA_define.h"
28 #include "RNA_types.h"
30 #include "rna_internal.h"
32 #include "DNA_armature_types.h"
33 #include "DNA_object_types.h"
34 #include "DNA_scene_types.h"
41 #include "BLI_arithb.h"
43 #include "BKE_context.h"
44 #include "BKE_depsgraph.h"
47 #include "ED_armature.h"
49 static void rna_Armature_update_data(bContext *C, PointerRNA *ptr)
51 Main *bmain= CTX_data_main(C);
52 Scene *scene= CTX_data_scene(C);
56 for(ob=bmain->object.first; ob; ob= ob->id.next) {
58 /* XXX this will loop over all objects again (slow) */
59 DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
60 WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob);
65 static void rna_Armature_redraw_data(bContext *C, PointerRNA *ptr)
67 Main *bmain= CTX_data_main(C);
71 for(ob=bmain->object.first; ob; ob= ob->id.next)
73 WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob);
76 static void rna_bone_layer_set(short *layer, const int *values)
80 /* ensure we always have some layer selected */
89 if(values[i]) *layer |= (1<<i);
90 else *layer &= ~(1<<i);
94 static void rna_Bone_layer_set(PointerRNA *ptr, const int *values)
96 Bone *bone= (Bone*)ptr->data;
97 rna_bone_layer_set(&bone->layer, values);
100 static void rna_Armature_layer_set(PointerRNA *ptr, const int *values)
102 bArmature *arm= (bArmature*)ptr->data;
105 /* ensure we always have some layer selected */
113 for(i=0; i<20; i++) {
114 if(values[i]) arm->layer |= (1<<i);
115 else arm->layer &= ~(1<<i);
119 static void rna_Armature_ghost_start_frame_set(PointerRNA *ptr, int value)
121 bArmature *data= (bArmature*)ptr->data;
122 CLAMP(value, 1, data->ghostef);
123 data->ghostsf= value;
126 static void rna_Armature_ghost_end_frame_set(PointerRNA *ptr, int value)
128 bArmature *data= (bArmature*)ptr->data;
129 CLAMP(value, data->ghostsf, (int)(MAXFRAMEF/2));
130 data->ghostef= value;
133 static void rna_Armature_path_start_frame_set(PointerRNA *ptr, int value)
135 bArmature *data= (bArmature*)ptr->data;
136 CLAMP(value, 1, data->pathef);
140 static void rna_Armature_path_end_frame_set(PointerRNA *ptr, int value)
142 bArmature *data= (bArmature*)ptr->data;
143 CLAMP(value, data->pathsf, (int)(MAXFRAMEF/2));
147 static void rna_EditBone_name_get(PointerRNA *ptr, char *value)
149 EditBone *data= (EditBone*)(ptr->data);
150 BLI_strncpy(value, data->name, sizeof(data->name));
153 static int rna_EditBone_name_length(PointerRNA *ptr)
155 EditBone *data= (EditBone*)(ptr->data);
156 return strlen(data->name);
159 static void rna_EditBone_name_set(PointerRNA *ptr, const char *value)
161 bArmature *arm= (bArmature*)ptr->id.data;
162 EditBone *ebone= (EditBone*)ptr->data;
163 char oldname[32], newname[32];
165 /* need to be on the stack */
166 BLI_strncpy(newname, value, 32);
167 BLI_strncpy(oldname, ebone->name, 32);
169 ED_armature_bone_rename(arm, oldname, newname);
172 static int rna_EditBone_active_get(PointerRNA *ptr)
174 EditBone *data= (EditBone*)(ptr->data);
175 return (((data->flag) & BONE_ACTIVE) != 0);
178 static void rna_EditBone_active_set(PointerRNA *ptr, int value)
180 EditBone *data= (EditBone*)(ptr->data);
181 if(value) data->flag |= BONE_ACTIVE;
182 else data->flag &= ~BONE_ACTIVE;
185 static float rna_EditBone_bbone_in_get(PointerRNA *ptr)
187 EditBone *data= (EditBone*)(ptr->data);
188 return (float)(data->ease1);
191 static void rna_EditBone_bbone_in_set(PointerRNA *ptr, float value)
193 EditBone *data= (EditBone*)(ptr->data);
194 data->ease1= CLAMPIS(value, 0.0f, 2.0f);
197 static float rna_EditBone_bbone_out_get(PointerRNA *ptr)
199 EditBone *data= (EditBone*)(ptr->data);
200 return (float)(data->ease2);
203 static void rna_EditBone_bbone_out_set(PointerRNA *ptr, float value)
205 EditBone *data= (EditBone*)(ptr->data);
206 data->ease2= CLAMPIS(value, 0.0f, 2.0f);
209 static int rna_EditBone_bbone_segments_get(PointerRNA *ptr)
211 EditBone *data= (EditBone*)(ptr->data);
212 return (int)(data->segments);
215 static void rna_EditBone_bbone_segments_set(PointerRNA *ptr, int value)
217 EditBone *data= (EditBone*)(ptr->data);
218 data->segments= CLAMPIS(value, 1, 32);
221 static void rna_EditBone_layer_get(PointerRNA *ptr, int values[16])
223 EditBone *data= (EditBone*)(ptr->data);
224 values[0]= ((data->layer & (1<<0)) != 0);
225 values[1]= ((data->layer & (1<<1)) != 0);
226 values[2]= ((data->layer & (1<<2)) != 0);
227 values[3]= ((data->layer & (1<<3)) != 0);
228 values[4]= ((data->layer & (1<<4)) != 0);
229 values[5]= ((data->layer & (1<<5)) != 0);
230 values[6]= ((data->layer & (1<<6)) != 0);
231 values[7]= ((data->layer & (1<<7)) != 0);
232 values[8]= ((data->layer & (1<<8)) != 0);
233 values[9]= ((data->layer & (1<<9)) != 0);
234 values[10]= ((data->layer & (1<<10)) != 0);
235 values[11]= ((data->layer & (1<<11)) != 0);
236 values[12]= ((data->layer & (1<<12)) != 0);
237 values[13]= ((data->layer & (1<<13)) != 0);
238 values[14]= ((data->layer & (1<<14)) != 0);
239 values[15]= ((data->layer & (1<<15)) != 0);
242 static void rna_EditBone_layer_set(PointerRNA *ptr, const int values[16])
244 EditBone *data= (EditBone*)(ptr->data);
245 rna_bone_layer_set(&data->layer, values);
248 static void rna_EditBone_connected_check(EditBone *ebone)
251 if(ebone->flag & BONE_CONNECTED) {
252 /* Attach this bone to its parent */
253 VECCOPY(ebone->head, ebone->parent->tail);
255 if(ebone->flag & BONE_ROOTSEL)
256 ebone->parent->flag |= BONE_TIPSEL;
258 else if(!(ebone->parent->flag & BONE_ROOTSEL)) {
259 ebone->parent->flag &= ~BONE_TIPSEL;
264 static int rna_EditBone_connected_get(PointerRNA *ptr)
266 EditBone *data= (EditBone*)(ptr->data);
267 return (((data->flag) & BONE_CONNECTED) != 0);
270 static void rna_EditBone_connected_set(PointerRNA *ptr, int value)
272 EditBone *ebone= (EditBone*)(ptr->data);
274 if(value) ebone->flag |= BONE_CONNECTED;
275 else ebone->flag &= ~BONE_CONNECTED;
277 rna_EditBone_connected_check(ebone);
280 static int rna_EditBone_cyclic_offset_get(PointerRNA *ptr)
282 EditBone *data= (EditBone*)(ptr->data);
283 return (!((data->flag) & BONE_NO_CYCLICOFFSET) != 0);
286 static void rna_EditBone_cyclic_offset_set(PointerRNA *ptr, int value)
288 EditBone *data= (EditBone*)(ptr->data);
289 if(!value) data->flag |= BONE_NO_CYCLICOFFSET;
290 else data->flag &= ~BONE_NO_CYCLICOFFSET;
293 static int rna_EditBone_deform_get(PointerRNA *ptr)
295 EditBone *data= (EditBone*)(ptr->data);
296 return (!((data->flag) & BONE_NO_DEFORM) != 0);
299 static void rna_EditBone_deform_set(PointerRNA *ptr, int value)
301 EditBone *data= (EditBone*)(ptr->data);
302 if(!value) data->flag |= BONE_NO_DEFORM;
303 else data->flag &= ~BONE_NO_DEFORM;
306 static int rna_EditBone_draw_wire_get(PointerRNA *ptr)
308 EditBone *data= (EditBone*)(ptr->data);
309 return (((data->flag) & BONE_DRAWWIRE) != 0);
312 static void rna_EditBone_draw_wire_set(PointerRNA *ptr, int value)
314 EditBone *data= (EditBone*)(ptr->data);
315 if(value) data->flag |= BONE_DRAWWIRE;
316 else data->flag &= ~BONE_DRAWWIRE;
319 static float rna_EditBone_envelope_distance_get(PointerRNA *ptr)
321 EditBone *data= (EditBone*)(ptr->data);
322 return (float)(data->dist);
325 static void rna_EditBone_envelope_distance_set(PointerRNA *ptr, float value)
327 EditBone *data= (EditBone*)(ptr->data);
328 data->dist= CLAMPIS(value, 0.0f, 1000.0f);
331 static float rna_EditBone_envelope_weight_get(PointerRNA *ptr)
333 EditBone *data= (EditBone*)(ptr->data);
334 return (float)(data->weight);
337 static void rna_EditBone_envelope_weight_set(PointerRNA *ptr, float value)
339 EditBone *data= (EditBone*)(ptr->data);
340 data->weight= CLAMPIS(value, 0.0f, 1000.0f);
343 static float rna_EditBone_radius_head_get(PointerRNA *ptr)
345 EditBone *data= (EditBone*)(ptr->data);
346 return (float)(data->rad_head);
349 static void rna_EditBone_radius_head_set(PointerRNA *ptr, float value)
351 EditBone *data= (EditBone*)(ptr->data);
353 data->parent->rad_tail= value;
355 data->rad_head= value;
358 static float rna_EditBone_radius_tail_get(PointerRNA *ptr)
360 EditBone *data= (EditBone*)(ptr->data);
361 return (float)(data->rad_tail);
364 static void rna_EditBone_radius_tail_set(PointerRNA *ptr, float value)
366 EditBone *data= (EditBone*)(ptr->data);
367 data->rad_tail= value;
370 static void rna_EditBone_head_get(PointerRNA *ptr, float values[3])
372 EditBone *data= (EditBone*)(ptr->data);
373 values[0]= (float)(((float*)data->head)[0]);
374 values[1]= (float)(((float*)data->head)[1]);
375 values[2]= (float)(((float*)data->head)[2]);
378 static void rna_EditBone_head_set(PointerRNA *ptr, const float values[3])
380 EditBone *data= (EditBone*)(ptr->data);
381 ((float*)data->head)[0]= values[0];
382 ((float*)data->head)[1]= values[1];
383 ((float*)data->head)[2]= values[2];
386 static int rna_EditBone_head_selected_get(PointerRNA *ptr)
388 EditBone *data= (EditBone*)(ptr->data);
389 return (((data->flag) & BONE_ROOTSEL) != 0);
392 static void rna_EditBone_head_selected_set(PointerRNA *ptr, int value)
394 EditBone *data= (EditBone*)(ptr->data);
395 if(value) data->flag |= BONE_ROOTSEL;
396 else data->flag &= ~BONE_ROOTSEL;
399 static int rna_EditBone_hidden_get(PointerRNA *ptr)
401 EditBone *data= (EditBone*)(ptr->data);
402 return (((data->flag) & BONE_HIDDEN_A) != 0);
405 static void rna_EditBone_hidden_set(PointerRNA *ptr, int value)
407 EditBone *data= (EditBone*)(ptr->data);
408 if(value) data->flag |= BONE_HIDDEN_A;
409 else data->flag &= ~BONE_HIDDEN_A;
412 static int rna_EditBone_hinge_get(PointerRNA *ptr)
414 EditBone *data= (EditBone*)(ptr->data);
415 return (!((data->flag) & BONE_HINGE) != 0);
418 static void rna_EditBone_hinge_set(PointerRNA *ptr, int value)
420 EditBone *data= (EditBone*)(ptr->data);
421 if(!value) data->flag |= BONE_HINGE;
422 else data->flag &= ~BONE_HINGE;
425 static int rna_EditBone_inherit_scale_get(PointerRNA *ptr)
427 EditBone *data= (EditBone*)(ptr->data);
428 return (!((data->flag) & BONE_NO_SCALE) != 0);
431 static void rna_EditBone_inherit_scale_set(PointerRNA *ptr, int value)
433 EditBone *data= (EditBone*)(ptr->data);
434 if(!value) data->flag |= BONE_NO_SCALE;
435 else data->flag &= ~BONE_NO_SCALE;
438 static int rna_EditBone_locked_get(PointerRNA *ptr)
440 EditBone *data= (EditBone*)(ptr->data);
441 return (((data->flag) & BONE_EDITMODE_LOCKED) != 0);
444 static void rna_EditBone_locked_set(PointerRNA *ptr, int value)
446 EditBone *data= (EditBone*)(ptr->data);
447 if(value) data->flag |= BONE_EDITMODE_LOCKED;
448 else data->flag &= ~BONE_EDITMODE_LOCKED;
451 static int rna_EditBone_multiply_vertexgroup_with_envelope_get(PointerRNA *ptr)
453 EditBone *data= (EditBone*)(ptr->data);
454 return (((data->flag) & BONE_MULT_VG_ENV) != 0);
457 static void rna_EditBone_multiply_vertexgroup_with_envelope_set(PointerRNA *ptr, int value)
459 EditBone *data= (EditBone*)(ptr->data);
460 if(value) data->flag |= BONE_MULT_VG_ENV;
461 else data->flag &= ~BONE_MULT_VG_ENV;
464 static PointerRNA rna_EditBone_parent_get(PointerRNA *ptr)
466 EditBone *data= (EditBone*)(ptr->data);
467 return rna_pointer_inherit_refine(ptr, &RNA_EditBone, data->parent);
470 static void rna_EditBone_parent_set(PointerRNA *ptr, PointerRNA value)
472 EditBone *ebone= (EditBone*)(ptr->data);
473 EditBone *pbone, *parbone= (EditBone*)value.data;
475 /* within same armature */
476 if(value.id.data != ptr->id.data)
479 if(parbone == NULL) {
480 if(ebone->parent && !(ebone->parent->flag & BONE_ROOTSEL))
481 ebone->parent->flag &= ~BONE_TIPSEL;
483 ebone->parent = NULL;
484 ebone->flag &= ~BONE_CONNECTED;
487 /* make sure this is a valid child */
491 for(pbone= parbone->parent; pbone; pbone=pbone->parent)
495 ebone->parent = parbone;
496 rna_EditBone_connected_check(ebone);
500 static float rna_EditBone_roll_get(PointerRNA *ptr)
502 EditBone *data= (EditBone*)(ptr->data);
503 return (float)(data->roll);
506 static void rna_EditBone_roll_set(PointerRNA *ptr, float value)
508 EditBone *data= (EditBone*)(ptr->data);
512 static void rna_EditBone_tail_get(PointerRNA *ptr, float values[3])
514 EditBone *data= (EditBone*)(ptr->data);
515 values[0]= (float)(((float*)data->tail)[0]);
516 values[1]= (float)(((float*)data->tail)[1]);
517 values[2]= (float)(((float*)data->tail)[2]);
520 static void rna_EditBone_tail_set(PointerRNA *ptr, const float values[3])
522 EditBone *data= (EditBone*)(ptr->data);
523 ((float*)data->tail)[0]= values[0];
524 ((float*)data->tail)[1]= values[1];
525 ((float*)data->tail)[2]= values[2];
528 static int rna_EditBone_tail_selected_get(PointerRNA *ptr)
530 EditBone *data= (EditBone*)(ptr->data);
531 return (((data->flag) & BONE_TIPSEL) != 0);
534 static void rna_EditBone_tail_selected_set(PointerRNA *ptr, int value)
536 EditBone *data= (EditBone*)(ptr->data);
537 if(value) data->flag |= BONE_TIPSEL;
538 else data->flag &= ~BONE_TIPSEL;
541 static void rna_Armature_editbone_transform_update(bContext *C, PointerRNA *ptr)
543 bArmature *arm= (bArmature*)ptr->id.data;
544 EditBone *ebone= (EditBone*)ptr->data;
545 EditBone *child, *eboflip;
547 /* update our parent */
548 if(ebone->parent && ebone->flag & BONE_CONNECTED)
549 VECCOPY(ebone->parent->tail, ebone->head)
551 /* update our children if necessary */
552 for(child = arm->edbo->first; child; child=child->next)
553 if(child->parent == ebone && (child->flag & BONE_CONNECTED))
554 VECCOPY(child->head, ebone->tail);
556 if(arm->flag & ARM_MIRROR_EDIT) {
557 eboflip= ED_armature_bone_get_mirrored(arm->edbo, ebone);
560 eboflip->roll= -ebone->roll;
562 eboflip->head[0]= -ebone->head[0];
563 eboflip->tail[0]= -ebone->tail[0];
565 /* update our parent */
566 if(eboflip->parent && eboflip->flag & BONE_CONNECTED)
567 VECCOPY(eboflip->parent->tail, eboflip->head);
569 /* update our children if necessary */
570 for(child = arm->edbo->first; child; child=child->next)
571 if(child->parent == eboflip && (child->flag & BONE_CONNECTED))
572 VECCOPY (child->head, eboflip->tail);
576 rna_Armature_update_data(C, ptr);
579 static void rna_Armature_bones_next(CollectionPropertyIterator *iter)
581 ListBaseIterator *internal= iter->internal;
582 Bone *bone= (Bone*)internal->link;
584 if(bone->childbase.first)
585 internal->link= (Link*)bone->childbase.first;
587 internal->link= (Link*)bone->next;
589 internal->link= NULL;
593 if(bone && bone->next) {
594 internal->link= (Link*)bone->next;
600 iter->valid= (internal->link != NULL);
605 static void rna_def_bone_common(StructRNA *srna, int editbone)
610 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
611 RNA_def_property_ui_text(prop, "Name", "");
612 RNA_def_struct_name_property(srna, prop);
613 if(editbone) RNA_def_property_string_funcs(prop, "rna_EditBone_name_get", "rna_EditBone_name_length", "rna_EditBone_name_set");
614 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
617 prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE);
619 RNA_def_property_array(prop, 16);
620 RNA_def_property_boolean_funcs(prop, "rna_EditBone_layer_get", "rna_EditBone_layer_set");
623 RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
624 RNA_def_property_array(prop, 16);
625 RNA_def_property_boolean_funcs(prop, NULL, "rna_Bone_layer_set");
627 RNA_def_property_ui_text(prop, "Layers", "Layers bone exists in");
628 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
630 prop= RNA_def_property(srna, "connected", PROP_BOOLEAN, PROP_NONE);
631 if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_connected_get", "rna_EditBone_connected_set");
633 RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_CONNECTED);
634 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
636 RNA_def_property_ui_text(prop, "Connected", "When bone has a parent, bone's head is struck to the parent's tail.");
637 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
639 prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
640 if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_active_get", "rna_EditBone_active_set");
641 else RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_ACTIVE);
642 RNA_def_property_ui_text(prop, "Active", "Bone was the last bone clicked on (most operations are applied to only this bone)");
643 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
645 prop= RNA_def_property(srna, "hinge", PROP_BOOLEAN, PROP_NONE);
646 if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_hinge_get", "rna_EditBone_hinge_set");
647 else RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_HINGE);
648 RNA_def_property_ui_text(prop, "Inherit Rotation", "Bone doesn't inherit rotation or scale from parent bone.");
649 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
651 prop= RNA_def_property(srna, "multiply_vertexgroup_with_envelope", PROP_BOOLEAN, PROP_NONE);
652 if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_multiply_vertexgroup_with_envelope_get", "rna_EditBone_multiply_vertexgroup_with_envelope_set");
653 else RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_MULT_VG_ENV);
654 RNA_def_property_ui_text(prop, "Multiply Vertex Group with Envelope", "When deforming bone, multiply effects of Vertex Group weights with Envelope influence.");
655 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
657 prop= RNA_def_property(srna, "deform", PROP_BOOLEAN, PROP_NONE);
658 if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_deform_get", "rna_EditBone_deform_set");
659 else RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_DEFORM);
660 RNA_def_property_ui_text(prop, "Deform", "Bone does not deform any geometry.");
661 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
663 prop= RNA_def_property(srna, "inherit_scale", PROP_BOOLEAN, PROP_NONE);
664 RNA_def_property_ui_text(prop, "Inherit Scale", "Bone inherits scaling from parent bone.");
665 if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_inherit_scale_get", "rna_EditBone_inherit_scale_set");
666 else RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_SCALE);
667 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
669 prop= RNA_def_property(srna, "draw_wire", PROP_BOOLEAN, PROP_NONE);
670 if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_draw_wire_get", "rna_EditBone_draw_wire_set");
671 else RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_DRAWWIRE);
672 RNA_def_property_ui_text(prop, "Draw Wire", "Bone is always drawn as Wireframe regardless of viewport draw mode. Useful for non-obstructive custom bone shapes.");
673 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
675 prop= RNA_def_property(srna, "cyclic_offset", PROP_BOOLEAN, PROP_NONE);
676 if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_cyclic_offset_get", "rna_EditBone_cyclic_offset_set");
677 else RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_CYCLICOFFSET);
678 RNA_def_property_ui_text(prop, "Cyclic Offset", "When bone doesn't have a parent, it receives cyclic offset effects.");
679 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
682 /* envelope deform settings */
683 prop= RNA_def_property(srna, "envelope_distance", PROP_FLOAT, PROP_NONE);
684 if(editbone) RNA_def_property_float_funcs(prop, "rna_EditBone_envelope_distance_get", "rna_EditBone_envelope_distance_set", NULL);
685 else RNA_def_property_float_sdna(prop, NULL, "dist");
686 RNA_def_property_range(prop, 0.0f, 1000.0f);
687 RNA_def_property_ui_text(prop, "Envelope Deform Distance", "Bone deformation distance (for Envelope deform only).");
688 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
690 prop= RNA_def_property(srna, "envelope_weight", PROP_FLOAT, PROP_NONE);
691 if(editbone) RNA_def_property_float_funcs(prop, "rna_EditBone_envelope_weight_get", "rna_EditBone_envelope_weight_set", NULL);
692 else RNA_def_property_float_sdna(prop, NULL, "weight");
693 RNA_def_property_range(prop, 0.0f, 1000.0f);
694 RNA_def_property_ui_text(prop, "Envelope Deform Weight", "Bone deformation weight (for Envelope deform only).");
695 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
697 prop= RNA_def_property(srna, "head_radius", PROP_FLOAT, PROP_NONE);
699 RNA_def_property_float_funcs(prop, "rna_EditBone_radius_head_get", "rna_EditBone_radius_head_set", NULL);
700 RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
702 else RNA_def_property_float_sdna(prop, NULL, "rad_head");
703 //RNA_def_property_range(prop, 0, 1000); // XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid);
704 RNA_def_property_ui_text(prop, "Envelope Head Radius", "Radius of head of bone (for Envelope deform only).");
706 prop= RNA_def_property(srna, "tail_radius", PROP_FLOAT, PROP_NONE);
708 RNA_def_property_float_funcs(prop, "rna_EditBone_radius_tail_get", "rna_EditBone_radius_tail_set", NULL);
709 RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
711 else RNA_def_property_float_sdna(prop, NULL, "rad_tail");
712 //RNA_def_property_range(prop, 0, 1000); // XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid);
713 RNA_def_property_ui_text(prop, "Envelope Tail Radius", "Radius of tail of bone (for Envelope deform only).");
715 /* b-bones deform settings */
716 prop= RNA_def_property(srna, "bbone_segments", PROP_INT, PROP_NONE);
717 if(editbone) RNA_def_property_int_funcs(prop, "rna_EditBone_bbone_segments_get", "rna_EditBone_bbone_segments_set", NULL);
718 else RNA_def_property_int_sdna(prop, NULL, "segments");
719 RNA_def_property_range(prop, 1, 32);
720 RNA_def_property_ui_text(prop, "B-Bone Segments", "Number of subdivisions of bone (for B-Bones only).");
721 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
723 prop= RNA_def_property(srna, "bbone_in", PROP_FLOAT, PROP_NONE);
724 if(editbone) RNA_def_property_float_funcs(prop, "rna_EditBone_bbone_in_get", "rna_EditBone_bbone_in_set", NULL);
725 else RNA_def_property_float_sdna(prop, NULL, "ease1");
726 RNA_def_property_range(prop, 0.0f, 2.0f);
727 RNA_def_property_ui_text(prop, "B-Bone Ease In", "Length of first Bezier Handle (for B-Bones only).");
728 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
730 prop= RNA_def_property(srna, "bbone_out", PROP_FLOAT, PROP_NONE);
731 if(editbone) RNA_def_property_float_funcs(prop, "rna_EditBone_bbone_out_get", "rna_EditBone_bbone_out_set", NULL);
732 else RNA_def_property_float_sdna(prop, NULL, "ease2");
733 RNA_def_property_range(prop, 0.0f, 2.0f);
734 RNA_def_property_ui_text(prop, "B-Bone Ease Out", "Length of second Bezier Handle (for B-Bones only).");
735 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
738 // err... bones should not be directly edited (only editbones should be...)
739 static void rna_def_bone(BlenderRNA *brna)
744 srna= RNA_def_struct(brna, "Bone", NULL);
745 RNA_def_struct_ui_text(srna, "Bone", "Bone in an Armature datablock.");
746 RNA_def_struct_ui_icon(srna, ICON_BONE_DATA);
748 /* pointers/collections */
749 /* parent (pointer) */
750 prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
751 RNA_def_property_struct_type(prop, "Bone");
752 RNA_def_property_pointer_sdna(prop, NULL, "parent");
753 RNA_def_property_ui_text(prop, "Parent", "Parent bone (in same Armature).");
754 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
756 /* children (collection) */
757 prop= RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE);
758 RNA_def_property_collection_sdna(prop, NULL, "childbase", NULL);
759 RNA_def_property_struct_type(prop, "Bone");
760 RNA_def_property_ui_text(prop, "Children", "Bones which are children of this bone");
762 rna_def_bone_common(srna, 0);
764 // XXX should we define this in PoseChannel wrapping code instead? but PoseChannels directly get some of their flags from here...
765 prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
766 RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_P);
767 RNA_def_property_ui_text(prop, "Hidden", "Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes).");
768 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
770 prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
771 RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_SELECTED);
772 RNA_def_property_ui_text(prop, "Selected", "");
773 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
776 static void rna_def_edit_bone(BlenderRNA *brna)
781 srna= RNA_def_struct(brna, "EditBone", NULL);
782 RNA_def_struct_ui_text(srna, "Edit Bone", "Editmode bone in an Armature datablock.");
783 RNA_def_struct_ui_icon(srna, ICON_BONE_DATA);
785 prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
786 RNA_def_property_struct_type(prop, "EditBone");
787 RNA_def_property_pointer_funcs(prop, "rna_EditBone_parent_get", "rna_EditBone_parent_set", NULL);
788 RNA_def_property_flag(prop, PROP_EDITABLE);
789 RNA_def_property_ui_text(prop, "Parent", "Parent edit bone (in same Armature).");
790 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
792 prop= RNA_def_property(srna, "roll", PROP_FLOAT, PROP_NONE);
793 RNA_def_property_float_funcs(prop, "rna_EditBone_roll_get", "rna_EditBone_roll_set", NULL);
794 RNA_def_property_ui_text(prop, "Roll", "Bone rotation around head-tail axis.");
795 RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
797 prop= RNA_def_property(srna, "head", PROP_FLOAT, PROP_VECTOR);
798 RNA_def_property_array(prop, 3);
799 RNA_def_property_float_funcs(prop, "rna_EditBone_head_get", "rna_EditBone_head_set", NULL);
800 RNA_def_property_ui_text(prop, "Head", "Location of head end of the bone.");
801 RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
803 prop= RNA_def_property(srna, "tail", PROP_FLOAT, PROP_VECTOR);
804 RNA_def_property_array(prop, 3);
805 RNA_def_property_float_funcs(prop, "rna_EditBone_tail_get", "rna_EditBone_tail_set", NULL);
806 RNA_def_property_ui_text(prop, "Tail", "Location of tail end of the bone.");
807 RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
809 rna_def_bone_common(srna, 1);
811 prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
812 RNA_def_property_boolean_funcs(prop, "rna_EditBone_hidden_get", "rna_EditBone_hidden_set");
813 RNA_def_property_ui_text(prop, "Hidden", "Bone is not visible when in Edit Mode");
814 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
816 prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE);
817 RNA_def_property_boolean_funcs(prop, "rna_EditBone_locked_get", "rna_EditBone_locked_set");
818 RNA_def_property_ui_text(prop, "Locked", "Bone is not able to be transformed when in Edit Mode.");
819 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
821 prop= RNA_def_property(srna, "head_selected", PROP_BOOLEAN, PROP_NONE);
822 RNA_def_property_boolean_funcs(prop, "rna_EditBone_head_selected_get", "rna_EditBone_head_selected_set");
823 RNA_def_property_ui_text(prop, "Head Selected", "");
824 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
826 prop= RNA_def_property(srna, "tail_selected", PROP_BOOLEAN, PROP_NONE);
827 RNA_def_property_boolean_funcs(prop, "rna_EditBone_tail_selected_get", "rna_EditBone_tail_selected_set");
828 RNA_def_property_ui_text(prop, "Tail Selected", "");
829 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
832 void rna_def_armature(BlenderRNA *brna)
837 static EnumPropertyItem prop_drawtype_items[] = {
838 {ARM_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Draw bones as octahedral shape (default)."},
839 {ARM_LINE, "STICK", 0, "Stick", "Draw bones as simple 2D lines with dots."},
840 {ARM_B_BONE, "BBONE", 0, "B-Bone", "Draw bones as boxes, showing subdivision and B-Splines"},
841 {ARM_ENVELOPE, "ENVELOPE", 0, "Envelope", "Draw bones as extruded spheres, showing defomation influence volume."},
842 {0, NULL, 0, NULL, NULL}};
843 static EnumPropertyItem prop_ghost_type_items[] = {
844 {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Current Frame", "Draw Ghosts of poses within a fixed number of frames around the current frame."},
845 {ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Draw Ghosts of poses within specified range."},
846 {ARM_GHOST_KEYS, "KEYS", 0, "On Keyframes", "Draw Ghosts of poses on Keyframes."},
847 {0, NULL, 0, NULL, NULL}};
849 srna= RNA_def_struct(brna, "Armature", "ID");
850 RNA_def_struct_ui_text(srna, "Armature", "Armature datablock containing a hierarchy of bones, usually used for rigging characters.");
851 RNA_def_struct_ui_icon(srna, ICON_ARMATURE_DATA);
853 RNA_def_struct_sdna(srna, "bArmature");
856 prop= RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE);
857 RNA_def_property_collection_sdna(prop, NULL, "bonebase", NULL);
858 RNA_def_property_collection_funcs(prop, 0, "rna_Armature_bones_next", 0, 0, 0, 0, 0, 0, 0);
859 RNA_def_property_struct_type(prop, "Bone");
860 RNA_def_property_ui_text(prop, "Bones", "");
862 prop= RNA_def_property(srna, "edit_bones", PROP_COLLECTION, PROP_NONE);
863 RNA_def_property_collection_sdna(prop, NULL, "edbo", NULL);
864 RNA_def_property_struct_type(prop, "EditBone");
865 RNA_def_property_ui_text(prop, "Edit Bones", "");
868 prop= RNA_def_property(srna, "drawtype", PROP_ENUM, PROP_NONE);
869 RNA_def_property_enum_items(prop, prop_drawtype_items);
870 RNA_def_property_ui_text(prop, "Draw Type", "");
871 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
873 prop= RNA_def_property(srna, "ghost_type", PROP_ENUM, PROP_NONE);
874 RNA_def_property_enum_sdna(prop, NULL, "ghosttype");
875 RNA_def_property_enum_items(prop, prop_ghost_type_items);
876 RNA_def_property_ui_text(prop, "Ghost Drawing", "Method of Onion-skinning for active Action");
877 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
881 prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE);
882 RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
883 RNA_def_property_array(prop, 16);
884 RNA_def_property_ui_text(prop, "Visible Layers", "Armature layer visibility.");
885 RNA_def_property_boolean_funcs(prop, NULL, "rna_Armature_layer_set");
886 RNA_def_property_update(prop, NC_OBJECT|ND_POSE, NULL);
888 /* layer protection */
889 prop= RNA_def_property(srna, "layer_protection", PROP_BOOLEAN, PROP_NONE);
890 RNA_def_property_boolean_sdna(prop, NULL, "layer_protected", 1);
891 RNA_def_property_array(prop, 16);
892 RNA_def_property_ui_text(prop, "Layer Proxy Protection", "Protected layers in Proxy Instances are restored to Proxy settings on file reload and undo.");
893 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
896 prop= RNA_def_property(srna, "rest_position", PROP_BOOLEAN, PROP_NONE);
897 RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_RESTPOS);
898 RNA_def_property_ui_text(prop, "Rest Position", "Show Armature in Rest Position. No posing possible.");
899 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
901 prop= RNA_def_property(srna, "draw_axes", PROP_BOOLEAN, PROP_NONE);
902 RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWAXES);
903 RNA_def_property_ui_text(prop, "Draw Axes", "Draw bone axes.");
904 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
906 prop= RNA_def_property(srna, "draw_names", PROP_BOOLEAN, PROP_NONE);
907 RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWNAMES);
908 RNA_def_property_ui_text(prop, "Draw Names", "Draw bone names.");
909 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
911 prop= RNA_def_property(srna, "delay_deform", PROP_BOOLEAN, PROP_NONE);
912 RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DELAYDEFORM);
913 RNA_def_property_ui_text(prop, "Delay Deform", "Don't deform children when manipulating bones in Pose Mode");
914 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
916 prop= RNA_def_property(srna, "x_axis_mirror", PROP_BOOLEAN, PROP_NONE);
917 RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_MIRROR_EDIT);
918 RNA_def_property_ui_text(prop, "X-Axis Mirror", "Apply changes to matching bone on opposite side of X-Axis.");
919 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
921 prop= RNA_def_property(srna, "auto_ik", PROP_BOOLEAN, PROP_NONE);
922 RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_AUTO_IK);
923 RNA_def_property_ui_text(prop, "Auto IK", "Add temporaral IK constraints while grabbing bones in Pose Mode.");
924 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
926 prop= RNA_def_property(srna, "draw_custom_bone_shapes", PROP_BOOLEAN, PROP_NONE);
927 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ARM_NO_CUSTOM);
928 RNA_def_property_ui_text(prop, "Draw Custom Bone Shapes", "Draw bones with their custom shapes.");
929 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
931 prop= RNA_def_property(srna, "draw_group_colors", PROP_BOOLEAN, PROP_NONE);
932 RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_COL_CUSTOM);
933 RNA_def_property_ui_text(prop, "Draw Bone Group Colors", "Draw bone group colors.");
934 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
936 prop= RNA_def_property(srna, "ghost_only_selected", PROP_BOOLEAN, PROP_NONE);
937 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ARM_GHOST_ONLYSEL);
938 RNA_def_property_ui_text(prop, "Draw Ghosts on Selected Keyframes Only", "");
939 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
942 prop= RNA_def_property(srna, "deform_vertexgroups", PROP_BOOLEAN, PROP_NONE);
943 RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_VGROUP);
944 RNA_def_property_ui_text(prop, "Deform Vertex Groups", "Enable Vertex Groups when defining deform");
945 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
947 prop= RNA_def_property(srna, "deform_envelope", PROP_BOOLEAN, PROP_NONE);
948 RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_ENVELOPE);
949 RNA_def_property_ui_text(prop, "Deform Envelopes", "Enable Bone Envelopes when defining deform");
950 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
952 prop= RNA_def_property(srna, "deform_quaternion", PROP_BOOLEAN, PROP_NONE);
953 RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_QUATERNION);
954 RNA_def_property_ui_text(prop, "Use Dual Quaternion Deformation", "Enable deform rotation with Quaternions");
955 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
957 prop= RNA_def_property(srna, "deform_bbone_rest", PROP_BOOLEAN, PROP_NONE);
958 RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_B_BONE_REST);
959 RNA_def_property_ui_text(prop, "B-Bones Deform in Rest Position", "Make B-Bones deform already in Rest Position");
960 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
962 //prop= RNA_def_property(srna, "deform_invert_vertexgroups", PROP_BOOLEAN, PROP_NONE);
963 //RNA_def_property_boolean_negative_sdna(prop, NULL, "deformflag", ARM_DEF_INVERT_VGROUP);
964 //RNA_def_property_ui_text(prop, "Invert Vertex Group Influence", "Invert Vertex Group influence (only for Modifiers)");
965 //RNA_def_property_update(prop, 0, "rna_Armature_update_data");
968 prop= RNA_def_property(srna, "paths_show_frame_numbers", PROP_BOOLEAN, PROP_NONE);
969 RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_FNUMS);
970 RNA_def_property_ui_text(prop, "Paths Show Frame Numbers", "When drawing Armature in Pose Mode, show frame numbers on Bone Paths");
971 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
973 prop= RNA_def_property(srna, "paths_highlight_keyframes", PROP_BOOLEAN, PROP_NONE);
974 RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_KFRAS);
975 RNA_def_property_ui_text(prop, "Paths Highlight Keyframes", "When drawing Armature in Pose Mode, emphasize position of keyframes on Bone Paths");
976 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
978 prop= RNA_def_property(srna, "paths_show_keyframe_numbers", PROP_BOOLEAN, PROP_NONE);
979 RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_KFNOS);
980 RNA_def_property_ui_text(prop, "Paths Show Keyframe Numbers", "When drawing Armature in Pose Mode, show frame numbers of Keyframes on Bone Paths");
981 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
983 prop= RNA_def_property(srna, "paths_show_around_current_frame", PROP_BOOLEAN, PROP_NONE);
984 RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_ACFRA);
985 RNA_def_property_ui_text(prop, "Paths Around Current Frame", "When drawing Armature in Pose Mode, only show section of Bone Paths that falls around current frame");
986 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
988 prop= RNA_def_property(srna, "paths_calculate_head_positions", PROP_BOOLEAN, PROP_NONE);
989 RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_HEADS);
990 RNA_def_property_ui_text(prop, "Paths Use Heads", "When calculating Bone Paths, use Head locations instead of Tips");
991 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
994 /* ghost/onionskining settings */
995 prop= RNA_def_property(srna, "ghost_step", PROP_INT, PROP_NONE);
996 RNA_def_property_int_sdna(prop, NULL, "ghostep");
997 RNA_def_property_range(prop, 0, 30);
998 RNA_def_property_ui_text(prop, "Ghosting Step", "Number of frame steps on either side of current frame to show as ghosts (only for 'Around Current Frame' Onion-skining method).");
999 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
1001 prop= RNA_def_property(srna, "ghost_size", PROP_INT, PROP_NONE);
1002 RNA_def_property_int_sdna(prop, NULL, "ghostsize");
1003 RNA_def_property_range(prop, 1, 20);
1004 RNA_def_property_ui_text(prop, "Ghosting Frame Step", "Frame step for Ghosts (not for 'On Keyframes' Onion-skining method).");
1005 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
1007 prop= RNA_def_property(srna, "ghost_start_frame", PROP_INT, PROP_NONE);
1008 RNA_def_property_int_sdna(prop, NULL, "ghostsf");
1009 RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_start_frame_set", NULL);
1010 RNA_def_property_ui_text(prop, "Ghosting Start Frame", "Starting frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method).");
1011 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
1013 prop= RNA_def_property(srna, "ghost_end_frame", PROP_INT, PROP_NONE);
1014 RNA_def_property_int_sdna(prop, NULL, "ghostef");
1015 RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_end_frame_set", NULL);
1016 RNA_def_property_ui_text(prop, "Ghosting End Frame", "End frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method).");
1017 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
1019 /* bone path settings */
1020 prop= RNA_def_property(srna, "path_size", PROP_INT, PROP_NONE);
1021 RNA_def_property_int_sdna(prop, NULL, "pathsize");
1022 RNA_def_property_range(prop, 1, 100);
1023 RNA_def_property_ui_text(prop, "Paths Frame Step", "Number of frames between 'dots' on Bone Paths (when drawing).");
1024 RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
1026 prop= RNA_def_property(srna, "path_start_frame", PROP_INT, PROP_NONE);
1027 RNA_def_property_int_sdna(prop, NULL, "pathsf");
1028 RNA_def_property_int_funcs(prop, NULL, "rna_Armature_path_start_frame_set", NULL);
1029 RNA_def_property_ui_text(prop, "Paths Calculation Start Frame", "Starting frame of range of frames to use for Bone Path calculations.");
1030 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
1032 prop= RNA_def_property(srna, "path_end_frame", PROP_INT, PROP_NONE);
1033 RNA_def_property_int_sdna(prop, NULL, "pathef");
1034 RNA_def_property_int_funcs(prop, NULL, "rna_Armature_path_end_frame_set", NULL);
1035 RNA_def_property_ui_text(prop, "Paths Calculation End Frame", "End frame of range of frames to use for Bone Path calculations.");
1036 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
1038 prop= RNA_def_property(srna, "path_before_current", PROP_INT, PROP_NONE);
1039 RNA_def_property_int_sdna(prop, NULL, "pathbc");
1040 RNA_def_property_range(prop, 1, MAXFRAMEF/2);
1041 RNA_def_property_ui_text(prop, "Paths Frames Before Current", "Number of frames before current frame to show on Bone Paths (only for 'Around Current' option).");
1042 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
1044 prop= RNA_def_property(srna, "path_after_current", PROP_INT, PROP_NONE);
1045 RNA_def_property_int_sdna(prop, NULL, "pathac");
1046 RNA_def_property_range(prop, 1, MAXFRAMEF/2);
1047 RNA_def_property_ui_text(prop, "Paths Frames After Current", "Number of frames after current frame to show on Bone Paths (only for 'Around Current' option).");
1048 RNA_def_property_update(prop, 0, "rna_Armature_update_data");
1051 void RNA_def_armature(BlenderRNA *brna)
1053 rna_def_armature(brna);
1055 rna_def_edit_bone(brna);