diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_object.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 575 |
1 files changed, 381 insertions, 194 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index a0c638b484b..45407a8e375 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -33,6 +33,7 @@ #include "DNA_action_types.h" #include "DNA_customdata_types.h" +#include "DNA_controller_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" #include "DNA_object_force.h" @@ -40,6 +41,9 @@ #include "DNA_property_types.h" #include "DNA_scene_types.h" +#include "BLO_sys_types.h" /* needed for intptr_t used in ED_mesh.h */ +#include "ED_mesh.h" + #include "WM_api.h" #include "WM_types.h" @@ -121,25 +125,61 @@ EnumPropertyItem object_type_curve_items[] = { #include "BKE_mesh.h" #include "BKE_particle.h" #include "BKE_scene.h" +#include "BKE_deform.h" #include "BLI_editVert.h" /* for EditMesh->mat_nr */ #include "ED_mesh.h" #include "ED_object.h" #include "ED_particle.h" +#include "ED_curve.h" +#include "ED_lattice.h" -void rna_Object_update(Main *bmain, Scene *scene, PointerRNA *ptr) +static void rna_Object_internal_update(Main *bmain, Scene *scene, PointerRNA *ptr) { DAG_id_flush_update(ptr->id.data, OB_RECALC_OB); } -void rna_Object_matrix_update(Main *bmain, Scene *scene, PointerRNA *ptr) +static void rna_Object_matrix_world_update(Main *bmain, Scene *scene, PointerRNA *ptr) { object_apply_mat4(ptr->id.data, ((Object *)ptr->id.data)->obmat); - rna_Object_update(bmain, scene, ptr); + rna_Object_internal_update(bmain, scene, ptr); +} + +static void rna_Object_matrix_local_get(PointerRNA *ptr, float values[16]) +{ + Object *ob= ptr->id.data; + + if(ob->parent) { + float invmat[4][4]; /* for inverse of parent's matrix */ + invert_m4_m4(invmat, ob->parent->obmat); + mul_m4_m4m4((float(*)[4])values, ob->obmat, invmat); + } + else { + copy_m4_m4((float(*)[4])values, ob->obmat); + } +} + +static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16]) +{ + Object *ob= ptr->id.data; + + /* localspace matrix is truly relative to the parent, but parameters + * stored in object are relative to parentinv matrix. Undo the parent + * inverse part before updating obmat and calling apply_obmat() */ + if(ob->parent) { + float invmat[4][4]; + invert_m4_m4(invmat, ob->parentinv); + mul_m4_m4m4(ob->obmat, (float(*)[4])values, invmat); + } + else { + copy_m4_m4(ob->obmat, (float(*)[4])values); + } + + object_apply_mat4(ob, ob->obmat); } -void rna_Object_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) +void rna_Object_internal_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) { DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA); WM_main_add_notifier(NC_OBJECT|ND_DRAW, ptr->id.data); @@ -148,21 +188,33 @@ void rna_Object_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) void rna_Object_active_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr) { Object *ob= ptr->id.data; - int editmode= (scene->obedit == ob && ob->type == OB_MESH); - if(editmode) { + if(scene->obedit == ob) { /* exit/enter editmode to get new shape */ - load_editMesh(scene, ob); - make_editMesh(scene, ob); + switch(ob->type) { + case OB_MESH: + load_editMesh(scene, ob); + make_editMesh(scene, ob); + break; + case OB_CURVE: + case OB_SURF: + load_editNurb(ob); + make_editNurb(ob); + break; + case OB_LATTICE: + load_editLatt(ob); + make_editLatt(ob); + break; + } } - rna_Object_update_data(bmain, scene, ptr); + rna_Object_internal_update_data(bmain, scene, ptr); } static void rna_Object_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr) { DAG_id_flush_update(ptr->id.data, OB_RECALC_OB); - DAG_scene_sort(scene); + DAG_scene_sort(bmain, scene); } /* when changing the selection flag the scene needs updating */ @@ -180,7 +232,7 @@ static void rna_Base_select_update(Main *bmain, Scene *scene, PointerRNA *ptr) ED_base_object_select(base, mode); } -static void rna_Object_layer_update__internal(Scene *scene, Base *base, Object *ob) +static void rna_Object_layer_update__internal(Main *bmain, Scene *scene, Base *base, Object *ob) { /* try to avoid scene sort */ if((ob->lay & scene->lay) && (base->lay & scene->lay)) { @@ -188,7 +240,7 @@ static void rna_Object_layer_update__internal(Scene *scene, Base *base, Object * } else if((ob->lay & scene->lay)==0 && (base->lay & scene->lay)==0) { /* pass */ } else { - DAG_scene_sort(scene); + DAG_scene_sort(bmain, scene); } } @@ -203,16 +255,16 @@ static void rna_Object_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr) SWAP(int, base->lay, ob->lay); - rna_Object_layer_update__internal(scene, base, ob); + rna_Object_layer_update__internal(bmain, scene, base, ob); ob->lay= base->lay; } static void rna_Base_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - Base *base= (Base*)ptr->id.data; + Base *base= (Base*)ptr->data; Object *ob= (Object*)base->object; - rna_Object_layer_update__internal(scene, base, ob); + rna_Object_layer_update__internal(bmain, scene, base, ob); ob->lay= base->lay; } @@ -400,32 +452,19 @@ int rna_object_vgroup_name_index_length(PointerRNA *ptr, int index) void rna_object_vgroup_name_index_set(PointerRNA *ptr, const char *value, short *index) { Object *ob= (Object*)ptr->id.data; - bDeformGroup *dg; - int a; - - for(a=1, dg=ob->defbase.first; dg; dg=dg->next, a++) { - if(strcmp(dg->name, value) == 0) { - *index= a; - return; - } - } - - *index= 0; + *index= defgroup_name_index(ob, value) + 1; } void rna_object_vgroup_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen) { Object *ob= (Object*)ptr->id.data; - bDeformGroup *dg; - - for(dg=ob->defbase.first; dg; dg=dg->next) { - if(strcmp(dg->name, value) == 0) { - BLI_strncpy(result, value, maxlen); - return; - } + bDeformGroup *dg= defgroup_find_name(ob, value); + if(dg) { + BLI_strncpy(result, value, maxlen); + return; } - BLI_strncpy(result, "", maxlen); + result[0]= '\0'; } void rna_object_uvlayer_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen) @@ -858,25 +897,52 @@ static void rna_Base_layer_set(PointerRNA *ptr, const int *values) /* rna_Base_layer_update updates the objects layer */ } +static void rna_GameObjectSettings_state_get(PointerRNA *ptr, int *values) +{ + Object *ob= (Object*)ptr->data; + int i; + int all_states = (ob->scaflag & OB_ALLSTATE?1:0); + + memset(values, 0, sizeof(int)*OB_MAX_STATES); + for(i=0; i<OB_MAX_STATES; i++) + values[i] = (ob->state & (1<<i)) | all_states; +} + static void rna_GameObjectSettings_state_set(PointerRNA *ptr, const int *values) { Object *ob= (Object*)ptr->data; int i, tot= 0; /* ensure we always have some state selected */ - for(i=0; i<20; i++) + for(i=0; i<OB_MAX_STATES; i++) if(values[i]) tot++; if(tot==0) return; - for(i=0; i<20; i++) { + for(i=0; i<OB_MAX_STATES; i++) { if(values[i]) ob->state |= (1<<i); else ob->state &= ~(1<<i); } } +static void rna_GameObjectSettings_used_state_get(PointerRNA *ptr, int *values) +{ + Object *ob= (Object*)ptr->data; + bController *cont; + + memset(values, 0, sizeof(int)*OB_MAX_STATES); + for (cont=ob->controllers.first; cont; cont=cont->next) { + int i; + + for (i=0; i<OB_MAX_STATES; i++) { + if (cont->state_mask & (1<<i)) + values[i] = 1; + } + } +} + static void rna_Object_active_shape_key_index_range(PointerRNA *ptr, int *min, int *max) { Object *ob= (Object*)ptr->id.data; @@ -951,31 +1017,32 @@ static void rna_Object_active_constraint_set(PointerRNA *ptr, PointerRNA value) constraints_set_active(&ob->constraints, (bConstraint *)value.data); } -static bConstraint *rna_Object_constraint_new(Object *object, bContext *C, int type) +static bConstraint *rna_Object_constraints_new(Object *object, int type) { WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object); return add_ob_constraint(object, NULL, type); } -static int rna_Object_constraint_remove(Object *object, bContext *C, int index) +static void rna_Object_constraints_remove(Object *object, ReportList *reports, bConstraint *con) { - int ok = remove_constraint_index(&object->constraints, index); - if(ok) { - ED_object_constraint_set_active(object, NULL); - WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT, object); + if(BLI_findindex(&object->constraints, con) == -1) { + BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in object '%s'.", con->name, object->id.name+2); + return; } - return ok; + remove_constraint(&object->constraints, con); + ED_object_constraint_set_active(object, NULL); + WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT, object); } static ModifierData *rna_Object_modifier_new(Object *object, bContext *C, ReportList *reports, char *name, int type) { - return ED_object_modifier_add(reports, CTX_data_scene(C), object, name, type); + return ED_object_modifier_add(reports, CTX_data_main(C), CTX_data_scene(C), object, name, type); } static void rna_Object_modifier_remove(Object *object, bContext *C, ReportList *reports, ModifierData *md) { - ED_object_modifier_remove(reports, CTX_data_scene(C), object, md); + ED_object_modifier_remove(reports, CTX_data_main(C), CTX_data_scene(C), object, md); } static void rna_Object_boundbox_get(PointerRNA *ptr, float *values) @@ -991,6 +1058,38 @@ static void rna_Object_boundbox_get(PointerRNA *ptr, float *values) } +static void rna_Object_add_vertex_to_group(Object *ob, int vertex_index, bDeformGroup *def, float weight, int assignmode) +{ + /* creates dverts if needed */ + ED_vgroup_vert_add(ob, def, vertex_index, weight, assignmode); +} + +/* generic poll functions */ +int rna_Lattice_object_poll(PointerRNA *ptr, PointerRNA value) +{ + return ((Object *)value.id.data)->type == OB_LATTICE; +} + +int rna_Curve_object_poll(PointerRNA *ptr, PointerRNA value) +{ + return ((Object *)value.id.data)->type == OB_CURVE; +} + +int rna_Armature_object_poll(PointerRNA *ptr, PointerRNA value) +{ + return ((Object *)value.id.data)->type == OB_ARMATURE; +} + +int rna_Mesh_object_poll(PointerRNA *ptr, PointerRNA value) +{ + return ((Object *)value.id.data)->type == OB_MESH; +} + +int rna_Camera_object_poll(PointerRNA *ptr, PointerRNA value) +{ + return ((Object *)value.id.data)->type == OB_CAMERA; +} + #else static void rna_def_vertex_group(BlenderRNA *brna) @@ -1035,15 +1134,15 @@ static void rna_def_material_slot(BlenderRNA *brna) prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Material"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_pointer_funcs(prop, "rna_MaterialSlot_material_get", "rna_MaterialSlot_material_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_MaterialSlot_material_get", "rna_MaterialSlot_material_set", NULL, NULL); RNA_def_property_ui_text(prop, "Material", "Material datablock used by this material slot"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); prop= RNA_def_property(srna, "link", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, link_items); RNA_def_property_enum_funcs(prop, "rna_MaterialSlot_link_get", "rna_MaterialSlot_link_set", NULL); RNA_def_property_ui_text(prop, "Link", "Link material to object or the object's data"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_MaterialSlot_name_get", "rna_MaterialSlot_name_length", NULL); @@ -1111,12 +1210,13 @@ static void rna_def_object_game_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, body_type_items); RNA_def_property_enum_funcs(prop, "rna_GameObjectSettings_physics_type_get", "rna_GameObjectSettings_physics_type_set", NULL); RNA_def_property_ui_text(prop, "Physics Type", "Selects the type of physical representation"); + RNA_def_property_update(prop, NC_LOGIC, NULL); - prop= RNA_def_property(srna, "actor", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_actor", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ACTOR); RNA_def_property_ui_text(prop, "Actor", "Object is detected by the Near and Radar sensor"); - prop= RNA_def_property(srna, "ghost", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_ghost", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_GHOST); RNA_def_property_ui_text(prop, "Ghost", "Object does not restitute collisions, like a ghost"); @@ -1130,7 +1230,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Radius", "Radius of bounding sphere and material physics"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); - prop= RNA_def_property(srna, "no_sleeping", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_sleep", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_COLLISION_RESPONSE); RNA_def_property_ui_text(prop, "No Sleeping", "Disable auto (de)activation in physics simulation"); @@ -1144,40 +1244,40 @@ static void rna_def_object_game_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Rotation Damping", "General rotation damping"); - prop= RNA_def_property(srna, "minimum_velocity", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "velocity_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "min_vel"); RNA_def_property_range(prop, 0.0, 1000.0); RNA_def_property_ui_text(prop, "Velocity Min", "Clamp velocity to this minimum speed (except when totally still)"); - prop= RNA_def_property(srna, "maximum_velocity", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max_vel"); RNA_def_property_range(prop, 0.0, 1000.0); RNA_def_property_ui_text(prop, "Velocity Max", "Clamp velocity to this maximum speed"); /* lock position */ - prop= RNA_def_property(srna, "lock_x_axis", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "lock_location_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_X_AXIS); RNA_def_property_ui_text(prop, "Lock X Axis", "Disable simulation of linear motion along the X axis"); - prop= RNA_def_property(srna, "lock_y_axis", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "lock_location_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Y_AXIS); RNA_def_property_ui_text(prop, "Lock Y Axis", "Disable simulation of linear motion along the Y axis"); - prop= RNA_def_property(srna, "lock_z_axis", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "lock_location_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Z_AXIS); RNA_def_property_ui_text(prop, "Lock Z Axis", "Disable simulation of linear motion along the Z axis"); /* lock rotation */ - prop= RNA_def_property(srna, "lock_x_rot_axis", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "lock_rotation_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_X_ROT_AXIS); RNA_def_property_ui_text(prop, "Lock X Rotation Axis", "Disable simulation of angular motion along the X axis"); - prop= RNA_def_property(srna, "lock_y_rot_axis", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "lock_rotation_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Y_ROT_AXIS); RNA_def_property_ui_text(prop, "Lock Y Rotation Axis", "Disable simulation of angular motion along the Y axis"); - prop= RNA_def_property(srna, "lock_z_rot_axis", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "lock_rotation_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Z_ROT_AXIS); RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis"); @@ -1187,11 +1287,11 @@ static void rna_def_object_game_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis"); - prop= RNA_def_property(srna, "material_physics", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_material_physics", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_DO_FH); RNA_def_property_ui_text(prop, "Use Material Physics", "Use physics settings in materials"); - prop= RNA_def_property(srna, "rotate_from_normal", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_rotate_from_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ROT_FH); RNA_def_property_ui_text(prop, "Rotate From Normal", "Use face normal to rotate object, so that it points away from the surface"); @@ -1200,7 +1300,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Form Factor", "Form factor scales the inertia tensor"); - prop= RNA_def_property(srna, "anisotropic_friction", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_anisotropic_friction", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ANISOTROPIC_FRICTION); RNA_def_property_ui_text(prop, "Anisotropic Friction", "Enable anisotropic friction"); @@ -1213,16 +1313,16 @@ static void rna_def_object_game_settings(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_BOUNDS); RNA_def_property_ui_text(prop, "Use Collision Bounds", "Specify a collision bounds type other than the default"); - prop= RNA_def_property(srna, "collision_bounds", PROP_ENUM, PROP_NONE); + prop= RNA_def_property(srna, "collision_bounds_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "boundtype"); RNA_def_property_enum_items(prop, collision_bounds_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Object_collision_bounds_itemf"); RNA_def_property_ui_text(prop, "Collision Bounds", "Selects the collision type"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); - prop= RNA_def_property(srna, "collision_compound", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_collision_compound", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_CHILD); - RNA_def_property_ui_text(prop, "Collison Compound", "Add children to form a compound collision object"); + RNA_def_property_ui_text(prop, "Collision Compound", "Add children to form a compound collision object"); prop= RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH); RNA_def_property_float_sdna(prop, NULL, "margin"); @@ -1235,20 +1335,36 @@ static void rna_def_object_game_settings(BlenderRNA *brna) /* state */ - prop= RNA_def_property(srna, "state", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "states_visible", PROP_BOOLEAN, PROP_LAYER_MEMBER); RNA_def_property_boolean_sdna(prop, NULL, "state", 1); - RNA_def_property_array(prop, 30); + RNA_def_property_array(prop, OB_MAX_STATES); RNA_def_property_ui_text(prop, "State", "State determining which controllers are displayed"); - RNA_def_property_boolean_funcs(prop, NULL, "rna_GameObjectSettings_state_set"); + RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_state_get", "rna_GameObjectSettings_state_set"); - prop= RNA_def_property(srna, "initial_state", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "used_states", PROP_BOOLEAN, PROP_LAYER_MEMBER); + RNA_def_property_array(prop, OB_MAX_STATES); + RNA_def_property_ui_text(prop, "Used State", "States which are being used by controllers"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_used_state_get", NULL); + + prop= RNA_def_property(srna, "states_initial", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "init_state", 1); - RNA_def_property_array(prop, 30); + RNA_def_property_array(prop, OB_MAX_STATES); RNA_def_property_ui_text(prop, "Initial State", "Initial state when the game starts"); - prop= RNA_def_property(srna, "debug_state", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "show_debug_state", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_DEBUGSTATE); RNA_def_property_ui_text(prop, "Debug State", "Print state debug info in the game engine"); + RNA_def_property_ui_icon(prop, ICON_INFO, 0); + + prop= RNA_def_property(srna, "use_all_states", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_ALLSTATE); + RNA_def_property_ui_text(prop, "All", "Set all state bits"); + + prop= RNA_def_property(srna, "show_state_panel", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWSTATE); + RNA_def_property_ui_text(prop, "States", "Show state panel"); + RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1); } static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop) @@ -1268,34 +1384,30 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop) /* Collection active property */ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Constraint"); - RNA_def_property_pointer_funcs(prop, "rna_Object_active_constraint_get", "rna_Object_active_constraint_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Object_active_constraint_get", "rna_Object_active_constraint_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Constraint", "Active Object constraint"); /* Constraint collection */ - func= RNA_def_function(srna, "new", "rna_Object_constraint_new"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT); + func= RNA_def_function(srna, "new", "rna_Object_constraints_new"); RNA_def_function_ui_description(func, "Add a new constraint to this object"); - /* return type */ - parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint."); - RNA_def_function_return(func, parm); /* object to add */ parm= RNA_def_enum(func, "type", constraint_type_items, 1, "", "Constraint type to add."); RNA_def_property_flag(parm, PROP_REQUIRED); - - func= RNA_def_function(srna, "remove", "rna_Object_constraint_remove"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT); - RNA_def_function_ui_description(func, "Remove a constraint from this object."); /* return type */ - parm= RNA_def_boolean(func, "success", 0, "Success", "Removed the constraint successfully."); + parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint."); RNA_def_function_return(func, parm); - /* object to add */ - parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "", 0, INT_MAX); - RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "remove", "rna_Object_constraints_remove"); + RNA_def_function_ui_description(func, "Remove a constraint from this object."); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + /* constraint to remove */ + parm= RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint."); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } -/* armature.bones.* */ +/* object.modifiers */ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; @@ -1315,7 +1427,7 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active EditBone", "Armatures active edit bone"); //RNA_def_property_update(prop, 0, "rna_Armature_act_editbone_update"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_edit_bone_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_edit_bone_set", NULL, NULL); /* todo, redraw */ // RNA_def_property_collection_active(prop, prop_act); @@ -1324,7 +1436,7 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop) /* add target */ func= RNA_def_function(srna, "new", "rna_Object_modifier_new"); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Add a new bone."); + RNA_def_function_ui_description(func, "Add a new modifier."); parm= RNA_def_string(func, "name", "Name", 0, "", "New name for the bone."); RNA_def_property_flag(parm, PROP_REQUIRED); /* modifier to add */ @@ -1340,9 +1452,92 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Remove an existing modifier from the object."); /* target to remove*/ parm= RNA_def_pointer(func, "modifier", "Modifier", "", "Modifier to remove."); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); +} + +/* object.particle_systems */ +static void rna_def_object_particle_systems(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + + PropertyRNA *prop; + + // FunctionRNA *func; + // PropertyRNA *parm; + + RNA_def_property_srna(cprop, "ParticleSystems"); + srna= RNA_def_struct(brna, "ParticleSystems", NULL); + RNA_def_struct_sdna(srna, "Object"); + RNA_def_struct_ui_text(srna, "Particle Systems", "Collection of particle systems"); + + prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "ParticleSystem"); + RNA_def_property_pointer_funcs(prop, "rna_Object_active_particle_system_get", NULL, NULL, NULL); + RNA_def_property_ui_text(prop, "Active Particle System", "Active particle system being displayed"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + + prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_funcs(prop, "rna_Object_active_particle_system_index_get", "rna_Object_active_particle_system_index_set", "rna_Object_active_particle_system_index_range"); + RNA_def_property_ui_text(prop, "Active Particle System Index", "Index of active particle system slot"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_particle_update"); +} + + +/* object.vertex_groups */ +static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop) +{ + static EnumPropertyItem assign_mode_items[] = { + {WEIGHT_REPLACE, "REPLACE", 0, "Replace", "Replace"}, + {WEIGHT_ADD, "ADD", 0, "Add", "Add"}, + {WEIGHT_SUBTRACT, "SUBTRACT", 0, "Subtract", "Subtract"}, + {0, NULL, 0, NULL, NULL} + }; + + StructRNA *srna; + + PropertyRNA *prop; + + FunctionRNA *func; + PropertyRNA *parm; + + RNA_def_property_srna(cprop, "VertexGroups"); + srna= RNA_def_struct(brna, "VertexGroups", NULL); + RNA_def_struct_sdna(srna, "Object"); + RNA_def_struct_ui_text(srna, "Vertex Groups", "Collection of vertex groups"); + + prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "VertexGroup"); + RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", "rna_Object_active_vertex_group_set", NULL, NULL); + RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object"); + RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_internal_update_data"); + + prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "actdef"); + RNA_def_property_int_funcs(prop, "rna_Object_active_vertex_group_index_get", "rna_Object_active_vertex_group_index_set", "rna_Object_active_vertex_group_index_range"); + RNA_def_property_ui_text(prop, "Active Vertex Group Index", "Active index in vertex group array"); + RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_internal_update_data"); + + /* vertex groups */ // add_vertex_group + func= RNA_def_function(srna, "new", "ED_vgroup_add_name"); + RNA_def_function_ui_description(func, "Add vertex group to object."); + parm= RNA_def_string(func, "name", "Group", 0, "", "Vertex group name."); /* optional */ + parm= RNA_def_pointer(func, "group", "VertexGroup", "", "New vertex group."); + RNA_def_function_return(func, parm); + + // XXX, this will be very slow, bad API design! :S + func= RNA_def_function(srna, "assign", "rna_Object_add_vertex_to_group"); + RNA_def_function_ui_description(func, "Add vertex to a vertex group."); + parm= RNA_def_int(func, "index", 0, 0, 0, "", "Vertex index.", 0, 0); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "group", "VertexGroup", "", "Vertex group to add vertex to."); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight.", 0.0f, 1.0f); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_enum(func, "type", assign_mode_items, 0, "", "Vertex assign mode."); RNA_def_property_flag(parm, PROP_REQUIRED); } + static void rna_def_object(BlenderRNA *brna) { StructRNA *srna; @@ -1357,7 +1552,6 @@ static void rna_def_object(BlenderRNA *brna) {OB_MBALL, "META", 0, "Meta", ""}, {OB_LAMP, "LAMP", 0, "Lamp", ""}, {OB_CAMERA, "CAMERA", 0, "Camera", ""}, - {OB_WAVE, "WAVE", 0, "Wave", ""}, {OB_LATTICE, "LATTICE", 0, "Lattice", ""}, {OB_ARMATURE, "ARMATURE", 0, "Armature", ""}, {0, NULL, 0, NULL, NULL}}; @@ -1400,7 +1594,7 @@ static void rna_def_object(BlenderRNA *brna) {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""}, {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", ""}, {OB_BOUND_CONE, "CONE", 0, "Cone", ""}, - {OB_BOUND_POLYH, "POLYHEDER", 0, "Polyheder", ""}, + {OB_BOUND_POLYH, "POLYHEDRON", 0, "Polyhedron", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem dupli_items[] = { @@ -1436,11 +1630,11 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ID"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_data_set", "rna_Object_data_typef"); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_data_set", "rna_Object_data_typef", NULL); RNA_def_property_editable_func(prop, "rna_Object_data_editable"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Data", "Object data"); - RNA_def_property_update(prop, 0, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_Object_internal_update_data"); prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); @@ -1462,9 +1656,9 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_layer_update"); - prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT); - RNA_def_property_ui_text(prop, "Selected", "Object selection state"); + RNA_def_property_ui_text(prop, "Select", "Object selection state"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_select_update"); /* for data access */ @@ -1472,11 +1666,11 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_multi_array(prop, 2, boundbox_dimsize); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_float_funcs(prop, "rna_Object_boundbox_get", NULL, NULL); - RNA_def_property_ui_text(prop, "Bound Box", "Objects bound box in object-space coords"); + RNA_def_property_ui_text(prop, "Bound Box", "Objects bound box in object-space coordinates"); /* parent */ prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_parent_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_parent_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_ui_text(prop, "Parent", "Parent Object"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update"); @@ -1493,7 +1687,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Parent Vertices", "Indices of vertices in cases of a vertex parenting relation"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); prop= RNA_def_property(srna, "parent_bone", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "parsubstr"); @@ -1507,13 +1701,13 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "trackflag"); RNA_def_property_enum_items(prop, track_items); RNA_def_property_ui_text(prop, "Track Axis", "Axis that points in 'forward' direction"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); prop= RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "upflag"); RNA_def_property_enum_items(prop, up_items); RNA_def_property_ui_text(prop, "Up Axis", "Axis that points in the upward direction"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); /* proxy */ prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE); @@ -1531,10 +1725,10 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "active_material", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Material"); - RNA_def_property_pointer_funcs(prop, "rna_Object_active_material_get", "rna_Object_active_material_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Object_active_material_get", "rna_Object_active_material_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Material", "Active material being displayed"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); prop= RNA_def_property(srna, "active_material_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "actcol"); @@ -1547,14 +1741,14 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "loc"); RNA_def_property_editable_array_func(prop, "rna_Object_location_editable"); RNA_def_property_ui_text(prop, "Location", "Location of the object"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); prop= RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION); RNA_def_property_float_sdna(prop, NULL, "quat"); RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable"); RNA_def_property_float_array_default(prop, default_quat); RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); /* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but * having a single one is better for Keyframing and other property-management situations... @@ -1565,81 +1759,84 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable"); RNA_def_property_float_array_default(prop, default_axisAngle); RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); prop= RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER); RNA_def_property_float_sdna(prop, NULL, "rot"); RNA_def_property_editable_array_func(prop, "rna_Object_rotation_euler_editable"); RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rotmode"); RNA_def_property_enum_items(prop, prop_rotmode_items); // XXX move to using a single define of this someday RNA_def_property_enum_funcs(prop, NULL, "rna_Object_rotation_mode_set", NULL); RNA_def_property_ui_text(prop, "Rotation Mode", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_editable_array_func(prop, "rna_Object_scale_editable"); RNA_def_property_float_array_default(prop, default_scale); RNA_def_property_ui_text(prop, "Scale", "Scaling of the object"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); - prop= RNA_def_property(srna, "dimensions", PROP_FLOAT, PROP_XYZ|PROP_UNIT_LENGTH); + prop= RNA_def_property(srna, "dimensions", PROP_FLOAT, PROP_XYZ_LENGTH); RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_Object_dimensions_get", "rna_Object_dimensions_set", NULL); RNA_def_property_ui_text(prop, "Dimensions", "Absolute bounding box dimensions of the object"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); /* delta transforms */ prop= RNA_def_property(srna, "delta_location", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "dloc"); RNA_def_property_ui_text(prop, "Delta Location", "Extra translation added to the location of the object"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); prop= RNA_def_property(srna, "delta_rotation_euler", PROP_FLOAT, PROP_EULER); RNA_def_property_float_sdna(prop, NULL, "drot"); RNA_def_property_ui_text(prop, "Delta Rotation (Euler)", "Extra rotation added to the rotation of the object (when using Euler rotations)"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); prop= RNA_def_property(srna, "delta_rotation_quaternion", PROP_FLOAT, PROP_QUATERNION); RNA_def_property_float_sdna(prop, NULL, "dquat"); RNA_def_property_float_array_default(prop, default_quat); RNA_def_property_ui_text(prop, "Delta Rotation (Quaternion)", "Extra rotation added to the rotation of the object (when using Quaternion rotations)"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); #if 0 // XXX not supported well yet... prop= RNA_def_property(srna, "delta_rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE); RNA_def_property_float_sdna(prop, NULL, "dquat"); // FIXME: this is not a single field any more! (drotAxis and drotAngle) RNA_def_property_float_array_default(prop, default_axisAngle); RNA_def_property_ui_text(prop, "Delta Rotation (Axis Angle)", "Extra rotation added to the rotation of the object (when using Axis-Angle rotations)"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); #endif prop= RNA_def_property(srna, "delta_scale", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "dsize"); RNA_def_property_ui_text(prop, "Delta Scale", "Extra scaling added to the scale of the object"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); /* transform locks */ prop= RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_XYZ); RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_LOCX); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Lock Location", "Lock editing of location in the interface"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_XYZ); RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTX); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Lock Rotation", "Lock editing of rotation in the interface"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); // XXX this is sub-optimal - it really should be included above, but due to technical reasons we can't do this! prop= RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTW); + RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); RNA_def_property_ui_text(prop, "Lock Rotation (4D Angle)", "Lock editing of 'angle' component of four-component rotations in the interface"); // XXX this needs a better name prop= RNA_def_property(srna, "lock_rotations_4d", PROP_BOOLEAN, PROP_NONE); @@ -1650,14 +1847,21 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_SCALEX); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Lock Scale", "Lock editing of scale in the interface"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); /* matrix */ - prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX); + prop= RNA_def_property(srna, "matrix_world", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "obmat"); RNA_def_property_multi_array(prop, 2, matrix_dimsize); - RNA_def_property_ui_text(prop, "Matrix", "Transformation matrix"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_matrix_update"); + RNA_def_property_ui_text(prop, "Matrix World", "Worldspace transformation matrix"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_matrix_world_update"); + + prop= RNA_def_property(srna, "matrix_local", PROP_FLOAT, PROP_MATRIX); + RNA_def_property_multi_array(prop, 2, matrix_dimsize); + RNA_def_property_ui_text(prop, "Local Matrix", "Parent relative transformation matrix"); + RNA_def_property_float_funcs(prop, "rna_Object_matrix_local_get", "rna_Object_matrix_local_set", NULL); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); /* collections */ prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE); @@ -1675,7 +1879,7 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "game", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "GameObjectSettings"); - RNA_def_property_pointer_funcs(prop, "rna_Object_game_settings_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Object_game_settings_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Game Settings", "Game engine related settings for the object"); /* vertex groups */ @@ -1683,18 +1887,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "defbase", NULL); RNA_def_property_struct_type(prop, "VertexGroup"); RNA_def_property_ui_text(prop, "Vertex Groups", "Vertex groups of the object"); - - prop= RNA_def_property(srna, "active_vertex_group", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "VertexGroup"); - RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", "rna_Object_active_vertex_group_set", NULL); - RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object"); - RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_update_data"); - - prop= RNA_def_property(srna, "active_vertex_group_index", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "actdef"); - RNA_def_property_int_funcs(prop, "rna_Object_active_vertex_group_index_get", "rna_Object_active_vertex_group_index_set", "rna_Object_active_vertex_group_index_range"); - RNA_def_property_ui_text(prop, "Active Vertex Group Index", "Active index in vertex group array"); - RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_update_data"); + rna_def_object_vertex_groups(brna, prop); /* empty */ prop= RNA_def_property(srna, "empty_draw_type", PROP_ENUM, PROP_NONE); @@ -1705,8 +1898,8 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "empty_draw_size", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "empty_drawsize"); - RNA_def_property_range(prop, 0.1f, 1000.0f); - RNA_def_property_ui_range(prop, 0.01, 100, 1, 1); + RNA_def_property_range(prop, 0.0001f, 1000.0f); + RNA_def_property_ui_range(prop, 0.01, 100, 1, 2); RNA_def_property_ui_text(prop, "Empty Display Size", "Size of display for empties in the viewport"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); @@ -1725,13 +1918,13 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "field", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "pd"); RNA_def_property_struct_type(prop, "FieldSettings"); - RNA_def_property_pointer_funcs(prop, "rna_Object_field_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Object_field_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Field Settings", "Settings for using the objects as a field in physics simulation"); prop= RNA_def_property(srna, "collision", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "pd"); RNA_def_property_struct_type(prop, "CollisionSettings"); - RNA_def_property_pointer_funcs(prop, "rna_Object_collision_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Object_collision_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Collision Settings", "Settings for using the objects as a collider in physics simulation"); prop= RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE); @@ -1743,32 +1936,25 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "particlesystem", NULL); RNA_def_property_struct_type(prop, "ParticleSystem"); RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object"); - - prop= RNA_def_property(srna, "active_particle_system", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "ParticleSystem"); - RNA_def_property_pointer_funcs(prop, "rna_Object_active_particle_system_get", NULL, NULL); - RNA_def_property_ui_text(prop, "Active Particle System", "Active particle system being displayed"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); - - prop= RNA_def_property(srna, "active_particle_system_index", PROP_INT, PROP_UNSIGNED); - RNA_def_property_int_funcs(prop, "rna_Object_active_particle_system_index_get", "rna_Object_active_particle_system_index_set", "rna_Object_active_particle_system_index_range"); - RNA_def_property_ui_text(prop, "Active Particle System Index", "Index of active particle system slot"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_particle_update"); + rna_def_object_particle_systems(brna, prop); /* restrict */ - prop= RNA_def_property(srna, "restrict_view", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_VIEW); RNA_def_property_ui_text(prop, "Restrict View", "Restrict visibility in the viewport"); + RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); - prop= RNA_def_property(srna, "restrict_select", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_SELECT); RNA_def_property_ui_text(prop, "Restrict Select", "Restrict selection in the viewport"); + RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 1); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); - prop= RNA_def_property(srna, "restrict_render", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "hide_render", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_RENDER); RNA_def_property_ui_text(prop, "Restrict Render", "Restrict renderability"); + RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); /* anim */ @@ -1779,10 +1965,10 @@ static void rna_def_object(BlenderRNA *brna) /* duplicates */ // XXX: evil old crap - prop= RNA_def_property(srna, "slow_parent", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_slow_parent", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "partype", PARSLOW); RNA_def_property_ui_text(prop, "Slow Parent", "Create a delay in the parent relationship"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); prop= RNA_def_property(srna, "dupli_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "transflag"); @@ -1793,9 +1979,9 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "use_dupli_frames_speed", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "transflag", OB_DUPLINOSPEED); RNA_def_property_ui_text(prop, "Dupli Frames Speed", "Set dupliframes to use the frame"); // TODO, better descriptio! - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); - prop= RNA_def_property(srna, "use_dupli_verts_rotation", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_dupli_vertices_rotation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIROT); RNA_def_property_ui_text(prop, "Dupli Verts Rotation", "Rotate dupli according to vertex normal"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); @@ -1803,7 +1989,7 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "use_dupli_faces_scale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIFACES_SCALE); RNA_def_property_ui_text(prop, "Dupli Faces Inherit Scale", "Scale dupli based on face size"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); prop= RNA_def_property(srna, "dupli_faces_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dupfacesca"); @@ -1821,67 +2007,71 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "dupsta"); RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Dupli Frames Start", "Start frame for DupliFrames"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); prop= RNA_def_property(srna, "dupli_frames_end", PROP_INT, PROP_NONE|PROP_UNIT_TIME); RNA_def_property_int_sdna(prop, NULL, "dupend"); RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Dupli Frames End", "End frame for DupliFrames"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); prop= RNA_def_property(srna, "dupli_frames_on", PROP_INT, PROP_NONE|PROP_UNIT_TIME); RNA_def_property_int_sdna(prop, NULL, "dupon"); RNA_def_property_range(prop, MINFRAME, MAXFRAME); RNA_def_property_ui_range(prop, 1, 1500, 1, 0); RNA_def_property_ui_text(prop, "Dupli Frames On", "Number of frames to use between DupOff frames"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); prop= RNA_def_property(srna, "dupli_frames_off", PROP_INT, PROP_NONE|PROP_UNIT_TIME); RNA_def_property_int_sdna(prop, NULL, "dupoff"); RNA_def_property_range(prop, 0, MAXFRAME); RNA_def_property_ui_range(prop, 0, 1500, 1, 0); RNA_def_property_ui_text(prop, "Dupli Frames Off", "Recurring frames to exclude from the Dupliframes"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); prop= RNA_def_property(srna, "dupli_list", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "duplilist", NULL); RNA_def_property_struct_type(prop, "DupliObject"); RNA_def_property_ui_text(prop, "Dupli list", "Object duplis"); + prop= RNA_def_property(srna, "is_duplicator", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLI); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + /* time offset */ prop= RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_NONE|PROP_UNIT_TIME); RNA_def_property_float_sdna(prop, NULL, "sf"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Time Offset", "Animation offset in frames for IPO's and dupligroup instances"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_ui_text(prop, "Time Offset", "Animation offset in frames for F-Curve and dupligroup instances"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); - prop= RNA_def_property(srna, "time_offset_edit", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_time_offset_edit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_OB); - RNA_def_property_ui_text(prop, "Time Offset Edit", "Use time offset when inserting keys and display time offset for IPO and action views"); + RNA_def_property_ui_text(prop, "Time Offset Edit", "Use time offset when inserting keys and display time offset for F-Curve and action views"); - prop= RNA_def_property(srna, "time_offset_parent", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_time_offset_parent", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARENT); RNA_def_property_ui_text(prop, "Time Offset Parent", "Apply the time offset to this objects parent relationship"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); - prop= RNA_def_property(srna, "time_offset_particle", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_time_offset_particle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARTICLE); RNA_def_property_ui_text(prop, "Time Offset Particle", "Let the time offset work on the particle effect"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); - prop= RNA_def_property(srna, "time_offset_add_parent", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_time_offset_add_parent", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARENTADD); RNA_def_property_ui_text(prop, "Time Offset Add Parent", "Add the parents time offset value"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); /* drawing */ - prop= RNA_def_property(srna, "max_draw_type", PROP_ENUM, PROP_NONE); + prop= RNA_def_property(srna, "draw_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "dt"); RNA_def_property_enum_items(prop, drawtype_items); RNA_def_property_ui_text(prop, "Maximum Draw Type", "Maximum draw type to display object with in viewport"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); - prop= RNA_def_property(srna, "draw_bounds", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "show_bounds", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_BOUNDBOX); RNA_def_property_ui_text(prop, "Draw Bounds", "Displays the object's bounds"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); @@ -1892,32 +2082,32 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Draw Bounds Type", "Object boundary display type"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); - prop= RNA_def_property(srna, "draw_name", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWNAME); RNA_def_property_ui_text(prop, "Draw Name", "Displays the object's name"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); - prop= RNA_def_property(srna, "draw_axis", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "show_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_AXIS); RNA_def_property_ui_text(prop, "Draw Axis", "Displays the object's origin and axis"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); - prop= RNA_def_property(srna, "draw_texture_space", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "show_texture_space", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_TEXSPACE); RNA_def_property_ui_text(prop, "Draw Texture Space", "Displays the object's texture space"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); - prop= RNA_def_property(srna, "draw_wire", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWWIRE); RNA_def_property_ui_text(prop, "Draw Wire", "Adds the object's wireframe over solid drawing"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); - prop= RNA_def_property(srna, "draw_transparent", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "show_transparent", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWTRANSP); RNA_def_property_ui_text(prop, "Draw Transparent", "Enables transparent materials for the object (Mesh only)"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); - prop= RNA_def_property(srna, "x_ray", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWXRAY); RNA_def_property_ui_text(prop, "X-Ray", "Makes the object draw in front of others"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); @@ -1941,21 +2131,21 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Pose", "Current pose for armatures"); /* shape keys */ - prop= RNA_def_property(srna, "shape_key_lock", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "show_shape_key", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_LOCK); RNA_def_property_ui_text(prop, "Shape Key Lock", "Always show the current Shape for this Object"); RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1); - RNA_def_property_update(prop, 0, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_Object_internal_update_data"); - prop= RNA_def_property(srna, "shape_key_edit_mode", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_shape_key_edit_mode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_EDIT_MODE); RNA_def_property_ui_text(prop, "Shape Key Edit Mode", "Apply shape keys in edit mode (for Meshes only)"); RNA_def_property_ui_icon(prop, ICON_EDITMODE_HLT, 0); - RNA_def_property_update(prop, 0, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_Object_internal_update_data"); prop= RNA_def_property(srna, "active_shape_key", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ShapeKey"); - RNA_def_property_pointer_funcs(prop, "rna_Object_active_shape_key_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Object_active_shape_key_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Active Shape Key", "Current shape key"); prop= RNA_def_property(srna, "active_shape_key_index", PROP_INT, PROP_NONE); @@ -1980,13 +2170,13 @@ static void rna_def_dupli_object(BlenderRNA *brna) prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ob"); - /* RNA_def_property_pointer_funcs(prop, "rna_DupliObject_object_get", NULL, NULL); */ + /* RNA_def_property_pointer_funcs(prop, "rna_DupliObject_object_get", NULL, NULL, NULL); */ RNA_def_property_ui_text(prop, "Object", "Object being duplicated"); - prop= RNA_def_property(srna, "object_matrix", PROP_FLOAT, PROP_MATRIX); + prop= RNA_def_property(srna, "matrix_original", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "omat"); RNA_def_property_array(prop, 16); - RNA_def_property_ui_text(prop, "Object Matrix", "Duplicated object transformation matrix"); + RNA_def_property_ui_text(prop, "Object Matrix", "The original matrix of this object before it was duplicated"); prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "mat"); @@ -1996,7 +2186,7 @@ static void rna_def_dupli_object(BlenderRNA *brna) /* TODO: DupliObject has more properties that can be wrapped */ } -static void rna_def_base(BlenderRNA *brna) +static void rna_def_object_base(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -2018,22 +2208,19 @@ static void rna_def_base(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, NULL, "rna_Base_layer_set"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Base_layer_update"); - prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BA_SELECT); - RNA_def_property_ui_text(prop, "Selected", "Object base selection state"); + RNA_def_property_ui_text(prop, "Select", "Object base selection state"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Base_select_update"); - prop= RNA_def_property(srna, "selected_user", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", BA_WAS_SEL); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "User Selected", "Object base user selection state, used to restore user selection after transformations"); + RNA_api_object_base(srna); } void RNA_def_object(BlenderRNA *brna) { rna_def_object(brna); rna_def_object_game_settings(brna); - rna_def_base(brna); + rna_def_object_base(brna); rna_def_vertex_group(brna); rna_def_material_slot(brna); rna_def_dupli_object(brna); |