QmlDesigner: Export materials as user material bundles

If materials are exported as user3D bundles, they will be imported
under 3D scene rather than material library.

Fixes: QDS-14859
Change-Id: Ib0c34113e2b497b48ab686a8e63787b88fcd6b7a
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2025-03-04 17:00:29 +02:00
committed by Mahmoud Badri
parent 1cba6bf5af
commit f94679b61a

View File

@@ -221,7 +221,6 @@ void BundleHelper::exportBundle(const QList<ModelNode> &nodes, const QPixmap &ic
auto compUtils = QmlDesignerPlugin::instance()->documentManager().generatedComponentUtils();
QJsonObject jsonObj;
jsonObj["id"] = compUtils.user3DBundleId();
jsonObj["version"] = BUNDLE_VERSION;
QJsonArray itemsArr;
@@ -235,6 +234,9 @@ void BundleHelper::exportBundle(const QList<ModelNode> &nodes, const QPixmap &ic
if (!isChild)
nodesToExport.append(node);
}
jsonObj["id"] = !nodesToExport.isEmpty() && nodesToExport[0].metaInfo().isQtQuick3DMaterial()
? compUtils.userMaterialsBundleId()
: compUtils.user3DBundleId();
m_remainingFiles = nodesToExport.size() + 1;