Description
If the parent of an entity is changed in a scene graph with more than one level of entities, the entity is not reported as a child of the parent on the backend.
The following code reproduces the issue:
Qt3DCore::QEntity *grandParentNode = new Qt3DCore::QEntity(rootEntity); Qt3DCore::QEntity *parentNode = new Qt3DCore::QEntity(rootEntity); Qt3DCore::QEntity *leafNode = new Qt3DCore::QEntity(rootEntity); grandParentNode->setParent(rootEntity); parentNode->setParent(grandParentNode); leafNode->setParent(parentNode);
A working example is attached, based on cylinder-cpp.
The problem appears to be that m_changeArbiter is not properly set on all of the nodes. I am not sure where the m_changeArbiter should have been set in this case.
However, even with m_changeArbiter set properly, the children of a QEntity will never be propagated correctly to the backend if there are other non-QEntity nodes in the tree. This is because QNode::_q_addChild does not take into account that entity parent/child relationships traverse across non-QEntity nodes (see the implementation of QEntity::parentEntity). This is also illustrated in the attached example.
Actual result:
Expected result:
Attachments
Issue Links
- mentioned in
-
Page Loading...