feat: Update version to 2.0.1, refactor asset library handling, and enhance layer import process
This commit is contained in:
@@ -5,6 +5,7 @@ import bpy
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
|
||||
from ..asset_library import add_bioxel_asset_library
|
||||
from ..constants import LATEST_NODE_LIB_PATH
|
||||
from ..utils import (
|
||||
get_all_layer_objs,
|
||||
@@ -120,6 +121,27 @@ class Help(bpy.types.Operator):
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class AddAssetLibrary(bpy.types.Operator):
|
||||
bl_idname = "bioxel.add_asset_library"
|
||||
bl_label = "Add Nodes Library"
|
||||
bl_description = "Add the bundled O Bioxel asset library"
|
||||
|
||||
def execute(self, context):
|
||||
try:
|
||||
add_bioxel_asset_library()
|
||||
except FileNotFoundError as e:
|
||||
self.report({"ERROR"}, str(e))
|
||||
return {"CANCELLED"}
|
||||
|
||||
for window in context.window_manager.windows:
|
||||
for area in window.screen.areas:
|
||||
if area.type == "NODE_EDITOR":
|
||||
area.tag_redraw()
|
||||
|
||||
self.report({"INFO"}, "O Bioxel asset library is ready.")
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
# 定义虚无化切换操作
|
||||
class TogglePhantom(bpy.types.Operator):
|
||||
"""Toggle object phantom state (ray invisible, no shadows, semi-transparent wireframe)"""
|
||||
|
||||
Reference in New Issue
Block a user