forked from qt-creator/qt-creator
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:
committed by
Mahmoud Badri
parent
1cba6bf5af
commit
f94679b61a
@@ -221,7 +221,6 @@ void BundleHelper::exportBundle(const QList<ModelNode> &nodes, const QPixmap &ic
|
|||||||
|
|
||||||
auto compUtils = QmlDesignerPlugin::instance()->documentManager().generatedComponentUtils();
|
auto compUtils = QmlDesignerPlugin::instance()->documentManager().generatedComponentUtils();
|
||||||
QJsonObject jsonObj;
|
QJsonObject jsonObj;
|
||||||
jsonObj["id"] = compUtils.user3DBundleId();
|
|
||||||
jsonObj["version"] = BUNDLE_VERSION;
|
jsonObj["version"] = BUNDLE_VERSION;
|
||||||
QJsonArray itemsArr;
|
QJsonArray itemsArr;
|
||||||
|
|
||||||
@@ -235,6 +234,9 @@ void BundleHelper::exportBundle(const QList<ModelNode> &nodes, const QPixmap &ic
|
|||||||
if (!isChild)
|
if (!isChild)
|
||||||
nodesToExport.append(node);
|
nodesToExport.append(node);
|
||||||
}
|
}
|
||||||
|
jsonObj["id"] = !nodesToExport.isEmpty() && nodesToExport[0].metaInfo().isQtQuick3DMaterial()
|
||||||
|
? compUtils.userMaterialsBundleId()
|
||||||
|
: compUtils.user3DBundleId();
|
||||||
|
|
||||||
m_remainingFiles = nodesToExport.size() + 1;
|
m_remainingFiles = nodesToExport.size() + 1;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user