Refactor and enhance DA3 and BEN2 debug panels, introduce mesh export functionality

- Renamed DA3 and BEN2 debug panels for clarity and consistency.
- Added a new function to draw DA3 input settings to reduce code duplication.
- Implemented mesh export functionality, including confidence thresholding and edge filtering.
- Updated export format options to include new mesh type and adjusted related properties.
- Enhanced job handling to move generated inputs into job root and manage temporary directories.
- Improved error handling and file management during export processes.
- Added unit tests for new mesh functionality and ensured existing tests cover changes.
This commit is contained in:
2026-08-09 21:31:08 +08:00
parent 8aac4822c6
commit 6d4d1c4ec2
10 changed files with 778 additions and 136 deletions

View File

@@ -66,8 +66,8 @@ class SnapFormSettings(bpy.types.PropertyGroup):
default="upper_bound_resize",
)
conf_thresh_percentile: bpy.props.FloatProperty(
name="Conf Thresh Percentile",
description="DA3 GLB confidence threshold percentile",
name="Confidence Threshold",
description="Remove the lowest-confidence percentile of points or mesh faces",
default=40.0,
min=0.0,
max=100.0,
@@ -110,24 +110,52 @@ class SnapFormSettings(bpy.types.PropertyGroup):
default="saddle_balanced",
)
export_format: bpy.props.EnumProperty(
name="Export Format",
description="Official DA3 export format",
name="Output Type",
description="Result generated by the DA3 debug task",
items=(
("glb", "GLB", "Export a colored point cloud as GLB"),
("gs_ply", "PLY (3DGS)", "Export Gaussian splats as PLY"),
(
"glb",
"Point Cloud (GLB)",
"Generate a colored point cloud and optional cameras",
),
(
"gs_ply",
"Gaussian Splats (PLY)",
"Generate a 3D Gaussian Splatting PLY",
),
(
"depth_vis",
"Depth Images",
"Export image and depth visualization pairs",
"Depth Preview (Images)",
"Generate image and colored-depth preview pairs",
),
(
"mini_npz",
"Mini NPZ",
"Export compact depth and camera data",
"Depth Data (NPZ)",
"Generate compact depth, confidence, and camera data",
),
(
"mesh",
"Textured Mesh (GLB)",
"Generate one filtered textured depth mesh per input image",
),
),
default="glb",
)
mesh_filter_edges: bpy.props.BoolProperty(
name="Filter Depth Edges",
description="Remove faces around sharp depth transitions",
default=True,
)
mesh_max_edge_length: bpy.props.FloatProperty(
name="Max Edge Length",
description=(
"Remove faces with an edge longer than this scene distance; "
"zero disables the test"
),
default=0.1,
min=0.0,
soft_max=2.0,
)
gs_views_interval: bpy.props.IntProperty(
name="GS Views Interval",
description="Export 3D Gaussians every N input views",