TurboWarp-A-Frame

TurboWarp-A-Frame is an unsandboxed TurboWarp extension for building declarative A-Frame scene graphs from blocks.

Scene model

Scratch sprites and backdrops are script containers. The 3D graph is addressed through node ids, classes, data attributes, A-Frame attributes, templates, selectors, and events.

Core blocks

Animation blocks

Development

See the repository README and architecture documentation for build, test, release, compatibility, rollback, collision, and AR fallback details.

TurboWarp-A-Frame: complete block reference

All 36 blocks are documented below, including compatibility blocks and blocks available through optional features. Select a block to read its behavior, arguments, default values, and menu choices. Each block has a permanent link.

create 3D scene with layer [LAYER] mode [MODE]

Loads A-Frame 1.8.0 from jsDelivr when the page does not have it, initializes the A-Frame scene host, and emits the scene ready event.

Block type: COMMAND. Opcode: createScene. Permanent link

ArgumentTypeDefault valueMenu choices
LAYERSTRINGabove-stage
MODESTRING3d

Fixed input controls and value preservation

load template [ID] from JSON [SOURCE]

Stores a declarative scene graph template for later instantiation.

Block type: COMMAND. Opcode: loadTemplate. Permanent link

ArgumentTypeDefault valueMenu choices
IDSTRINGmonster
SOURCESTRING{"type":"box","id":"body","attributes":{"color":"#4cffb0"}}

create [TYPE] node id [ID] under [PARENT]

Creates a primitive, model, text, light, camera, or group node.

Block type: COMMAND. Opcode: createNode. Permanent link

ArgumentTypeDefault valueMenu choices
TYPESTRINGbox
IDSTRINGcard
PARENTSTRING#scene

create template [TEMPLATE] as [INSTANCE] under [PARENT]

Instantiates a stored template under the first node matching the parent selector.

Block type: COMMAND. Opcode: createFromTemplate. Permanent link

ArgumentTypeDefault valueMenu choices
TEMPLATESTRINGmonster
INSTANCESTRINGmonster-1
PARENTSTRING#scene

set selector [SELECTOR] position x [X] y [Y] z [Z]

Sets local position on every node matching the selector.

Block type: COMMAND. Opcode: setPosition. Permanent link

ArgumentTypeDefault valueMenu choices
SELECTORSTRING#card
XNUMBER0
YNUMBER1
ZNUMBER-3

Fixed input controls and value preservation

move selector [SELECTOR] by x [X] y [Y] z [Z]

Offsets local position on every node matching the selector.

Block type: COMMAND. Opcode: moveBy. Permanent link

ArgumentTypeDefault valueMenu choices
SELECTORSTRING#card
XNUMBER0
YNUMBER0
ZNUMBER1

Fixed input controls and value preservation

set selector [SELECTOR] rotation x [X] y [Y] z [Z]

Sets local Euler rotation in degrees on every node matching the selector.

Block type: COMMAND. Opcode: setRotation. Permanent link

ArgumentTypeDefault valueMenu choices
SELECTORSTRING#card
XNUMBER0
YNUMBER45
ZNUMBER0

Fixed input controls and value preservation

add class [CLASS] to selector [SELECTOR]

Adds a CSS-style class to every node matching the selector.

Block type: COMMAND. Opcode: addClass. Permanent link

ArgumentTypeDefault valueMenu choices
CLASSSTRINGmonster
SELECTORSTRING#card

set selector [SELECTOR] data [KEY] to [VALUE]

Sets a data-* value on every node matching the selector.

Block type: COMMAND. Opcode: setData. Permanent link

ArgumentTypeDefault valueMenu choices
SELECTORSTRING#card
KEYSTRINGzone
VALUESTRINGfield

set selector [SELECTOR] attribute [NAME] to [VALUE]

Sets an A-Frame component or HTML attribute on every node matching the selector.

Block type: COMMAND. Opcode: setAttribute. Permanent link

ArgumentTypeDefault valueMenu choices
SELECTORSTRING#card
NAMESTRINGvisible
VALUESTRINGtrue

delete selector [SELECTOR]

Deletes every non-root node matching the selector and its descendants.

Block type: COMMAND. Opcode: deleteSelector. Permanent link

ArgumentTypeDefault valueMenu choices
SELECTORSTRING#card

count selector [SELECTOR]

Returns the number of nodes matching a limited selector.

Block type: REPORTER. Opcode: countSelector. Permanent link

ArgumentTypeDefault valueMenu choices
SELECTORSTRING.monster

event target id

Returns the id of the most recently handled 3D event target.

Block type: REPORTER. Opcode: eventTargetId. Permanent link

This block has no arguments.

emit 3D event [TYPE] from selector [SELECTOR] with data [DATA]

Queues and dispatches a 3D event from the first node matching the selector.

Block type: COMMAND. Opcode: emitEvent. Permanent link

ArgumentTypeDefault valueMenu choices
TYPESTRINGattack
SELECTORSTRING#card
DATASTRING{}

when 3D scene ready

Fires once after create 3D scene initializes the scene host.

Block type: HAT. Opcode: whenSceneReady. Permanent link

This block has no arguments.

when event [TYPE] on selector [SELECTOR]

Fires when a queued 3D event of the given type targets a node matching the selector.

Block type: HAT. Opcode: whenEventOnSelector. Permanent link

ArgumentTypeDefault valueMenu choices
TYPESTRINGattack
SELECTORSTRING.monster

create 3D animation clip [NAME] duration [DURATION]

Creates or replaces a Three.js AnimationClip definition.

Block type: COMMAND. Opcode: createAnimationClip. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGwave
DURATIONNUMBER-1

Fixed input controls and value preservation

delete 3D animation clip [NAME]

Deletes a stored 3D animation clip definition and stops its active actions.

Block type: COMMAND. Opcode: deleteAnimationClip. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGwave

add vector keyframe track to clip [CLIP] path [PATH] times [TIMES] values [VALUES]

Adds a Three.js VectorKeyframeTrack definition with x y z values.

Block type: COMMAND. Opcode: addVectorKeyframeTrack. Permanent link

ArgumentTypeDefault valueMenu choices
CLIPSTRINGmove-up
PATHSTRING.position
TIMESSTRING0,0.5,1
VALUESSTRING0,1,-3, 0,1.5,-3, 0,1,-3

Fixed input controls and value preservation

add quaternion keyframe track to clip [CLIP] path [PATH] times [TIMES] values [VALUES]

Adds a Three.js QuaternionKeyframeTrack definition with x y z w values.

Block type: COMMAND. Opcode: addQuaternionKeyframeTrack. Permanent link

ArgumentTypeDefault valueMenu choices
CLIPSTRINGwave
PATHSTRING.quaternion
TIMESSTRING0,0.5,1
VALUESSTRING0,0,0,1, 0,0,0.389,0.921, 0,0,0,1

Fixed input controls and value preservation

add euler rotation keyframe track to clip [CLIP] path [PATH] times [TIMES] values [VALUES] unit [UNIT]

Adds a quaternion track converted from Euler x y z rotation values.

Block type: COMMAND. Opcode: addEulerRotationKeyframeTrack. Permanent link

ArgumentTypeDefault valueMenu choices
CLIPSTRINGwave
PATHSTRING.quaternion
TIMESSTRING0,0.25,0.5,0.75,1
VALUESSTRING0,0,0, 0,0,0.8, 0,0,0, 0,0,-0.8, 0,0,0
UNITSTRINGradians

Fixed input controls and value preservation

add position keyframe to clip [CLIP] at [TIME] x [X] y [Y] z [Z]

Adds or replaces one position keyframe on the clip.

Block type: COMMAND. Opcode: addPositionKeyframe. Permanent link

ArgumentTypeDefault valueMenu choices
CLIPSTRINGmove-up
TIMENUMBER0
XNUMBER0
YNUMBER1
ZNUMBER-3

Fixed input controls and value preservation

add scale keyframe to clip [CLIP] at [TIME] x [X] y [Y] z [Z]

Adds or replaces one scale keyframe on the clip.

Block type: COMMAND. Opcode: addScaleKeyframe. Permanent link

ArgumentTypeDefault valueMenu choices
CLIPSTRINGpulse
TIMENUMBER0
XNUMBER1
YNUMBER1
ZNUMBER1

Fixed input controls and value preservation

add euler rotation keyframe to clip [CLIP] at [TIME] x [X] y [Y] z [Z] unit [UNIT]

Adds or replaces one Euler rotation keyframe converted to quaternion values.

Block type: COMMAND. Opcode: addEulerRotationKeyframe. Permanent link

ArgumentTypeDefault valueMenu choices
CLIPSTRINGwave
TIMENUMBER0
XNUMBER0
YNUMBER0
ZNUMBER0.8
UNITSTRINGradians

Fixed input controls and value preservation

play 3D animation clip [CLIP] on selector [SELECTOR] loop [LOOP]

Plays a stored 3D animation clip on every matching node.

Block type: COMMAND. Opcode: playAnimationClip. Permanent link

ArgumentTypeDefault valueMenu choices
CLIPSTRINGwave
SELECTORSTRING#leftArm
LOOPBOOLEANtrue

Fixed input controls and value preservation

stop 3D animation clip [CLIP] on selector [SELECTOR]

Stops a stored 3D animation clip on every matching node.

Block type: COMMAND. Opcode: stopAnimationClip. Permanent link

ArgumentTypeDefault valueMenu choices
CLIPSTRINGwave
SELECTORSTRING#leftArm

pause 3D animation clip [CLIP] on selector [SELECTOR]

Pauses a stored 3D animation clip on every matching node.

Block type: COMMAND. Opcode: pauseAnimationClip. Permanent link

ArgumentTypeDefault valueMenu choices
CLIPSTRINGwave
SELECTORSTRING#leftArm

resume 3D animation clip [CLIP] on selector [SELECTOR]

Resumes a paused 3D animation clip on every matching node.

Block type: COMMAND. Opcode: resumeAnimationClip. Permanent link

ArgumentTypeDefault valueMenu choices
CLIPSTRINGwave
SELECTORSTRING#leftArm

set 3D animation clip [CLIP] on selector [SELECTOR] time scale [SCALE]

Sets the playback speed for a stored 3D animation clip on every matching node.

Block type: COMMAND. Opcode: setAnimationTimeScale. Permanent link

ArgumentTypeDefault valueMenu choices
CLIPSTRINGwave
SELECTORSTRING#leftArm
SCALENUMBER1

Fixed input controls and value preservation

is 3D animation clip [CLIP] playing on selector [SELECTOR]?

Reports whether any matching node has the stored 3D animation clip playing.

Block type: BOOLEAN. Opcode: isAnimationClipPlaying. Permanent link

ArgumentTypeDefault valueMenu choices
CLIPSTRINGwave
SELECTORSTRING#leftArm

load VRM [URL] onto [SELECTOR]

Loads a VRM avatar with three-vrm on the A-Frame Three.js and attaches it to the first matching node. The block waits until the model is ready.

Block type: COMMAND. Opcode: loadVrm. Permanent link

ArgumentTypeDefault valueMenu choices
URLSTRINGavatar.vrm
SELECTORSTRING#avatar

set VRM [SELECTOR] bone [BONE] rotation x [X] y [Y] z [Z]

Sets the Euler rotation in degrees of a normalized VRM humanoid bone, relative to the T-pose, on every matching node whose VRM is ready.

Block type: COMMAND. Opcode: setVrmBoneRotation. Permanent link

ArgumentTypeDefault valueMenu choices
SELECTORSTRING#avatar
BONESTRINGleftUpperArm
XNUMBER0
YNUMBER0
ZNUMBER-60

Fixed input controls and value preservation

VRM [SELECTOR] humanoid bones

Returns the humanoid bone names of the first matching node's VRM as a JSON array.

Block type: REPORTER. Opcode: vrmBoneNames. Permanent link

ArgumentTypeDefault valueMenu choices
SELECTORSTRING#avatar

set VRM [SELECTOR] expression [NAME] to [WEIGHT]

Sets the weight, clamped to 0 through 1, of a preset or custom VRM expression such as happy or blink on every matching node whose VRM is ready.

Block type: COMMAND. Opcode: setVrmExpression. Permanent link

ArgumentTypeDefault valueMenu choices
SELECTORSTRING#avatar
NAMESTRINGhappy
WEIGHTNUMBER1

Fixed input controls and value preservation

VRM [SELECTOR] expressions

Returns the preset and custom expression names of the first matching node's VRM as a JSON array.

Block type: REPORTER. Opcode: vrmExpressionNames. Permanent link

ArgumentTypeDefault valueMenu choices
SELECTORSTRING#avatar

VRM [SELECTOR] state

Returns none, loading, ready, or error with its reason for the first matching node.

Block type: REPORTER. Opcode: vrmState. Permanent link

ArgumentTypeDefault valueMenu choices
SELECTORSTRING#avatar

Repository guide and examples

Optional fixed-input editor

Fixed menus and finite numeric inputs preserve existing raw values unless edited. Connected reporters remain read only and are never evaluated. Failed saves retain drafts; cancel, dispose and scope changes discard them. Existing runtime clamps and serializers remain unchanged. The fixed editor is OFF by default; enable blockEditorDialogs and blockEditorFixedInputs at startup.

固定入力の契約・保持規則・切戻し