Skip to content

Commit

Permalink
Fix importers not having file extension filters
Browse files Browse the repository at this point in the history
lasa01 committed Jun 10, 2022
1 parent 9725e88 commit bc09350
Showing 3 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions plumber/importer/mdl.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Set

from bpy.types import Context, Panel
from bpy.props import StringProperty

from . import (
GameFileImporterOperator,
@@ -26,6 +27,14 @@ class ImportMdl(
bl_label = "Import MDL"
bl_options = {"REGISTER", "UNDO"}

filename_ext = ".mdl"

filter_glob: StringProperty(
default="*.mdl",
options={"HIDDEN"},
maxlen=255,
)

def execute(self, context: Context) -> Set[str]:
fs = self.get_game_fs(context)

2 changes: 1 addition & 1 deletion plumber/importer/vmf.py
Original file line number Diff line number Diff line change
@@ -299,7 +299,7 @@ def execute(self, context: Context) -> Set[str]:
except OSError as err:
self.report({"ERROR"}, f"Could not parse vmf: {err}")
return {"CANCELLED"}

asset_callbacks.finish()

return {"FINISHED"}
9 changes: 9 additions & 0 deletions plumber/importer/vmt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Set

from bpy.types import Context, Panel
from bpy.props import StringProperty

from . import (
GameFileImporterOperator,
@@ -24,6 +25,14 @@ class ImportVmt(
bl_label = "Import VMT"
bl_options = {"REGISTER", "UNDO"}

filename_ext = ".vmt"

filter_glob: StringProperty(
default="*.vmt",
options={"HIDDEN"},
maxlen=255,
)

def execute(self, context: Context) -> Set[str]:
fs = self.get_game_fs(context)

0 comments on commit bc09350

Please sign in to comment.