Closed 09williamsad closed 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.
It should be fixed in the latest commit. Download the latest hotfix to access this feature.
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
So now you should call bpy.ops.import_scene.custom_nif(). Sorry that I didn't tell you.
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.
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")