feat(node_assets): add image plane geometry nodes and validation scripts
- Implemented `image_plane.py` to build the Image Plane Geometry Nodes group with customizable parameters for geometry, subdivide, and thickness. - Created `image_plane_validation.py` to validate the functionality of the image plane, ensuring correct geometry generation and material assignment. - Developed `material_layers.py` to construct shader node groups for image materials, including depth and normal handling. - Authored `plane_layouts.py` to define node arrangements for image geometry assets. - Introduced `shadeless.py` to create a shadeless shader node group that displays color without scene lighting while preserving shadows and reflections.
This commit is contained in:
@@ -1,11 +1,6 @@
|
||||
import bpy
|
||||
|
||||
from .runtime import runtime
|
||||
from .properties import (
|
||||
BEN2_MODEL_KEY,
|
||||
model_ready,
|
||||
)
|
||||
from .server.model_catalog import UPSCALE_MODELS
|
||||
|
||||
class ServerPanel(bpy.types.Panel):
|
||||
bl_label = "Job Server"
|
||||
@@ -110,154 +105,3 @@ class ServerPanel(bpy.types.Panel):
|
||||
text="",
|
||||
icon="TRASH",
|
||||
)
|
||||
|
||||
|
||||
class DebugPanel(bpy.types.Panel):
|
||||
bl_label = "Debug"
|
||||
bl_idname = "ANYIMAGE_PT_debug"
|
||||
bl_space_type = "VIEW_3D"
|
||||
bl_region_type = "UI"
|
||||
bl_category = "AnyImage"
|
||||
bl_options = {"DEFAULT_CLOSED"}
|
||||
bl_order = 2
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
settings = context.scene.anyimage_settings
|
||||
|
||||
layout.prop(settings, "device")
|
||||
|
||||
|
||||
def draw_da3_input_settings(layout, settings, model_property):
|
||||
layout.prop(settings, model_property)
|
||||
layout.prop(settings, "input_path")
|
||||
input_path = bpy.path.abspath(settings.input_path)
|
||||
if input_path.lower().endswith(
|
||||
(
|
||||
".mp4",
|
||||
".mov",
|
||||
".avi",
|
||||
".mkv",
|
||||
".webm",
|
||||
".m4v",
|
||||
".mts",
|
||||
".mpg",
|
||||
".mpeg",
|
||||
)
|
||||
):
|
||||
layout.prop(settings, "video_frames")
|
||||
layout.prop(settings, "process_res")
|
||||
layout.prop(settings, "process_res_method")
|
||||
layout.prop(settings, "ref_view_strategy")
|
||||
|
||||
|
||||
class Da3OutputDebugPanel(bpy.types.Panel):
|
||||
bl_label = "DA3"
|
||||
bl_idname = "ANYIMAGE_PT_debug_da3_output"
|
||||
bl_parent_id = DebugPanel.bl_idname
|
||||
bl_space_type = "VIEW_3D"
|
||||
bl_region_type = "UI"
|
||||
bl_category = "AnyImage"
|
||||
bl_options = {"DEFAULT_CLOSED"}
|
||||
bl_order = 1
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
settings = context.scene.anyimage_settings
|
||||
|
||||
draw_da3_input_settings(layout, settings, "model")
|
||||
export_row = layout.row()
|
||||
export_row.enabled = (
|
||||
not runtime.server_busy()
|
||||
and model_ready(settings.model)
|
||||
)
|
||||
export_row.operator(
|
||||
"anyimage.debug_da3",
|
||||
text="Run DA3 API",
|
||||
icon="EXPORT",
|
||||
)
|
||||
|
||||
|
||||
class Moge2ApiDebugPanel(bpy.types.Panel):
|
||||
bl_label = "MoGe-2"
|
||||
bl_idname = "ANYIMAGE_PT_debug_moge2_api"
|
||||
bl_parent_id = DebugPanel.bl_idname
|
||||
bl_space_type = "VIEW_3D"
|
||||
bl_region_type = "UI"
|
||||
bl_category = "AnyImage"
|
||||
bl_options = {"DEFAULT_CLOSED"}
|
||||
bl_order = 0
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
settings = context.scene.anyimage_settings
|
||||
layout.prop(settings, "input_path")
|
||||
layout.prop(settings, "moge_model")
|
||||
layout.prop(settings, "moge_resolution_level")
|
||||
run_row = layout.row()
|
||||
run_row.enabled = (
|
||||
not runtime.server_busy()
|
||||
and model_ready(settings.moge_model)
|
||||
)
|
||||
run_row.operator(
|
||||
"anyimage.debug_moge2",
|
||||
text="Run MoGe-2 API",
|
||||
icon="EXPORT",
|
||||
)
|
||||
|
||||
|
||||
class Ben2RemovalDebugPanel(bpy.types.Panel):
|
||||
bl_label = "BEN2"
|
||||
bl_idname = "ANYIMAGE_PT_debug_ben2_removal"
|
||||
bl_parent_id = DebugPanel.bl_idname
|
||||
bl_space_type = "VIEW_3D"
|
||||
bl_region_type = "UI"
|
||||
bl_category = "AnyImage"
|
||||
bl_options = {"DEFAULT_CLOSED"}
|
||||
bl_order = 2
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
settings = context.scene.anyimage_settings
|
||||
|
||||
layout.prop(settings, "background_input_path")
|
||||
background_row = layout.row()
|
||||
background_row.enabled = (
|
||||
not runtime.server_busy()
|
||||
and model_ready(BEN2_MODEL_KEY)
|
||||
)
|
||||
background_row.operator(
|
||||
"anyimage.debug_ben2",
|
||||
text="Remove Background",
|
||||
icon="IMAGE_ALPHA",
|
||||
)
|
||||
|
||||
|
||||
class UpscaleDebugPanel(bpy.types.Panel):
|
||||
bl_label = "Upscale"
|
||||
bl_idname = "ANYIMAGE_PT_debug_upscale"
|
||||
bl_parent_id = DebugPanel.bl_idname
|
||||
bl_space_type = "VIEW_3D"
|
||||
bl_region_type = "UI"
|
||||
bl_category = "AnyImage"
|
||||
bl_options = {"DEFAULT_CLOSED"}
|
||||
bl_order = 3
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
settings = context.scene.anyimage_settings
|
||||
layout.prop(settings, "input_path")
|
||||
input_path = bpy.path.abspath(settings.input_path)
|
||||
if input_path.lower().endswith(
|
||||
(".mp4", ".mov", ".avi", ".mkv", ".webm", ".m4v", ".mts", ".mpg", ".mpeg")
|
||||
):
|
||||
layout.prop(settings, "video_frames")
|
||||
for model in UPSCALE_MODELS.values():
|
||||
row = layout.row()
|
||||
row.enabled = not runtime.server_busy() and model_ready(model.key)
|
||||
operator = row.operator(
|
||||
"anyimage.debug_upscale",
|
||||
text=f"Run {model.label} API",
|
||||
icon="EXPORT",
|
||||
)
|
||||
operator.model = model.key
|
||||
|
||||
Reference in New Issue
Block a user