Skip to content

Commit

Permalink
Fixed import error
Browse files Browse the repository at this point in the history
  • Loading branch information
REDxEYE committed Feb 2, 2020
1 parent cb14c40 commit b85f5c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
10 changes: 8 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import bpy
from bpy.props import StringProperty, BoolProperty, CollectionProperty, EnumProperty
from model_import import import_model
from .model_import import import_model


class PyWMDPreferences(bpy.types.AddonPreferences):
Expand Down Expand Up @@ -50,7 +50,7 @@ def execute(self, context):
else:
directory = Path(self.filepath).absolute()
for file in self.files:
import_model(file)
import_model(str(directory / file.name))
return {'FINISHED'}

def invoke(self, context, event):
Expand All @@ -63,11 +63,17 @@ def invoke(self, context, event):
register_, unregister_ = bpy.utils.register_classes_factory(classes)


def menu_import(self, context):
self.layout.operator(WMD_import_OT_operator.bl_idname, text="Pragma model (.wmd)")


def register():
register_()
bpy.types.TOPBAR_MT_file_import.append(menu_import)


def unregister():
bpy.types.TOPBAR_MT_file_import.remove(menu_import)
unregister_()


Expand Down
9 changes: 2 additions & 7 deletions model_import.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import random
from pathlib import Path

if __name__ == '__main__':
import sys

sys.path.append(r"F:\PYTHON_STUFF\blender_wmd")

from PyWMD.byte_io_wmd import ByteIO
from PyWMD.pragma_model import PragmaModel, PragmaBone, PragmaMeshV24Plus
from .PyWMD.byte_io_wmd import ByteIO
from .PyWMD.pragma_model import PragmaModel, PragmaBone, PragmaMeshV24Plus
import bpy
from mathutils import Vector, Quaternion, Matrix

Expand Down

0 comments on commit b85f5c6

Please sign in to comment.