kopia lustrzana https://github.com/torrinworx/Blend_My_NFTs
imports work when called from the command line
rodzic
3c1db95e57
commit
443137f063
11
__init__.py
11
__init__.py
|
@ -14,9 +14,12 @@ import bpy
|
|||
from bpy.app.handlers import persistent
|
||||
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import importlib
|
||||
|
||||
#a little hacky bs
|
||||
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
|
||||
|
||||
if bpy in locals():
|
||||
importlib.reload(DNA_Generator)
|
||||
|
@ -27,7 +30,7 @@ if bpy in locals():
|
|||
importlib.reload(Checks)
|
||||
|
||||
else:
|
||||
from .main import \
|
||||
from main import \
|
||||
DNA_Generator, \
|
||||
Batch_Sorter, \
|
||||
Exporter, \
|
||||
|
@ -480,10 +483,9 @@ class export_settings(bpy.types.Operator):
|
|||
save_path = bpy.path.abspath(bpy.context.scene.my_tool.save_path)
|
||||
filename = "Config.cfg"
|
||||
|
||||
#self.report({'INFO'}, f"Saved settings to: {save_path + filename}!")
|
||||
|
||||
settings = bpy.context.scene.my_tool;
|
||||
|
||||
#could probably have made this a lot cleaner looking
|
||||
with open(save_path + filename, 'w') as f:
|
||||
output = "#This file was auto-generated from the Blend_My_NFTs addon and is used" + "\n"
|
||||
output += "#when running Blend_My_NFTs in a headless environment." + "\n"
|
||||
|
@ -527,6 +529,8 @@ class export_settings(bpy.types.Operator):
|
|||
|
||||
print(output, file=f)
|
||||
|
||||
self.report({'INFO'}, f"Saved settings to: {save_path + filename}!")
|
||||
|
||||
return {"FINISHED"}
|
||||
|
||||
class BMNFTS_PT_ExportSettings(bpy.types.Panel):
|
||||
|
@ -599,6 +603,5 @@ def unregister():
|
|||
|
||||
del bpy.types.Scene.my_tool
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
register()
|
||||
|
|
Ładowanie…
Reference in New Issue