diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-08-16 10:35:13 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-08-16 12:43:38 +0000 |
commit | b7948e09c29a86785485aa3e05f438e4575811c2 (patch) | |
tree | fd39785935ded96ac697bd4dd2adff989b56e6c5 /src/runtime/api/q3dselement.cpp | |
parent | 87579a5c2efc37c56642cbbf39fd7d1b7734cf1c (diff) |
Add support for element paths referencing objects in properties
Users of the legacy API may very well do something like the following:
Element { id: texture; elementPath:
"Scene.Layer.Rectangle.Material.diffusemap" }
texture.setAttribute("sourcepath", "some_image.png");
Note how the .diffusemap selects the Image object stored in the diffusemap
property instead of a child object named diffusemap.
Task-number: QT3DS-2089
Change-Id: I1b03516f67b390f8411e263774d64980b9f9e09b
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/runtime/api/q3dselement.cpp')
-rw-r--r-- | src/runtime/api/q3dselement.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/runtime/api/q3dselement.cpp b/src/runtime/api/q3dselement.cpp index a09d21e..ba99c80 100644 --- a/src/runtime/api/q3dselement.cpp +++ b/src/runtime/api/q3dselement.cpp @@ -109,6 +109,11 @@ Q3DSElement::~Q3DSElement() question was renamed to \c MyCamera, applications can then simply pass \c MyCamera as the element path. + To reference an object stored in a property of another object, the dot + syntax can be used. The most typical example of this is changing the source + of a texture map by changing the \c sourcepath property on the object + selected by \c{SomeMaterial.diffusemap}. + To access an object in a sub-presentation, prepend the name of the sub-presentation followed by a colon, for example, \c{SubPresentationOne:Scene.Layer.Camera}. @@ -215,6 +220,11 @@ void Q3DSElementPrivate::setPresentation(Q3DSPresentation *pres) question was renamed to \c MyCamera, applications can then simply pass \c MyCamera as the element path. + To reference an object stored in a property of another object, the dot + syntax can be used. The most typical example of this is changing the source + of a texture map by changing the \c sourcepath property on the object + selected by \c{SomeMaterial.diffusemap}. + To access an object in a sub-presentation, prepend the name of the sub-presentation followed by a colon, for example, \c{SubPresentationOne:Scene.Layer.Camera}. |