summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Kangas <janne.kangas@qt.io>2018-11-23 09:55:09 +0200
committerJanne Kangas <janne.kangas@qt.io>2018-12-04 08:22:08 +0000
commitc3f56555c8b47ab0cc200fb37e182057a4045a19 (patch)
tree4d2fbaec60a4a4f0f608466e8bffa4cc82077e7d
parent2ba5f4d873a1fb04b891238f78868778fd4bc20f (diff)
Do not assert on datainput bind type parsing on custom materials
Editor attempts to parse datainput binding datatypes from other presentations in project to prevent changing datainput type to something incompatible. Custom properties are specific to current open project so there is no way to query datatype for custom property in another project. Therefore on unrecognizable property just return datatype none. Task-ID: QT3DS-2790 Change-Id: Ia90503fe2aade13a98dcd8501e864d8de9ae6513 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r--src/Authoring/QT3DSIMP/Qt3DSImportLib/Qt3DSImportComposerTypes.cpp8
-rw-r--r--src/Authoring/Studio/Application/DataInputListDlg.cpp2
2 files changed, 7 insertions, 3 deletions
diff --git a/src/Authoring/QT3DSIMP/Qt3DSImportLib/Qt3DSImportComposerTypes.cpp b/src/Authoring/QT3DSIMP/Qt3DSImportLib/Qt3DSImportComposerTypes.cpp
index 90c376bb..3d9f1d5c 100644
--- a/src/Authoring/QT3DSIMP/Qt3DSImportLib/Qt3DSImportComposerTypes.cpp
+++ b/src/Authoring/QT3DSIMP/Qt3DSImportLib/Qt3DSImportComposerTypes.cpp
@@ -102,7 +102,9 @@ DataModelDataType::Value SImportControllableObject::GetPropertyDataType(
ITERATE_COMPOSER_MATERIAL_PROPERTIES
ITERATE_COMPOSER_NODE_PROPERTIES
ITERATE_COMPOSER_LIGHT_PROPERTIES
- return SImportAsset::GetPropertyDataType(inPropertyName);
+ // Cannot fall back to SImportAsset as we might receive custom material
+ // properties which are not known to property system and cause assert.
+ return DataModelDataType::None;
}
#undef HANDLE_COMPOSER_PROPERTY_NO_DEFAULT
@@ -180,7 +182,9 @@ DataModelDataType::Value SImportControllableObject::GetPropertyDataType(
ITERATE_COMPOSER_MATERIAL_PROPERTIES
ITERATE_COMPOSER_NODE_PROPERTIES
ITERATE_COMPOSER_LIGHT_PROPERTIES
- return SImportAsset::GetPropertyDataType(inPropertyName);
+ // Cannot fall back to SImportAsset as we might receive custom material
+ // properties which are not known to property system and cause assert.
+ return DataModelDataType::None;
}
#undef HANDLE_COMPOSER_PROPERTY_NO_DEFAULT
diff --git a/src/Authoring/Studio/Application/DataInputListDlg.cpp b/src/Authoring/Studio/Application/DataInputListDlg.cpp
index a03e9dcd..9d5936f7 100644
--- a/src/Authoring/Studio/Application/DataInputListDlg.cpp
+++ b/src/Authoring/Studio/Application/DataInputListDlg.cpp
@@ -321,7 +321,7 @@ void CDataInputListDlg::updateInfo()
= m_dataInputs[m_currentDataInputName]->externalPresBoundTypes.uniqueKeys();
for (auto &k : uniqueKeys) {
m_infoContents->appendRow(QList<QStandardItem *>(
- {new QStandardItem(QObject::tr("<subpresentation>")),
+ {new QStandardItem(QObject::tr("<another presentation>")),
new QStandardItem(k), new QStandardItem()}));
}
}