summaryrefslogtreecommitdiffstats
path: root/tests/scenes
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2018-07-05 11:42:36 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2018-07-05 12:26:31 +0000
commitda74a3cd815b8bdeaf5eec0c419a1a75582de242 (patch)
tree004b8b89f72b6e1dd6dc8aa74cd6054e235c77c1 /tests/scenes
parent8438867768f819a8cb60ae93ad2a5c8f500ff763 (diff)
Fix inherited eyeball handling for nodes
Introduce the concept of logical and effective global visibility. The slideplayer can this way check the logical global visibility (which is based on the eyeball and nothing else) while others can continue using the effective visibility (that also includes the visibilityTag). Complete with a simple test scene that allows interactively toggling the eyeball for some model nodes. Task-number: QT3DS-1985 Change-Id: I3492412d0c80c2d2ab6e419fa6aefd035171508b Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'tests/scenes')
-rw-r--r--tests/scenes/inheritednodedata/fonts/TitilliumWeb-Regular.ttfbin0 -> 63752 bytes
-rw-r--r--tests/scenes/inheritednodedata/globalvisibility.qml94
-rw-r--r--tests/scenes/inheritednodedata/globalvisibility.uip106
3 files changed, 200 insertions, 0 deletions
diff --git a/tests/scenes/inheritednodedata/fonts/TitilliumWeb-Regular.ttf b/tests/scenes/inheritednodedata/fonts/TitilliumWeb-Regular.ttf
new file mode 100644
index 0000000..6da8219
--- /dev/null
+++ b/tests/scenes/inheritednodedata/fonts/TitilliumWeb-Regular.ttf
Binary files differ
diff --git a/tests/scenes/inheritednodedata/globalvisibility.qml b/tests/scenes/inheritednodedata/globalvisibility.qml
new file mode 100644
index 0000000..5bbc6ed
--- /dev/null
+++ b/tests/scenes/inheritednodedata/globalvisibility.qml
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** 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.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*[[
+ <Property name="target" formalName="Target" type="ObjectRef" default="Scene.Layer.Camera" description="Some object" />
+ <Property name="startImmediately" formalName="Start Immediately?" type="Boolean" default="True" publishLevel="Advanced" description="Start immediately, or wait for the Enable action to be called?" />
+
+ <Handler name="start" formalName="Start" category="Dummy" description="Start" />
+ <Handler name="stop" formalName="Stop" category="Dummy" description="Stop" />
+ <Handler name="cube_eyeball_0" formalName="cube_eyeball_0" category="actionevent" description="Make cube invisible" />
+ <Handler name="cube_eyeball_1" formalName="cube_eyeball_1" category="actionevent" description="Make cube visible" />
+ <Handler name="cone_eyeball_0" formalName="cone_eyeball_0" category="actionevent" description="Make cone invisible" />
+ <Handler name="cone_eyeball_1" formalName="cone_eyeball_1" category="actionevent" description="Make cone visible" />
+ <Handler name="sphere2_eyeball_0" formalName="sphere2_eyeball_0" category="actionevent" description="Make sphere invisible" />
+ <Handler name="sphere2_eyeball_1" formalName="sphere2_eyeball_1" category="actionevent" description="Make sphere visible" />
+]]*/
+
+import QtStudio3D.Behavior 1.1
+
+Behavior {
+ property string target
+ property bool startImmediately
+
+ function cube_eyeball_0() {
+ setAttribute("Cube", "eyeball", false)
+ }
+
+ function cube_eyeball_1() {
+ setAttribute("Cube", "eyeball", true)
+ }
+
+ function cone_eyeball_0() {
+ setAttribute("Cone", "eyeball", false)
+ }
+
+ function cone_eyeball_1() {
+ setAttribute("Cone", "eyeball", true)
+ }
+
+ function sphere2_eyeball_0() {
+ setAttribute("Sphere2", "eyeball", false)
+ }
+
+ function sphere2_eyeball_1() {
+ setAttribute("Sphere2", "eyeball", true)
+ }
+}
diff --git a/tests/scenes/inheritednodedata/globalvisibility.uip b/tests/scenes/inheritednodedata/globalvisibility.uip
new file mode 100644
index 0000000..6af15ba
--- /dev/null
+++ b/tests/scenes/inheritednodedata/globalvisibility.uip
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<UIP version="4" >
+ <Project >
+ <ProjectSettings author="" company="" presentationWidth="1366" presentationHeight="768" maintainAspect="False" >
+ <CustomColors count="16" >#ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff</CustomColors>
+ </ProjectSettings>
+ <Classes >
+ <Behavior id="globalvisibility" name="globalvisibility" sourcepath="globalvisibility.qml" />
+ </Classes>
+ <Graph >
+ <Scene id="Scene" backgroundcolor="0.360784 0.627451 0.956863" >
+ <Layer id="Layer" >
+ <Camera id="Camera" />
+ <Light id="Light" />
+ <Model id="Cube" >
+ <Behavior id="globalvisibility_001" class="#globalvisibility" />
+ <Material id="Default" name="Default" />
+ <Model id="Cone" >
+ <Model id="Cylinder" >
+ <Material id="Default_001" name="Default" />
+ </Model>
+ <Material id="Default_002" name="Default" />
+ </Model>
+ </Model>
+ <Text id="Text" />
+ <Text id="Text2" />
+ <Text id="Text4" />
+ <Text id="Text3" />
+ <Text id="Text5" />
+ <Model id="Sphere" >
+ <Material id="Default_003" name="Default" />
+ <Model id="Sphere2" >
+ <Material id="Default_004" name="Default" />
+ <Model id="Sphere3" >
+ <Material id="Default_005" name="Default" />
+ </Model>
+ </Model>
+ </Model>
+ <Text id="Text6" />
+ <Text id="Text7" />
+ <Text id="Text8" />
+ <Text id="Text9" />
+ <Text id="Text10" />
+ <Text id="Text11" />
+ <Text id="Text12" />
+ </Layer>
+ </Scene>
+ </Graph>
+ <Logic >
+ <State name="Master Slide" component="#Scene" >
+ <Add ref="#Layer" />
+ <Add ref="#Camera" position="0 0 -600" rotation="0 0 0" />
+ <Add ref="#Light" />
+ <State id="Scene-Slide1" name="Slide1" playmode="Looping" >
+ <Add ref="#Cube" name="Cube" position="13.422 -44.1103 23.3646" rotation="-25.8866 9.61909 -21.2157" scale="2.23726 1.72021 1" sourcepath="#Cube" >
+ <AnimationTrack property="rotation.x" type="EaseInOut" >0 -25.8866 100 100 10 -25.887 100 100</AnimationTrack>
+ <AnimationTrack property="rotation.y" type="EaseInOut" >0 9.61909 100 100 10 360 100 100</AnimationTrack>
+ <AnimationTrack property="rotation.z" type="EaseInOut" >0 -21.2157 100 100 10 -21.216 100 100</AnimationTrack>
+ </Add>
+ <Add ref="#globalvisibility_001" name="globalvisibility" />
+ <Add ref="#Default" />
+ <Add ref="#Cone" name="Cone" sourcepath="#Cone" />
+ <Add ref="#Cylinder" name="Cylinder" position="74.4106 125.685 -3.24249e-05" scale="0.540356 0.564928 1" sourcepath="#Cylinder" />
+ <Add ref="#Default_001" />
+ <Add ref="#Default_002" />
+ <Add ref="#Text" name="Text" font="TitilliumWeb-Regular" position="-475.412 224.626 0" textstring="Cube eyeball -&gt; 0" >
+ <Action id="Text-Action" eyeball="True" triggerObject="#Text" event="onPressureDown" targetObject="#globalvisibility_001" handler="cube_eyeball_0" />
+ </Add>
+ <Add ref="#Text2" name="Text2" font="TitilliumWeb-Regular" opacity="99" position="-474.51 166.891 0" textstring="Cube eyeball -&gt; 1" >
+ <Action id="Text2-Action" eyeball="True" triggerObject="#Text2" event="onPressureDown" targetObject="#globalvisibility_001" handler="cube_eyeball_1" />
+ </Add>
+ <Add ref="#Text4" name="Text4" font="TitilliumWeb-Regular" opacity="99" position="-470 54.1273 0" textstring="Cone eyeball -&gt; 1" >
+ <Action id="Text4-Action" eyeball="True" triggerObject="#Text4" event="onPressureDown" targetObject="#globalvisibility_001" handler="cone_eyeball_1" />
+ </Add>
+ <Add ref="#Text3" name="Text3" font="TitilliumWeb-Regular" opacity="99" position="-472.706 112.764 0" textstring="Cone eyeball -&gt; 0" >
+ <Action id="Text3-Action" eyeball="True" triggerObject="#Text3" event="onPressureDown" targetObject="#globalvisibility_001" handler="cone_eyeball_0" />
+ </Add>
+ <Add ref="#Text5" name="Text5" font="TitilliumWeb-Regular" position="23.6989 303.109 15.1224" textstring="Hierarchy is Cube - Cone - Cylinder" />
+ <Add ref="#Text7" name="Text7" font="TitilliumWeb-Regular" position="-490.748 -12.6296 0" textstring="Next slide" >
+ <Action id="Text7-Action" eyeball="True" triggerObject="#Text7" event="onPressureDown" targetObject="#Scene" handler="Next Slide" />
+ </Add>
+ <Add ref="#Text9" name="Text9" font="TitilliumWeb-Regular" position="-562.917 326.876 68.9938" textcolor="1 0.952941 0.431373" textstring="Click:" />
+ </State>
+ <State id="Scene-Slide2" name="Slide2" playthroughto="Previous" >
+ <Add ref="#Sphere" name="Sphere" position="-74.8751 -37.8886 0" sourcepath="#Sphere" />
+ <Add ref="#Default_003" />
+ <Add ref="#Sphere2" name="Sphere2" position="48.714 71.2667 0" sourcepath="#Sphere" />
+ <Add ref="#Default_004" />
+ <Add ref="#Sphere3" name="Sphere3" position="54.1266 63.1477 0" sourcepath="#Sphere" />
+ <Add ref="#Default_005" />
+ <Add ref="#Text6" name="Text6" font="TitilliumWeb-Regular" position="-19.8464 273.339 0" textstring="Hierarchy is Sphere - Sphere - Sphere" />
+ <Add ref="#Text8" name="Text8" font="TitilliumWeb-Regular" position="-472.706 73.071 0" textstring="Previous slide" >
+ <Action id="Text8-Action" eyeball="True" triggerObject="#Text8" event="onPressureDown" targetObject="#Scene" handler="Previous Slide" />
+ </Add>
+ <Add ref="#Text10" name="Text10" font="TitilliumWeb-Regular" position="-562.917 326.876 68.9938" textcolor="1 0.952941 0.431373" textstring="Click:" />
+ <Add ref="#Text11" name="Text11" font="TitilliumWeb-Regular" position="-442.936 193.954 0" textstring="Sphere 2 eyeball -&gt; 0" >
+ <Action id="Text11-Action" eyeball="True" triggerObject="#Text11" event="onPressureDown" targetObject="#globalvisibility_001" handler="sphere2_eyeball_0" />
+ </Add>
+ <Add ref="#Text12" name="Text12" font="TitilliumWeb-Regular" position="-442.034 130.806 0" textstring="Sphere 2 eyeball -&gt; 1" >
+ <Action id="Text12-Action" eyeball="True" triggerObject="#Text12" event="onPressureDown" targetObject="#globalvisibility_001" handler="sphere2_eyeball_1" />
+ </Add>
+ </State>
+ </State>
+ </Logic>
+ </Project>
+</UIP>