tidy up
authorBrendon Murphy <meta.androcto1@gmail.com>
Mon, 7 Jul 2014 14:55:41 +0000 (00:55 +1000)
committerBrendon Murphy <meta.androcto1@gmail.com>
Mon, 7 Jul 2014 14:55:41 +0000 (00:55 +1000)
Signed-off-by: Brendon Murphy <meta.androcto1@gmail.com>
object_drop_to_ground.py

index 96000987a1532f9672c4fc196834c58aafa8454e..30aa857fd2c37fb08b37fda5f583b0ead560d330 100644 (file)
@@ -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()