The project JavaScript global object. Retrieve and set global project attributes. More...
Public Slots | |
Project Saving and Loading | |
bool | saveAll () |
Performs the "save all" command. Effectively, this saves the entire project and all modified files. More... | |
bool | saveAsNewVersion (String &name, bool markAsDefault) |
Saves the project as a new version. More... | |
bool | saveAs (String &pathname) |
Save the current project to the specified folder. More... | |
bool | openProject (String &filePath) |
Closes the current project, and open the one specified by it's file path. More... | |
bool | isDirty () |
Tells if the project has been modified since its last save. More... | |
bool | hasBeenDirty () |
Returns true if the project was ever modified. More... | |
Project Data | |
int | projectVersion () |
Returns the ID of the current version. More... | |
String | projectVersionName () |
Returns the name of the current project version. More... | |
String | currentProjectPath () |
Returns the current project path. More... | |
String | currentProjectPathRemapped () |
For windows, returns the remapped path. More... | |
double | unitsAspectRatioX () |
Returns the X value of the aspect ratio of the cells in the grid. More... | |
double | unitsAspectRatioY () |
Returns the Y value of the aspect ratio of the cells in the grid. More... | |
int | numberOfUnitsX () |
Returns the number of units in the X axis of the grid. More... | |
int | numberOfUnitsY () |
Returns the number of units in the Y axis of the grid. More... | |
int | numberOfUnitsZ () |
Returns the number of units in the Z axis of the grid. More... | |
int | coordAtCenterX () |
Returns the X value of the centre coordinate of the grid. More... | |
int | coordAtCenterY () |
Returns the Y value of the centre coordinate of the grid. More... | |
int | currentResolutionX () |
Returns the X value of the current preview resolution. More... | |
int | currentResolutionY () |
Returns the Y value of the current preview resolution. More... | |
String | defaultResolutionName () |
Returns the default resolution name. More... | |
int | defaultResolutionX () |
Returns the X value of the default resolution. More... | |
int | defaultResolutionY () |
Returns the Y value of the default resolution. More... | |
double | defaultResolutionFOV () |
Returns the default resolution field of view (FOV). The default FOV is a global project parameter. More... | |
StringList | namedResolutions () |
Returns the list of known resolutions. More... | |
int | namedResolutionX (String name) |
Returns the X value of the named resolution. For example, when the named resolution is 720x540 pixels this function will return 720. More... | |
int | namedResolutionY (String name) |
Returns the Y value of the named resolution. For example, when the named resolution is 720x540 pixels this function will return 540. More... | |
double | getFrameRate () |
Returns the frame rate, as frames per second. More... | |
Global Project Edition. | |
bool | setUnitsAspectRatio (double x, double y) |
Sets the aspect ratio of the project. The project's final aspect ratio will be: X * numberOfUnitsX()/Y * numberOfUnitsY(). More... | |
bool | setNumberOfUnits (int x, int y, int z) |
Sets the number of X, Y, and Z units in the grid. More... | |
bool | setCoordAtCenter (int x, int y) |
Sets the value of the centre (X, Y) coordinates. More... | |
bool | setDefaultResolution (int x, int y, double fov) |
Sets the default project resolution and field of view. More... | |
bool | setDefaultResolutionName (String name) |
This function sets the default project resolution name. More... | |
bool | setFrameRate (double frameRate) |
This function set the default frame rate of the project. The frame rate is expressed as frames per second. Typical value is 12, 24 or 30. More... | |
QScriptValue | metadatas () |
Return the list of metadatas for the current project. More... | |
QScriptValue | metadata (String &name, String &type=QNTR("string")) |
Return a metadata object corresponding to the given name and type. More... | |
void | setMetadata (QScriptValue &meta) |
Either inserts a new metadata object or sets the value of an existing metadata object. More... | |
bool | removeMetadata (QScriptValue &meta) |
Removes a metadata object from the list of metadata objects. More... | |
Undo / Redo | |
Functions will generate only one Undo/Redo entry if sandwiched by these two functions. | |
void | beginUndoRedoAccum (String commandName) |
This function starts the accumulation of all of the functions between it and the endUndoRedoAccum function as one command that will appear in the undo/redo list. If you do not use this function with endUndoRedoAccum, each function in the script generates a separate undo/redo entry. More... | |
void | endUndoRedoAccum () |
This function ends the accumulation all of the functions between it and the beginUndoRedoAccum function as one command that will appear in the undo/redo list. If you do not use this function with beginUndoRedoAccum, each function in the script generates a separate undo/redo entry. More... | |
void | cancelUndoRedoAccum () |
This function cancels the accumulation of undo/redo commands. No command will be added to the undo/redo list and all commands that have already been executed will be rolled-back (undone). More... | |
void | undo (int depth=1) |
Undoes the last n operations. If n is not specified, it will be 1. More... | |
void | redo (int depth=1) |
Redoes the last n operations. If n is not specified, it will be 1. More... | |
void | clearHistory () |
Clears the command history. More... | |
The project JavaScript global object. Retrieve and set global project attributes.
|
slot |
This function starts the accumulation of all of the functions between it and the endUndoRedoAccum function as one command that will appear in the undo/redo list. If you do not use this function with endUndoRedoAccum, each function in the script generates a separate undo/redo entry.
commandName | : The name of the command to be added to the undo/redo list. |
|
slot |
This function cancels the accumulation of undo/redo commands. No command will be added to the undo/redo list and all commands that have already been executed will be rolled-back (undone).
|
slot |
Clears the command history.
|
slot |
Returns the X value of the centre coordinate of the grid.
|
slot |
Returns the Y value of the centre coordinate of the grid.
|
slot |
Returns the current project path.
|
slot |
For windows, returns the remapped path.
|
slot |
Returns the X value of the current preview resolution.
For example, when the current resolution is 720x540 pixels this function will return 720.
|
slot |
Returns the Y value of the current preview resolution.
For example, when the current resolution is 720x540 pixels this function will return 540.
|
slot |
Returns the default resolution field of view (FOV). The default FOV is a global project parameter.
|
slot |
Returns the default resolution name.
The resolution name is a global parameter saved with the project. It may be empty when the project is used as a custom resolution, which is not one of the pre-defined resolutions.
|
slot |
Returns the X value of the default resolution.
This resolution is a global parameter saved with the project, not the current preview resolution. For example, when the default project resolution is 720x540 pixels this function will return 720.
|
slot |
Returns the Y value of the default resolution.
This resolution is a global parameter saved with the project, not the current preview resolution. For example, when the default project resolution is 720x540 pixels this function will return 540.
|
slot |
This function ends the accumulation all of the functions between it and the beginUndoRedoAccum function as one command that will appear in the undo/redo list. If you do not use this function with beginUndoRedoAccum, each function in the script generates a separate undo/redo entry.
|
slot |
Returns the frame rate, as frames per second.
|
slot |
Returns true if the project was ever modified.
It will return true even if the modifications have been saved.
|
slot |
Tells if the project has been modified since its last save.
|
slot |
Return a metadata object corresponding to the given name and type.
Here is an example of a metadata object:
Supported values for type are: string, int, double, bool.
name | : The name of the metadata object. |
type | : The metadata type. |
|
slot |
Return the list of metadatas for the current project.
This method returns an array of javascript objects where each object represent a single metadata object. Here is an example of a metadata object:
Supported values for type are: string, int, double, bool.
|
slot |
Returns the list of known resolutions.
|
slot |
Returns the X value of the named resolution. For example, when the named resolution is 720x540 pixels this function will return 720.
name | : The name of the resolution to get the value from. |
|
slot |
Returns the Y value of the named resolution. For example, when the named resolution is 720x540 pixels this function will return 540.
name | : The name of the resolution to get the value from. |
|
slot |
Returns the number of units in the X axis of the grid.
|
slot |
Returns the number of units in the Y axis of the grid.
|
slot |
Returns the number of units in the Z axis of the grid.
|
slot |
Closes the current project, and open the one specified by it's file path.
filePath | : The full path to the file to open. |
|
slot |
Returns the ID of the current version.
|
slot |
Returns the name of the current project version.
|
slot |
Redoes the last n operations. If n is not specified, it will be 1.
depth | : The number of operations to redo. |
|
slot |
Removes a metadata object from the list of metadata objects.
meta | : A metadata object. |
|
slot |
Performs the "save all" command. Effectively, this saves the entire project and all modified files.
|
slot |
Save the current project to the specified folder.
Save the current project to the specified folder. Folder must not exists. The current project is updated to use that folder. Any error or message is reported using the standard error logger (so, in non batch mode, user will see message popup).
This API only works in standalone as you cannot 'Save As' in database.
pathname | : New folder of the project (ie: /Users/a_user/Documents/my_save_as_project ) |
|
slot |
Saves the project as a new version.
name | : The name of the version. |
markAsDefault | : This is boolean to indicate to mark this version as the default version. |
|
slot |
Sets the value of the centre (X, Y) coordinates.
x | : The value of the X coordinate at the centre of the grid. |
y | : The value of the Y coordinate at the centre of the grid. |
|
slot |
Sets the default project resolution and field of view.
x | : Set the X resolution for the project in pixels. |
y | : Set the Y resolution for the project in pixels. |
fov | : Set the field of view in degree. Typical value is 41.112. |
|
slot |
This function sets the default project resolution name.
name | : Set the current resolution preset name to this value. |
|
slot |
This function set the default frame rate of the project. The frame rate is expressed as frames per second. Typical value is 12, 24 or 30.
frameRate | : The new frame rate. |
|
slot |
Either inserts a new metadata object or sets the value of an existing metadata object.
If a metadata object already exist with the given name and type properties, then sets its value with the given value property. Otherwise, inserts a new metadata object with the given name, type(default is string), creator(default is executable), version(default is 1.0) and values properties. Here is an example of a metadata object:
Supported values for type are: string, int, double, bool.
meta | : A metadata object. |
|
slot |
Sets the number of X, Y, and Z units in the grid.
x | : The X value of the grid. |
y | : The Y value of the grid. |
z | : The Z value of the grid. |
|
slot |
Sets the aspect ratio of the project. The project's final aspect ratio will be: X * numberOfUnitsX()/Y * numberOfUnitsY().
x | : The X value of the new aspect ratio. |
y | : The Y value of the new aspect ratio. |
|
slot |
Undoes the last n operations. If n is not specified, it will be 1.
depth | : The number of operations to undo. |
|
slot |
Returns the X value of the aspect ratio of the cells in the grid.
|
slot |
Returns the Y value of the aspect ratio of the cells in the grid.