diff options
Diffstat (limited to 'src/Authoring/Qt3DStudio/Palettes/Inspector/InspectorControlView.cpp')
-rw-r--r-- | src/Authoring/Qt3DStudio/Palettes/Inspector/InspectorControlView.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Authoring/Qt3DStudio/Palettes/Inspector/InspectorControlView.cpp b/src/Authoring/Qt3DStudio/Palettes/Inspector/InspectorControlView.cpp index e4e0379f..c642d1e8 100644 --- a/src/Authoring/Qt3DStudio/Palettes/Inspector/InspectorControlView.cpp +++ b/src/Authoring/Qt3DStudio/Palettes/Inspector/InspectorControlView.cpp @@ -289,16 +289,22 @@ QString InspectorControlView::noneString() const bool InspectorControlView::canLinkProperty(int instance, int handle) const { + if (!instance || !handle) + return false; + CDoc *doc = g_StudioApp.GetCore()->GetDoc(); const auto bridge = doc->GetStudioSystem()->GetClientDataModelBridge(); if (bridge->isInsideMaterialContainer(instance)) return false; - if (bridge->IsMaterialBaseInstance(instance)) // all material types are unlinkable + if (handle == bridge->GetSceneAsset().m_Eyeball.m_Property) // eyeball is unlinkable return false; - if (handle == bridge->GetSceneAsset().m_Eyeball.m_Property) // eyeball is unlinkable + // Disallow linking of properties that refer to images as unlinking them is not trivial at all. + qt3dsdm::AdditionalMetaDataType::Value thePropertyMetaData = + doc->GetStudioSystem()->GetPropertySystem()->GetAdditionalMetaDataType(instance, handle); + if (thePropertyMetaData == qt3dsdm::AdditionalMetaDataType::Image) return false; return doc->GetDocumentReader().CanPropertyBeLinked(instance, handle); |