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).
22 * ***** END GPL LICENSE BLOCK *****
27 #include "RNA_define.h"
28 #include "RNA_types.h"
30 #include "rna_internal.h"
32 #include "DNA_customdata_types.h"
33 #include "DNA_mesh_types.h"
34 #include "DNA_object_types.h"
35 #include "DNA_property_types.h"
36 #include "DNA_scene_types.h"
42 #include "BKE_context.h"
43 #include "BKE_depsgraph.h"
44 #include "BKE_material.h"
45 #include "BKE_particle.h"
47 static void rna_Object_update(bContext *C, PointerRNA *ptr)
49 DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_OB);
52 static void rna_Object_dependency_update(bContext *C, PointerRNA *ptr)
54 DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_OB);
55 DAG_scene_sort(CTX_data_scene(C));
58 static int rna_VertexGroup_index_get(PointerRNA *ptr)
60 Object *ob= (Object*)ptr->id.data;
62 return BLI_findindex(&ob->defbase, ptr->data);
65 static PointerRNA rna_Object_active_vertex_group_get(PointerRNA *ptr)
67 Object *ob= (Object*)ptr->id.data;
68 return rna_pointer_inherit_refine(ptr, &RNA_VertexGroup, BLI_findlink(&ob->defbase, ob->actdef));
71 void rna_object_vgroup_name_index_get(PointerRNA *ptr, char *value, int index)
73 Object *ob= (Object*)ptr->id.data;
76 dg= BLI_findlink(&ob->defbase, index-1);
78 if(dg) BLI_strncpy(value, dg->name, sizeof(dg->name));
79 else BLI_strncpy(value, "", sizeof(dg->name));
82 int rna_object_vgroup_name_index_length(PointerRNA *ptr, int index)
84 Object *ob= (Object*)ptr->id.data;
87 dg= BLI_findlink(&ob->defbase, index-1);
88 return (dg)? strlen(dg->name): 0;
91 void rna_object_vgroup_name_index_set(PointerRNA *ptr, const char *value, short *index)
93 Object *ob= (Object*)ptr->id.data;
97 for(a=1, dg=ob->defbase.first; dg; dg=dg->next, a++) {
98 if(strcmp(dg->name, value) == 0) {
107 void rna_object_vgroup_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen)
109 Object *ob= (Object*)ptr->id.data;
112 for(dg=ob->defbase.first; dg; dg=dg->next) {
113 if(strcmp(dg->name, value) == 0) {
114 BLI_strncpy(result, value, maxlen);
119 BLI_strncpy(result, "", maxlen);
122 void rna_object_uvlayer_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen)
124 Object *ob= (Object*)ptr->id.data;
126 CustomDataLayer *layer;
129 if(ob->type == OB_MESH && ob->data) {
132 for(a=0; a<me->fdata.totlayer; a++) {
133 layer= &me->fdata.layers[a];
135 if(layer->type == CD_MTFACE && strcmp(layer->name, value) == 0) {
136 BLI_strncpy(result, value, maxlen);
142 BLI_strncpy(result, "", maxlen);
145 void rna_object_vcollayer_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen)
147 Object *ob= (Object*)ptr->id.data;
149 CustomDataLayer *layer;
152 if(ob->type == OB_MESH && ob->data) {
155 for(a=0; a<me->fdata.totlayer; a++) {
156 layer= &me->fdata.layers[a];
158 if(layer->type == CD_MCOL && strcmp(layer->name, value) == 0) {
159 BLI_strncpy(result, value, maxlen);
165 BLI_strncpy(result, "", maxlen);
168 static void rna_Object_active_material_index_range(PointerRNA *ptr, int *min, int *max)
170 Object *ob= (Object*)ptr->id.data;
175 static PointerRNA rna_Object_active_material_get(PointerRNA *ptr)
177 Object *ob= (Object*)ptr->id.data;
178 return rna_pointer_inherit_refine(ptr, &RNA_Material, give_current_material(ob, ob->actcol));
182 static void rna_Object_active_material_set(PointerRNA *ptr, PointerRNA value)
184 Object *ob= (Object*)ptr->id.data;
186 assign_material(ob, value.data, ob->actcol);
190 static int rna_Object_active_material_link_get(PointerRNA *ptr)
192 Object *ob= (Object*)ptr->id.data;
193 return (ob->colbits & 1<<(ob->actcol)) != 0;
196 static void rna_Object_active_material_link_set(PointerRNA *ptr, int value)
198 Object *ob= (Object*)ptr->id.data;
201 ob->colbits |= (1<<(ob->actcol));
203 ob->colbits &= ~(1<<(ob->actcol));
206 static PointerRNA rna_Object_active_particle_system_get(PointerRNA *ptr)
208 Object *ob= (Object*)ptr->id.data;
209 ParticleSystem *psys= psys_get_current(ob);
210 return rna_pointer_inherit_refine(ptr, &RNA_ParticleSystem, psys);
213 static PointerRNA rna_Object_game_settings_get(PointerRNA *ptr)
215 return rna_pointer_inherit_refine(ptr, &RNA_GameObjectSettings, ptr->id.data);
218 static void rna_Object_layer_set(PointerRNA *ptr, const int *values)
220 Object *ob= (Object*)ptr->data;
223 /* ensure we always have some layer selected */
231 for(i=0; i<20; i++) {
232 if(values[i]) ob->lay |= (1<<i);
233 else ob->lay &= ~(1<<i);
237 static void rna_GameObjectSettings_state_set(PointerRNA *ptr, const int *values)
239 Object *ob= (Object*)ptr->data;
242 /* ensure we always have some stateer selected */
250 for(i=0; i<20; i++) {
251 if(values[i]) ob->state |= (1<<i);
252 else ob->state &= ~(1<<i);
258 static void rna_def_vertex_group(BlenderRNA *brna)
263 srna= RNA_def_struct(brna, "VertexGroup", NULL);
264 RNA_def_struct_sdna(srna, "bDeformGroup");
265 RNA_def_struct_ui_text(srna, "Vertex Group", "Group of vertices, used for armature deform and other purposes.");
267 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
268 RNA_def_property_ui_text(prop, "Name", "Vertex group name.");
269 RNA_def_struct_name_property(srna, prop);
271 prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
272 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
273 RNA_def_property_int_funcs(prop, "rna_VertexGroup_index_get", NULL, NULL);
274 RNA_def_property_ui_text(prop, "Index", "Index number of the vertex group.");
277 static void rna_def_object_game_settings(BlenderRNA *brna)
282 static EnumPropertyItem body_type_items[] = {
283 {OB_BODY_TYPE_NO_COLLISION, "NO_COLLISION", "No Collision", ""},
284 {OB_BODY_TYPE_STATIC, "STATIC", "Static", ""},
285 {OB_BODY_TYPE_DYNAMIC, "DYNAMIC", "Dynamic", ""},
286 {OB_BODY_TYPE_RIGID, "RIGID_BODY", "Rigid Body", ""},
287 {OB_BODY_TYPE_SOFT, "SOFT_BODY", "Soft Body", ""},
288 {0, NULL, NULL, NULL}};
290 static EnumPropertyItem collision_bounds_items[] = {
291 {OB_BOUND_BOX, "BOX", "Box", ""},
292 {OB_BOUND_SPHERE, "SPHERE", "Sphere", ""},
293 {OB_BOUND_CYLINDER, "CYLINDER", "Cylinder", ""},
294 {OB_BOUND_CONE, "CONE", "Cone", ""},
295 {OB_BOUND_POLYH, "CONVEX_HULL", "Convex Hull", ""},
296 {OB_BOUND_POLYT, "TRIANGLE_MESH", "Triangle Mesh", ""},
297 //{OB_DYN_MESH, "DYNAMIC_MESH", "Dynamic Mesh", ""},
298 {0, NULL, NULL, NULL}};
300 srna= RNA_def_struct(brna, "GameObjectSettings", NULL);
301 RNA_def_struct_sdna(srna, "Object");
302 RNA_def_struct_nested(brna, srna, "Object");
303 RNA_def_struct_ui_text(srna, "Game Object Settings", "Game engine related settings for the object.");
307 prop= RNA_def_property(srna, "sensors", PROP_COLLECTION, PROP_NONE);
308 RNA_def_property_struct_type(prop, "Sensor");
309 RNA_def_property_ui_text(prop, "Sensors", "Game engine sensor to detect events.");
311 prop= RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE);
312 RNA_def_property_struct_type(prop, "Controller");
313 RNA_def_property_ui_text(prop, "Controllers", "Game engine controllers to process events, connecting sensor to actuators.");
315 prop= RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE);
316 RNA_def_property_struct_type(prop, "Actuator");
317 RNA_def_property_ui_text(prop, "Actuators", "Game engine actuators to act on events.");
319 prop= RNA_def_property(srna, "properties", PROP_COLLECTION, PROP_NONE);
320 RNA_def_property_collection_sdna(prop, NULL, "prop", NULL);
321 RNA_def_property_struct_type(prop, "GameProperty");
322 RNA_def_property_ui_text(prop, "Properties", "Game engine properties.");
324 prop= RNA_def_property(srna, "show_sensors", PROP_BOOLEAN, PROP_NONE);
325 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWSENS);
326 RNA_def_property_ui_text(prop, "Show Sensors", "Shows sensors for this object in the user interface.");
328 prop= RNA_def_property(srna, "show_controllers", PROP_BOOLEAN, PROP_NONE);
329 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWCONT);
330 RNA_def_property_ui_text(prop, "Show Controllers", "Shows controllers for this object in the user interface.");
332 prop= RNA_def_property(srna, "show_actuators", PROP_BOOLEAN, PROP_NONE);
333 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWACT);
334 RNA_def_property_ui_text(prop, "Show Actuators", "Shows actuators for this object in the user interface.");
338 prop= RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE);
339 RNA_def_property_enum_sdna(prop, NULL, "body_type");
340 RNA_def_property_enum_items(prop, body_type_items);
341 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // this controls various gameflags
342 RNA_def_property_ui_text(prop, "Physics Type", "Selects the type of physical representation.");
344 prop= RNA_def_property(srna, "actor", PROP_BOOLEAN, PROP_NONE);
345 RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ACTOR);
346 RNA_def_property_ui_text(prop, "Actor", "Object is detected by the Near and Radar sensor.");
348 prop= RNA_def_property(srna, "ghost", PROP_BOOLEAN, PROP_NONE);
349 RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_GHOST);
350 RNA_def_property_ui_text(prop, "Ghost", "Object does not restitute collisions, like a ghost.");
352 prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
353 RNA_def_property_range(prop, 0.01, 10000.0);
354 RNA_def_property_ui_text(prop, "Mass", "Mass of the object.");
356 prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
357 RNA_def_property_float_sdna(prop, NULL, "inertia");
358 RNA_def_property_range(prop, 0.01, 10.0);
359 RNA_def_property_ui_text(prop, "Radius", "Radius for Bounding sphere and Fh/Fh Rot.");
360 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
362 prop= RNA_def_property(srna, "no_sleeping", PROP_BOOLEAN, PROP_NONE);
363 RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_COLLISION_RESPONSE);
364 RNA_def_property_ui_text(prop, "No Sleeping", "Disable auto (de)activation in physics simulation.");
366 prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
367 RNA_def_property_float_sdna(prop, NULL, "damping");
368 RNA_def_property_range(prop, 0.0, 1.0);
369 RNA_def_property_ui_text(prop, "Damping", "General movement damping.");
371 prop= RNA_def_property(srna, "rotation_damping", PROP_FLOAT, PROP_NONE);
372 RNA_def_property_float_sdna(prop, NULL, "rdamping");
373 RNA_def_property_range(prop, 0.0, 1.0);
374 RNA_def_property_ui_text(prop, "Rotation Damping", "General rotation damping.");
376 prop= RNA_def_property(srna, "do_fh", PROP_BOOLEAN, PROP_NONE);
377 RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_DO_FH);
378 RNA_def_property_ui_text(prop, "Do Fh", "Use Fh settings in materials.");
380 prop= RNA_def_property(srna, "rotation_fh", PROP_BOOLEAN, PROP_NONE);
381 RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ROT_FH);
382 RNA_def_property_ui_text(prop, "Rotation Fh", "Use face normal to rotate Object");
384 prop= RNA_def_property(srna, "form_factor", PROP_FLOAT, PROP_NONE);
385 RNA_def_property_float_sdna(prop, NULL, "formfactor");
386 RNA_def_property_range(prop, 0.0, 1.0);
387 RNA_def_property_ui_text(prop, "Form Factor", "Form factor scales the inertia tensor.");
389 prop= RNA_def_property(srna, "anisotropic_friction", PROP_BOOLEAN, PROP_NONE);
390 RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ANISOTROPIC_FRICTION);
391 RNA_def_property_ui_text(prop, "Anisotropic Friction", "Enable anisotropic friction.");
393 prop= RNA_def_property(srna, "friction_coefficients", PROP_FLOAT, PROP_VECTOR);
394 RNA_def_property_float_sdna(prop, NULL, "anisotropicFriction");
395 RNA_def_property_range(prop, 0.0, 1.0);
396 RNA_def_property_ui_text(prop, "Friction Coefficients", "Relative friction coefficient in the in the X, Y and Z directions, when anisotropic friction is enabled.");
398 prop= RNA_def_property(srna, "use_collision_bounds", PROP_BOOLEAN, PROP_NONE);
399 RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_BOUNDS);
400 RNA_def_property_ui_text(prop, "Use Collision Bounds", "Specify a collision bounds type other than the default.");
402 prop= RNA_def_property(srna, "collision_bounds", PROP_ENUM, PROP_NONE);
403 RNA_def_property_enum_sdna(prop, NULL, "boundtype");
404 RNA_def_property_enum_items(prop, collision_bounds_items);
405 RNA_def_property_ui_text(prop, "Collision Bounds", "Selects the collision type.");
407 prop= RNA_def_property(srna, "collision_compound", PROP_BOOLEAN, PROP_NONE);
408 RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_CHILD);
409 RNA_def_property_ui_text(prop, "Collison Compound", "Add children to form a compound collision object.");
411 prop= RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE);
412 RNA_def_property_float_sdna(prop, NULL, "margin");
413 RNA_def_property_range(prop, 0.0, 1.0);
414 RNA_def_property_ui_text(prop, "Collision Margin", "Extra margin around object for collision detection, small amount required for stability.");
416 prop= RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE);
417 RNA_def_property_pointer_sdna(prop, NULL, "bsoft");
418 RNA_def_property_ui_text(prop, "Soft Body Settings", "Settings for Bullet soft body simulation.");
422 prop= RNA_def_property(srna, "state", PROP_BOOLEAN, PROP_NONE);
423 RNA_def_property_boolean_sdna(prop, NULL, "state", 1);
424 RNA_def_property_array(prop, 30);
425 RNA_def_property_ui_text(prop, "State", "State determining which controllers are displayed.");
426 RNA_def_property_boolean_funcs(prop, NULL, "rna_GameObjectSettings_state_set");
428 prop= RNA_def_property(srna, "initial_state", PROP_BOOLEAN, PROP_NONE);
429 RNA_def_property_boolean_sdna(prop, NULL, "init_state", 1);
430 RNA_def_property_array(prop, 30);
431 RNA_def_property_ui_text(prop, "Initial State", "Initial state when the game starts.");
433 prop= RNA_def_property(srna, "debug_state", PROP_BOOLEAN, PROP_NONE);
434 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_DEBUGSTATE);
435 RNA_def_property_ui_text(prop, "Debug State", "Print state debug info in the game engine.");
438 static StructRNA *rna_def_object(BlenderRNA *brna)
443 static EnumPropertyItem parent_type_items[] = {
444 {PAROBJECT, "OBJECT", "Object", ""},
445 {PARCURVE, "CURVE", "Curve", ""},
446 //{PARKEY, "KEY", "Key", ""},
447 {PARSKEL, "ARMATURE", "Armature", ""},
448 {PARSKEL, "LATTICE", "Lattice", ""}, // PARSKEL reuse will give issues
449 {PARVERT1, "VERTEX", "Vertex", ""},
450 {PARVERT3, "VERTEX_3", "3 Vertices", ""},
451 {PARBONE, "BONE", "Bone", ""},
452 {0, NULL, NULL, NULL}};
454 static EnumPropertyItem object_type_items[] = {
455 {OB_EMPTY, "EMPTY", "Empty", ""},
456 {OB_MESH, "MESH", "Mesh", ""},
457 {OB_CURVE, "CURVE", "Curve", ""},
458 {OB_SURF, "SURFACE", "Surface", ""},
459 {OB_FONT, "TEXT", "Text", ""},
460 {OB_MBALL, "META", "Meta", ""},
461 {OB_LAMP, "LAMP", "Lamp", ""},
462 {OB_CAMERA, "CAMERA", "Camera", ""},
463 {OB_WAVE, "WAVE", "Wave", ""},
464 {OB_LATTICE, "LATTICE", "Lattice", ""},
465 {OB_ARMATURE, "ARMATURE", "Armature", ""},
466 {0, NULL, NULL, NULL}};
468 static EnumPropertyItem empty_drawtype_items[] = {
469 {OB_ARROWS, "ARROWS", "Arrows", ""},
470 {OB_SINGLE_ARROW, "SINGLE_ARROW", "Single Arrow", ""},
471 {OB_PLAINAXES, "PLAIN_AXES", "Plain Axes", ""},
472 {OB_CIRCLE, "CIRCLE", "Circle", ""},
473 {OB_CUBE, "CUBE", "Cube", ""},
474 {OB_EMPTY_SPHERE, "SPHERE", "Sphere", ""},
475 {OB_EMPTY_CONE, "CONE", "Cone", ""},
476 {0, NULL, NULL, NULL}};
478 static EnumPropertyItem track_items[] = {
479 {OB_POSX, "POSX", "+X", ""},
480 {OB_POSY, "POSY", "+Y", ""},
481 {OB_POSZ, "POSZ", "+Z", ""},
482 {OB_NEGX, "NEGX", "-X", ""},
483 {OB_NEGY, "NEGY", "-Y", ""},
484 {OB_NEGZ, "NEGZ", "-Z", ""},
485 {0, NULL, NULL, NULL}};
487 static EnumPropertyItem up_items[] = {
488 {OB_POSX, "X", "X", ""},
489 {OB_POSY, "Y", "Y", ""},
490 {OB_POSZ, "Z", "Z", ""},
491 {0, NULL, NULL, NULL}};
493 static EnumPropertyItem drawtype_items[] = {
494 {OB_BOUNDBOX, "BOUNDS", "Bounds", ""},
495 {OB_WIRE, "WIRE", "Wire", ""},
496 {OB_SOLID, "SOLID", "Solid", ""},
497 {OB_SHADED, "SHADED", "Shaded", ""},
498 {OB_TEXTURE, "TEXTURED", "Textured", ""},
499 {0, NULL, NULL, NULL}};
501 static EnumPropertyItem boundtype_items[] = {
502 {OB_BOUND_BOX, "BOX", "Box", ""},
503 {OB_BOUND_SPHERE, "SPHERE", "Sphere", ""},
504 {OB_BOUND_CYLINDER, "CYLINDER", "Cylinder", ""},
505 {OB_BOUND_CONE, "CONE", "Cone", ""},
506 {OB_BOUND_POLYH, "POLYHEDER", "Polyheder", ""},
507 {0, NULL, NULL, NULL}};
509 static EnumPropertyItem material_link_items[] = {
510 {0, "DATA", "Data", ""},
511 {1, "OBJECT", "Object", ""},
512 {0, NULL, NULL, NULL}};
514 static EnumPropertyItem dupli_items[] = {
515 {0, "NONE", "None", ""},
516 {OB_DUPLIFRAMES, "FRAMES", "Frames", "Make copy of object for every frame."},
517 {OB_DUPLIVERTS, "VERTS", "Verts", "Duplicate child objects on all vertices."},
518 {OB_DUPLIFACES, "FACES", "Faces", "Duplicate child objects on all faces."},
519 {OB_DUPLIGROUP, "GROUP", "Group", "Enable group instancing."},
520 {0, NULL, NULL, NULL}};
522 srna= RNA_def_struct(brna, "Object", "ID");
523 RNA_def_struct_ui_text(srna, "Object", "Object datablock defining an object in a scene..");
524 RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
526 prop= RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE);
527 RNA_def_property_struct_type(prop, "ID");
528 RNA_def_property_ui_text(prop, "Data", "Object data.");
530 prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_NONE);
531 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
532 RNA_def_property_array(prop, 20);
533 RNA_def_property_ui_text(prop, "Layers", "Layers the object is on.");
534 RNA_def_property_boolean_funcs(prop, NULL, "rna_Object_layer_set");
536 prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
537 RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
538 RNA_def_property_ui_text(prop, "Selected", "Object selection state.");
540 /* parent and track */
542 prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
543 RNA_def_property_ui_text(prop, "Parent", "Parent Object");
545 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
546 RNA_def_property_enum_sdna(prop, NULL, "type");
547 RNA_def_property_enum_items(prop, object_type_items);
548 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
549 RNA_def_property_ui_text(prop, "Type", "Type of Object.");
551 prop= RNA_def_property(srna, "parent_type", PROP_ENUM, PROP_NONE);
552 RNA_def_property_enum_sdna(prop, NULL, "partype");
553 RNA_def_property_enum_items(prop, parent_type_items);
554 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
555 RNA_def_property_ui_text(prop, "Parent Type", "Type of parent relation.");
557 prop= RNA_def_property(srna, "parent_vertices", PROP_INT, PROP_UNSIGNED);
558 RNA_def_property_int_sdna(prop, NULL, "par1");
559 RNA_def_property_array(prop, 3);
560 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
561 RNA_def_property_ui_text(prop, "Parent Vertices", "Indices of vertices in cases of a vertex parenting relation.");
563 prop= RNA_def_property(srna, "parent_bone", PROP_STRING, PROP_NONE);
564 RNA_def_property_string_sdna(prop, NULL, "parsubstr");
565 RNA_def_property_ui_text(prop, "Parent Bone", "Name of parent bone in case of a bone parenting relation.");
567 prop= RNA_def_property(srna, "track", PROP_POINTER, PROP_NONE);
568 RNA_def_property_flag(prop, PROP_EDITABLE);
569 RNA_def_property_ui_text(prop, "Track", "Object being tracked to define the rotation (Old Track).");
571 prop= RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
572 RNA_def_property_enum_sdna(prop, NULL, "trackflag");
573 RNA_def_property_enum_items(prop, track_items);
574 RNA_def_property_ui_text(prop, "Track Axis", "Tracking axis pointing to the another object.");
576 prop= RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
577 RNA_def_property_enum_sdna(prop, NULL, "upflag");
578 RNA_def_property_enum_items(prop, up_items);
579 RNA_def_property_ui_text(prop, "Up Axis", "Specify the axis that points up.");
583 prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
584 RNA_def_property_ui_text(prop, "Proxy", "Library object this proxy object controls.");
586 prop= RNA_def_property(srna, "proxy_group", PROP_POINTER, PROP_NONE);
587 RNA_def_property_ui_text(prop, "Proxy Group", "Library group duplicator object this proxy object controls.");
591 prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
592 RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
593 RNA_def_property_struct_type(prop, "Material");
594 RNA_def_property_ui_text(prop, "Materials", "");
596 prop= RNA_def_property(srna, "active_material", PROP_POINTER, PROP_NONE);
597 RNA_def_property_struct_type(prop, "Material");
598 RNA_def_property_pointer_funcs(prop, "rna_Object_active_material_get", NULL);
599 RNA_def_property_ui_text(prop, "Active Material", "Active material being displayed.");
601 prop= RNA_def_property(srna, "active_material_index", PROP_INT, PROP_UNSIGNED);
602 RNA_def_property_int_sdna(prop, NULL, "actcol");
603 RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Object_active_material_index_range");
604 RNA_def_property_ui_text(prop, "Active Material Index", "Index of active material.");
606 prop= RNA_def_property(srna, "active_material_link", PROP_ENUM, PROP_NONE);
607 RNA_def_property_enum_items(prop, material_link_items);
608 RNA_def_property_enum_funcs(prop, "rna_Object_active_material_link_get", "rna_Object_active_material_link_set", NULL);
609 RNA_def_property_ui_text(prop, "Active Material Link", "Use material from object or data for the active material.");
613 prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
614 RNA_def_property_float_sdna(prop, NULL, "loc");
615 RNA_def_property_ui_text(prop, "Location", "Location of the object.");
616 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
618 prop= RNA_def_property(srna, "delta_location", PROP_FLOAT, PROP_VECTOR);
619 RNA_def_property_float_sdna(prop, NULL, "dloc");
620 RNA_def_property_ui_text(prop, "Delta Location", "Extra added translation to object location.");
621 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
623 prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ROTATION);
624 RNA_def_property_float_sdna(prop, NULL, "rot");
625 RNA_def_property_ui_text(prop, "Rotation", "Rotation of the object.");
626 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
628 prop= RNA_def_property(srna, "delta_rotation", PROP_FLOAT, PROP_ROTATION);
629 RNA_def_property_float_sdna(prop, NULL, "drot");
630 RNA_def_property_ui_text(prop, "Delta Rotation", "Extra added rotation to the rotation of the object.");
631 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
633 prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_VECTOR);
634 RNA_def_property_float_sdna(prop, NULL, "size");
635 RNA_def_property_ui_text(prop, "Scale", "Scaling of the object.");
636 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
638 prop= RNA_def_property(srna, "delta_scale", PROP_FLOAT, PROP_VECTOR);
639 RNA_def_property_float_sdna(prop, NULL, "dsize");
640 RNA_def_property_ui_text(prop, "Delta Scale", "Extra added scaling to the scale of the object.");
641 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
643 prop= RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_VECTOR);
644 RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_LOCX);
645 RNA_def_property_array(prop, 3);
646 RNA_def_property_ui_text(prop, "Lock Location", "Lock editing of location in the interface.");
648 prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_VECTOR);
649 RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTX);
650 RNA_def_property_array(prop, 3);
651 RNA_def_property_ui_text(prop, "Lock Rotation", "Lock editing of rotation in the interface.");
653 prop= RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_VECTOR);
654 RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_SCALEX);
655 RNA_def_property_array(prop, 3);
656 RNA_def_property_ui_text(prop, "Lock Scale", "Lock editing of scale in the interface.");
659 prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
660 RNA_def_property_struct_type(prop, "Constraint");
661 RNA_def_property_ui_text(prop, "Constraints", "Constraints of the object.");
663 prop= RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
664 RNA_def_property_struct_type(prop, "Modifier");
665 RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting the geometric data of the Object.");
669 prop= RNA_def_property(srna, "game", PROP_POINTER, PROP_NEVER_NULL);
670 RNA_def_property_struct_type(prop, "GameObjectSettings");
671 RNA_def_property_pointer_funcs(prop, "rna_Object_game_settings_get", NULL);
672 RNA_def_property_ui_text(prop, "Game Settings", "Game engine related settings for the object.");
676 prop= RNA_def_property(srna, "vertex_groups", PROP_COLLECTION, PROP_NONE);
677 RNA_def_property_collection_sdna(prop, NULL, "defbase", NULL);
678 RNA_def_property_struct_type(prop, "VertexGroup");
679 RNA_def_property_ui_text(prop, "Vertex Groups", "Vertex groups of the object.");
681 prop= RNA_def_property(srna, "active_vertex_group", PROP_POINTER, PROP_NONE);
682 RNA_def_property_struct_type(prop, "VertexGroup");
683 RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", NULL);
684 RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object.");
688 prop= RNA_def_property(srna, "empty_draw_type", PROP_ENUM, PROP_NONE);
689 RNA_def_property_enum_sdna(prop, NULL, "empty_drawtype");
690 RNA_def_property_enum_items(prop, empty_drawtype_items);
691 RNA_def_property_ui_text(prop, "Empty Draw Type", "Viewport display style for empties.");
692 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
694 prop= RNA_def_property(srna, "empty_draw_size", PROP_FLOAT, PROP_NONE);
695 RNA_def_property_float_sdna(prop, NULL, "empty_drawsize");
696 RNA_def_property_range(prop, 0.01, 10.0);
697 RNA_def_property_ui_text(prop, "Empty Draw Size", "Size of of display for empties in the viewport.");
698 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
702 prop= RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
703 RNA_def_property_int_sdna(prop, NULL, "index");
704 RNA_def_property_ui_text(prop, "Pass Index", "Index # for the IndexOB render pass.");
706 prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
707 RNA_def_property_float_sdna(prop, NULL, "col");
708 RNA_def_property_ui_text(prop, "Color", "Object color and alpha, used when faces have the ObColor mode enabled.");
712 prop= RNA_def_property(srna, "field", PROP_POINTER, PROP_NONE);
713 RNA_def_property_pointer_sdna(prop, NULL, "pd");
714 RNA_def_property_struct_type(prop, "FieldSettings");
715 RNA_def_property_ui_text(prop, "Field Settings", "Settings for using the objects as a field in physics simulation.");
717 prop= RNA_def_property(srna, "collision", PROP_POINTER, PROP_NONE);
718 RNA_def_property_pointer_sdna(prop, NULL, "pd");
719 RNA_def_property_struct_type(prop, "CollisionSettings");
720 RNA_def_property_ui_text(prop, "Collision Settings", "Settings for using the objects as a collider in physics simulation.");
722 prop= RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE);
723 RNA_def_property_pointer_sdna(prop, NULL, "soft");
724 RNA_def_property_ui_text(prop, "Soft Body Settings", "Settings for soft body simulation.");
726 prop= RNA_def_property(srna, "particle_systems", PROP_COLLECTION, PROP_NONE);
727 RNA_def_property_collection_sdna(prop, NULL, "particlesystem", NULL);
728 RNA_def_property_struct_type(prop, "ParticleSystem");
729 RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object.");
731 prop= RNA_def_property(srna, "active_particle_system", PROP_POINTER, PROP_NONE);
732 RNA_def_property_struct_type(prop, "ParticleSystem");
733 RNA_def_property_pointer_funcs(prop, "rna_Object_active_particle_system_get", NULL);
734 RNA_def_property_ui_text(prop, "Active Particle System", "Active particle system being displayed");
738 prop= RNA_def_property(srna, "restrict_view", PROP_BOOLEAN, PROP_NONE);
739 RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_VIEW);
740 RNA_def_property_ui_text(prop, "Restrict View", "Restrict visibility in the viewport.");
741 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
743 prop= RNA_def_property(srna, "restrict_select", PROP_BOOLEAN, PROP_NONE);
744 RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_SELECT);
745 RNA_def_property_ui_text(prop, "Restrict Select", "Restrict selection in the viewport.");
747 prop= RNA_def_property(srna, "restrict_render", PROP_BOOLEAN, PROP_NONE);
748 RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_RENDER);
749 RNA_def_property_ui_text(prop, "Restrict Render", "Restrict renderability.");
753 rna_def_animdata_common(srna);
755 prop= RNA_def_property(srna, "draw_keys", PROP_BOOLEAN, PROP_NONE);
756 RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_DRAWKEY);
757 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // update ipo flag indirect
758 RNA_def_property_ui_text(prop, "Draw Keys", "Draw object as key positions.");
760 prop= RNA_def_property(srna, "draw_keys_selected", PROP_BOOLEAN, PROP_NONE);
761 RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_DRAWKEYSEL);
762 RNA_def_property_ui_text(prop, "Draw Keys Selected", "Limit the drawing of object keys to selected.");
763 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
765 prop= RNA_def_property(srna, "track_rotation", PROP_BOOLEAN, PROP_NONE);
766 RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_POWERTRACK);
767 RNA_def_property_ui_text(prop, "Track Rotation", "Switch object rotation of in tracking.");
769 prop= RNA_def_property(srna, "slow_parent", PROP_BOOLEAN, PROP_NONE);
770 RNA_def_property_boolean_sdna(prop, NULL, "partype", PARSLOW);
771 RNA_def_property_ui_text(prop, "Slow Parent", "Create a delay in the parent relationship.");
773 prop= RNA_def_property(srna, "dupli_type", PROP_ENUM, PROP_NONE);
774 RNA_def_property_enum_bitflag_sdna(prop, NULL, "transflag");
775 RNA_def_property_enum_items(prop, dupli_items);
776 RNA_def_property_ui_text(prop, "Dupli Type", "If not None, object duplication method to use.");
777 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
779 prop= RNA_def_property(srna, "dupli_frames_no_speed", PROP_BOOLEAN, PROP_NONE);
780 RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLINOSPEED);
781 RNA_def_property_ui_text(prop, "Dupli Frames No Speed", "Set dupliframes to still, regardless of frame.");
782 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
784 prop= RNA_def_property(srna, "dupli_verts_rotation", PROP_BOOLEAN, PROP_NONE);
785 RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIROT);
786 RNA_def_property_ui_text(prop, "Dupli Verts Rotation", "Rotate dupli according to vertex normal.");
787 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
789 prop= RNA_def_property(srna, "dupli_faces_inherit_scale", PROP_BOOLEAN, PROP_NONE);
790 RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIROT);
791 RNA_def_property_ui_text(prop, "Dupli Faces Inherit Scale", "Scale dupli based on face size.");
792 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
794 prop= RNA_def_property(srna, "dupli_faces_scale", PROP_FLOAT, PROP_NONE);
795 RNA_def_property_float_sdna(prop, NULL, "dupfacesca");
796 RNA_def_property_range(prop, 0.001f, 10000.0f);
797 RNA_def_property_ui_text(prop, "Dupli Faces Scale", "Scale the DupliFace objects.");
798 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
800 prop= RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE);
801 RNA_def_property_pointer_sdna(prop, NULL, "dup_group");
802 RNA_def_property_flag(prop, PROP_EDITABLE);
803 RNA_def_property_ui_text(prop, "Dupli Group", "Instance an existing group.");
804 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
806 prop= RNA_def_property(srna, "dupli_frames_start", PROP_INT, PROP_NONE);
807 RNA_def_property_int_sdna(prop, NULL, "dupsta");
808 RNA_def_property_range(prop, 1, 32767);
809 RNA_def_property_ui_text(prop, "Dupli Frames Start", "Start frame for DupliFrames.");
810 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
812 prop= RNA_def_property(srna, "dupli_frames_end", PROP_INT, PROP_NONE);
813 RNA_def_property_int_sdna(prop, NULL, "dupend");
814 RNA_def_property_range(prop, 1, 32767);
815 RNA_def_property_ui_text(prop, "Dupli Frames End", "End frame for DupliFrames.");
816 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
818 prop= RNA_def_property(srna, "dupli_frames_on", PROP_INT, PROP_NONE);
819 RNA_def_property_int_sdna(prop, NULL, "dupon");
820 RNA_def_property_range(prop, 1, 1500);
821 RNA_def_property_ui_text(prop, "Dupli Frames On", "Number of frames to use between DupOff frames.");
822 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
824 prop= RNA_def_property(srna, "dupli_frames_off", PROP_INT, PROP_NONE);
825 RNA_def_property_int_sdna(prop, NULL, "dupoff");
826 RNA_def_property_range(prop, 0, 1500);
827 RNA_def_property_ui_text(prop, "Dupli Frames Off", "Recurring frames to exclude from the Dupliframes.");
828 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
832 prop= RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_NONE);
833 RNA_def_property_float_sdna(prop, NULL, "sf");
834 RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF);
835 RNA_def_property_ui_text(prop, "Time Offset", "Animation offset in frames for ipo's and dupligroup instances.");
836 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
838 prop= RNA_def_property(srna, "time_offset_edit", PROP_BOOLEAN, PROP_NONE);
839 RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_OB);
840 RNA_def_property_ui_text(prop, "Time Offset Edit", "Use time offset when inserting keys and display time offset for ipo and action views.");
842 prop= RNA_def_property(srna, "time_offset_parent", PROP_BOOLEAN, PROP_NONE);
843 RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARENT);
844 RNA_def_property_ui_text(prop, "Time Offset Parent", "Apply the time offset to this objects parent relationship.");
845 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
847 prop= RNA_def_property(srna, "time_offset_particle", PROP_BOOLEAN, PROP_NONE);
848 RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARTICLE);
849 RNA_def_property_ui_text(prop, "Time Offset Particle", "Let the time offset work on the particle effect.");
850 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
852 prop= RNA_def_property(srna, "time_offset_add_parent", PROP_BOOLEAN, PROP_NONE);
853 RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARENTADD);
854 RNA_def_property_ui_text(prop, "Time Offset Add Parent", "Add the parents time offset value");
855 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
859 prop= RNA_def_property(srna, "script_link", PROP_POINTER, PROP_NEVER_NULL);
860 RNA_def_property_pointer_sdna(prop, NULL, "scriptlink");
861 RNA_def_property_ui_text(prop, "Script Link", "Scripts linked to this object.");
865 prop= RNA_def_property(srna, "max_draw_type", PROP_ENUM, PROP_NONE);
866 RNA_def_property_enum_sdna(prop, NULL, "dt");
867 RNA_def_property_enum_items(prop, drawtype_items);
868 RNA_def_property_ui_text(prop, "Maximum Draw Type", "Maximum draw type to display object with in viewport.");
869 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
871 prop= RNA_def_property(srna, "draw_bounds", PROP_BOOLEAN, PROP_NONE);
872 RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_BOUNDBOX);
873 RNA_def_property_ui_text(prop, "Draw Bounds", "Displays the object's bounds.");
874 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
876 prop= RNA_def_property(srna, "draw_bounds_type", PROP_ENUM, PROP_NONE);
877 RNA_def_property_enum_sdna(prop, NULL, "boundtype");
878 RNA_def_property_enum_items(prop, boundtype_items);
879 RNA_def_property_ui_text(prop, "Draw Bounds Type", "Object boundary display type.");
880 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
882 prop= RNA_def_property(srna, "draw_name", PROP_BOOLEAN, PROP_NONE);
883 RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWNAME);
884 RNA_def_property_ui_text(prop, "Draw Name", "Displays the object's name.");
885 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
887 prop= RNA_def_property(srna, "draw_axis", PROP_BOOLEAN, PROP_NONE);
888 RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_AXIS);
889 RNA_def_property_ui_text(prop, "Draw Axis", "Displays the object's center and axis");
890 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
892 prop= RNA_def_property(srna, "draw_texture_space", PROP_BOOLEAN, PROP_NONE);
893 RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_TEXSPACE);
894 RNA_def_property_ui_text(prop, "Draw Texture Space", "Displays the object's texture space.");
895 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
897 prop= RNA_def_property(srna, "draw_wire", PROP_BOOLEAN, PROP_NONE);
898 RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWWIRE);
899 RNA_def_property_ui_text(prop, "Draw Wire", "Adds the object's wireframe over solid drawing.");
900 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
902 prop= RNA_def_property(srna, "draw_transparent", PROP_BOOLEAN, PROP_NONE);
903 RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWTRANSP);
904 RNA_def_property_ui_text(prop, "Draw Transparent", "Enables transparent materials for the object (Mesh only).");
905 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
907 prop= RNA_def_property(srna, "x_ray", PROP_BOOLEAN, PROP_NONE);
908 RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWXRAY);
909 RNA_def_property_ui_text(prop, "X-Ray", "Makes the object draw in front of others.");
910 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
913 prop= RNA_def_property(srna, "pose_library", PROP_POINTER, PROP_NONE);
914 RNA_def_property_pointer_sdna(prop, NULL, "poselib");
915 RNA_def_property_struct_type(prop, "Action");
916 RNA_def_property_ui_text(prop, "Pose Library", "Action used as a pose library for armatures.");
918 prop= RNA_def_property(srna, "pose", PROP_POINTER, PROP_NONE);
919 RNA_def_property_pointer_sdna(prop, NULL, "pose");
920 RNA_def_property_struct_type(prop, "Pose");
921 RNA_def_property_ui_text(prop, "Pose", "Current pose for armatures.");
923 prop= RNA_def_property(srna, "pose_mode", PROP_BOOLEAN, PROP_NONE);
924 RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_POSEMODE);
925 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
926 RNA_def_property_ui_text(prop, "Pose Mode", "Object with armature data is in pose mode.");
928 // XXX this stuff should be moved to AnimData...
930 prop= RNA_def_property(srna, "nla_disable_path", PROP_BOOLEAN, PROP_NONE);
931 RNA_def_property_boolean_sdna(prop, NULL, "nlaflag", OB_DISABLE_PATH);
932 RNA_def_property_ui_text(prop, "NLA Disable Path", "Disable path temporally, for editing cycles.");
934 prop= RNA_def_property(srna, "nla_collapsed", PROP_BOOLEAN, PROP_NONE);
935 RNA_def_property_boolean_sdna(prop, NULL, "nlaflag", OB_NLA_COLLAPSED);
936 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
937 RNA_def_property_ui_text(prop, "NLA Collapsed", "");
939 prop= RNA_def_property(srna, "nla_override", PROP_BOOLEAN, PROP_NONE);
940 RNA_def_property_boolean_sdna(prop, NULL, "nlaflag", OB_NLA_OVERRIDE);
941 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
942 RNA_def_property_ui_text(prop, "NLA Override", "");
944 prop= RNA_def_property(srna, "nla_strips", PROP_COLLECTION, PROP_NONE);
945 RNA_def_property_collection_sdna(prop, NULL, "nlastrips", NULL);
946 RNA_def_property_struct_type(prop, "UnknownType");
947 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
948 RNA_def_property_ui_text(prop, "NLA Strips", "NLA strips of the object.");
953 prop= RNA_def_property(srna, "shape_key_lock", PROP_BOOLEAN, PROP_NONE);
954 RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_LOCK);
955 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
956 RNA_def_property_ui_text(prop, "Shape Key Lock", "Always show the current Shape for this Object.");
958 prop= RNA_def_property(srna, "active_shape_key", PROP_INT, PROP_NONE);
959 RNA_def_property_int_sdna(prop, NULL, "shapenr");
960 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
961 RNA_def_property_ui_text(prop, "Active Shape Key", "Current shape key index.");
966 void RNA_def_object(BlenderRNA *brna)
968 rna_def_object(brna);
969 rna_def_object_game_settings(brna);
970 rna_def_vertex_group(brna);