Any subtree of Nodes can be shown in 3D edit view.
Selecting any Node or their children, or View3D changes the
view in 3D edit view to the relevant scene.
Fixes: QDS-1494
Fixes: QDS-1565
Change-Id: I2d5a6f88bab2a20b74c347351235f79fb530519b
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Changed auto scaler math to use more double precision math to improve
scaling accuracy when camera is zoomed far or gizmo is far from origin.
Change-Id: Ic3020bbf159c0d5d090af9c9b8e8a4aa372d2406
Fixes: QDS-1528
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Float precision becomes issue when calculating ray-plane intersections
for gizmo hit detection when camera is very zoomed (in or out).
Do the critical calculations in double precision to mitigate the issue.
Change-Id: I8c33e17bf19d092e24ab19f8f8f2a54cd83304cc
Fixes: QDS-1526
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Whenever the tool state of 3D edit view changes, creator is notified
to store the state. The stored state is then restored to 3D edit view
when it is restarted. The state persists only for the lifetime of the
creator.
Change-Id: I888b3ba82693a17a2f163924fbae1cfa27593890
Fixes: QDS-1351
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
As global space scaling is not supported, the scaling algorithm could
be simplified a lot. Now scaling gizmos work off the relative distance
along the scaling rod/plane instead of going through global space,
removing the need for complicated and error prone transformations.
Change-Id: Iaf0d5b2f31f10ae0b26b6a59b36e9ee4498838c9
Fixes: QDS-1269
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
A line connecting the pivot point and object center is added to
3D edit view.
Change-Id: Ic265e9a3ab2895761cc92b94c778d68509ef36f1
Fixes: QDS-1474
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
- Imported 3D objects can be dropped correctly on the Edit View 3D.
Non-3D objects are not allowed to be dropped (both imported and
existing items like materials)
- corrected the issue that imported 3D objects were allowed to be dropped
on the form editor while hovering.
- show invalid drop icon on the Edit View 3D if the item in non droppable.
Task-number: QDS-1445
Change-Id: I6de0f6ddd163ae57db6100832083c942b34bfdba
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Clicking undo, redo, delete, or save keyboard hotkeys while the Edit View 3D
has focus is working now.
Additionally this commit introduces a generic command for carrying any
variant data from puppet to creator side. This significantly simplifies
and avoids the boiler plate work of sending actions from puppet to
creator side. Current commands can be ported to use this generic
command but this is not part of this commit. Also a similar command to
work the other way around could be implemented.
Task-number: QDS-1266
Change-Id: I40fdf6b215ce77402250a791ea49cbdcd2a9d6eb
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
For some reason the Qt meta system does not work reliable
for QVector3D. It does work "rotation", but not for "pivot",
despite the fact that both properties are defined in exactly the
same way.
This patch works around the main issue.
There are still a few issues left, but at least the default is
correct now.
Task-number: QDS-1355
Change-Id: I75e2d3adff6967e89c6ce031d744baa12b5e8061
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Also the 2D/3D action updates correctly according to Edit View 3D state.
Task-number: QDS-1385
Change-Id: I95d0994e9c56df25a2988eb9d27994268dd1903d
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
- Proxy dialog removed
- When the QDS window is minimized/maximized, the edit view 3D follows.
The opposite is not true (edit view 3D can be minimized separately).
- Edit view 3D is always on top of QDS window. Only exception is when
a popup is shown (so that the user can handle the popup).
- External apps go normally on top of the edit view 3D.
Known (non critical) issues:
- Activating the edit view 3D doesn't raise() the QDS window, so if an
external app is on top of the edit view 3D then the view is clicked,
the external app will be in between the view and the QDS window.
- Closing the edit view 3D from the x button doesnt work (causes a
restart). This is not in the scope of this commit.
Task-number: QDS-1179
Change-Id: I1dd72590037be295b94735de96772307ba14c59c
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Now edit view will create and remove cameras and light gizmos properly
when cameras and lights are added or deleted.
Change-Id: I858752c1410f3a40ea2adaf538c281aaee94ec58
Fixes: QDS-1267
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Using the MouseArea3D linked to gizmo to manage the drag leads to
slight unwanted drift on the drag plane, as it moves with the gizmo.
Fixed by using a helper MouseArea3D to calculate drag vector.
Helper area's transform is set at mouse press time and is not changed
during the drag.
Change-Id: I50d3f738277bd34005c977423d114abc8dbed520
Fixes: QDS-1312
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Selection box geometry update sets explicit global transform for
selection box root. The transform depends on the target node
parent, so if the parent changes, the box needs to be updated.
Change-Id: Iccf8b7e863bcfe541bbb4f60a4094739a7513e8d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Selection box for zero size items ended up being infinite, which broke
some functionality like fit to camera. Now boxes should be correctly
zero sized for non-model items. This also fixes issues with parent
box size if it has zero size children.
Change-Id: I3c8fae3ee971fbb0cf9e0de2615c107ce97a76f8
Fixes: QDS-1287
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
All the math before checking if the scaling axis is zero can cause
enough rounding errors to make qFuzzyIsNull to not think the value is
zero anymore, so check increase the check range.
Change-Id: I776d44886f061be6c1fd91c09eb8efcfb29e0936
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
When selected node has non-default rotation order or orientation,
gizmos need to account for that.
Change-Id: Ie3817fd057b43f708ac1feea3e98e1e44f56d66a
Fixes: QDS-1290
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Import creates an opaque Component, which can contain one or more
pickable models. We mark all instanceless models pickable according to
the parent instance pickable status and specify the parent instance
as the pick target using a dynamic property.
Change-Id: I05b96ee48eb8f246c50b2254d620b621e2437aa5
Fixes: QDS-1282
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
When changing the view by clicking the axis helper, maintain the
current view camera zoom
Task-number: QDS-1274
Change-Id: Icb502bd70da1e6348be90a52885366393ea072c6
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Multiselection works in 3D edit view with ctrl-click just like it
does on the Design Studio.
Change-Id: I266f2de11758bed064f44dd97cd79189e3e1f831
Fixes: QDS-1265
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
To integrate the 3D edit view in the qml2puppet process,
we create a dialog in the Qt Creator process.
This dialog acts as a proxy that manages the actual window.
For this I introduced a new command that allows showing, hiding, resizing
and moving of the 3D edit view.
The 3D edit view always follows the proxy dialog.
During moving and resizing we hide the window to avoid artefacts.
At this point in time the proxy widget is a dialog, but it could
also be a dockwidget or any other QWidget in the future.
Task-number: QDS-1179
Change-Id: I67ccab49eb2de9ba23098a67b2f9577f6c7fd3ac
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
If eyeball is turned off for object, it shouldn't be pickable in
3D edit view.
Change-Id: Ib9308aaaecc822f448591f249bd96ffb5d0c9c48
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Instead of centering edit camera on selected object, center it on
the selection box, which includes child objects.
Change-Id: I7315a4bcfffc74e72a2b21d0a04fc99ee9f4f3c3
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Object's selection box now includes the bounds of all of its
descendants. Selection boxes of immediate children of a selected
object are also drawn.
Individual/group selection buttons also now work as expected.
Change-Id: Ice7ef9a536e32c6bb6da70fe23bf0a38e72c14f8
Fixes: QDS-1210
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Shortcuts for scale and move were also updated to correct ones.
Change-Id: Iffcad0c81475553003962e65dc059879a237546e
Fixes: QDS-1235
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Axis helper shows up on top right corner of 3D edit view.
Clicking on axis helper arms zooms camera on that side of the selected
object.
Change-Id: Ibd81a933036f7965f825e3dc97ad7156da62e14c
Fixes: QDS-1205
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Existing mouse grab is now released when MouseArea3D is deactivated
or set to no longer grab the mouse. Various gizmos were also set
to follow MouseArea3D's dragging property instead of keeping track
of drag themselves.
Change-Id: I49f968f20b26eb222fc8635b943e9144073fb164
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Edit camera is now controlled as in Qt 3D Studio:
ALT + left button orbits camera.
ALT + middle button pans camera.
ALT + right button zooms camera.
Wheel zooms camera.
Task-number: QDS-1206
Change-Id: Ia72644073d172b00483ceed8bcc5ffb8dce68741
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Added a gizmo for rotating selected object either freely or locked
around X, Y, Z, or camera axis.
Change-Id: Ib43c7dd3fc0f49f384d5920fce21ea932c4fc90d
Task-number: QDS-1196
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This does not cover Utils::MapReduceOption with QVector, and code
that's not compiled on my machine.
Change-Id: Ib63923985c52b1bb74e5ec2068a2bb37469ac618
Reviewed-by: Eike Ziller <eike.ziller@qt.io>