Light icons have a color overlay that indicates light color.
Change-Id: I5f6d80f63d0916dd7cb7b2d5345d586aacd550ef
Fixes: QDS-1209
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
- Slightly larger cam plane rotate ring to avoid overlap
- Scale tool is always local
- Little more transparent and borderless light/cam icons when selected
- Center light/cam icon on the object
Change-Id: Icb24d89fb3ea852b139677aebe797881a12e474a
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 the UX approved camera icons, which will now turn transparent
and ignore mouse events when camera is selected so they do not
interfere with transform gizmos. Frustum visualization also changes
color according to selection state.
Change-Id: Id77066d9abb2b54696fae833201236afa238486a
Fixes: QDS-1208
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
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>
Move and scale shortcuts are temporarily set to (M) and (T) instead of
(W) and (R) to avoid interference with the WASD RF controller
Task-number: QDS-1201
Change-Id: Ia7ebb6c0d39880be6b87b12d0a4a1d16638fd141
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Proof of concept drag and drop implementation. Basic functionality
working but needs polish.
Task-number: QDS-1132
Change-Id: Ie3b9e80de9a414c4955d6e38daf338045bc1e614
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
The default point light is very dim as it has quadratic fade.
Explicitly set fades to zero to make sure edit light is always bright.
Change-Id: I67e3ba0905c2d907d660320c1510556fb3ea5de3
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
QTBUG-79768 has been fixed, so the workaround can be removed.
Change-Id: I649f295cacb8b1b87def58087cd60c7f62dc47c1
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
ScaleGizmo allows scaling in the direction of local or global axes,
as well as uniform scaling. Any scale component cannot be made
negative with ScaleGizmo.
Change-Id: I9b98d9593e07ded340178b07b73fa1b72421ba20
Fixes: QDS-1195
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Mouse press and release are now properly handled by MouseArea3D.
This fixes various issues:
- No need to move the mouse after release for release to register.
- Drag is no longer limited to the 3D edit window, though it is still
limited to the screen.
- Drag arrows no longer register start of drag if you click outside
the arrow and then move the cursor over the arrow while holding the
mouse button down.
Also added the missing center ball to the MoveGizmo to allow free
dragging along the camera plane.
Change-Id: Iab55ae79f8af024534510e5fd29379532ac74025
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
When editing values in the puppet we did not take reflection into account.
This means that any changes we did from the puppet for notified back
from Qt Creator. Since those notifications are asynchronous this leads
to various issues especially when more than one axis (property) was modified
at once.
This patch avoids reflection. The notifications are 'flagged' and then
ignored in the Qt5InformationNodeInstanceServer.
While a node is moved we ignore any changes to that specific node.
Task-number: QDS-1191
Change-Id: Ic74e22ea71832ce12321f9085a7296c2a7d9893d
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
A small icon and a placeholder mesh are displayed at the location of
the lights and cameras in the scene, to provide a way to see and
interact with them.
Change-Id: I1f90fce77a643cab2c3fda3ee2105af53dea57a9
Task-number: QDS-1177
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
We send a ValuesModifiedCommand 'immediately' when the item is moved.
This means the 2D form editor and property editor update
while moving nodes in the 3D edit view.
The updates are 'compressed' by 100ms. This is to avoid performance issues.
The timer could be reduced to 50ms or even 10ms, but 100ms feel
acceptable at least for me.
The code was a bit refactored.
Qt5InformationNodeInstanceServer::modifyVariantValue() can be used later
to update other Vector3D based properties like rotation and scale.
There is one issue left. MouseArea3D emits 'onReleased' only after the
mouse is moved again. This delays the 'commit' of the transaction which
is annoying and can triggers bugs.
Change-Id: I834a1e2658278ff8dd39678f39e51735dee91b65
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This option allows to define transactions for
ValuesChangedCommand and ValuesModifiedCommand.
Change-Id: Ia603027b5c431f1a1912d8959561f92a19fd0243
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
When dragging using move gizmo, a label is displayed that shows the
current position of the selected object.
Change-Id: I2e03b363ce9dcb975bcfe198ffae2e98024d74c8
Fixes: QDS-1129
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Mark 3D objects implicitly pickable upon initialization so that they
receive mouse clicks without having to declare the pickable property
in qml.
Task-number: QDS-1124
Change-Id: Ib8ec5415097c1a9bf57b8965a3fca0c3665f3732
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This proof-of-concept move gadget is based on the move gadget
in studio example of QtQuick3D.
Change-Id: I1b596443a3e99c16ed214bc464c5367a0f7aa503
Fixes: QDS-1125
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
Clicking an object in the 3D object selection view, selects it in the
creator side. Multiselection (i.e. Ctrl+click) is not implemented yet.
Also selected object is not highlighted in the view yet.
Task-number: QDS-1124
Change-Id: I0b10162539ecedc40ed117896e385975c52b04a9
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This method allows to modify properties in the data model from
the puppet. For performance reasons, properties should be modified
in bulks. Each bulk will be one step on the undo stack.
Change-Id: I7dbef02781706c8638981512ca0ec45d24c54545
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
EditView3D.qml can contain errors, most likely because
of QtQuick3D updates.
Change-Id: I85879d9079ba8771a2af4478ba2e4e63a6aa9223
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Light component was split into three different light types in Quick3D.
Change-Id: I409dc4888b389bcb9b8e842f3a6bfeac34f3aaa0
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Without the DesignerWindowManager QtQuick3D items will crash.
Change-Id: Ib4057d581143aed860fa120ab189e11076d1f531
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
We already have valuesChanged() which notifies that a
property of the C++ QObject has changed.
This patch adds valuesModified() which notifies that values
in the data model should be changed.
While valuesChanged() only changes the so called instance value,
valuesModified() does change the internal data model and as
a result the QML code.
This is done in NodeInstanceView::valuesModified().
This enabled the qml2puppet to acutally change values,
like a property editor would.
Change-Id: I2493b9e626c4b194e332a7a096de3dbf2195514a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
We use Quick3DNodeInstance as a proxy class to wrap QQuick3DNode.
The access to private API like QQuick3DNodePrivate::setIsHiddenInEditor()
is restriced by such proxy classes.
Change-Id: If5191c3b730359000cf983c3af206dcffa07be74
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Since the camera is movable the light should follow the camera.
Change-Id: Ia9925f98288ff19a81086e52f3a31fe72b32ee99
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Add edit camera controls and grid helper to 3D edit view.
Task-number: QDS-1127
Change-Id: Ice5ea0fcca18d59dc8a2907710e16c6688b90628
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This patch implements the command and dispatchers for
synchronising the selection between Qt Creator and the qml2puppet.
Qt5InformationNodeInstanceServer::changeSelection() is called whenever the selection
is changed in Qt Creator.
Qt5InformationNodeInstanceServer::changeSelection() allows to change the
selection from the qml2puppet.
Change-Id: I73a64d8dc2a3f330433f966b42a10229cbbff649
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
QMLDESIGNER_QUICK3D_MODE controls if the edit mode should be shown.
Change-Id: I4522dc0887486f329fdb140079e6d644f601c77f
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
A View3D can have multiple root nodes, which are
automatically aggregated in a single root node.
Change-Id: I3ad11eff5a8beadbd53f0fc8cdcaecd78772768b
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
We should enable the 3d edit mode only, if there is
QtQuick3D import. Additionally there should also be an option in the UI.
Change-Id: I2010f2cdd6546c63a2263b8ee02480d4f13177c2
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
We used LSUIElement and QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM
to hide the puppet process on macOS.
Unfortunately such a process cannot get any keyboard focus.
Change-Id: I73ae919a6a2fd5a733e92a37541baccddc135326
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
The eyeball status for QQuickItem is handled in the form editor.
This does not work for QQuick3DNode.
* Adding support for 'invisible' in QmlVisualNode
This allows to handle the 'invisible" state for
both QQuickItem and QQuick3DNode.
* Adding support for 'invisible' in the NodeInstanceServer.
This means that the nodes are actuallly made invisible,
if the AuxiliaryData is set.
Even with this patch there is still a downside. We actually do
hide the QQuick3DNode, which is reflected by the value of 'visible'
in the property editor. This is not correct. The eybeball should not affect
the actual property. To properly implement this we need a way to hide an
item in the scene wihout changing the visibility property.
Task-number: QDS-1065
Change-Id: I713ec97bc89fdd7271b2174756f36ce3731cfd4e
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
If we find a QQuick3DViewport or the root node is a QQuick3DNode,
we create an 3D Edit View QQuickView for 3D editing in the 'editmode'.
This requires to not use the DesignerWindowManager for the 'editmode'.
The current implementation for the 3D Edit View is done in EditView3D.qml,
but can be replaced by a custom EditView class later. At this point in time
there is no hard dependency on QtQuick3D. Once we start to implement
more advanceded editing features, EditView3D.qml has to be replaced by a
custom C++ class with a hard dependency on QtQuick3D.
Currently the scene can be rotated around the 'y' axis, it is possible
to move the camera on the 'z' axis and the custom light can be turned
on and off. This is simply a proof of concept that the 3D Edit View
already allows some user interaction.
Change-Id: I96400e72b0853dde7939c693d1d7300f9c2ab142
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>