|
The Drawing JavaScript global object. Iterate and manipulate the drawings of an element node. More...
Public Slots | |
| int | numberOfLayers (int elementId) |
| Returns the number of drawing layers in the element. More... | |
| String | layer (int elementId, int drawingLayerIndex) |
| Returns the drawing layer name. More... | |
| int | numberOf (int elementId) |
| Returns the number of drawings in the element. More... | |
| String | name (int elementId, int drawingIndex) |
| Returns the drawing id. More... | |
| bool | isExists (int elementId, String timing) |
| Returns true if the given drawing exists in this element. More... | |
| String | generateUniqueTiming (int elementId, String baseTiming) |
| String | generateUniqueTiming (int elementId) |
| bool | create (int elementId, String timing, bool fileExists, bool storeInProjectFolder=false) |
| Creates a new drawing inside an element. More... | |
| bool | importDrawing (int elementId, String timing, QScriptValue filepath) |
| String | filename (int elementId, String drawingName) |
| Returns the filename of this drawing on disk or in a vfs folder. More... | |
| QScriptValue | filepath (int elementId, String drawingName) |
| Returns the filepath of this drawing on disk or in a vfs folder. More... | |
| QScriptValue | Key (QScriptValue object) |
| Create a drawing key which can be used to test the availability of a drawing. More... | |
The Drawing JavaScript global object. Iterate and manipulate the drawings of an element node.
|
slot |
Creates a new drawing inside an element.
Create a new empty drawing inside the given element. The drawing file will physically exists in the temporary folder until the project is saved. Then, the file will reside in (scene folder)/elements/MyElement/ (where MyElement is the name of the element linked to the given elementId).
| elementId | : The unique id of the element. |
| timing | : The proposed drawing name. |
| fileExists | : Used to indicate that the drawing exists. By default, drawings exist in the temporary folder. |
| storeInProjectFolder | : Indicate that the drawing exits in the project folder, not in a temporary folder. |
|
slot |
Returns the filename of this drawing on disk or in a vfs folder.
This filename may be in the temp folder or project folder. Before the project is actually saved, the temporary folder is where the drawing must reside to be found by the application.
| elementId | : The unique id of the element. |
| drawingName | : The drawing name. |
|
slot |
Returns the filepath of this drawing on disk or in a vfs folder.
This filename may be in the temp folder or project folder. Before the project is actually saved, the temporary folder is where the drawing must reside to be found by the application.
| elementId | : The unique id of the element. |
| drawingName | : The drawing name. |
|
slot |
Returns a timing that does not exist in the element and could be passed to importDrawing().
| elementId | : The unique id of the element. |
| baseTiming | : The base drawing name. Can be empty. |
|
slot |
|
slot |
Imports a new drawing inside an element and assigns it the timing passed in argument. If the timing exists, the file will be replaced.
| elementId | : The unique id of the element. |
| timing | : The proposed drawing name. |
| filepath | : The file path to import. |
|
slot |
Returns true if the given drawing exists in this element.
| elementId | : The unique id of the element. |
| timing | : The drawing name. |
|
slot |
Create a drawing key which can be used to test the availability of a drawing.
Create a drawing key from an object having one of the following property set.
| object | an object with the following properties (see the example below). // Point to a drawing from the file system var fileDrawingKey = { filename : "C:/MySceneFolder/elements/Drawing/Drawing-1.tvg" }; var drawingKey = Drawing.Key(fileDrawingKey); if(!drawingKey.isValid) return; // Point to the drawing of a node exposed to a given frame var nodeDrawingKey = { node : "Top/MyDrawing", frame : 1 }; var drawingKey = Drawing.Key(nodeDrawingKey); if(!drawingKey.isValid) return; // Point to a drawing from an element var exposureDrawingKey = { elementId : 1, exposure : "2", layer : "Drawing_1" // [Optional] Name of the synced drawing layer. Get it from the "DRAWING.ELEMENT.LAYER" attribute from an element node. DO NOT SPECIFY if the drawing isn't a drawing layer. }; var drawingKey = Drawing.Key(exposureDrawingKey); if(!drawingKey.isValid) return; |
As a more complete example, here's how to get the properties of a drawing key from an element node.
|
slot |
Returns the drawing layer name.
| elementId | : The unique id of the element. |
| drawingLayerIndex | : The drawing layer index (if the index is 0 it will return the default drawing layer name, which is empty). |
|
slot |
Returns the drawing id.
| elementId | : The unique id of the element. |
| drawingIndex | : The drawing index. |
|
slot |
Returns the number of drawings in the element.
| elementId | : The unique id of the element. |
|
slot |
Returns the number of drawing layers in the element.
| elementId | : The unique id of the element. |