Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-01-01 23:44:40 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-01-01 23:44:40 +0300
commit112385660aeefbd503b128c91a3c7fc09d1e6d5a (patch)
tree3db61ae0103dab6ba41bdfbf015ccb8b05bba0d6 /source/blender/makesrna
parentddabed9c9625f7109b703ed88c88247bfb14aaba (diff)
RNA
* Object has some more properties wrapped, mostly game related. * Scene frame changes now send a notifier. * Added functions to create/free operator properties for calling operators. This also simplifies some duplicated code that did this. Ideally though this kind of thing should use the properties pointer provided by buttons and keymap items. Example code: PointerRNA ptr; WM_operator_properties_create(&ptr, "SOME_OT_name"); RNA_int_set(&ptr, "value", 42); WM_operator_name_call(C, "SOME_OT_name", WM_OP_EXEC_DEFAULT, &ptr); WM_operator_properties_free(&ptr);
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/RNA_access.h1
-rw-r--r--source/blender/makesrna/intern/rna_access.c46
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c4
-rw-r--r--source/blender/makesrna/intern/rna_internal.h2
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c2
-rw-r--r--source/blender/makesrna/intern/rna_object.c283
-rw-r--r--source/blender/makesrna/intern/rna_rna.c2
-rw-r--r--source/blender/makesrna/intern/rna_scene.c20
-rw-r--r--source/blender/makesrna/intern/rna_wm.c4
9 files changed, 310 insertions, 54 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 29739b62615..a10405770ce 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -143,6 +143,7 @@ extern StructRNA RNA_Node;
extern StructRNA RNA_NodeTree;
extern StructRNA RNA_NorController;
extern StructRNA RNA_Object;
+extern StructRNA RNA_ObjectGameSettings;
extern StructRNA RNA_ObstacleFluidSettings;
extern StructRNA RNA_Operator;
extern StructRNA RNA_OperatorMousePath;
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index c8c3a8605a8..55d3cde4af7 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -99,22 +99,20 @@ void RNA_blender_rna_pointer_create(PointerRNA *r_ptr)
/* ID Properties */
-IDProperty *rna_idproperties_get(StructRNA *type, void *data, int create)
-{
- if(type->flag & STRUCT_ID)
- return IDP_GetProperties(data, create);
- else if(type == &RNA_IDPropertyGroup || type->from == &RNA_IDPropertyGroup)
- return data;
- else if(type->from == &RNA_OperatorProperties) {
- IDProperty **properties= (IDProperty**)data;
-
- if(create && !*properties) {
+IDProperty *rna_idproperties_get(PointerRNA *ptr, int create)
+{
+ if(ptr->type->flag & STRUCT_ID)
+ return IDP_GetProperties(ptr->data, create);
+ else if(ptr->type == &RNA_IDPropertyGroup || ptr->type->from == &RNA_IDPropertyGroup)
+ return ptr->data;
+ else if(ptr->type->from == &RNA_OperatorProperties) {
+ if(create && !ptr->data) {
IDPropertyTemplate val;
val.i = 0; /* silence MSVC warning about uninitialized var when debugging */
- *properties= IDP_New(IDP_GROUP, val, "RNA_OperatorProperties group");
+ ptr->data= IDP_New(IDP_GROUP, val, "RNA_OperatorProperties group");
}
- return *properties;
+ return ptr->data;
}
else
return NULL;
@@ -122,7 +120,7 @@ IDProperty *rna_idproperties_get(StructRNA *type, void *data, int create)
static IDProperty *rna_idproperty_find(PointerRNA *ptr, const char *name)
{
- IDProperty *group= rna_idproperties_get(ptr->type, ptr->data, 0);
+ IDProperty *group= rna_idproperties_get(ptr, 0);
IDProperty *idprop;
if(group) {
@@ -194,7 +192,7 @@ IDProperty *rna_idproperty_check(PropertyRNA **prop, PointerRNA *ptr)
IDProperty *idprop= rna_idproperty_find(ptr, (*prop)->identifier);
if(idprop && !rna_idproperty_verify_valid(*prop, idprop)) {
- IDProperty *group= rna_idproperties_get(ptr->type, ptr->data, 0);
+ IDProperty *group= rna_idproperties_get(ptr, 0);
IDP_RemFromGroup(group, idprop);
IDP_FreeProperty(idprop);
@@ -549,7 +547,7 @@ void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value)
val.i= value;
- group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ group= rna_idproperties_get(ptr, 1);
if(group)
IDP_AddToGroup(group, IDP_New(IDP_INT, val, (char*)prop->identifier));
}
@@ -584,7 +582,7 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, int inde
val.array.len= prop->arraylength;
val.array.type= IDP_INT;
- group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ group= rna_idproperties_get(ptr, 1);
if(group) {
idprop= IDP_New(IDP_ARRAY, val, (char*)prop->identifier);
IDP_AddToGroup(group, idprop);
@@ -622,7 +620,7 @@ void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
val.i= value;
- group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ group= rna_idproperties_get(ptr, 1);
if(group)
IDP_AddToGroup(group, IDP_New(IDP_INT, val, (char*)prop->identifier));
}
@@ -657,7 +655,7 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, int index, i
val.array.len= prop->arraylength;
val.array.type= IDP_INT;
- group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ group= rna_idproperties_get(ptr, 1);
if(group) {
idprop= IDP_New(IDP_ARRAY, val, (char*)prop->identifier);
IDP_AddToGroup(group, idprop);
@@ -704,7 +702,7 @@ void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
val.f= value;
- group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ group= rna_idproperties_get(ptr, 1);
if(group)
IDP_AddToGroup(group, IDP_New(IDP_FLOAT, val, (char*)prop->identifier));
}
@@ -748,7 +746,7 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, int index,
val.array.len= prop->arraylength;
val.array.type= IDP_FLOAT;
- group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ group= rna_idproperties_get(ptr, 1);
if(group) {
idprop= IDP_New(IDP_ARRAY, val, (char*)prop->identifier);
IDP_AddToGroup(group, idprop);
@@ -816,7 +814,7 @@ void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *val
val.str= (char*)value;
- group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ group= rna_idproperties_get(ptr, 1);
if(group)
IDP_AddToGroup(group, IDP_New(IDP_STRING, val, (char*)prop->identifier));
}
@@ -852,7 +850,7 @@ void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
val.i= value;
- group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ group= rna_idproperties_get(ptr, 1);
if(group)
IDP_AddToGroup(group, IDP_New(IDP_INT, val, (char*)prop->identifier));
}
@@ -916,7 +914,7 @@ void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop)
val.i= 0;
- group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ group= rna_idproperties_get(ptr, 1);
if(group)
IDP_AddToGroup(group, IDP_New(IDP_GROUP, val, (char*)prop->identifier));
}
@@ -1078,7 +1076,7 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA
IDPropertyTemplate val;
val.i= 0;
- group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ group= rna_idproperties_get(ptr, 1);
if(group) {
idprop= IDP_NewIDPArray(prop->identifier);
IDP_AddToGroup(group, idprop);
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index 7ced246fa98..4d800e36887 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -63,12 +63,12 @@ void rna_def_constraint_basedata(BlenderRNA *brna)
{CONSTRAINT_TYPE_CLAMPTO, "CLAMPTO", "Clamp To", ""},
{CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", "Transformation", ""},
{0, NULL, NULL, NULL}};
- static EnumPropertyItem space_items[] ={
+ /*static EnumPropertyItem space_items[] ={
{CONSTRAINT_SPACE_WORLD, "WORLD", "World Space", "World/Global space."},
{CONSTRAINT_SPACE_LOCAL, "LOCAL", "Local", "For objects (relative to parent/without parent influence). | For bones (along normals of bone, without parent/restpositions)."},
{CONSTRAINT_SPACE_POSE, "POSE", "Pose", "Pose/Armature space (only for Pose Channels)."},
{CONSTRAINT_SPACE_PARLOCAL, "PARLOCAL", "Local With Parent", "'Local' space with Parent transform taken into account (only for Pose Channels)."},
- {0, NULL, NULL, NULL}};
+ {0, NULL, NULL, NULL}};*/
/* data */
srna= RNA_def_struct(brna, "Constraint", NULL );
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index e1df48ecff6..e5c9fa35847 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -149,7 +149,7 @@ extern FloatPropertyRNA rna_IDProperty_doublearray;
extern StructRNA RNA_IDProperty;
extern StructRNA RNA_IDPropertyGroup;
-struct IDProperty *rna_idproperties_get(struct StructRNA *type, void *data, int create);
+struct IDProperty *rna_idproperties_get(struct PointerRNA *ptr, int create);
struct IDProperty *rna_idproperty_check(struct PropertyRNA **prop, struct PointerRNA *ptr);
/* Builtin Property Callbacks */
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index cf7a2c4ffbf..3d51780abc0 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -403,7 +403,7 @@ void RNA_def_modifier(BlenderRNA *brna)
/* strings */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
- RNA_def_property_ui_text(prop, "Name", "");
+ RNA_def_property_ui_text(prop, "Name", "Modifier name.");
RNA_def_struct_name_property(srna, prop);
/* enums */
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index ead4b1162ee..d1a91e200d9 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -45,9 +45,203 @@ static void rna_Object_update(bContext *C, PointerRNA *ptr)
DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_OB);
}
+static int rna_VertexGroup_index_get(PointerRNA *ptr)
+{
+ Object *ob= ptr->id.data;
+
+ return BLI_findindex(&ob->defbase, ptr->data);
+}
+
+static void *rna_Object_active_vertex_group_get(PointerRNA *ptr)
+{
+ Object *ob= ptr->id.data;
+ return BLI_findlink(&ob->defbase, ob->actdef);
+}
+
+static void *rna_Object_game_settings_get(PointerRNA *ptr)
+{
+ return ptr->id.data;
+}
+
+static void rna_Object_layer_set(PointerRNA *ptr, int index, int value)
+{
+ Object *ob= (Object*)ptr->data;
+
+ if(value) ob->lay |= (1<<index);
+ else {
+ ob->lay &= ~(1<<index);
+ if(ob->lay == 0)
+ ob->lay |= (1<<index);
+ }
+}
+
+static void rna_ObjectGameSettings_state_set(PointerRNA *ptr, int index, int value)
+{
+ Object *ob= (Object*)ptr->data;
+
+ if(value) ob->state |= (1<<index);
+ else {
+ ob->state &= ~(1<<index);
+ if(ob->state == 0)
+ ob->state |= (1<<index);
+ }
+}
+
#else
-void RNA_def_object(BlenderRNA *brna)
+static void rna_def_vertex_group(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "VertexGroup", NULL);
+ RNA_def_struct_sdna(srna, "bDeformGroup");
+ RNA_def_struct_ui_text(srna, "Vertex Group", "Group of vertices, used for armature deform and other purposes.");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Name", "Vertex group name.");
+ RNA_def_struct_name_property(srna, prop);
+
+ prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_VertexGroup_index_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Index", "Index number of the vertex group.");
+}
+
+static void rna_def_object_game_settings(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem body_type_items[] = {
+ {OB_BODY_TYPE_NO_COLLISION, "NO_COLLISION", "No Collision", ""},
+ {OB_BODY_TYPE_STATIC, "STATIC", "Static", ""},
+ {OB_BODY_TYPE_DYNAMIC, "DYNAMIC", "Dynamic", ""},
+ {OB_BODY_TYPE_RIGID, "RIGID_BODY", "Rigid Body", ""},
+ {OB_BODY_TYPE_SOFT, "SOFT_BODY", "Soft Body", ""},
+ {0, NULL, NULL, NULL}};
+
+ static EnumPropertyItem collision_bounds_items[] = {
+ {OB_BOUND_BOX, "BOX", "Box", ""},
+ {OB_BOUND_SPHERE, "SPHERE", "Sphere", ""},
+ {OB_BOUND_CYLINDER, "CYLINDER", "Cylinder", ""},
+ {OB_BOUND_CONE, "CONE", "Cone", ""},
+ {OB_BOUND_POLYH, "CONVEX_HULL", "Convex Hull", ""},
+ {OB_BOUND_POLYT, "TRIANGLE_MESH", "Triangle Mesh", ""},
+ //{OB_DYN_MESH, "DYNAMIC_MESH", "Dynamic Mesh", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "ObjectGameSettings", NULL);
+ RNA_def_struct_sdna(srna, "Object");
+ RNA_def_struct_ui_text(srna, "Object Game Settings", "Game engine related settings for the object.");
+
+ prop= RNA_def_property(srna, "sensors", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Sensor");
+ RNA_def_property_ui_text(prop, "Sensors", "DOC_BROKEN");
+
+ prop= RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Controller");
+ RNA_def_property_ui_text(prop, "Controllers", "DOC_BROKEN");
+
+ prop= RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Actuator");
+ RNA_def_property_ui_text(prop, "Actuators", "DOC_BROKEN");
+
+ prop= RNA_def_property(srna, "properties", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "prop", NULL);
+ RNA_def_property_struct_type(prop, "GameProperty");
+ RNA_def_property_ui_text(prop, "Properties", "Game engine properties.");
+
+ prop= RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "body_type");
+ RNA_def_property_enum_items(prop, body_type_items);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE); // this controls various gameflags
+ RNA_def_property_ui_text(prop, "Physics Type", "Selects the type of physical representation.");
+
+ prop= RNA_def_property(srna, "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);
+ 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.");
+
+ prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.01, 10000.0);
+ RNA_def_property_ui_text(prop, "Mass", "Mass of the object.");
+
+ prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "inertia");
+ RNA_def_property_range(prop, 0.01, 10.0);
+ RNA_def_property_ui_text(prop, "Radius", "Radius for Bounding sphere and Fh/Fh Rot.");
+
+ prop= RNA_def_property(srna, "no_sleeping", 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.");
+
+ prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "damping");
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_ui_text(prop, "Damping", "General movement damping.");
+
+ prop= RNA_def_property(srna, "rotation_damping", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "rdamping");
+ 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, "do_fh", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_DO_FH);
+ RNA_def_property_ui_text(prop, "Do Fh", "Use Fh settings in materials.");
+
+ prop= RNA_def_property(srna, "rotation_fh", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ROT_FH);
+ RNA_def_property_ui_text(prop, "Rotation Fh", "Use face normal to rotate Object");
+
+ prop= RNA_def_property(srna, "form_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "formfactor");
+ 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);
+ RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ANISOTROPIC_FRICTION);
+ RNA_def_property_ui_text(prop, "Anisotropic Friction", "Enable anisotropic friction.");
+
+ prop= RNA_def_property(srna, "friction_coefficients", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_float_sdna(prop, NULL, "anisotropicFriction");
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_ui_text(prop, "Friction Coefficients", "Relative friction coefficient in the in the X, Y and Z directions, when anisotropic friction is enabled.");
+
+ prop= RNA_def_property(srna, "use_collision_bounds", PROP_BOOLEAN, PROP_NONE);
+ 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);
+ RNA_def_property_enum_sdna(prop, NULL, "boundtype");
+ RNA_def_property_enum_items(prop, collision_bounds_items);
+ RNA_def_property_ui_text(prop, "Collision Bounds", "Selects the collision type.");
+
+ prop= RNA_def_property(srna, "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.");
+
+ prop= RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "margin");
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_ui_text(prop, "Collision Margin", "Extra margin around object for collision detection, small amount required for stability.");
+
+ prop= RNA_def_property(srna, "state", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "state", 1);
+ RNA_def_property_array(prop, 30);
+ RNA_def_property_ui_text(prop, "State", "State determining which controllers are displayed.");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_ObjectGameSettings_state_set");
+
+ prop= RNA_def_property(srna, "initial_state", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "init_state", 1);
+ RNA_def_property_array(prop, 30);
+ RNA_def_property_ui_text(prop, "Initial State", "Initial state when the game starts.");
+}
+
+static void rna_def_object(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -59,24 +253,54 @@ void RNA_def_object(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "ID");
RNA_def_property_ui_text(prop, "Data", "Object data.");
+ prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
+ RNA_def_property_array(prop, 20);
+ RNA_def_property_ui_text(prop, "Layers", "Layers the object is on.");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_Object_layer_set");
+
+ /* parent and track */
+
prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Parent", "Parent Object");
prop= RNA_def_property(srna, "track", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Track", "Object being tracked to define the rotation (Old Track).");
- prop= RNA_def_property(srna, "loc", PROP_FLOAT, PROP_VECTOR);
- RNA_def_property_ui_text(prop, "Location", "DOC_BROKEN");
+ /* transform */
+
+ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_float_sdna(prop, NULL, "loc");
+ RNA_def_property_ui_text(prop, "Location", "Location of the object.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+ prop= RNA_def_property(srna, "delta_location", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_float_sdna(prop, NULL, "dloc");
+ RNA_def_property_ui_text(prop, "Delta Location", "Extra added translation to object location.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
- prop= RNA_def_property(srna, "rot", PROP_FLOAT, PROP_ROTATION);
- RNA_def_property_ui_text(prop, "Rotation", "");
+ prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ROTATION);
+ RNA_def_property_float_sdna(prop, NULL, "rot");
+ RNA_def_property_ui_text(prop, "Rotation", "Rotation of the object.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+ prop= RNA_def_property(srna, "delta_rotation", PROP_FLOAT, PROP_ROTATION);
+ RNA_def_property_float_sdna(prop, NULL, "drot");
+ RNA_def_property_ui_text(prop, "Delta Rotation", "Extra added rotation to the rotation of the object.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
- prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_VECTOR);
- RNA_def_property_ui_text(prop, "Scale", "DOC_BROKEN");
+ prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_float_sdna(prop, NULL, "size");
+ RNA_def_property_ui_text(prop, "Scale", "Scaling of the object.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+ prop= RNA_def_property(srna, "delta_scale", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_float_sdna(prop, NULL, "dsize");
+ RNA_def_property_ui_text(prop, "Delta Scale", "Extra added scaling to the scale of the object.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+ /* collections */
+
prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Ipo");
RNA_def_property_ui_text(prop, "Ipo", "DOC_BROKEN");
@@ -89,22 +313,41 @@ void RNA_def_object(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Modifier");
RNA_def_property_ui_text(prop, "Modifiers", "DOC_BROKEN");
- prop= RNA_def_property(srna, "sensors", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_struct_type(prop, "Sensor");
- RNA_def_property_ui_text(prop, "Sensors", "DOC_BROKEN");
+ /* game engine */
- prop= RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_struct_type(prop, "Controller");
- RNA_def_property_ui_text(prop, "Controllers", "DOC_BROKEN");
+ prop= RNA_def_property(srna, "game_settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "ObjectGameSettings");
+ RNA_def_property_pointer_funcs(prop, "rna_Object_game_settings_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Game Settings", "Game engine related settings for the object.");
- prop= RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_struct_type(prop, "Actuator");
- RNA_def_property_ui_text(prop, "Actuators", "DOC_BROKEN");
+ /* vertex groups */
- prop= RNA_def_property(srna, "game_properties", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_collection_sdna(prop, NULL, "prop", NULL);
- RNA_def_property_struct_type(prop, "GameProperty");
- RNA_def_property_ui_text(prop, "Game Properties", "Game engine properties.");
+ prop= RNA_def_property(srna, "vertex_groups", PROP_COLLECTION, PROP_NONE);
+ 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", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object.");
+
+ /* various */
+
+ prop= RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "index");
+ RNA_def_property_ui_text(prop, "Pass Index", "Index # for the IndexOB render pass.");
+
+ prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "col");
+ RNA_def_property_ui_text(prop, "Color", "Object color and alpha, used when faces have the ObColor mode enabled.");
+}
+
+void RNA_def_object(BlenderRNA *brna)
+{
+ rna_def_vertex_group(brna);
+ rna_def_object_game_settings(brna);
+ rna_def_object(brna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index f43d864ea5b..b4d414c727d 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -105,7 +105,7 @@ static void rna_Struct_properties_next(CollectionPropertyIterator *iter)
/* try id properties */
if(!iter->valid) {
- group= rna_idproperties_get(iter->parent.type, iter->parent.data, 0);
+ group= rna_idproperties_get(&iter->parent, 0);
if(group) {
rna_iterator_listbase_end(iter);
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index dc2eff673ec..353db5248d9 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -31,6 +31,8 @@
#include "DNA_scene_types.h"
+#include "WM_types.h"
+
#ifdef RNA_RUNTIME
#include "BKE_global.h"
@@ -69,6 +71,12 @@ static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
data->r.efra= value;
}
+static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr)
+{
+ //Scene *scene= ptr->id.data;
+ //update_for_newframe();
+}
+
#else
void RNA_def_scene(BlenderRNA *brna)
@@ -95,7 +103,8 @@ void RNA_def_scene(BlenderRNA *brna)
prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Active Camera", "Active camera used for rendering the scene.");
- prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_VECTOR);
+ prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_float_sdna(prop, NULL, "cursor");
RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location.");
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
@@ -105,13 +114,14 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Objects", "");
RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0, 0);
- prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible when rendering the scene.");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set");
- prop= RNA_def_property(srna, "prop_mode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "proportional_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
RNA_def_property_enum_items(prop, prop_mode_items);
RNA_def_property_ui_text(prop, "Proportional Mode", "Proportional editing mode.");
@@ -120,22 +130,26 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "r.cfra");
RNA_def_property_range(prop, MINFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Current Frame", "");
+ RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_DRIVEABLE);
RNA_def_property_int_sdna(prop, NULL, "r.sfra");
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Start Frame", "");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_DRIVEABLE);
RNA_def_property_int_sdna(prop, NULL, "r.efra");
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "End Frame", "");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "stamp_note", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
RNA_def_property_ui_text(prop, "Stamp Note", "User define note for the render stamping.");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "unwrapper", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "toolsettings->unwrapper");
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index fe809a18d4d..c4a4780cb1d 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -36,7 +36,7 @@
static wmOperator *rna_OperatorProperties_find_operator(PointerRNA *ptr)
{
wmWindowManager *wm= ptr->id.data;
- IDProperty *properties= *(IDProperty**)ptr->data;
+ IDProperty *properties= (IDProperty*)ptr->data;
wmOperator *op;
if(wm)
@@ -72,7 +72,7 @@ static int rna_Operator_name_length(PointerRNA *ptr)
static void *rna_Operator_properties_get(PointerRNA *ptr)
{
wmOperator *op= (wmOperator*)ptr->data;
- return &op->properties;
+ return op->properties;
}
#else