Add seventh H3 scene image slot
This commit is contained in:
+30
-10
@@ -172,8 +172,16 @@ def _h3_plan_binding_entry(plan):
|
||||
return token, counts
|
||||
|
||||
|
||||
def _scene_images_tuple(image1=None, image2=None, image3=None, image4=None, image5=None, image6=None):
|
||||
return (image1, image2, image3, image4, image5, image6)
|
||||
def _scene_images_tuple(
|
||||
image1=None,
|
||||
image2=None,
|
||||
image3=None,
|
||||
image4=None,
|
||||
image5=None,
|
||||
image6=None,
|
||||
image7=None,
|
||||
):
|
||||
return (image1, image2, image3, image4, image5, image6, image7)
|
||||
|
||||
|
||||
def _connected_image_count(images):
|
||||
@@ -489,7 +497,7 @@ class DumasSaveImageNode:
|
||||
|
||||
class DumasH3PlanAttachSceneImagesNode:
|
||||
DESCRIPTION = (
|
||||
"Attach up to six optional IMAGE sockets to one H3 Chain Plan scene "
|
||||
"Attach up to seven optional IMAGE sockets to one H3 Chain Plan scene "
|
||||
"without breaking the upstream plan archive format. Chain multiple "
|
||||
"copies of this node to bind different scene indexes."
|
||||
)
|
||||
@@ -501,7 +509,7 @@ class DumasH3PlanAttachSceneImagesNode:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
optional = {}
|
||||
for slot in range(1, 7):
|
||||
for slot in range(1, 8):
|
||||
optional[f"image{slot}"] = (
|
||||
"IMAGE",
|
||||
{
|
||||
@@ -530,7 +538,7 @@ class DumasH3PlanAttachSceneImagesNode:
|
||||
"step": 1,
|
||||
"tooltip": (
|
||||
"1-based scene index inside the H3 plan. Use one node per "
|
||||
"scene that needs up to six image sockets."
|
||||
"scene that needs up to seven image sockets."
|
||||
),
|
||||
},
|
||||
),
|
||||
@@ -548,10 +556,11 @@ class DumasH3PlanAttachSceneImagesNode:
|
||||
image4=None,
|
||||
image5=None,
|
||||
image6=None,
|
||||
image7=None,
|
||||
):
|
||||
updated_plan = _clone_h3_plan(plan)
|
||||
scene_index = _normalize_h3_scene_index(updated_plan, scene_index)
|
||||
images = _scene_images_tuple(image1, image2, image3, image4, image5, image6)
|
||||
images = _scene_images_tuple(image1, image2, image3, image4, image5, image6, image7)
|
||||
connected_count = _connected_image_count(images)
|
||||
|
||||
token, scene_counts = _h3_plan_binding_entry(updated_plan)
|
||||
@@ -582,11 +591,21 @@ class DumasH3PlanAttachSceneImagesNode:
|
||||
|
||||
class DumasH3PlanExtractSceneImagesNode:
|
||||
DESCRIPTION = (
|
||||
"Read back the six optional image bindings for one H3 Chain Plan scene. "
|
||||
"Read back the seven optional image bindings for one H3 Chain Plan scene. "
|
||||
"Connect clip_index or another scene selector to recover the matching "
|
||||
"scene images downstream."
|
||||
)
|
||||
RETURN_TYPES = (_H3_PLAN_TYPE, "IMAGE", "IMAGE", "IMAGE", "IMAGE", "IMAGE", "IMAGE", "INT")
|
||||
RETURN_TYPES = (
|
||||
_H3_PLAN_TYPE,
|
||||
"IMAGE",
|
||||
"IMAGE",
|
||||
"IMAGE",
|
||||
"IMAGE",
|
||||
"IMAGE",
|
||||
"IMAGE",
|
||||
"IMAGE",
|
||||
"INT",
|
||||
)
|
||||
RETURN_NAMES = (
|
||||
"plan",
|
||||
"image1",
|
||||
@@ -595,6 +614,7 @@ class DumasH3PlanExtractSceneImagesNode:
|
||||
"image4",
|
||||
"image5",
|
||||
"image6",
|
||||
"image7",
|
||||
"connected_images",
|
||||
)
|
||||
FUNCTION = "extract"
|
||||
@@ -633,11 +653,11 @@ class DumasH3PlanExtractSceneImagesNode:
|
||||
scene_index = _normalize_h3_scene_index(passthrough_plan, scene_index)
|
||||
token, _scene_counts = _h3_plan_binding_entry(passthrough_plan)
|
||||
if not token:
|
||||
return (passthrough_plan, None, None, None, None, None, None, 0)
|
||||
return (passthrough_plan, None, None, None, None, None, None, None, 0)
|
||||
|
||||
registry = _H3_PLAN_IMAGE_BINDINGS.get(token) or {}
|
||||
_touch_plan_image_binding(token)
|
||||
images = registry.get(int(scene_index)) or (None, None, None, None, None, None)
|
||||
images = registry.get(int(scene_index)) or (None, None, None, None, None, None, None)
|
||||
return (passthrough_plan, *images, _connected_image_count(images))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user