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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_object.c')
-rw-r--r--source/blender/makesrna/intern/rna_object.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 7e1b0df9ce7..39739867c8b 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -107,13 +107,13 @@ static EnumPropertyItem dupli_items[] = {
#endif
static EnumPropertyItem collision_bounds_items[] = {
- {OB_BOUND_BOX, "BOX", 0, "Box", ""},
- {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""},
- {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", ""},
- {OB_BOUND_CONE, "CONE", 0, "Cone", ""},
- {OB_BOUND_CONVEX_HULL, "CONVEX_HULL", 0, "Convex Hull", ""},
- {OB_BOUND_TRIANGLE_MESH, "TRIANGLE_MESH", 0, "Triangle Mesh", ""},
- {OB_BOUND_CAPSULE, "CAPSULE", 0, "Capsule", ""},
+ {OB_BOUND_BOX, "BOX", ICON_MESH_CUBE, "Box", ""},
+ {OB_BOUND_SPHERE, "SPHERE", ICON_MESH_UVSPHERE, "Sphere", ""},
+ {OB_BOUND_CYLINDER, "CYLINDER", ICON_MESH_CYLINDER, "Cylinder", ""},
+ {OB_BOUND_CONE, "CONE", ICON_MESH_CONE, "Cone", ""},
+ {OB_BOUND_CONVEX_HULL, "CONVEX_HULL", ICON_MESH_ICOSPHERE, "Convex Hull", ""},
+ {OB_BOUND_TRIANGLE_MESH, "TRIANGLE_MESH", ICON_MESH_MONKEY, "Triangle Mesh", ""},
+ {OB_BOUND_CAPSULE, "CAPSULE", ICON_MESH_CAPSULE, "Capsule", ""},
/*{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""}, */
{0, NULL, 0, NULL, NULL}
};
@@ -535,11 +535,14 @@ static void rna_Object_dup_group_set(PointerRNA *ptr, PointerRNA value)
/* must not let this be set if the object belongs in this group already,
* thus causing a cycle/infinite-recursion leading to crashes on load [#25298]
*/
- if (BKE_group_object_exists(grp, ob) == 0)
+ if (BKE_group_object_exists(grp, ob) == 0) {
ob->dup_group = grp;
- else
+ id_lib_extern((ID *)grp);
+ }
+ else {
BKE_report(NULL, RPT_ERROR,
"Cannot set dupli-group as object belongs in group being instanced, thus causing a cycle");
+ }
}
static void rna_VertexGroup_name_set(PointerRNA *ptr, const char *value)
@@ -710,7 +713,7 @@ static void rna_Object_active_material_set(PointerRNA *ptr, PointerRNA value)
Object *ob = (Object *)ptr->id.data;
DAG_id_tag_update(value.data, 0);
- assign_material(ob, value.data, ob->actcol, BKE_MAT_ASSIGN_USERPREF);
+ assign_material(ob, value.data, ob->actcol, BKE_MAT_ASSIGN_EXISTING);
}
static int rna_Object_active_material_editable(PointerRNA *ptr)
@@ -882,7 +885,7 @@ static void rna_MaterialSlot_material_set(PointerRNA *ptr, PointerRNA value)
Object *ob = (Object *)ptr->id.data;
int index = (Material **)ptr->data - ob->mat;
- assign_material(ob, value.data, index + 1, BKE_MAT_ASSIGN_USERPREF);
+ assign_material(ob, value.data, index + 1, BKE_MAT_ASSIGN_EXISTING);
}
static int rna_MaterialSlot_link_get(PointerRNA *ptr)
@@ -1771,6 +1774,14 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_float_default(prop, 55.0f);
RNA_def_property_ui_text(prop, "Fall Speed Max", "Maximum speed at which the character will fall");
+ prop = RNA_def_property(srna, "jump_max", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "max_jumps");
+ RNA_def_property_range(prop, 1, CHAR_MAX);
+ RNA_def_property_ui_range(prop, 1, 10, 1, 1);
+ RNA_def_property_int_default(prop, 1);
+ RNA_def_property_ui_text(prop, "Max Jumps",
+ "The maximum number of jumps the character can make before it hits the ground");
+
/* Collision Masks */
prop = RNA_def_property(srna, "collision_group", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "col_group", 1);