forked from qt-creator/qt-creator
MaterialBrowser: Fix applying material to model
The material should be applied to a selected model. Fixes: QDS-15038 Change-Id: I86f6c215ac90414dad21d7e4f62d99301b2486e1 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -46,6 +46,11 @@ static bool isTexture(const ModelNode &node)
|
|||||||
return node.metaInfo().isQtQuick3DTexture();
|
return node.metaInfo().isQtQuick3DTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool isModel3D(const ModelNode &node)
|
||||||
|
{
|
||||||
|
return node.metaInfo().isQtQuick3DModel();
|
||||||
|
}
|
||||||
|
|
||||||
static QString propertyEditorResourcesPath()
|
static QString propertyEditorResourcesPath()
|
||||||
{
|
{
|
||||||
#ifdef SHARE_QML_PATH
|
#ifdef SHARE_QML_PATH
|
||||||
@@ -354,8 +359,10 @@ void MaterialBrowserView::selectedNodesChanged([[maybe_unused]] const QList<Mode
|
|||||||
ModelNodes selectedTextures = Utils::filtered(selectedNodeList, isTexture);
|
ModelNodes selectedTextures = Utils::filtered(selectedNodeList, isTexture);
|
||||||
ModelNodes deselectedTextures = Utils::filtered(lastSelectedNodeList, isTexture);
|
ModelNodes deselectedTextures = Utils::filtered(lastSelectedNodeList, isTexture);
|
||||||
|
|
||||||
|
ModelNodes selectedModels = Utils::filtered(selectedNodeList, isModel3D);
|
||||||
|
|
||||||
m_widget->materialBrowserModel()->notifySelectionChanges(selectedMaterials, deselectedMaterials);
|
m_widget->materialBrowserModel()->notifySelectionChanges(selectedMaterials, deselectedMaterials);
|
||||||
m_widget->materialBrowserModel()->setHasModelSelection(!selectedMaterials.isEmpty());
|
m_widget->materialBrowserModel()->setHasModelSelection(!selectedModels.isEmpty());
|
||||||
|
|
||||||
m_widget->materialBrowserTexturesModel()->notifySelectionChanges(selectedTextures,
|
m_widget->materialBrowserTexturesModel()->notifySelectionChanges(selectedTextures,
|
||||||
deselectedTextures);
|
deselectedTextures);
|
||||||
|
Reference in New Issue
Block a user