Yes, thank you.
I am trying to make the importer, however ops.py from bpy cannot call the operator.
Traceback (most recent call last):
File "\Text", line 23, in <module>
File "\Text", line 20, in import_models_from_directory
File "C:\blender-git\build_windows_x64_vc16_Release\bin\Release\3.0\scripts\modules\bpy\ops.py", line 132, in __call__
ret = _op_call(self.idname_py(), None, kw)
AttributeError: Calling operator "bpy.ops.import_mesh.ascii" error, could not be found
Error: Python script failed, check the message in the system console
I added this to the init.py file for the plugin:
lass ImportXNA(bpy.types.Operator, ImportHelper):
"""Load a XNALara file"""
bl_idname = "import_mesh.xna"
bl_label = "Import XNA"
bl_options = {'PRESET','UNDO'}
files: CollectionProperty(
name="File Path",
description="File path used for importing the XNA file",
type=bpy.types.OperatorFileListElement,
)
#I don't know what I am doing :[
hide_props_region: BoolProperty(
name="Hide Operator Properties",
description="Collaps the region displaying the operator settings",
default=True,
)
directory: StringProperty()
filename_ext = ".ascii"
filter_glob: StringProperty(
default="*.ascii;*.mesh",
options={'HIDDEN'}
)
def exeute(self, context):
import os
from . import import_xnalara_model
print('Started executing')
context.window.cursor_set('WAIT')
paths = [
os.path.join(self.directory, name.name)
for name in self.files
]
if not paths:
paths.append(self.filepath)
for path in paths:
#import_xnalara_model.load(self, context, path)
import_xnalara_model.loadXpsFile(self, path)
context.window.cursor_set('DEFAULT')
return {'FINISHED'}
I added the class so it would register and unregister as well. What should I do to fix the ops error?