summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Kangas <janne.kangas@qt.io>2019-05-24 12:16:36 +0300
committerJanne Kangas <janne.kangas@qt.io>2019-06-03 10:57:44 +0300
commit77d441c8b50fa711d61a86a7272c558cf2e93091 (patch)
treecc31594d8d7b084e3704b30ef11c8342c3fd2542
parent089d283afb8cde5024e60c29eeeeefc5c3c80543 (diff)
Disregard UIP -specified name for material references to images
Drop custom name attribute from image instances that are used as references in material properties (diffusemap etc.) and use material property name instead. This matches the object path given by Editor with the runtime elementpath, f.ex. "Scene.Layer.Rectangle.Material.diffusemap" Change-Id: I972dd0d79af6f4e2428f72906e8dc714c2a5b424 Task-id: QT3DS-3326 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserObjectRefHelper.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserObjectRefHelper.cpp b/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserObjectRefHelper.cpp
index 19af2a9d..4861a5da 100644
--- a/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserObjectRefHelper.cpp
+++ b/src/Runtime/ogl-runtime/src/uipparser/Qt3DSUIPParserObjectRefHelper.cpp
@@ -327,7 +327,13 @@ void CUIPParserObjectRefHelper::CacheStateGraph(IDOMReader &inReader)
if (theNode) {
// Overwrite the name. This assumes that "name" property is always linked.
if (inReader.Att("name", theName)) {
- theNode->m_Name = m_MetaData.Register(theName);
+ // Do not touch the name of an image instance that was renamed in the code
+ // below. i.e. an image that is referred to from a material.
+ if (!(theNode->m_Type == m_MetaData.Register("Image")
+ && m_ImageNamePropertyList.find(theNode->m_Name)
+ != m_ImageNamePropertyList.end())) {
+ theNode->m_Name = m_MetaData.Register(theName);
+ }
}
// Special case for material. Image properties refer to instances.