summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2019-06-28 10:46:43 +0300
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2019-06-28 11:06:43 +0300
commit90702603c5e525190c94f24c10cb9ff83e7abb19 (patch)
treedcf76e4de1dccb9646fbd35c6b9a5a1ea2009922 /src
parent427bf6fac383f066a1378679a88546b16f156c7e (diff)
parent0c4183e5748576845d9ce2aa61f56cf5c69c6350 (diff)
Merge "Merge branch '2.4'"
Diffstat (limited to 'src')
m---------src/3rdparty/EASTL0
-rw-r--r--src/api/studio3d/doc/doc.pri9
-rw-r--r--src/api/studio3d/doc/online/qtstudio3d.qdocconf2
-rw-r--r--src/api/studio3d/doc/qt3dstudio-opengl-runtime-project.qdocconf63
-rw-r--r--src/api/studio3d/doc/qtstudio3d.qdocconf2
-rw-r--r--src/api/studio3d/doc/src/attributenames.html911
-rw-r--r--src/api/studio3d/doc/src/attributenames.qdoc71
-rw-r--r--src/api/studio3d/doc/src/building-embedded.qdoc82
-rw-r--r--src/api/studio3d/doc/src/building-integrity.qdoc71
-rw-r--r--src/api/studio3d/doc/src/building-opengl-runtime.qdoc44
-rw-r--r--src/api/studio3d/doc/src/building-qnx.qdoc162
-rw-r--r--src/api/studio3d/doc/src/copyright.qdoc38
-rw-r--r--src/api/studio3d/doc/src/embedded.qdoc32
-rw-r--r--src/api/studio3d/doc/src/examples.qdoc41
-rw-r--r--src/api/studio3d/doc/src/gettingstarted.qdoc117
-rw-r--r--src/api/studio3d/doc/src/images/add-build-step-qnx.pngbin0 -> 212284 bytes
-rw-r--r--src/api/studio3d/doc/src/images/add-build-step.pngbin0 -> 170273 bytes
-rw-r--r--src/api/studio3d/doc/src/images/add-qnx-device.pngbin0 -> 19121 bytes
-rw-r--r--src/api/studio3d/doc/src/images/customsignal.pngbin0 -> 28206 bytes
-rw-r--r--src/api/studio3d/doc/src/images/devices-tab.pngbin0 -> 118542 bytes
-rw-r--r--src/api/studio3d/doc/src/images/embedded-linux-2.pngbin0 -> 136019 bytes
-rw-r--r--src/api/studio3d/doc/src/images/embedded-linux.pngbin0 -> 177270 bytes
-rw-r--r--src/api/studio3d/doc/src/images/intro-app.pngbin0 -> 368639 bytes
-rw-r--r--src/api/studio3d/doc/src/images/intro-editor.pngbin0 -> 289164 bytes
-rw-r--r--src/api/studio3d/doc/src/images/intro-viewer.pngbin0 -> 338976 bytes
-rw-r--r--src/api/studio3d/doc/src/images/ogl-runtime-pro.pngbin0 -> 68177 bytes
-rw-r--r--src/api/studio3d/doc/src/images/qnx-prebuild.pngbin0 -> 112522 bytes
-rw-r--r--src/api/studio3d/doc/src/images/qnx-sdp-folder.pngbin0 -> 22958 bytes
-rw-r--r--src/api/studio3d/doc/src/images/qt-installer-qnx-prebuild.pngbin0 -> 94480 bytes
-rw-r--r--src/api/studio3d/doc/src/images/qt3dstudio-pro.pngbin0 -> 52413 bytes
-rw-r--r--src/api/studio3d/doc/src/images/select-prebuilt-qnx-component.pngbin0 -> 127837 bytes
-rw-r--r--src/api/studio3d/doc/src/images/twolayers.pngbin0 -> 4564 bytes
-rw-r--r--src/api/studio3d/doc/src/index.qdoc45
-rw-r--r--src/api/studio3d/doc/src/mobile.qdoc32
-rw-r--r--src/api/studio3d/doc/src/module.qdoc111
-rw-r--r--src/api/studio3d/doc/src/requirements.qdoc100
-rw-r--r--src/api/studio3d/doc/src/toc.qdoc40
-rw-r--r--src/api/studio3d/doc/style/qt5-sidebar.html26
-rw-r--r--src/api/studio3d/q3dscommandqueue.cpp5
-rw-r--r--src/api/studio3d/q3dscommandqueue_p.h2
-rw-r--r--src/api/studio3d/q3dsdatainput.cpp105
-rw-r--r--src/api/studio3d/q3dsdatainput.h3
-rw-r--r--src/api/studio3d/q3dsdataoutput.cpp27
-rw-r--r--src/api/studio3d/q3dselement.cpp6
-rw-r--r--src/api/studio3d/q3dsgeometry.cpp212
-rw-r--r--src/api/studio3d/q3dspresentation.cpp428
-rw-r--r--src/api/studio3d/q3dssceneelement.cpp16
-rw-r--r--src/api/studio3d/q3dssurfaceviewer.cpp3
-rw-r--r--src/api/studio3d/q3dsviewersettings.cpp92
-rw-r--r--src/api/studio3d/q3dsviewersettings.h7
-rw-r--r--src/api/studio3d/q3dsviewersettings_p.h2
-rw-r--r--src/api/studio3d/studio3d.pro2
-rw-r--r--src/api/studio3dqml/plugins.qmltypes438
-rw-r--r--src/api/studio3dqml/q3dspresentationitem.cpp44
-rw-r--r--src/api/studio3dqml/q3dsrenderer.cpp10
-rw-r--r--src/api/studio3dqml/q3dsrenderer_p.h5
-rw-r--r--src/api/studio3dqml/q3dsstudio3d.cpp26
-rw-r--r--src/api/studio3dqml/q3dsstudio3d_p.h2
-rw-r--r--src/dm/systems/Qt3DSDMStringTable.h1
-rw-r--r--src/engine/Qt3DSRenderRuntimeBindingImplRenderer.cpp1
-rw-r--r--src/engine/Qt3DSRenderRuntimeBindingImplTranslation.cpp96
-rw-r--r--src/engine/Qt3DSRuntimeView.cpp3
-rw-r--r--src/engine/Qt3DSRuntimeView.h1
-rw-r--r--src/foundation/Qt3DSFoundation.cpp9
-rw-r--r--src/foundation/Qt3DSPreprocessor.h17
-rw-r--r--src/foundation/StringTable.cpp83
-rw-r--r--src/foundation/StringTable.h2
-rw-r--r--src/foundation/qt/formatdiscovery.cpp18
-rw-r--r--src/ogl-runtime-dylib/ogl-runtime-dylib.pro16
-rw-r--r--src/ogl-runtime-static/ogl-runtime-static.pro11
-rw-r--r--src/qmlstreamer/q3dsqmlstream.cpp9
-rw-r--r--src/qmlstreamer/q3dsqmlsubpresentationsettings.cpp8
-rw-r--r--src/runtime/Qt3DSActivationManager.cpp5
-rw-r--r--src/runtime/Qt3DSApplication.cpp14
-rw-r--r--src/runtime/Qt3DSApplication.h5
-rw-r--r--src/runtime/Qt3DSElementSystem.cpp73
-rw-r--r--src/runtime/Qt3DSElementSystem.h3
-rw-r--r--src/runtime/Qt3DSQmlElementHelper.cpp32
-rw-r--r--src/runtime/Qt3DSQmlElementHelper.h3
-rw-r--r--src/runtime/Qt3DSQmlEngine.cpp229
-rw-r--r--src/runtimerender/Qt3DSDistanceFieldRenderer.cpp33
-rw-r--r--src/runtimerender/Qt3DSDistanceFieldRenderer.h1
-rw-r--r--src/runtimerender/Qt3DSOnscreenTextRenderer.cpp14
-rw-r--r--src/runtimerender/Qt3DSRenderContextCore.cpp36
-rw-r--r--src/runtimerender/Qt3DSRenderContextCore.h1
-rw-r--r--src/runtimerender/Qt3DSRenderCustomMaterialSystem.cpp4
-rw-r--r--src/runtimerender/Qt3DSRenderCustomMaterialSystem.h2
-rw-r--r--src/runtimerender/graphobjects/Qt3DSRenderScene.cpp7
-rw-r--r--src/runtimerender/rendererimpl/Qt3DSRendererImpl.cpp34
-rw-r--r--src/runtimerender/rendererimpl/Qt3DSRendererImpl.h4
-rw-r--r--src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderData.cpp23
-rw-r--r--src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.cpp32
-rw-r--r--src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.h6
-rw-r--r--src/runtimerender/rendererimpl/Qt3DSRendererImplShaders.cpp1
-rw-r--r--src/viewer/Qt3DSViewerApp.cpp14
-rw-r--r--src/viewer/Qt3DSViewerApp.h1
96 files changed, 3752 insertions, 534 deletions
diff --git a/src/3rdparty/EASTL b/src/3rdparty/EASTL
-Subproject e4b2f453fd3cb3176922af9ab6bc79ddafc12c4
+Subproject 31697c758f2ed19bd7c6bbe61f1b91f9e12035b
diff --git a/src/api/studio3d/doc/doc.pri b/src/api/studio3d/doc/doc.pri
new file mode 100644
index 0000000..ec30e40
--- /dev/null
+++ b/src/api/studio3d/doc/doc.pri
@@ -0,0 +1,9 @@
+build_online_docs: \
+ QMAKE_DOCS = $$PWD/online/qtstudio3d.qdocconf
+else: \
+ QMAKE_DOCS = $$PWD/qtstudio3d.qdocconf
+
+OTHER_FILES += \
+ $$PWD/src/*.qdoc \
+ $$PWD/src/*.html \
+ $$PWD/src/images/*.png \
diff --git a/src/api/studio3d/doc/online/qtstudio3d.qdocconf b/src/api/studio3d/doc/online/qtstudio3d.qdocconf
new file mode 100644
index 0000000..a1dd74d
--- /dev/null
+++ b/src/api/studio3d/doc/online/qtstudio3d.qdocconf
@@ -0,0 +1,2 @@
+include($QT_INSTALL_DOCS/global/qt-module-defaults-online-commercial.qdocconf)
+include(../qt3dstudio-opengl-runtime-project.qdocconf)
diff --git a/src/api/studio3d/doc/qt3dstudio-opengl-runtime-project.qdocconf b/src/api/studio3d/doc/qt3dstudio-opengl-runtime-project.qdocconf
new file mode 100644
index 0000000..ece96a5
--- /dev/null
+++ b/src/api/studio3d/doc/qt3dstudio-opengl-runtime-project.qdocconf
@@ -0,0 +1,63 @@
+project = QtStudio3D
+description = Qt 3D Studio OpenGL Runtime Reference
+version = $QT_VERSION
+# url is relative to the parent project
+url = openglruntime
+
+moduleheader = QtStudio3D
+
+sourcedirs += ./src \
+ ../.. \
+ ../../../qmlstreamer
+
+headerdirs += ../.. \
+ ../../../qmlstreamer
+
+imagedirs += ./src/images
+
+depends = qtcore qtgui qtwidgets qtqml qtquick qtquickcontrols qt3dstudio qt3dstudioruntime2 qtdoc qmake
+
+qhp.projects = QtStudio3D
+
+qhp.QtStudio3D.file = qtstudio3d.qhp
+qhp.QtStudio3D.namespace = io.qt.qtstudio3d.$QT_VERSION_TAG
+qhp.QtStudio3D.virtualFolder = qtstudio3d
+qhp.QtStudio3D.indexTitle = Qt 3D Studio OpenGL Runtime
+qhp.QtStudio3D.indexRoot =
+
+qhp.QtStudio3D.filterAttributes = qtstudio3d $QT_VER
+qhp.QtStudio3D.customFilters.Qt.name = QtStudio3D $QT_VER
+qhp.QtStudio3D.customFilters.Qt.filterAttributes = qtstudio3d $QT_VER
+
+qhp.QtStudio3D.subprojects = qmltypes classes
+
+qhp.QtStudio3D.subprojects.qmltypes.title = QML Types
+qhp.QtStudio3D.subprojects.qmltypes.indexTitle = Qt 3D Studio OpenGL Runtime QML Types
+qhp.QtStudio3D.subprojects.qmltypes.selectors = qmltype
+qhp.QtStudio3D.subprojects.qmltypes.sortPages = true
+
+qhp.QtStudio3D.subprojects.classes.title = C++ Classes
+qhp.QtStudio3D.subprojects.classes.indexTitle = Qt 3D Studio OpenGL Runtime C++ Classes
+qhp.QtStudio3D.subprojects.classes.selectors = class namespace doc:headerfile
+qhp.QtStudio3D.subprojects.classes.sortPages = true
+
+# Add an .html file with sidebar content, used in the online style
+HTML.stylesheets += style/qt5-sidebar.html
+
+navigation.homepage = "Qt 3D Studio OpenGL Runtime"
+navigation.hometitle = "Qt 3D Studio OpenGL Runtime"
+navigation.hometitle = "OpenGL Runtime"
+navigation.landingpage = "Qt 3D Studio OpenGL Runtime"
+navigation.landingtitle = OpenGL Runtime
+navigation.cppclassespage = Qt 3D Studio OpenGL Runtime C++ Classes
+navigation.qmltypespage = Qt 3D Studio OpenGL Runtime QML Types
+buildversion = "Qt 3D Studio OpenGL Runtime $QT_VER Manual"
+
+macro.RUNTIME = Qt 3D Studio OpenGL Runtime
+
+#TODO: adjust these once we have runtime-specific examples
+# examplesinstallpath = studio3d
+# exampledirs += ../examples/studio3d
+
+Cpp.ignoretokens += Q3DSV_EXPORT Q_STUDIO3D_EXPORT
+depends += qt3d
diff --git a/src/api/studio3d/doc/qtstudio3d.qdocconf b/src/api/studio3d/doc/qtstudio3d.qdocconf
new file mode 100644
index 0000000..9b76104
--- /dev/null
+++ b/src/api/studio3d/doc/qtstudio3d.qdocconf
@@ -0,0 +1,2 @@
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
+include(qt3dstudio-opengl-runtime-project.qdocconf)
diff --git a/src/api/studio3d/doc/src/attributenames.html b/src/api/studio3d/doc/src/attributenames.html
new file mode 100644
index 0000000..fca55df
--- /dev/null
+++ b/src/api/studio3d/doc/src/attributenames.html
@@ -0,0 +1,911 @@
+\raw HTML
+<table id='scripting-attributes'>
+<tbody></tbody>
+<tr><th colspan="4">Scenes</td></tr>
+<tr>
+<td class='formal'>Name</td>
+<td class='scripting'>name</td>
+<td class='type'>string</td>
+</tr>
+<tr>
+<td class='formal'>Enable Background Color</td>
+<td class='scripting'>bgcolorenable</td>
+<td class='type'>boolean</td>
+</tr>
+<tr>
+<td class='formal'>Background Color R</td>
+<td class='scripting'>backgroundcolor.r</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Background Color G</td>
+<td class='scripting'>backgroundcolor.g</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Background Color B</td>
+<td class='scripting'>backgroundcolor.b</td>
+<td class='type'>number</td>
+</tr>
+<tbody></tbody>
+<tr><th colspan="4">Elements other than Scenes</td></tr>
+<tr>
+<td class='formal'>Element Name</td>
+<td class='scripting'>name</td>
+<td class='type'>string</td>
+</tr>
+<tr>
+<td class='formal'>(Eyeball)</td>
+<td class='scripting'>eyeball</td>
+<td class='type'>boolean</td>
+</tr>
+<tr>
+<td class='formal'>Timebar Start</td>
+<td class='scripting'>starttime</td>
+<td class='type'>number</td>
+<td class='note'>
+in integer milliseconds
+</td>
+</tr>
+<tr>
+<td class='formal'>Timebar End</td>
+<td class='scripting'>endtime</td>
+<td class='type'>number</td>
+<td class='note'>
+in integer milliseconds
+</td>
+</tr>
+<tbody></tbody>
+<tr><th colspan="4">Layers</td></tr>
+<tr>
+<td class='formal'>Disable Depth Test</td>
+<td class='scripting'>disabledepthtest</td>
+<td class='type'>boolean</td>
+</tr>
+<tr>
+<td class='formal'>Progressive AA</td>
+<td class='scripting'>progressiveaa</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'None'</code>, <code>'2x'</code>, <code>'4x'</code>, <code>'8x'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Multisample AA</td>
+<td class='scripting'>multisampleaa</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'None'</code>, <code>'2x'</code>, <code>'4x'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Temporal AA</td>
+<td class='scripting'>temporalaa</td>
+<td class='type'>boolean</td>
+</tr>
+<tr>
+<td class='formal'>Layer Background</td>
+<td class='scripting'>background</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'Transparent'</code>, <code>'Unspecified'</code>, <code>'SolidColor'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Background Color R</td>
+<td class='scripting'>backgroundcolor.r</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Background Color G</td>
+<td class='scripting'>backgroundcolor.g</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Background Color B</td>
+<td class='scripting'>backgroundcolor.b</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Blend Type</td>
+<td class='scripting'>blendtype</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'Normal'</code>, <code>'Screen'</code>, <code>'Multiply'</code>, <code>'Add'</code>, <code>'*Overlay'</code>, <code>'*ColorBurn'</code>, <code>'*ColorDodge'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Horizontal Fields</td>
+<td class='scripting'>horzfields</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'Left/Width'</code>, <code>'Left/Right'</code>, <code>'Width/Right'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Left</td>
+<td class='scripting'>left</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Left Units</td>
+<td class='scripting'>leftunits</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'pixels'</code>, <code>'percent'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Width</td>
+<td class='scripting'>width</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Width Units</td>
+<td class='scripting'>widthunits</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'pixels'</code>, <code>'percent'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Right</td>
+<td class='scripting'>right</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Right Units</td>
+<td class='scripting'>rightunits</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'pixels'</code>, <code>'percent'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Vertical Fields</td>
+<td class='scripting'>vertfields</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'Top/Height'</code>, <code>'Top/Bottom'</code>, <code>'Height/Bottom'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Top</td>
+<td class='scripting'>top</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Top Units</td>
+<td class='scripting'>topunits</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'pixels'</code>, <code>'percent'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Height</td>
+<td class='scripting'>height</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Height Units</td>
+<td class='scripting'>heightunits</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'pixels'</code>, <code>'percent'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Bottom</td>
+<td class='scripting'>bottom</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Bottom Units</td>
+<td class='scripting'>bottomunits</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'pixels'</code>, <code>'percent'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Ambient Occlusion</td>
+<td class='scripting'>aostrength</td>
+<td class='type'>number</td>
+<td class='note'>
+values between 0 and 100
+</td>
+</tr>
+<tr>
+<td class='formal'>AO Distance</td>
+<td class='scripting'>aodistance</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>AO Softness</td>
+<td class='scripting'>aosoftness</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>AO Threshold</td>
+<td class='scripting'>aobias</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>AO Sampling Rate</td>
+<td class='scripting'>aosamplerate</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>AO Dithering</td>
+<td class='scripting'>aodither</td>
+<td class='type'>boolean</td>
+</tr>
+<tr>
+<td class='formal'>Shadow Strength</td>
+<td class='scripting'>shadowstrength</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Shadow Distance</td>
+<td class='scripting'>shadowdist</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Shadow Softness</td>
+<td class='scripting'>shadowsoftness</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Shadow Threshold</td>
+<td class='scripting'>shadowbias</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Light Probe</td>
+<td class='scripting'>lightprobe</td>
+<td class='type'>image element</td>
+</tr>
+<tr>
+<td class='formal'>IBL Horizon Cutoff</td>
+<td class='scripting'>probehorizon</td>
+<td class='type'>number</td>
+<td class='note'>
+values from -1 (no horizon) to -0.001 (hard edge)
+</td>
+</tr>
+<tr>
+<td class='formal'>Sub-Presentation</td>
+<td class='scripting'>sourcepath</td>
+<td class='type'>string</td>
+<td class='note'>
+id of the sub-presentation to display
+</td>
+</tr>
+<tbody></tbody>
+<tr><th colspan="4">Nodes</td></tr>
+<tr>
+<td class='formal'>Position X</td>
+<td class='scripting'>position.x</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Position Y</td>
+<td class='scripting'>position.y</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Position Z</td>
+<td class='scripting'>position.z</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Rotation X</td>
+<td class='scripting'>rotation.x</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Rotation Y</td>
+<td class='scripting'>rotation.y</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Rotation Z</td>
+<td class='scripting'>rotation.z</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Scale X</td>
+<td class='scripting'>scale.x</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Scale Y</td>
+<td class='scripting'>scale.y</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Scale Z</td>
+<td class='scripting'>scale.z</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Pivot X</td>
+<td class='scripting'>pivot.x</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Pivot Y</td>
+<td class='scripting'>pivot.y</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Pivot Z</td>
+<td class='scripting'>pivot.z</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Opacity</td>
+<td class='scripting'>opacity</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'></td>
+<td class='scripting'>orientation</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'Left Handed'</code>, <code>'Right Handed'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'></td>
+<td class='scripting'>rotationorder</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'XYZ'</code>, <code>'YZX'</code>, <code>'ZXY'</code>, <code>'XZY'</code>, <code>'YXZ'</code>, <code>'ZYX'</code>, <code>'XYZr'</code>, <code>'YZXr'</code>, <code>'ZXYr'</code>, <code>'XZYr'</code>, <code>'YXZr'</code>, <code>'ZYXr'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'></td>
+<td class='scripting'>ignoresparent</td>
+<td class='type'>boolean</td>
+<td class='note'>
+prevents parent transformation from being applied [ignored as of 2.0]
+</td>
+</tr>
+<tbody></tbody>
+<tr><th colspan="4">Aliases</td></tr>
+<tr>
+<td class='formal'>Reference</td>
+<td class='scripting'>referencednode</td>
+<td class='type'>string</td>
+<td class='note'>
+relative or absolute element path
+</td>
+</tr>
+<tbody></tbody>
+<tr><th colspan="4">Cameras</td></tr>
+<tr>
+<td class='formal'>Orthographic</td>
+<td class='scripting'>orthographic</td>
+<td class='type'>boolean</td>
+</tr>
+<tr>
+<td class='formal'>Field of View</td>
+<td class='scripting'>fov</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Clipping Start</td>
+<td class='scripting'>clipnear</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Clipping End</td>
+<td class='scripting'>clipfar</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Runtime Scale Mode</td>
+<td class='scripting'>scalemode</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'Fit'</code>, <code>'Same Size'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Runtime Scale Anchor</td>
+<td class='scripting'>scaleanchor</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'Center'</code>, <code>'NW'</code>, <code>'N'</code>, <code>'NE'</code>, <code>'E'</code>, <code>'SE'</code>, <code>'S'</code>, <code>'SW'</code>, <code>'W'</code>
+</td>
+</tr>
+<tbody></tbody>
+<tr><th colspan="4">Lights</td></tr>
+<tr>
+<td class='formal'>Scope</td>
+<td class='scripting'>scope</td>
+<td class='type'>string</td>
+<td class='note'>
+full path to the element
+</td>
+</tr>
+<tr>
+<td class='formal'>Light Type</td>
+<td class='scripting'>lighttype</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'Directional'</code>, <code>'Point'</code>, <code>'Area'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Light Color R</td>
+<td class='scripting'>lightdiffuse.r</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Light Color G</td>
+<td class='scripting'>lightdiffuse.g</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Light Color B</td>
+<td class='scripting'>lightdiffuse.b</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Specular Color R</td>
+<td class='scripting'>lightspecular.r</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Specular Color G</td>
+<td class='scripting'>lightspecular.g</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Specular Color B</td>
+<td class='scripting'>lightspecular.b</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Ambient Color R</td>
+<td class='scripting'>lightambient.r</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Ambient Color G</td>
+<td class='scripting'>lightambient.g</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Ambient Color B</td>
+<td class='scripting'>lightambient.b</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Brightness</td>
+<td class='scripting'>brightness</td>
+<td class='type'>number</td>
+<td class='note'>
+only applies to point lights
+</td>
+</tr>
+<tr>
+<td class='formal'>Linear Fade</td>
+<td class='scripting'>linearfade</td>
+<td class='type'>number</td>
+<td class='note'>
+only applies to point lights
+</td>
+</tr>
+<tr>
+<td class='formal'>Exponential Fade</td>
+<td class='scripting'>expfade</td>
+<td class='type'>number</td>
+<td class='note'>
+only applies to point lights
+</td>
+</tr>
+<tr>
+<td class='formal'>Cast Shadows?</td>
+<td class='scripting'>castshadow</td>
+<td class='type'>boolean</td>
+</tr>
+<tr>
+<td class='formal'>Shadow Darkness</td>
+<td class='scripting'>shdwfactor</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Shadow Softness</td>
+<td class='scripting'>shdwfilter</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Shadow Resolution</td>
+<td class='scripting'>shdwmapres</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'256'</code>, <code>'512'</code>, <code>'1024'</code>, <code>'2048'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Shadow Depth Bias</td>
+<td class='scripting'>shdwbias</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Shadow Far Clip</td>
+<td class='scripting'>shdwmapfar</td>
+<td class='type'>number</td>
+<tr>
+<td class='formal'>Shadow Field of View</td>
+<td class='scripting'>shdwmapfov</td>
+<td class='type'>number</td>
+</tr>
+<tbody></tbody>
+<tr><th colspan="4">Groups</td></tr>
+<tr>
+<td class='formal'>Import</td>
+<td class='scripting'>sourcepath</td>
+<td class='type'>string</td>
+</tr>
+<tbody></tbody>
+<tr><th colspan="4">Text</td></tr>
+<tr>
+<td class='formal'>Text String</td>
+<td class='scripting'>textstring</td>
+<td class='type'>string</td>
+</tr>
+<tr>
+<td class='formal'>Text Color R</td>
+<td class='scripting'>textcolor.r</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Text Color G</td>
+<td class='scripting'>textcolor.g</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Text Color B</td>
+<td class='scripting'>textcolor.b</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Font</td>
+<td class='scripting'>font</td>
+<td class='type'>string</td>
+</tr>
+<tr>
+<td class='formal'>Font Size</td>
+<td class='scripting'>size</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Horizontal Alignment</td>
+<td class='scripting'>horzalign</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'Left'</code>, <code>'Center'</code>, <code>'Right'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Vertical Alignment</td>
+<td class='scripting'>vertalign</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'Top'</code>, <code>'Middle'</code>, <code>'Bottom'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Leading</td>
+<td class='scripting'>leading</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Tracking</td>
+<td class='scripting'>tracking</td>
+<td class='type'>number</td>
+</tr>
+<tbody></tbody>
+<tr><th colspan="4">Models</td></tr>
+<tr>
+<td class='formal'>Mesh</td>
+<td class='scripting'>sourcepath</td>
+<td class='type'>string</td>
+</tr>
+<tr>
+<td class='formal'>Tessellation Mode</td>
+<td class='scripting'>tessellation</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'None'</code>, <code>'Linear'</code>, <code>'Phong'</code>, <code>'NPatch'</code> [ignored as of 2.0]
+</td>
+</tr>
+<tr>
+<td class='formal'>Edge Tessellation</td>
+<td class='scripting'>edgetess</td>
+<td class='type'>number</td>
+<td class='note'>
+[ignored as of 2.0]
+</td>
+</tr>
+<tr>
+<td class='formal'>Inner Tessellation</td>
+<td class='scripting'>innertess</td>
+<td class='type'>number</td>
+<td class='note'>
+[ignored as of 2.0]
+</td>
+</tr>
+<tbody></tbody>
+<tr><th colspan="4">Standard Materials</td></tr>
+<tr>
+<td class='formal'>Lighting</td>
+<td class='scripting'>shaderlighting</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'Vertex'</code>, <code>'Pixel'</code>, <code>'None'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Blending Mode</td>
+<td class='scripting'>blendmode</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'Normal'</code>, <code>'Screen'</code>, <code>'Multiply'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Diffuse Color R</td>
+<td class='scripting'>diffuse.r</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Diffuse Color G</td>
+<td class='scripting'>diffuse.g</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Diffuse Color B</td>
+<td class='scripting'>diffuse.b</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Diffuse Map</td>
+<td class='scripting'>diffusemap</td>
+<td class='type'>image element</td>
+<td class='note'>
+to change the image set the <code>sourcepath</code> attribute on the image element
+</td>
+</tr>
+<tr>
+<td class='formal'>Diffuse Map 2</td>
+<td class='scripting'>diffusemap2</td>
+<td class='type'>image element</td>
+<td class='note'>
+to change the image set the <code>sourcepath</code> attribute on the image element
+</td>
+</tr>
+<tr>
+<td class='formal'>Diffuse Map 3</td>
+<td class='scripting'>diffusemap3</td>
+<td class='type'>image element</td>
+<td class='note'>
+to change the image set the <code>sourcepath</code> attribute on the image element
+</td>
+</tr>
+<tr>
+<td class='formal'>Specular Reflection</td>
+<td class='scripting'>specularreflection</td>
+<td class='type'>image element</td>
+<td class='note'>
+to change the image set the <code>sourcepath</code> attribute on the image element
+</td>
+</tr>
+<tr>
+<td class='formal'>Specular Tint R</td>
+<td class='scripting'>speculartint.r</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Specular Tint G</td>
+<td class='scripting'>speculartint.g</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Specular Tint B</td>
+<td class='scripting'>speculartint.b</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Specular Amount</td>
+<td class='scripting'>specularamount</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Specular Map</td>
+<td class='scripting'>specularmap</td>
+<td class='type'>image element</td>
+<td class='note'>
+to change the image set the <code>sourcepath</code> attribute on the image element
+</td>
+</tr>
+<tr>
+<td class='formal'>Specular Model</td>
+<td class='scripting'>specularmodel</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'Default'</code>, <code>'KGGX'</code>, <code>'KWard'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>Fresnel Power</td>
+<td class='scripting'>fresnelPower</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Index of Refraction</td>
+<td class='scripting'>ior</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Specular Roughness</td>
+<td class='scripting'>specularroughness</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Bump Map</td>
+<td class='scripting'>bumpmap</td>
+<td class='type'>image element</td>
+<td class='note'>
+to change the image set the <code>sourcepath</code> attribute on the image element
+</td>
+</tr>
+<tr>
+<td class='formal'>Normal Map</td>
+<td class='scripting'>normalmap</td>
+<td class='type'>image element</td>
+<td class='note'>
+to change the image set the <code>sourcepath</code> attribute on the image element
+</td>
+</tr>
+<tr>
+<td class='formal'>Bump Amount</td>
+<td class='scripting'>bumpamount</td>
+<td class='type'>number</td>
+<td class='note'>
+affects both bump and normal maps
+</td>
+</tr>
+<tr>
+<td class='formal'>Displacement Map</td>
+<td class='scripting'>displacementmap</td>
+<td class='type'>image element</td>
+<td class='note'>
+to change the image set the <code>sourcepath</code> attribute on the image element
+</td>
+</tr>
+<tr>
+<td class='formal'>Displacement Amount</td>
+<td class='scripting'>displaceamount</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Opacity</td>
+<td class='scripting'>opacity</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Opacity Map</td>
+<td class='scripting'>opacitymap</td>
+<td class='type'>image element</td>
+<td class='note'>
+to change the image set the <code>sourcepath</code> attribute on the image element
+</td>
+</tr>
+<tr>
+<td class='formal'>Emissive Power</td>
+<td class='scripting'>emissivepower</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Emissive Map</td>
+<td class='scripting'>emissivemap</td>
+<td class='type'>image element</td>
+<td class='note'>
+to change the image set the <code>sourcepath</code> attribute on the image element
+</td>
+</tr>
+<tbody></tbody>
+<tr><th colspan="4">Material References</td></tr>
+<tr>
+<td class='formal'>Referenced Material</td>
+<td class='scripting'>referencedmaterial</td>
+<td class='type'>string</td>
+<td class='note'>
+relative or absolute element path
+</td>
+</tr>
+<tbody></tbody>
+<tr><th colspan="4">Images</td></tr>
+<tr>
+<td class='formal'>U Repeat</td>
+<td class='scripting'>scaleu</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>V Repeat</td>
+<td class='scripting'>scalev</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Texture Mapping</td>
+<td class='scripting'>mappingmode</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'UV Mapping'</code>, <code>'Environmental Mapping'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>U Tiling</td>
+<td class='scripting'>tilingmodehorz</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'Tiled'</code>, <code>'Mirrored'</code>, <code>'No Tiling'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>V Tiling</td>
+<td class='scripting'>tilingmodevert</td>
+<td class='type'>string</td>
+<td class='note'>
+values: <code>'Tiled'</code>, <code>'Mirrored'</code>, <code>'No Tiling'</code>
+</td>
+</tr>
+<tr>
+<td class='formal'>UV Rotation</td>
+<td class='scripting'>rotationuv</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>U Position</td>
+<td class='scripting'>positionu</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>V Position</td>
+<td class='scripting'>positionv</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>U Pivot</td>
+<td class='scripting'>pivotu</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>V Pivot</td>
+<td class='scripting'>pivotv</td>
+<td class='type'>number</td>
+</tr>
+<tr>
+<td class='formal'>Sub-Presentation</td>
+<td class='scripting'>subpresentation</td>
+<td class='type'>string</td>
+<td class='note'>
+id of the sub-presentation to display
+</td>
+</tr>
+<tr>
+<td class='formal'>Source Path</td>
+<td class='scripting'>sourcepath</td>
+<td class='type'>string</td>
+<td class='note'>
+path to the image
+</td>
+</tr>
+</table>
+\endraw
diff --git a/src/api/studio3d/doc/src/attributenames.qdoc b/src/api/studio3d/doc/src/attributenames.qdoc
new file mode 100644
index 0000000..e499f17
--- /dev/null
+++ b/src/api/studio3d/doc/src/attributenames.qdoc
@@ -0,0 +1,71 @@
+!/****************************************************************************
+**
+** Copyright (C) 1993-2009 NVIDIA Corporation.
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Pull in attributenames.html into qdoc. Note that attributenames.html is
+// manually maintained since 2.0 and is not auto-generated.
+
+/*!
+ \page qt3dstudio-opengl-runtime-attribute-names.html
+ \title Attribute Names
+ \keyword Attributes
+
+ Below is a list of the attributes that can be set on the various scene
+ objects via Q3DSPresentation::setAttribute() or Q3DSElement::setAttribute().
+
+ \note vector (e.g. a group's or model's \c rotation) and color (e.g. a
+ material's \c diffuse) attributes allow setting/getting all components in
+ one operation, and are mapped to QVector3D and QColor, respectively.
+
+ \note As of Qt 3D Studio 2.1 not all properties can be changed on the fly at
+ run time. As a general rule attributes that are animatable in the Qt 3D
+ Studio application are freely changeable by the applications during run time
+ as well.
+
+ \note When possible, applications are recommended to rely on the \c{data
+ input} functionality of Qt 3D Studio instead. This avoids the need to refer
+ to hard-coded attribute names, and instead allows the designers to expose
+ the interesting attributes with arbitrary data input names to the
+ application developers, thus offering a fixed, well-known interface from the
+ 3D presentation to the application code. See \l Q3DSDataInput, \l DataInput,
+ \l Q3DSDataOutput, and \l DataOutput for more information.
+
+ \include attributenames.html
+
+ Custom materials and effects have their custom set of properties that are
+ defined in the \c{.material} or \c{.effect} file. For example, an instances
+ of an effect with the following metadata will have an attribute \c HBlurBias
+ with the type \c number that can be set and queried as if it was a built-in
+ attribute.
+
+ \badcode
+ <Effect>
+ <MetaData>
+ <Property name="HBlurBias" formalName="Horizontal Blur" min="0" max="10" default="2" description="Amount of corona horizontally."/>
+ ...
+ \endcode
+*/
diff --git a/src/api/studio3d/doc/src/building-embedded.qdoc b/src/api/studio3d/doc/src/building-embedded.qdoc
new file mode 100644
index 0000000..ddd8b59
--- /dev/null
+++ b/src/api/studio3d/doc/src/building-embedded.qdoc
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+
+\title Building \RUNTIME for Embedded Linux
+\page building-opengl-runtime-embedded-linux.html
+
+Before you build the \RUNTIME for Embedded Linux, you will need to install Qt for Embedded Linux.
+
+\section1 Install Qt for Embedded Linux
+Follow the Installation guide for your specific target device.
+
+\section1 Build the \RUNTIME
+
+\list 1
+ \li
+ Clone the \RUNTIME repository from
+ \l {https://code.qt.io/cgit/qt3dstudio/ogl-runtime.git}.
+ You can clone the repo with the \c {git clone} command:
+ \badcode
+ git clone git://code.qt.io/qt3dstudio/ogl-runtime.git
+ \endcode
+
+ \note If you want to use the HTTPS protocol, you can clone the \RUNTIME repo with the
+ following command:
+ \badcode
+ git clone https://code.qt.io/qt3dstudio/ogl-runtime.git
+ \endcode
+ \li
+ Run the following \c{git submodule} command:
+ \badcode
+ git submodule update --init --recursive
+ \endcode
+ \li
+ Open \c{ogl-runtime.pro} in Qt Creator. \c{ogl-runtime.pro} is located in the root of the
+ cloned repository.
+
+ \image ogl-runtime-pro.png
+ \li
+ Select the desired prebuilt Embedded Linux component and select \uicontrol{Configure Project}.
+
+ \image embedded-linux.png
+ \li
+ Add a build step with argument \c{install}.
+
+ \image embedded-linux-2.png
+ \li
+ From the menu, select \uicontrol{Build > Build Project "opengl-runtime"}.
+\endlist
+
+\section1 Deploy the \RUNTIME
+
+Follow the
+\l{https://doc.qt.io/QtForDeviceCreation/b2qt-installation-guides.html}{Installation guide}
+for your specific target device.
+
+*/
diff --git a/src/api/studio3d/doc/src/building-integrity.qdoc b/src/api/studio3d/doc/src/building-integrity.qdoc
new file mode 100644
index 0000000..fb09a10
--- /dev/null
+++ b/src/api/studio3d/doc/src/building-integrity.qdoc
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+
+\title Building \RUNTIME for GHS Integrity
+\page building-opengl-runtime-integrity.html
+
+Before you build the \RUNTIME for Integrity, you will need to build
+\l{https://doc.qt.io/qt-5/integrity.html}{Qt for Integrity}.
+Then, follow the steps below:
+
+\list 1
+ \li
+ Clone the OpenGL Runtime repository from
+ \l {https://code.qt.io/cgit/qt3dstudio/ogl-runtime.git/}. You can clone the repo with the git
+ clone command:
+
+ \badcode
+ git clone git://code.qt.io/qt3dstudio/ogl-runtime.git
+ \endcode
+
+ \note If you want to use the HTTPS protocol, you can clone the \RUNTIME repo with the
+ following command:
+ \badcode
+ git clone https://code.qt.io/qt3dstudio/ogl-runtime.git
+ \endcode
+ \li
+ Run the following \c{git submodule} command:
+ \badcode
+ git submodule update --init --recursive
+ \endcode
+ \li
+ In the root folder of the cloned repo, run the \c qmake command:
+ \badcode
+ qmake
+ \endcode
+ \li
+ Next, run the \c make command:
+ \badcode
+ make
+ \endcode
+\endlist
+
+For deployment, see the \l {https://doc.qt.io/qt-5/integrity.html}{Qt for Integrity} documentation.
+
+*/
diff --git a/src/api/studio3d/doc/src/building-opengl-runtime.qdoc b/src/api/studio3d/doc/src/building-opengl-runtime.qdoc
new file mode 100644
index 0000000..b9d95b5
--- /dev/null
+++ b/src/api/studio3d/doc/src/building-opengl-runtime.qdoc
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+
+\title Building the \RUNTIME
+\page building-opengl-runtime.html
+
+\section1 Build Instructions
+
+\list
+ \li
+ \l {Building \RUNTIME for Embedded Linux}
+ \li
+ \l {Building \RUNTIME for GHS Integrity}
+ \li
+ \l {Building \RUNTIME for QNX}
+\endlist
+
+*/
diff --git a/src/api/studio3d/doc/src/building-qnx.qdoc b/src/api/studio3d/doc/src/building-qnx.qdoc
new file mode 100644
index 0000000..fba04ce
--- /dev/null
+++ b/src/api/studio3d/doc/src/building-qnx.qdoc
@@ -0,0 +1,162 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+
+\title Building \RUNTIME for QNX
+\page building-opengl-runtime-qnx.html
+
+Before you build the \RUNTIME for QNX, you will need to install Qt for QNX and Qt 3D Studio.
+
+\section1 Install Qt for QNX
+
+\list 1
+ \li
+ Download and install QNX SDP 7.0 from the \l {http://www.qnx.com}{QNX software center}.
+ \li
+ Run the Qt online installer. You can get it from \l {https://www.qt.io/download}.
+ \li
+ Select the desired prebuilt QNX component, select \uicontrol Next.
+
+ \image qt-installer-qnx-prebuild.png
+ \li
+ Select the folder where your QNX SDP is installed.
+
+ \image qnx-sdp-folder.png
+ \li
+ Press \uicontrol Next, then press \uicontrol Install. The Qt Creator will now run.
+\endlist
+
+\section1 Build Qt 3D Studio
+
+\list 1
+ \li
+ Clone the Qt 3D Studio repository from \l {https://code.qt.io/qt3dstudio/qt3dstudio.git}.
+ You can clone the repo with the \c {git clone} command:
+
+ \badcode
+ git clone git://code.qt.io/qt3dstudio/qt3dstudio.git
+ \endcode
+
+ \note If you want to use the HTTPS protocol, you can clone the Qt 3D Studio with the following
+ command:
+
+ \badcode
+ git clone https://code.qt.io/qt3dstudio/qt3dstudio.
+ \endcode
+ \li
+ Run the following \c{git submodule} command:
+ \badcode
+ git submodule update --init --recursive
+ \endcode
+ \li
+ Open \c {qt3dstudio.pro} in the Qt Creator. \c {qt3dstudio.pro} is located in the root of the
+ cloned repository.
+
+ \image qt3dstudio-pro.png
+ \li
+ Select desired prebuilt QNX Component.
+
+ \image select-prebuilt-qnx-component.png
+ \li
+ Press \uicontrol{Configure Project}.
+ \li
+ Select the \uicontrol Project tab and \uicontrol{Build Settings}.
+ \li
+ Add a build step with the argument \c install.
+
+ \image add-build-step.png
+ \li
+ From the menu, select \uicontrol{Build > Build Project "qt3dstudio"}.
+\endlist
+
+\section1 Build the \RUNTIME
+
+\list 1
+ \li
+ Clone the \RUNTIME repository from
+ \l{https://code.qt.io/cgit/qt3dstudio/ogl-runtime.git}.
+ You can clone the repo with the \c {git clone} command:
+ \badcode
+ git clone git://code.qt.io/qt3dstudio/ogl-runtime.git
+ \endcode
+
+ \note If you want to use the HTTPS protocol, you can clone the \RUNTIME repo with
+ the following command:
+
+ \badcode
+ git clone https://code.qt.io/qt3dstudio/ogl-runtime.git
+ \endcode
+ \li
+ Run the following \ {git submodule} command:
+
+ \badcode
+ git submodule update --init --recursive
+ \endcode
+ \li
+ Open \c {ogl-runtime.pro} in Qt Creator. \c {ogl-runtime.pro} is located in the root of the
+ cloned repository.
+
+ \image ogl-runtime-pro.png
+ \li
+ Select the desired prebuilt QNX component and select \uicontrol{Configure Project}.
+
+ \image qnx-prebuild.png
+ \li
+ Add a build step with argument \c install.
+
+ \image add-build-step-qnx.png
+ \li
+ From the menu, select \uicontrol{Build > Build Project "opengl-runtime"}.
+ \li
+ The \RUNTIME is installed to the same folder where you have installed the QNX prebuilt
+ components. For example \c{~/Qt5.12/5.12.3/qnx7_x86_64/}.
+\endlist
+
+\section1 Deploy the \RUNTIME
+
+To deploy to the target device, follow the steps below:
+
+\list 1
+ \li
+ In Qt Creator, select \uicontrol{Tools > Options} from the menu.
+ \li
+ Select the \uicontrol Devices tab.
+
+ \image devices-tab.png
+ \li
+ Select \uicontrol Add.
+ \li
+ Select QNX Device, then press \uicontrol {Start Wizard}.
+
+ \image add-qnx-device.png
+ \li
+ Select \uicontrol {Deploy Qt Libraries}. This will also deploy Qt and Qt 3D Studio binaries
+ and libraries.
+\endlist
+
+*/
diff --git a/src/api/studio3d/doc/src/copyright.qdoc b/src/api/studio3d/doc/src/copyright.qdoc
new file mode 100644
index 0000000..bd431cd
--- /dev/null
+++ b/src/api/studio3d/doc/src/copyright.qdoc
@@ -0,0 +1,38 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page copyright-notices.html
+\title Copyright Notices
+\section1 Third-party Licenses
+
+The following table lists parts (modules) of \RUNTIME that
+incorporate code licensed under third-party open-source licenses:
+
+\annotatedlist attributions-qtstudio3d
+
+*/
diff --git a/src/api/studio3d/doc/src/embedded.qdoc b/src/api/studio3d/doc/src/embedded.qdoc
new file mode 100644
index 0000000..b468070
--- /dev/null
+++ b/src/api/studio3d/doc/src/embedded.qdoc
@@ -0,0 +1,32 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qt3dstudio-opengl-runtime-embedded.html
+ \title Using the Runtime on Embedded Devices
+
+*/
diff --git a/src/api/studio3d/doc/src/examples.qdoc b/src/api/studio3d/doc/src/examples.qdoc
new file mode 100644
index 0000000..f7a78b4
--- /dev/null
+++ b/src/api/studio3d/doc/src/examples.qdoc
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Examples
+ \ingroup examples
+ \page qt3dstudio-opengl-runtime-examples.html
+
+ Included in the \RUNTIME you will find a set of examples. These are
+ located in the \c {examples} folder in the installation folder.
+
+ \section1 More Examples
+
+ You can find more examples from
+ \l{https://git.qt.io/public-demos/qt3dstudio}, these examples are more
+ visually appealing and suitable to use as demos for example.
+*/
diff --git a/src/api/studio3d/doc/src/gettingstarted.qdoc b/src/api/studio3d/doc/src/gettingstarted.qdoc
new file mode 100644
index 0000000..9289b54
--- /dev/null
+++ b/src/api/studio3d/doc/src/gettingstarted.qdoc
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qt3dstudio-opengl-runtime-gettingstarted.html
+ \title Getting Started
+
+ The \RUNTIME provides C++ and QML APIs for integrating Qt 3D
+ Studio scenes into Qt applications, as well as the viewer application that
+ is used in combination with the Qt 3D Studio application during the design
+ phase.
+
+ Below is an example scene in the Qt 3D Studio application.
+
+ \image intro-editor.png
+
+ During the design phase, the standalone viewer is typically launched from
+ the editor several times to check and verify the presentation in the
+ runtime.
+
+ \image intro-viewer.png
+
+ Once the design is done and the \c{.uia}, \c{.uip}, and other asset files
+ are available, these can be loaded, rendered, and manipulated in Qt
+ applications. This is done via the APIs provided in the \c studio3d
+ module and the \c QtStudio3D.OpenGL QML plugin.
+
+ Below is the same scene loaded into a simple Qt Quick application
+ (the \l{Qt 3D Studio Runtime: Simple QML Example}{simpleqml
+ example}) that composes the 3D content with the other Qt Quick
+ items, for example the ones provided by \l{Qt Quick Controls
+ 2}. In addition to displaying the presentation, the application
+ can also control many aspects of it (slides, timeline, object
+ properties) and can react on certain conditions, such as when a 3D
+ object is clicked on (picked) by mouse or touch input.
+
+ \image intro-app.png
+
+ \section1 Rendering Scenes
+
+ APIs are provided for the following Qt UI technologies:
+
+ \list
+
+ \li Qt Quick: here applications import QtStudio3D.OpenGL \QtVer which
+ provides the \l [QML] Studio3D QML type, a Qt Quick item that can be
+ added to Qt Quick scenes. Under the hood this is similar to adding a
+ \l [QML] Scene3D (when working directly with the lower level Qt 3D
+ framework) or a custom item based on \l QQuickFramebufferObject into
+ the scene.
+
+ \li QWindow or offscreen render targets (OpenGL texture): Q3DSSurfaceViewer
+ can be used both to render to an on-screen QWindow, as well as off-screen
+ into an OpenGL texture. The latter allows reading back and saving the
+ frames, to generate pre-rendered video sequences for example.
+
+ \endlist
+
+ \section1 Manipulating Scenes
+
+ Rendering Qt 3D Studio scenes is only part of the story since many scenes
+ are not static and will not just display all their contents as they were
+ done by designers in the Qt 3D Studio application. Rather, properties of
+ scene objects (for example, the rotation property of a 3D model, or the
+ diffuse color of the material associated with such a model) may need to be
+ changed dynamically, at run time. The timeline or the current slide may
+ also need to be adjusted based on the user's actions or other application
+ state.
+
+ Above functionality is exposed via the following types:
+
+ \table
+ \header
+ \li C++ Class
+ \li QML Type
+ \row
+ \li Q3DSPresentation
+ \li \l [QML] Presentation
+ \row
+ \li Q3DSElement
+ \li \l Element
+ \row
+ \li Q3DSSceneElement
+ \li \l [QML] SceneElement
+ \row
+ \li Q3DSDataInput
+ \li \l [QML] DataInput
+
+ \endtable
+
+ Advanced scene manipulation (for example, dynamically spawning and
+ removing objects in a 3D scene) will be introduced in future versions.
+*/
diff --git a/src/api/studio3d/doc/src/images/add-build-step-qnx.png b/src/api/studio3d/doc/src/images/add-build-step-qnx.png
new file mode 100644
index 0000000..8406b39
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/add-build-step-qnx.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/images/add-build-step.png b/src/api/studio3d/doc/src/images/add-build-step.png
new file mode 100644
index 0000000..d047bb7
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/add-build-step.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/images/add-qnx-device.png b/src/api/studio3d/doc/src/images/add-qnx-device.png
new file mode 100644
index 0000000..c1f5aca
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/add-qnx-device.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/images/customsignal.png b/src/api/studio3d/doc/src/images/customsignal.png
new file mode 100644
index 0000000..eb0e0ba
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/customsignal.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/images/devices-tab.png b/src/api/studio3d/doc/src/images/devices-tab.png
new file mode 100644
index 0000000..10f2884
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/devices-tab.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/images/embedded-linux-2.png b/src/api/studio3d/doc/src/images/embedded-linux-2.png
new file mode 100644
index 0000000..d46da08
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/embedded-linux-2.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/images/embedded-linux.png b/src/api/studio3d/doc/src/images/embedded-linux.png
new file mode 100644
index 0000000..b8e0efb
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/embedded-linux.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/images/intro-app.png b/src/api/studio3d/doc/src/images/intro-app.png
new file mode 100644
index 0000000..3658190
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/intro-app.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/images/intro-editor.png b/src/api/studio3d/doc/src/images/intro-editor.png
new file mode 100644
index 0000000..52e5a69
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/intro-editor.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/images/intro-viewer.png b/src/api/studio3d/doc/src/images/intro-viewer.png
new file mode 100644
index 0000000..f964b58
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/intro-viewer.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/images/ogl-runtime-pro.png b/src/api/studio3d/doc/src/images/ogl-runtime-pro.png
new file mode 100644
index 0000000..d49dbdf
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/ogl-runtime-pro.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/images/qnx-prebuild.png b/src/api/studio3d/doc/src/images/qnx-prebuild.png
new file mode 100644
index 0000000..09ce65d
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/qnx-prebuild.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/images/qnx-sdp-folder.png b/src/api/studio3d/doc/src/images/qnx-sdp-folder.png
new file mode 100644
index 0000000..269374a
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/qnx-sdp-folder.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/images/qt-installer-qnx-prebuild.png b/src/api/studio3d/doc/src/images/qt-installer-qnx-prebuild.png
new file mode 100644
index 0000000..8dc7389
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/qt-installer-qnx-prebuild.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/images/qt3dstudio-pro.png b/src/api/studio3d/doc/src/images/qt3dstudio-pro.png
new file mode 100644
index 0000000..8d8a5d5
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/qt3dstudio-pro.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/images/select-prebuilt-qnx-component.png b/src/api/studio3d/doc/src/images/select-prebuilt-qnx-component.png
new file mode 100644
index 0000000..4ef68fe
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/select-prebuilt-qnx-component.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/images/twolayers.png b/src/api/studio3d/doc/src/images/twolayers.png
new file mode 100644
index 0000000..2f4b66f
--- /dev/null
+++ b/src/api/studio3d/doc/src/images/twolayers.png
Binary files differ
diff --git a/src/api/studio3d/doc/src/index.qdoc b/src/api/studio3d/doc/src/index.qdoc
new file mode 100644
index 0000000..1888a87
--- /dev/null
+++ b/src/api/studio3d/doc/src/index.qdoc
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\title \RUNTIME
+\page qt3dstudio-opengl-runtime-index.html
+
+\section1 Table of Contents
+
+\list
+ \li \l {Getting Started}
+ \li \l {System and Application Requirements}
+ \li \l {Building the \RUNTIME}
+ \li \l {\RUNTIME C++ Classes}
+ \li \l {\RUNTIME QML Types}
+ \li \l {Attribute Names}{Scene Object Attribute List}
+ \li \l {Examples}
+ \li \l {Copyright Notices}
+\endlist
+
+*/
diff --git a/src/api/studio3d/doc/src/mobile.qdoc b/src/api/studio3d/doc/src/mobile.qdoc
new file mode 100644
index 0000000..2ede51a
--- /dev/null
+++ b/src/api/studio3d/doc/src/mobile.qdoc
@@ -0,0 +1,32 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qt3dstudio-opengl-runtime-mobile.html
+ \title Using the OpenGL Runtime on Android/iOS Devices
+
+*/
diff --git a/src/api/studio3d/doc/src/module.qdoc b/src/api/studio3d/doc/src/module.qdoc
new file mode 100644
index 0000000..98b134e
--- /dev/null
+++ b/src/api/studio3d/doc/src/module.qdoc
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \module OpenGLRuntime
+ \title \RUNTIME C++ Classes
+ \ingroup modules
+
+ \brief The \RUNTIME provides a number of C++ classes to
+ integrate and control Qt 3D Studio presentations in Qt applications.
+
+ To include the definitions of the module's classes, use the following directive:
+
+ \code
+ #include <QtStudio3D>
+ \endcode
+
+ To link against the module, add this line to your \l qmake \c .pro file:
+
+ \badcode
+ QT += studio3d
+ \endcode
+
+ \section1 Integrating
+
+ The main class is \l Q3DSSurfaceViewer. Q3DSSurfaceViewer allows targeting a QWindow or an
+ offscreen render target (an OpenGL texture).
+
+ \note Qt applications based on QML and Qt Quick will rather want to use the
+ \l Studio3D type from \l {\RUNTIME QML Types}.
+
+ \section1 Controlling
+
+ Each \l Q3DSSurfaceViewer instance exposes a \l
+ Q3DSPresentation. This, possibly in combination with \l Q3DSDataInput or
+ \l Q3DSElement objects, allows:
+
+ \list
+
+ \li changing scene object properties (for example, the transform of a
+ model, colors and other settings of a material, etc.),
+
+ \li changing slides (thus starting the relevant animations and applying the
+ scene object property changes associated with the new slide),
+
+ \li and controlling the timeline (the current playback position for the
+ key-frame based animations) both on the main scene and on individual
+ Component nodes.
+
+ \endlist
+
+ \section1 Classes
+*/
+
+/*!
+ \qmlmodule QtStudio3D.OpenGL \QtVer
+ \title \RUNTIME QML Types
+ \ingroup qmlmodules
+
+ \brief QML Types for the \RUNTIME module.
+
+ The \RUNTIME provides a number of QML types to integrate and
+ control Qt 3D Studio presentations in Qt Quick applications. These types
+ can be imported into your application using the following import statement
+ in your \c{.qml} file:
+
+ \qml \QtVer
+ import QtStudio3D.OpenGL \1
+ \endqml
+
+ The main type for embedding a Qt 3D Studio presentations into a Qt Quick
+ scene is \l Studio3D. Many of the other types correspond to a C++ class in
+ the API offered to non-QML based applications, providing the same level of
+ control described in \l{\RUNTIME C++ Classes}{the C++ reference}.
+
+ There are also QML types that offer functionality not available via the C++
+ classes. The \l SubPresentationSettings type allows defining \c{QML
+ sub-presentations} (live Qt Quick scenes composed into the 3D scene either
+ as Qt 3D Studio layers or as texture maps) in-line, inside a Studio3D
+ element, without having to deploy them as separate \c .qml files.
+
+ \note the \l Behavior type is to be used by \c{behavior scripts} (\c .qml
+ snippets associated with scene objects during the design phase in Qt 3D
+ Studio) and is not available in the main application code.
+
+ \section1 QML Types
+*/
diff --git a/src/api/studio3d/doc/src/requirements.qdoc b/src/api/studio3d/doc/src/requirements.qdoc
new file mode 100644
index 0000000..f93483c
--- /dev/null
+++ b/src/api/studio3d/doc/src/requirements.qdoc
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qt3dstudio-opengl-runtime-requirements.html
+ \title System and Application Requirements
+
+ \section1 OpenGL Requirements
+
+ Qt 3D Studio requires OpenGL or OpenGL ES. The recommended minimum versions
+ are \c{3.3 core profile} and \c{3.0}, respectively.
+
+ When it comes to OpenGL ES, a limited subset of the functionality is
+ available when running on plain \c{OpenGL ES 2.0} implementations. In
+ practice this means losing shadow mapping, image based lighting, and many
+ other advanced features and is therefore not recommended. On the other hand,
+ this allows bringing up Qt 3D Studio scenes on boards like the Raspberry Pi
+ (with the original proprietary graphics stack) or the Beaglebone Black, or
+ in hypervisor-based virtualized environments where the GPU virtualization
+ only supports GLES 2.0, and can therefore still be valuable in certain
+ special situations.
+
+ Non-native implementations, like \c ANGLE or software implementations like
+ \c{Mesa's llvmpipe} may work but are not tested and can fail in unexpected
+ ways.
+
+ \section1 Application Integration Notes
+
+ \section2 C++
+
+ A typical Qt C++ application using the \RUNTIME is expected to
+ query and honor the runtime's \c{ideal surface format}. This way the OpenGL
+ contexts will all be created with the OpenGL version and profile that best
+ match the runtime's needs:
+
+ \code
+ #include <Q3DSSurfaceViewer> // or <q3dsruntimeglobal.h> if only Q3DS::surfaceFormat() is interesting for main()
+
+ int main(int argc, char *argv[])
+ {
+ QApplication app(argc, argv);
+
+ QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat());
+
+ Q3DSSurfaceViewer w;
+ ...
+ return app.exec();
+ }
+ \endcode
+
+ To enable using Qt 3D Studio headers and libraries in the application, add
+ the \c studio3d module in the application's \c{.pro} file:
+
+ \badcode
+ QT += studio3d
+ \endcode
+
+ \section2 QML/Qt Quick
+
+ When no C++ classes are used, the \c studio3d module can be omitted
+ in the \c{.pro}. To use the \l Studio3D element in QML code, it is
+ enough to add the corresponding import statement:
+
+ \qml
+ import QtStudio3D.OpenGL \QtVer
+ \endqml
+
+ It is nonetheless strongly recommended to set the the default surface format
+ as shown above. Make sure the
+ \c{QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat())} call is made
+ after constructing QGuiApplication but before the first QQuickWindow or
+ QQuickView. When this is not possible, for example because the QML contents
+ is hosted in an application that has no knowledge of the Qt Quick scene's 3D
+ needs, Studio3D may still be usable but this may be dependent on the OpenGL
+ implementation and the context versions it offers, and is therefore more fragile.
+*/
diff --git a/src/api/studio3d/doc/src/toc.qdoc b/src/api/studio3d/doc/src/toc.qdoc
new file mode 100644
index 0000000..979f084
--- /dev/null
+++ b/src/api/studio3d/doc/src/toc.qdoc
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\contentspage \RUNTIME
+\page qt3dstudio-opengl-runtime-toc.html
+\title \RUNTIME TOC
+
+\omit
+This file is used for generating a TOC in a .qch file.
+\endomit
+
+\list
+ \li \l {\RUNTIME}{Overview}
+\endlist
+*/
diff --git a/src/api/studio3d/doc/style/qt5-sidebar.html b/src/api/studio3d/doc/style/qt5-sidebar.html
new file mode 100644
index 0000000..435d52a
--- /dev/null
+++ b/src/api/studio3d/doc/style/qt5-sidebar.html
@@ -0,0 +1,26 @@
+<div class="sectionlist normallist">
+ <div>
+ <a name="reference"></a>
+ <h2 id="reference">Qt 3D OpenGL Studio Runtime</h2>
+ </div>
+ <div class="indexboxcont indexboxbar">
+ <ul>
+ <li><a href="qt3dstudio-opengl-runtime-index.html">Home</a></li>
+ <li><a href="qt3dstudio-opengl-runtime-gettingstarted.html">Getting Started</a></li>
+ <li><a href="qtstudio3d-opengl-qmlmodule.html">QML API Reference</a></li>
+ <li><a href="openglruntime-module.html">C++ API Reference</a></li>
+ <li><a href="copyright-notices.html">Copyright Notices</a></li>
+ </ul>
+ </div>
+</div>
+<div class="sectionlist normallist">
+ <div>
+ <a name="reference"></a>
+ <h2 id="reference">Qt 3D Studio</h2>
+ </div>
+ <div class="indexboxcont indexboxbar">
+ <ul>
+ <li><a href="../index.html">Home</a></li>
+ </ul>
+ </div>
+</div>
diff --git a/src/api/studio3d/q3dscommandqueue.cpp b/src/api/studio3d/q3dscommandqueue.cpp
index c6071aa..e9eed29 100644
--- a/src/api/studio3d/q3dscommandqueue.cpp
+++ b/src/api/studio3d/q3dscommandqueue.cpp
@@ -61,6 +61,7 @@ CommandQueue::CommandQueue()
, m_showRenderStats(false)
, m_matteColor(Qt::black)
, m_delayedLoading(false)
+ , m_matteEnabled(false)
, m_size(0)
{
qRegisterMetaType<CommandType>();
@@ -207,6 +208,7 @@ void CommandQueue::copyCommands(CommandQueue &fromQueue)
m_globalAnimationTimeChanged
= m_globalAnimationTimeChanged || fromQueue.m_globalAnimationTimeChanged;
m_delayedLoadingChanged = m_delayedLoadingChanged || fromQueue.m_delayedLoadingChanged;
+ m_matteEnabledChanged = m_matteEnabledChanged || fromQueue.m_matteEnabledChanged;
if (fromQueue.m_visibleChanged)
m_visible = fromQueue.m_visible;
@@ -226,6 +228,8 @@ void CommandQueue::copyCommands(CommandQueue &fromQueue)
m_globalAnimationTime = fromQueue.m_globalAnimationTime;
if (fromQueue.m_delayedLoadingChanged)
m_delayedLoading = fromQueue.m_delayedLoading;
+ if (fromQueue.m_matteEnabledChanged)
+ m_matteEnabled = fromQueue.m_matteEnabled;
// Pending queue may be synchronized multiple times between queue processing, so let's append
// to the existing queue rather than clearing it.
@@ -304,6 +308,7 @@ void CommandQueue::clear(bool deleteCommandData)
m_variantListChanged = false;
m_globalAnimationTimeChanged = false;
m_delayedLoadingChanged = false;
+ m_matteEnabledChanged = false;
if (deleteCommandData) {
for (int i = 0; i < m_size; ++i) {
diff --git a/src/api/studio3d/q3dscommandqueue_p.h b/src/api/studio3d/q3dscommandqueue_p.h
index 12d1b7e..effb72e 100644
--- a/src/api/studio3d/q3dscommandqueue_p.h
+++ b/src/api/studio3d/q3dscommandqueue_p.h
@@ -142,6 +142,7 @@ public:
bool m_variantListChanged;
bool m_globalAnimationTimeChanged;
bool m_delayedLoadingChanged;
+ bool m_matteEnabledChanged;
bool m_visible;
Q3DSViewerSettings::ScaleMode m_scaleMode;
@@ -152,6 +153,7 @@ public:
QStringList m_variantList;
qint64 m_globalAnimationTime;
bool m_delayedLoading;
+ bool m_matteEnabled;
void clear(bool deleteCommandData);
int size() const { return m_size; }
diff --git a/src/api/studio3d/q3dsdatainput.cpp b/src/api/studio3d/q3dsdatainput.cpp
index a15f9fb..2a52963 100644
--- a/src/api/studio3d/q3dsdatainput.cpp
+++ b/src/api/studio3d/q3dsdatainput.cpp
@@ -38,9 +38,10 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype DataInput
\instantiates Q3DSDataInput
- \inqmlmodule Qt3DStudio
+ \inqmlmodule QtStudio3D.OpenGL
\ingroup OpenGLRuntime
\brief Controls a data input entry in a Qt 3D Studio presentation.
+
This class is a convenience class for controlling a data input in a presentation.
DataInput provides a clean contract between the presentation design and the code.
It hides the presentation details from the code while providing a contractual access
@@ -49,11 +50,40 @@ QT_BEGIN_NAMESPACE
multiple aspects of the design (e.g. DataInput for speed can change the color of
the speedometer, angle of the needle).
+ As an example:
+
+ \qml
+ Studio3D {
+ ...
+ Presentation {
+ id: presentation
+ ...
+ property string text: ""
+ DataInput {
+ name: "inputForSomeTextNode"
+ value: presentation.text
+ }
+ }
+ }
+
+ Button {
+ onClicked: presentation.text = "Hello World"
+ }
+ \endqml
+
+ The example assumes that a data input connection was made in Qt 3D Studio
+ presentation using Qt 3D Studio editor between the \c textstring property of
+ target property and a data input name \c inputForSomeTextNode. As the value
+ is now set via a property, the full set of QML property bindings techniques
+ are available.
+
\note There is a performance cost for each registered DataInput, so try to avoid
creating unnecessary DataInputs.
- \sa Presentation, DataOutput, Presentation::slideExited, Presentation::slideEntered
- \sa Presentation::customSignalEmitted
+ \sa Presentation, DataOutput
+ \sa {QtStudio3D.OpenGL::Presentation::slideExited()}{Presentation.slideExited()}
+ \sa {QtStudio3D.OpenGL::Presentation::slideEntered()}{Presentation.slideEntered()}
+ \sa {QtStudio3D.OpenGL::Presentation::customSignalEmitted()}{Presentation.customSignalEmitted()}
*/
/*!
@@ -82,6 +112,10 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \dontdocument QMetaTypeId
+*/
+
+/*!
\internal
*/
Q3DSDataInput::Q3DSDataInput(QObject *parent)
@@ -101,6 +135,8 @@ Q3DSDataInput::Q3DSDataInput(const QString &name, QObject *parent)
}
/*!
+ \fn Q3DSDataInput::Q3DSDataInput(Q3DSPresentation *presentation, const QString &name, QObject *parent)
+
Constructs a Q3DSDataInput instance and initializes the \a name. The
constructed instance is automatically associated with the specified \a
presentation. An optional \a parent object can be specified.
@@ -257,6 +293,8 @@ bool Q3DSDataInput::isValid() const
}
/*!
+ \qmlmethod string DataInput::metadata(string key)
+
Returns the metadata defined for this datainput with metadata \a key.
Metadata is user-defined key-value table that can be used, for example, to better describe the
@@ -265,8 +303,8 @@ bool Q3DSDataInput::isValid() const
\note Datainput metadata is read-only.
*/
+
/*!
- \qmlmethod string DataInput::metadata
Returns the metadata defined for this datainput with metadata \a key.
Metadata is user-defined key-value table that can be used, for example, to better describe the
@@ -290,13 +328,6 @@ QString Q3DSDataInput::metadata(const QString &key) const
\sa metadata
*/
-/*!
- \qmlmethod var DataInput::metadataKeys
- Returns the metadata keys defined for this datainput.
-
- \note Datainput metadata is read-only.
- \sa metadata
- */
QStringList Q3DSDataInput::metadataKeys() const
{
if (!d_ptr->m_presentation)
@@ -360,50 +391,6 @@ void Q3DSDataInputPrivate::setCommandQueue(CommandQueue *queue)
setValue(m_value);
}
-
-/*!
- \qmltype DataInput
- \instantiates Q3DSDataInput
- \inqmlmodule QtStudio3D
- \ingroup OpenGLRuntime
-
- \brief Controls a data input entry in a Qt 3D Studio presentation.
-
- This type is a convenience for controlling a data in a presentation. Its functionality is
- equivalent to \c{Presentation::setDataInputValue()}, however it has a big advantage
- of being able to use QML property bindings, thus avoiding the need to having to resort
- to a JavaScript function call for every value change.
-
- As an example:
-
- \qml
- Studio3D {
- ...
- Presentation {
- id: presentation
- ...
- property string text: ""
- DataInput {
- name: "inputForSomeTextNode"
- value: presentation.text
- }
- }
- }
-
- Button {
- onClicked: presentation.text = "Hello World"
- }
- \endqml
-
- The example assumes that a data input connection was made in Qt 3D Studio
- presentation using Qt 3D Studio editor between the \c textstring property of
- target property and a data input name \c inputForSomeTextNode. As the value
- is now set via a property, the full set of QML property bindings techniques
- are available.
-
- \sa Studio3D, Presentation
-*/
-
/*!
\qmlproperty string DataInput::name
@@ -448,4 +435,12 @@ void Q3DSDataInputPrivate::setCommandQueue(CommandQueue *queue)
\note This value is read-only.
*/
+/*!
+ \qmlproperty list<string> DataInput::metadataKeys
+
+ Contains the metadata keys specified for this datainput.
+
+ \note This value is read-only.
+*/
+
QT_END_NAMESPACE
diff --git a/src/api/studio3d/q3dsdatainput.h b/src/api/studio3d/q3dsdatainput.h
index 3617dcd..3f81c65 100644
--- a/src/api/studio3d/q3dsdatainput.h
+++ b/src/api/studio3d/q3dsdatainput.h
@@ -48,6 +48,7 @@ class Q_STUDIO3D_EXPORT Q3DSDataInput : public QObject
Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged)
Q_PROPERTY(float max READ max CONSTANT)
Q_PROPERTY(float min READ min CONSTANT)
+ Q_PROPERTY(QStringList metadataKeys READ metadataKeys CONSTANT)
public:
explicit Q3DSDataInput(QObject *parent = nullptr);
explicit Q3DSDataInput(const QString &name, QObject *parent = nullptr);
@@ -69,7 +70,7 @@ public:
bool isValid() const;
Q_INVOKABLE QString metadata(const QString &key) const;
- Q_INVOKABLE QStringList metadataKeys() const;
+ QStringList metadataKeys() const;
public Q_SLOTS:
void setName(const QString &name);
diff --git a/src/api/studio3d/q3dsdataoutput.cpp b/src/api/studio3d/q3dsdataoutput.cpp
index 3cb13a0..9ca0d03 100644
--- a/src/api/studio3d/q3dsdataoutput.cpp
+++ b/src/api/studio3d/q3dsdataoutput.cpp
@@ -34,9 +34,10 @@
/*!
\qmltype DataOutput
\instantiates Q3DSDataOutput
- \inqmlmodule Qt3DStudio
+ \inqmlmodule QtStudio3D.OpenGL
\ingroup OpenGLRuntime
\brief Provides notifications from data output entries in Qt 3D Studio presentation.
+
This class is a convenience class for listening for changes in the Qt 3D Studio
presentation attributes. DataOutput provides a clean contract between the presentation
design and the code. It hides the presentation details from the code while providing a
@@ -59,6 +60,7 @@
\inmodule OpenGLRuntime
\since Qt 3D Studio 2.4
\brief Provides notifications from data output entries in Qt 3D Studio presentation.
+
This class is a convenience class for listening for changes in the Qt 3D Studio
presentation attributes. DataOutput provides a clean contract between the presentation
design and the code. It hides the presentation details from the code while providing a
@@ -66,8 +68,8 @@
(e.g. movement of an element in the presentation due to timeline animation).
DataOutput can be attached to same attributes in the design as DataInput is, including
- presentation timeline. Only excaption is slide changes Slide changes are already notified
- through \c{Q3DSPresentation::slideEntered} and \c{Q3DSPresentation::slideExited} signals.
+ presentation timeline. Only exception is slide changes (slide changes are already notified
+ through \c{Q3DSPresentation::slideEntered} and \c{Q3DSPresentation::slideExited} signals).
\note There is a performance cost for each registered DataOutput, so try to avoid
creating unnecessary DataOutputs.
@@ -135,7 +137,8 @@ void Q3DSDataOutput::setName(const QString &name)
}
/*!
- \qmlproperty DataOutput::value
+ \qmlproperty var DataOutput::value
+ \readonly
Contains the read-only value of the controlled data output element in the
presentation.
@@ -161,17 +164,17 @@ QVariant Q3DSDataOutput::value() const
}
/*!
- * \qmlsignal DataOutput::valueChanged
- Emitted when the value of the observed DataOutput has changed in the
- presentation.
- \param newValue The new value of the observed DataOutput.
+ \qmlsignal DataOutput::valueChanged(var newValue)
+
+ Emitted when the value of the observed DataOutput has changed to
+ \a newValue in the presentation.
*/
/*!
- \fn Q3DSDataOutput::valueChanged
- Emitted when the value of the observed DataOutput has changed in the
- presentation.
- \param newValue The new value of the observed DataOutput.
+ \fn Q3DSDataOutput::valueChanged(const QVariant &newValue)
+
+ Emitted when the value of the observed DataOutput has changed to
+ \a newValue in the presentation.
*/
/*!
diff --git a/src/api/studio3d/q3dselement.cpp b/src/api/studio3d/q3dselement.cpp
index 16ae110..5731001 100644
--- a/src/api/studio3d/q3dselement.cpp
+++ b/src/api/studio3d/q3dselement.cpp
@@ -40,7 +40,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Element
\instantiates Q3DSElement
- \inqmlmodule Qt3DStudio
+ \inqmlmodule QtStudio3D.OpenGL
\ingroup OpenGLRuntime
\brief Control type for elements in a Qt 3D Studio presentation.
@@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE
\inmodule OpenGLRuntime
\since Qt 3D Studio 2.0
- \brief Controls a scene object (node) in a Qt 3D Studio presentation.
+ \brief Controls a scene object (element) in a Qt 3D Studio presentation.
This class is provided for backwards compatibility. We recommend using
DataInput and DataOutput APIs for contractual and clean API between
@@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE
object (such as, model, material, camera, layer) in a Qt 3D Studio
presentation.
- \sa Q3DSWidget, Q3DSSurfaceViewer, Q3DSSceneElement
+ \sa Q3DSSurfaceViewer, Q3DSSceneElement
*/
/*!
diff --git a/src/api/studio3d/q3dsgeometry.cpp b/src/api/studio3d/q3dsgeometry.cpp
index bfc66a9..f4b650a 100644
--- a/src/api/studio3d/q3dsgeometry.cpp
+++ b/src/api/studio3d/q3dsgeometry.cpp
@@ -31,51 +31,239 @@
QT_BEGIN_NAMESPACE
+/*!
+ \class Q3DSGeometry
+ \inmodule OpenGLRuntime
+ \since Qt 3D Studio 2.4
+
+ \brief Represents a mesh geometry.
+
+ This class describes the mesh geometry for dynamic mesh creation.
+ The geometry consists of a vertex buffer and an optional index buffer.
+ Geometry attributes are used to define how the data in these buffers should be interpreted.
+
+ For example, create a simple textured pyramid geometry:
+
+ \badcode
+ // A vertex in vertex buffer consists of position, normal, and texture coordinates
+ struct Vertex {
+ QVector3D position;
+ QVector3D normal;
+ QVector2D uv;
+ };
+
+ // The vertex buffer
+ QVector<Vertex> vertices;
+
+ // Creates a triangle into the vertex buffer
+ auto createTriangle = [&](const QVector3D &xyz1, const QVector2D &uv1,
+ const QVector3D &xyz2, const QVector2D &uv2,
+ const QVector3D &xyz3, const QVector2D &uv3) {
+ QVector3D n = QVector3D::crossProduct(xyz2 - xyz1, xyz3 - xyz1).normalized();
+ vertices.append({xyz1, n, uv1});
+ vertices.append({xyz2, n, uv2});
+ vertices.append({xyz3, n, uv3});
+ };
+
+ // Pyramid corner coordinates in local space
+ QVector3D xyz[5] = {{0, 0, 50}, {50, 50, -50}, {50, -50, -50}, {-50, -50, -50}, {-50, 50, -50}};
+
+ // Possible texture coordinates for triangle corners
+ QVector2D uv[4] = {{1, 1}, {1, 0}, {0, 0}, {0, 1}};
+
+ // Pyramid consists of four side triangles and a bottom quad made of two triangles
+ createTriangle(xyz[0], uv[0], xyz[1], uv[1], xyz[2], uv[2]);
+ createTriangle(xyz[0], uv[0], xyz[2], uv[1], xyz[3], uv[2]);
+ createTriangle(xyz[0], uv[0], xyz[3], uv[1], xyz[4], uv[2]);
+ createTriangle(xyz[0], uv[0], xyz[4], uv[1], xyz[1], uv[2]);
+ createTriangle(xyz[1], uv[0], xyz[4], uv[2], xyz[3], uv[1]);
+ createTriangle(xyz[1], uv[0], xyz[3], uv[3], xyz[2], uv[2]);
+
+ // Make a byte array out of the vertex buffer
+ QByteArray vertexBuffer(reinterpret_cast<const char *>(vertices.constData()),
+ vertices.size() * int(sizeof(Vertex)));
+
+ // Create the geometry. Triangle is the default primitive type, so we don't specify it.
+ // The order of the added attributes must match the order of the attribute data in the
+ // vertex buffer.
+ Q3DSGeometry pyramid;
+ pyramid.setVertexData(vertexBuffer);
+ pyramid.addAttribute(Q3DSGeometry::Attribute::PositionSemantic);
+ pyramid.addAttribute(Q3DSGeometry::Attribute::NormalSemantic);
+ pyramid.addAttribute(Q3DSGeometry::Attribute::TexCoordSemantic);
+ \endcode
+
+ \sa Q3DSPresentation::createMesh
+ */
+
+/*!
+ \enum Q3DSGeometry::PrimitiveType
+
+ This enumeration specifies the possible rendering primitives for the geometry.
+ For more information about rendering primitives and how they affect the vertex data,
+ see OpenGL documentation.
+
+ \value UnknownType Primitive type is unknown.
+ \value Points Geometry uses point primitives.
+ \value LineStrip Geometry uses line strip primitives.
+ \value LineLoop Geometry uses line loop primitives.
+ \value Lines Geometry uses line primitives.
+ \value TriangleStrip Geometry uses triangle strip primitives.
+ \value TriangleFan Geometry uses triangle fan primitives.
+ \value Triangles Geometry uses triangle primitives. This is the default primitive type.
+ \value Patches Geometry uses patch primitives.
+*/
+
+/*!
+ \enum Q3DSGeometry::Attribute::Semantic
+
+ This enumeration specifies the possible attribute semantics for the geometry.
+ The attribute semantic indicates the purpose of the attribute.
+
+ \value UnknownSemantic Attribute semantic is unknown.
+ \value IndexSemantic Attribute specifies index buffer data type.
+ \value PositionSemantic Attribute specifies vertex position attribute
+ (\c{attr_pos} in shaders).
+ Attribute has three components.
+ \value NormalSemantic Attribute specifies vertex normal attribute
+ (\c{attr_norm} in shaders).
+ Attribute has three components.
+ \value TexCoordSemantic Attribute specifies vertex texture coordinate attribute
+ (\c{attr_uv0} in shaders).
+ Attribute has two components.
+ \value TangentSemantic Attribute specifies vertex tangent attribute
+ (\c{attr_textan} in shaders).
+ Attribute has three components.
+ \value BinormalSemantic Attribute specifies vertex binormal attribute
+ (\c{attr_binormal} in shaders).
+ Attribute has three components.
+*/
+
+/*!
+ \enum Q3DSGeometry::Attribute::ComponentType
+
+ This enumeration specifies the possible attribute component types for the geometry.
+ The attribute component type indicates how the attribute component data should be interpreted.
+
+ \value DefaultType Use the default type for the attribute.
+ \value U8Type Component data is unsigned 8 bit integer.
+ \value I8Type Component data is signed 8 bit integer.
+ \value U16Type Component data is unsigned 16 bit integer.
+ \value I16Type Component data is signed 16 bit integer.
+ \value U32Type Component data is unsigned 32 bit integer.
+ Default component type for attributes with IndexSemantic.
+ \value I32Type Component data is signed 32 bit integer.
+ \value U64Type Component data is unsigned 64 bit integer.
+ \value I64Type Component data is signed 64 bit integer.
+ \value F16Type Component data is 16 bit float.
+ \value F32Type Component data is 32 bit float.
+ Default component type for attributes with a semantic other than IndexSemantic.
+ \value F64Type Component data is 64 bit float.
+*/
+
+/*!
+ Constructs a new Q3DSGeometry instance.
+ */
Q3DSGeometry::Q3DSGeometry()
: d_ptr(new Q3DSGeometryPrivate(this))
{
}
+/*!
+ Destructor.
+ */
Q3DSGeometry::~Q3DSGeometry()
{
delete d_ptr;
}
+/*!
+ Sets the vertex buffer to \a data. The \a data must contain all attribute data in interleaved
+ format. You must also add attributes to the geometry to specify how the vertex buffer
+ data should be interpreted.
+
+ \sa addAttribute
+ \sa vertexBuffer
+ */
void Q3DSGeometry::setVertexData(const QByteArray &data)
{
d_ptr->m_meshData.m_vertexBuffer = data;
}
+/*!
+ Sets the index buffer to \a data.
+ You must also add an attribute with \c IndexSemantic to the geometry.
+
+ \sa addAttribute
+ \sa indexBuffer
+ \sa Attribute::Semantic
+ */
void Q3DSGeometry::setIndexData(const QByteArray &data)
{
d_ptr->m_meshData.m_indexBuffer = data;
}
+/*!
+ Returns the currently set vertex buffer data.
+
+ \sa setVertexData
+ */
const QByteArray &Q3DSGeometry::vertexBuffer() const
{
return d_ptr->m_meshData.m_vertexBuffer;
}
+/*!
+ This is an overloaded function.
+ */
QByteArray &Q3DSGeometry::vertexBuffer()
{
return d_ptr->m_meshData.m_vertexBuffer;
}
+/*!
+ Returns the currently set index buffer data.
+
+ \sa setIndexData
+ */
const QByteArray &Q3DSGeometry::indexBuffer() const
{
return d_ptr->m_meshData.m_indexBuffer;
}
+/*!
+ This is an overloaded function.
+ */
QByteArray &Q3DSGeometry::indexBuffer()
{
return d_ptr->m_meshData.m_indexBuffer;
}
+/*!
+ Returns the number of attributes set to this geometry.
+
+ \sa addAttribute
+ */
int Q3DSGeometry::attributeCount() const
{
return d_ptr->m_meshData.m_attributeCount;
}
+/*!
+ Sets an attribute to this geometry. The geometry attributes specify how the data in vertex and
+ index buffers should be interpreted. Each attribute is composed of a \a semantic, which
+ indicates which vertex attribute this attribute refers to and \a componentType, which indicates
+ the data type of each component of the attribute data. The \a semantic also determines
+ the component count in vertex buffer for the attribute. The component count is two for
+ TexCoordSemantic and three for other vertex buffer semantics.
+ Component count for index buffer is always one.
+
+ For example, PositionSemantic specifies the vertex position in local space, so it is composed
+ of three components: x, y, and z-coordinates.
+
+ The order of addAttribute calls must match the order of the attributes in vertex data.
+ The order is relevant as it is used to calculate the offset and stride of each attribute.
+ */
void Q3DSGeometry::addAttribute(Q3DSGeometry::Attribute::Semantic semantic,
Q3DSGeometry::Attribute::ComponentType componentType)
{
@@ -98,11 +286,20 @@ void Q3DSGeometry::addAttribute(Q3DSGeometry::Attribute::Semantic semantic,
d_ptr->m_meshData.m_stride = d_ptr->getNextAttributeOffset();
}
+/*!
+ This is an overloaded function.
+ */
void Q3DSGeometry::addAttribute(const Q3DSGeometry::Attribute &att)
{
addAttribute(att.semantic, att.componentType);
}
+/*!
+ Returns an added attribute with index \a idx.
+
+ \sa addAttribute
+ \sa attributeCount
+ */
Q3DSGeometry::Attribute Q3DSGeometry::attribute(int idx) const
{
Attribute att;
@@ -113,16 +310,31 @@ Q3DSGeometry::Attribute Q3DSGeometry::attribute(int idx) const
return att;
}
+/*!
+ Returns the primitive type of this geometry.
+
+ \sa setPrimitiveType
+ */
Q3DSGeometry::PrimitiveType Q3DSGeometry::primitiveType() const
{
return static_cast<Q3DSGeometry::PrimitiveType>(d_ptr->m_meshData.m_primitiveType);
}
+/*!
+ Sets the primitive type of this geometry to \a type.
+
+ \sa primitiveType
+ */
void Q3DSGeometry::setPrimitiveType(Q3DSGeometry::PrimitiveType type)
{
d_ptr->m_meshData.m_primitiveType = static_cast<Q3DSViewer::MeshData::PrimitiveType>(type);
}
+/*!
+ Removes all added attributes and buffers and resets the geometry to an uninitialized state.
+
+ \sa primitiveType
+ */
void Q3DSGeometry::clear()
{
d_ptr->m_meshData.clear();
diff --git a/src/api/studio3d/q3dspresentation.cpp b/src/api/studio3d/q3dspresentation.cpp
index c07922c..cd9ecfa 100644
--- a/src/api/studio3d/q3dspresentation.cpp
+++ b/src/api/studio3d/q3dspresentation.cpp
@@ -79,9 +79,54 @@ QT_BEGIN_NAMESPACE
information is available regardless.
\note This class should not be instantiated directly when working with the
- C++ APIs. Q3DSSurfaceViewer and Q3DSWidget create a Q3DSPresentation
+ C++ APIs. Q3DSSurfaceViewer creates a Q3DSPresentation
instance implicitly. This can be queried via
- Q3DSSurfaceViewer::presentation() or Q3DSWidget::presentation().
+ Q3DSSurfaceViewer::presentation().
+ */
+
+/*!
+ \qmltype Presentation
+ \instantiates Q3DSPresentationItem
+ \inqmlmodule QtStudio3D.OpenGL
+ \ingroup OpenGLRuntime
+ \inherits Q3DSPresentation
+ \keyword Studio3D
+
+ \brief Represents a Qt 3D Studio presentation.
+
+ This item provides properties and methods for controlling a
+ presentation.
+
+ Qt 3D Studio supports multiple presentations in one project. There
+ is always a main presentation and zero or more
+ sub-presentations. The sub-presentations are composed into the
+ main presentations either as contents of Qt 3D Studio layers or as
+ texture maps.
+
+ In the filesystem each presentation corresponds to one \c{.uip}
+ presentation file. When present, the \c{.uia} project file ties
+ these together by specifying a name for each of the
+ (sub-)presentations and specifies which one is the main one.
+
+ The \c{.uia} project also defines \l{DataInput}s and
+ \l{DataOutput}s that are exported by the presentations.
+ \l{DataInput}s provide a way to provide input to the presentation
+ to e.g. control a timeline of a subpresentation from code.
+ \l{DataOutput}s provide a way to get notified when an attribute
+ is changed in the presentation by animation timeline,
+ by behavior scripts or by a \l{DataInput}.
+
+ The Presentation type handles child objects of the types \l Element, \l
+ SceneElement, \l DataInput, \l DataOutput, and \l SubPresentationSettings specially. These
+ will get automatically associated with the presentation and can control
+ certain aspects of it from that point on.
+
+ From the API point of view Presentation corresponds to the
+ main presentation. The source property can refer either to a
+ \c{.uia} or \c{.uip} file. When specifying a file with \c{.uip}
+ extension and a \c{.uia} is present with the same name, the
+ \c{.uia} is loaded automatically and thus sub-presentation
+ information is available regardless.
*/
/*!
@@ -299,7 +344,7 @@ Q3DSDataOutput *Q3DSPresentation::registeredDataOutput(const QString &name) cons
interface to set a datainput value using datainput name, or call Q3DSDataInput::setValue
directly for a specific datainput.
- \sa setDataInputValue
+ \sa setDataInputValue()
\sa Q3DSDataInput
*/
QVector<Q3DSDataInput *> Q3DSPresentation::dataInputs() const
@@ -327,7 +372,7 @@ QVector<Q3DSDataInput *> Q3DSPresentation::dataInputs() const
interface to set a datainput value using datainput name, or call Q3DSDataInput::setValue
directly for a specific datainput.
- \sa setDataInputValue
+ \sa setDataInputValue()
\sa Q3DSDataInput
*/
QVariantList Q3DSPresentation::getDataInputs() const
@@ -342,19 +387,19 @@ QVariantList Q3DSPresentation::getDataInputs() const
}
/*!
+ \qmlmethod var Presentation::getDataInputs(string metadataKey)
Returns a list of datainputs defined for this presentation that have the specified
\a metadataKey.
- \sa setDataInputValue
- \sa Q3DSDataInput
+ \sa DataInput
*/
/*!
- \qmlmethod var Presentation::getDataInputs
Returns a list of datainputs defined for this presentation that have the specified
\a metadataKey.
- \sa DataInput
+ \sa setDataInputValue()
+ \sa Q3DSDataInput
*/
QVariantList Q3DSPresentation::getDataInputs(const QString &metadataKey) const
{
@@ -371,7 +416,7 @@ QVariantList Q3DSPresentation::getDataInputs(const QString &metadataKey) const
Returns a list of datainputs defined for this presentation that have the specified
\a metadataKey.
- \sa setDataInputValue
+ \sa setDataInputValue()
\sa Q3DSDataInput
*/
QVector<Q3DSDataInput *> Q3DSPresentation::dataInputs(const QString &metadataKey) const
@@ -405,7 +450,7 @@ QVector<Q3DSDataOutput *> Q3DSPresentation::dataOutputs() const
\c{valueChanged()} signal in the required \l{DataOutput}s to get notified
when the value tracked by the DataOutput is changed.
- \sa SDataOutput
+ \sa Q3DSDataOutput
*/
/*!
* \brief Q3DSPresentation::getDataOutputs Returns \l{DataOutput}s.
@@ -465,16 +510,44 @@ void Q3DSPresentation::setDelayedLoading(bool enable)
}
/*!
- \qmlmethod Presentation::preloadSlide
- Preloads slide resources to memory. All resources required by the given slide will be
- loaded in the background. This function has effect only when delayed loading is enabled.
- \param elementPath
+ \qmlmethod Presentation::preloadSlide(string elementPath)
+
+ Preloads slide resources identified by \a elementPath to memory. All resources required
+ by the given slide will load in the background.
+
+ \a elementPath is the identifier of a slide in a presentation and component.
+
+ The presentation, component and slide are separated by ":", for example
+ My-presentation:Scene.Layer.Speedometer:Main-slide.
+
+ If \a elementPath does not contain any ":", then it specifies the name of a slide in the
+ main presentation and main component. If it contains one ":", it specifies component:slide
+ in the main presentation, and if it contains two ":", it
+ specifies presentation:component:slide.
+
+ If you want to indicate the main slide in a sub-presentation, you will need to specify the
+ full path. For example My-sub-presentation:Scene:Main-slide.
+
+ This function has effect only when delayed loading is enabled.
*/
/*!
- \brief Q3DSPresentation::preloadSlide
- Preloads slide resources to memory. All resources required by the given slide will be
- loaded in the background. This function has effect only when delayed loading is enabled.
- \param elementPath
+ Preloads slide resources identified by \a elementPath to memory. All resources required
+ by the given slide will load in the background.
+
+ \a elementPath is the identifier of a slide in a presentation and component.
+
+ The presentation, component and slide are separated by ":", for example
+ My-presentation:Scene.Layer.Speedometer:Main-slide.
+
+ If \a elementPath does not contain any ":", then it specifies the name of a slide in the
+ main presentation and main component. If it contains one ":", it specifies component:slide
+ in the main presentation, and if it contains two ":", it
+ specifies presentation:component:slide.
+
+ If you want to indicate the main slide in a sub-presentation, you will need to specify the
+ full path. For example My-sub-presentation:Scene:Main-slide.
+
+ This function has effect only when delayed loading is enabled.
*/
void Q3DSPresentation::preloadSlide(const QString &elementPath)
{
@@ -485,17 +558,45 @@ void Q3DSPresentation::preloadSlide(const QString &elementPath)
}
/*!
- \qmlmethod Presentation::unloadSlide
- Unloads slide resources from memory. If the slide is current, then the resources are unloaded
- when the slide is changed. This function has effect only when delayed loading is enabled.
- \param elementPath
+ \qmlmethod Presentation::unloadSlide(string elementPath)
+
+ Unloads slide resources identified by \a elementPath from memory. If the
+ slide is current, the resources are unloaded when the slide is changed.
+
+ \a elementPath is the identifier of a slide in a presentation and component.
+
+ The presentation, component and slide are separated by ":", for example
+ my-presentation:Scene.Layer.Speedometer:Main-slide.
+
+ If \a elementPath does not contain any ":", then it specifies the name of a slide in the
+ main presentation and main component. If it contains one ":", it specifies component:slide
+ in the main presentation, and if it contains two ":", it
+ specifies presentation:component:slide.
+
+ If you want to indicate the main slide in a sub-presentation, you will need to specify the
+ full path. For example My-sub-presentation:Scene:Main-slide.
+
+ This function has effect only when delayed loading is enabled.
*/
/*!
- \brief Q3DSPresentation::unloadSlide
- Unloads slide resources from memory. If the slide is current, then the resources are unloaded
- when the slide is changed. This function has effect only when delayed loading is enabled.
- \param elementPath
+ Unloads slide resources identified by \a elementPath from memory. If the
+ slide is current, the resources are unloaded when the slide is changed.
+
+ \a elementPath is the identifier of a slide in a presentation and component.
+
+ The presentation, component and slide are separated by ":", for example
+ My-presentation:speedometer:main-slide.
+
+ If \a elementPath does not contain any ":", then it specifies the name of a slide in the
+ main presentation and main component. If it contains one ":", it specifies component:slide
+ in the main presentation, and if it contains two ":", it
+ specifies presentation:Scene.Layer.Speedometer:Main-slide.
+
+ If you want to indicate the main slide in a sub-presentation, you will need to specify the
+ full path. For example My-sub-presentation:Scene:Main-slide.
+
+ This function has effect only when delayed loading is enabled.
*/
void Q3DSPresentation::unloadSlide(const QString &elementPath)
{
@@ -506,7 +607,7 @@ void Q3DSPresentation::unloadSlide(const QString &elementPath)
}
/*!
- This API is for backwards compatibility. We recommend using \l{DataInput}s to control
+ This function is for backwards compatibility. We recommend using \l{DataInput}s to control
slide changes. \l{DataInput} provides stronger contract between the design and
code as it avoids use of elementPath (a reference to design's internal structure).
@@ -531,7 +632,7 @@ void Q3DSPresentation::goToSlide(const QString &elementPath, unsigned int index)
}
/*!
- This API is for backwards compatibility. We recommend using \l{DataInput}s to control
+ This function is for backwards compatibility. We recommend using \l{DataInput}s to control
slide changes. \l{DataInput} provides stronger contract between the design and
code as it avoids use of elementPath (a reference to design's internal structure).
@@ -557,7 +658,7 @@ void Q3DSPresentation::goToSlide(const QString &elementPath, const QString &name
}
/*!
- This API is for backwards compatibility. We recommend using \l{DataInput}s to control
+ This function is for backwards compatibility. We recommend using \l{DataInput}s to control
slide changes. \l{DataInput} provides stronger contract between the design and
code as it avoids use of elementPath (a reference to design's internal structure).
@@ -584,12 +685,12 @@ void Q3DSPresentation::goToSlide(const QString &elementPath, bool next, bool wra
}
/*!
- This API is for backwards compatibility. We recommend using \l{DataInput}s to control
+ This function is for backwards compatibility. We recommend using \l{DataInput}s to control
slide changes. \l{DataInput} provides stronger contract between the design and
code as it avoids use of elementPath (a reference to design's internal structure).
Moves the timeline for a time context (a Scene or a Component element) to a
- specific position. The position is given in seconds in \a timeSeconds.
+ specific position. The position is given in seconds in \a time.
If \a elementPath points to a time context, that element is
controlled. For all other element types the time context owning
@@ -624,7 +725,7 @@ void Q3DSPresentation::goToTime(const QString &elementPath, float time)
}
/*!
- This API is for backwards compatibility. We recommend using \l{DataInput}s to control
+ This function is for backwards compatibility. We recommend using \l{DataInput}s to control
attributes in the presentation. \l{DataInput} provides stronger contract between the
design and code as it avoids use of elementPath (a reference to design's
internal structure).
@@ -778,12 +879,18 @@ void Q3DSPresentation::setDataInputValue(const QString &name, const QVariant &va
The element is ready for use once elementsCreated() signal is received for it.
- \sa createElements
- \sa createMaterial
- \sa createMesh
- \sa elementsCreated
- \sa setAttribute
- \sa dataInputs
+ \note If your application is creating and deleting a lot of elements, it is recommended that
+ you reuse previously deleted element names when creating new elements.
+ This is because the internal string table implementation of Qt 3D Studio ogl-runtime doesn't
+ support removing strings for performance reasons, so always using new unique names
+ will leak memory.
+
+ \sa createElements()
+ \sa createMaterial()
+ \sa createMesh()
+ \sa elementsCreated()
+ \sa setAttribute()
+ \sa dataInputs()
*/
void Q3DSPresentation::createElement(const QString &parentElementPath, const QString &slideName,
const QHash<QString, QVariant> &properties)
@@ -798,8 +905,8 @@ void Q3DSPresentation::createElement(const QString &parentElementPath, const QSt
specified with \a slideName. Element properties are specified in \a properties.
For more details, see createElement().
- \sa createElement
- \sa elementsCreated
+ \sa createElement()
+ \sa elementsCreated()
*/
void Q3DSPresentation::createElements(const QString &parentElementPath, const QString &slideName,
const QVector<QHash<QString, QVariant>> &properties)
@@ -820,8 +927,8 @@ void Q3DSPresentation::createElements(const QString &parentElementPath, const QS
Deleting elements is supported only for elements that have been dynamically created with
createElement() or createElements().
- \sa deleteElements
- \sa createElement
+ \sa deleteElements()
+ \sa createElement()
*/
void Q3DSPresentation::deleteElement(const QString &elementPath)
{
@@ -835,7 +942,7 @@ void Q3DSPresentation::deleteElement(const QString &elementPath)
Deleting elements is supported only for elements that have been dynamically created with
createElement() or createElements().
- \sa deleteElement
+ \sa deleteElement()
*/
void Q3DSPresentation::deleteElements(const QStringList &elementPaths)
{
@@ -852,6 +959,7 @@ void Q3DSPresentation::deleteElements(const QStringList &elementPaths)
/*!
\qmlproperty list<string> Presentation::createdElements
+ \readonly
This property contains a list of all dynamically created elements on this presentation.
@@ -859,8 +967,8 @@ void Q3DSPresentation::deleteElements(const QStringList &elementPaths)
\note Elements can only be dynamically created via C++ API.
- \sa createElement
- \sa createElements
+ \sa createElement()
+ \sa createElements()
*/
/*!
@@ -870,8 +978,8 @@ void Q3DSPresentation::deleteElements(const QStringList &elementPaths)
This property is read-only.
- \sa createElement
- \sa createElements
+ \sa createElement()
+ \sa createElements()
*/
QStringList Q3DSPresentation::createdElements() const
{
@@ -898,15 +1006,21 @@ QStringList Q3DSPresentation::createdElements() const
The material is ready for use once materialsCreated() signal is received for it.
+ \note If your application is creating and deleting a lot of materials, it is recommended that
+ you reuse previously deleted material names when creating new materials.
+ This is because the internal string table implementation of Qt 3D Studio ogl-runtime doesn't
+ support removing strings for performance reasons, so always using new unique names
+ will leak memory.
+
\note Creating materials that utilise custom shaders with mipmapped textures can in some cases
corrupt the textures on other elements if the same textures are already used by existing basic
materials in the scene, as basic materials do not create mipmaps for their textures.
Typical symptom of this is black texture on another element after creating a new element using
the custom material.
- \sa createMaterials
- \sa createElement
- \sa materialsCreated
+ \sa createMaterials()
+ \sa createElement()
+ \sa materialsCreated()
*/
void Q3DSPresentation::createMaterial(const QString &materialDefinition,
const QString &subPresId)
@@ -923,8 +1037,8 @@ void Q3DSPresentation::createMaterial(const QString &materialDefinition,
For more details, see createMaterial().
- \sa createMaterial
- \sa materialsCreated
+ \sa createMaterial()
+ \sa materialsCreated()
*/
void Q3DSPresentation::createMaterials(const QStringList &materialDefinitions,
const QString &subPresId)
@@ -947,8 +1061,8 @@ void Q3DSPresentation::createMaterials(const QStringList &materialDefinitions,
Deleting materials is supported only for materials that have been dynamically created with
createMaterial() or createMaterials().
- \sa deleteMaterials
- \sa createMaterial
+ \sa deleteMaterials()
+ \sa createMaterial()
*/
void Q3DSPresentation::deleteMaterial(const QString &materialName)
{
@@ -965,7 +1079,7 @@ void Q3DSPresentation::deleteMaterial(const QString &materialName)
Deleting materials is supported only for materials that have been dynamically created with
createMaterial() or createMaterials().
- \sa deleteMaterial
+ \sa deleteMaterial()
*/
void Q3DSPresentation::deleteMaterials(const QStringList &materialNames)
{
@@ -982,6 +1096,7 @@ void Q3DSPresentation::deleteMaterials(const QStringList &materialNames)
/*!
\qmlproperty list<string> Presentation::createdMaterials
+ \readonly
This property contains a list of all dynamically created materials on this presentation.
@@ -989,8 +1104,8 @@ void Q3DSPresentation::deleteMaterials(const QStringList &materialNames)
\note Materials can only be dynamically created via C++ API.
- \sa createMaterial
- \sa createMaterials
+ \sa createMaterial()
+ \sa createMaterials()
*/
/*!
@@ -1000,8 +1115,8 @@ void Q3DSPresentation::deleteMaterials(const QStringList &materialNames)
This property is read-only.
- \sa createMaterial
- \sa createMaterials
+ \sa createMaterial()
+ \sa createMaterials()
*/
QStringList Q3DSPresentation::createdMaterials() const
{
@@ -1014,9 +1129,9 @@ QStringList Q3DSPresentation::createdMaterials() const
The mesh is ready for use once meshesCreated() signal is received for it.
- \sa createElement
- \sa createMeshes
- \sa meshesCreated
+ \sa createElement()
+ \sa createMeshes()
+ \sa meshesCreated()
*/
void Q3DSPresentation::createMesh(const QString &meshName, const Q3DSGeometry &geometry)
{
@@ -1031,8 +1146,14 @@ void Q3DSPresentation::createMesh(const QString &meshName, const Q3DSGeometry &g
The ownership of supplied geometries stays with the caller.
- \sa createMesh
- \sa meshesCreated
+ \note If your application is creating and deleting a lot of meshes, it is recommended that
+ you reuse previously deleted mesh names when creating new materials.
+ This is because the internal string table implementation of \RUNTIME doesn't
+ support removing strings for performance reasons, so always using new unique names
+ will leak memory.
+
+ \sa createMesh()
+ \sa meshesCreated()
*/
void Q3DSPresentation::createMeshes(const QHash<QString, const Q3DSGeometry *> &meshData)
{
@@ -1058,8 +1179,8 @@ void Q3DSPresentation::createMeshes(const QHash<QString, const Q3DSGeometry *> &
Deleting meshes is supported only for meshes that have been dynamically created with
createMesh() or createMeshes().
- \sa deleteMeshes
- \sa createMesh
+ \sa deleteMeshes()
+ \sa createMesh()
*/
void Q3DSPresentation::deleteMesh(const QString &meshName)
{
@@ -1073,7 +1194,7 @@ void Q3DSPresentation::deleteMesh(const QString &meshName)
Deleting meshes is supported only for meshes that have been dynamically created with
createMesh() or createMeshes().
- \sa deleteMesh
+ \sa deleteMesh()
*/
void Q3DSPresentation::deleteMeshes(const QStringList &meshNames)
{
@@ -1090,6 +1211,7 @@ void Q3DSPresentation::deleteMeshes(const QStringList &meshNames)
/*!
\qmlproperty list<string> Presentation::createdMeshes
+ \readonly
This property contains a list of all dynamically created meshes on this presentation.
@@ -1097,8 +1219,8 @@ void Q3DSPresentation::deleteMeshes(const QStringList &meshNames)
\note Meshes can only be dynamically created via C++ API.
- \sa createMesh
- \sa createMeshes
+ \sa createMesh()
+ \sa createMeshes()
*/
/*!
@@ -1108,8 +1230,8 @@ void Q3DSPresentation::deleteMeshes(const QStringList &meshNames)
This property is read-only.
- \sa createMesh
- \sa createMeshes
+ \sa createMesh()
+ \sa createMeshes()
*/
QStringList Q3DSPresentation::createdMeshes() const
{
@@ -1213,125 +1335,171 @@ void Q3DSPresentation::keyReleaseEvent(QKeyEvent *e)
}
}
-// #TODO: QT3DS-3562 Most Presentation signals missing documentation
/*!
- * \qmlsignal Presentation::slideEntered
- * Emitted when
- * \param elementPath
- * \param index
- * \param name
+ \qmlsignal Presentation::slideEntered(string elementPath, int index, string name)
+
+ Emitted when a slide in a presentation or component is entered. \a elementPath
+ specifies the slide path. \a index and \a name contain the index and
+ the name of the entered slide.
+
+ This signal is emitted for each component, meaning that it can be emitted multiple
+ times on one slide change.
*/
/*!
- * \fn Q3DSPresentation::slideEntered
- * Emitted when
- * \param elementPath
- * \param index
- * \param name
+ \fn Q3DSPresentation::slideEntered(const QString &elementPath, unsigned int index, const QString &name)
+
+ Emitted when a slide in a presentation or component is entered. \a elementPath
+ specifies the slide path. \a index and \a name contain the index and
+ the name of the entered slide.
+
+ This signal is emitted for each component, meaning that it can be emitted multiple
+ times on one slide change.
*/
/*!
- * \qmlsignal Presentation::slideExited
- * Emitted when
- * \param elementPath
- * \param index
- * \param name
+ \qmlsignal Presentation::slideExited(string elementPath, int index, string name)
+
+ Emitted when a slide in a presentation or component is exited. \a elementPath
+ specifies the slide path. \a index and \a name contain the index and
+ the name of the exited slide.
+
+ This signal is emitted for each component, meaning that it can be emitted multiple
+ times on one slide change.
*/
/*!
- * \fn Q3DSPresentation::slideExited
- * Emitted when
- * \param elementPath
- * \param index
- * \param name
- */
+ \fn Q3DSPresentation::slideExited(const QString &elementPath, unsigned int index, const QString &name)
+
+ Emitted when a slide in a presentation or component is exited. \a elementPath
+ specifies the slide path. \a index and \a name contain the index and
+ the name of the exited slide.
+
+ This signal is emitted for each component, meaning that it can be emitted multiple
+ times on one slide change.
+*/
/*!
- * \fn Q3DSPresentation::dataInputsReady
- * Emitted when \l{DataInput}s in the Studio project have been parsed and data inputs are available
- * through dataInputs() and getDataInputs() methods.
- */
+ \fn Q3DSPresentation::dataInputsReady()
+
+ Emitted when \l{DataInput}s in the Studio project have been parsed and data inputs are available
+ through dataInputs() and getDataInputs() methods.
+*/
/*!
- * \fn Q3DSPresentation::dataOutputsReady
- * Emitted when \l{DataOutput}s in the Studio project have been parsed and data outputs are available
- * through dataOutputs() and getDataOutputs() methods.
+ \fn Q3DSPresentation::dataOutputsReady()
+
+ Emitted when \l{DataOutput}s in the Studio project have been parsed and data outputs are available
+ through dataOutputs() and getDataOutputs() methods.
*/
/*!
- * \qmlsignal Presentation::customSignalEmitted
- * Emitted when
- * \param elementPath
- * \param name
+ \qmlsignal Presentation::customSignalEmitted(string elementPath, string name)
+
+ Emitted when an action with the \c{Emit Signal}
+ handler is executed in the Qt 3D Studio presentation. \a
+ elementPath specifies \c{Target Object}, and \a name specifies \c{Signal Name}.
+
+ Connecting to this signal offers a way of reacting upon certain
+ events in the Qt 3D Studio presentation.
+
+ \image customsignal.png
+
+ In this example, pressing or tapping on the Cluster object will result in
+ emitting \c{customSignalEmitted("Cluster", "clusterPressed")}.
*/
/*!
- * \fn Q3DSPresentation::customSignalEmitted
- * Emitted when
- * \param elementPath
- * \param name
+ \fn Q3DSPresentation::customSignalEmitted(const QString &elementPath, const QString &name)
+
+ Emitted when an action with the \c{Emit Signal}
+ handler is executed in the Qt 3D Studio presentation. \a
+ elementPath specifies \c{Target Object}, and \a name specifies \c{Signal Name}.
+
+ Connecting to this signal offers a way of reacting upon certain
+ events in the Qt 3D Studio presentation.
+
+ \image customsignal.png
+
+ In this example, pressing or tapping on the Cluster object will result in
+ emitting \c{customSignalEmitted("Cluster", "clusterPressed")}.
*/
/*!
- \qmlsignal Presentation::elementsCreated
+ \qmlsignal Presentation::elementsCreated(list<string> elementPaths, string error)
+
Emitted when one or more elements have been created in response to createElement()
or createElements() calls. The \a elementPaths list contains the element paths of the created
- elements. If creation failed, \a error string indicates the reason.
+ elements.
+
+ If creation failed, \a error string indicates the reason.
- \sa createElement
- \sa createElements
+ \sa createElement()
+ \sa createElements()
*/
/*!
- \fn Q3DSPresentation::elementsCreated
+ \fn Q3DSPresentation::elementsCreated(const QStringList &elementPaths, const QString &error)
+
Emitted when one or more elements have been created in response to createElement()
or createElements() calls. The \a elementPaths list contains the element paths of the created
elements. If creation failed, \a error string indicates the reason.
- \sa createElement
- \sa createElements
+ \sa createElement()
+ \sa createElements()
*/
/*!
- \qmlsignal Presentation::materialsCreated
+ \qmlsignal Presentation::materialsCreated(list<string> materialNames, string error)
+
Emitted when one or more materials have been created in response to createMaterial()
or createMaterials() calls. The \a materialNames list contains the names of the created
materials. If the material is created into a subpresentation, the name is prefixed with
subpresentation ID followed by a colon.
+
If creation failed, \a error string indicates the reason.
- \sa createMaterial
- \sa createMaterials
+ \sa createMaterial()
+ \sa createMaterials()
*/
/*!
- \fn Q3DSPresentation::materialsCreated
+ \fn Q3DSPresentation::materialsCreated(const QStringList &materialNames, const QString &error)
+
Emitted when one or more materials have been created in response to createMaterial()
or createMaterials() calls. The \a materialNames list contains the names of the created
- materials. If creation failed, \a error string indicates the reason.
+ materials.
+
+ If creation failed, \a error string indicates the reason.
- \sa createMaterial
- \sa createMaterials
+ \sa createMaterial()
+ \sa createMaterials()
*/
/*!
- \qmlsignal Presentation::meshesCreated
+ \qmlsignal Presentation::meshesCreated(list<string> meshNames, string error)
+
Emitted when one or more meshes have been created in response to createMesh()
or createMeshes() calls. The \a meshNames list contains the names of the created
- meshes. If creation failed, \a error string indicates the reason.
+ meshes.
+
+ If creation failed, \a error string indicates the reason.
- \sa createMesh
- \sa createMeshes
+ \sa createMesh()
+ \sa createMeshes()
*/
/*!
- \fn Q3DSPresentation::meshesCreated
+ \fn Q3DSPresentation::meshesCreated(const QStringList &meshNames, const QString &error)
+
Emitted when one or more meshes have been created in response to createMesh()
or createMeshes() calls. The \a meshNames list contains the names of the created
- meshes. If creation failed, \a error string indicates the reason.
+ meshes.
+
+ If creation failed, \a error string indicates the reason.
- \sa createMesh
- \sa createMeshes
+ \sa createMesh()
+ \sa createMeshes()
*/
/*!
diff --git a/src/api/studio3d/q3dssceneelement.cpp b/src/api/studio3d/q3dssceneelement.cpp
index 3f860d6..8de03eb 100644
--- a/src/api/studio3d/q3dssceneelement.cpp
+++ b/src/api/studio3d/q3dssceneelement.cpp
@@ -40,7 +40,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype SceneElement
\instantiates Q3DSSceneElement
- \inqmlmodule Qt3DStudio
+ \inqmlmodule QtStudio3D.OpenGL
\ingroup OpenGLRuntime
\brief Controls the special Scene or Component scene objects in a Qt 3D
Studio presentation.
@@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE
\note The functionality of Q3DSSceneElement is equivalent to
Q3DSPresentation::goToTime() and Q3DSPresentation::goToSlide().
- \sa Q3DSPresentation, Q3DSWidget, Q3DSSurfaceViewer, Q3DSElement
+ \sa Q3DSPresentation, Q3DSSurfaceViewer, Q3DSElement
*/
/*!
@@ -156,11 +156,10 @@ void Q3DSSceneElement::setCurrentSlideIndex(int currentSlideIndex)
}
/*!
- \property int SceneElement::previousSlideIndex
+ \qmlproperty int SceneElement::previousSlideIndex
+ \readonly
Holds the index of the previously active slide of the tracked time context.
-
- Note: This property is read-only.
*/
/*!
\property Q3DSSceneElement::previousSlideIndex
@@ -224,11 +223,10 @@ void Q3DSSceneElement::setCurrentSlideName(const QString &currentSlideName)
}
/*!
- \qmlmproperty string SceneElement::previousSlideName
+ \qmlproperty string SceneElement::previousSlideName
+ \readonly
Holds the name of the previously active slide of the tracked time context.
-
- Note: This property is read-only.
*/
/*!
\property Q3DSSceneElement::previousSlideName
@@ -257,7 +255,7 @@ void Q3DSSceneElement::goToSlide(bool next, bool wrap)
/*!
Moves the timeline for a time context (a Scene or a Component element) to a
- specific position. The position is given in seconds in \a timeSeconds.
+ specific position. The position is given in seconds in \a time.
*/
void Q3DSSceneElement::goToTime(float time)
{
diff --git a/src/api/studio3d/q3dssurfaceviewer.cpp b/src/api/studio3d/q3dssurfaceviewer.cpp
index 32ffb99..899d771 100644
--- a/src/api/studio3d/q3dssurfaceviewer.cpp
+++ b/src/api/studio3d/q3dssurfaceviewer.cpp
@@ -94,7 +94,6 @@ QT_BEGIN_NAMESPACE
}
\endcode
- \sa Q3DSWidget
*/
/*!
@@ -259,8 +258,6 @@ bool Q3DSSurfaceViewer::isRunning() const
return d_ptr->m_viewerApp != nullptr;
}
-// #TODO QT3DS-3534
-
/*!
\property Q3DSSurfaceViewer::presentationId
*/
diff --git a/src/api/studio3d/q3dsviewersettings.cpp b/src/api/studio3d/q3dsviewersettings.cpp
index 187729a..9403a32 100644
--- a/src/api/studio3d/q3dsviewersettings.cpp
+++ b/src/api/studio3d/q3dsviewersettings.cpp
@@ -40,11 +40,11 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype ViewerSettings
\instantiates Q3DSViewerSettings
- \inqmlmodule Qt3DStudio
+ \inqmlmodule QtStudio3D.OpenGL
\ingroup OpenGLRuntime
\brief Qt 3D Studio presentation viewer settings.
- This type provides properties to define presentation independent viewer settings.
+ This type provides properties to define presentation-independent viewer settings.
\note ViewerSettings are only applicable when \l Studio3D is used in the
default mode, showing the final, composed image from the Qt 3D Studio
@@ -60,13 +60,12 @@ QT_BEGIN_NAMESPACE
\brief Qt 3D Studio presentation viewer settings.
- Q3DSViewerSettings provides properties to define presentation independent
+ Q3DSViewerSettings provides properties to define presentation-independent
viewer settings.
\note This class should not be instantiated directly when working with the
- C++ APIs. Q3DSSurfaceViewer and Q3DSWidget create a Q3DSViewerSettings
- instance implicitly. This can be queried via Q3DSSurfaceViewer::settings()
- or Q3DSWidget::settings().
+ C++ APIs. Q3DSSurfaceViewer creates a Q3DSViewerSettings
+ instance implicitly. This can be queried via Q3DSSurfaceViewer::settings().
*/
/*!
@@ -156,11 +155,15 @@ void Q3DSViewerSettings::setShowRenderStats(bool show)
}
}
-/*!
- \qmlproperty ViewerSettings::shadeMode
+/*
+ //! TODO
+ \internal
+ \qmlproperty enumeration ViewerSettings::shadeMode
*/
-/*!
+/*
+ // TODO
+ \internal
\property Q3DSViewerSettings::shadeMode
*/
Q3DSViewerSettings::ShadeMode Q3DSViewerSettings::shadeMode() const
@@ -226,20 +229,49 @@ void Q3DSViewerSettings::setScaleMode(Q3DSViewerSettings::ScaleMode mode)
}
/*!
- \qmmlmethod ViewerSettings::save
+ \qmlproperty bool ViewerSettings::matteEnabled
+
+ Specifies if the empty area around the presentation (applicable when
+ scaleMode is set to ScaleModeCenter or ScaleModeFit) should be filled with
+ a custom color.
+
+ The default value is \c false.
+ */
+/*!
+ \property Q3DSViewerSettings::matteEnabled
+
+ Specifies if the empty area around the presentation (applicable when
+ scaleMode is set to ScaleModeCenter or ScaleModeFit) should be filled with
+ a custom color.
+
+ The default value is \c false.
+
+ \sa matteColor
+ */
+bool Q3DSViewerSettings::matteEnabled() const
+{
+ return d_ptr->m_matteEnabled;
+}
+
+void Q3DSViewerSettings::setMatteEnabled(bool enabled)
+{
+ if (d_ptr->m_matteEnabled != enabled) {
+ d_ptr->setMatteEnabled(enabled);
+ Q_EMIT matteEnabledChanged(enabled);
+ }
+}
+
+
+/*!
+ \qmlmethod ViewerSettings::save(string group, string organization, string application)
+
Persistently saves the viewer \l{QSettings}{settings} using \a group, \a organization and
\a application.
- \param group
- \param organization
- \param application
*/
+
/*!
- * \brief Q3DSViewerSettings::save Persistently saves the viewer \l{QSettings}{settings}
Persistently saves the viewer \l{QSettings}{settings} using \a group, \a organization and
\a application.
- \param group
- \param organization
- \param application
*/
void Q3DSViewerSettings::save(const QString &group, const QString &organization,
const QString &application)
@@ -248,20 +280,14 @@ void Q3DSViewerSettings::save(const QString &group, const QString &organization,
}
/*!
- \qmlmethod ViewerSettings::load
+ \qmlmethod ViewerSettings::load(string group, string organization, string application)
Loads previously saved viewer \l{QSettings}{settings} using \a group, \a organization and
\a application.
- \param group
- \param organization
- \param application
*/
+
/*!
- * \brief Q3DSViewerSettings::load Loads previously saved viewer \l{QSettings}{settings}
Loads previously saved viewer \l{QSettings}{settings} using \a group, \a organization and
\a application.
- \param group
- \param organization
- \param application
*/
void Q3DSViewerSettings::load(const QString &group, const QString &organization,
const QString &application)
@@ -276,6 +302,7 @@ Q3DSViewerSettingsPrivate::Q3DSViewerSettingsPrivate(Q3DSViewerSettings *q)
, m_commandQueue(nullptr)
, m_matteColor(Qt::black)
, m_showRenderStats(false)
+ , m_matteEnabled(false)
, m_shadeMode(Q3DSViewerSettings::ShadeModeShaded)
, m_scaleMode(Q3DSViewerSettings::ScaleModeCenter)
, m_savedSettings(nullptr)
@@ -290,6 +317,7 @@ void Q3DSViewerSettingsPrivate::setViewerApp(Q3DSViewer::Q3DSViewerApp *app)
{
m_viewerApp = app;
if (m_viewerApp) {
+ setMatteEnabled(m_matteEnabled);
setMatteColor(m_matteColor);
setShowRenderStats(m_showRenderStats);
setShadeMode(m_shadeMode);
@@ -301,6 +329,7 @@ void Q3DSViewerSettingsPrivate::setCommandQueue(CommandQueue *queue)
{
m_commandQueue = queue;
if (m_commandQueue) {
+ setMatteEnabled(m_matteEnabled);
setMatteColor(m_matteColor);
setShowRenderStats(m_showRenderStats);
setShadeMode(m_shadeMode);
@@ -317,6 +346,7 @@ void Q3DSViewerSettingsPrivate::save(const QString &group, const QString &organi
m_savedSettings->setValue(QStringLiteral("showRenderStats"), m_showRenderStats);
m_savedSettings->setValue(QStringLiteral("shadeMode"), m_shadeMode);
m_savedSettings->setValue(QStringLiteral("scaleMode"), m_scaleMode);
+ m_savedSettings->setValue(QStringLiteral("matteEnabled"), m_matteEnabled);
}
void Q3DSViewerSettingsPrivate::load(const QString &group, const QString &organization,
@@ -330,6 +360,7 @@ void Q3DSViewerSettingsPrivate::load(const QString &group, const QString &organi
m_savedSettings->value(QStringLiteral("shadeMode")).toInt()));
q_ptr->setScaleMode(Q3DSViewerSettings::ScaleMode(
m_savedSettings->value(QStringLiteral("scaleMode")).toInt()));
+ q_ptr->setMatteEnabled(m_savedSettings->value(QStringLiteral("matteEnabled")).toBool());
}
void Q3DSViewerSettingsPrivate::setMatteColor(const QColor &color)
@@ -343,6 +374,17 @@ void Q3DSViewerSettingsPrivate::setMatteColor(const QColor &color)
}
}
+void Q3DSViewerSettingsPrivate::setMatteEnabled(bool enabled)
+{
+ m_matteEnabled = enabled;
+ if (m_viewerApp) {
+ m_viewerApp->setMatteColor(enabled);
+ } else if (m_commandQueue) {
+ m_commandQueue->m_matteEnabled = enabled;
+ m_commandQueue->m_matteEnabledChanged = true;
+ }
+}
+
void Q3DSViewerSettingsPrivate::setShowRenderStats(bool show)
{
m_showRenderStats = show;
diff --git a/src/api/studio3d/q3dsviewersettings.h b/src/api/studio3d/q3dsviewersettings.h
index 5d7abf6..7199e1c 100644
--- a/src/api/studio3d/q3dsviewersettings.h
+++ b/src/api/studio3d/q3dsviewersettings.h
@@ -45,9 +45,7 @@ class Q_STUDIO3D_EXPORT Q3DSViewerSettings : public QObject
Q_ENUMS(ShadeMode)
Q_ENUMS(ScaleMode)
-// #TODO: QT3DS-3542 Q3DSViewerSettings API is missing property matteEnabled compared to 2.3
-// Q_PROPERTY(bool matteEnabled READ matteEnabled WRITE setMatteEnabled NOTIFY matteEnabledChanged)
-
+ Q_PROPERTY(bool matteEnabled READ matteEnabled WRITE setMatteEnabled NOTIFY matteEnabledChanged)
Q_PROPERTY(QColor matteColor READ matteColor WRITE setMatteColor NOTIFY matteColorChanged)
Q_PROPERTY(bool showRenderStats READ isShowRenderStats WRITE setShowRenderStats NOTIFY showRenderStatsChanged)
Q_PROPERTY(ScaleMode scaleMode READ scaleMode WRITE setScaleMode NOTIFY scaleModeChanged)
@@ -67,6 +65,7 @@ public:
explicit Q3DSViewerSettings(QObject *parent = nullptr);
~Q3DSViewerSettings();
+ bool matteEnabled() const;
QColor matteColor() const;
bool isShowRenderStats() const;
ScaleMode scaleMode() const;
@@ -77,11 +76,13 @@ public:
const QString &application = QString());
public Q_SLOTS:
+ void setMatteEnabled(bool enabled);
void setMatteColor(const QColor &color);
void setShowRenderStats(bool show);
void setScaleMode(ScaleMode mode);
Q_SIGNALS:
+ void matteEnabledChanged(bool enabled);
void matteColorChanged(const QColor &color);
void showRenderStatsChanged(bool show);
void shadeModeChanged(ShadeMode mode);
diff --git a/src/api/studio3d/q3dsviewersettings_p.h b/src/api/studio3d/q3dsviewersettings_p.h
index 48fbae3..4628241 100644
--- a/src/api/studio3d/q3dsviewersettings_p.h
+++ b/src/api/studio3d/q3dsviewersettings_p.h
@@ -62,6 +62,7 @@ public:
void save(const QString &group, const QString &organization, const QString &application);
void load(const QString &group, const QString &organization, const QString &application);
+ void setMatteEnabled(bool enabled);
void setMatteColor(const QColor &color);
void setShowRenderStats(bool show);
void setShadeMode(Q3DSViewerSettings::ShadeMode mode);
@@ -78,6 +79,7 @@ private:
CommandQueue *m_commandQueue; // Not owned
QColor m_matteColor;
bool m_showRenderStats;
+ bool m_matteEnabled;
Q3DSViewerSettings::ShadeMode m_shadeMode;
Q3DSViewerSettings::ScaleMode m_scaleMode;
QSettings *m_savedSettings;
diff --git a/src/api/studio3d/studio3d.pro b/src/api/studio3d/studio3d.pro
index 8b9fbb0..6749a57 100644
--- a/src/api/studio3d/studio3d.pro
+++ b/src/api/studio3d/studio3d.pro
@@ -3,6 +3,8 @@ TARGET = QtStudio3D
include($$PWD/../../commoninclude.pri)
QT += opengl widgets qml
+include($$PWD/doc/doc.pri)
+
qtHaveModule(multimedia) {
DEFINES += PLATFORM_HAS_QT_MULTIMEDIA_LIB
QT += multimedia
diff --git a/src/api/studio3dqml/plugins.qmltypes b/src/api/studio3dqml/plugins.qmltypes
new file mode 100644
index 0000000..bb8f052
--- /dev/null
+++ b/src/api/studio3dqml/plugins.qmltypes
@@ -0,0 +1,438 @@
+import QtQuick.tooling 1.2
+
+// This file describes the plugin-supplied types contained in the library.
+// It is used for QML tooling purposes only.
+//
+// This file was auto-generated by:
+// 'qmlplugindump -nonrelocatable QtStudio3D.OpenGL 2.4'
+
+Module {
+ dependencies: ["QtQuick 2.12"]
+ Component {
+ name: "Q3DSDataInput"
+ prototype: "QObject"
+ exports: ["QtStudio3D.OpenGL/DataInput 2.4"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "name"; type: "string" }
+ Property { name: "value"; type: "QVariant" }
+ Property { name: "max"; type: "float"; isReadonly: true }
+ Property { name: "min"; type: "float"; isReadonly: true }
+ Property { name: "metadataKeys"; type: "QStringList"; isReadonly: true }
+ Method {
+ name: "setName"
+ Parameter { name: "name"; type: "string" }
+ }
+ Method {
+ name: "setValue"
+ Parameter { name: "value"; type: "QVariant" }
+ }
+ Method {
+ name: "metadata"
+ type: "string"
+ Parameter { name: "key"; type: "string" }
+ }
+ }
+ Component {
+ name: "Q3DSDataOutput"
+ prototype: "QObject"
+ exports: ["QtStudio3D.OpenGL/DataOutput 2.4"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "name"; type: "string" }
+ Property { name: "value"; type: "QVariant"; isReadonly: true }
+ Signal {
+ name: "nameChanged"
+ Parameter { name: "newName"; type: "string" }
+ }
+ Signal {
+ name: "valueChanged"
+ Parameter { name: "newValue"; type: "QVariant" }
+ }
+ Method {
+ name: "setName"
+ Parameter { name: "name"; type: "string" }
+ }
+ }
+ Component {
+ name: "Q3DSElement"
+ prototype: "QObject"
+ exports: ["QtStudio3D.OpenGL/Element 2.4"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "elementPath"; type: "string" }
+ Signal {
+ name: "elementPathChanged"
+ Parameter { name: "elementPath"; type: "string" }
+ }
+ Method {
+ name: "setElementPath"
+ Parameter { name: "elementPath"; type: "string" }
+ }
+ Method {
+ name: "setAttribute"
+ Parameter { name: "attributeName"; type: "string" }
+ Parameter { name: "value"; type: "QVariant" }
+ }
+ Method {
+ name: "fireEvent"
+ Parameter { name: "eventName"; type: "string" }
+ }
+ }
+ Component {
+ name: "Q3DSPresentation"
+ prototype: "QObject"
+ Property { name: "source"; type: "QUrl" }
+ Property { name: "variantList"; type: "QStringList" }
+ Property { name: "delayedLoading"; type: "bool" }
+ Property { name: "createdElements"; type: "QStringList"; isReadonly: true }
+ Property { name: "createdMaterials"; type: "QStringList"; isReadonly: true }
+ Property { name: "createdMeshes"; type: "QStringList"; isReadonly: true }
+ Signal {
+ name: "variantListChanged"
+ Parameter { name: "variantList"; type: "QStringList" }
+ }
+ Signal {
+ name: "sourceChanged"
+ Parameter { name: "source"; type: "QUrl" }
+ }
+ Signal {
+ name: "slideEntered"
+ Parameter { name: "elementPath"; type: "string" }
+ Parameter { name: "index"; type: "uint" }
+ Parameter { name: "name"; type: "string" }
+ }
+ Signal {
+ name: "slideExited"
+ Parameter { name: "elementPath"; type: "string" }
+ Parameter { name: "index"; type: "uint" }
+ Parameter { name: "name"; type: "string" }
+ }
+ Signal { name: "dataInputsReady" }
+ Signal { name: "dataOutputsReady" }
+ Signal {
+ name: "customSignalEmitted"
+ Parameter { name: "elementPath"; type: "string" }
+ Parameter { name: "name"; type: "string" }
+ }
+ Signal {
+ name: "delayedLoadingChanged"
+ Parameter { name: "enable"; type: "bool" }
+ }
+ Signal {
+ name: "elementsCreated"
+ Parameter { name: "elementPaths"; type: "QStringList" }
+ Parameter { name: "error"; type: "string" }
+ }
+ Signal {
+ name: "materialsCreated"
+ Parameter { name: "materialNames"; type: "QStringList" }
+ Parameter { name: "error"; type: "string" }
+ }
+ Signal {
+ name: "meshesCreated"
+ Parameter { name: "meshNames"; type: "QStringList" }
+ Parameter { name: "error"; type: "string" }
+ }
+ Method {
+ name: "setSource"
+ Parameter { name: "source"; type: "QUrl" }
+ }
+ Method {
+ name: "setVariantList"
+ Parameter { name: "variantList"; type: "QStringList" }
+ }
+ Method {
+ name: "goToSlide"
+ Parameter { name: "elementPath"; type: "string" }
+ Parameter { name: "index"; type: "uint" }
+ }
+ Method {
+ name: "goToSlide"
+ Parameter { name: "elementPath"; type: "string" }
+ Parameter { name: "name"; type: "string" }
+ }
+ Method {
+ name: "goToSlide"
+ Parameter { name: "elementPath"; type: "string" }
+ Parameter { name: "next"; type: "bool" }
+ Parameter { name: "wrap"; type: "bool" }
+ }
+ Method {
+ name: "goToTime"
+ Parameter { name: "elementPath"; type: "string" }
+ Parameter { name: "time"; type: "float" }
+ }
+ Method {
+ name: "setAttribute"
+ Parameter { name: "elementPath"; type: "string" }
+ Parameter { name: "attributeName"; type: "string" }
+ Parameter { name: "value"; type: "QVariant" }
+ }
+ Method {
+ name: "setPresentationActive"
+ Parameter { name: "id"; type: "string" }
+ Parameter { name: "active"; type: "bool" }
+ }
+ Method {
+ name: "fireEvent"
+ Parameter { name: "elementPath"; type: "string" }
+ Parameter { name: "eventName"; type: "string" }
+ }
+ Method {
+ name: "setGlobalAnimationTime"
+ Parameter { name: "milliseconds"; type: "qlonglong" }
+ }
+ Method {
+ name: "setDataInputValue"
+ Parameter { name: "name"; type: "string" }
+ Parameter { name: "value"; type: "QVariant" }
+ Parameter { name: "valueRole"; type: "Q3DSDataInput::ValueRole" }
+ }
+ Method {
+ name: "setDataInputValue"
+ Parameter { name: "name"; type: "string" }
+ Parameter { name: "value"; type: "QVariant" }
+ }
+ Method { name: "getDataInputs"; type: "QVariantList" }
+ Method {
+ name: "getDataInputs"
+ type: "QVariantList"
+ Parameter { name: "metadataKey"; type: "string" }
+ }
+ Method { name: "getDataOutputs"; type: "QVariantList" }
+ Method {
+ name: "preloadSlide"
+ Parameter { name: "elementPath"; type: "string" }
+ }
+ Method {
+ name: "unloadSlide"
+ Parameter { name: "elementPath"; type: "string" }
+ }
+ }
+ Component {
+ name: "Q3DSPresentationItem"
+ defaultProperty: "qmlChildren"
+ prototype: "Q3DSPresentation"
+ exports: ["QtStudio3D.OpenGL/Presentation 2.4"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "qmlChildren"; type: "QObject"; isList: true; isReadonly: true }
+ Method {
+ name: "appendQmlChildren"
+ Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
+ Parameter { name: "obj"; type: "QObject"; isPointer: true }
+ }
+ }
+ Component {
+ name: "Q3DSQmlStream"
+ defaultProperty: "item"
+ prototype: "QObject"
+ exports: ["QtStudio3D.OpenGL/QmlStream 2.4"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "presentationId"; type: "string" }
+ Property { name: "item"; type: "QQuickItem"; isPointer: true }
+ Signal {
+ name: "presentationIdChanged"
+ Parameter { name: "presentationId"; type: "string" }
+ }
+ Signal {
+ name: "itemChanged"
+ Parameter { name: "item"; type: "QQuickItem"; isPointer: true }
+ }
+ Method {
+ name: "setPresentationId"
+ Parameter { name: "presentationId"; type: "string" }
+ }
+ Method {
+ name: "setItem"
+ Parameter { name: "item"; type: "QQuickItem"; isPointer: true }
+ }
+ }
+ Component {
+ name: "Q3DSSceneElement"
+ prototype: "Q3DSElement"
+ exports: ["QtStudio3D.OpenGL/SceneElement 2.4"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "currentSlideIndex"; type: "int" }
+ Property { name: "previousSlideIndex"; type: "int"; isReadonly: true }
+ Property { name: "currentSlideName"; type: "string" }
+ Property { name: "previousSlideName"; type: "string"; isReadonly: true }
+ Signal {
+ name: "currentSlideIndexChanged"
+ Parameter { name: "currentSlideIndex"; type: "int" }
+ }
+ Signal {
+ name: "previousSlideIndexChanged"
+ Parameter { name: "previousSlideIndex"; type: "int" }
+ }
+ Signal {
+ name: "currentSlideNameChanged"
+ Parameter { name: "currentSlideName"; type: "string" }
+ }
+ Signal {
+ name: "previousSlideNameChanged"
+ Parameter { name: "previousSlideName"; type: "string" }
+ }
+ Method {
+ name: "setCurrentSlideIndex"
+ Parameter { name: "currentSlideIndex"; type: "int" }
+ }
+ Method {
+ name: "setCurrentSlideName"
+ Parameter { name: "currentSlideName"; type: "string" }
+ }
+ Method {
+ name: "goToSlide"
+ Parameter { name: "next"; type: "bool" }
+ Parameter { name: "wrap"; type: "bool" }
+ }
+ Method {
+ name: "goToTime"
+ Parameter { name: "time"; type: "float" }
+ }
+ }
+ Component {
+ name: "Q3DSStudio3D"
+ defaultProperty: "data"
+ prototype: "QQuickFramebufferObject"
+ exports: ["QtStudio3D.OpenGL/Studio3D 2.4"]
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "EventIgnoreFlags"
+ values: {
+ "EnableAllEvents": 0,
+ "IgnoreMouseEvents": 1,
+ "IgnoreWheelEvents": 2,
+ "IgnoreKeyboardEvents": 4,
+ "IgnoreAllInputEvents": 7
+ }
+ }
+ Property { name: "running"; type: "bool"; isReadonly: true }
+ Property { name: "presentation"; type: "Q3DSPresentationItem"; isReadonly: true; isPointer: true }
+ Property { name: "viewerSettings"; type: "Q3DSViewerSettings"; isReadonly: true; isPointer: true }
+ Property { name: "error"; type: "string"; isReadonly: true }
+ Property { name: "ignoredEvents"; type: "EventIgnoreFlags" }
+ Signal { name: "frameUpdate" }
+ Signal {
+ name: "runningChanged"
+ Parameter { name: "initialized"; type: "bool" }
+ }
+ Signal {
+ name: "errorChanged"
+ Parameter { name: "error"; type: "string" }
+ }
+ Signal { name: "presentationReady" }
+ Signal { name: "presentationLoaded" }
+ Method { name: "reset" }
+ }
+ Component {
+ name: "Q3DSSubPresentationSettings"
+ prototype: "QObject"
+ exports: ["QtStudio3D.OpenGL/SubPresentationSettings 2.4"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "qmlStreams"; type: "Q3DSQmlStream"; isList: true; isReadonly: true }
+ }
+ Component {
+ name: "Q3DSViewerSettings"
+ prototype: "QObject"
+ exports: ["QtStudio3D.OpenGL/ViewerSettings 2.4"]
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "ShadeMode"
+ values: {
+ "ShadeModeShaded": 0,
+ "ShadeModeShadedWireframe": 1
+ }
+ }
+ Enum {
+ name: "ScaleMode"
+ values: {
+ "ScaleModeFit": 0,
+ "ScaleModeFill": 1,
+ "ScaleModeCenter": 2
+ }
+ }
+ Property { name: "matteEnabled"; type: "bool" }
+ Property { name: "matteColor"; type: "QColor" }
+ Property { name: "showRenderStats"; type: "bool" }
+ Property { name: "scaleMode"; type: "ScaleMode" }
+ Signal {
+ name: "matteEnabledChanged"
+ Parameter { name: "enabled"; type: "bool" }
+ }
+ Signal {
+ name: "matteColorChanged"
+ Parameter { name: "color"; type: "QColor" }
+ }
+ Signal {
+ name: "showRenderStatsChanged"
+ Parameter { name: "show"; type: "bool" }
+ }
+ Signal {
+ name: "shadeModeChanged"
+ Parameter { name: "mode"; type: "ShadeMode" }
+ }
+ Signal {
+ name: "scaleModeChanged"
+ Parameter { name: "mode"; type: "ScaleMode" }
+ }
+ Method {
+ name: "setMatteEnabled"
+ Parameter { name: "enabled"; type: "bool" }
+ }
+ Method {
+ name: "setMatteColor"
+ Parameter { name: "color"; type: "QColor" }
+ }
+ Method {
+ name: "setShowRenderStats"
+ Parameter { name: "show"; type: "bool" }
+ }
+ Method {
+ name: "setScaleMode"
+ Parameter { name: "mode"; type: "ScaleMode" }
+ }
+ Method {
+ name: "save"
+ Parameter { name: "group"; type: "string" }
+ Parameter { name: "organization"; type: "string" }
+ Parameter { name: "application"; type: "string" }
+ }
+ Method {
+ name: "save"
+ Parameter { name: "group"; type: "string" }
+ Parameter { name: "organization"; type: "string" }
+ }
+ Method {
+ name: "save"
+ Parameter { name: "group"; type: "string" }
+ }
+ Method {
+ name: "load"
+ Parameter { name: "group"; type: "string" }
+ Parameter { name: "organization"; type: "string" }
+ Parameter { name: "application"; type: "string" }
+ }
+ Method {
+ name: "load"
+ Parameter { name: "group"; type: "string" }
+ Parameter { name: "organization"; type: "string" }
+ }
+ Method {
+ name: "load"
+ Parameter { name: "group"; type: "string" }
+ }
+ }
+ Component {
+ name: "QQuickFramebufferObject"
+ defaultProperty: "data"
+ prototype: "QQuickItem"
+ Property { name: "textureFollowsItemSize"; type: "bool" }
+ Property { name: "mirrorVertically"; type: "bool" }
+ Signal {
+ name: "textureFollowsItemSizeChanged"
+ Parameter { type: "bool" }
+ }
+ Signal {
+ name: "mirrorVerticallyChanged"
+ Parameter { type: "bool" }
+ }
+ }
+}
diff --git a/src/api/studio3dqml/q3dspresentationitem.cpp b/src/api/studio3dqml/q3dspresentationitem.cpp
index 6372f2f..4eb7c96 100644
--- a/src/api/studio3dqml/q3dspresentationitem.cpp
+++ b/src/api/studio3dqml/q3dspresentationitem.cpp
@@ -37,50 +37,6 @@
QT_BEGIN_NAMESPACE
-/*!
- \qmltype Presentation
- \instantiates Q3DSPresentationItem
- \inqmlmodule QtStudio3D
- \ingroup OpenGLRuntime
- \inherits Q3DSPresentation
- \keyword Studio3D
-
- \brief Represents a Qt 3D Studio presentation.
-
- This item provides properties and methods for controlling a
- presentation.
-
- Qt 3D Studio supports multiple presentations in one project. There
- is always a main presentation and zero or more
- sub-presentations. The sub-presentations are composed into the
- main presentations either as contents of Qt 3D Studio layers or as
- texture maps.
-
- In the filesystem each presentation corresponds to one \c{.uip}
- presentation file. When present, the \c{.uia} project file ties
- these together by specifying a name for each of the
- (sub-)presentations and specifies which one is the main one.
-
- The \c{.uia} project also defines \l{DataInput}s and
- \l{DataOutput}s that are exported by the presentations.
- \l{DataInput}s provide a way to provide input to the presentation
- to e.g. control a timeline of a subpresentation from code.
- \l{DataOutput}s provide a way to get notified when an attribute
- is changed in the presentation by animation timeline,
- by behavior scripts or by a \l{DataInput}.
-
- The Presentation type handles child objects of the types \l Element, \l
- SceneElement, \l DataInput, and \l SubPresentationSettings specially. These
- will get automatically associated with the presentation and can control
- certain aspects of it from that point on.
-
- From the API point of view Presentation corresponds to the
- main presentation. The source property can refer either to a
- \c{.uia} or \c{.uip} file. When specifying a file with \c{.uip}
- extension and a \c{.uia} is present with the same name, the
- \c{.uia} is loaded automatically and thus sub-presentation
- information is available regardless.
- */
Q3DSPresentationItem::Q3DSPresentationItem(QObject *parent)
: Q3DSPresentation(parent)
, m_subPresentationSettings(nullptr)
diff --git a/src/api/studio3dqml/q3dsrenderer.cpp b/src/api/studio3dqml/q3dsrenderer.cpp
index 7366d6a..e3fce5c 100644
--- a/src/api/studio3dqml/q3dsrenderer.cpp
+++ b/src/api/studio3dqml/q3dsrenderer.cpp
@@ -48,7 +48,8 @@ using namespace Q3DSViewer;
QT_BEGIN_NAMESPACE
-Q3DSRenderer::Q3DSRenderer(bool visibleFlag, qt3ds::Qt3DSAssetVisitor *assetVisitor)
+Q3DSRenderer::Q3DSRenderer(bool visibleFlag, qt3ds::Qt3DSAssetVisitor *assetVisitor,
+ QElapsedTimer *startupTimer)
: m_visibleFlag(visibleFlag)
, m_initElements(false)
, m_runtime(0)
@@ -58,8 +59,9 @@ Q3DSRenderer::Q3DSRenderer(bool visibleFlag, qt3ds::Qt3DSAssetVisitor *assetVisi
, m_visitor(assetVisitor)
, m_settings(new Q3DSViewerSettings(this))
, m_presentation(new Q3DSPresentation(this))
+ , m_startupTimer(startupTimer)
{
- m_startupTimer.start();
+
}
Q3DSRenderer::~Q3DSRenderer()
@@ -170,7 +172,7 @@ void Q3DSRenderer::draw()
bool Q3DSRenderer::initializeRuntime(QOpenGLFramebufferObject *inFbo)
{
- m_runtime = &Q3DSViewerApp::Create(nullptr, new Qt3DSAudioPlayerImpl(), &m_startupTimer);
+ m_runtime = &Q3DSViewerApp::Create(nullptr, new Qt3DSAudioPlayerImpl(), m_startupTimer);
Q_ASSERT(m_runtime);
// Connect presentation ready signal before initializing the app
@@ -286,6 +288,8 @@ void Q3DSRenderer::processCommands()
m_settings->setShowRenderStats(m_commands.m_showRenderStats);
if (m_commands.m_delayedLoadingChanged)
this->m_runtime->setDelayedLoading(m_commands.m_delayedLoading);
+ if (m_commands.m_matteEnabledChanged)
+ this->m_runtime->setMatteEnabled(m_commands.m_matteEnabled);
if (m_commands.m_globalAnimationTimeChanged)
m_presentation->setGlobalAnimationTime(m_commands.m_globalAnimationTime);
diff --git a/src/api/studio3dqml/q3dsrenderer_p.h b/src/api/studio3dqml/q3dsrenderer_p.h
index 6d044ff..8927f34 100644
--- a/src/api/studio3dqml/q3dsrenderer_p.h
+++ b/src/api/studio3dqml/q3dsrenderer_p.h
@@ -59,7 +59,8 @@ class Q3DSRenderer : public QObject,
Q_OBJECT
public:
- Q3DSRenderer(bool visibleFlag, qt3ds::Qt3DSAssetVisitor *assetVisitor);
+ Q3DSRenderer(bool visibleFlag, qt3ds::Qt3DSAssetVisitor *assetVisitor,
+ QElapsedTimer *startupTimer);
~Q3DSRenderer();
QOpenGLFramebufferObject *createFramebufferObject(const QSize &size) override;
@@ -102,7 +103,7 @@ protected:
Q3DSViewerSettings *m_settings;
Q3DSPresentation *m_presentation;
QString m_error;
- QElapsedTimer m_startupTimer;
+ QElapsedTimer *m_startupTimer;
};
QT_END_NAMESPACE
diff --git a/src/api/studio3dqml/q3dsstudio3d.cpp b/src/api/studio3dqml/q3dsstudio3d.cpp
index 5a46089..38d32d4 100644
--- a/src/api/studio3dqml/q3dsstudio3d.cpp
+++ b/src/api/studio3dqml/q3dsstudio3d.cpp
@@ -40,13 +40,14 @@
#include <QtCore/qdebug.h>
#include <QtCore/qfileinfo.h>
#include <QtQuick/qquickwindow.h>
+#include <QtQml/qqmlcontext.h>
QT_BEGIN_NAMESPACE
/*!
\qmltype Studio3D
\instantiates Q3DSStudio3D
- \inqmlmodule QtStudio3D
+ \inqmlmodule QtStudio3D.OpenGL
\ingroup OpenGLRuntime
\inherits Item
\keyword Studio3D
@@ -151,6 +152,8 @@ Q3DSStudio3D::Q3DSStudio3D()
connect(this, &Q3DSStudio3D::visibleChanged, this, &Q3DSStudio3D::handleVisibleChanged);
updateEventMasks();
+ m_startupTimer.reset(new QElapsedTimer());
+ m_startupTimer->restart();
}
Q3DSStudio3D::~Q3DSStudio3D()
@@ -171,10 +174,13 @@ Q3DSPresentationItem *Q3DSStudio3D::presentation() const
return m_presentation;
}
-// #TODO: QT3DS-3566 viewerSettings is missing documentation
/*!
\qmlproperty ViewerSettings Studio3D::viewerSettings
+ Accessor for the viewerSettings. Applications are expected to create a single
+ ViewerSettings child object for Studio3D. If this is omitted, ViewerSettings
+ is created automatically.
+
This property is read-only.
*/
Q3DSViewerSettings *Q3DSStudio3D::viewerSettings() const
@@ -271,7 +277,12 @@ void Q3DSStudio3D::componentComplete()
m_presentation->d_ptr->setCommandQueue(&m_pendingCommands);
// Ensure qml stream proxy gets created on main thread
- m_presentation->d_ptr->streamProxy();
+ QQmlContext *ctx = QQmlEngine::contextForObject(this);
+ m_presentation->d_ptr->streamProxy()->setEngine(ctx->engine());
+
+ QObject::connect(m_presentation, &Q3DSPresentationItem::sourceChanged, [this]() {
+ m_startupTimer->restart();
+ });
QQuickFramebufferObject::componentComplete();
}
@@ -291,6 +302,8 @@ void Q3DSStudio3D::handleWindowChanged(QQuickWindow *window)
connect(window, &QQuickWindow::afterAnimating, this, &Q3DSStudio3D::tick);
// Call update after the frame is handled to queue another frame
connect(window, &QQuickWindow::afterSynchronizing, this, &Q3DSStudio3D::update);
+
+ reset();
}
/*!
@@ -310,9 +323,9 @@ void Q3DSStudio3D::reset()
{
// Fake a source change to trigger a reloading of the presentation
m_pendingCommands.m_sourceChanged = true;
- m_pendingCommands.m_source = m_presentation->source();
+ m_pendingCommands.m_source = m_presentation ? m_presentation->source() : QString();
m_pendingCommands.m_variantListChanged = true;
- m_pendingCommands.m_variantList = m_presentation->variantList();
+ m_pendingCommands.m_variantList = m_presentation ? m_presentation->variantList() : QStringList();
}
/*!
@@ -366,7 +379,8 @@ QQuickFramebufferObject::Renderer *Q3DSStudio3D::createRenderer() const
// It is "illegal" to create a connection between the renderer
// and the plugin, and vice-versa. The only valid time the two
// may communicate is during Q3DSRenderer::synchronize().
- Q3DSRenderer *renderer = new Q3DSRenderer(isVisible(), m_presentation->d_ptr->streamProxy());
+ Q3DSRenderer *renderer = new Q3DSRenderer(isVisible(), m_presentation->d_ptr->streamProxy(),
+ m_startupTimer.get());
connect(renderer, &Q3DSRenderer::enterSlide,
m_presentation->d_ptr, &Q3DSPresentationPrivate::handleSlideEntered);
diff --git a/src/api/studio3dqml/q3dsstudio3d_p.h b/src/api/studio3dqml/q3dsstudio3d_p.h
index eed8459..0fa91d6 100644
--- a/src/api/studio3dqml/q3dsstudio3d_p.h
+++ b/src/api/studio3dqml/q3dsstudio3d_p.h
@@ -45,6 +45,7 @@
#include <QtStudio3D/private/q3dscommandqueue_p.h>
#include <QtGui/qopenglframebufferobject.h>
#include <QtQuick/qquickframebufferobject.h>
+#include <QtCore/qelapsedtimer.h>
QT_BEGIN_NAMESPACE
@@ -128,6 +129,7 @@ protected:
CommandQueue m_pendingCommands;
qreal m_pixelRatio;
QString m_error;
+ QScopedPointer<QElapsedTimer> m_startupTimer;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(Q3DSStudio3D::EventIgnoreFlags)
diff --git a/src/dm/systems/Qt3DSDMStringTable.h b/src/dm/systems/Qt3DSDMStringTable.h
index 7f1e945..fb38b0b 100644
--- a/src/dm/systems/Qt3DSDMStringTable.h
+++ b/src/dm/systems/Qt3DSDMStringTable.h
@@ -31,6 +31,7 @@
#define QT3DS_IMPORT_STRINGTABLE_H
#include <string>
+#include <memory>
#include <EABase/eabase.h>
#include "foundation/Qt3DSPreprocessor.h"
diff --git a/src/engine/Qt3DSRenderRuntimeBindingImplRenderer.cpp b/src/engine/Qt3DSRenderRuntimeBindingImplRenderer.cpp
index b41c83b..0451570 100644
--- a/src/engine/Qt3DSRenderRuntimeBindingImplRenderer.cpp
+++ b/src/engine/Qt3DSRenderRuntimeBindingImplRenderer.cpp
@@ -167,6 +167,7 @@ struct SRenderer : public Q3DStudio::ITegraApplicationRenderEngine
}
void SetMatteColor(Option<QT3DSVec4> inColor) override { m_Context->SetMatteColor(inColor); }
+ void setMatteEnabled(bool enabled) override { m_Context->setMatteEnabled(enabled); };
virtual void PushState() { m_StateStack.push_back(m_Viewport); }
virtual void PopState()
{
diff --git a/src/engine/Qt3DSRenderRuntimeBindingImplTranslation.cpp b/src/engine/Qt3DSRenderRuntimeBindingImplTranslation.cpp
index a4b3bc7..c0b72a6 100644
--- a/src/engine/Qt3DSRenderRuntimeBindingImplTranslation.cpp
+++ b/src/engine/Qt3DSRenderRuntimeBindingImplTranslation.cpp
@@ -1236,21 +1236,22 @@ struct SDynamicObjectTranslatorContext : public STranslatorContext
{
}
~SDynamicObjectTranslatorContext() {}
- void AddEffectExtendedProperty(const qt3ds::render::dynamic::SPropertyDefinition &thePropDef,
- const char *inExtension, Q3DStudio::EAttributeType inType,
- Qt3DSString &ioStringBuilder, QT3DSU32 inOffset, QT3DSU32 dataOffset)
- {
- ioStringBuilder.fromUtf8(thePropDef.m_Name.c_str());
- ioStringBuilder.append(inExtension);
- Q3DStudio::INT32 theHash = Q3DStudio::CHash::HashAttribute(
- ioStringBuilder.toUtf8().constData());
+ void AddEffectExtendedProperty(const QByteArray &baseName,
+ const QByteArray &extension, Q3DStudio::EAttributeType inType,
+ QByteArray &ioStringBuilder, QT3DSU32 inOffset,
+ QT3DSU32 dataOffset)
+ {
+ ioStringBuilder = baseName;
+ ioStringBuilder.append(extension);
+ Q3DStudio::INT32 theHash = Q3DStudio::CHash::HashAttribute(ioStringBuilder.constData());
m_PropertyHashes.insert(
eastl::make_pair(theHash, SEffectPropertyEntry(inType, inOffset, dataOffset)));
}
void BuildPropertyHashes(NVConstDataRef<qt3ds::render::dynamic::SPropertyDefinition> inProperties)
{
if (m_PropertyHashes.size() == 0) {
- qt3ds::foundation::Qt3DSString theNameBuilder;
+ QByteArray nameBuilder;
+ QByteArray baseName;
for (QT3DSU32 idx = 0, end = inProperties.size(); idx < end; ++idx) {
const qt3ds::render::dynamic::SPropertyDefinition &thePropDef = inProperties[idx];
switch (thePropDef.m_DataType) {
@@ -1276,35 +1277,62 @@ struct SDynamicObjectTranslatorContext : public STranslatorContext
}
break;
case qt3ds::render::NVRenderShaderDataTypes::QT3DSVec2:
- AddEffectExtendedProperty(thePropDef, ".x", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, 0);
- AddEffectExtendedProperty(thePropDef, ".y", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, sizeof(QT3DSF32));
+ baseName = QString::fromUtf8(thePropDef.m_Name.c_str()).toUtf8();
+ AddEffectExtendedProperty(baseName, QByteArrayLiteral(".x"),
+ Q3DStudio::ATTRIBUTETYPE_FLOAT, nameBuilder, idx, 0);
+ AddEffectExtendedProperty(baseName, QByteArrayLiteral(".y"),
+ Q3DStudio::ATTRIBUTETYPE_FLOAT, nameBuilder, idx,
+ sizeof(QT3DSF32));
break;
case qt3ds::render::NVRenderShaderDataTypes::QT3DSVec3:
- AddEffectExtendedProperty(thePropDef, ".x", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, 0);
- AddEffectExtendedProperty(thePropDef, ".y", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, sizeof(QT3DSF32));
- AddEffectExtendedProperty(thePropDef, ".z", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, 2 * sizeof(QT3DSF32));
-
- AddEffectExtendedProperty(thePropDef, ".r", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, 0);
- AddEffectExtendedProperty(thePropDef, ".g", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, sizeof(QT3DSF32));
- AddEffectExtendedProperty(thePropDef, ".b", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, 2 * sizeof(QT3DSF32));
+ baseName = QString::fromUtf8(thePropDef.m_Name.c_str()).toUtf8();
+ AddEffectExtendedProperty(baseName, QByteArrayLiteral(".x"),
+ Q3DStudio::ATTRIBUTETYPE_FLOAT,
+ nameBuilder, idx, 0);
+ AddEffectExtendedProperty(baseName, QByteArrayLiteral(".y"),
+ Q3DStudio::ATTRIBUTETYPE_FLOAT,
+ nameBuilder, idx, sizeof(QT3DSF32));
+ AddEffectExtendedProperty(baseName, QByteArrayLiteral(".z"),
+ Q3DStudio::ATTRIBUTETYPE_FLOAT,
+ nameBuilder, idx, 2 * sizeof(QT3DSF32));
+
+ AddEffectExtendedProperty(baseName, QByteArrayLiteral(".r"),
+ Q3DStudio::ATTRIBUTETYPE_FLOAT,
+ nameBuilder, idx, 0);
+ AddEffectExtendedProperty(baseName, QByteArrayLiteral(".g"),
+ Q3DStudio::ATTRIBUTETYPE_FLOAT,
+ nameBuilder, idx, sizeof(QT3DSF32));
+ AddEffectExtendedProperty(baseName, QByteArrayLiteral(".b"),
+ Q3DStudio::ATTRIBUTETYPE_FLOAT,
+ nameBuilder, idx, 2 * sizeof(QT3DSF32));
break;
case qt3ds::render::NVRenderShaderDataTypes::QT3DSVec4:
- AddEffectExtendedProperty(thePropDef, ".x", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, 0);
- AddEffectExtendedProperty(thePropDef, ".y", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, sizeof(QT3DSF32));
- AddEffectExtendedProperty(thePropDef, ".z", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, 2 * sizeof(QT3DSF32));
- AddEffectExtendedProperty(thePropDef, ".w", Q3DStudio::ATTRIBUTETYPE_FLOAT,
- theNameBuilder, idx, 3 * sizeof(QT3DSF32));
+ baseName = QString::fromUtf8(thePropDef.m_Name.c_str()).toUtf8();
+ AddEffectExtendedProperty(baseName, QByteArrayLiteral(".x"),
+ Q3DStudio::ATTRIBUTETYPE_FLOAT,
+ nameBuilder, idx, 0);
+ AddEffectExtendedProperty(baseName, QByteArrayLiteral(".y"),
+ Q3DStudio::ATTRIBUTETYPE_FLOAT,
+ nameBuilder, idx, sizeof(QT3DSF32));
+ AddEffectExtendedProperty(baseName, QByteArrayLiteral(".z"),
+ Q3DStudio::ATTRIBUTETYPE_FLOAT,
+ nameBuilder, idx, 2 * sizeof(QT3DSF32));
+ AddEffectExtendedProperty(baseName, QByteArrayLiteral(".w"),
+ Q3DStudio::ATTRIBUTETYPE_FLOAT,
+ nameBuilder, idx, 3 * sizeof(QT3DSF32));
+
+ AddEffectExtendedProperty(baseName, QByteArrayLiteral(".r"),
+ Q3DStudio::ATTRIBUTETYPE_FLOAT,
+ nameBuilder, idx, 0);
+ AddEffectExtendedProperty(baseName, QByteArrayLiteral(".g"),
+ Q3DStudio::ATTRIBUTETYPE_FLOAT,
+ nameBuilder, idx, sizeof(QT3DSF32));
+ AddEffectExtendedProperty(baseName, QByteArrayLiteral(".b"),
+ Q3DStudio::ATTRIBUTETYPE_FLOAT,
+ nameBuilder, idx, 2 * sizeof(QT3DSF32));
+ AddEffectExtendedProperty(baseName, QByteArrayLiteral(".a"),
+ Q3DStudio::ATTRIBUTETYPE_FLOAT,
+ nameBuilder, idx, 3 * sizeof(QT3DSF32));
break;
case qt3ds::render::NVRenderShaderDataTypes::NVRenderTexture2DPtr:
case qt3ds::render::NVRenderShaderDataTypes::NVRenderImage2DPtr:
diff --git a/src/engine/Qt3DSRuntimeView.cpp b/src/engine/Qt3DSRuntimeView.cpp
index c1f3b3d..90a2562 100644
--- a/src/engine/Qt3DSRuntimeView.cpp
+++ b/src/engine/Qt3DSRuntimeView.cpp
@@ -260,6 +260,7 @@ CRuntimeView::~CRuntimeView()
bool CRuntimeView::BeginLoad(const QString &sourcePath, const QStringList &variantList)
{
bool theResult = false;
+ m_startupTime = -1;
// boot up the application
BootupPreGraphicsInitObjects();
@@ -372,7 +373,7 @@ void CRuntimeView::Render()
m_Application->UpdateAndRender();
- if (m_startupTime < 0 && m_startupTimer) {
+ if (m_startupTime < 0 && m_startupTimer && m_startupTimer->isValid()) {
m_startupTime = m_startupTimer->elapsed();
m_startupTimer->invalidate();
}
diff --git a/src/engine/Qt3DSRuntimeView.h b/src/engine/Qt3DSRuntimeView.h
index 22d8cba..7d86022 100644
--- a/src/engine/Qt3DSRuntimeView.h
+++ b/src/engine/Qt3DSRuntimeView.h
@@ -143,6 +143,7 @@ public:
virtual ITegraRenderStateManager &GetTegraRenderStateManager() = 0;
virtual qt3ds::render::NVRenderContext &GetRenderContext() = 0;
virtual void SetMatteColor(qt3ds::foundation::Option<qt3ds::QT3DSVec4> inColor) = 0;
+ virtual void setMatteEnabled(bool enable) = 0;
virtual void EnableRenderRotation(bool inEnable) = 0;
virtual void SetWriteOutShaderCache(bool inWriteOutShaderCache) = 0;
virtual void Release() = 0;
diff --git a/src/foundation/Qt3DSFoundation.cpp b/src/foundation/Qt3DSFoundation.cpp
index 8687cd6..b08ca19 100644
--- a/src/foundation/Qt3DSFoundation.cpp
+++ b/src/foundation/Qt3DSFoundation.cpp
@@ -44,6 +44,15 @@
#ifdef _WIN32
#pragma warning(disable : 4996) // intentionally suppressing this warning message
#endif
+
+namespace qt3ds {
+void Qt3DSAssert(const char *exp, const char *file, int line, bool *ignore)
+{
+ Q_UNUSED(ignore)
+ qCritical() << "Assertion thrown: " << file << " " << line << " " << exp;
+}
+}
+
namespace qt3ds {
namespace foundation {
using namespace intrinsics;
diff --git a/src/foundation/Qt3DSPreprocessor.h b/src/foundation/Qt3DSPreprocessor.h
index 371d3e6..98b60c6 100644
--- a/src/foundation/Qt3DSPreprocessor.h
+++ b/src/foundation/Qt3DSPreprocessor.h
@@ -175,29 +175,20 @@ static linking
no definition - this will allow DLLs and libraries to use the exported API from PhysXCommon
*/
+#include <qglobal.h>
#if defined(QT3DS_WINDOWS) && !defined(__CUDACC__)
#if defined QT3DS_FOUNDATION_EXPORTS
-#define QT3DS_FOUNDATION_API __declspec(dllexport)
+#define QT3DS_FOUNDATION_API Q_DECL_EXPORT
#elif defined QT3DS_FOUNDATION_NO_EXPORTS
#define QT3DS_FOUNDATION_API
#else
-#define QT3DS_FOUNDATION_API __declspec(dllimport)
+#define QT3DS_FOUNDATION_API Q_DECL_IMPORT
#endif
#else
#define QT3DS_FOUNDATION_API
#endif
-
-#if defined(QT3DS_AUTOTESTS_ENABLED)
-#include <qglobal.h>
-#if defined(QT3DS_BUILDING_LIBRARY)
-#define QT3DS_AUTOTEST_EXPORT Q_DECL_EXPORT
-#else
-#define QT3DS_AUTOTEST_EXPORT Q_DECL_IMPORT
-#endif
-#else
-#define QT3DS_AUTOTEST_EXPORT
-#endif
+#define QT3DS_AUTOTEST_EXPORT QT3DS_FOUNDATION_API
/**
Calling convention
diff --git a/src/foundation/StringTable.cpp b/src/foundation/StringTable.cpp
index 47130dc..7833639 100644
--- a/src/foundation/StringTable.cpp
+++ b/src/foundation/StringTable.cpp
@@ -38,6 +38,8 @@
#include "foundation/SerializationTypes.h"
#include "foundation/Qt3DSMutex.h"
+#include <QtCore/qhash.h>
+
using namespace qt3ds;
using namespace qt3ds::foundation;
using namespace eastl;
@@ -317,6 +319,16 @@ public:
return theFind->second;
}
+ SCharAndHandle justFindStrDontRegister(SCharAndHash hashCode)
+ {
+ if (isTrivial(hashCode.m_Data))
+ return SCharAndHandle();
+ TMapType::iterator theFind = m_HashToStrMap.find(hashCode);
+ if (theFind == m_HashToStrMap.end())
+ return SCharAndHandle();
+ return theFind->second;
+ }
+
const CRegisteredString FindStr(SCharAndHash hashCode)
{
SCharAndHandle result = DoFindStr(hashCode);
@@ -527,6 +539,8 @@ struct SStringTableMutexScope
#define STRING_TABLE_MULTITHREADED_METHOD SStringTableMutexScope __locker(m_MultithreadMutex)
+static const QT3DSU32 dynHandleBase = 0x80000000;
+
class StringTable : public IStringTable
{
typedef nvhash_map<SCharAndHash, QT3DSU32> TMapType;
@@ -539,6 +553,18 @@ class StringTable : public IStringTable
TWideStr m_WideConvertBuffer;
Mutex m_MultithreadMutexBacker;
Mutex *m_MultithreadMutex;
+
+ struct DynamicString
+ {
+ QByteArray str;
+ int refCount = 0;
+ };
+
+ QHash<QT3DSU32, DynamicString *> m_dynamicFreeHandlesMap;
+ QHash<QT3DSU32, DynamicString *> m_dynamicUsedHandlesMap;
+ QHash<QByteArray, QT3DSU32> m_dynamicStringToHandleMap;
+ QT3DSU32 m_nextFreeDynamicHandle = dynHandleBase;
+
// Data that will be written out to the file.
public:
@@ -554,7 +580,11 @@ public:
{
}
- virtual ~StringTable() override {}
+ virtual ~StringTable() override
+ {
+ qDeleteAll(m_dynamicFreeHandlesMap);
+ qDeleteAll(m_dynamicUsedHandlesMap);
+ }
QT3DS_IMPLEMENT_REF_COUNT_ADDREF_RELEASE_OVERRIDE(m_FileData.m_Allocator.m_Allocator)
@@ -630,10 +660,59 @@ public:
return m_FileData.FindStrHandle(str);
}
+ CStringHandle getDynamicHandle(const QByteArray &str) override
+ {
+ STRING_TABLE_MULTITHREADED_METHOD;
+ QT3DSU32 handle = m_dynamicStringToHandleMap.value(str, 0);
+ DynamicString *theStr = nullptr;
+
+ if (!handle) {
+ handle = m_FileData.justFindStrDontRegister(str.constData()).m_Handle;
+ if (!handle) {
+ if (m_dynamicFreeHandlesMap.isEmpty()) {
+ handle = ++m_nextFreeDynamicHandle;
+ theStr = new DynamicString;
+ } else {
+ auto first = m_dynamicFreeHandlesMap.begin();
+ handle = first.key();
+ theStr = first.value();
+ m_dynamicFreeHandlesMap.erase(first);
+ }
+ theStr->str = str;
+ m_dynamicStringToHandleMap.insert(str, handle);
+ m_dynamicUsedHandlesMap.insert(handle, theStr);
+ } else {
+ return CStringHandle::ISwearThisHasBeenRegistered(handle);
+ }
+ } else {
+ theStr = m_dynamicUsedHandlesMap.value(handle);
+ }
+ ++theStr->refCount;
+ return CStringHandle::ISwearThisHasBeenRegistered(handle);
+ }
+
+ void releaseDynamicHandle(QT3DSU32 strHandle) override
+ {
+ DynamicString *str = m_dynamicUsedHandlesMap.value(strHandle);
+ if (str) {
+ --str->refCount;
+ if (str->refCount == 0) {
+ m_dynamicUsedHandlesMap.remove(strHandle);
+ m_dynamicFreeHandlesMap.insert(strHandle, str);
+ m_dynamicStringToHandleMap.remove(str->str);
+ }
+ }
+ }
+
CRegisteredString HandleToStr(QT3DSU32 strHandle) override
{
STRING_TABLE_MULTITHREADED_METHOD;
- return m_FileData.FindStrByHandle(strHandle);
+ if (strHandle >= dynHandleBase) {
+ DynamicString *str = m_dynamicUsedHandlesMap.value(strHandle);
+ return CRegisteredString::ISwearThisHasBeenRegistered(str->str.constData());
+ } else {
+ return m_FileData.FindStrByHandle(strHandle);
+ }
}
const wchar_t *GetWideStr(CRegisteredString theStr)
diff --git a/src/foundation/StringTable.h b/src/foundation/StringTable.h
index d46c111..8f7fa84 100644
--- a/src/foundation/StringTable.h
+++ b/src/foundation/StringTable.h
@@ -248,6 +248,8 @@ namespace foundation {
virtual CRegisteredString RegisterStr(const char32_t *str) = 0;
virtual CStringHandle GetHandle(Qt3DSBCharPtr str) = 0;
+ virtual CStringHandle getDynamicHandle(const QByteArray &str) = 0;
+ virtual void releaseDynamicHandle(QT3DSU32 strHandle) = 0;
virtual CRegisteredString HandleToStr(QT3DSU32 strHandle) = 0;
virtual CRegisteredString RegisterStr(const wchar_t *str) = 0;
diff --git a/src/foundation/qt/formatdiscovery.cpp b/src/foundation/qt/formatdiscovery.cpp
index 7ea762b..0a4bcbd 100644
--- a/src/foundation/qt/formatdiscovery.cpp
+++ b/src/foundation/qt/formatdiscovery.cpp
@@ -104,22 +104,22 @@ static QSurfaceFormat findIdealGLESVersion()
return fmt;
}
+static QSurfaceFormat s_f;
+
QSurfaceFormat surfaceFormat()
{
- static const QSurfaceFormat f = [] {
- QSurfaceFormat fmt;
+ if (s_f.renderableType() == QSurfaceFormat::DefaultRenderableType) {
// works in dynamic gl builds too because there's a qguiapp already
// this requirement is also a problem, see QT3DS-3603
if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL)
- fmt = findIdealGLVersion();
+ s_f = findIdealGLVersion();
else
- fmt = findIdealGLESVersion();
- fmt.setDepthBufferSize(24);
- fmt.setStencilBufferSize(8);
+ s_f = findIdealGLESVersion();
+ s_f.setDepthBufferSize(24);
+ s_f.setStencilBufferSize(8);
// Ignore MSAA here as that is a per-layer setting.
- return fmt;
- }();
- return f;
+ }
+ return s_f;
}
} // End namespace Q3DS
diff --git a/src/ogl-runtime-dylib/ogl-runtime-dylib.pro b/src/ogl-runtime-dylib/ogl-runtime-dylib.pro
index 6cafa4c..264830f 100644
--- a/src/ogl-runtime-dylib/ogl-runtime-dylib.pro
+++ b/src/ogl-runtime-dylib/ogl-runtime-dylib.pro
@@ -28,7 +28,7 @@ HEADERS += \
../viewer/Qt3DSViewerApp.h \
../viewer/Qt3DSViewerTimer.h
-linux|qnx|mingw {
+linux|qnx {
BEGIN_ARCHIVE = -Wl,--whole-archive
END_ARCHIVE = -Wl,--no-whole-archive
}
@@ -46,9 +46,17 @@ STATICRUNTIME = \
QMAKE_LFLAGS += $$STATICRUNTIME
LIBS += -lqt3dsqmlstreamer$$qtPlatformTargetSuffix()
} else {
- LIBS += \
- $$STATICRUNTIME \
- -lqt3dsqmlstreamer$$qtPlatformTargetSuffix()
+ mingw {
+ LIBS += \
+ -lqt3dsruntimestatic$$qtPlatformTargetSuffix() \
+ -lEASTL$$qtPlatformTargetSuffix() \
+ -lQT3DSDM$$qtPlatformTargetSuffix() \
+ -lqt3dsqmlstreamer$$qtPlatformTargetSuffix()
+ } else {
+ LIBS += \
+ $$STATICRUNTIME \
+ -lqt3dsqmlstreamer$$qtPlatformTargetSuffix()
+ }
}
win32 {
diff --git a/src/ogl-runtime-static/ogl-runtime-static.pro b/src/ogl-runtime-static/ogl-runtime-static.pro
index 8b2c95a..09b6c89 100644
--- a/src/ogl-runtime-static/ogl-runtime-static.pro
+++ b/src/ogl-runtime-static/ogl-runtime-static.pro
@@ -17,6 +17,17 @@ DEFINES += QT3DS_BUILDING_LIBRARY DISABLE_MESH_OPTIMIZATION
QT += qml
QT += quick-private
+mingw {
+ win32 {
+ LIBS += \
+ -lWs2_32 \
+ }
+ LIBS += \
+ -lEASTL$$qtPlatformTargetSuffix() \
+ -lQT3DSDM$$qtPlatformTargetSuffix() \
+ -lqt3dsqmlstreamer$$qtPlatformTargetSuffix()
+}
+
# Foundation
SOURCES += \
../foundation/ConvertUTF.cpp \
diff --git a/src/qmlstreamer/q3dsqmlstream.cpp b/src/qmlstreamer/q3dsqmlstream.cpp
index e1b9e85..c0dc6a2 100644
--- a/src/qmlstreamer/q3dsqmlstream.cpp
+++ b/src/qmlstreamer/q3dsqmlstream.cpp
@@ -32,7 +32,7 @@
/*!
\qmltype QmlStream
\instantiates Q3DSQmlStream
- \inqmlmodule Qt3DStudio
+ \inqmlmodule QtStudio3D.OpenGL
\ingroup OpenGLRuntime
\brief Allows streaming of QML as subpresentation.
@@ -43,12 +43,10 @@
\inmodule OpenGLRuntime
\since Qt 3D Studio 2.0
\brief Allows streaming of QML as subpresentation.
- \param parent
*/
/*!
- * \brief Q3DSQmlStream::Q3DSQmlStream Constructor
- * \param parent Optional parent object.
+ Constructs a Q3DSQmlStream object with \a parent as parent.
*/
Q3DSQmlStream::Q3DSQmlStream(QObject *parent)
: QObject(parent)
@@ -56,9 +54,6 @@ Q3DSQmlStream::Q3DSQmlStream(QObject *parent)
{
}
-/*!
- * \brief Q3DSQmlStream::~Q3DSQmlStream Destructor.
- */
Q3DSQmlStream::~Q3DSQmlStream()
{
}
diff --git a/src/qmlstreamer/q3dsqmlsubpresentationsettings.cpp b/src/qmlstreamer/q3dsqmlsubpresentationsettings.cpp
index bde5ad3..664b9e4 100644
--- a/src/qmlstreamer/q3dsqmlsubpresentationsettings.cpp
+++ b/src/qmlstreamer/q3dsqmlsubpresentationsettings.cpp
@@ -33,9 +33,9 @@
/*!
\qmltype SubPresentationSettings
\instantiates Q3DSSubPresentationSettings
- \inqmlmodule Qt3DStudio
+ \inqmlmodule QtStudio3D.OpenGL
\ingroup OpenGLRuntime
- \brief
+ \brief Settings for subpresentations.
\sa Studio3D, Presentation, QmlStream
*/
@@ -44,7 +44,6 @@
\inmodule OpenGLRuntime
\since Qt 3D Studio 2.0
\brief Settings for subpresentations.
- \param parent
\sa Q3DSPresentation, Q3DSQmlStream
*/
@@ -71,6 +70,9 @@ QQmlListProperty<Q3DSQmlStream> Q3DSSubPresentationSettings::qmlStreams()
return QQmlListProperty<Q3DSQmlStream>(this, m_list);
}
+/*!
+ Returns the list of QML streams to be used as subpresentations.
+*/
QList<Q3DSQmlStream *> Q3DSSubPresentationSettings::qmlStreamsList()
{
return m_list;
diff --git a/src/runtime/Qt3DSActivationManager.cpp b/src/runtime/Qt3DSActivationManager.cpp
index 3d05274..1449f6e 100644
--- a/src/runtime/Qt3DSActivationManager.cpp
+++ b/src/runtime/Qt3DSActivationManager.cpp
@@ -45,6 +45,7 @@
#include "foundation/Qt3DSMutex.h"
#include "foundation/Qt3DSSync.h"
#include "Qt3DSRenderThreadPool.h"
+#include "foundation/Qt3DSSimpleTypes.h"
using namespace qt3ds::runtime;
using namespace qt3ds::runtime::element;
@@ -405,7 +406,9 @@ struct STimeContext
if (inNode.DoesParticipateInTimeGraph()) {
UpdateNodeElementInformation(inNode);
if (inNode.IsUserActive()) {
- inGlobalMin = NVMax(inNode.m_ActivationManagerNode.m_StartTime, inGlobalMin);
+ // Start time does not get updated if the element doesn't have ATTRIBUTE_STARTTIME.
+ if (inNode.m_ActivationManagerNode.m_StartTime != QT3DS_MAX_U32)
+ inGlobalMin = NVMax(inNode.m_ActivationManagerNode.m_StartTime, inGlobalMin);
inGlobalMax = NVMin(inNode.m_ActivationManagerNode.m_StopTime, inGlobalMax);
if (inGlobalMin < inGlobalMax) {
GetTimeEventForTime(inGlobalMin, STimeEvent::Start)
diff --git a/src/runtime/Qt3DSApplication.cpp b/src/runtime/Qt3DSApplication.cpp
index baa94dd..d215e2f 100644
--- a/src/runtime/Qt3DSApplication.cpp
+++ b/src/runtime/Qt3DSApplication.cpp
@@ -338,8 +338,10 @@ struct STextureUploadRenderTask : public IRenderTask, public IImageLoadListener
sourcePaths.push_back(m_bufferManager.GetStringTable().RegisterStr(s));
QT3DSU32 id = m_batchLoader.LoadImageBatch(sourcePaths, CRegisteredString(),
this, m_type, m_preferKtx, false);
- if (id)
+ if (id) {
m_batches[id] = m_uploadSet;
+ m_uploadSet.clear();
+ }
}
if (!m_uploadWaitSet.isEmpty()) {
nvvector<CRegisteredString> sourcePaths(m_bufferManager.GetStringTable().GetAllocator(),
@@ -351,9 +353,11 @@ struct STextureUploadRenderTask : public IRenderTask, public IImageLoadListener
if (id) {
m_batchLoader.BlockUntilLoaded(id);
m_bufferManager.loadSet(m_uploadWaitSet);
+ m_uploadWaitSet.clear();
}
}
- m_bufferManager.unloadSet(m_deleteSet);
+ if (!m_deleteSet.isEmpty())
+ m_bufferManager.unloadSet(m_deleteSet);
}
void add(const QSet<QString> &set, bool wait)
{
@@ -1619,8 +1623,10 @@ struct SApp : public IApplication
// else assume main presentation and component:slide
}
component = presentation->GetRoot();
- if (!componentName.isNull() && componentName != component->m_Name)
- component = component->FindChild(CHash::HashString(qPrintable(componentName)));
+ if (!componentName.isNull() && componentName != component->m_Name) {
+ component = CQmlElementHelper::GetElement(*this, presentation,
+ qPrintable(componentName), nullptr);
+ }
if (!component) {
qCWarning(WARNING) << "Could not find slide: " << elementPath;
return false;
diff --git a/src/runtime/Qt3DSApplication.h b/src/runtime/Qt3DSApplication.h
index f38b182..510845e 100644
--- a/src/runtime/Qt3DSApplication.h
+++ b/src/runtime/Qt3DSApplication.h
@@ -89,6 +89,11 @@ struct DataInOutAttribute
QByteArray elementPath;
QVector<QByteArray> attributeName;
Q3DStudio::EAttributeType propertyType = Q3DStudio::ATTRIBUTETYPE_NONE;
+
+ bool operator==(const DataInOutAttribute &inOther) const {
+ return (inOther.elementPath == elementPath && inOther.attributeName == attributeName
+ && inOther.propertyType == propertyType);
+ }
};
enum DataInOutType {
diff --git a/src/runtime/Qt3DSElementSystem.cpp b/src/runtime/Qt3DSElementSystem.cpp
index d8e1833..f77bac5 100644
--- a/src/runtime/Qt3DSElementSystem.cpp
+++ b/src/runtime/Qt3DSElementSystem.cpp
@@ -162,11 +162,17 @@ struct SElementAllocator : public qt3ds::runtime::IElementAllocator
m_TempPropertyDescs.clear();
bool participatesInTimeGraph = false;
GetIgnoredProperties();
+ const bool isImage = inType == m_StringTable.RegisterStr("Image");
for (QT3DSU32 idx = 0, end = inPropertyDescriptions.size(); idx < end; ++idx) {
QT3DSU32 nameHash = inPropertyDescriptions[idx].first.GetNameHash();
- if (nameHash == Q3DStudio::ATTRIBUTE_STARTTIME
- || nameHash == Q3DStudio::ATTRIBUTE_ENDTIME)
+ // Make image instances explicitly not participate in the timegraph. This way their
+ // default start/end time does not have impact into lifetimes of their parents.
+ // This fixes QT3DS-3669 where image default end time overrode parent endtime when
+ // element active status was considered.
+ if ((nameHash == Q3DStudio::ATTRIBUTE_STARTTIME
+ || nameHash == Q3DStudio::ATTRIBUTE_ENDTIME) && !isImage) {
participatesInTimeGraph = true;
+ }
if (eastl::find(m_IgnoredProperties.begin(), m_IgnoredProperties.end(),
inPropertyDescriptions[idx].first.m_Name)
== m_IgnoredProperties.end()) {
@@ -637,36 +643,44 @@ void SElement::SetAttribute(const Q3DStudio::TAttributeHash inKey,
const Q3DStudio::UVariant inValue)
{
Option<TPropertyDescAndValuePtr> existing = FindProperty(inKey);
- if (existing.hasValue() == false)
+ if (existing.hasValue() == false) {
+ if (Q3DStudio::ATTRIBUTE_EYEBALL == inKey)
+ SetFlag(Q3DStudio::ELEMENTFLAG_EXPLICITACTIVE, inValue.m_INT32 ? true : false);
return;
+ }
SetAttribute(*existing, inValue);
}
-void SElement::SetAttribute(TPropertyDescAndValuePtr inKey, const Q3DStudio::UVariant inValue)
+void SElement::SetAttribute(TPropertyDescAndValuePtr inKey, const Q3DStudio::UVariant inValue,
+ bool forceSet)
{
Q3DStudio::EAttributeType theType = inKey.first.m_Type;
Q3DStudio::UVariant *currentValue = inKey.second;
QT3DSU32 attHash = inKey.first.GetNameHash();
- switch (theType) {
- case Q3DStudio::ATTRIBUTETYPE_FLOAT: // Early return
- if (fabs(currentValue->m_FLOAT - inValue.m_FLOAT) < SmallestDifference())
- return;
- break;
- case Q3DStudio::ATTRIBUTETYPE_FLOAT3: // Early return
- if (fabs(currentValue->m_FLOAT3[0] - inValue.m_FLOAT3[0]) < SmallestDifference()
- && fabs(currentValue->m_FLOAT3[1] - inValue.m_FLOAT3[1]) < SmallestDifference()
- && fabs(currentValue->m_FLOAT3[2] - inValue.m_FLOAT3[2]) < SmallestDifference()) {
- return;
+ if (!forceSet) {
+ switch (theType) {
+ case Q3DStudio::ATTRIBUTETYPE_FLOAT: // Early return
+ if (fabs(currentValue->m_FLOAT - inValue.m_FLOAT) < SmallestDifference())
+ return;
+ break;
+ case Q3DStudio::ATTRIBUTETYPE_FLOAT3: // Early return
+ if (fabs(currentValue->m_FLOAT3[0] - inValue.m_FLOAT3[0]) < SmallestDifference()
+ && fabs(currentValue->m_FLOAT3[1] - inValue.m_FLOAT3[1]) < SmallestDifference()
+ && fabs(currentValue->m_FLOAT3[2] - inValue.m_FLOAT3[2]) < SmallestDifference()) {
+ return;
+ }
+ break;
+ case Q3DStudio::ATTRIBUTETYPE_STRING:
+ if (currentValue->m_StringHandle == inValue.m_StringHandle)
+ return;
+ m_BelongedPresentation->GetStringTable().releaseDynamicHandle(
+ currentValue->m_StringHandle);
+ break;
+ default: // Early return
+ if (Q3DStudio::ATTRIBUTE_EYEBALL != attHash && currentValue->m_INT32 == inValue.m_INT32)
+ return;
+ break;
}
- break;
- case Q3DStudio::ATTRIBUTETYPE_STRING:
- if (currentValue->m_StringHandle == inValue.m_StringHandle)
- return;
- break;
- default: // Early return
- if (currentValue->m_INT32 == inValue.m_INT32)
- return;
- break;
}
*currentValue = inValue;
@@ -764,10 +778,19 @@ void SElement::SetFlag(Q3DStudio::EElementFlag inFlag, bool inValue)
bool existing = m_Flags & inFlag;
if (existing != inValue && HasActivityZone()) {
m_Flags.clearOrSet(inValue, inFlag);
- if (inFlag == Q3DStudio::ELEMENTFLAG_EXPLICITACTIVE)
+ if (inFlag == Q3DStudio::ELEMENTFLAG_EXPLICITACTIVE) {
GetActivityZone().UpdateItemInfo(*this);
- else if (inFlag == Q3DStudio::ELEMENTFLAG_SCRIPTCALLBACKS)
+ if (IsComponent()) {
+ SElement *parent = m_Parent;
+ // Get out parent component
+ while (parent && parent->m_Parent && !parent->IsComponent())
+ parent = parent->m_Parent;
+ if (parent)
+ parent->GetActivityZone().UpdateItemInfo(*parent);
+ }
+ } else if (inFlag == Q3DStudio::ELEMENTFLAG_SCRIPTCALLBACKS) {
GetActivityZone().UpdateItemScriptStatus(*this);
+ }
SetDirty();
}
}
diff --git a/src/runtime/Qt3DSElementSystem.h b/src/runtime/Qt3DSElementSystem.h
index 12ebebd..6e61a02 100644
--- a/src/runtime/Qt3DSElementSystem.h
+++ b/src/runtime/Qt3DSElementSystem.h
@@ -322,7 +322,8 @@ namespace runtime {
void SetAttribute(const Q3DStudio::TAttributeHash inKey,
const Q3DStudio::UVariant inValue);
// Triggers updating various subcomponents without requiring a new property lookup.
- void SetAttribute(TPropertyDescAndValuePtr inKey, const Q3DStudio::UVariant inNewValue);
+ void SetAttribute(TPropertyDescAndValuePtr inKey, const Q3DStudio::UVariant inNewValue,
+ bool forceSet = false);
// Q3DStudio::CHash::HashAttribute
Option<QT3DSU32> FindPropertyIndex(QT3DSU32 inNameHash) const;
diff --git a/src/runtime/Qt3DSQmlElementHelper.cpp b/src/runtime/Qt3DSQmlElementHelper.cpp
index 9b58a73..0a13a1f 100644
--- a/src/runtime/Qt3DSQmlElementHelper.cpp
+++ b/src/runtime/Qt3DSQmlElementHelper.cpp
@@ -150,10 +150,11 @@ TElement *CQmlElementHelper::GetElement(qt3ds::runtime::IApplication &inApplicat
}
bool CQmlElementHelper::SetAttribute(TElement *theElement, const char *theAttName,
- const void *value, bool inDelay)
+ const void *value)
{
SAttributeKey theAttributeKey;
theAttributeKey.m_Hash = CHash::HashAttribute(theAttName);
+ bool force = false;
// Early out for our single 'read only' attribute
if (ATTRIBUTE_URI == theAttributeKey.m_Hash) {
@@ -165,7 +166,8 @@ bool CQmlElementHelper::SetAttribute(TElement *theElement, const char *theAttNam
Option<qt3ds::runtime::element::TPropertyDescAndValuePtr> thePropertyInfo =
theElement->FindProperty(theAttributeKey.m_Hash);
- if (!thePropertyInfo.hasValue()) {
+ // Do not create property for eyeball, it uses the explicit activity flag
+ if (!thePropertyInfo.hasValue() && theAttributeKey.m_Hash != Q3DStudio::ATTRIBUTE_EYEBALL) {
// if not search in the dynamic properties
thePropertyInfo = theElement->FindDynamicProperty(theAttributeKey.m_Hash);
if (!thePropertyInfo.hasValue()) {
@@ -178,10 +180,15 @@ bool CQmlElementHelper::SetAttribute(TElement *theElement, const char *theAttNam
theElement->GetBelongedPresentation()->GetApplication().GetMetaData();
thePropertyInfo = theElemAllocator.CreateDynamicProperty(
theMetaData, *theElement, theStringTable.RegisterStr(theAttName));
+ force = true;
}
}
- if (thePropertyInfo.hasValue()) {
+ if (theAttributeKey.m_Hash == Q3DStudio::ATTRIBUTE_EYEBALL) {
+ UVariant theNewValue;
+ theNewValue.m_INT32 = *(INT32 *)value;
+ theElement->SetAttribute(theAttributeKey.m_Hash, theNewValue);
+ } else if (thePropertyInfo.hasValue()) {
UVariant theNewValue;
QString name(thePropertyInfo->first.m_Name.c_str());
EAttributeType theAttributeType = thePropertyInfo->first.m_Type;
@@ -203,8 +210,8 @@ bool CQmlElementHelper::SetAttribute(TElement *theElement, const char *theAttNam
case ATTRIBUTETYPE_STRING:
theNewValue.m_StringHandle =
- theElement->GetBelongedPresentation()->GetStringTable().GetHandle(
- (const char *)value);
+ theElement->GetBelongedPresentation()->GetStringTable().getDynamicHandle(
+ QByteArray(static_cast<const char *>(value)));
break;
case ATTRIBUTETYPE_POINTER:
@@ -239,15 +246,7 @@ bool CQmlElementHelper::SetAttribute(TElement *theElement, const char *theAttNam
break;
}
- if (inDelay) {
- UVariant arg1;
- arg1.m_INT32 = theAttributeKey.m_Hash;
- theElement->GetBelongedPresentation()->FireCommand(
- COMMAND_SETPROPERTY, theElement, &arg1, &theNewValue, ATTRIBUTETYPE_HASH,
- theAttributeType);
- } else {
- theElement->SetAttribute(*thePropertyInfo, theNewValue);
- }
+ theElement->SetAttribute(*thePropertyInfo, theNewValue, force);
} else {
return false;
}
@@ -266,7 +265,10 @@ bool CQmlElementHelper::GetAttribute(TElement *inElement, const char *inAttribut
if (!thePropertyInfo.hasValue())
thePropertyInfo = inElement->FindDynamicProperty(theAttributeKey.m_Hash);
- if (thePropertyInfo.hasValue()) {
+ if (theAttributeKey.m_Hash == Q3DStudio::ATTRIBUTE_EYEBALL) {
+ INT32 val = inElement->IsExplicitActive() ? 1 : 0;
+ *(INT32 *)value = val;
+ } else if (thePropertyInfo.hasValue()) {
UVariant *theValuePtr = thePropertyInfo->second;
EAttributeType theAttributeType = thePropertyInfo->first.m_Type;
switch (theAttributeType) {
diff --git a/src/runtime/Qt3DSQmlElementHelper.h b/src/runtime/Qt3DSQmlElementHelper.h
index ec36c8e..c7b2b08 100644
--- a/src/runtime/Qt3DSQmlElementHelper.h
+++ b/src/runtime/Qt3DSQmlElementHelper.h
@@ -48,8 +48,7 @@ public:
IPresentation *inDefaultPresentation, const char *inPath,
TElement *inStartElement = NULL);
- static bool SetAttribute(TElement *inElement, const char *inAttribute, const void *value,
- bool inDelay);
+ static bool SetAttribute(TElement *inElement, const char *inAttribute, const void *value);
static bool GetAttribute(TElement *inElement, const char *inAttribute, void *value);
};
}
diff --git a/src/runtime/Qt3DSQmlEngine.cpp b/src/runtime/Qt3DSQmlEngine.cpp
index ac958ea..b9b2067 100644
--- a/src/runtime/Qt3DSQmlEngine.cpp
+++ b/src/runtime/Qt3DSQmlEngine.cpp
@@ -389,6 +389,9 @@ private:
QMap<QString, QQmlComponent *> m_components;
QVector<Q3DSQmlScript *> m_scripts;
+ QSet<int> m_availableIds;
+ QHash<TElement *, int> m_elementIdMap;
+
public:
CQmlEngineImpl(NVFoundationBase &fnd, ITimeProvider &inTimeProvider);
@@ -474,10 +477,14 @@ private:
TElement *getTarget(const char *component);
void listAllElements(TElement *root, QList<TElement *> &elements);
void initializeDataInputsInPresentation(CPresentation &presentation, bool isPrimary,
+ bool isDynamicAdd = false,
QList<TElement *> inElements = QList<TElement *>());
void initializeDataOutputsInPresentation(CPresentation &presentation, bool isPrimary);
+ void removeDataInputControl(const QVector<TElement *> &inElements);
// Splits down vector attributes to components as Runtime does not really
// handle vectors at this level anymore
+ bool getAttributeVector4(QVector<QByteArray> &outAttVec, const QByteArray &attName,
+ TElement *elem);
bool getAttributeVector3(QVector<QByteArray> &outAttVec, const QByteArray &attName,
TElement *elem);
bool getAttributeVector2(QVector<QByteArray> &outAttVec, const QByteArray &attName,
@@ -532,6 +539,8 @@ private:
void notifyMaterialCreation(const QStringList &materialNames, const QString &error);
void deleteElements(const QVector<TElement *> &elements,
qt3ds::render::IQt3DSRenderer *renderer);
+ int getAvailableId();
+ void releaseId(int id);
};
CQmlEngineImpl::CQmlEngineImpl(NVFoundationBase &fnd, ITimeProvider &)
@@ -595,7 +604,7 @@ void CQmlEngineImpl::SetAttribute(TElement *target, const char *attName, const c
{
QML_ENGINE_MULTITHREAD_PROTECT_METHOD;
if (target) {
- bool success = CQmlElementHelper::SetAttribute(target, attName, value, false);
+ bool success = CQmlElementHelper::SetAttribute(target, attName, value);
if (!success) {
qCCritical(qt3ds::INVALID_OPERATION)
<< "CQmlEngineImpl::SetAttribute: "
@@ -611,7 +620,7 @@ void CQmlEngineImpl::SetAttribute(const char *element, const char *attName, cons
TElement *theTarget = getTarget(element);
if (theTarget) {
- bool success = CQmlElementHelper::SetAttribute(theTarget, attName, value, false);
+ bool success = CQmlElementHelper::SetAttribute(theTarget, attName, value);
if (!success) {
qCCritical(qt3ds::INVALID_OPERATION)
<< "CQmlEngineImpl::SetAttribute: "
@@ -929,8 +938,6 @@ void CQmlEngineImpl::SetDataInputValue(
}
}
-static int _idCounter = 0;
-
void CQmlEngineImpl::createElements(const QString &parentElementPath, const QString &slideName,
const QVector<QHash<QString, QVariant>> &properties,
qt3ds::render::IQt3DSRenderer *renderer)
@@ -944,13 +951,15 @@ void CQmlEngineImpl::createElements(const QString &parentElementPath, const QStr
elementPaths.reserve(properties.size());
QVector<QHash<QString, QVariant>> theProperties = properties;
const QString namePropName = QStringLiteral("name");
+ QVector<int> idNumbers(theProperties.size());
for (int i = 0; i < theProperties.size(); ++i) {
auto &props = theProperties[i];
QString newElementName = props.value(namePropName).toString();
+ idNumbers[i] = getAvailableId();
if (newElementName.isEmpty()) {
// The id number on generated name will match generated graph object identifiers
- newElementName = QStringLiteral("NewElement_%1").arg(_idCounter + i + 1);
+ newElementName = QStringLiteral("NewElement_%1").arg(idNumbers[i]);
props.insert(namePropName, newElementName);
}
elementPaths << parentElementPath + QLatin1Char('.') + newElementName;
@@ -959,8 +968,11 @@ void CQmlEngineImpl::createElements(const QString &parentElementPath, const QStr
TElement *parentElement = nullptr;
auto handleError = [&]() {
- if (!error.isEmpty())
+ if (!error.isEmpty()) {
+ for (int id : qAsConst(idNumbers))
+ releaseId(id);
deleteElements(createdElements, renderer);
+ }
notifyElementCreation(elementPaths, error);
};
@@ -1012,8 +1024,8 @@ void CQmlEngineImpl::createElements(const QString &parentElementPath, const QStr
parentElement->GetAttribute(Q3DStudio::ATTRIBUTE_ENDTIME, attValue);
const int parentEndTime = int(attValue.m_INT32);
- for (const auto &currentProps : qAsConst(theProperties)) {
- ++_idCounter;
+ for (int i = 0; i < theProperties.size(); ++i) {
+ const auto &currentProps = theProperties[i];
++elementIndex;
// Remove properties requiring custom handling
@@ -1200,7 +1212,7 @@ void CQmlEngineImpl::createElements(const QString &parentElementPath, const QStr
NVAllocatorCallback &allocator = presentation->GetScene()->allocator();
SModel *newObject = QT3DS_NEW(allocator, SModel)();
newObject->m_Id = strTable.RegisterStr((QByteArrayLiteral("__newObj_")
- + QByteArray::number(_idCounter)).constData());
+ + QByteArray::number(idNumbers[i])).constData());
parentObject.AddChild(*newObject);
Qt3DSTranslator::CreateTranslatorForElement(newElem, *newObject, allocator);
@@ -1210,7 +1222,7 @@ void CQmlEngineImpl::createElements(const QString &parentElementPath, const QStr
SReferencedMaterial *newMaterial = QT3DS_NEW(allocator, SReferencedMaterial)();
newMaterial->m_Id = strTable.RegisterStr(
(QByteArrayLiteral("__newMat_")
- + QByteArray::number(_idCounter)).constData());
+ + QByteArray::number(idNumbers[i])).constData());
newMaterial->m_ReferencedMaterial = referencedMaterial;
newObject->AddMaterial(*newMaterial);
}
@@ -1233,10 +1245,11 @@ void CQmlEngineImpl::createElements(const QString &parentElementPath, const QStr
newElem.GetActivityZone().UpdateItemInfo(newElem);
createdElements << &newElem;
+ m_elementIdMap.insert(&newElem, idNumbers[i]);
}
bool isPrimary = presentation == m_Application->GetPrimaryPresentation() ? true : false;
- initializeDataInputsInPresentation(*presentation, isPrimary, createdElements.toList());
+ initializeDataInputsInPresentation(*presentation, isPrimary, true, createdElements.toList());
renderer->ChildrenUpdated(parentObject);
@@ -1311,10 +1324,16 @@ void CQmlEngineImpl::createMaterials(const QString &subPresId,
};
QVector<MaterialInfo *> materialInfos;
QVector<TElement *> createdElements;
+ QVector<int> idNumbers(materialDefinitions.size());
+ for (int i = 0; i < materialDefinitions.size(); ++i)
+ idNumbers[i] = getAvailableId();
auto handleError = [&]() {
- if (!error.isEmpty())
+ if (!error.isEmpty()) {
+ for (int id : qAsConst(idNumbers))
+ releaseId(id);
deleteElements(createdElements, renderer);
+ }
QStringList materialNames;
QString prefix;
if (!subPresId.isEmpty())
@@ -1365,7 +1384,8 @@ void CQmlEngineImpl::createMaterials(const QString &subPresId,
if (!container)
container = createMaterialContainer(rootElement, presentation);
- for (auto &materialInfo : materialInfos) {
+ for (int i = 0; i < materialInfos.size(); ++i) {
+ const auto &materialInfo = materialInfos[i];
if (materialInfo->materialName.isEmpty() || materialInfo->materialProps.isEmpty()) {
error = QObject::tr("Invalid material definition: '%1'")
.arg(materialInfo->materialDefinition);
@@ -1570,7 +1590,7 @@ void CQmlEngineImpl::createMaterials(const QString &subPresId,
// Create render object for the material
qt3ds::render::SGraphObject *newMaterial = nullptr;
CRegisteredString newMatId = strTable.RegisterStr(
- (QByteArrayLiteral("__newMat_") + QByteArray::number(++_idCounter))
+ (QByteArrayLiteral("__newMat_") + QByteArray::number(idNumbers[i]))
.constData());
if (isCustomMaterial) {
newMaterial = customMaterialSystem->CreateCustomMaterial(matClass, allocator);
@@ -1647,15 +1667,18 @@ void CQmlEngineImpl::createMaterials(const QString &subPresId,
qt3ds::render::SImage *newImageObj
= QT3DS_NEW(allocator, qt3ds::render::SImage)();
+ const int imageId = getAvailableId();
newImageObj->m_Id = strTable.RegisterStr(
(QByteArrayLiteral("__newImage_")
- + QByteArray::number(++_idCounter)).constData());
+ + QByteArray::number(imageId)).constData());
qt3ds::render::Qt3DSTranslator::CreateTranslatorForElement(
*imageElem, *newImageObj, allocator);
+ m_elementIdMap.insert(imageElem, imageId);
}
}
- createdElements << &newMatElem;
}
+ createdElements << &newMatElem;
+ m_elementIdMap.insert(&newMatElem, idNumbers[i]);
qt3ds::render::Qt3DSTranslator::CreateTranslatorForElement(newMatElem, *newMaterial,
allocator);
@@ -2030,7 +2053,7 @@ void CQmlEngineImpl::listAllElements(TElement *root, QList<TElement *> &elements
// Initializes datainput bindings in the presentation starting by default from the root element.
// If inElements is specified, only parses the specified elements.
void CQmlEngineImpl::initializeDataInputsInPresentation(CPresentation &presentation,
- bool isPrimary,
+ bool isPrimary, bool isDynamicAdd,
QList<TElement *> inElements)
{
QList<TElement *> elements;
@@ -2079,6 +2102,24 @@ void CQmlEngineImpl::initializeDataInputsInPresentation(CPresentation &presentat
TElement *component = &element->GetComponentParent();
ctrlElem.elementPath.append(component->m_Path);
} else if (diMap[controllerName].type
+ == qt3ds::runtime::DataInOutTypeVector4) {
+ // special handling for vector datatype to handle
+ // expansion from <propertyname> to <propertyname>.x .y .z .w
+ QVector<QByteArray> attVec;
+ bool success = getAttributeVector4(
+ attVec, ctrlElem.attributeName.first().constData(),
+ element);
+ if (!attVec.empty() && success) {
+ ctrlElem.attributeName = attVec;
+ ctrlElem.elementPath.append(element->m_Path);
+ ctrlElem.propertyType = ATTRIBUTETYPE_FLOAT4;
+ } else {
+ qWarning() << __FUNCTION__ << "Property "
+ << ctrlElem.attributeName.first()
+ << " was not expanded to vector";
+ ctrlElem.propertyType = ATTRIBUTETYPE_NONE;
+ }
+ } else if (diMap[controllerName].type
== qt3ds::runtime::DataInOutTypeVector3) {
// special handling for vector datatype to handle
// expansion from <propertyname> to <propertyname>.x .y .z
@@ -2152,41 +2193,46 @@ void CQmlEngineImpl::initializeDataInputsInPresentation(CPresentation &presentat
diDef.controlledAttributes.append(ctrlElem);
// #TODO: Remove below once QT3DS-3510 has been implemented in the editor
- // Note, in this temp implementation only the LAST of multiple attributes
- // will be notified from the object under the DataInput name..
- qt3ds::runtime::DataInputDef inDef = diMap[controllerName];
- qt3ds::runtime::DataOutputDef &doDef = doMap[controllerName];
- doDef.observedAttribute = ctrlElem;
- doDef.type = inDef.type;
- doDef.min = inDef.min;
- doDef.max = inDef.max;
-
- if (ctrlElem.propertyType == ATTRIBUTETYPE_DATAINPUT_TIMELINE) {
- // Find the TElement for the @timeline attrib
- TElement *target = nullptr;
- QStringList split
- = QString(ctrlElem.elementPath).split(QLatin1Char(':'));
- if (split.size() > 1) {
- target = CQmlElementHelper::GetElement(
- *m_Application,
- m_Application->GetPresentationById(
- split.at(0).toStdString().c_str()),
- split.at(1).toStdString().c_str(), nullptr);
+ // Skip data output modification when adding dynamic elements,
+ // as that would break the previous binding
+ if (!isDynamicAdd) {
+ // Note, in this temp implementation only the LAST of multiple attrs
+ // will be notified from the object under the DataInput name..
+ qt3ds::runtime::DataInputDef inDef = diMap[controllerName];
+ qt3ds::runtime::DataOutputDef &doDef = doMap[controllerName];
+ doDef.observedAttribute = ctrlElem;
+ doDef.type = inDef.type;
+ doDef.min = inDef.min;
+ doDef.max = inDef.max;
+
+ if (ctrlElem.propertyType == ATTRIBUTETYPE_DATAINPUT_TIMELINE) {
+ // Find the TElement for the @timeline attrib
+ TElement *target = nullptr;
+ QStringList split
+ = QString(ctrlElem.elementPath).split(QLatin1Char(':'));
+ if (split.size() > 1) {
+ target = CQmlElementHelper::GetElement(
+ *m_Application,
+ m_Application->GetPresentationById(
+ split.at(0).toStdString().c_str()),
+ split.at(1).toStdString().c_str(), nullptr);
+ } else {
+ target = CQmlElementHelper::GetElement(
+ *m_Application,
+ m_Application->GetPrimaryPresentation(),
+ split.at(0).toStdString().c_str(), nullptr);
+ }
+
+ doDef.timelineComponent = static_cast<TComponent *>(target);
+ } else if (ctrlElem.propertyType == ATTRIBUTETYPE_DATAINPUT_SLIDE) {
+ // Slide notifications are already done with separate signal
+ // No need to process
} else {
- target = CQmlElementHelper::GetElement(
- *m_Application,
- m_Application->GetPrimaryPresentation(),
- split.at(0).toStdString().c_str(), nullptr);
+ // Other than slide or timeline are handled by CPresentation
+ CRegisteredString rString = strTable.RegisterStr(
+ ctrlElem.elementPath);
+ elementPathToDataOutputDefMap.insertMulti(rString, doDef);
}
-
- doDef.timelineComponent = static_cast<TComponent *>(target);
- } else if (ctrlElem.propertyType == ATTRIBUTETYPE_DATAINPUT_SLIDE) {
- // Slide notifications are already done with separate signal
- // No need to process
- } else {
- // Other than slide or timeline attributes are handled by CPresentation
- CRegisteredString rString = strTable.RegisterStr(ctrlElem.elementPath);
- elementPathToDataOutputDefMap.insertMulti(rString, doDef);
}
// #TODO: Remove above once QT3DS-3510 has been implemented in the editor
}
@@ -2196,7 +2242,8 @@ void CQmlEngineImpl::initializeDataInputsInPresentation(CPresentation &presentat
}
// #TODO: Remove below once QT3DS-3510 has been implemented in the editor
- presentation.AddToDataOutputMap(elementPathToDataOutputDefMap);
+ if (!isDynamicAdd)
+ presentation.AddToDataOutputMap(elementPathToDataOutputDefMap);
// #TODO: Remove above once QT3DS-3510 has been implemented in the editor
}
@@ -2292,11 +2339,61 @@ void CQmlEngineImpl::initializeDataOutputsInPresentation(CPresentation &presenta
presentation.AddToDataOutputMap(elementPathToDataOutputDefMap);
}
+// Remove datainput control from listed elements and update internal control map. Should be used
+// when elements having a datainput controller are removed in order to avoid invalid entries.
+void CQmlEngineImpl::removeDataInputControl(const QVector<TElement *> &inElements)
+{
+ const qt3ds::runtime::DataInputMap diMap(m_Application->dataInputMap());
+
+ // Have to do nasty triple-nested search loop as the datainput map is organized around
+ // datainputs for fast lookups in setDataInputValue, not around control targets.
+ QVector<QPair<QString, qt3ds::runtime::DataInOutAttribute>> elemAttrsToRemove;
+ QMapIterator<QString, qt3ds::runtime::DataInputDef> diMapIter(diMap);
+
+ for (const auto &elem : inElements) {
+ while (diMapIter.hasNext()) {
+ diMapIter.next();
+ for (const auto &inOutAttr : qAsConst(diMapIter.value().controlledAttributes)) {
+ if (inOutAttr.elementPath == QByteArray(elem->m_Path))
+ elemAttrsToRemove.append({diMapIter.key(), inOutAttr});
+ }
+ }
+ diMapIter.toFront();
+ }
+
+ for (const auto &attr : qAsConst(elemAttrsToRemove))
+ m_Application->dataInputMap()[attr.first].controlledAttributes.removeAll(attr.second);
+}
+
// Bit clumsy way of getting from "position" to "position .x .y .z" and enabling datainput
// support for vectorized types. UIP parser has already thrown away all vector
// type attributes and at this point we are operating with scalar components only.
// We check if this element has a property attName.x or attName.r to find out it
// we should expand property attName to XYZ or RGB vector
+bool CQmlEngineImpl::getAttributeVector4(QVector<QByteArray> &outAttVec,
+ const QByteArray &attName,
+ TElement *elem)
+{
+ auto hashName = Q3DStudio::CHash::HashAttribute(attName + ".x");
+
+ if (!elem->FindProperty(hashName).isEmpty()) {
+ outAttVec.append(attName + ".x");
+ outAttVec.append(attName + ".y");
+ outAttVec.append(attName + ".z");
+ outAttVec.append(attName + ".w");
+ return true;
+ }
+ hashName = Q3DStudio::CHash::HashAttribute(attName + ".r");
+ if (!elem->FindProperty(hashName).isEmpty()) {
+ outAttVec.append(attName + ".r");
+ outAttVec.append(attName + ".g");
+ outAttVec.append(attName + ".b");
+ outAttVec.append(attName + ".a");
+ return true;
+ }
+ return false;
+}
+
bool CQmlEngineImpl::getAttributeVector3(QVector<QByteArray> &outAttVec,
const QByteArray &attName,
TElement *elem)
@@ -2615,6 +2712,9 @@ void CQmlEngineImpl::deleteElements(const QVector<TElement *> &elements,
// Recursive deleter for translators and graph objects
std::function<void(TElement *)> deleteRenderObjects;
deleteRenderObjects = [&](TElement *elem) {
+ if (m_elementIdMap.contains(elem))
+ releaseId(m_elementIdMap.take(elem));
+
TElement *child = elem->m_Child;
while (child) {
TElement *sibling = child->m_Sibling;
@@ -2633,6 +2733,10 @@ void CQmlEngineImpl::deleteElements(const QVector<TElement *> &elements,
model->m_FirstMaterial);
QT3DS_FREE(allocator, material);
}
+ } else if (type == qt3ds::render::GraphObjectTypes::Image) {
+ auto image = static_cast<qt3ds::render::SImage *>(&translator->RenderObject());
+ if (image->m_LoadedTextureData)
+ image->m_LoadedTextureData->m_callbacks.removeOne(image);
}
QT3DS_FREE(allocator, &translator->RenderObject());
QT3DS_FREE(allocator, translator);
@@ -2664,6 +2768,29 @@ void CQmlEngineImpl::deleteElements(const QVector<TElement *> &elements,
}
for (auto parentNode : qAsConst(parentNodes))
renderer->ChildrenUpdated(*parentNode);
+
+ removeDataInputControl(elements);
+}
+
+int CQmlEngineImpl::getAvailableId()
+{
+ static int _idCounter = 0;
+
+ int id = -1;
+ if (m_availableIds.isEmpty()) {
+ id = ++_idCounter;
+ } else {
+ auto first = m_availableIds.begin();
+ id = *first;
+ m_availableIds.erase(first);
+ }
+
+ return id;
+}
+
+void CQmlEngineImpl::releaseId(int id)
+{
+ m_availableIds.insert(id);
}
template<typename TDataType>
diff --git a/src/runtimerender/Qt3DSDistanceFieldRenderer.cpp b/src/runtimerender/Qt3DSDistanceFieldRenderer.cpp
index 8c1b28a..f28e545 100644
--- a/src/runtimerender/Qt3DSDistanceFieldRenderer.cpp
+++ b/src/runtimerender/Qt3DSDistanceFieldRenderer.cpp
@@ -91,20 +91,32 @@ void Q3DSDistanceFieldRenderer::EndFrame()
// Remove meshes for glyphs that weren't rendered last frame
NVAllocatorCallback &alloc = m_context->GetAllocator();
- QHash<size_t, Q3DSDistanceFieldMesh>::const_iterator it = m_meshCache.constBegin();
- while (it != m_meshCache.constEnd()) {
- const size_t glyphHash = it.key();
- const Q3DSDistanceFieldMesh &mesh = it.value();
+ QHash<size_t, QHash<Q3DSDistanceFieldGlyphCache::TextureInfo *, GlyphInfo>>::const_iterator
+ glyphIt = m_glyphCache.constBegin();
+ while (glyphIt != m_glyphCache.constEnd()) {
+ const size_t textHash = glyphIt.key();
+ if (!m_renderedTexts.contains(textHash))
+ m_glyphCache.erase(glyphIt++);
+ else
+ glyphIt++;
+ }
+
+ QHash<size_t, Q3DSDistanceFieldMesh>::const_iterator meshIt = m_meshCache.constBegin();
+ while (meshIt != m_meshCache.constEnd()) {
+ const size_t glyphHash = meshIt.key();
+ const Q3DSDistanceFieldMesh &mesh = meshIt.value();
if (!m_renderedGlyphs.contains(glyphHash)) {
NVDelete(alloc, mesh.vertexBuffer);
NVDelete(alloc, mesh.indexBuffer);
NVDelete(alloc, mesh.inputAssembler);
- m_meshCache.erase(it++);
+ m_meshCache.erase(meshIt++);
} else {
- it++;
+ meshIt++;
}
}
+
m_renderedGlyphs.clear();
+ m_renderedTexts.clear();
}
QHash<Q3DSDistanceFieldGlyphCache::TextureInfo *, GlyphInfo>
@@ -611,6 +623,8 @@ static QVector<T> fillIndexBuffer(uint quadCount)
void Q3DSDistanceFieldRenderer::buildShaders()
{
+ if (m_shader.program)
+ return;
IShaderProgramGenerator &gen = m_context->GetShaderProgramGenerator();
gen.BeginProgram();
IShaderStageGenerator &vertexGenerator(*gen.GetStage(ShaderGeneratorStages::Vertex));
@@ -682,12 +696,12 @@ void Q3DSDistanceFieldRenderer::buildShaders()
Q3DSDistanceFieldMesh Q3DSDistanceFieldRenderer::buildMesh(const GlyphInfo &glyphInfo,
bool shadow)
{
- static NVRenderVertexBufferEntry entries[] = {
+ NVRenderVertexBufferEntry entries[] = {
NVRenderVertexBufferEntry("vCoord", NVRenderComponentTypes::QT3DSF32, 3),
NVRenderVertexBufferEntry("tCoord", NVRenderComponentTypes::QT3DSF32, 2, 3 * sizeof(float))
};
- static NVRenderVertexBufferEntry shadowEntries[] = {
+ NVRenderVertexBufferEntry shadowEntries[] = {
NVRenderVertexBufferEntry("vCoord", NVRenderComponentTypes::QT3DSF32, 3),
NVRenderVertexBufferEntry("tCoord", NVRenderComponentTypes::QT3DSF32, 2,
3 * sizeof(float)),
@@ -948,6 +962,8 @@ void Q3DSDistanceFieldRenderer::renderText(SText &text, const QT3DSMat44 &mvp)
m_renderedGlyphs += glyphHashValue;
}
+ m_renderedTexts += textHashValue;
+
text.m_Bounds = NVBounds3(minimum, maximum);
}
@@ -961,7 +977,6 @@ void Q3DSDistanceFieldRenderer::setContext(IQt3DSRenderContext &context)
{
m_context = &context;
m_glyphCacheManager.setContext(context);
- buildShaders();
}
ITextRendererCore &ITextRendererCore::createDistanceFieldRenderer(NVFoundationBase &fnd)
diff --git a/src/runtimerender/Qt3DSDistanceFieldRenderer.h b/src/runtimerender/Qt3DSDistanceFieldRenderer.h
index 3af19a9..a64fddd 100644
--- a/src/runtimerender/Qt3DSDistanceFieldRenderer.h
+++ b/src/runtimerender/Qt3DSDistanceFieldRenderer.h
@@ -153,6 +153,7 @@ private:
Q3DSDistanceFieldShader m_shader;
Q3DSDistanceFieldDropShadowShader m_dropShadowShader;
QVector<size_t> m_renderedGlyphs;
+ QVector<size_t> m_renderedTexts;
QStringList m_systemDirs;
QStringList m_projectDirs;
diff --git a/src/runtimerender/Qt3DSOnscreenTextRenderer.cpp b/src/runtimerender/Qt3DSOnscreenTextRenderer.cpp
index 4b74c51..2612b7c 100644
--- a/src/runtimerender/Qt3DSOnscreenTextRenderer.cpp
+++ b/src/runtimerender/Qt3DSOnscreenTextRenderer.cpp
@@ -292,10 +292,8 @@ public:
SRenderTextureAtlasDetails RenderText(const STextRenderInfo &inText) override
{
- qt3ds::foundation::IStringTable &theStringTable(m_RenderContext->GetStringTable());
-
- const wchar_t *wText = theStringTable.GetWideStr(inText.m_Text);
- QT3DSU32 length = (QT3DSU32)wcslen(wText);
+ const QString wText = QString::fromUtf8(inText.m_Text);
+ QT3DSU32 length = QT3DSU32(wText.length());
if (length) {
STextAtlasFont *pFont = m_TextFont;
@@ -307,13 +305,13 @@ public:
// we construct triangles here
// which means character count x 6 vertices x 5 floats
QT3DSF32 *vertexData =
- (QT3DSF32 *)QT3DS_ALLOC(m_Foundation.getAllocator(),
- length * 6 * 5 * sizeof(QT3DSF32),
- "Qt3DSOnscreenTextRenderer");
+ static_cast<QT3DSF32 *>(QT3DS_ALLOC(m_Foundation.getAllocator(),
+ length * 6 * 5 * sizeof(QT3DSF32),
+ "Qt3DSOnscreenTextRenderer"));
QT3DSF32 *bufPtr = vertexData;
if (vertexData) {
for (size_t i = 0; i < length; ++i) {
- pEntry = &pFont->m_AtlasEntries.find(wText[i])->second;
+ pEntry = &pFont->m_AtlasEntries.find(wText[uint(i)].unicode())->second;
if (pEntry) {
x1 = advance + pEntry->m_xOffset;
diff --git a/src/runtimerender/Qt3DSRenderContextCore.cpp b/src/runtimerender/Qt3DSRenderContextCore.cpp
index 33e1bf6..b5f9bc9 100644
--- a/src/runtimerender/Qt3DSRenderContextCore.cpp
+++ b/src/runtimerender/Qt3DSRenderContextCore.cpp
@@ -249,6 +249,7 @@ struct SRenderContext : public IQt3DSRenderContext
bool m_IsInSubPresentation;
Option<QT3DSVec4> m_SceneColor;
Option<QT3DSVec4> m_MatteColor;
+ bool m_matteEnabled;
RenderRotationValues::Enum m_Rotation;
NVScopedRefCounted<NVRenderFrameBuffer> m_RotationFBO;
NVScopedRefCounted<NVRenderTexture2D> m_RotationTexture;
@@ -276,14 +277,15 @@ struct SRenderContext : public IQt3DSRenderContext
, m_ResourceManager(IResourceManager::CreateResourceManager(ctx))
, m_ShaderCache(IShaderCache::CreateShaderCache(ctx, *m_InputStreamFactory, *m_PerfTimer))
, m_ThreadPool(inCore.GetThreadPool())
- , m_RenderList(IRenderList::CreateRenderList(ctx.GetFoundation()))
, m_PerFrameAllocator(ctx.GetAllocator())
+ , m_RenderList(IRenderList::CreateRenderList(ctx.GetFoundation()))
, m_FrameCount(0)
, mRefCount(0)
, m_WindowDimensions(800, 480)
, m_ScaleMode(ScaleModes::ExactSize)
, m_WireframeMode(false)
, m_IsInSubPresentation(false)
+ , m_matteEnabled(false)
, m_Rotation(RenderRotationValues::NoRotation)
, m_ContextRenderTarget(NULL)
, m_PresentationScale(0, 0)
@@ -420,6 +422,10 @@ struct SRenderContext : public IQt3DSRenderContext
void SetSceneColor(Option<QT3DSVec4> inSceneColor) override { m_SceneColor = inSceneColor; }
void SetMatteColor(Option<QT3DSVec4> inMatteColor) override { m_MatteColor = inMatteColor; }
+ void setMatteEnabled(bool enable) override
+ {
+ m_matteEnabled = enable;
+ }
void SetWindowDimensions(const QSize &inWindowDimensions) override
{
@@ -697,11 +703,17 @@ struct SRenderContext : public IQt3DSRenderContext
m_RenderContext->SetScissorTestEnabled(false);
}
{
- QT3DSVec4 theClearColor;
- if (m_MatteColor.hasValue())
+ QT3DSVec4 theClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ if (m_MatteColor.hasValue() && m_matteEnabled)
theClearColor = m_MatteColor;
- else
+ else if (m_SceneColor.hasValue())
theClearColor = m_SceneColor;
+ //premultiply the clear color
+ if (theClearColor.w < 1.0f) {
+ theClearColor.x *= theClearColor.w;
+ theClearColor.y *= theClearColor.w;
+ theClearColor.z *= theClearColor.w;
+ }
m_RenderContext->SetClearColor(theClearColor);
m_RenderContext->Clear(qt3ds::render::NVRenderClearValues::Color);
}
@@ -721,7 +733,13 @@ struct SRenderContext : public IQt3DSRenderContext
m_RotationDepthBuffer = NULL;
}
if (m_SceneColor.hasValue() && m_SceneColor.getValue().w != 0.0f) {
- m_RenderContext->SetClearColor(m_SceneColor);
+ QT3DSVec4 theClearColor = m_SceneColor;
+ if (theClearColor.w < 1.0f) {
+ theClearColor.x *= theClearColor.w;
+ theClearColor.y *= theClearColor.w;
+ theClearColor.z *= theClearColor.w;
+ }
+ m_RenderContext->SetClearColor(theClearColor);
m_RenderContext->Clear(qt3ds::render::NVRenderClearValues::Color);
}
} else {
@@ -752,7 +770,13 @@ struct SRenderContext : public IQt3DSRenderContext
}
m_RenderContext->SetRenderTarget(m_RotationFBO);
if (m_SceneColor.hasValue()) {
- m_RenderContext->SetClearColor(m_SceneColor);
+ QT3DSVec4 theClearColor = m_SceneColor;
+ if (theClearColor.w < 1.0f) {
+ theClearColor.x *= theClearColor.w;
+ theClearColor.y *= theClearColor.w;
+ theClearColor.z *= theClearColor.w;
+ }
+ m_RenderContext->SetClearColor(theClearColor);
m_RenderContext->Clear(qt3ds::render::NVRenderClearValues::Color);
}
}
diff --git a/src/runtimerender/Qt3DSRenderContextCore.h b/src/runtimerender/Qt3DSRenderContextCore.h
index 302571d..027d1f9 100644
--- a/src/runtimerender/Qt3DSRenderContextCore.h
+++ b/src/runtimerender/Qt3DSRenderContextCore.h
@@ -145,6 +145,7 @@ namespace render {
virtual void SetInSubPresentation(bool inValue) = 0;
virtual void SetSceneColor(Option<QT3DSVec4> inSceneColor) = 0;
virtual void SetMatteColor(Option<QT3DSVec4> inMatteColor) = 0;
+ virtual void setMatteEnabled(bool enable) = 0;
// Render screen aligned 2D text at x,y
virtual void RenderText2D(QT3DSF32 x, QT3DSF32 y, qt3ds::foundation::Option<qt3ds::QT3DSVec3> inColor,
diff --git a/src/runtimerender/Qt3DSRenderCustomMaterialSystem.cpp b/src/runtimerender/Qt3DSRenderCustomMaterialSystem.cpp
index aaf799f..a6fb9ee 100644
--- a/src/runtimerender/Qt3DSRenderCustomMaterialSystem.cpp
+++ b/src/runtimerender/Qt3DSRenderCustomMaterialSystem.cpp
@@ -1975,7 +1975,7 @@ struct SMaterialSystem : public ICustomMaterialSystem
// TODO - return more information, specifically about transparency (object is transparent,
// object is completely transparent
bool PrepareForRender(const SModel & /*inModel*/, const SRenderSubset & /*inSubset*/,
- SCustomMaterial &inMaterial, bool clearMaterialDirtyFlags) override
+ SCustomMaterial &inMaterial) override
{
SMaterialClass *theMaterialClass = GetMaterialClass(inMaterial.m_ClassName);
if (theMaterialClass == NULL) {
@@ -1990,8 +1990,6 @@ struct SMaterialSystem : public ICustomMaterialSystem
inMaterial.m_hasVolumetricDF = false;
bool wasDirty = inMaterial.IsDirty() || theMaterialClass->m_AlwaysDirty;
- if (clearMaterialDirtyFlags)
- inMaterial.UpdateDirtyForFrame();
return wasDirty;
}
diff --git a/src/runtimerender/Qt3DSRenderCustomMaterialSystem.h b/src/runtimerender/Qt3DSRenderCustomMaterialSystem.h
index 6fe522f..478d2e3 100644
--- a/src/runtimerender/Qt3DSRenderCustomMaterialSystem.h
+++ b/src/runtimerender/Qt3DSRenderCustomMaterialSystem.h
@@ -111,7 +111,7 @@ namespace render {
// Returns true if the material is dirty and thus will produce a different render result
// than previously. This effects things like progressive AA.
virtual bool PrepareForRender(const SModel &inModel, const SRenderSubset &inSubset,
- SCustomMaterial &inMaterial, bool inClearDirty) = 0;
+ SCustomMaterial &inMaterial) = 0;
virtual bool RenderDepthPrepass(const QT3DSMat44 &inMVP, const SCustomMaterial &inMaterial,
const SRenderSubset &inSubset) = 0;
diff --git a/src/runtimerender/graphobjects/Qt3DSRenderScene.cpp b/src/runtimerender/graphobjects/Qt3DSRenderScene.cpp
index 7917bd7..7049035 100644
--- a/src/runtimerender/graphobjects/Qt3DSRenderScene.cpp
+++ b/src/runtimerender/graphobjects/Qt3DSRenderScene.cpp
@@ -37,8 +37,8 @@ using namespace qt3ds::render;
SScene::SScene()
: SGraphObject(GraphObjectTypes::Scene)
- , m_Presentation(NULL)
- , m_FirstChild(NULL)
+ , m_Presentation(nullptr)
+ , m_FirstChild(nullptr)
, m_ClearColor(0.0f)
, m_UseClearColor(true)
, m_Dirty(true)
@@ -47,7 +47,7 @@ SScene::SScene()
void SScene::AddChild(SLayer &inLayer)
{
- if (m_FirstChild == NULL)
+ if (m_FirstChild == nullptr)
m_FirstChild = &inLayer;
else
GetLastChild()->m_NextSibling = &inLayer;
@@ -71,6 +71,7 @@ bool SScene::PrepareForRender(const QT3DSVec2 &inViewportDimensions, IQt3DSRende
// We need to iterate through the layers in reverse order and ask them to render.
bool wasDirty = m_Dirty;
m_Dirty = false;
+
if (m_FirstChild) {
wasDirty |=
inContext.GetRenderer().PrepareLayerForRender(*m_FirstChild, inViewportDimensions,
diff --git a/src/runtimerender/rendererimpl/Qt3DSRendererImpl.cpp b/src/runtimerender/rendererimpl/Qt3DSRendererImpl.cpp
index 0b3f665..10f62c3 100644
--- a/src/runtimerender/rendererimpl/Qt3DSRendererImpl.cpp
+++ b/src/runtimerender/rendererimpl/Qt3DSRendererImpl.cpp
@@ -236,6 +236,20 @@ namespace render {
if (theRenderData) {
theRenderData->PrepareForRender();
+ if (id) {
+ if (m_initialPrepareData.contains(theLayer)) {
+ // Copy dirty state from the initial since the graph is
+ // not dirty for subsequent calls
+ auto &flags = theRenderData->m_LayerPrepResult->m_Flags;
+ const auto &initialFlags
+ = m_initialPrepareData[theLayer]->m_LayerPrepResult->m_Flags;
+ flags.SetWasDirty(flags.WasDirty() || initialFlags.WasDirty());
+ flags.SetLayerDataDirty(flags.WasLayerDataDirty()
+ || initialFlags.WasLayerDataDirty());
+ } else {
+ m_initialPrepareData.insert(theLayer, theRenderData);
+ }
+ }
retval = retval || theRenderData->m_LayerPrepResult->m_Flags.WasDirty();
} else {
QT3DS_ASSERT(false);
@@ -495,6 +509,14 @@ namespace render {
for (QT3DSU32 idx = 0, end = m_LastFrameLayers.size(); idx < end; ++idx)
m_LastFrameLayers[idx]->ResetForFrame();
m_LastFrameLayers.clear();
+ m_initialPrepareData.clear();
+ for (auto *obj : qAsConst(m_materialClearDirty)) {
+ if (obj->m_Type == GraphObjectTypes::DefaultMaterial)
+ static_cast<SDefaultMaterial *>(obj)->m_Dirty.UpdateDirtyForFrame();
+ else if (obj->m_Type == GraphObjectTypes::CustomMaterial)
+ static_cast<SCustomMaterial *>(obj)->UpdateDirtyForFrame();
+ }
+ m_materialClearDirty.clear();
m_BeginFrameViewport = m_qt3dsContext.GetRenderList().GetViewport();
}
void Qt3DSRendererImpl::EndFrame()
@@ -1141,6 +1163,11 @@ namespace render {
inImage.m_TextureData.m_Texture->GenerateMipmaps();
}
+ void Qt3DSRendererImpl::addMaterialDirtyClear(SGraphObject *obj)
+ {
+ m_materialClearDirty.insert(obj);
+ }
+
bool NodeContainsBoneRoot(SNode &childNode, QT3DSI32 rootID)
{
for (SNode *childChild = childNode.m_FirstChild; childChild != NULL;
@@ -1851,9 +1878,11 @@ namespace render {
ITextTextureAtlas *theTextureAtlas = m_qt3dsContext.GetTextureAtlas();
QSize theWindow = m_qt3dsContext.GetWindowDimensions();
- const wchar_t *wText = m_StringTable->GetWideStr(text);
+ // Use dynamic strings to avoid memory leakage
+ QByteArray theText(text);
+ CStringHandle textHandle = m_StringTable->getDynamicHandle(theText);
STextRenderInfo theInfo;
- theInfo.m_Text = m_StringTable->RegisterStr(wText);
+ theInfo.m_Text = m_StringTable->HandleToStr(textHandle);
theInfo.m_FontSize = 20;
// text scale 2% of screen we don't scale Y though because it becomes unreadable
theInfo.m_ScaleX = (theWindow.width() / 100.0f) * 1.5f / (theInfo.m_FontSize);
@@ -1894,6 +1923,7 @@ namespace render {
QT3DS_FREE(m_Context->GetAllocator(),
theRenderTextDetails.first.m_Vertices.begin());
}
+ m_StringTable->releaseDynamicHandle(textHandle);
}
}
}
diff --git a/src/runtimerender/rendererimpl/Qt3DSRendererImpl.h b/src/runtimerender/rendererimpl/Qt3DSRendererImpl.h
index 906afd6..6311a2d 100644
--- a/src/runtimerender/rendererimpl/Qt3DSRendererImpl.h
+++ b/src/runtimerender/rendererimpl/Qt3DSRendererImpl.h
@@ -292,6 +292,9 @@ namespace render {
bool m_LayerGPuProfilingEnabled;
SShaderDefaultMaterialKeyProperties m_DefaultMaterialShaderKeyProperties;
+ QHash<SLayer *, SLayerRenderData *> m_initialPrepareData;
+ QSet<SGraphObject *> m_materialClearDirty;
+
public:
Qt3DSRendererImpl(IQt3DSRenderContext &ctx);
virtual ~Qt3DSRendererImpl();
@@ -402,6 +405,7 @@ namespace render {
void BeginLayerRender(SLayerRenderData &inLayer);
void EndLayerRender();
void PrepareImageForIbl(SImage &inImage);
+ void addMaterialDirtyClear(SGraphObject *obj);
NVRenderShaderProgram *CompileShader(CRegisteredString inName, const char8_t *inVert,
const char8_t *inFrame);
diff --git a/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderData.cpp b/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderData.cpp
index 362a602..69c79ff 100644
--- a/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderData.cpp
+++ b/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderData.cpp
@@ -1281,9 +1281,8 @@ namespace render {
// If the user has disabled all layer caching this has the side effect of disabling the
// progressive AA algorithm.
if (thePrepResult.m_Flags.WasLayerDataDirty()
- || thePrepResult.m_Flags.WasDirty()
- || m_Renderer.IsLayerCachingEnabled() == false
- || thePrepResult.m_Flags.ShouldRenderToTexture()) {
+ || thePrepResult.m_Flags.WasDirty()
+ || m_Renderer.IsLayerCachingEnabled() == false) {
m_ProgressiveAAPassIndex = 0;
m_NonDirtyTemporalAAPassIndex = 0;
needsRender = true;
@@ -1490,8 +1489,15 @@ namespace render {
theRenderContext, &NVRenderContext::GetViewport, &NVRenderContext::SetViewport,
theNewViewport);
QT3DSVec4 clearColor(0.0f);
- if (m_Layer.m_Background == LayerBackground::Color)
+ if (m_Layer.m_Background == LayerBackground::Color) {
clearColor = m_Layer.m_ClearColor;
+ // Framebuffer holds premultiplied colors so the clearcolor must be premultiplied
+ if (clearColor.w < 1.0f) {
+ clearColor.x *= clearColor.w;
+ clearColor.y *= clearColor.w;
+ clearColor.z *= clearColor.w;
+ }
+ }
NVRenderContextScopedProperty<QT3DSVec4> __clearColor(
theRenderContext, &NVRenderContext::GetClearColor, &NVRenderContext::SetClearColor,
@@ -1776,9 +1782,16 @@ namespace render {
theContext.SetScissorRect(
m_LayerPrepResult->GetLayerToPresentationScissorRect().ToIntegerRect());
if (m_Layer.m_Background == LayerBackground::Color) {
+ QT3DSVec4 clearColor = m_Layer.m_ClearColor;
+ // Framebuffer holds premultiplied colors so the clearcolor must be premultiplied
+ if (clearColor.w < 1.0f) {
+ clearColor.x *= clearColor.w;
+ clearColor.y *= clearColor.w;
+ clearColor.z *= clearColor.w;
+ }
NVRenderContextScopedProperty<QT3DSVec4> __clearColor(
theContext, &NVRenderContext::GetClearColor, &NVRenderContext::SetClearColor,
- m_Layer.m_ClearColor);
+ clearColor);
theContext.Clear(NVRenderClearValues::Color);
}
RenderToViewport();
diff --git a/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.cpp b/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.cpp
index 8afa3c0..6dcd4c9 100644
--- a/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.cpp
+++ b/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.cpp
@@ -388,6 +388,7 @@ namespace render {
Q3DSDistanceFieldRenderer *distanceFieldText
= static_cast<Q3DSDistanceFieldRenderer *>(
m_Renderer.GetQt3DSContext().getDistanceFieldRenderer());
+ distanceFieldText->buildShaders();
theRenderable = RENDER_FRAME_NEW(SDistanceFieldRenderable)(
theFlags, inText.GetGlobalPos(), inText, inText.m_Bounds, theMVP,
*distanceFieldText);
@@ -500,10 +501,8 @@ namespace render {
if (theMaterial != NULL && theMaterial->m_Type == GraphObjectTypes::DefaultMaterial) {
SDefaultMaterial *theDefaultMaterial = static_cast<SDefaultMaterial *>(theMaterial);
- // Don't clear dirty flags if the material was referenced.
- bool clearMaterialFlags = theMaterial == inPath.m_Material;
SDefaultMaterialPreparationResult prepResult(PrepareDefaultMaterialForRender(
- *theDefaultMaterial, theFlags, subsetOpacity, clearMaterialFlags));
+ *theDefaultMaterial, theFlags, subsetOpacity));
theFlags = prepResult.m_RenderableFlags;
if (inPath.m_PathType == PathTypes::Geometry) {
@@ -545,7 +544,8 @@ namespace render {
// Don't clear dirty flags if the material was referenced.
// bool clearMaterialFlags = theMaterial == inPath.m_Material;
SDefaultMaterialPreparationResult prepResult(
- PrepareCustomMaterialForRender(*theCustomMaterial, theFlags, subsetOpacity));
+ PrepareCustomMaterialForRender(*theCustomMaterial, theFlags, subsetOpacity,
+ retval));
theFlags = prepResult.m_RenderableFlags;
if (inPath.m_PathType == PathTypes::Geometry) {
@@ -660,8 +660,7 @@ namespace render {
}
SDefaultMaterialPreparationResult SLayerRenderPreparationData::PrepareDefaultMaterialForRender(
- SDefaultMaterial &inMaterial, SRenderableObjectFlags &inExistingFlags, QT3DSF32 inOpacity,
- bool inClearDirtyFlags)
+ SDefaultMaterial &inMaterial, SRenderableObjectFlags &inExistingFlags, QT3DSF32 inOpacity)
{
SDefaultMaterial *theMaterial = &inMaterial;
SDefaultMaterialPreparationResult retval(GenerateLightingKey(theMaterial->m_Lighting));
@@ -675,8 +674,6 @@ namespace render {
renderableFlags |= RenderPreparationResultFlagValues::Dirty;
}
subsetOpacity *= theMaterial->m_Opacity;
- if (inClearDirtyFlags)
- theMaterial->m_Dirty.UpdateDirtyForFrame();
SRenderableImage *firstImage = NULL;
@@ -780,11 +777,14 @@ namespace render {
retval.m_FirstImage = firstImage;
if (retval.m_RenderableFlags.IsDirty())
retval.m_Dirty = true;
+ if (retval.m_Dirty)
+ m_Renderer.addMaterialDirtyClear(&inMaterial);
return retval;
}
SDefaultMaterialPreparationResult SLayerRenderPreparationData::PrepareCustomMaterialForRender(
- SCustomMaterial &inMaterial, SRenderableObjectFlags &inExistingFlags, QT3DSF32 inOpacity)
+ SCustomMaterial &inMaterial, SRenderableObjectFlags &inExistingFlags, QT3DSF32 inOpacity,
+ bool alreadyDirty)
{
SDefaultMaterialPreparationResult retval(GenerateLightingKey(
DefaultMaterialLighting::FragmentLighting)); // always fragment lighting
@@ -836,6 +836,8 @@ namespace render {
#undef CHECK_IMAGE_AND_PREPARE
retval.m_FirstImage = firstImage;
+ if (retval.m_Dirty || alreadyDirty)
+ m_Renderer.addMaterialDirtyClear(&inMaterial);
return retval;
}
@@ -926,10 +928,6 @@ namespace render {
subsetDirty | (theSubset.m_WireframeMode != inModel.m_WireframeMode);
inModel.m_WireframeMode = false;
}
- // Only clear flags on the materials in this direct hierarchy. Do not clear them of
- // this
- // references materials in another hierarchy.
- bool clearMaterialDirtyFlags = theMaterialObject == theSourceMaterialObject;
if (theMaterialObject == NULL)
continue;
@@ -938,8 +936,8 @@ namespace render {
SDefaultMaterial &theMaterial(
static_cast<SDefaultMaterial &>(*theMaterialObject));
SDefaultMaterialPreparationResult theMaterialPrepResult(
- PrepareDefaultMaterialForRender(theMaterial, renderableFlags, subsetOpacity,
- clearMaterialDirtyFlags));
+ PrepareDefaultMaterialForRender(theMaterial, renderableFlags,
+ subsetOpacity));
SShaderDefaultMaterialKey theGeneratedKey = theMaterialPrepResult.m_MaterialKey;
subsetOpacity = theMaterialPrepResult.m_Opacity;
SRenderableImage *firstImage(theMaterialPrepResult.m_FirstImage);
@@ -968,11 +966,11 @@ namespace render {
ICustomMaterialSystem &theMaterialSystem(
qt3dsContext.GetCustomMaterialSystem());
subsetDirty |= theMaterialSystem.PrepareForRender(
- theModelContext.m_Model, theSubset, theMaterial, clearMaterialDirtyFlags);
+ theModelContext.m_Model, theSubset, theMaterial);
SDefaultMaterialPreparationResult theMaterialPrepResult(
PrepareCustomMaterialForRender(theMaterial, renderableFlags,
- subsetOpacity));
+ subsetOpacity, subsetDirty));
SShaderDefaultMaterialKey theGeneratedKey = theMaterialPrepResult.m_MaterialKey;
subsetOpacity = theMaterialPrepResult.m_Opacity;
SRenderableImage *firstImage(theMaterialPrepResult.m_FirstImage);
diff --git a/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.h b/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.h
index 5b8d6e1..4a4415f 100644
--- a/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.h
+++ b/src/runtimerender/rendererimpl/Qt3DSRendererImplLayerRenderPreparationData.h
@@ -313,12 +313,12 @@ namespace render {
SDefaultMaterialPreparationResult
PrepareDefaultMaterialForRender(SDefaultMaterial &inMaterial,
- SRenderableObjectFlags &inExistingFlags, QT3DSF32 inOpacity,
- bool inClearMaterialFlags);
+ SRenderableObjectFlags &inExistingFlags, QT3DSF32 inOpacity);
SDefaultMaterialPreparationResult
PrepareCustomMaterialForRender(SCustomMaterial &inMaterial,
- SRenderableObjectFlags &inExistingFlags, QT3DSF32 inOpacity);
+ SRenderableObjectFlags &inExistingFlags, QT3DSF32 inOpacity,
+ bool alreadyDirty);
bool PrepareModelForRender(SModel &inModel, const QT3DSMat44 &inViewProjection,
const Option<SClippingFrustum> &inClipFrustum,
diff --git a/src/runtimerender/rendererimpl/Qt3DSRendererImplShaders.cpp b/src/runtimerender/rendererimpl/Qt3DSRendererImplShaders.cpp
index a3d3fab..eb560aa 100644
--- a/src/runtimerender/rendererimpl/Qt3DSRendererImplShaders.cpp
+++ b/src/runtimerender/rendererimpl/Qt3DSRendererImplShaders.cpp
@@ -2399,7 +2399,6 @@ namespace render {
fragmentGenerator.Append("void main() {");
fragmentGenerator.Append("\tvec2 theCoords = uv_coords;\n");
fragmentGenerator.Append("\tvec4 theLayerTexture = texture2D( layer_image, theCoords );\n");
- fragmentGenerator.Append("\tif( theLayerTexture.a == 0.0 ) discard;\n");
fragmentGenerator.Append("\tfragOutput = theLayerTexture;\n");
fragmentGenerator.Append("}");
NVRenderShaderProgram *theShader = GetProgramGenerator().CompileGeneratedShader(
diff --git a/src/viewer/Qt3DSViewerApp.cpp b/src/viewer/Qt3DSViewerApp.cpp
index 3199124..1402ef0 100644
--- a/src/viewer/Qt3DSViewerApp.cpp
+++ b/src/viewer/Qt3DSViewerApp.cpp
@@ -48,14 +48,6 @@
#include <mach-o/dyld.h>
#endif
-namespace qt3ds {
-void Qt3DSAssert(const char *exp, const char *file, int line, bool *ignore)
-{
- Q_UNUSED(ignore)
- qCritical() << "Assertion thrown: " << file << " " << line << " " << exp;
-}
-}
-
#ifndef EASTL_DEBUG_BREAK
void EASTL_DEBUG_BREAK()
{
@@ -833,6 +825,12 @@ void Q3DSViewerApp::setMatteColor(const QColor &color)
}
}
+void Q3DSViewerApp::setMatteEnabled(bool enable)
+{
+ if (m_Impl.m_view && m_Impl.m_view->GetTegraRenderEngine())
+ m_Impl.m_view->GetTegraRenderEngine()->setMatteEnabled(enable);
+}
+
void Q3DSViewerApp::setShowOnScreenStats(bool inShow)
{
if (m_Impl.m_view && m_Impl.m_view->GetTegraRenderEngine())
diff --git a/src/viewer/Qt3DSViewerApp.h b/src/viewer/Qt3DSViewerApp.h
index 06fdeef..3086d55 100644
--- a/src/viewer/Qt3DSViewerApp.h
+++ b/src/viewer/Qt3DSViewerApp.h
@@ -477,6 +477,7 @@ public:
void preloadSlide(const QString &slide);
void unloadSlide(const QString &slide);
void setDelayedLoading(bool enable);
+ void setMatteEnabled(bool enabled);
private:
/*