diff options
Diffstat (limited to 'src/engine/Qt3DSRenderRuntimeBinding.cpp')
-rw-r--r-- | src/engine/Qt3DSRenderRuntimeBinding.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/engine/Qt3DSRenderRuntimeBinding.cpp b/src/engine/Qt3DSRenderRuntimeBinding.cpp index 7535af6..3d7dac8 100644 --- a/src/engine/Qt3DSRenderRuntimeBinding.cpp +++ b/src/engine/Qt3DSRenderRuntimeBinding.cpp @@ -254,6 +254,24 @@ struct Qt3DSRenderScene : public Q3DStudio::IScene Q3DStudio::UVariant value; if (theElement.GetAttribute(ATTRIBUTE_SUBPRESENTATION, value)) subs.push_back(m_Context->GetStringTable().HandleToStr(value.m_StringHandle)); + } else if (theTranslator && theTranslator->GetUIPType() + == GraphObjectTypes::CustomMaterial) { + // Add custom material strings to the subpresentation list since any string + // property could be a texture with a subpresentation source. + // Non-subpresentation strings are filtered out by the function caller. + int numProperties = theElement.GetNumProperties(); + for (int i = 0; i < numProperties; ++i) { + auto property = theElement.GetPropertyByIndex(i); + if (property.hasValue()) { + auto value = property.getValue(); + if (value.first.type() == ATTRIBUTETYPE_STRING) { + auto stringValue = m_Context->GetStringTable().HandleToStr( + value.second->m_StringHandle); + if (stringValue.IsValid()) + subs.push_back(stringValue); + } + } + } } } } |