In this commit material library node is created on model attach.
A timer keeps monitoring until it is suitable to create the node.
This will properly move materials into material library for
projects created with previous QDS versions.
Also removed unnecessary handling on new material dragging, as
rewriter now works properly with material library creation.
Fixes: QDS-7178
Change-Id: Idf6f41906e02bc064961d8de9841ba1644bd3552
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Removed preview request call from setValue, as it is called in long
loops during initial project load and added the calls outside those
loops where they already weren't there.
Fixes: QDS-7175
Change-Id: Ia83814a0de6fe801d954373dc8ce0e4920e8a6a6
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Parsing has to happen so material in an old project are correctly
appearing in the material views. Using a timer to wait until it is ok
to create the material editor node. Otherwise errors happen.
Change-Id: I54b532211f8a865c5183fab0fd8c12e5f15b983a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Handle property support for asset drag based on property type rather
than name in order to support properties with any name
(like lightProbe).
Change-Id: I20fd422119db96aebd505b47888c97f0d94bf7f9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Added material library accessor to AbstractView, which creates the
material library and moves existing materials under it in case it
doesn't yet exist. Also added material assignment function to
AbstractView. The reason these were added to AbstractView instead of
being handled e.g. via custom notification in material editor is that
they need to be called from multiple different views in the same
transaction that triggers the need of material library.
Fixes: QDS-7081
Change-Id: If2bb884f87d04c9f3599c2342df66ef51ec238ee
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Creating material library node in response to model change
notifications is problematic, so don't do that.
Fixes: QDS-7075
Change-Id: Ib688d71223a851b8a98e1c8fcfe598f6decdaf16
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Fixed that material editor node was not being created when no materials
exist.
Fixes: QDS-7069
Change-Id: I358c497325e8865fc5f012531783dcbe46c32490
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Without a transaction we will reparse the document for each reparent.
This will make the process very slow if there are e.g. 20 materials
in the document.
The new parent has to be created first. This cannot be part of the same
transaction, because of limiations in the rewriter.
Change-Id: Ie2c587d0f072b8163846c660dc2dd66bee7146c1
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Only check the first asset when dnd multiple assets to be in sync with
the dnd handling in the QML side after drop.
Change-Id: I32ecf6be87284dc8e32f51f674ba082fab7cad7a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
When clicking the open material browser button in the material editor,
focus the material browser window if it is already open. Also do the
same when opening the material editor by double clicking a material
in the material browser.
Fixes: QDS-7006
Change-Id: If64d1ff6595dea5e33771485622322df708405d9
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
When there is no valid model selected, disable the "apply to selected"
actions in the material editor and browser.
Change-Id: Id8e771c64e69c0ba2f42dff01d19ffbf4afafb77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>