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:
authorJason Hays <jason_hays22@mymail.eku.edu>2011-06-27 21:21:08 +0400
committerJason Hays <jason_hays22@mymail.eku.edu>2011-06-27 21:21:08 +0400
commit84ea89e25feaeff8eeaf5ebe35c0a76203670569 (patch)
treeb85158536330b76a9b7445028e04a06d7579ea09 /source/blender/makesrna/intern/rna_object.c
parent1876b592daffb86a60890b9f8db55d676d7cae1c (diff)
parent8e90ba3b201f58496b3bec39d98963ab77182736 (diff)
Merged from trunk with revision range 36835-37865,
(No conflicts had to be manually resolved) Gave weight paint a basic ability to draw edges and vertices with an option (with colors for selected/unselected), but I didn't make any vertex selection functions available in weight paint mode yet (tested with edit mode for now).
Diffstat (limited to 'source/blender/makesrna/intern/rna_object.c')
-rw-r--r--source/blender/makesrna/intern/rna_object.c43
1 files changed, 28 insertions, 15 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 8dc095841a2..2c4f8b64553 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -155,7 +155,7 @@ EnumPropertyItem object_type_curve_items[] = {
#include "ED_curve.h"
#include "ED_lattice.h"
-static void rna_Object_internal_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Object_internal_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
DAG_id_tag_update(ptr->id.data, OB_RECALC_OB);
}
@@ -213,7 +213,7 @@ static void rna_Object_matrix_basis_set(PointerRNA *ptr, const float values[16])
object_apply_mat4(ob, (float(*)[4])values, FALSE, FALSE);
}
-void rna_Object_internal_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
+void rna_Object_internal_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ptr->id.data);
@@ -263,14 +263,14 @@ static void rna_Object_dependency_update(Main *bmain, Scene *scene, PointerRNA *
}
/* when changing the selection flag the scene needs updating */
-static void rna_Object_select_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Object_select_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
short mode = ob->flag & SELECT ? BA_SELECT : BA_DESELECT;
ED_base_object_select(object_in_scene(ob, scene), mode);
}
-static void rna_Base_select_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Base_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Base *base= (Base*)ptr->data;
short mode = base->flag & BA_SELECT ? BA_SELECT : BA_DESELECT;
@@ -389,7 +389,7 @@ static void rna_Object_parent_type_set(PointerRNA *ptr, int value)
ED_object_parent(ob, ob->parent, value, ob->parsubstr);
}
-static EnumPropertyItem *rna_Object_parent_type_itemf(bContext *C, PointerRNA *ptr, int *free)
+static EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{
Object *ob= (Object*)ptr->data;
EnumPropertyItem *item= NULL;
@@ -420,7 +420,7 @@ static EnumPropertyItem *rna_Object_parent_type_itemf(bContext *C, PointerRNA *p
return item;
}
-static EnumPropertyItem *rna_Object_collision_bounds_itemf(bContext *C, PointerRNA *ptr, int *free)
+static EnumPropertyItem *rna_Object_collision_bounds_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{
Object *ob= (Object*)ptr->data;
EnumPropertyItem *item= NULL;
@@ -464,6 +464,14 @@ static void rna_Object_dup_group_set(PointerRNA *ptr, PointerRNA value)
BKE_report(NULL, RPT_ERROR, "Cannot set dupli-group as object belongs in group being instanced thus causing a cycle");
}
+void rna_VertexGroup_name_set(PointerRNA *ptr, const char *value)
+{
+ Object *ob= (Object *)ptr->id.data;
+ bDeformGroup *dg= (bDeformGroup *)ptr->data;
+ BLI_strncpy(dg->name, value, sizeof(dg->name));
+ defgroup_unique_name(dg, ob);
+}
+
static int rna_VertexGroup_index_get(PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
@@ -646,7 +654,7 @@ static void rna_Object_active_particle_system_index_set(PointerRNA *ptr, int val
psys_set_current_num(ob, value);
}
-static void rna_Object_particle_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Object_particle_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
@@ -1026,8 +1034,13 @@ static void rna_Object_active_shape_key_index_range(PointerRNA *ptr, int *min, i
Key *key= ob_get_key(ob);
*min= 0;
- *max= (key)? BLI_countlist(&key->block)-1: 0;
- *max= MAX2(0, *max);
+ if(key) {
+ *max= BLI_countlist(&key->block)-1;
+ if(*max < 0) *max= 0;
+ }
+ else {
+ *max= 0;
+ }
}
static int rna_Object_active_shape_key_index_get(PointerRNA *ptr)
@@ -1196,27 +1209,27 @@ static float rna_VertexGroup_weight(ID *id, bDeformGroup *dg, ReportList *report
}
/* generic poll functions */
-int rna_Lattice_object_poll(PointerRNA *ptr, PointerRNA value)
+int rna_Lattice_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
{
return ((Object *)value.id.data)->type == OB_LATTICE;
}
-int rna_Curve_object_poll(PointerRNA *ptr, PointerRNA value)
+int rna_Curve_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
{
return ((Object *)value.id.data)->type == OB_CURVE;
}
-int rna_Armature_object_poll(PointerRNA *ptr, PointerRNA value)
+int rna_Armature_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
{
return ((Object *)value.id.data)->type == OB_ARMATURE;
}
-int rna_Mesh_object_poll(PointerRNA *ptr, PointerRNA value)
+int rna_Mesh_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
{
return ((Object *)value.id.data)->type == OB_MESH;
}
-int rna_Camera_object_poll(PointerRNA *ptr, PointerRNA value)
+int rna_Camera_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
{
return ((Object *)value.id.data)->type == OB_CAMERA;
}
@@ -1246,6 +1259,7 @@ static void rna_def_vertex_group(BlenderRNA *brna)
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);
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_VertexGroup_name_set");
RNA_def_property_update(prop, NC_GEOM|ND_DATA|NA_RENAME, "rna_Object_internal_update_data"); /* update data because modifiers may use [#24761] */
/* Jason was here */
prop= RNA_def_property(srna, "flag", PROP_BOOLEAN, PROP_NONE);
@@ -1832,7 +1846,6 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "parent_vertices", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "par1");
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_internal_update");