Added a hard coded check box to the vertex group list items in interface/interface_te...
authorJason Hays <jason_hays22@mymail.eku.edu>
Fri, 3 Jun 2011 16:08:03 +0000 (16:08 +0000)
committerJason Hays <jason_hays22@mymail.eku.edu>
Fri, 3 Jun 2011 16:08:03 +0000 (16:08 +0000)
Made my 3 new buttons only appear in weight paint mode when there are vertex groups present
in properties_data_mesh.py

I took the now redundant check box out of properties_data_mesh.py

I took out unnecessary code (resulting from copy/paste) from my lock all, unlock all, and invert all functions of object/object_vgroup.c

(and I got rid of a new line in paint_vertex.c :) )

release/scripts/startup/bl_ui/properties_data_mesh.py
source/blender/editors/interface/interface_templates.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/sculpt_paint/paint_vertex.c

index 888ba55be3d59ad1fa1b6dd9556fced0fe554bea..74270b156d62af0fee2aa1557c9ee27864b46484 100644 (file)
@@ -137,8 +137,8 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, bpy.types.Panel):
         row.template_list(ob, "vertex_groups", ob.vertex_groups, "active_index", rows=rows)
 
         col = row.column(align=True)
-        # Jason was here #
-        col.prop(group, "flag")
+        # Jason was here, this was replaced by hardcoded list view checkboxes. #
+        #col.prop(group, "flag")
         
         col.operator("object.vertex_group_add", icon='ZOOMIN', text="")
         col.operator("object.vertex_group_remove", icon='ZOOMOUT', text="")
@@ -151,11 +151,12 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, bpy.types.Panel):
             row = layout.row()
             row.prop(group, "name")
         #Jason was here
-        row = layout.row()
-        sub = row.row(align=True)
-        sub.operator("object.vertex_group_lock_all", text="Lock All")
-        sub.operator("object.vertex_group_invert_locks", text="Invert Locks")
-        sub.operator("object.vertex_group_unlock_all", text="Unlock All")
+        if ob.mode == 'WEIGHT_PAINT' and len(ob.vertex_groups) > 0:
+            row = layout.row()
+            sub = row.row(align=True)
+            sub.operator("object.vertex_group_lock_all", text="Lock All")
+            sub.operator("object.vertex_group_invert_locks", text="Invert Locks")
+            sub.operator("object.vertex_group_unlock_all", text="Unlock All")
 
         if ob.mode == 'EDIT' and len(ob.vertex_groups) > 0:
             row = layout.row()
index af5a69da653622f0f1c2ee1c46aabe9d76c88b2b..4d048540e07cd6a60e5f8ccab3a5c1bc78ea7f99 100644 (file)
@@ -2118,6 +2118,12 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
                //uiItemR(row, itemptr, "mute", 0, "", ICON_MUTE_IPO_OFF);
                uiBlockSetEmboss(block, UI_EMBOSS);
        }
+       /* Jason was here: I need the RNA struct for vertex groups */
+       else if(RNA_struct_is_a(itemptr->type, &RNA_VertexGroup)) {
+               uiItemL(sub, name, icon);
+               uiBlockSetEmboss(block, UI_EMBOSS);
+               uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "flag", 0, 0, 0, 0, 0,  NULL);
+       }
        else
                uiItemL(sub, name, icon); /* fails, backdrop LISTROW... */
 
index bc598a5b8e43525e6629f6c721aeccbadc54a4fe..8e19b2985ab6df0e84756c0197c00448dcc2dbaf 100644 (file)
@@ -1778,10 +1778,6 @@ static int vertex_group_invert_locks_exec(bContext *C, wmOperator *op)
        Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
 
        vgroup_invert_locks(ob);
-       // not sure what these 3 do yet!
-       DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
-       WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
-       WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
 
        return OPERATOR_FINISHED;
 }
@@ -1805,10 +1801,6 @@ static int vertex_group_lock_all_exec(bContext *C, wmOperator *op)
        Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
 
        vgroup_lock_all(ob);
-       // not sure what these 3 do yet!
-       DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
-       WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
-       WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
 
        return OPERATOR_FINISHED;
 }
@@ -1832,10 +1824,6 @@ static int vertex_group_unlock_all_exec(bContext *C, wmOperator *op)
        Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
 
        vgroup_unlock_all(ob);
-       // not sure what these 3 do yet!
-       DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
-       WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
-       WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
 
        return OPERATOR_FINISHED;
 }
index ecd09975355b3f9ee500e5f40c04c3662528044c..4793b5687d18b3dd026f981eb0ac291e15067d68 100644 (file)
@@ -1280,7 +1280,6 @@ static void check_locks_and_normalize(Mesh *me, int index, int vgroup, MDeformWe
        } else if(bone_groups[dw->def_nr]) {// disable auto normalize if the active group is not a bone group
                do_weight_paint_auto_normalize(me->dvert+index, vgroup, validmap);
        }
-       
 }
 // Jason
 static char *wpaint_make_validmap(Object *ob);