Add operators for model downloading and surface generation

- Implemented `DownloadModel` and `DownloadRequiredModels` operators for downloading models.
- Created `ClearModels` operator to clear model resources.
- Added `ConvertToSurface` operator for converting image empties into textured surfaces.
- Introduced `GenerateDa3Surface` and `GenerateMoge2Surface` operators for generating surfaces using DA3 and MoGe-2 models respectively.
- Developed utility functions for handling image mesh data, assigning attributes, and managing geometry nodes.
- Established runtime configuration and post-installation model downloading in `runtime.py`.
This commit is contained in:
2026-08-20 01:56:04 +08:00
parent ee46d98b93
commit 13ef705226
39 changed files with 4729 additions and 3138 deletions

View File

@@ -11,20 +11,20 @@ sys.path.insert(
str(next((PROJECT_ROOT / "src" / "snapform" / "wheels").glob("blendjob-*.whl"))),
)
from snapform.blender.depth_plane import (
from snapform.operators.material import (
DEPTH_PLANE_MATERIAL_NODE_GROUP_NAME,
material_color_space_name,
SHADELESS_NODE_GROUP_NAME,
SURFACE_MATERIAL_NODE_GROUP_NAME,
add_depth_plane_processing,
create_material,
get_modifier_input,
load_depth_plane_node_group,
material_color_space_name,
modifier_input_driver_path,
modifier_input_identifier,
set_modifier_input,
)
from snapform.blender.surface import load_geometry_node_group
from snapform.operators.depth_plane.build import add_depth_plane_processing
from snapform.operators.surface import load_geometry_node_group
def main():

View File

@@ -12,11 +12,8 @@ sys.path.insert(
str(next((PROJECT_ROOT / "src" / "snapform" / "wheels").glob("blendjob-*.whl"))),
)
from snapform.blender.depth_plane import (
get_modifier_input,
set_modifier_input,
)
from snapform.blender.surface import create_matching_camera, load_geometry_node_group
from snapform.operators.material import get_modifier_input, set_modifier_input
from snapform.operators.surface import create_matching_camera, load_geometry_node_group
def set_input(modifier, group, name, value):

View File

@@ -15,16 +15,14 @@ sys.path.insert(
str(next((PROJECT_ROOT / "src" / "snapform" / "wheels").glob("blendjob-*.whl"))),
)
import snapform.blender.depth_plane as depth_plane
from snapform.blender.depth_plane import (
from snapform.operators.image import create_color_image
from snapform.operators.material import (
MOGE_DEPTH_PLANE_NODE_GROUP_NAME,
MOGE_MATERIAL_NODE_GROUP_NAME,
build_moge2_depth_plane,
create_color_image,
get_modifier_input,
modifier_input_identifier,
)
from snapform.operators.depth_plane.build import build_moge2_depth_plane
def validate_single_frame_source_types():

View File

@@ -13,12 +13,11 @@ sys.path.insert(
str(next((PROJECT_ROOT / "src" / "snapform" / "wheels").glob("blendjob-*.whl"))),
)
from snapform.blender.depth_plane import MOGE_SURFACE_MATERIAL_NODE_GROUP_NAME
from snapform.blender.depth_plane import material_color_space_name
from snapform.blender.surface import (
MOGE_NODE_GROUP_NAME,
build_image_mesh,
from snapform.operators.material import (
MOGE_SURFACE_MATERIAL_NODE_GROUP_NAME,
material_color_space_name,
)
from snapform.operators.surface import MOGE_NODE_GROUP_NAME, build_image_mesh
from snapform.server.geometry import GeometryFrame, build_surface
from snapform.server.outputs.surface import write_surface_archive