[Bf-extensions-cvs] [26a8eec] master: tidy up

Brendon Murphy noreply at git.blender.org
Mon Jul 7 16:57:14 CEST 2014


Commit: 26a8eec3501f52ae3a0a6ef2f23ae65e086f2a12
Author: Brendon Murphy
Date:   Tue Jul 8 00:55:41 2014 +1000
https://developer.blender.org/rBAC26a8eec3501f52ae3a0a6ef2f23ae65e086f2a12

tidy up

Signed-off-by: Brendon Murphy <meta.androcto1 at gmail.com>

===================================================================

M	object_drop_to_ground.py

===================================================================

diff --git a/object_drop_to_ground.py b/object_drop_to_ground.py
index 9600098..30aa857 100644
--- a/object_drop_to_ground.py
+++ b/object_drop_to_ground.py
@@ -168,17 +168,52 @@ class OBJECT_OT_drop_to_ground(Operator):
         return {'FINISHED'}
 
 #################################################################
-def drop_to_ground_button(self, context):
-    self.layout.operator(OBJECT_OT_drop_to_ground.bl_idname,
+class drop_help(bpy.types.Operator):
+	bl_idname = 'help.drop'
+	bl_label = ''
+
+	def draw(self, context):
+		layout = self.layout
+		layout.label("To use:")
+		layout.label("Name the base object 'Ground'")
+		layout.label("Select the object/s to drop")
+		layout.label("Then Shift Select 'Ground'")
+
+    def execute(self, context):
+		return {'FINISHED'}
+
+	def invoke(self, context, event):
+		return context.window_manager.invoke_popup(self, width = 300)
+		
+class Drop_Operator_Panel(bpy.types.Panel):
+    bl_label = "Drop To Ground"
+    bl_region_type = "TOOLS" #UI possible too
+    bl_space_type = "VIEW_3D"
+    bl_options = {'DEFAULT_CLOSED'}
+    bl_context = "objectmode"
+    bl_category = "Addons"
+
+    def draw(self,context):
+        sce = context.scene
+        layout = self.layout
+        row = layout.row()
+        row = layout.split(0.80)
+        row.operator(OBJECT_OT_drop_to_ground.bl_idname,
                          text="Drop to Ground")
+        row.operator('help.drop', icon = 'INFO')
+
 
+
+# register the class
 def register():
     bpy.utils.register_module(__name__)
-    bpy.types.VIEW3D_PT_tools_objectmode.append(drop_to_ground_button)
+
+    pass
 
 def unregister():
     bpy.utils.unregister_module(__name__)
-    bpy.types.VIEW3D_PT_tools_objectmode.remove(drop_to_ground_button)
 
-if __name__ == '__main__':
+    pass
+
+if __name__ == "__main__":
     register()



More information about the Bf-extensions-cvs mailing list