feat(ui): 添加渲染图像列表和清理功能
- 新增属性组 `Comfy_RenderedImageItem` 用于存储渲染图像信息 - 在面板中添加渲染图像列表显示,支持缩略图预览和打开文件夹 - 为深度和法线渲染添加结果自动记录功能 - 新增清理操作符,用于删除生成的多视角对象和相机并恢复原始对象 - 改进操作符的 poll 条件,在已有结果时提示先清理 - 在注销时清理预览集合和自定义属性
This commit is contained in:
16
__init__.py
16
__init__.py
@@ -12,7 +12,8 @@ bl_info = {
|
||||
}
|
||||
|
||||
import bpy # noqa: E402
|
||||
from .utils import classes # noqa: E402
|
||||
from .utils import classes, cleanup_preview_collections # noqa: E402
|
||||
from .utils import Comfy_RenderedImageItem # noqa: E402
|
||||
|
||||
|
||||
def register():
|
||||
@@ -30,9 +31,21 @@ def register():
|
||||
],
|
||||
default='1024',
|
||||
)
|
||||
bpy.types.Scene.sna_rendered_images = bpy.props.CollectionProperty(
|
||||
type=Comfy_RenderedImageItem,
|
||||
)
|
||||
bpy.types.Scene.sna_rendered_images_index = bpy.props.IntProperty(
|
||||
name="Active Rendered Image Index",
|
||||
default=0,
|
||||
)
|
||||
|
||||
|
||||
def unregister():
|
||||
cleanup_preview_collections()
|
||||
if hasattr(bpy.types.Scene, "sna_rendered_images_index"):
|
||||
del bpy.types.Scene.sna_rendered_images_index
|
||||
if hasattr(bpy.types.Scene, "sna_rendered_images"):
|
||||
del bpy.types.Scene.sna_rendered_images
|
||||
if hasattr(bpy.types.Scene, "sna_render_resolution"):
|
||||
del bpy.types.Scene.sna_render_resolution
|
||||
if hasattr(bpy.types.Scene, "sna_activeobject_name"):
|
||||
@@ -43,3 +56,4 @@ def unregister():
|
||||
del bpy.types.Scene.sna_activeobject
|
||||
for cls in reversed(classes):
|
||||
bpy.utils.unregister_class(cls)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user