Changed object selection to be done on press instead of click, and
the initial press now also starts free drag of the selected object
after a short distance moved to prevent accidental drags.
Change-Id: I61656661cd734d167ef9f8db42d986f0e97402a3
Fixes: QDS-2376
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
The scene id shown on the corner of edit 3D view is updated and
toolstates are also stored under the new id.
Change-Id: Ib3ac2f2bb829a5d908e22932c313c76bd4143592
Fixes: QDS-2277
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Explicit return values in qml functions cause errors in some Qt
versions, so remove the need for it.
Change-Id: Idd3035b19b56c25e94bc846c3de8f7aa5381e1eb
Reviewed-by: Artur Shepilko <artur.shepilko@nomadbyte.com>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Upped default priority of all directional draggables a bit to make
them preferable to free rotation ball.
Change-Id: If934cb723e8c1a8ca9a114d71b19cbfc196e2682
Fixes: QDS-2286
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
It's sometimes hard to tell which scene is shown in 3D edit view, so
added the scene id to the upper left corner of the view.
Task-number: QDS-2239
Change-Id: I5999e41c3f92028cd9a0f79ae0c8b72263d9ce42
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
MouseArea.containsMouse gets confused when the mouse input gets grabbed
by an overlapping 3D mouse area.
Change-Id: I6ee69f217d95c5e4f3f5361e14c932ce0a2feab0
Fixes: QDS-2187
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Labels went under IconGizmos, so increased the z-value to match that
of MoveGizmo label.
Change-Id: I2620db0cadfadc73808a3a9f9967aadf87c9a863
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Also changed the point light mesh to just a single camera plane ring
based on discussions with UX.
Change-Id: If9e847440570bbe87483194c0b417cf09c7084a2
Fixes: QDS-2041
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Inner cone visualization for spotlight was added, as well as drag
handles to adjust inner and outer cone angles and fade.
Fade handle adjusts fades in order: quadratic, linear, constant.
If a specific fade value is zero, the next one in list is chosen
for adjustment.
Change-Id: I921936d9782de511558bc6c24cfa0953cce494f0
Fixes: QDS-2038
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Brightness can be controlled by dragging on the brightness indicator
arrow of the light gizmo in 3D edit view.
Change-Id: I317f5ee08b59bcc0bebf3fdf59861df15ef13c84
Fixes: QDS-2039
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Directional light model was made constant size, as it doesn't have
actual physical presence.
Spot light cone now shows the cone angle correctly and the length of
the cone is calculated so that 5% of the brightness reaches the
center of the cone bottom.
Area light rectangle matches the area of the light.
Point light mesh changed to three perpendicular circles.
Same formula for size of the circles used as for spotlight length.
All light types share a common brightness indicator arrow.
Task-number: QDS-2037
Change-Id: I534dbcda9cfa2a7768c2537868ba83818979b250
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
The closeup option is used for itemlibrary thumbnail generation, where
the regular fit produces too small images on most imports.
Change-Id: I2901a2e20d100b155111f002b22489df945e9e01
Fixes: QDS-1899
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Light gizmo icons and models are now colored based on the light color.
Image provider is used instead of simpler ColorOverlay component,
as ColorOverlay doesn't properly handle transparency when rendered
offscreen in puppet.
Change-Id: If6af915bca9bea2cb48ac23ac6c5ba46dc150e3b
Fixes: QDS-1733
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
There is no keyboard handling on puppet side anymore, so no need to
set focus, either.
Change-Id: I00ebf7de1ac0b339c1323a62a61a1c086123d848
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Also remove the toolbar buttons from the puppet side and few other
clean-ups.
Task-number: QDS-1849
Change-Id: I075753552043a9f1bc649f6baf54dc7b689e4f64
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Qmlpuppet now allows creating icon from qml source code.
Invoke qmlpuppet with following arguments to create icons:
--rendericon <size> <icon file name> <icon qml source>
E.g. --rendericon 24 ~/my_icon.png ~/my_icon.qml
Two icons are created, one with size x size dimensions and
one with double the dimensions and "@2x" injected into the file name.
3D asset import utilizes this icon rendering to produce item library
icons for imported components.
Change-Id: I92c62c80d961f5f61a0ce1c09b32bbcbf80ea56c
Fixes: QDS-1052
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Added icon for spot light gizmo and updated directional light icon.
Removed icons that are no longer needed on puppet side.
Change-Id: Id1e72c80e122250f7edc8a69a0e5720e755b96fc
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Edit 3D view tool state is now always initialized to a stored
"no scene" state if one exists to ensure further scene changes
properly inherit the tool state in all cases.
Change-Id: Ifee5fe58255b51d9dbed57abb2020ea00d94af2c
Fixes: QDS-1750
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Edit 3D view tool state is now inherited from the current tool state
of the 3D view for newly added scenes. If there is a stored tool state
for the scene id, then that is used instead.
Change-Id: I4360d034cf946b1951642f4c2e09344b34825dc2
Fixes: QDS-1730
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Qt 5.15.0 is now the minimum version to enable Edit 3D view.
Change-Id: I15cee59e6a7665477825caa0ae412fc6ac7b570a
Fixes: QDS-1694
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
When there is no 3D node in the qml doc, the view 3D will still be
enabled and manipulate-able. Also few relevant tweaks.
Task-number: QDS-1693
Change-Id: I758f783108b317a6971703bee8e3fb564400ed8b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Edit3D view is now a tab alongside Form Editor.
Buttons were moved to a Creator side task bar on Edit 3D view.
Change-Id: Ia06107e4f855ba512ffea3e628a61558894e800e
Fixes: QDS-1570
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Tool state of the scene is linked to qml id of the scene root, so that
tool states are preserved through delete and undo, which causes
generation of new internal ids for instances.
Tool state storage doesn't currently survive changing of scene root
qml id, as tracking that isn't trivial. It's not enough to simply track
id change commands because model repurposes existing nodes when major
graph changes occur, causing unexpected id changes e.g. when
delete/undo is done.
Change-Id: I74d11ce47e86ce5d29796399c4a91b65980b1597
Fixes: QDS-1536
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Grid zooms in and out according to camera zoom so that grid spacing is
neither too condense nor too sparse. Also changed the grid color to be
a bit darker and few other small tweaks.
PS: if the view camera is panned, the grid will not work correctly.
This is due to issues with the camera zoom calculations and is not part
of this commit.
Task-number: QDS-1566
Change-Id: Ib08d5387b028b8d870df9ecf88a5766eae5a509e
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Now camera frustum visualization should always appear correctly in
3D edit view, as the QSSGRenderCamera node is created at frustum
geometry update time if it's missing. Active scene change
also triggers geometry update for camera gizmos.
Change-Id: If24e97490b2ff6607049b5288c6e167aa29a86b2
Fixes: QDS-1472
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
3D edit view should now update correctly when 3D Nodes and View3D
items are added, removed, or reparented in the scene.
Deleting the active scene will change the active scene to another
existing scene.
Fixes: QDS-1591
Change-Id: Ib885453574e72f486a236264cc10d88cb872e9c7
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
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>
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>
To make things clearer, non-dragged planes of rotate gizmo are hidden
for the duration of the drag. This also hides the wobbling of the
gizmo during a drag when ancestors have non-uniform scaling.
Also corrects the resulting rotation by using dragHelper mouseArea to
lock the drag plane down for the duration of the drag.
Change-Id: I2dda2a78c78d5df62626c6b6c3ed3b18bac37933
Fixes: QDS-1331
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>
When a multiselected light/camera icon is clicked without ctrl pressed,
it now ends up as the single selection as it is supposed to instead
of clearing the entire selection.
Change-Id: Id785cc4cd4ed6100b9bde625e9ccb45646e43b7f
Fixes: QDS-1353
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@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>