summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Enable vertex shaders in custom materialsJere Tuliniemi2019-01-156-0/+104
| | | | | | | | | | | | | | | | | | If <VertexShader> tags in custom material contain a main function, use the shaders provided as is. The shader generator adds } to the end of the fully custom fragment shaders so I left that also to the vertex shader generation. Custom attributes can be provided with a user-generated .mesh file. The test scene has a sphere with the normal attr_pos and a sphere with an attr_pos2 instead. "simple-pos.material" expects an attr_pos vertex attribute and "simple-pos2.material" an attr_pos2. Task-number: QT3DS-2026 Change-Id: I2c0cd1c079f9c741900f119aefd2e3515d42f36d Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Add support for dynamically adding/removing object from a slideChristian Strømme2019-01-091-1/+10
| | | | | | | | | | This change adds support for adding objects at run-time in the new animation system. Note that this is now done in-place and requires no rebuilding of the animation track for the slide, which means objects with animations will start immediately at the right place. Change-Id: I987aa1aeaa272f3506310304b5543bd6f9547d39 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Change default animation systemChristian Strømme2019-01-092-20/+8
| | | | | | | | | | The dragon wings animation system is now the one being used by default. Enabling the old animation system can be done by setting the environment variable Q3DS_NO_DRAGONWINGS or by setting the option --no-dragon-wings when starting the viewer. Change-Id: Ieb920e2bb2cea61f460ec175e7fee06821403903 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Merge remote-tracking branch 'origin/2.2'Laszlo Agocs2018-12-131-0/+165
|\ | | | | | | Change-Id: I8977367f3742088a51b0308496de8816e407b0c2
| * Fix dynamic keyframesChristian Strømme2018-11-261-0/+165
| | | | | | | | | | | | | | | | | | | | Don't generate dynamic kf on first entry to a slide, since there are no "from" values yet. Task-number: QT3DS-2209 Change-Id: Ib4e59968d9099b77ea6d11f1b627b77cad194a23 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | DragonsWingsChristian Strømme2018-12-105-13/+13
|/ | | | | | | | | | This adds the basis for the dragon wings animation system, which is a light weight animator that works directly with the qt3ds' graph objects. To enable it pass --dragon-wings to the viewer or set the env variable DRAGONWINGS. Change-Id: I4403b1ac5f8c96a62993fa2043af9c611be64abb Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Make manylayersinquick example a manual test for nowLaszlo Agocs2018-11-167-1/+309
| | | | | | | Will not productize this in 2.2. Change-Id: I6be378671efba1e99f289955a230ac95bdc91a8d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix unlinked properties not being applied when there are no tracksChristian Strømme2018-11-071-0/+60
| | | | | | | | | | | Notifying property changes was delayed until the track starts, but if there's no tracks this will never happen, so instead we now delay the calls until the slide animator (always present) is first called, which happens even if the slide is initially paused. Task-number: QT3DS-2596 Change-Id: I3fd49977b90ac370680446ecbfc7b3301130de34 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Revert "Improve state handling"Christian Strømme2018-11-062-224/+227
| | | | | | | | | | | This commit is introducing to many regressions at this point, so the best option is to revert it now and re-apply once the remaining issue are resolved. This reverts commit 55b43d3e1c3a100f4ad41d94c132afd2a0d029b3. Change-Id: If2733c506aa64a242a4605d81d69f66e2f7aae41 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix dynamic keyframe regressionLaszlo Agocs2018-10-311-0/+56
| | | | | | | | | | | | | Adding the dummy first/last keyframes should be postponed until after the first keyframe is updated by the dynamic keyframe logic. Add also the test scene from the report: clicking the rectangle should only start moving after 2 seconds (assuming you click fast enough after opening the scene) Task-number: QT3DS-2577 Change-Id: If768179c8aafd541798af21d397e1e93164354db Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Improve state handlingChristian Strømme2018-10-292-227/+224
| | | | | | | | | | | | | | | | | | | | This is an attempt to clean up and make the state changes more sane, i.e., by trying do everything once and in the right order. There are still ugliness in this code, but it should be more easily to follow now, aided by extra inline commentary. This change should also improve some of the flickering seen in some examples when changing slides, as we try avoid re-setting stuff when we don't need to. Since time updates for the new slide is deferred until the first time callback, some of the test needed to be changed to their QTRY_* version. Also, there's now a clear distinction between stopped and paused, where paused means the slides progress is stopped at time t, as expected and stopped means the slides values and state is reset to it's initial state. Task-number: QT3DS-1866 Change-Id: I7a9b61ee3ad4a976e0e8d4de386704dcf0d526bf Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Support stereoscopic renderingKaj Grönholm2018-10-241-2/+2
| | | | | | | | | | | | | This patch provides stereoscopic rendering support for Qt Studio qt3d-runtime. Contains API to switch between stereo modes (mono, top-bottom, left-right, analyph red-cyan & green-magenta) and to control eye (camera) separation. Adds menu into Q3DSViewer for these. Task-number: QT3DS-1023 Change-Id: I3da3d34606a07178978eba83236ca6cb6360e893 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Bring View3D and Studio3DProfiler back as publicLaszlo Agocs2018-10-129-495/+2
| | | | | | | This reverts commit 0752ab7e7b7c3d2e5daa6023c4ea93c84b8e45ec. Change-Id: Ie2f71e19a8a05fd1d2554934a9dba235dca9933c Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Generate prop.changes from custom mesh updates as wellLaszlo Agocs2018-10-031-2/+2
| | | | | | | | | | | | | The scene manager must get a notification saying that something has changed in the geometry of a given model (so it can dirty appropriately). Therefore the standard notifyPropertyChange({ ...}) model has to be used for the updateCustomMeshBuffer functions as well. This avoids not updating the content in the 'standalone' test when trying to change geometry after all animations have finished. Change-Id: If9d8a8fa3c69147206803b790f0ea4ec1e59ec72 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Merge remote-tracking branch 'origin/2.1'Christian Strømme2018-09-219-0/+241
|\ | | | | | | Change-Id: I5339cbc7f52608a7bfce10360ed20ba344b9c736
| * Fix getStartAndEndTime()Christian Strømme2018-09-172-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | Take into consideration that a layer on the master slide that doesn't get a property change on a child slide, still has an implicit endTime. Note that this change also contains some textual description of how the function works and some recommendations for future optimizations. The optimizations are left out for now, as they are considered nice to have, but are not critical in any way. Change-Id: I592061f7911489a8130d0374afb10e6213332a67 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * Fix visibility updates for slides without animation tracksChristian Strømme2018-09-171-0/+38
| | | | | | | | | | | | | | | | | | | | | | If there's no animations the nodes won't be marked as dirty, as they are not expected to be changing, but there's at least one exception and that's when the start and end time are not the same as the start and end time of the slide. Task-number: QT3DS-2022 Change-Id: I4cc634c224d41028d5401f28b1b6d9fe348e2f02 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * Fix for certain ignored set-property actionsLaszlo Agocs2018-09-131-0/+37
| | | | | | | | | | | | Task-number: QT3DS-2325 Change-Id: Ia57d5b34be87c46dcd029ce3289d3436f8e643f2 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
| * Add test scene for nested subpresentationsLaszlo Agocs2018-09-125-0/+127
| | | | | | | | | | Change-Id: I47eb82ac17017c969c8e34eb1f7a5d33a4a09fc9 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | Add some new types and an example using the QML APIsChristian Strømme2018-09-205-1/+225
|/ | | | | | | | Contains some basic types for getting the ball rolling, and isn't very usable outside that. Change-Id: Ib4c186e26d7bd142a9fe51bd74ea54a7bf5fd691 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Quick fix for animations getting out of syncChristian Strømme2018-09-071-0/+64
| | | | | | | | | | | | A clip on Qt3D's side gets its duration calculated from the first and last keyframe position, so to make sure we don't end up with animation clips that are shorter then the expected duration, we now insert extra keyframs at the start and end of each clip if needed. This should ensure that the clips are more or less in sync, as expected. Taks-number: QT3DS-2183 Change-Id: Idd2715ede6c8bb2698ed9ea9e2262703cc28866d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Don't use dynamic values when entering the first slideChristian Strømme2018-09-071-0/+54
| | | | | | | | | | | When entering the first slide there's no previous values available, so the initial default value was used. Instead of applying these values we should just skip updating the dynamic values when there's no previous slide. Task-number: QT3DS-2209 Change-Id: I5b8d184c3c27d37758259a0585948a7be9580aff Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Change origin for Right and Bottom calculationsLaszlo Agocs2018-09-071-0/+53
| | | | | | | | | | Right and Bottom are pixels or percentage from the right or bottom side of the output. Until now we treated them as values with the top-left as the origin. Correct this to stay compatible with 3DS1. Task-number: QT3DS-2200 Change-Id: I5ffa1444f2e5b545ff194c4b418c0536765393e9 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Handle Layer.sourcepath changesLaszlo Agocs2018-09-0310-0/+224
| | | | | | | | | ...but only for layers that start out as subpresentations. Changing back and forth between "normal" and subpresentation layers is not supported. Change-Id: Id160f3efee12bd7b1a950635e738a47bc9d890b6 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Fix and test Variant type in data inputLaszlo Agocs2018-08-292-0/+77
| | | | | Change-Id: I7308dad6039fe99751793d70a32d5bc4b0cb003d Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Support Float as a data input typeLaszlo Agocs2018-08-294-1/+86
| | | | | | | Float is equivalent to RangedNumber with no min and max specified. Change-Id: I6d7feaec660034f40a41d59547580a87710bcda0 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Mark View3D and Studio3DProfiler as internal for nowLaszlo Agocs2018-08-239-0/+493
| | | | | | | | | | Also move the example to tests/manual. Hide all public references to these types for now. They are fully usable of course. To be re-enabled in a later release. Change-Id: Ib7f6a53eed131280307821e1f63ddac9856e33fe Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Add Object3D tests covering object orderingLaszlo Agocs2018-08-171-0/+104
| | | | | | | | | ...and fix a small glitch that prevented objects being detached from the parent when m_layer was null (because the object was never attached to a live Layer3D). Change-Id: I2479d255aa150bae085d845dd36061b4ffbf19a9 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Add Object3D infraLaszlo Agocs2018-08-1710-1/+576
| | | | | | | | | | | | | Use Group (and Node) to crystalize the concepts. Fix also some issues in Studio3DEngine. Also changes the pureqml example to a manual test since Studio3DEngine and friends are marked as internal for now, so shipping examples for them along with the regular examples is not desirable yet. Change-Id: I8ab0ad50d1b846cadb6927fcb38afe9dff576c2e Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Fix eyeball changes when changing slidesChristian Strømme2018-08-161-0/+52
| | | | | | | | | | | | When changing slides, always reset to eyeball value to "true" for all objects on the master slide, as the value will be set to false by the current slides property change if needed, or else the eyeball value is implicitly true. Task-number: QT3DS-2084 Change-Id: Ie7906d642edda2ff7bd1e8850cdb0ed0ce5c7eb5 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Don't restart components on the master slide when changing slidesChristian Strømme2018-08-142-0/+100
| | | | | | | | Components on the master slide should not be restarted when changing slides. Task-number: QT3DS-2052 Change-Id: I986e0ad713b7f979d6899a8ef80032d93e371656 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix effect orderLaszlo Agocs2018-08-102-0/+102
| | | | | | | | | | | Object order in the scene graph is front to back (like with Layer). When building the effect chain for rendering (which is back to front by nature) the effect list must be iterated in reverse order. (just like the compositor does for layers) Task-number: QT3DS-2053 Change-Id: I0ef82fe678330f9863a08f0411638f216dbef5f4 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add support for QImage in Q3DSImageLaszlo Agocs2018-08-071-0/+59
| | | | | | | Also fixes changing the filename in the sourcepath property of an Image. Change-Id: Ie805cc288ecda96cdf126ec1d611aa863cb82c48 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* standalone test: Change a const to static constLaszlo Agocs2018-08-061-1/+1
| | | | | | | | | ...to avoid lambda capture trouble: some compilers require stride to be listed in the capture list, while others show a warning saying it is unnecessary. Change-Id: I67a3b2be51b6cfb3df76494f00791c6151d34497 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add flags to Q3DSEffect and check for ReliesOnTimeLaszlo Agocs2018-08-033-0/+118
| | | | | | | Task-number: QT3DS-2025 Task-number: QT3DS-2023 Change-Id: Icd8e5190b078cd78ee13525c522097d94fe45ded Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make effects dynamically spawnable, destroyable, and changeableLaszlo Agocs2018-08-021-2/+2
| | | | | | | | | | | | | | | Also makes it possible to use filenames in effects', custom materials' and behaviors' "class" property. Previously this could only contain an id referring to an entry in the Classes section of the uip document. With programatically constructed scenes the pre-loaded list of effect/material/behavior descriptions is not used. Instead the instances refer directly to filenames (the loaded data is cached like with meshes). Custom materials and behaviors do not yet support changing their "class" at runtime, although they get many of the enablers. Change-Id: I560ab00b9dc447bd19d5ebeb749972873b89ec2c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Allow changing eyeball for effect and behavior via the Q_PROPERTYLaszlo Agocs2018-08-021-2/+2
| | | | | | | | Like Node does. Also add the missing property for effect, for consistency (not that these are used anywhere yet). Change-Id: I8e3e5a0e527cb4e4ea7feca52ec42fe104379c6a Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Introduce custom geometries in Q3DSModelNodeLaszlo Agocs2018-08-011-0/+92
| | | | | | | | | | | Instead of setting a the mesh' source path, one can now also call setCustomMesh with the plain and lightweight object describing the geometry. This will lead to changing sourcepath to #Custom and the engine will generate Qt 3D buffers and geometries from the provided data instead of any file or built-in primitive. Change-Id: I685a20275f99b051190a523bb996f606af5a8182 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Remove a now-unneeded resolveReferences callLaszlo Agocs2018-07-302-1/+4
| | | | | | | | | | | There is now a resolveReferences call in the scenemanager whenever building a scene. Also, add a note in the autotests since there it is still important to have an explicit call. Change-Id: I26d720411c6980c65eb60bbe680cbb10ce8c9cbe Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add a fully standalone C++ manual testLaszlo Agocs2018-07-303-0/+167
| | | | | | | | Complete with acting upon clicking an object and dynamically spawning new objects. Change-Id: Id2df79c011196f38cc6a3738bfb2c207c8638deb Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make Q3DSEngine::setPresentation a first class APILaszlo Agocs2018-07-303-5/+5
| | | | | | | | | | | | | | Previously this was plagued by todos since it did not support any types of subpresentations properly. However, that would not be useful anyway: a programatically constructed and managed scene will have no use of the "static" subpresentation concept, especially if QML is used which provides the standard component and object model. So drop the QVector and make the function take a single presentation only. Change-Id: I4bc6787dd057bfd08a3f542fa8bbac6efde774e0 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make Q3DSCamera default to 0 0 -600 from C++ tooLaszlo Agocs2018-07-303-7/+3
| | | | | | | Remnove the discrepancy between cameras created from uip and code. Change-Id: I8b04199b931b00f3686caf84fbe7e1d0f39c7357 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add missing scene build steps when dyn.adding entire layersLaszlo Agocs2018-07-272-0/+16
| | | | | Change-Id: Idbd015fef9b609c028670f48bd65dca8facffc68 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Update Qt 3D Studio Explorer applicationAndy Nichols2018-07-263-23/+173
| | | | | | | Add many of the feature improvments that are present in the viewer app. Change-Id: I2c307b4cb05773b3f258f61db07114d22a0bd156 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Enable changing properties in SceneExplorerAndy Nichols2018-07-261-3/+9
| | | | | Change-Id: I4721603df7aeddb8ba9f32a7d347c01c1441913c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Enablers for adding and removing layers to the scene at run timeLaszlo Agocs2018-07-162-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding, removing and reordering layers is almost in place now. Some things are still missing when it comes to cameras since the mvp in the vertex shaders for layers introduced on-the-fly is incorrect. Extend also setparent() in the console to allow inserting new subtrees at arbitrary places. Q3DSGraphObject already has the necessary APIs (insertChildNodeAfter and friends). Therefore, doing object(newlayer, newlayer, Layer, null, Slide1) object(newlayer_cam, newlayer_cam, Camera, newlayer, Slide1) ... setparent(newlayer, Scene) Adds the new layer after all existing layers (and thus to the bottom of the stack since the 3D Studio object tree (and the editor's visualization of the tree) assumes front-to-back ordering for the layers which is weird but that's what it is). To instead add to the top (i.e. before the existing Layer children of Scene), we can now do: setparent(newlayer, Scene, null) This also matches what clicking the "Add new layer" button in the editor would do. To implement moving layers around (to change their ordering), one can now simply do setparent(newlayer, Scene, SomeOtherLayer) (or the equivalent using the Q3DSGraphObject APIs) in order to move newlayer after SomeOtherLayer. Change-Id: I9c832e4299cb7398d97a799dce5eaa3cd5518a77 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add some test scriptsLaszlo Agocs2018-07-114-0/+66
| | | | | | | | | | | | | ...and start supporting // comments when loading commands via prgload (we already support this in the autoexec.drgscr, no reason not to do it for other files) Retyping is boring, and what's more important these also show concepts that a higher level API or a new editor implementation would use to manage the scene contents. Change-Id: Iefbe8efee47c475b91efe5b05602eb18b9749791 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix inherited eyeball handling for nodesLaszlo Agocs2018-07-053-0/+200
| | | | | | | | | | | | | | 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>
* Add a handcrafted lights on-off test sceneLaszlo Agocs2018-07-041-0/+65
| | | | | | | | | The file is manually edited to implement toggling eyeball without any scripts or application code. The editor is apparently unable to create actions that change the value of the eyeball property. (sigh) Change-Id: I2a56896c3f0bd73f05cca43e3c279edd59b9c1c4 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Add some tests scenes for ASTC-in-KTXLaszlo Agocs2018-06-287-0/+90
| | | | | | | | Try out 4x4 and 6x5. Task-number: QT3DS-1956 Change-Id: Ic469e43e8fb0da62530abed8592d7daec249fa10 Reviewed-by: Christian Stromme <christian.stromme@qt.io>