chore: Update version to 0.12.11, upgrade BlendJob wheel to 0.1.13, and enhance documentation for environment installation and model management
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import bpy
|
||||
|
||||
from .blender import depth_plane as image_depth
|
||||
from .blender import surface as image_mesh
|
||||
from .blender.depth_plane import (
|
||||
ConvertToDepthPlane,
|
||||
RemoveImageBackground,
|
||||
|
||||
@@ -1970,12 +1970,13 @@ class RemoveImageBackground(bpy.types.Operator):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
from ..job_runtime import runtime
|
||||
from ..properties import BEN2_MODEL_KEY, model_ready
|
||||
from ..properties import required_models_ready
|
||||
|
||||
return (
|
||||
is_image_empty(context.object)
|
||||
and runtime.environment_ready()
|
||||
and not runtime.server_busy()
|
||||
and model_ready(BEN2_MODEL_KEY)
|
||||
and required_models_ready()
|
||||
)
|
||||
|
||||
def execute(self, context):
|
||||
@@ -2045,10 +2046,13 @@ class ConvertToDepthPlane(bpy.types.Operator):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
from ..job_runtime import runtime
|
||||
from ..properties import required_models_ready
|
||||
|
||||
return (
|
||||
is_image_empty(context.object)
|
||||
and runtime.environment_ready()
|
||||
and not runtime.server_busy()
|
||||
and required_models_ready()
|
||||
)
|
||||
|
||||
def invoke(self, context, _event):
|
||||
@@ -2170,35 +2174,46 @@ class SnapFormImageMenu(bpy.types.Menu):
|
||||
|
||||
layout = self.layout
|
||||
layout.operator_context = "INVOKE_DEFAULT"
|
||||
if not runtime.environment_ready():
|
||||
environment_ready = runtime.environment_ready()
|
||||
if not environment_ready:
|
||||
layout.operator(
|
||||
"snapform.install_environment",
|
||||
text="Install Environment",
|
||||
icon="IMPORT",
|
||||
)
|
||||
return
|
||||
layout.operator(
|
||||
"snapform.install_environment_mirror",
|
||||
text="Install Environment (Mirror)",
|
||||
icon="IMPORT",
|
||||
)
|
||||
models_ready = required_models_ready()
|
||||
if not models_ready:
|
||||
if environment_ready and not models_ready:
|
||||
layout.operator(
|
||||
"snapform.download_required_models",
|
||||
text="Download Required Models",
|
||||
icon="IMPORT",
|
||||
)
|
||||
features_ready = environment_ready and models_ready
|
||||
if not features_ready:
|
||||
layout.separator()
|
||||
depth_plane_row = layout.row()
|
||||
depth_plane_row.enabled = models_ready
|
||||
depth_plane_row.enabled = features_ready
|
||||
depth_plane_row.operator(
|
||||
"snapform.convert_to_depth_plane",
|
||||
text="Convert to Depth Plane",
|
||||
icon="MOD_DISPLACE",
|
||||
)
|
||||
layout.operator(
|
||||
surface_row = layout.row()
|
||||
surface_row.enabled = features_ready
|
||||
surface_row.operator(
|
||||
"snapform.convert_to_surface",
|
||||
text="Convert to Surface",
|
||||
icon="MESH_GRID",
|
||||
)
|
||||
layout.separator()
|
||||
layout.operator(
|
||||
background_row = layout.row()
|
||||
background_row.enabled = features_ready
|
||||
background_row.operator(
|
||||
"snapform.remove_image_background",
|
||||
text="Remove Background",
|
||||
icon="IMAGE_ALPHA",
|
||||
|
||||
@@ -598,18 +598,14 @@ class ConvertToSurface(bpy.types.Operator):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
from ..job_runtime import runtime
|
||||
from ..properties import model_catalog
|
||||
from ..properties import required_models_ready
|
||||
|
||||
return (
|
||||
is_image_empty(context.object)
|
||||
and video_total_frames(context.object.data) == 1
|
||||
and runtime.environment_ready()
|
||||
and not runtime.server_busy()
|
||||
and any(
|
||||
model.get("ready")
|
||||
and model.get("enabled")
|
||||
and model.get("family") in {"moge2", "da3"}
|
||||
for model in model_catalog()
|
||||
)
|
||||
and required_models_ready()
|
||||
)
|
||||
|
||||
def invoke(self, context, _event):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
schema_version = "1.0.0"
|
||||
|
||||
id = "snapform"
|
||||
version = "0.12.6"
|
||||
version = "0.12.11"
|
||||
name = "SnapForm"
|
||||
tagline = "Build spatial structures from images, fast"
|
||||
maintainer = "OmooLab"
|
||||
@@ -10,7 +10,7 @@ type = "add-on"
|
||||
blender_version_min = "4.5.0"
|
||||
platforms = ["windows-x64", "macos-arm64", "linux-x64"]
|
||||
license = ["SPDX:GPL-3.0-or-later"]
|
||||
wheels = ["./wheels/blendjob-0.1.8-py3-none-any.whl"]
|
||||
wheels = ["./wheels/blendjob-0.1.13-py3-none-any.whl"]
|
||||
|
||||
[permissions]
|
||||
network = "Access the local Job Server and download environment dependencies and model weights"
|
||||
|
||||
@@ -31,6 +31,13 @@ class ServerPanel(bpy.types.Panel):
|
||||
text="Install Environment",
|
||||
icon="IMPORT",
|
||||
)
|
||||
mirror_row = layout.row()
|
||||
mirror_row.enabled = not running
|
||||
mirror_row.operator(
|
||||
"snapform.install_environment_mirror",
|
||||
text="Install Environment (Mirror)",
|
||||
icon="IMPORT",
|
||||
)
|
||||
return
|
||||
|
||||
status = runtime.server_status()
|
||||
|
||||
@@ -42,6 +42,13 @@ class SnapFormPreferences(bpy.types.AddonPreferences):
|
||||
text="Install Environment",
|
||||
icon="IMPORT",
|
||||
)
|
||||
mirror_row = layout.row()
|
||||
mirror_row.enabled = runtime.active_job is None
|
||||
mirror_row.operator(
|
||||
"snapform.install_environment_mirror",
|
||||
text="Install Environment (Mirror)",
|
||||
icon="IMPORT",
|
||||
)
|
||||
layout.separator()
|
||||
layout.operator(
|
||||
"snapform.open_server_log",
|
||||
|
||||
Reference in New Issue
Block a user