Skip to content

Commit

Permalink
Added batch import feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Psycrow101 committed Dec 8, 2023
1 parent 5aa0461 commit 9bb2049
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions io_scene_bfbb_anm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import bpy
from bpy.props import (
CollectionProperty,
EnumProperty,
FloatProperty,
IntProperty,
Expand All @@ -9,6 +10,7 @@
ImportHelper,
ExportHelper,
)
from pathlib import Path

bl_info = {
"name": "Battle for Bikini Bottom Animation",
Expand Down Expand Up @@ -45,13 +47,17 @@ class ImportBFBBAnm(bpy.types.Operator, ImportHelper):
default=30.0,
)

files: CollectionProperty(type=bpy.types.PropertyGroup)

def execute(self, context):
from . import import_bfbb_anm

keywords = self.as_keywords(ignore=("filter_glob",
))

return import_bfbb_anm.load(context, **keywords)
files_dir = Path(self.filepath)
for selection in self.files:
file_path = Path(files_dir.parent, selection.name)
if file_path.suffix.lower() == self.filename_ext:
import_bfbb_anm.load(context, file_path, self.fps)
return {'FINISHED'}


class ExportBFBBAnm(bpy.types.Operator, ExportHelper):
Expand Down
2 changes: 1 addition & 1 deletion io_scene_bfbb_anm/import_bfbb_anm.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def create_action(arm_obj, anm, fps):

return act

def load(context, filepath, *, fps):
def load(context, filepath, fps):
arm_obj = context.view_layer.objects.active
if not arm_obj or type(arm_obj.data) != bpy.types.Armature:
context.window_manager.popup_menu(invalid_active_object, title='Error', icon='ERROR')
Expand Down

0 comments on commit 9bb2049

Please sign in to comment.