When coming back to previously loaded document, the sceneId will be
available at model attach time and there will not be separate changed
notification for it.
Fixes: QDS-8585
Change-Id: Ic8fcd4e2ec9123adc39d0c1cdca3bdb86d3a7924
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
MaterialBrowserTexturesModel's hasSingleModelSelection property value
is now updated at context menu open, as that's the only place using it.
This is similar to how hasSceneEnv is handled.
Fixes: QDS-8582
Change-Id: I63871a5557c90a06633eee52840b267d808bfe27
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Textures in material browser can now be applied as light probes to
the active SceneEnvironment node.
Also changed the logic for resolving the active SceneEnvironment node
to prefer a currently single-selected SceneEnvironment node over
the SceneEnvironment node associated with currently active 3D scene.
Fixes: QDS-8472
Change-Id: I9a3a7b9c2fad3c8120e85ade507a7ea66de19f1d
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
When the user right-clicks on an image asset, "Add Light probe" now
appears in the context menu. When the user right-clicks one or more
image assets, "Add texture" or "Add textures" becomes available.
Task-number: QDS-8344
Change-Id: Ia8d8379be2a0a285b33e4a230e08527c18756b47
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Whenever an operation involving an asset image would result in
creation of a new texture node, it now checks first if
a matching texture node already exists and uses that instead.
Fixes: QDS-8435
Change-Id: I3d091aafcd09afdec897bc4da79789c1d84056e8
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Focus is shown by a thicker selection border for material and
texture items. Delete shortcut works on the selected focused item.
Fixes: QDS-8401
Change-Id: I1ddbbd595a0da3f0e2b7cf2bb9e611532770bc3c
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Texture editor, material browser, and UrlChooser all had separate
texture providers that served nearly identical purpose.
Unified all use cases to use same PropertyEditorImageProvider.
This provider is asynchronous, which combined with enabling caching on
Image elements, significantly improves responsiveness of the material
browser UI when there are many textures shown in the browser.
Fixes: QDS-8387
Change-Id: I2888aee2f4320dba9456fa046c9ede319673a3d9
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Disable apply texture to selected model option from texture editor's
toolbar when the selected model has no material. Also relevant fixes
to make sure texture assigning happens in the current state.
Fixes: QDS-8395
Change-Id: Iab2e8fce4696c6bd5d50636b4077362ba04cb8a0
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Apply to selected model/material, delete, duplicate, and
create new options are available in the menu.
Fixes: QDS-8342
Change-Id: Ib9bdc1738500a87361000bcd3e89403e3b8ccef8
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
If material library is missing, material browser and editor UI should
be disabled, except for material editor main pane in case of root
material node.
Change-Id: I3d2bd545de0649fb90d3fe1f751d46b7c7054bbf
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
The previews are cached based on modelnode internal id, which can
overlap between documents, resulting in briefly showing incorrect
preview when new document is opened. Also, never clearing the cache
leads to leaking memory.
Fixed the issue by clearing the preview cache whenever all materials
are removed from browser (model detach and material library deletion).
Change-Id: Idad39fef62871c4e94f35604e643c7195ae9ec81
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
More generally, materials previews are now updated whenever the
instance values on them change.
Fixes: QDS-8096
Change-Id: I07dab4c9cefa241ca5f22e32e6a53e85c31aa252
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Most materials in the material bundle require at least QtQuick3D 6.3,
so we hide the bundle materials from material browser when the detected
module version is less than 6.3.
Fixes: QDS-8100
Change-Id: I9f50b507c3c3c50f821fa6a902995b999da24464
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
The property groups would be unloaded when a model is detached,
and it would be loaded when the model is attached.
The problem was that the unload function was missing for the
MaterialBrowserModel.
Task-number: QDS-7515
Change-Id: I89064a78552c10228c0b18e42c1e0df4a92fb4a6
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
'data' property contains node's children, so it should be ignored
during the 'copy all properties' operation.
Change-Id: Ib056409c9ad0a42ebc40f751173b7a3455d912c6
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
To improve testability external dependencies are now broken with an
interface. It is a first step to test individual units without injection
of source files.
Task-number: QDS-7571
Change-Id: I4255c8668022f1097947e4ea5788f2a6b605365d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Added check that target node is actually a model when applying material.
Fixes: QDS-7843
Change-Id: I6e165280c8b79ebbf8316861fe0eb9b947eac3be
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Now we store the current value of copied properties at copy time
instead of just storing a reference to copied property. This ensures
we paste the correct value.
When copying all properties, properties set by base state,
current state, and active timeline are copied.
Fixes: QDS-7804
Change-Id: Id6315dde96b30304fde007a87da578faaab43233
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
When copying specific set of properties, old values need to be cleared
just like in case of copying all properties to ensure also default
values get copied.
Fixes: QDS-7522
Change-Id: I314ff70b6e611bec3f662b86f964d789618c1df7
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>