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>
Many validation tests can now be skipped.
Task-number: QDS-7454
Change-Id: I01c37ff9747260940400043d2a0e39bb2700ee5b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
We apply not very often the parent to views. So it can lead to dangling
pointer if the parent is used by other objects and does not handle the
null pointer case. It can lead to double deletion if the parent is
deleted before the object when it is on the stack or handled by smart
pointer.
If you really want to use it there is still setParent.
Change-Id: I1fc6b145a50f037a0e9d415fb36e7970ea7296ed
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
TO save space and make material names clearer.
Change-Id: I1cea8787ca03a37adca6e4a0f352732d50bc1b40
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
When apply a material from the material bundle directly to a model in
the 3D scene, check frist if there is an existing material that has no
properties set, if so apply it instead of creating a new instance.
Also few tweaks.
Change-Id: I4ddadfd84442164b671645af5e4f5d9e8dcb7cb0
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
IsSubClass is renamed to isBasedOn and takes now NodeMetaInfo as a
parameter. But for most cases there are is... functions as short cut.
The model is providing shortcut NodeMetaInfos too. This is done in the
sake of caching.
Task-number: QDS-7445
Change-Id: Iff2dea66e253b412105427134bd49cb16ed76193
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Load property groups file only if Quick3D import exists
Change-Id: Idf7b95cb4efa34dde6196964e5e2cbad54341193
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reverts/comments out parts of 45f93a817a,
which needs to be resolved in a follow-up commit.
Conflicts:
cmake/QtCreatorIDEBranding.cmake
qbs/modules/qtc/qtc.qbs
qtcreator_ide_branding.pri
share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp
src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
src/plugins/cmakeprojectmanager/cmakesettingspage.cpp
src/plugins/python/pythoneditor.cpp
src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
src/plugins/scxmleditor/common/colorsettings.cpp
Change-Id: I7f0f7b7120e75a9fc3a8886bc57c17345cbb501b
Component materials can now be seen on material browser and their
properties are properly shown on material editor
Fixes: QDS-7390
Change-Id: I3f7edfe655bdb0da1fa71739c825d09d6101c386
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
If the scene root item is Material subclass, material library is not
created for the scene. Material editor and browser functionalities that
relate to having material library are disabled.
Material editor will always show the material that is the scene root.
Fixes: QDS-7374
Change-Id: Icd1c212c17b59e4a2caa6b3b4d7e615e68b21eb9
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>