TurboWarp-A-Frame is an unsandboxed TurboWarp extension for building declarative A-Frame scene graphs from blocks.
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.
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
Argument Type Default value Menu choices LAYERSTRING above-stageMODESTRING 3d
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
Argument Type Default value Menu choices IDSTRING monsterSOURCESTRING {"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
Argument Type Default value Menu choices TYPESTRING boxIDSTRING cardPARENTSTRING #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
Argument Type Default value Menu choices TEMPLATESTRING monsterINSTANCESTRING monster-1PARENTSTRING #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
Argument Type Default value Menu choices SELECTORSTRING #cardXNUMBER 0YNUMBER 1ZNUMBER -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
Argument Type Default value Menu choices SELECTORSTRING #cardXNUMBER 0YNUMBER 0ZNUMBER 1
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
Argument Type Default value Menu choices SELECTORSTRING #cardXNUMBER 0YNUMBER 45ZNUMBER 0
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
Argument Type Default value Menu choices CLASSSTRING monsterSELECTORSTRING #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
Argument Type Default value Menu choices SELECTORSTRING #cardKEYSTRING zoneVALUESTRING field
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
Argument Type Default value Menu choices SELECTORSTRING #cardNAMESTRING visibleVALUESTRING true
delete selector [SELECTOR]Deletes every non-root node matching the selector and its descendants.
Block type: COMMAND. Opcode: deleteSelector. Permanent link
Argument Type Default value Menu choices SELECTORSTRING #card
count selector [SELECTOR]Returns the number of nodes matching a limited selector.
Block type: REPORTER. Opcode: countSelector. Permanent link
Argument Type Default value Menu choices SELECTORSTRING .monster
event target idReturns 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
Argument Type Default value Menu choices TYPESTRING attackSELECTORSTRING #cardDATASTRING {}
when 3D scene readyFires 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
Argument Type Default value Menu choices TYPESTRING attackSELECTORSTRING .monster
create 3D animation clip [NAME] duration [DURATION]Creates or replaces a Three.js AnimationClip definition.
Block type: COMMAND. Opcode: createAnimationClip. Permanent link
Argument Type Default value Menu choices NAMESTRING waveDURATIONNUMBER -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
Argument Type Default value Menu choices NAMESTRING wave
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
Argument Type Default value Menu choices CLIPSTRING move-upPATHSTRING .positionTIMESSTRING 0,0.5,1VALUESSTRING 0,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
Argument Type Default value Menu choices CLIPSTRING wavePATHSTRING .quaternionTIMESSTRING 0,0.5,1VALUESSTRING 0,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
Argument Type Default value Menu choices CLIPSTRING wavePATHSTRING .quaternionTIMESSTRING 0,0.25,0.5,0.75,1VALUESSTRING 0,0,0, 0,0,0.8, 0,0,0, 0,0,-0.8, 0,0,0UNITSTRING radians
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
Argument Type Default value Menu choices CLIPSTRING move-upTIMENUMBER 0XNUMBER 0YNUMBER 1ZNUMBER -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
Argument Type Default value Menu choices CLIPSTRING pulseTIMENUMBER 0XNUMBER 1YNUMBER 1ZNUMBER 1
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
Argument Type Default value Menu choices CLIPSTRING waveTIMENUMBER 0XNUMBER 0YNUMBER 0ZNUMBER 0.8UNITSTRING radians
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
Argument Type Default value Menu choices CLIPSTRING waveSELECTORSTRING #leftArmLOOPBOOLEAN true
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
Argument Type Default value Menu choices CLIPSTRING waveSELECTORSTRING #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
Argument Type Default value Menu choices CLIPSTRING waveSELECTORSTRING #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
Argument Type Default value Menu choices CLIPSTRING waveSELECTORSTRING #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
Argument Type Default value Menu choices CLIPSTRING waveSELECTORSTRING #leftArmSCALENUMBER 1
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
Argument Type Default value Menu choices CLIPSTRING waveSELECTORSTRING #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
Argument Type Default value Menu choices URLSTRING avatar.vrmSELECTORSTRING #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
Argument Type Default value Menu choices SELECTORSTRING #avatarBONESTRING leftUpperArmXNUMBER 0YNUMBER 0ZNUMBER -60
Fixed input controls and value preservation
VRM [SELECTOR] humanoid bonesReturns the humanoid bone names of the first matching node's VRM as a JSON array.
Block type: REPORTER. Opcode: vrmBoneNames. Permanent link
Argument Type Default value Menu 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
Argument Type Default value Menu choices SELECTORSTRING #avatarNAMESTRING happyWEIGHTNUMBER 1
Fixed input controls and value preservation
VRM [SELECTOR] expressionsReturns the preset and custom expression names of the first matching node's VRM as a JSON array.
Block type: REPORTER. Opcode: vrmExpressionNames. Permanent link
Argument Type Default value Menu choices SELECTORSTRING #avatar
VRM [SELECTOR] stateReturns none, loading, ready, or error with its reason for the first matching node.
Block type: REPORTER. Opcode: vrmState. Permanent link
Argument Type Default value Menu choices SELECTORSTRING #avatar
Repository guide and examples