vai:lua_scripting
This is an old revision of the document!
Scripting in Lua
Vai can be scripted using Lua.
A comprehensive list of available command can be retrieved using the help() command in the lua console.
To get a single list of all commands, use help_all().
To monitor which commands are being used by buttons and menu items, use the Lua History panel.
All native libraries are included as well as the following third party libraries:
Supported Commands
Vai
| Category | Description |
|---|---|
| vai.prefs() | Open the Preferences Panel |
| vai.edit_shortcuts() | Open the Keyboard Shortcuts Panel |
| vai.licenses() | Display the licenses of all used software libraries |
| vai.about() | Show the About info |
| vai.quit() | Exit Vai |
| vai.project.list() | Return a list of all loaded projects. |
| vai.project.set(name) | Set the current project to display. |
| vai.project.close() | Close the current project. |
| vai.project.reload() | Reload the current project. |
| vai.open(filename, wait) | Opens a file or a file requester if the file name is omitted. |
| vai.fullscreen.set(bool) | Set full screen on or off |
| vai.fullscreen.get() | Get the current full screen state |
| vai.lua.console.set(bool) | set the current state of the lua console panel |
| vai.lua.console.get() | get the current state of the lua console panel |
| vai.lua.log.set(bool) | set the current state of the lua log panel |
| vai.lua.log.get() | get the current state of the lua log panel |
| vai.log.set(bool) | set the current state of the log panel |
| vai.log.get() | get the current state of the log panel |
View
| Category | Description |
|---|---|
| view.fit() | Fit the camera to the scene. |
| view.camera.get() | Returns the currently used camera. |
| view.camera.set(camera) | Set a cammera to use. |
| view.camera.list() | Return a list of all available cameras. |
| view.scene_lighting.set(val) | Set the scene lighting. |
| view.scene_lighting.get() | Get the current state of using scene lighting. |
| view.scene_materials.set(val) | Set whether to use scene materials. |
| view.scene_materials.get() | Get the current state of using scene materials. |
| view.frame.set(frame) | Set the current frame number. |
| view.frame.get() | Return the current frame number. |
| view.frame.step(frames) | Change the current frame number. |
| view.frame.go() | Open a dialogue to enter the current frame number. |
| view.complexity(complexity) | Change the complexity for the viewport |
| view.front() | Switch to a frontal view. |
| view.back() | Switch to a back view. |
| view.top() | Switch to a top view. |
| view.bottom() | Switch to a bottom view. |
| view.right() | Switch to a right view. |
| view.left() | Switch to a left view. |
| view.flip() | Flip the view. |
| view.toggle_ortho() | Toggle between an orthogonal and a prespective view. |
| view.tumble(x,y) | Tumble the view. |
| view.zoom(value) | Zoom the current view |
| view.draw_mode.set(mode) | Set the draw mode for the viewport. |
| view.draw_mode.get() | Get the current draw mode for the viewport. |
| view.shading_mode.set(mode) | Set the shading mode for the viewport. |
| view.shading_mode.get() | Get the current shading mode for the viewport. |
| view.play.set(play) | Play / Pause the current animation. |
| view.play.get() | Get the current play state |
| view.last_frame(frame) | Set the last frame for playback. |
| view.first_frame(frame) | Set the first frame for playback. |
| view.bones.set(show) | Display bones. |
| view.bones.get() | Get bones visibility. |
| view.geometry.set(show) | Display geometry. |
| view.geometry.get() | Get geometry visibility. |
| view.hud.set() | Set the visibility of the hud |
| view.hud.get() | Get the visibility of the hud |
| view.turntable.speed.set() | Set the Turntable Rotation. |
| view.turntable.speed.get() | Get the Turntable Rotation. |
| view.turntable.speed.flip() | Flip the Turntable direction. |
| view.turntable.set() | Turn the turntable on/off |
| view.turntable.get() | Get the current state of the turntable |
| view.timeline.set() | Set the visibility of the timeline |
| view.timeline.get() | Get the visibility of the timeline |
| view.props.get() | Get the visibility of the Properties panel. |
| view.props.set() | Set the visibility of the Properties panel. |
| view.ab.get() | Get the ab comparison state |
| view.ab.set() | Set the ab comparison state |
| view.image.copy() | Copy the current viewport to the clipboard. |
| view.image.save(filename, format) | Save the current viewport as an image. |
| view.variants.set(prim, variant, x) | Change the variant on prim to x |
| view.variants.gset(variant, x) | Change the variant to x |
License
| Category | Description |
|---|---|
| license.wizard() | Launch the licensing wizard |
| license.deactivate() | Deactivate the current license |
| license.delete() | Deactivate and delete the current license |
vai/lua_scripting.1789573135.txt.gz · Last modified: by lightwolf

