[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4086] contrib/py/scripts/addons/ mesh_show_vgroup_weights.py: Fixes for Campbells add-on loading change.

Jason van Gumster jason at handturkeystudios.com
Thu Dec 20 16:30:59 CET 2012


Revision: 4086
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4086
Author:   thefallenweeble
Date:     2012-12-20 15:30:59 +0000 (Thu, 20 Dec 2012)
Log Message:
-----------
Fixes for Campbells add-on loading change. Has a small issue where the add-on unloads itself when a new file is opened.

Modified Paths:
--------------
    contrib/py/scripts/addons/mesh_show_vgroup_weights.py

Modified: contrib/py/scripts/addons/mesh_show_vgroup_weights.py
===================================================================
--- contrib/py/scripts/addons/mesh_show_vgroup_weights.py	2012-12-20 13:41:28 UTC (rev 4085)
+++ contrib/py/scripts/addons/mesh_show_vgroup_weights.py	2012-12-20 15:30:59 UTC (rev 4086)
@@ -26,7 +26,7 @@
     "blender": (2, 62, 0),
     "location": "3D View > Properties Region > Show Weights",
     "description": "Finds the vertex groups of a selected vertex and displays the corresponding weights",
-    "warning": "Requires bmesh",
+    "warning": "",
     "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
         "Scripts/Modeling/Show_Vertex_Group_Weights",
     "tracker_url": "http://projects.blender.org/tracker/index.php?"\
@@ -190,19 +190,6 @@
             return {'CANCELLED'}
 
 
-# properties used by the script
-class InitProperties(bpy.types.Operator):
-    bl_idname = "view3d.init_find_weights"
-    bl_label = "Initialize properties for vgroup weights finder"
-    
-    def execute(self, context):
-        bpy.types.Scene.display_indices = bpy.props.IntProperty(
-            name="Display indices",
-            default=0)
-        context.scene.display_indices = 0
-        return {'FINISHED'}
-
-
 # removal of ID-properties when script is disabled
 def clear_properties(full=True):
     # can happen on reload
@@ -448,8 +435,9 @@
         default = False)
     bpy.types.Mesh.assign_vgroup = bpy.props.StringProperty()
     bpy.utils.register_class(ShowVGroupWeights)
-    bpy.utils.register_class(InitProperties)
-    bpy.ops.view3d.init_find_weights()
+    bpy.types.Scene.display_indices = bpy.props.IntProperty(
+        name="Display indices",
+        default=0)
     bpy.utils.register_class(AssignVertexWeight)
     bpy.utils.register_class(RemoveFromVertexGroup)
     bpy.utils.register_class(AddToVertexGroup)
@@ -458,7 +446,6 @@
 
 def unregister():
     bpy.utils.unregister_class(ShowVGroupWeights)
-    bpy.utils.unregister_class(InitProperties)
     clear_properties()
     bpy.utils.unregister_class(AssignVertexWeight)
     bpy.utils.unregister_class(RemoveFromVertexGroup)



More information about the Bf-extensions-cvs mailing list