SesamePaste233 / StarfieldMeshConverter

Exports assets for Starfield. Supports models, morph, geometry and physics data.
MIT License
17 stars 4 forks source link

Nif import - Python command syntax error #1

Closed 09williamsad closed 10 months ago

09williamsad commented 10 months ago

Plugin version: v0.11 Blender version: 3.6.4 Operating System: Windows 10 Pro 22H2

Example script: import bpy import os bpy.ops.import.custom_nif(filepath="D:/StarfieldExtract/meshes/weapons/tombstone/tombstone.nif")

Resulting error: Error: Python: File "\Text", line 3 bpy.ops.import.custom_nif(filepath="D:/StarfieldExtract/meshes/weapons/tombstone/tombstone.nif") ^^^^^^ SyntaxError: invalid syntax

According to Blender and from what I can see in the init.py, the python command is bpy.ops.import.custom_nif()

This same script works with the Blender FBX importer and I have used methods like this in batch operations with other plugins. So this is presumably a issue with the plugin. import bpy import os bpy.ops.import_scene.fbx(filepath="D:/New folder (3)/wep_sniperrifle__vss_vintorez/art/skins/wskin0165/ob_wep_sniperrifle__vss_vintorez_01_base_01_cosmetics_1p_wskin0165_mesh.fbx")

SesamePaste233 commented 10 months ago

Can confirm the issue. Apparently bpy now uses import_scene instead of import or export to hold the operators. I'll fix that in the next few commits.

SesamePaste233 commented 10 months ago

It should be fixed in the latest commit. Download the latest hotfix to access this feature.

09williamsad commented 10 months ago

I have the same problem with 0.11-pre-release-h2. Error: Python: File "\Text", line 3 bpy.ops.import.custom_nif(filepath="D:/StarfieldExtract/meshes/weapons/tombstone/tombstone.nif") ^^^^^^ SyntaxError: invalid syntax

SesamePaste233 commented 10 months ago

So now you should call bpy.ops.import_scene.custom_nif(). Sorry that I didn't tell you.

09williamsad commented 10 months ago

That works, but the asset folder needs to be specified in the command. bpy.ops.import_scene.custom_nif(filepath="D:/StarfieldExtract/meshes/weapons/ak47/ak_47.nif", assets_folder="D:/StarfieldExtract")

You may want to include script usage in the readme, as I incorrectly assumed that it would use the existing asset folder variable.