more bpy.context removal, menus are working again (check it)
authorCarlos Padial <palidoestudio2@gmail.com>
Mon, 7 Jan 2013 00:10:15 +0000 (00:10 +0000)
committerCarlos Padial <palidoestudio2@gmail.com>
Mon, 7 Jan 2013 00:10:15 +0000 (00:10 +0000)
recursive loader is no longer a panel, it has been added as operator in the sequencer add menu

sequencer_extra_actions/__init__.py
sequencer_extra_actions/functions.py
sequencer_extra_actions/operators_extra_actions.py
sequencer_extra_actions/ui.py

index 675abc683e84af47d9737317cd4b0718643cd656..7e6383f16cd5ed664cface96859c5a4d1c7a0b34 100644 (file)
@@ -50,6 +50,7 @@ def register():
     bpy.utils.register_module(__name__)
 
     # Append menu entries
+    bpy.types.SEQUENCER_MT_add.prepend(ui.sequencer_add_menu_func)
     bpy.types.SEQUENCER_MT_select.prepend(ui.sequencer_select_menu_func)
     bpy.types.SEQUENCER_MT_strip.prepend(ui.sequencer_strip_menu_func)
     bpy.types.SEQUENCER_HT_header.append(ui.sequencer_header_func)
@@ -73,6 +74,7 @@ def unregister():
     bpy.utils.unregister_module(__name__)
 
     #  Remove menu entries
+    bpy.types.SEQUENCER_MT_add.remove(ui.sequencer_add_menu_func)
     bpy.types.SEQUENCER_MT_select.remove(ui.sequencer_select_menu_func)
     bpy.types.SEQUENCER_MT_strip.remove(ui.sequencer_strip_menu_func)
     bpy.types.SEQUENCER_HT_header.remove(ui.sequencer_header_func)
index 0d52ef724bd87267b7bd3946b85f31e9090bb8c0..f52376eac90fd34b91c44e412a0441ce544248c2 100644 (file)
@@ -149,12 +149,12 @@ def getfilepathfrombrowser():
         params
     except UnboundLocalError:
         #print("no browser")
-        self.report({'ERROR_INVALID_INPUT'}, 'No visible File Browser')
+        #self.report({'ERROR_INVALID_INPUT'}, 'No visible File Browser')
         return {'CANCELLED'}
 
     if params.filename == '':
         #print("no file selected")
-        self.report({'ERROR_INVALID_INPUT'}, 'No file selected')
+        #self.report({'ERROR_INVALID_INPUT'}, 'No file selected')
         return {'CANCELLED'}
     path = params.directory
     filename = params.filename
index bfa65bfb56a752add588e59b337a3a5c67c303f7..37d0ea66919d64e94265e789794ed77dfdfb1ae6 100644 (file)
@@ -40,6 +40,7 @@ from . import exiftool
 
 # Initialization
 
+
 def initSceneProperties(context, scn):
     try:
         if context.scene.scene_initialized == True:
@@ -1706,22 +1707,22 @@ class Sequencer_Extra_RecursiveLoader(bpy.types.Operator):
     bl_options = {'REGISTER', 'UNDO'}
     
     default_recursive = BoolProperty(
-        name='Recursive',
+        name='recursive',
         description='Load in recursive folders',
         default=False)
         
     default_recursive_ext = BoolProperty(
-        name='Recursive extension',
-        description='Load in recursive folders',
+        name='select by extension',
+        description='Load by extension',
         default=False)
         
     default_ext = EnumProperty(
         items=functions.movieextdict,
-        name="ext enum",
+        name="extension",
         default="3")
         
     default_recursive_proxies = BoolProperty(
-        name='Recursive proxies',
+        name='use proxies',
         description='Load in recursive folders',
         default=False)
     build_25 = BoolProperty(name='default_build_25',
@@ -1769,10 +1770,10 @@ class Sequencer_Extra_RecursiveLoader(bpy.types.Operator):
         self.proxy_suffix = scn.default_proxy_suffix
         self.proxy_extension = scn.default_proxy_extension
         self.proxy_path = scn.default_proxy_path
-        self.default_recursive = scn.default_recursive
-        self.default_recursive_ext = scn.default_recursive_ext
-        self.default_recursive_proxies = scn.default_recursive_proxies
-        self.default_ext = scn.default_ext 
+        self.recursive = scn.default_recursive
+        self.recursive_ext = scn.default_recursive_ext
+        self.recursive_proxies = scn.default_recursive_proxies
+        self.ext = scn.default_ext 
         
         return context.window_manager.invoke_props_dialog(self)  
         
@@ -1784,18 +1785,18 @@ class Sequencer_Extra_RecursiveLoader(bpy.types.Operator):
                 try:
                     if self.default_recursive_proxies:
                         bpy.ops.sequencerextra.placefromfilebrowserproxy(
-                            proxy_suffix=self.default_proxy_suffix,
-                            proxy_extension=self.default_proxy_extension,
-                            proxy_path=self.default_proxy_path,
-                            build_25=self.default_build_25,
-                            build_50=self.default_build_50,
-                            build_75=self.default_build_75,
-                            build_100=self.default_build_100)
+                            proxy_suffix=self.proxy_suffix,
+                            proxy_extension=self.proxy_extension,
+                            proxy_path=self.proxy_path,
+                            build_25=self.build_25,
+                            build_50=self.build_50,
+                            build_75=self.build_75,
+                            build_100=self.build_100)
                     else:
                         bpy.ops.sequencerextra.placefromfilebrowser()
                 except:
                     print("Error loading file (recursive loader error): ", i[1])
-                    functions.add_marker(i[1], context)
+                    functions.add_marker(context, i[1])
                     #self.report({'ERROR_INVALID_INPUT'}, 'Error loading file ')
                     pass
 
@@ -1804,9 +1805,11 @@ class Sequencer_Extra_RecursiveLoader(bpy.types.Operator):
         scn = context.scene
         initSceneProperties(context, scn)
         if scn["default_recursive"] == True:
-            self.loader(context, functions.sortlist(functions.recursive(context, self.default_recursive_ext)))
+            self.loader(context, functions.sortlist(\
+            functions.recursive(context, self.default_recursive_ext)))
         else:
-            self.loader(context, functions.sortlist(functions.onefolder(context, self.default_recursive_ext)))
+            self.loader(context, functions.sortlist(functions.onefolder(\
+            context, self.default_recursive_ext)))
         return {'FINISHED'}
 
 
@@ -1823,7 +1826,7 @@ class Sequencer_Extra_ReadExifData(bpy.types.Operator):
         strip = functions.act_strip(context)
         scn = context.scene
         if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
-            return (strip.type == 'IMAGE')
+            return (strip.type == 'IMAGE' or 'MOVIE')
         else:
             return False
 
index f092d334545aac3eb5f5c99728b7c03b000f4f5c..a8bd5bfbb8d91d0550f00814037e271a9a1333a3 100644 (file)
@@ -35,28 +35,10 @@ class SEQUENCER_EXTRA_MT_input(bpy.types.Menu):
         text='Create Movieclip strip', icon='PLUGIN')
 
 
-class AddRecursiveLoadPanel(bpy.types.Panel):
-    bl_label = "Recursive Load"
-    bl_space_type = "SEQUENCE_EDITOR"
-    bl_region_type = "UI"
-
-    @staticmethod
-    def has_sequencer(context):
-        return (context.space_data.view_type\
-        in {'SEQUENCER', 'SEQUENCER_PREVIEW'})
-
-    @classmethod
-    def poll(cls, context):
-        return cls.has_sequencer(context)
-
-    def draw_header(self, context):
-        layout = self.layout
-        layout.label(text="", icon="NLA")
-
-    def draw(self, context):
-        self.layout.operator("sequencerextra.recursiveload",
-            text="Import from Browser")
-
+def sequencer_add_menu_func(self, context):
+    self.layout.operator('sequencerextra.recursiveload', 
+    text='recursive load from browser', icon='PLUGIN')
+    self.layout.separator()
 
 
 def sequencer_select_menu_func(self, context):