Build a scene from a script
kinematic.graph makes nodes, sets them and wires them. Every node a script makes lands on the canvas like one you placed by hand, so you can open any of them and keep going. Wrap the calls in an undo group and one Cmd-Z takes the whole script back.
import colorsys import kinematic.graph as kg g = kg.current() rings = g.create_node("3DGeoMerge", position=(1210, 440), config={"num_inputs": 12}) for i in range(12): ring = g.create_node("3DGeoTorus", position=(i * 220, 0), config={ "major_radius": 1 + 0.07 * i, "minor_radius": 0.06, "major_segments": 160, "t_rx": 15 * i}) # a driver: read again on every frame ring.config["t_ry"] = ( f"#(time * {45 * (1 + i % 3)} + {30 * i}) % 360") rgb = colorsys.hsv_to_rgb(i / 12, 0.7, 1.0) hex_color = "#" + bytes(int(c * 255) for c in rgb).hex() tint = g.create_node("3DGeoColor", position=(i * 220, 200), config={"color": kg.literal(hex_color)}) g.connect(ring, "Geometry_Out", tint, "Geometry_In") g.connect(tint, "Geometry_Out", rings, f"Geometry_In_{i + 1}")















