App
Summary
Various properties and methods that effect the entire app
Class Properties
Name | Return Type | Description |
---|---|---|
time | number Read-only | The time in seconds since Open Brush was launched |
frames | number Read-only | The number of frames that have been rendered since Open Brush was launched |
physics | boolean Read/Write | Whether physics simulation is active (defaults is off) |
currentScale | number Read-only | The current scale of the scene |
environment | string Read/Write | Get or set the current environment by name |
clipboardText | string Read/Write | Get or set the clipboard text |
Class Methods
App:Undo()
Undo the last action
Returns: nil
Example
App:Redo()
Redo the previously undone action
Returns: nil
Example
App:AddListener(url)
Adds a url that should be sent the data for each stroke as soon as the user finishes drawing it
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
url | string | The url to send the stroke data to |
Example
App:ResetPanels()
Reset all panels
Returns: nil
Example
App:ShowScriptsFolder()
Opens an Explorer/Finder window outside of VR showing the user's Scripts folder on the desktop (Mac/Windows only)
Returns: nil
Example
App:ShowExportFolder()
Opens an Explorer/Finder window outside of VR showing the user's Export folder on the desktop (Mac/Windows only)
Returns: nil
Example
App:ShowSketchesFolder()
Opens an Explorer/Finder window outside of VR showing the user's Sketches folder on the desktop (Mac/Windows only)
Returns: nil
Example
App:StraightEdge(active)
Activate or deactivate straight edge mode
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | True means activate, false means deactivate |
Example
App:AutoOrient(active)
Activate or deactivate auto orientation mode
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | True means activate, false means deactivate |
Example
App:ViewOnly(active)
Activate or deactivate view only mode
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | True means activate, false means deactivate |
Example
App:AutoSimplify(active)
Activate or deactivate auto simplification mode
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | True means activate, false means deactivate |
Example
App:Disco(active)
Activate or deactivate disco mode
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | True means activate, false means deactivate |
Example
App:Profiling(active)
Activate or deactivate profiling mode
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | True means activate, false means deactivate |
Example
App:PostProcessing(active)
Activate or deactivate post-processing
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | True means activate, false means deactivate |
Example
App:DraftingVisible()
Set the drafting mode to visible
Returns: nil
Example
App:DraftingTransparent()
Set the drafting mode to transparent
Returns: nil
Example
App:DraftingHidden()
Set the drafting mode to hidden
Returns: nil
Example
App:Watermark(active)
Activate or deactivate the watermark
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | True means activate, false means deactivate |
Example
App:ReadFile(path)
Read the contents of a file
Returns: string (The contents of the file as a string)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
path | string | The file path to read from. It must be relative to and contined within the Scripts folder |
Example
App:Error(message)
Displays an error message on the back of the user's brush controller
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
message | string | The error message to display |
Example
App:SetFont(fontData)
Set the font used for drawing text
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
fontData | string | Font data in .chr format |
Example
App:TakeSnapshot(tr, filename, width, height, superSampling, renderDepth, removeBackground)
Take a snapshot of your scene and save it to your Snapshots folder
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
tr | Determines the position and orientation of the camera used to take the snapshot | ||
filename | string | The filename to use for the saved snapshot | |
width | number | Image width | |
height | number | Image height | |
superSampling | number | 1 | The supersampling strength to apply (between 0.125 and 4.0) |
renderDepth | boolean | false | If true then render the depth buffer instead of the image |
removeBackground | boolean | false |
Example
App:Take360Snapshot(tr, filename, width)
Take a 360-degree snapshot of the scene and save it
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
tr | Determines the position and orientation of the camera used to take the snapshot | ||
filename | string | The filename to use for the saved snapshot | |
width | number | 4096 | The width of the image |
Example
Last updated