Description
Animates relative transforms over time with easing. The jit.anim.drive object works in conjunction with jit.anim.node and OpenGL objects to perform this function. Double clicking the object will open a ui mapping dictionary, allowing certain user interface actions to be mapped to animation messages.
Examples
Discussion
UI mapping of key and mouse input is facilitated by editing the ui-map dictionary. Key input is mapped alpha-numeric keys and arrow keys (using up, down, left and right instead of the key symbol). Mouse mapping looks for the following dictionary entries:
Horizontal: mouse_horizontal, mouse_h, mouse_x
Horizontal with button down: mouse_down_horizontal, mouse_down_h, mouse_down_x
Vertical: mouse_vertical, mouse_v, mouse_y
Vertical with button down: mouse_down_vertical, mouse_down_v, mouse_down_y
UI input can be mapped to , and messages.
Attributes
active [int]
Indicates if the object is currently animating.
automatic [int]
Enables automatic update messages (default = 1). Requires the targetname object to belong to a valid OpenGL context.
drawto [symbol]
Assign to the named drawing context, allowing for updates to be received automatically.
ease [float]
Set both easein and easeout attributes (default = 1.).
easefunc [symbol]
Determines how the easing is applied (default = linear).
Possible values:
'linear'
'quadratic'
'cubic'
easein [float]
Determines how long it will take (in seconds) for a specific animation message to go from it's current value to the new value (default = 1.). This attribute only affects the
, and animations.easeout [float]
Determines how long it will take (in seconds) for a specific animation message to go from it's current value to 0 (default = 1.). This attribute only affects the
, and animations.evalreport [int]
Enable/disable the evaluation parameter reporting out the dumpout (default = 0). The report is a 3 element list where each element represents the current evaluation parameters for the
, , and messages, in that order.name [symbol]
Specifies the name of the instance (default = UID).
position [3 floats]
The current stored position in 3D space. This attribute is used for the
and messages (default = 0 0 0).quat [4 floats]
The current orientation in 3D space, stored as a quaternion value. This attribute is used for the
message (default = 0 0 0 1).scale [3 floats]
The current stored scale in 3D space. This attribute is used for the
message (default = 1 1 1).speed [float]
The speed of animations in units per second. (default = 30.)
spring_damp [float]
The dampening amount applied to the spring equation used in the
message (default = 0.1).spring_mass [float]
The mass amount applied to the spring equation used in the
message (default = 1.).spring_stiff [float]
The stiffness amount applied to the spring equation used in the
message (default = 0.2).spring_thresh [float]
The threshold value to determine when the spring simulation is no longer active. Used in the
message (default = 0.0001).targetname [symbol]
The name of the target object that should be either an OpenGL object, or a jit.anim.node object.
ui_listen [int]
Cause UI mouse and keyboard messages to be received from context window (default = 0). Requires the targetname object to belong to a valid OpenGL context.
ui_map [symbol]
Name associated with the ui mapping dictionary (default = UID). If an existing dictionary is registered to that name, this dictionary will reference the registered dictionary.
ui_map_clone [symbol]
The name of a registered dictionary to clone as the UI mapping dictionary.
ui_priority [int]
UI priority value (default = 900). When multiple UI objects are listening to the same window, ui_priority determines the order objects receive input. Lower values test first.
Common Box Attributes
annotation [symbol]
Sets the text that will be displayed in the Clue window when the user moves the mouse over the object.
background [int] (default: 0)
Adds or removes the object from the patcher's background layer.
adds the object to the background layer, removes it. Objects in the background layer are shown behind all objects in the default foreground layer.color [4 floats]
Sets the color for the object box outline.
fontface [int]
Sets the type style used by the object. The options are:
plain
bold
italic
bold italic
Possible values:
0 = 'regular'
1 = 'bold'
2 = 'italic'
3 = 'bold italic'
fontname [symbol]
Sets the object's font.
fontsize [float]
Sets the object's font size (in points).
Possible values:
'8'
'9'
'10'
'11'
'12'
'13'
'14'
'16'
'18'
'20'
'24'
'30'
'36'
'48'
'64'
'72'
hidden [int] (default: 0)
Toggles whether an object is hidden when the patcher is locked.
hint [symbol]
Sets the text that will be displayed in as a pop-up hint when the user moves the mouse over the object in a locked patcher.
ignoreclick [int] (default: 0)
Toggles whether an object ignores mouse clicks in a locked patcher.
patching_rect [4 floats] (default: 0. 0. 100. 0.)
Sets the position and size of the object in the patcher window.
position [2 floats]
Sets the object's x and y position in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its size unchanged.
presentation [int] (default: 0)
Sets whether an object belongs to the patcher's presentation.
presentation_rect [4 floats] (default: 0. 0. 0. 0.)
Sets the x and y position and width and height of the object in the patcher's presentation, leaving its patching position unchanged.
rect [4 floats]
Sets the x and y position and width and height of the object in both patching and presentation modes (if the object belongs to its patcher's presentation).
size [2 floats]
Sets the object's width and height in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its position unchanged.
textcolor [float]
Sets the color for the object's text in RGBA format.
textjustification [int]
Text Justification
Possible values:
0 = 'left'
1 = 'center'
2 = 'right'
varname [symbol]
Sets the patcher's scripting name, which can be used to address the object by name in pattr, scripting messages to thispatcher, and the js object.
Messages
bang
anim_reset
(mouse)
dictionary
Arguments
grow
Arguments
y [float]
z [float]
move
Arguments
y [float]
z [float]
moveto
Arguments
y [float]
z [float]
duration [float]
scaleto
Arguments
y [float]
z [float]
duration [float]
springto
Arguments
y [float]
z [float]
rotateto
Arguments
y [float]
z [float]
w [float]
duration [float]
ui_dict
ui_key
Arguments
ui_keyup
Arguments
ui_mouse
Arguments
screen-y [int]
mouse-down [int]
update_drive
turn
Arguments
y [float]
z [float]
See Also
Name | Description |
---|---|
jit.anim.node | Perform hierarchical transformation |
jit.anim.path | Evaluate a path of 3D transform points |
jit.gl.camera | Set a rendering view |