Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
Qt 3D Studio 2.4 BETA1
-
None
Description
Due to how world update and rendering are done in Slayer runtime, a synchronous getAttribute(elementPath) call is not feasible to implement. The getAttribute() API also has the unfortunate elementPath problem in that changes to the presentation design can easily break the elementPath and thus any code that depends on using that elementPath.
Due to this it's better to define a symmetrical API to DataInput where presentation project (UIA) defines known unique DataOutput names. Perhaps following DataInput format might work in the UIA file:
<dataOutput name="tachoNeedleAngle" type="Ranged Number"/>
In the presentation file (UIP) the observedproperty attribute can be attached to an element to create DataOutput model when loading and parsing the UIP. Exactly how DataInputs are parsed and created from controlledproperty attributes. But use observedproperty for attributes that can be observed via DataOutput. Note that a property can be also both, as an example of a property that is both observed and controlled:
<Add ref="#speedNeedle" name="speedNeedle" controlledproperty="$speed @timeline" observedproperty="$speed @timeline" "endtime="1000" opacity="100" position="0 1 0" scale="1 1 1" >
On QML (and C++) side the API will look very similar to the DataInput API:
DataOutput {
{{ name: "speed"}}
{{ onValueChanged: {}}}
}
This method is most efficient as the runtime can detect when a value is updated and only notify listening DataOutputs (if one is registered for the name) upon value actually changing.
Attachments
Issue Links
- resulted from
-
QT3DS-3200 [Slayer] Add getAttribute to private API
- Closed
1.
|
Implement support for observedproperty and DataOutput QML elements | Closed | Pasi Keränen | |
2.
|
Design UI for handling DataOutput nodes in the editor | Reported | Kimmo Leppälä | |
3.
|
Implement DataOutput support in the Editor | Reported | Unassigned |