- ExportBatPack and BAT_OT_export_zip: catch EnvironmentError (typically
raised when zstandard is missing or the installed wheel is incompatible
with the embedded Python) and any other exception, and report it via
self.report instead of crashing the operator.
- file2blocks.BlockIterator: skip libraries that fail to open with a
warning instead of aborting the whole trace, so production blends with
one stale linked library still pack.
- preferences: use __package__ (stable, full dotted path) for the
AddonPreferences bl_idname instead of __name__.split('.')[0], which
breaks when the add-on is loaded under an unexpected module name.
- magic_compression: zstandard handling tweaks alongside the operator
error reports above.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
53 lines
1.6 KiB
Python
Executable File
53 lines
1.6 KiB
Python
Executable File
import bpy
|
|
from bpy.props import (FloatProperty,
|
|
BoolProperty,
|
|
EnumProperty,
|
|
StringProperty,
|
|
IntProperty,
|
|
PointerProperty)
|
|
|
|
def get_addon_prefs():
|
|
prefs = bpy.context.preferences
|
|
return prefs.addons[__package__].preferences
|
|
|
|
class myaddonPrefs(bpy.types.AddonPreferences):
|
|
bl_idname = __package__
|
|
|
|
root_default : bpy.props.StringProperty(
|
|
name='Default Root',
|
|
description="Default root folder path when using export to Zip",
|
|
subtype='DIR_PATH',
|
|
default='')
|
|
|
|
use_env_root : BoolProperty(
|
|
name="Use Environement Root",
|
|
description="Use root path specified by environnement keys at startup\nUsing key 'ZIP_ROOT' or 'PROJECT_ROOT' if exists (priority to key ZIP_ROOT if both are set)\nElse always use prefs.",
|
|
default=True,
|
|
)
|
|
|
|
def draw(self, context):
|
|
layout = self.layout
|
|
col = layout.column()
|
|
col.label(text='Export to Zip preferences:')
|
|
col.prop(self, 'root_default')
|
|
|
|
col = layout.column()
|
|
col.label(text='If specified, will be the default root folder path when using export to Zip')
|
|
col.label(text='Typically the root folder of the current project')
|
|
col.prop(self, 'use_env_root')
|
|
|
|
|
|
|
|
### --- REGISTER ---
|
|
|
|
classes=(
|
|
myaddonPrefs,
|
|
)
|
|
|
|
def register():
|
|
for cls in classes:
|
|
bpy.utils.register_class(cls)
|
|
|
|
def unregister():
|
|
for cls in reversed(classes):
|
|
bpy.utils.unregister_class(cls) |