Skip to content

Latest commit

 

History

History
1073 lines (556 loc) · 25.3 KB

help.adoc

File metadata and controls

1073 lines (556 loc) · 25.3 KB

Animatron

Table of Contents

log

/error msg:s

Log error messages.

info

/project/path path:s

Set a project path.

_Example: /project/path /home/yourname/projectname

_Usage: /assets/path $project/assets/animations

/assets/path/default

Set assets path to default location

Example: /assets/path/default

/commands

Lists all available commands.

Example: /commands

/assets

List all available animation clips that are on the current assets path.

This list includes all clips that are on the disk, no matter if they are loaded or not.

See also: /animations

Example: /assets

/animations

List all animations that are loaded to memory.

Example: /animations

/actors

List all actors that have been created.

Example: /actors

actors

/create/at actor:s animation:s x:f y:f

Create an actor at a relative position from the center of the screen.

Example: /create lola square 100 -100

/free actor:s

Delete any existing actor.

Example: /free lola

/delete actor:s

Delete any existing actor.

Example: /delete lola

/clear actor:s

Delete any existing actor.

Example: /delete lola

/reload animation:s

Reload animation frames from disk.

Example: /reload mama

transform

/position actor:a x:f y:f

Set the x and y coordinates (in pixels) of the actor.

Example: /position lola 500 500

/pos actor:a x:f y:f

See /position

/position/x actor:a x:f

Set the x coordinate (in pixels) of the actor.

Example: /position/x lola 500

/pos/x actor:a value:f

Example: /pos/x mama 500

/x actor:a value:f

Example: /x mama 500

/position/y actor:a y:f

Set the y coordinate (in pixels) of the actor.

Example: /position/x lola 500

/pos/y actor:a value:f

Set the y coordinate (in pixels) of the actor.

Example: /pos/y mama 500

/y actor:a value:f

Set the y coordinate (in pixels) of the actor.

Example: /y mama 500

/y/sort parentActor:s sort:b

Sort actors according to their y position value. Actors with a higher y value will be drawn lower on the screen and on top of actors with a smaller y position value.

If sort is 1, child nodes with the lowest Y position are drawn before those with a higher y position.

If sort is 0, Y-sorting is disabled.

This feature is set on the parentActor, so if you want actors to be sorted according to their y position value, they need to be children of a common parentActor.

Example: /y/sort lola 1

/create a bla /create b bla /create c alo /parent a c /parent b c /y/sort c 1

/y/sort/enable parentActor:s

See /y/sort

/y/sort/disable parentActor:s

See /y/sort

/move actor:a x:f y:f

Move actor an amount of pixels relative to the current position in both x and y axis.

Example: /move lola 100 100

/move/x actor:a x:f

Move actor an amount of pixels relative to the current position in the x axis.

Example: /move/x lola 100

/move/y actor:a y:f

Move actor an amount of pixels relative to the current position in the y axis.

Example: /move/y lola 100

/angle actor:s degrees:f

Set the absolute rotation of the actor in degrees.

Example: /angle lola 45

/rotate actor:s degrees:f

Rotate the actor some degrees relative to the current angle.

Example: /rotate lola 10

/size actor:s size:f

Set the actor 's absolute size relative to the normal size (on both axis). 1 is normal size; 0.5 is half the size; 2 is twice the size.

Example: /size lola 1.5

/size/xy actor:s x:f y:f

Set the actor 's absolute size relative to the normal size with different values on the x and y axis.

See: /size

Example: /size/xy lola 1.5 0.7

/size/x actor:s x:f

Set the actor 's absolute size relative to the normal size on the x axis.

Example: /size/x lola 1.5 0.7

/size/y actor:s y:f

Set the actor 's absolute size relative to the normal size on the y axis.

Example: /size/y lola 1.5 0.7

/scale actor:s scale:f

scale the actor relative to the current size equally on both axis.

Example: /scale lola 1.5

/scale/xy actor:s x:f y:f

scale the actor relative to the current size, with different values for each axis x and y

Example: /scale/xy lola 1.5 0.5

/scale/x actor:s x:f

scale the actor relative to the current size on the x axis

Example: /scale/x lola 1.5

/scale/y actor:s y:f

scale the actor relative to the current size on the y axis

Example: /scale/y lola 1.5

visibility

/show actor:s

Make the actor visible

Example: /show lola

/hide actor:s

Make the actor invisible

Example: /hide lola

See also /color

color

/color/r actor:s value:f

Set the actor 's color to a value of red (between 0 and 1).

Example: /color/r lola 0.5

/color/g actor:s value:f

Set the actor 's color to a value of green (between 0 and 1).

Example: /color/g lola 0.5

/color/b actor:s value:f

Set the actor 's color to a value of blue (between 0 and 1).

Example: /color/b lola 0.5

/tint actor:s r:f g:f b:f

Same as /color, but this subtracts the value to the current color, while /color adds to it.

Using /tint x 1 0 0 turns white into red, keeping black as black.

Using /color x 1 0 0 turns black into red, keeping white as white.

Example: /tint lola 0.5 0.25 0.0

animation

/play actor:s

Play the actor 's animation

Example: /play lola

/backwards actor:s

Play the actor 's animation backwards

Example: /backwards lola

/stop actor:s

Stop the actor 's animation

Example: /play lola

/play/range actor:s start:i end:i

Play the animation from start to end frames.

Example: /play lola

/animation actor:s animation:s

Change the actor 's animation.

Example: /animation lola letter-a

/anim actor:s animation:s

/speed actor:s speed:f

Set the actor 's animation speed (1 = normal speed, 2 = 2 x speed).

Example: /speed lola 2.1

/frame actor:s frame:i

Set the actor 's current frame. If the value of the frame is grater than the number of frames in the movie, it will wrap around.

Example: /frame lola 4

/next/frame actor:s

Advance actor 's animation by one frame.

Example: /next/frame lola 2

/prev/frame actor:s

Move actor 's animation one frame backwards.

Example: /prev/frame lola 2

/start/frame actor:s frame:f

Set the first frame of the loop in actor 's animation. Defaults to 0.

Example: /start/frame lola 2

/end/frame actor:s frame:f

Set the last frame of the loop in actor 's animation. Defaults to number of frames of the animation.

Example: /end/frame lola 6

/loop actor:s

Loop the actor 's animation.

Example: /loop lola

See also: /noloop, /pingpong

/noloop actor:s

Don’t loop the actor 's animation. Plays the animation stopping at the last frame.

Example: /noloop lola

See also: /loop, /pingpong

/pingpong actor:s

Make the loop go back and forth.

Example: /pingpong lola

See also: /loop, /noloop

Note
(for devs) This is inconsistent with /loop /noloop, as they use a built-in method, while this had to be custom-coded in Animation.gd because there’s no such thing for AnimatedSprite2D.

/offset actor:s x:i y:i

Set the actor 's animation drawing offset (in pixels) relative to the anchor point.

Example: /offset lola 50 -30

/offset/x actor:s x:i

Set the actor 's animation drawing offset on the x axis.

Example: /offset/x lola 50

/offset/y actor:s y:i

Set the actor 's animation drawing offset on the y axis.

Example: /offset/y lola -30

/unparent child:s

Undo the relationship of the child actor to its current parent.

Example: /unparent lola

/tween/loop dur:f interpolation:s property:s actor:s from:f to:f

Same as /tween, but looping back and forth between FROM and TO.

Example: /tween/loop 1 expo /position/y foo 100 500

See also: /tween

animation data

/animation/data/value name:s

Warning
Commands in this section are highly experimental. Proceed with caution.

Commands in this section describe ways to create and manipulate animation data, which can be used to animate anything in the engine. Animations are divided into tracks and each track must be linked to an actor. The state of that actor can be changed through time, by adding timed keys (events) to the track.

Create an animation data object to animate values.

Example: /animation/data/value myanimationdata

/animation/data/method name:s

Create an animation data object to animate methods.

Example: /animation/data/method myanimationdata

/animation/data/animation name:s

Create an animation data object to animate other animation data objects.

Example: /animation/data/animation myanimationdata

/animation/data/add/track name:s type:i

Add a track of the given type to the animation data object identified by name. Track type numbers and details can be found in Godot’s docs.

Example: /animation/data/add/track myanimationdata 0

text label

/type actor:s text:…​

Write text on the actor.

Example: /type lola alo

/type/clear actor:s

Clear text on the actor. Text can also be cleared with just /type actor, without text argument.

Example: /type/clear lola

Example: /type lola (note there’s no second argument)

/text/visible/ratio actor:s ratio:f

Set the fraction of characters to display, relative to the total number of characters. 1.0 displays all characters. 0.5 displays half the characters.

Example: /text/visible/ratio lola 0.5

See also: /type

/text/color actor:s r:f g:f b:f

Set the color of the text.

Example: /text/color lola 1 0 0

See also: /type

experimental

Warning
Commands in this section are highly experimental. Proceed with caution.

/comic actor:s animation:s

Creates an actor with a pair of 2 animation 's.

This allows to create actors with separate animations for line and fill colors. The *-ln actor is a child of the main (fill) actor.

Suppose we want to create an animation named bla with separate fill and line colors. We would have to create 2 directories: one holding the line (bla-ln) art and the other the fill (bla-fl).

Example: /comic lola bla

app

/presets

List all presets

Example: /presets

/preset name:s

Load a preset from a directory name under user://presets/.

Example: /preset mycommands/somecommands.ocl

See also: /preset/load

/preset/load

Load a preset using the file browser.

Example: /preset mycommands/somecommands.ocl

/animatron/demo

Load the animatron demo.

Example: /animatron/demo

editor

/editor/font/size pixels:i

Set the editor’s font size in pixels.

Example: /editor/font/size 60

window

/window/mode mode:i

Set window mode.

Example: /window/mode 3

0: windowed 1: minimized 2: maximized 3: fullscreen 4: exclusive fullscreen

See also /fullscreen, /window

/window/fullscreen

Set window mode to fullscreen.

Example: /window/fullscreen

See also /window/mode

/fullscreen

/window/windowed

Set window mode to windowed.

Example: /window/windowed

See also /window/mode

/windowed

/window/size width:i height:i

Set window dimensions.

Example: /window/size 640 480

osc

/osc msg:s

Send an OSC msg to a remote server.

core

/actors/list

Get list of current actor instances. Returns /list/actors/reply OSC message.

/animation/data/create name:s

Create a new Animation data object and add it to the library. No tracks are created, they need to be created with a different command.

/animation/data/library/method method:s args:…​

Call a method on the AnimationLibrary.

/animation/data/list

Get a list of existing Animation data objects.

/animation/data/method method:s args:…​

Call a method related to Animation data. NOTE: this is not image sequences, it’s data used to modify properties over time, like position or angle.

/animation/data/remove name:s

Remove the Animation data object from the library.

/animation/frames/method method:s actor:s args:…​

Call a METHOD on the ACTOR’s animation with some ARGS.

/animation/method method:s actor:s args:…​

Call a METHOD on the ACTOR’s animation with some ARGS.

/animation/player/method actor:s method:s args:…​

Call the actor’s `AnimationPlayer method with given args.

/animation/property property:s actor:s value:…​

Change the ACTOR’s ANIMATION GDScript PROPERTY. Slashes ('/') will be replaced for underscores '_'. Leading slash is optional.

Usage: /animation/property /rotation/degrees target 75

/animations/list

Get the list of available (loaded) animations.

/assets/list

Get the list of available (unloaded) assets. Assets must be loaded as animations in order to create actor instances.

/assets/path path:s

Set the path for the parent directory of the assets.

/behind actor:s target:s

Draw the ACTOR immediately behind the TARGET.

/bottom actor:s

Draw the ACTOR behind everything else.

/center actor:a

Set the ACTOR to the center of the screen.

/children/list parent:s

List all PARENT’s children actors.

/color actor:s r:f g:f b:f

Modulate the ACTOR by an RGB colour. R, G and B should be in the 0-1 range. Set to white (1,1,1) to restore its original colour.

/color/add actor:s r:f g:f b:f

Add an RGB colour to the ACTOR. R, G and B should be in the 0-1 range (can be negative to subtract colour). Set to black (0,0,0) to remove its effect. The addition is done after the modulation by /color (if any).

/commands/list

Get list of available commands.

/commands/load path:s

Load a custom command definitions file, which should have the format described below.

/create actor:s animation:s

Create an ACTOR that plays ANIMATION.

/def cmdName:s [args:v] subcommands:c

Define a custom OSC command that is a list of other OSC commands. This may be recursive, so each SUBCOMMAND may reference one of the built-in commands, or another custom-defined command. Another way to define custom commands is via the file commands/init.osc. The CMDNAME string (first argument) may include argument names (ARG1 …​ ARGN), which may be referenced as SUBCOMMAND arguments using $ARG1 …​ $ARGN. Example: /def "/addsel actor anim" "/create $actor $anim" "/select $actor".

/editor/append text:…​

Append TEXT to the last line of the editor.

/editor/clear

Delete all text from the editor.

/editor/open

Open a file dialog and append the selected file contents at the end.

/editor/open/from path:s

Load code from PATH and append it to the end.

/editor/property property:s value:…​

Change the editor’s font GDScript PROPERTY. Slashes ('/') will be replaced for underscores '_'. Leading slash is optional.

Usage: /editor/property /font/size 32

/editor/save

Save the code using a file dialog.

/editor/save/to path:s

Save the code to PATH.

/editor/toggle

Toggle editor and post window visibility.

/flip/h actor:s

Flip ACTOR horizontally.

/flip/v actor:s

Flip/ ACTOR vertically.

/for varName:s iterations:i cmd:s

Iterate iterations times over varName, substituting the current iteration value in each call to cmd.

/front actor:s target:s

Draw the ACTOR immediately in front of the TARGET.

/get variable:s

Get the value of a VARIABLE.

/help cmd:s

Get documentation about CMD.

A command sometimes needs parameters, which are described in the help documentation with their name followed by a colon : and their type. Parameter types include - s - string - i - integer - f - float - b - boolean - …​ - arbitrary number of paramters of any type

/list/dirs path:s

Get a list of the subdirectories in PATH.

/list/files path:s

Get a list of the files in PATH.

/load animation:s

Load an ANIMATION asset from disk. It will create an animation with the same name as the asset. Wildcards are supported, so several animations can be loaded at once. See also: /assets/list.

/log/level level:s

Set the log level to either 'fatal', 'error', 'warn', 'debug' or 'verbose'

/mask child:s mask:s

Mask a child ACTOR by a parent ACTOR

/method method:s actor:s args:…​

Generic command to call an ACTOR’s METHOD with some ARGS.

/midi/cc channel:i num:i cmd:s

Map the control value to a CMD. The last 2 CMD arguments should be MIN and MAX, in that order. Example: /midi/cc 0 1 /position/x target 0 1920. WARNING: this only works with commands that accept 1 argument.

/midi/cc/free channel:i [num:i]

Remove a cmd from the event.

/midi/free

Remove all commands from MIDI events.

/midi/list event:s [args:v]

List commands for the EVENT in CHANNEL and optional NUM. Events is one of: noteon, noteonnum, noteonvelocity, noteonnumvelocity (NUM), noteontrig (NUM), noteoff, noteoffnum, cc (NUM)

/midi/noteoff channel:i cmd:s

Execute a CMD when a note-off MIDI event is triggered on any note.

/midi/noteoff/free channel:i [num:i]

Remove a cmd from the event.

/midi/noteoff/num channel:i cmd:s

Map the released NOTE number to a CMD. The last 2 CMD arguments should be MIN and MAX, in that order. Example: /midi/noteon/num 0 /position/x target 0 1920. WARNING: this only works with commands that accept 1 argument.

/midi/noteoff/num/free channel:i [num:i]

Remove a cmd from the event.

/midi/noteon channel:i cmd:s

Execute a CMD when a note-on MIDI event is triggered on any note.

/midi/noteon/free channel:i [num:i]

Remove a cmd from the event.

/midi/noteon/num channel:i cmd:s

Map the pressed note number to a CMD. The last 2 CMD arguments should be MIN and MAX, in that order. Example: /midi/noteon/num 0 /position/x target 0 1920. WARNING: this only works with commands that accept 1 argument.

/midi/noteon/num/free channel:i [num:i]

Remove a cmd from the event.

/midi/noteon/num/velocity channel:i note:i cmd:s

Map the NOTE velocity to a CMD. The last 2 CMD arguments should be MIN and MAX, in that order. Example: /midi/noteon/num 0 60 /position/y target 0 1080. WARNING: this only works with commands that accept 1 argument.

/midi/noteon/num/velocity/free channel:i [num:i]

Remove a cmd from the event.

/midi/noteon/trig channel:i note:i cmd:s

Execute a CMD when a note-on event is triggered on a specific NOTE.

/midi/noteon/trig/free channel:i [num:i]

Remove a cmd from the event.

/midi/noteon/velocity channel:i cmd:s

Map the velocity of any note to a CMD. The last 2 CMD arguments should be MIN and MAX, in that order. Example: /midi/noteon/num 0 /position/y target 0 1080. WARNING: this only works with commands that accept 1 argument..

/opacity actor:s opacity:f

Set OPACITY of ACTOR and its children.

/osc/remote ip:s port:i

Set the IP address and PORT number of a remote OSC server.

/osc/send msg:s

Send an OSC message to a remote server. See /osc/remote.

/parent child:s parent:s

Set an actor to be the CHILD of another PARENT actor.

/parent/free child:s

Free the CHILD actor from it’s parent.

/post msg:s

Print MSG in the post window.

/post/clear

Clear post window contents.

/post/file path:s

Print the contents of a file on the post window.

/post/hide

Hide post window.

/post/show

Show post window.

/post/toggle

Toggle post window visibility.

/property property:s actor:s value:…​

Generic command to set the VALUE to any PROPERTY of an ACTOR.

/property/relative property:s actor:s value:…​

Generic command to set the VALUE to any PROPERTY of an ACTOR.

/rand cmd:s actor:s min:f max:f

Send a CMD to an ACTOR with a random value between MIN and MAX. If a wildcard is used, e.g. bl*, all ACTORs with with a name that begins with bl will get a different value. WARNING: This only works with single-value commands.

/remove actor:s

Delete the ACTOR by name (remove its instance).

/routine name:s repeats:i interval:f cmd:…​

Start a routine named NAME that sends CMD every INTERVAL of time (in seconds) for an arbitrary number of REPEATS.

/routine/finished routine:s cmd:s

Set the CMD to be sent when the ROUTINE (name) is finished.

/routine/free name:s

Remove the routine named NAME

/routine/start name:s

Start the routine named NAME.

/routine/stop name:s

Stop the routine named NAME.

/routines

Get the list of routines.

/set variable:type value:ifbs…​

Set a user VARIABLE with a VALUE, specifying the TYPE (:i = int, :f = float, :b = bool, :s string, :…​ = arbitrary number of arguments passed as array).

Usage: /set x:f 3.14

/shader actor:s shader:s

Assign the SHADER to an ACTOR. Passing an empty name for the shader argument will reset the Actor to use the default shader.

/shader/create shader:s code:…​

Create a named SHADER object with the given Godot shader CODE. If the code does not compile, then the default shader will be used. Passing no code argument for the shader will reset it to the default shader. Be sure to use double braces {{}} around functions and code blocks.

/shader/load shader:s

Load a named SHADER object from disk, located in a file with .gdshader extension in the shaders subdirectory of the user assets path. Sending * as the shader name will cause all custom shaders in that directory to be loaded.

/shader/property actor:s property:s value:…​

Set a SHADER property (aka 'uniform' variable) for an ACTOR. The value will depend on the type of the property, for example a vec3 would require three floats, a float only requires a single value.

/state/add machine:s state:s next:s

Add a STATE with a name to the state MACHINE. NEXT states is an arbitrary number of next possible states. Example: /state/add mymachine stateA state1 state2 would create a new stateA in mymachine that would either repeat or move on to `state2.

See /state/def

/state/def state:s entry:s exit:s

Define a STATE with an ENTRY /def to be executed when the state begins, and an EXIT /def to be executed when it ends. Both should be existing `/def`s without parameters.

See /state/add and /state/next

/state/free machine:s state:s

Remove the STATE from the state MACHINE.

/state/free/all

Deletes all state machines.

/state/next machine:s

Change MACHINE to next state. This will send the 'exit' command of the current state, and the 'entry' command of the next state.

See /state/def

/states

Get a list of states for the given ACTOR.

/text/property property:s actor:s value:…​

Change the ACTOR’s text GDScript PROPERTY. Slashes ('/') will be replaced for underscores '_'. Leading slash is optional.

Usage: /text/property /text target alo bla

/top actor:s

Draw the ACTOR on top of everything else.

/tween dur:f transition:s property:s actor:s value:f

Tweens a PROPERTY of an ACTOR between the current value and final VALUE in a span of time equal to DURation, in seconds. The TRANSITION must be one of: linear, sine, quint, quart, quad, expo, elastic, cubic, circ, bounce, back and spring. See also: /tween/loop.

/unload animation:s

Removes the ANIMATION asset from disk. This allows to free memory, and to reload a fresh version of the animation.

/unmask mask:s

Stop an ACTOR from behaving as a mask. Any masked child nodes will be reparented to the top level (similar to /parent/free).

/view/size width:i height:i

Set the view’s width and height. This is used for off-screen rendering, so it can be sent over to other apps (Spout, …​).

/visible actor:s visibility:b

Set ACTOR’s VISIBILITY to either true or false.

/wait time:f cmd:…​

Wait some TIME to execute the CMD.

/window/method

Call a window method.