diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_object.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 217 |
1 files changed, 122 insertions, 95 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 26e1cd1d5da..e61044776ca 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -124,25 +124,28 @@ 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_internal_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_world_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_internal_update(bmain, scene, ptr); } -void rna_Object_matrix_local_get(PointerRNA *ptr, float values[16]) +static void rna_Object_matrix_local_get(PointerRNA *ptr, float values[16]) { Object *ob= ptr->id.data; @@ -156,7 +159,7 @@ void rna_Object_matrix_local_get(PointerRNA *ptr, float values[16]) } } -void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16]) +static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16]) { Object *ob= ptr->id.data; @@ -184,12 +187,24 @@ void rna_Object_internal_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 */ - EDBM_LoadEditBMesh(scene, ob); - EDBM_MakeEditBMesh(scene->toolsettings, scene, ob); + switch(ob->type) { + case OB_MESH: + EDBM_LoadEditBMesh(scene, ob); + EDBM_MakeEditBMesh(scene->toolsettings, 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_internal_update_data(bmain, scene, ptr); @@ -198,7 +213,7 @@ void rna_Object_active_shape_update(Main *bmain, Scene *scene, PointerRNA *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 */ @@ -216,7 +231,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)) { @@ -224,7 +239,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); } } @@ -239,7 +254,7 @@ 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; } @@ -248,7 +263,7 @@ static void rna_Base_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr) 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; } @@ -436,32 +451,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) @@ -1033,12 +1035,12 @@ static int rna_Object_constraint_remove(Object *object, int index) 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) @@ -1054,6 +1056,32 @@ static void rna_Object_boundbox_get(PointerRNA *ptr, float *values) } +/* 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) @@ -1098,7 +1126,7 @@ 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_internal_update"); @@ -1176,11 +1204,11 @@ static void rna_def_object_game_settings(BlenderRNA *brna) 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"); @@ -1194,7 +1222,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"); @@ -1208,40 +1236,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"); @@ -1251,11 +1279,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"); @@ -1264,7 +1292,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"); @@ -1277,14 +1305,14 @@ 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, "Collision Compound", "Add children to form a compound collision object"); @@ -1299,29 +1327,29 @@ static void rna_def_object_game_settings(BlenderRNA *brna) /* state */ - prop= RNA_def_property(srna, "visible_state", PROP_BOOLEAN, PROP_LAYER_MEMBER); + 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, OB_MAX_STATES); RNA_def_property_ui_text(prop, "State", "State determining which controllers are displayed"); RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_state_get", "rna_GameObjectSettings_state_set"); - prop= RNA_def_property(srna, "used_state", PROP_BOOLEAN, PROP_LAYER_MEMBER); + 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, "initial_state", PROP_BOOLEAN, PROP_NONE); + 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, 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, "all_states", PROP_BOOLEAN, PROP_NONE); + 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"); @@ -1348,7 +1376,7 @@ 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"); @@ -1393,7 +1421,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); @@ -1435,7 +1463,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}}; @@ -1514,7 +1541,7 @@ 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"); @@ -1540,9 +1567,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 */ @@ -1554,7 +1581,7 @@ static void rna_def_object(BlenderRNA *brna) /* 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"); @@ -1609,7 +1636,7 @@ 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_internal_update"); @@ -1763,7 +1790,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 */ @@ -1774,7 +1801,7 @@ static void rna_def_object(BlenderRNA *brna) 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_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"); @@ -1813,13 +1840,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); @@ -1834,7 +1861,7 @@ static void rna_def_object(BlenderRNA *brna) 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_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); @@ -1844,19 +1871,19 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_particle_update"); /* 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); @@ -1870,7 +1897,7 @@ 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_internal_update"); @@ -1886,7 +1913,7 @@ static void rna_def_object(BlenderRNA *brna) 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_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); @@ -1939,7 +1966,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_struct_type(prop, "DupliObject"); RNA_def_property_ui_text(prop, "Dupli list", "Object duplis"); - prop= RNA_def_property(srna, "duplis_used", PROP_BOOLEAN, PROP_NONE); + 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); @@ -1950,33 +1977,33 @@ static void rna_def_object(BlenderRNA *brna) 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 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_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_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_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); @@ -1987,32 +2014,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); @@ -2036,13 +2063,13 @@ 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_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); @@ -2050,7 +2077,7 @@ static void rna_def_object(BlenderRNA *brna) 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); @@ -2075,13 +2102,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"); @@ -2113,9 +2140,9 @@ static void rna_def_object_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"); RNA_api_object_base(srna); |