summaryrefslogtreecommitdiffstats
path: root/src/runtime/q3dsuippresentation.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2018-10-02 14:41:04 +0200
committerChristian Stromme <christian.stromme@qt.io>2018-10-03 08:25:29 +0000
commitbf024bc30d37c6e3a4213726f1676a132656f4ff (patch)
treea1c179ed196ce8e87833fd51ba8b983a3dc966fe /src/runtime/q3dsuippresentation.cpp
parent063d58d3440eb034ca5f8756135ed90777c563ae (diff)
Generate prop.changes from custom mesh updates as well
The scene manager must get a notification saying that something has changed in the geometry of a given model (so it can dirty appropriately). Therefore the standard notifyPropertyChange({ ...}) model has to be used for the updateCustomMeshBuffer functions as well. This avoids not updating the content in the 'standalone' test when trying to change geometry after all animations have finished. Change-Id: If9d8a8fa3c69147206803b790f0ea4ec1e59ec72 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/runtime/q3dsuippresentation.cpp')
-rw-r--r--src/runtime/q3dsuippresentation.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/runtime/q3dsuippresentation.cpp b/src/runtime/q3dsuippresentation.cpp
index b181dc7..0ee0095 100644
--- a/src/runtime/q3dsuippresentation.cpp
+++ b/src/runtime/q3dsuippresentation.cpp
@@ -3346,14 +3346,22 @@ Q3DSPropertyChange Q3DSModelNode::setCustomMesh(Q3DSGeometry *geom)
return Q3DSPropertyChange(QLatin1String("sourcepath"));
}
-void Q3DSModelNode::updateCustomMeshBuffer(int bufferIdx)
+Q3DSPropertyChange Q3DSModelNode::updateCustomMeshBuffer(int bufferIdx)
{
Q3DSMeshLoader::updateMeshBuffer(*m_customMesh, m_customMeshMapping, bufferIdx);
+
+ // We still need a "property" change notification since there are things
+ // the scenemanager has to do (like marking the layer for the model dirty).
+ // Using sourcepath is not ideal since we do not want the heavyweight
+ // processing (regenerating submeshes and materials is not necessary since
+ // we are merely touching a submesh here). So invent a custom "property".
+ return Q3DSPropertyChange(QLatin1String("_buffer"));
}
-void Q3DSModelNode::updateCustomMeshBuffer(int bufferIdx, int offset, int size)
+Q3DSPropertyChange Q3DSModelNode::updateCustomMeshBuffer(int bufferIdx, int offset, int size)
{
Q3DSMeshLoader::updateMeshBuffer(*m_customMesh, m_customMeshMapping, bufferIdx, offset, size);
+ return Q3DSPropertyChange(QLatin1String("_buffer"));
}
Q3DSGroupNode::Q3DSGroupNode()