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"
46 static void rna_Object_update(bContext *C, PointerRNA *ptr)
48 DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_OB);
51 static void rna_Object_dependency_update(bContext *C, PointerRNA *ptr)
53 DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_OB);
54 DAG_scene_sort(CTX_data_scene(C));
57 static int rna_VertexGroup_index_get(PointerRNA *ptr)
59 Object *ob= (Object*)ptr->id.data;
61 return BLI_findindex(&ob->defbase, ptr->data);
64 static PointerRNA rna_Object_active_vertex_group_get(PointerRNA *ptr)
66 Object *ob= (Object*)ptr->id.data;
67 return rna_pointer_inherit_refine(ptr, &RNA_VertexGroup, BLI_findlink(&ob->defbase, ob->actdef));
70 void rna_object_vgroup_name_index_get(PointerRNA *ptr, char *value, int index)
72 Object *ob= (Object*)ptr->id.data;
75 dg= BLI_findlink(&ob->defbase, index-1);
77 if(dg) BLI_strncpy(value, dg->name, sizeof(dg->name));
78 else BLI_strncpy(value, "", sizeof(dg->name));
81 int rna_object_vgroup_name_index_length(PointerRNA *ptr, int index)
83 Object *ob= (Object*)ptr->id.data;
86 dg= BLI_findlink(&ob->defbase, index-1);
87 return (dg)? strlen(dg->name): 0;
90 void rna_object_vgroup_name_index_set(PointerRNA *ptr, const char *value, short *index)
92 Object *ob= (Object*)ptr->id.data;
96 for(a=1, dg=ob->defbase.first; dg; dg=dg->next, a++) {
97 if(strcmp(dg->name, value) == 0) {
106 void rna_object_vgroup_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen)
108 Object *ob= (Object*)ptr->id.data;
111 for(dg=ob->defbase.first; dg; dg=dg->next) {
112 if(strcmp(dg->name, value) == 0) {
113 BLI_strncpy(result, value, maxlen);
118 BLI_strncpy(result, "", maxlen);
121 void rna_object_uvlayer_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen)
123 Object *ob= (Object*)ptr->id.data;
125 CustomDataLayer *layer;
128 if(ob->type == OB_MESH && ob->data) {
131 for(a=0; a<me->fdata.totlayer; a++) {
132 layer= &me->fdata.layers[a];
134 if(layer->type == CD_MTFACE && strcmp(layer->name, value) == 0) {
135 BLI_strncpy(result, value, maxlen);
141 BLI_strncpy(result, "", maxlen);
144 void rna_object_vcollayer_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen)
146 Object *ob= (Object*)ptr->id.data;
148 CustomDataLayer *layer;
151 if(ob->type == OB_MESH && ob->data) {
154 for(a=0; a<me->fdata.totlayer; a++) {
155 layer= &me->fdata.layers[a];
157 if(layer->type == CD_MCOL && strcmp(layer->name, value) == 0) {
158 BLI_strncpy(result, value, maxlen);
164 BLI_strncpy(result, "", maxlen);
167 static void rna_Object_active_material_index_range(PointerRNA *ptr, int *min, int *max)
169 Object *ob= (Object*)ptr->id.data;
174 static PointerRNA rna_Object_active_material_get(PointerRNA *ptr)
176 Object *ob= (Object*)ptr->id.data;
177 return rna_pointer_inherit_refine(ptr, &RNA_Material, give_current_material(ob, ob->actcol));
181 static void rna_Object_active_material_set(PointerRNA *ptr, PointerRNA value)
183 Object *ob= (Object*)ptr->id.data;
185 assign_material(ob, value.data, ob->actcol);
189 static int rna_Object_active_material_link_get(PointerRNA *ptr)
191 Object *ob= (Object*)ptr->id.data;
192 return (ob->colbits & 1<<(ob->actcol)) != 0;
195 static void rna_Object_active_material_link_set(PointerRNA *ptr, int value)
197 Object *ob= (Object*)ptr->id.data;
200 ob->colbits |= (1<<(ob->actcol));
202 ob->colbits &= ~(1<<(ob->actcol));
205 static PointerRNA rna_Object_game_settings_get(PointerRNA *ptr)
207 return rna_pointer_inherit_refine(ptr, &RNA_GameObjectSettings, ptr->id.data);
210 static void rna_Object_layer_set(PointerRNA *ptr, const int *values)
212 Object *ob= (Object*)ptr->data;
215 /* ensure we always have some layer selected */
223 for(i=0; i<20; i++) {
224 if(values[i]) ob->lay |= (1<<i);
225 else ob->lay &= ~(1<<i);
229 static void rna_GameObjectSettings_state_set(PointerRNA *ptr, const int *values)
231 Object *ob= (Object*)ptr->data;
234 /* ensure we always have some stateer selected */
242 for(i=0; i<20; i++) {
243 if(values[i]) ob->state |= (1<<i);
244 else ob->state &= ~(1<<i);
250 static void rna_def_vertex_group(BlenderRNA *brna)
255 srna= RNA_def_struct(brna, "VertexGroup", NULL);
256 RNA_def_struct_sdna(srna, "bDeformGroup");
257 RNA_def_struct_ui_text(srna, "Vertex Group", "Group of vertices, used for armature deform and other purposes.");
259 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
260 RNA_def_property_ui_text(prop, "Name", "Vertex group name.");
261 RNA_def_struct_name_property(srna, prop);
263 prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
264 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
265 RNA_def_property_int_funcs(prop, "rna_VertexGroup_index_get", NULL, NULL);
266 RNA_def_property_ui_text(prop, "Index", "Index number of the vertex group.");
269 static void rna_def_object_game_settings(BlenderRNA *brna)
274 static EnumPropertyItem body_type_items[] = {
275 {OB_BODY_TYPE_NO_COLLISION, "NO_COLLISION", "No Collision", ""},
276 {OB_BODY_TYPE_STATIC, "STATIC", "Static", ""},
277 {OB_BODY_TYPE_DYNAMIC, "DYNAMIC", "Dynamic", ""},
278 {OB_BODY_TYPE_RIGID, "RIGID_BODY", "Rigid Body", ""},
279 {OB_BODY_TYPE_SOFT, "SOFT_BODY", "Soft Body", ""},
280 {0, NULL, NULL, NULL}};
282 static EnumPropertyItem collision_bounds_items[] = {
283 {OB_BOUND_BOX, "BOX", "Box", ""},
284 {OB_BOUND_SPHERE, "SPHERE", "Sphere", ""},
285 {OB_BOUND_CYLINDER, "CYLINDER", "Cylinder", ""},
286 {OB_BOUND_CONE, "CONE", "Cone", ""},
287 {OB_BOUND_POLYH, "CONVEX_HULL", "Convex Hull", ""},
288 {OB_BOUND_POLYT, "TRIANGLE_MESH", "Triangle Mesh", ""},
289 //{OB_DYN_MESH, "DYNAMIC_MESH", "Dynamic Mesh", ""},
290 {0, NULL, NULL, NULL}};
292 srna= RNA_def_struct(brna, "GameObjectSettings", NULL);
293 RNA_def_struct_sdna(srna, "Object");
294 RNA_def_struct_nested(brna, srna, "Object");
295 RNA_def_struct_ui_text(srna, "Game Object Settings", "Game engine related settings for the object.");
299 prop= RNA_def_property(srna, "sensors", PROP_COLLECTION, PROP_NONE);
300 RNA_def_property_struct_type(prop, "Sensor");
301 RNA_def_property_ui_text(prop, "Sensors", "Game engine sensor to detect events.");
303 prop= RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE);
304 RNA_def_property_struct_type(prop, "Controller");
305 RNA_def_property_ui_text(prop, "Controllers", "Game engine controllers to process events, connecting sensor to actuators.");
307 prop= RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE);
308 RNA_def_property_struct_type(prop, "Actuator");
309 RNA_def_property_ui_text(prop, "Actuators", "Game engine actuators to act on events.");
311 prop= RNA_def_property(srna, "properties", PROP_COLLECTION, PROP_NONE);
312 RNA_def_property_collection_sdna(prop, NULL, "prop", NULL);
313 RNA_def_property_struct_type(prop, "GameProperty");
314 RNA_def_property_ui_text(prop, "Properties", "Game engine properties.");
316 prop= RNA_def_property(srna, "show_sensors", PROP_BOOLEAN, PROP_NONE);
317 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWSENS);
318 RNA_def_property_ui_text(prop, "Show Sensors", "Shows sensors for this object in the user interface.");
320 prop= RNA_def_property(srna, "show_controllers", PROP_BOOLEAN, PROP_NONE);
321 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWCONT);
322 RNA_def_property_ui_text(prop, "Show Controllers", "Shows controllers for this object in the user interface.");
324 prop= RNA_def_property(srna, "show_actuators", PROP_BOOLEAN, PROP_NONE);
325 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWACT);
326 RNA_def_property_ui_text(prop, "Show Actuators", "Shows actuators for this object in the user interface.");
330 prop= RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE);
331 RNA_def_property_enum_sdna(prop, NULL, "body_type");
332 RNA_def_property_enum_items(prop, body_type_items);
333 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // this controls various gameflags
334 RNA_def_property_ui_text(prop, "Physics Type", "Selects the type of physical representation.");
336 prop= RNA_def_property(srna, "actor", PROP_BOOLEAN, PROP_NONE);
337 RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ACTOR);
338 RNA_def_property_ui_text(prop, "Actor", "Object is detected by the Near and Radar sensor.");
340 prop= RNA_def_property(srna, "ghost", PROP_BOOLEAN, PROP_NONE);
341 RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_GHOST);
342 RNA_def_property_ui_text(prop, "Ghost", "Object does not restitute collisions, like a ghost.");
344 prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
345 RNA_def_property_range(prop, 0.01, 10000.0);
346 RNA_def_property_ui_text(prop, "Mass", "Mass of the object.");
348 prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
349 RNA_def_property_float_sdna(prop, NULL, "inertia");
350 RNA_def_property_range(prop, 0.01, 10.0);
351 RNA_def_property_ui_text(prop, "Radius", "Radius for Bounding sphere and Fh/Fh Rot.");
352 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
354 prop= RNA_def_property(srna, "no_sleeping", PROP_BOOLEAN, PROP_NONE);
355 RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_COLLISION_RESPONSE);
356 RNA_def_property_ui_text(prop, "No Sleeping", "Disable auto (de)activation in physics simulation.");
358 prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
359 RNA_def_property_float_sdna(prop, NULL, "damping");
360 RNA_def_property_range(prop, 0.0, 1.0);
361 RNA_def_property_ui_text(prop, "Damping", "General movement damping.");
363 prop= RNA_def_property(srna, "rotation_damping", PROP_FLOAT, PROP_NONE);
364 RNA_def_property_float_sdna(prop, NULL, "rdamping");
365 RNA_def_property_range(prop, 0.0, 1.0);
366 RNA_def_property_ui_text(prop, "Rotation Damping", "General rotation damping.");
368 prop= RNA_def_property(srna, "do_fh", PROP_BOOLEAN, PROP_NONE);
369 RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_DO_FH);
370 RNA_def_property_ui_text(prop, "Do Fh", "Use Fh settings in materials.");
372 prop= RNA_def_property(srna, "rotation_fh", PROP_BOOLEAN, PROP_NONE);
373 RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ROT_FH);
374 RNA_def_property_ui_text(prop, "Rotation Fh", "Use face normal to rotate Object");
376 prop= RNA_def_property(srna, "form_factor", PROP_FLOAT, PROP_NONE);
377 RNA_def_property_float_sdna(prop, NULL, "formfactor");
378 RNA_def_property_range(prop, 0.0, 1.0);
379 RNA_def_property_ui_text(prop, "Form Factor", "Form factor scales the inertia tensor.");
381 prop= RNA_def_property(srna, "anisotropic_friction", PROP_BOOLEAN, PROP_NONE);
382 RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ANISOTROPIC_FRICTION);
383 RNA_def_property_ui_text(prop, "Anisotropic Friction", "Enable anisotropic friction.");
385 prop= RNA_def_property(srna, "friction_coefficients", PROP_FLOAT, PROP_VECTOR);
386 RNA_def_property_float_sdna(prop, NULL, "anisotropicFriction");
387 RNA_def_property_range(prop, 0.0, 1.0);
388 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.");
390 prop= RNA_def_property(srna, "use_collision_bounds", PROP_BOOLEAN, PROP_NONE);
391 RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_BOUNDS);
392 RNA_def_property_ui_text(prop, "Use Collision Bounds", "Specify a collision bounds type other than the default.");
394 prop= RNA_def_property(srna, "collision_bounds", PROP_ENUM, PROP_NONE);
395 RNA_def_property_enum_sdna(prop, NULL, "boundtype");
396 RNA_def_property_enum_items(prop, collision_bounds_items);
397 RNA_def_property_ui_text(prop, "Collision Bounds", "Selects the collision type.");
399 prop= RNA_def_property(srna, "collision_compound", PROP_BOOLEAN, PROP_NONE);
400 RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_CHILD);
401 RNA_def_property_ui_text(prop, "Collison Compound", "Add children to form a compound collision object.");
403 prop= RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE);
404 RNA_def_property_float_sdna(prop, NULL, "margin");
405 RNA_def_property_range(prop, 0.0, 1.0);
406 RNA_def_property_ui_text(prop, "Collision Margin", "Extra margin around object for collision detection, small amount required for stability.");
408 prop= RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE);
409 RNA_def_property_pointer_sdna(prop, NULL, "bsoft");
410 RNA_def_property_ui_text(prop, "Soft Body Settings", "Settings for Bullet soft body simulation.");
414 prop= RNA_def_property(srna, "state", PROP_BOOLEAN, PROP_NONE);
415 RNA_def_property_boolean_sdna(prop, NULL, "state", 1);
416 RNA_def_property_array(prop, 30);
417 RNA_def_property_ui_text(prop, "State", "State determining which controllers are displayed.");
418 RNA_def_property_boolean_funcs(prop, NULL, "rna_GameObjectSettings_state_set");
420 prop= RNA_def_property(srna, "initial_state", PROP_BOOLEAN, PROP_NONE);
421 RNA_def_property_boolean_sdna(prop, NULL, "init_state", 1);
422 RNA_def_property_array(prop, 30);
423 RNA_def_property_ui_text(prop, "Initial State", "Initial state when the game starts.");
425 prop= RNA_def_property(srna, "debug_state", PROP_BOOLEAN, PROP_NONE);
426 RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_DEBUGSTATE);
427 RNA_def_property_ui_text(prop, "Debug State", "Print state debug info in the game engine.");
430 static StructRNA *rna_def_object(BlenderRNA *brna)
435 static EnumPropertyItem parent_type_items[] = {
436 {PAROBJECT, "OBJECT", "Object", ""},
437 {PARCURVE, "CURVE", "Curve", ""},
438 //{PARKEY, "KEY", "Key", ""},
439 {PARSKEL, "ARMATURE", "Armature", ""},
440 {PARSKEL, "LATTICE", "Lattice", ""}, // PARSKEL reuse will give issues
441 {PARVERT1, "VERTEX", "Vertex", ""},
442 {PARVERT3, "VERTEX_3", "3 Vertices", ""},
443 {PARBONE, "BONE", "Bone", ""},
444 {0, NULL, NULL, NULL}};
446 static EnumPropertyItem object_type_items[] = {
447 {OB_EMPTY, "EMPTY", "Empty", ""},
448 {OB_MESH, "MESH", "Mesh", ""},
449 {OB_CURVE, "CURVE", "Curve", ""},
450 {OB_SURF, "SURFACE", "Surface", ""},
451 {OB_FONT, "TEXT", "Text", ""},
452 {OB_MBALL, "META", "Meta", ""},
453 {OB_LAMP, "LAMP", "Lamp", ""},
454 {OB_CAMERA, "CAMERA", "Camera", ""},
455 {OB_WAVE, "WAVE", "Wave", ""},
456 {OB_LATTICE, "LATTICE", "Lattice", ""},
457 {OB_ARMATURE, "ARMATURE", "Armature", ""},
458 {0, NULL, NULL, NULL}};
460 static EnumPropertyItem empty_drawtype_items[] = {
461 {OB_ARROWS, "ARROWS", "Arrows", ""},
462 {OB_SINGLE_ARROW, "SINGLE_ARROW", "Single Arrow", ""},
463 {OB_PLAINAXES, "PLAIN_AXES", "Plain Axes", ""},
464 {OB_CIRCLE, "CIRCLE", "Circle", ""},
465 {OB_CUBE, "CUBE", "Cube", ""},
466 {OB_EMPTY_SPHERE, "SPHERE", "Sphere", ""},
467 {OB_EMPTY_CONE, "CONE", "Cone", ""},
468 {0, NULL, NULL, NULL}};
470 static EnumPropertyItem track_items[] = {
471 {OB_POSX, "POSX", "+X", ""},
472 {OB_POSY, "POSY", "+Y", ""},
473 {OB_POSZ, "POSZ", "+Z", ""},
474 {OB_NEGX, "NEGX", "-X", ""},
475 {OB_NEGY, "NEGY", "-Y", ""},
476 {OB_NEGZ, "NEGZ", "-Z", ""},
477 {0, NULL, NULL, NULL}};
479 static EnumPropertyItem up_items[] = {
480 {OB_POSX, "X", "X", ""},
481 {OB_POSY, "Y", "Y", ""},
482 {OB_POSZ, "Z", "Z", ""},
483 {0, NULL, NULL, NULL}};
485 static EnumPropertyItem drawtype_items[] = {
486 {OB_BOUNDBOX, "BOUNDS", "Bounds", ""},
487 {OB_WIRE, "WIRE", "Wire", ""},
488 {OB_SOLID, "SOLID", "Solid", ""},
489 {OB_SHADED, "SHADED", "Shaded", ""},
490 {OB_TEXTURE, "TEXTURED", "Textured", ""},
491 {0, NULL, NULL, NULL}};
493 static EnumPropertyItem boundtype_items[] = {
494 {OB_BOUND_BOX, "BOX", "Box", ""},
495 {OB_BOUND_SPHERE, "SPHERE", "Sphere", ""},
496 {OB_BOUND_CYLINDER, "CYLINDER", "Cylinder", ""},
497 {OB_BOUND_CONE, "CONE", "Cone", ""},
498 {OB_BOUND_POLYH, "POLYHEDER", "Polyheder", ""},
499 {0, NULL, NULL, NULL}};
501 static EnumPropertyItem material_link_items[] = {
502 {0, "DATA", "Data", ""},
503 {1, "OBJECT", "Object", ""},
504 {0, NULL, NULL, NULL}};
506 static EnumPropertyItem dupli_items[] = {
507 {0, "NONE", "None", ""},
508 {OB_DUPLIFRAMES, "FRAMES", "Frames", "Make copy of object for every frame."},
509 {OB_DUPLIVERTS, "VERTS", "Verts", "Duplicate child objects on all vertices."},
510 {OB_DUPLIFACES, "FACES", "Faces", "Duplicate child objects on all faces."},
511 {OB_DUPLIGROUP, "GROUP", "Group", "Enable group instancing."},
512 {0, NULL, NULL, NULL}};
514 srna= RNA_def_struct(brna, "Object", "ID");
515 RNA_def_struct_ui_text(srna, "Object", "Object datablock defining an object in a scene..");
516 RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
518 prop= RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE);
519 RNA_def_property_struct_type(prop, "ID");
520 RNA_def_property_ui_text(prop, "Data", "Object data.");
522 prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_NONE);
523 RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
524 RNA_def_property_array(prop, 20);
525 RNA_def_property_ui_text(prop, "Layers", "Layers the object is on.");
526 RNA_def_property_boolean_funcs(prop, NULL, "rna_Object_layer_set");
528 prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
529 RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
530 RNA_def_property_ui_text(prop, "Selected", "Object selection state.");
532 /* parent and track */
534 prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
535 RNA_def_property_ui_text(prop, "Parent", "Parent Object");
537 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
538 RNA_def_property_enum_sdna(prop, NULL, "type");
539 RNA_def_property_enum_items(prop, object_type_items);
540 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
541 RNA_def_property_ui_text(prop, "Type", "Type of Object.");
543 prop= RNA_def_property(srna, "parent_type", PROP_ENUM, PROP_NONE);
544 RNA_def_property_enum_sdna(prop, NULL, "partype");
545 RNA_def_property_enum_items(prop, parent_type_items);
546 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
547 RNA_def_property_ui_text(prop, "Parent Type", "Type of parent relation.");
549 prop= RNA_def_property(srna, "parent_vertices", PROP_INT, PROP_UNSIGNED);
550 RNA_def_property_int_sdna(prop, NULL, "par1");
551 RNA_def_property_array(prop, 3);
552 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
553 RNA_def_property_ui_text(prop, "Parent Vertices", "Indices of vertices in cases of a vertex parenting relation.");
555 prop= RNA_def_property(srna, "parent_bone", PROP_STRING, PROP_NONE);
556 RNA_def_property_string_sdna(prop, NULL, "parsubstr");
557 RNA_def_property_ui_text(prop, "Parent Bone", "Name of parent bone in case of a bone parenting relation.");
559 prop= RNA_def_property(srna, "track", PROP_POINTER, PROP_NONE);
560 RNA_def_property_flag(prop, PROP_EDITABLE);
561 RNA_def_property_ui_text(prop, "Track", "Object being tracked to define the rotation (Old Track).");
563 prop= RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
564 RNA_def_property_enum_sdna(prop, NULL, "trackflag");
565 RNA_def_property_enum_items(prop, track_items);
566 RNA_def_property_ui_text(prop, "Track Axis", "Tracking axis pointing to the another object.");
568 prop= RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
569 RNA_def_property_enum_sdna(prop, NULL, "upflag");
570 RNA_def_property_enum_items(prop, up_items);
571 RNA_def_property_ui_text(prop, "Up Axis", "Specify the axis that points up.");
575 prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
576 RNA_def_property_ui_text(prop, "Proxy", "Library object this proxy object controls.");
578 prop= RNA_def_property(srna, "proxy_group", PROP_POINTER, PROP_NONE);
579 RNA_def_property_ui_text(prop, "Proxy Group", "Library group duplicator object this proxy object controls.");
583 prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
584 RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
585 RNA_def_property_struct_type(prop, "Material");
586 RNA_def_property_ui_text(prop, "Materials", "");
588 prop= RNA_def_property(srna, "active_material", PROP_POINTER, PROP_NONE);
589 RNA_def_property_struct_type(prop, "Material");
590 RNA_def_property_pointer_funcs(prop, "rna_Object_active_material_get", NULL);
591 RNA_def_property_ui_text(prop, "Active Material", "Active material being displayed.");
593 prop= RNA_def_property(srna, "active_material_index", PROP_INT, PROP_UNSIGNED);
594 RNA_def_property_int_sdna(prop, NULL, "actcol");
595 RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Object_active_material_index_range");
596 RNA_def_property_ui_text(prop, "Active Material Index", "Index of active material.");
598 prop= RNA_def_property(srna, "active_material_link", PROP_ENUM, PROP_NONE);
599 RNA_def_property_enum_items(prop, material_link_items);
600 RNA_def_property_enum_funcs(prop, "rna_Object_active_material_link_get", "rna_Object_active_material_link_set", NULL);
601 RNA_def_property_ui_text(prop, "Active Material Link", "Use material from object or data for the active material.");
605 prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
606 RNA_def_property_float_sdna(prop, NULL, "loc");
607 RNA_def_property_ui_text(prop, "Location", "Location of the object.");
608 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
610 prop= RNA_def_property(srna, "delta_location", PROP_FLOAT, PROP_VECTOR);
611 RNA_def_property_float_sdna(prop, NULL, "dloc");
612 RNA_def_property_ui_text(prop, "Delta Location", "Extra added translation to object location.");
613 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
615 prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ROTATION);
616 RNA_def_property_float_sdna(prop, NULL, "rot");
617 RNA_def_property_ui_text(prop, "Rotation", "Rotation of the object.");
618 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
620 prop= RNA_def_property(srna, "delta_rotation", PROP_FLOAT, PROP_ROTATION);
621 RNA_def_property_float_sdna(prop, NULL, "drot");
622 RNA_def_property_ui_text(prop, "Delta Rotation", "Extra added rotation to the rotation of the object.");
623 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
625 prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_VECTOR);
626 RNA_def_property_float_sdna(prop, NULL, "size");
627 RNA_def_property_ui_text(prop, "Scale", "Scaling of the object.");
628 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
630 prop= RNA_def_property(srna, "delta_scale", PROP_FLOAT, PROP_VECTOR);
631 RNA_def_property_float_sdna(prop, NULL, "dsize");
632 RNA_def_property_ui_text(prop, "Delta Scale", "Extra added scaling to the scale of the object.");
633 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
635 prop= RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_VECTOR);
636 RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_LOCX);
637 RNA_def_property_array(prop, 3);
638 RNA_def_property_ui_text(prop, "Lock Location", "Lock editing of location in the interface.");
640 prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_VECTOR);
641 RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTX);
642 RNA_def_property_array(prop, 3);
643 RNA_def_property_ui_text(prop, "Lock Rotation", "Lock editing of rotation in the interface.");
645 prop= RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_VECTOR);
646 RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_SCALEX);
647 RNA_def_property_array(prop, 3);
648 RNA_def_property_ui_text(prop, "Lock Scale", "Lock editing of scale in the interface.");
651 prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
652 RNA_def_property_struct_type(prop, "Constraint");
653 RNA_def_property_ui_text(prop, "Constraints", "Constraints of the object.");
655 prop= RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
656 RNA_def_property_struct_type(prop, "Modifier");
657 RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting the geometric data of the Object.");
661 prop= RNA_def_property(srna, "game", PROP_POINTER, PROP_NEVER_NULL);
662 RNA_def_property_struct_type(prop, "GameObjectSettings");
663 RNA_def_property_pointer_funcs(prop, "rna_Object_game_settings_get", NULL);
664 RNA_def_property_ui_text(prop, "Game Settings", "Game engine related settings for the object.");
668 prop= RNA_def_property(srna, "vertex_groups", PROP_COLLECTION, PROP_NONE);
669 RNA_def_property_collection_sdna(prop, NULL, "defbase", NULL);
670 RNA_def_property_struct_type(prop, "VertexGroup");
671 RNA_def_property_ui_text(prop, "Vertex Groups", "Vertex groups of the object.");
673 prop= RNA_def_property(srna, "active_vertex_group", PROP_POINTER, PROP_NONE);
674 RNA_def_property_struct_type(prop, "VertexGroup");
675 RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", NULL);
676 RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object.");
680 prop= RNA_def_property(srna, "empty_draw_type", PROP_ENUM, PROP_NONE);
681 RNA_def_property_enum_sdna(prop, NULL, "empty_drawtype");
682 RNA_def_property_enum_items(prop, empty_drawtype_items);
683 RNA_def_property_ui_text(prop, "Empty Draw Type", "Viewport display style for empties.");
684 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
686 prop= RNA_def_property(srna, "empty_draw_size", PROP_FLOAT, PROP_NONE);
687 RNA_def_property_float_sdna(prop, NULL, "empty_drawsize");
688 RNA_def_property_range(prop, 0.01, 10.0);
689 RNA_def_property_ui_text(prop, "Empty Draw Size", "Size of of display for empties in the viewport.");
690 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
694 prop= RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
695 RNA_def_property_int_sdna(prop, NULL, "index");
696 RNA_def_property_ui_text(prop, "Pass Index", "Index # for the IndexOB render pass.");
698 prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
699 RNA_def_property_float_sdna(prop, NULL, "col");
700 RNA_def_property_ui_text(prop, "Color", "Object color and alpha, used when faces have the ObColor mode enabled.");
704 prop= RNA_def_property(srna, "field", PROP_POINTER, PROP_NONE);
705 RNA_def_property_pointer_sdna(prop, NULL, "pd");
706 RNA_def_property_struct_type(prop, "FieldSettings");
707 RNA_def_property_ui_text(prop, "Field Settings", "Settings for using the objects as a field in physics simulation.");
709 prop= RNA_def_property(srna, "collision", PROP_POINTER, PROP_NONE);
710 RNA_def_property_pointer_sdna(prop, NULL, "pd");
711 RNA_def_property_struct_type(prop, "CollisionSettings");
712 RNA_def_property_ui_text(prop, "Collision Settings", "Settings for using the objects as a collider in physics simulation.");
714 prop= RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE);
715 RNA_def_property_pointer_sdna(prop, NULL, "soft");
716 RNA_def_property_ui_text(prop, "Soft Body Settings", "Settings for soft body simulation.");
718 prop= RNA_def_property(srna, "particle_systems", PROP_COLLECTION, PROP_NONE);
719 RNA_def_property_collection_sdna(prop, NULL, "particlesystem", NULL);
720 RNA_def_property_struct_type(prop, "ParticleSystem");
721 RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object.");
725 prop= RNA_def_property(srna, "restrict_view", PROP_BOOLEAN, PROP_NONE);
726 RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_VIEW);
727 RNA_def_property_ui_text(prop, "Restrict View", "Restrict visibility in the viewport.");
728 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
730 prop= RNA_def_property(srna, "restrict_select", PROP_BOOLEAN, PROP_NONE);
731 RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_SELECT);
732 RNA_def_property_ui_text(prop, "Restrict Select", "Restrict selection in the viewport.");
734 prop= RNA_def_property(srna, "restrict_render", PROP_BOOLEAN, PROP_NONE);
735 RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_RENDER);
736 RNA_def_property_ui_text(prop, "Restrict Render", "Restrict renderability.");
740 rna_def_animdata_common(srna);
742 prop= RNA_def_property(srna, "draw_keys", PROP_BOOLEAN, PROP_NONE);
743 RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_DRAWKEY);
744 RNA_def_property_clear_flag(prop, PROP_EDITABLE); // update ipo flag indirect
745 RNA_def_property_ui_text(prop, "Draw Keys", "Draw object as key positions.");
747 prop= RNA_def_property(srna, "draw_keys_selected", PROP_BOOLEAN, PROP_NONE);
748 RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_DRAWKEYSEL);
749 RNA_def_property_ui_text(prop, "Draw Keys Selected", "Limit the drawing of object keys to selected.");
750 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
752 prop= RNA_def_property(srna, "track_rotation", PROP_BOOLEAN, PROP_NONE);
753 RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_POWERTRACK);
754 RNA_def_property_ui_text(prop, "Track Rotation", "Switch object rotation of in tracking.");
756 prop= RNA_def_property(srna, "slow_parent", PROP_BOOLEAN, PROP_NONE);
757 RNA_def_property_boolean_sdna(prop, NULL, "partype", PARSLOW);
758 RNA_def_property_ui_text(prop, "Slow Parent", "Create a delay in the parent relationship.");
760 prop= RNA_def_property(srna, "dupli_type", PROP_ENUM, PROP_NONE);
761 RNA_def_property_enum_bitflag_sdna(prop, NULL, "transflag");
762 RNA_def_property_enum_items(prop, dupli_items);
763 RNA_def_property_ui_text(prop, "Dupli Type", "If not None, object duplication method to use.");
764 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
766 prop= RNA_def_property(srna, "dupli_frames_no_speed", PROP_BOOLEAN, PROP_NONE);
767 RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLINOSPEED);
768 RNA_def_property_ui_text(prop, "Dupli Frames No Speed", "Set dupliframes to still, regardless of frame.");
769 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
771 prop= RNA_def_property(srna, "dupli_verts_rotation", PROP_BOOLEAN, PROP_NONE);
772 RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIROT);
773 RNA_def_property_ui_text(prop, "Dupli Verts Rotation", "Rotate dupli according to vertex normal.");
774 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
776 prop= RNA_def_property(srna, "dupli_faces_inherit_scale", PROP_BOOLEAN, PROP_NONE);
777 RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIROT);
778 RNA_def_property_ui_text(prop, "Dupli Faces Inherit Scale", "Scale dupli based on face size.");
779 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
781 prop= RNA_def_property(srna, "dupli_faces_scale", PROP_FLOAT, PROP_NONE);
782 RNA_def_property_float_sdna(prop, NULL, "dupfacesca");
783 RNA_def_property_range(prop, 0.001f, 10000.0f);
784 RNA_def_property_ui_text(prop, "Dupli Faces Scale", "Scale the DupliFace objects.");
785 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
787 prop= RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE);
788 RNA_def_property_pointer_sdna(prop, NULL, "dup_group");
789 RNA_def_property_flag(prop, PROP_EDITABLE);
790 RNA_def_property_ui_text(prop, "Dupli Group", "Instance an existing group.");
791 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
793 prop= RNA_def_property(srna, "dupli_frames_start", PROP_INT, PROP_NONE);
794 RNA_def_property_int_sdna(prop, NULL, "dupsta");
795 RNA_def_property_range(prop, 1, 32767);
796 RNA_def_property_ui_text(prop, "Dupli Frames Start", "Start frame for DupliFrames.");
797 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
799 prop= RNA_def_property(srna, "dupli_frames_end", PROP_INT, PROP_NONE);
800 RNA_def_property_int_sdna(prop, NULL, "dupend");
801 RNA_def_property_range(prop, 1, 32767);
802 RNA_def_property_ui_text(prop, "Dupli Frames End", "End frame for DupliFrames.");
803 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
805 prop= RNA_def_property(srna, "dupli_frames_on", PROP_INT, PROP_NONE);
806 RNA_def_property_int_sdna(prop, NULL, "dupon");
807 RNA_def_property_range(prop, 1, 1500);
808 RNA_def_property_ui_text(prop, "Dupli Frames On", "Number of frames to use between DupOff frames.");
809 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
811 prop= RNA_def_property(srna, "dupli_frames_off", PROP_INT, PROP_NONE);
812 RNA_def_property_int_sdna(prop, NULL, "dupoff");
813 RNA_def_property_range(prop, 0, 1500);
814 RNA_def_property_ui_text(prop, "Dupli Frames Off", "Recurring frames to exclude from the Dupliframes.");
815 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
819 prop= RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_NONE);
820 RNA_def_property_float_sdna(prop, NULL, "sf");
821 RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF);
822 RNA_def_property_ui_text(prop, "Time Offset", "Animation offset in frames for ipo's and dupligroup instances.");
823 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
825 prop= RNA_def_property(srna, "time_offset_edit", PROP_BOOLEAN, PROP_NONE);
826 RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_OB);
827 RNA_def_property_ui_text(prop, "Time Offset Edit", "Use time offset when inserting keys and display time offset for ipo and action views.");
829 prop= RNA_def_property(srna, "time_offset_parent", PROP_BOOLEAN, PROP_NONE);
830 RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARENT);
831 RNA_def_property_ui_text(prop, "Time Offset Parent", "Apply the time offset to this objects parent relationship.");
832 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
834 prop= RNA_def_property(srna, "time_offset_particle", PROP_BOOLEAN, PROP_NONE);
835 RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARTICLE);
836 RNA_def_property_ui_text(prop, "Time Offset Particle", "Let the time offset work on the particle effect.");
837 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
839 prop= RNA_def_property(srna, "time_offset_add_parent", PROP_BOOLEAN, PROP_NONE);
840 RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARENTADD);
841 RNA_def_property_ui_text(prop, "Time Offset Add Parent", "Add the parents time offset value");
842 RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
846 prop= RNA_def_property(srna, "script_link", PROP_POINTER, PROP_NEVER_NULL);
847 RNA_def_property_pointer_sdna(prop, NULL, "scriptlink");
848 RNA_def_property_ui_text(prop, "Script Link", "Scripts linked to this object.");
852 prop= RNA_def_property(srna, "max_draw_type", PROP_ENUM, PROP_NONE);
853 RNA_def_property_enum_sdna(prop, NULL, "dt");
854 RNA_def_property_enum_items(prop, drawtype_items);
855 RNA_def_property_ui_text(prop, "Maximum Draw Type", "Maximum draw type to display object with in viewport.");
856 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
858 prop= RNA_def_property(srna, "draw_bounds", PROP_BOOLEAN, PROP_NONE);
859 RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_BOUNDBOX);
860 RNA_def_property_ui_text(prop, "Draw Bounds", "Displays the object's bounds.");
861 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
863 prop= RNA_def_property(srna, "draw_bounds_type", PROP_ENUM, PROP_NONE);
864 RNA_def_property_enum_sdna(prop, NULL, "boundtype");
865 RNA_def_property_enum_items(prop, boundtype_items);
866 RNA_def_property_ui_text(prop, "Draw Bounds Type", "Object boundary display type.");
867 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
869 prop= RNA_def_property(srna, "draw_name", PROP_BOOLEAN, PROP_NONE);
870 RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWNAME);
871 RNA_def_property_ui_text(prop, "Draw Name", "Displays the object's name.");
872 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
874 prop= RNA_def_property(srna, "draw_axis", PROP_BOOLEAN, PROP_NONE);
875 RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_AXIS);
876 RNA_def_property_ui_text(prop, "Draw Axis", "Displays the object's center and axis");
877 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
879 prop= RNA_def_property(srna, "draw_texture_space", PROP_BOOLEAN, PROP_NONE);
880 RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_TEXSPACE);
881 RNA_def_property_ui_text(prop, "Draw Texture Space", "Displays the object's texture space.");
882 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
884 prop= RNA_def_property(srna, "draw_wire", PROP_BOOLEAN, PROP_NONE);
885 RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWWIRE);
886 RNA_def_property_ui_text(prop, "Draw Wire", "Adds the object's wireframe over solid drawing.");
887 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
889 prop= RNA_def_property(srna, "draw_transparent", PROP_BOOLEAN, PROP_NONE);
890 RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWTRANSP);
891 RNA_def_property_ui_text(prop, "Draw Transparent", "Enables transparent materials for the object (Mesh only).");
892 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
894 prop= RNA_def_property(srna, "x_ray", PROP_BOOLEAN, PROP_NONE);
895 RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWXRAY);
896 RNA_def_property_ui_text(prop, "X-Ray", "Makes the object draw in front of others.");
897 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
900 prop= RNA_def_property(srna, "pose_library", PROP_POINTER, PROP_NONE);
901 RNA_def_property_pointer_sdna(prop, NULL, "poselib");
902 RNA_def_property_struct_type(prop, "Action");
903 RNA_def_property_ui_text(prop, "Pose Library", "Action used as a pose library for armatures.");
905 prop= RNA_def_property(srna, "pose", PROP_POINTER, PROP_NONE);
906 RNA_def_property_pointer_sdna(prop, NULL, "pose");
907 RNA_def_property_struct_type(prop, "Pose");
908 RNA_def_property_ui_text(prop, "Pose", "Current pose for armatures.");
910 prop= RNA_def_property(srna, "pose_mode", PROP_BOOLEAN, PROP_NONE);
911 RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_POSEMODE);
912 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
913 RNA_def_property_ui_text(prop, "Pose Mode", "Object with armature data is in pose mode.");
915 // XXX this stuff should be moved to AnimData...
917 prop= RNA_def_property(srna, "nla_disable_path", PROP_BOOLEAN, PROP_NONE);
918 RNA_def_property_boolean_sdna(prop, NULL, "nlaflag", OB_DISABLE_PATH);
919 RNA_def_property_ui_text(prop, "NLA Disable Path", "Disable path temporally, for editing cycles.");
921 prop= RNA_def_property(srna, "nla_collapsed", PROP_BOOLEAN, PROP_NONE);
922 RNA_def_property_boolean_sdna(prop, NULL, "nlaflag", OB_NLA_COLLAPSED);
923 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
924 RNA_def_property_ui_text(prop, "NLA Collapsed", "");
926 prop= RNA_def_property(srna, "nla_override", PROP_BOOLEAN, PROP_NONE);
927 RNA_def_property_boolean_sdna(prop, NULL, "nlaflag", OB_NLA_OVERRIDE);
928 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
929 RNA_def_property_ui_text(prop, "NLA Override", "");
931 prop= RNA_def_property(srna, "nla_strips", PROP_COLLECTION, PROP_NONE);
932 RNA_def_property_collection_sdna(prop, NULL, "nlastrips", NULL);
933 RNA_def_property_struct_type(prop, "UnknownType");
934 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
935 RNA_def_property_ui_text(prop, "NLA Strips", "NLA strips of the object.");
940 prop= RNA_def_property(srna, "shape_key_lock", PROP_BOOLEAN, PROP_NONE);
941 RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_LOCK);
942 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
943 RNA_def_property_ui_text(prop, "Shape Key Lock", "Always show the current Shape for this Object.");
945 prop= RNA_def_property(srna, "active_shape_key", PROP_INT, PROP_NONE);
946 RNA_def_property_int_sdna(prop, NULL, "shapenr");
947 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
948 RNA_def_property_ui_text(prop, "Active Shape Key", "Current shape key index.");
953 void RNA_def_object(BlenderRNA *brna)
955 rna_def_object(brna);
956 rna_def_object_game_settings(brna);
957 rna_def_vertex_group(brna);