feat: Update version to 0.13.0 in project files and adjust dependencies

This commit is contained in:
2026-09-02 19:50:55 +08:00
parent 8d279e9ab3
commit a6041cbe03
47 changed files with 1204 additions and 587 deletions

View File

@@ -6,6 +6,7 @@ from node_graph import expand_smooth
from anyimage.operators.cutout_tool.shape import (
BALLOON_ATTRIBUTE_NAME,
CUTOUT_AXIS_TO_SOURCE,
CUTOUT_NODE_GROUP_NAME,
CUTOUT_NODE_GROUP_NAMES,
CUTOUT_SHAPE_LABELS,
@@ -834,6 +835,8 @@ def build_cutout_modifier_group(shape_groups):
group.is_modifier = True
_socket(group, "Geometry", "INPUT", "NodeSocketGeometry")
_socket(group, "Shape", "INPUT", "NodeSocketMenu")
inward_axis = _socket(group, "Inward Axis", "INPUT", "NodeSocketMenu")
inward_axis.hide_in_modifier = True
thickness = _float_input(group, "Thickness", 0.0, 0.0)
thickness.description = (
@@ -968,7 +971,27 @@ def build_cutout_modifier_group(shape_groups):
menu_switch.outputs["Output"],
iterations_name="Smooth Iterations",
)
_shade_output(group, geometry, (3350.0, 550.0))
from mathutils import Matrix
orient = group.nodes.new("GeometryNodeTransform")
orient.inputs["Rotation"].default_value = Matrix(CUTOUT_AXIS_TO_SOURCE).to_euler()
orient.location = (3300.0, 350.0)
group.links.new(geometry, orient.inputs["Geometry"])
axis_switch = group.nodes.new("GeometryNodeMenuSwitch")
axis_switch.data_type = "GEOMETRY"
axis_switch.enum_items[0].name = "-Z"
axis_switch.enum_items[1].name = "+X"
axis_switch.location = (3550.0, 550.0)
axis_controls = _group_input(
group.nodes,
(3300.0, -650.0),
{"Inward Axis"},
)
group.links.new(axis_controls.outputs["Inward Axis"], axis_switch.inputs["Menu"])
group.links.new(orient.outputs["Geometry"], axis_switch.inputs["-Z"])
group.links.new(geometry, axis_switch.inputs["+X"])
_shade_output(group, axis_switch.outputs["Output"], (3850.0, 550.0))
group.color_tag = "GEOMETRY"
group.description = (
"Build Surface, Balloon, Depth Balloon, or Depth Surface from one "

View File

@@ -116,7 +116,12 @@ def main():
assert cutout.name == CUTOUT_NODE_GROUP_NAME
assert cutout.bl_idname == "GeometryNodeTree"
assert cutout.is_modifier
assert input_names(cutout)[:3] == ["Geometry", "Shape", "Thickness"]
assert input_names(cutout)[:4] == [
"Geometry",
"Shape",
"Inward Axis",
"Thickness",
]
assert set(cutout_groups) == set(CUTOUT_NODE_GROUP_NAMES.values())
for group in cutout_groups.values():
assert group.bl_idname == "GeometryNodeTree"

View File

@@ -56,6 +56,7 @@ def add_modifier(obj, shape, thickness):
modifier.node_group = group
for name, value in (
("Shape", shapes.CUTOUT_SHAPE_INDICES[shape]),
("Inward Axis", 1),
("Cleanup", 0.0),
("Smooth", 0.0),
("Smooth Iterations", 0),
@@ -96,6 +97,25 @@ def main():
and link.to_socket.name == "Menu"
for link in wrapper.links
)
axis_switch = next(
node
for node in wrapper.nodes
if node.bl_idname == "GeometryNodeMenuSwitch"
and [item.name for item in node.enum_items] == ["-Z", "+X"]
)
assert any(
link.from_socket.name == "Inward Axis"
and link.to_node == axis_switch
and link.to_socket.name == "Menu"
for link in wrapper.links
)
assert all(
any(
link.to_node == axis_switch and link.to_socket.name == axis
for link in wrapper.links
)
for axis in ("-Z", "+X")
)
child_nodes = {
node.node_tree: node
for node in wrapper.nodes
@@ -113,6 +133,7 @@ def main():
assert input_names(wrapper) == [
"Geometry",
"Shape",
"Inward Axis",
"Thickness",
"Depth Scale",
"Double Sided",