diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-27 06:33:35 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-27 06:33:35 +0400 |
commit | b0aa8368fe9405976eda8e08ec5d698a6b8013cb (patch) | |
tree | b166daf09ff514a2d0888e672e05b2e48d2a4d67 /source/blender/makesrna/intern/rna_object_api.c | |
parent | 6d195f61953fb9fa9c65514944f992c620bd449f (diff) |
rna api
obj.add_vertex_group() --> obj.vertex_groups.new()
obj.add_vertex_to_group() --> obj.vertex_groups.assign()
note: obj.vertex_groups.assign() will be very slow, need to have this take a list rather then 1 vertex at a time.
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 40 |
1 files changed, 2 insertions, 38 deletions
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 17e6630a48a..d48e714ea23 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -35,9 +35,9 @@ #include "DNA_object_types.h" -#include "BLO_sys_types.h" /* needed for intptr_t used in ED_mesh.h */ +// #include "BLO_sys_types.h" /* needed for intptr_t used in ED_mesh.h */ -#include "ED_mesh.h" +// #include "ED_mesh.h" #ifdef RNA_RUNTIME @@ -261,17 +261,6 @@ static void rna_Object_free_duplilist(Object *ob, ReportList *reports) } } -static bDeformGroup *rna_Object_add_vertex_group(Object *ob, char *group_name) -{ - return ED_vgroup_add_name(ob, group_name); -} - -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); -} - /* copied from old API Object.makeDisplayList (Object.c) * use _ suffix because this exists for internal rna */ static void rna_Object_update(Object *ob, Scene *sce, int object, int data, int time) @@ -433,13 +422,6 @@ void RNA_api_object(StructRNA *srna) {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem assign_mode_items[] = { - {WEIGHT_REPLACE, "REPLACE", 0, "Replace", "Replace"}, /* TODO: more meaningful descriptions */ - {WEIGHT_ADD, "ADD", 0, "Add", "Add"}, - {WEIGHT_SUBTRACT, "SUBTRACT", 0, "Subtract", "Subtract"}, - {0, NULL, 0, NULL, NULL} - }; - /* mesh */ func= RNA_def_function(srna, "create_mesh", "rna_Object_create_mesh"); RNA_def_function_ui_description(func, "Create a Mesh datablock with modifiers applied."); @@ -464,24 +446,6 @@ void RNA_api_object(StructRNA *srna) RNA_def_function_ui_description(func, "Free the list of dupli objects."); RNA_def_function_flag(func, FUNC_USE_REPORTS); - /* vertex groups */ - func= RNA_def_function(srna, "add_vertex_group", "rna_Object_add_vertex_group"); - 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); - - func= RNA_def_function(srna, "add_vertex_to_group", "rna_Object_add_vertex_to_group"); - RNA_def_function_ui_description(func, "Add vertex to a vertex group."); - parm= RNA_def_int(func, "vertex_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); - /* Armature */ func= RNA_def_function(srna, "find_armature", "rna_Object_find_armature"); RNA_def_function_ui_description(func, "Find armature influencing this object as a parent or via a modifier."); |