diff options
-rw-r--r-- | src/runtime/Qt3DSApplication.cpp | 13 | ||||
-rw-r--r-- | src/runtime/Qt3DSQmlElementHelper.cpp | 7 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/runtime/Qt3DSApplication.cpp b/src/runtime/Qt3DSApplication.cpp index c597802..1abc903 100644 --- a/src/runtime/Qt3DSApplication.cpp +++ b/src/runtime/Qt3DSApplication.cpp @@ -1950,8 +1950,19 @@ struct SApp : public IApplication if (iter != m_AssetMap.end() && iter->second->getType() == AssetValueTypes::Presentation) { CPresentation *ret = iter->second->getData<SPresentationAsset>().m_Presentation; - if (!ret && load) + if (!ret && load) { AssetHandlers::handlePresentation(*this, *iter->second); + SPresentationAsset &thePresentationAsset + = *iter->second->getDataPtr<SPresentationAsset>(); + CPresentation *thePresentation = thePresentationAsset.m_Presentation; + if (thePresentation) { + QT3DS_PERF_SCOPED_TIMER(m_CoreFactory->GetPerfTimer(), + "Application: SetActivityZone") + thePresentation->SetActivityZone( + &m_ActivityZoneManager->CreateActivityZone(*thePresentation)); + thePresentation->SetActive(thePresentationAsset.m_Active); + } + } return iter->second->getData<SPresentationAsset>().m_Presentation; } } diff --git a/src/runtime/Qt3DSQmlElementHelper.cpp b/src/runtime/Qt3DSQmlElementHelper.cpp index 0becf4f..77196ae 100644 --- a/src/runtime/Qt3DSQmlElementHelper.cpp +++ b/src/runtime/Qt3DSQmlElementHelper.cpp @@ -325,6 +325,13 @@ bool CQmlElementHelper::SetAttribute(TElement *theElement, const char *theAttNam else return false; + if (attributeAndValue.attribute.m_Hash == Q3DStudio::ATTRIBUTE_SUBPRESENTATION) { + auto presentation = theElement->GetBelongedPresentation(); + auto stringValue = presentation->GetStringTable().HandleToStr( + attributeAndValue.value.m_StringHandle); + presentation->GetApplication().LoadAndGetPresentationById(stringValue.c_str()); + } + return true; } |