simvx.core._scene_internal

In-memory node-tree snapshot helpers.

These functions serialise a live :class:Node subtree to a plain dict and reconstruct it again. They are the engine’s transient snapshot primitive – used for clipboard copy/paste, editor autosave envelopes, play-mode serialise/restore, and hot-reload state preservation. They are not a disk serialisation format: scenes on disk are Python source via

mod:

simvx.core.scene_io.

Private to the engine – consumers import via this private module path.

Module Contents

Functions

independent_copy

A value one node can mutate without reaching into another that holds it.

API

simvx.core._scene_internal.independent_copy(value)[source]

A value one node can mutate without reaching into another that holds it.

A snapshot records the live Property values, so a node rebuilt from one has to be handed copies or the two share a single object: adding an animation to a pasted AnimatedSprite2D would add it to the sprite it was copied from, and the symptom would appear on the node the author did not edit.

What is copied is the authoring state a node owns: containers, the mutable dataclasses inside them, and the numeric arrays Vec2, Vec3 and Quat are. What is shared is everything a node refers to: a texture, a physics shape (Shape.build memoises per world, so the sharing is load-bearing), another node, and any frozen dataclass, which cannot drift apart in the first place.