Various properties and methods that effect the entire app
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 |
Undo the last action
Returns: nil
App:Undo()
Redo the previously undone action
Returns: nil
App:Redo()
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 |
App:AddListener("http://example.com")
Reset all panels
Returns: nil
App:ResetPanels()
Opens an Explorer/Finder window outside of VR showing the user's Scripts folder on the desktop (Mac/Windows only)
Returns: nil
App:ShowScriptsFolder()
Opens an Explorer/Finder window outside of VR showing the user's Export folder on the desktop (Mac/Windows only)
Returns: nil
App:ShowExportFolder()
Opens an Explorer/Finder window outside of VR showing the user's Sketches folder on the desktop (Mac/Windows only)
Returns: nil
App:ShowSketchesFolder()
Activate or deactivate straight edge mode
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | True means activate, false means deactivate |
App:StraightEdge(true)
Activate or deactivate auto orientation mode
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | True means activate, false means deactivate |
App:AutoOrient(true)
Activate or deactivate view only mode
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | True means activate, false means deactivate |
App:ViewOnly(true)
Activate or deactivate auto simplification mode
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | True means activate, false means deactivate |
App:AutoSimplify(true)
Activate or deactivate disco mode
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | True means activate, false means deactivate |
App:Disco(true)
Activate or deactivate profiling mode
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | True means activate, false means deactivate |
App:Profiling(true)
Activate or deactivate post-processing
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | True means activate, false means deactivate |
App:PostProcessing(true)
Set the drafting mode to visible
Returns: nil
App:DraftingVisible()
Set the drafting mode to transparent
Returns: nil
App:DraftingTransparent()
App:DraftingHidden()
Set the drafting mode to hidden
Returns: nil
App:DraftingHidden()
Activate or deactivate the watermark
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | True means activate, false means deactivate |
App:Watermark(true)
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 |
App:ReadFile("path/to/file.txt")
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 |
App:Error("This is an error message.")
Set the font used for drawing text
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
fontData | string | Font data in .chr format |
App:SetFont("fontData")
Take a snapshot of your scene and save it to your Snapshots folder
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
tr | Transform | 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 |
App:TakeSnapshop(Transform:New(0, 12, 3), "mysnapshot.png", 1024, 768, true)
Take a 360-degree snapshot of the scene and save it
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
tr | Transform | 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 |
App:Take360Snapshot(Transform:Position(0, 12, 3), "my360snapshot.png", 4096)