diff options
-rw-r--r-- | src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp | 6 | ||||
-rw-r--r-- | src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp index 03d5c060..3ee2a01c 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp @@ -997,13 +997,17 @@ void InspectorControlModel::updateAnimateToggleState(InspectorControlBase* inIte } } -bool InspectorControlModel::isTreeRebuildRequired(CInspectableBase* inspectBase) const +bool InspectorControlModel::isTreeRebuildRequired(CInspectableBase* inspectBase) { if (inspectBase != m_inspectableBase || !inspectBase) return true; long theCount = m_inspectableBase->GetGroupCount(); auto refMaterial = getReferenceMaterial(inspectBase); + if (refMaterial != m_refMaterial) { + m_refMaterial = refMaterial; + return true; + } long refMaterialGroupCount = 0; if (refMaterial.Valid()) refMaterialGroupCount = 1; // Only the last group of the refMaterial is used diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h index 89b3e26a..a3140b3e 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h @@ -188,6 +188,7 @@ private: std::vector<MaterialEntry> m_materials; std::vector<MaterialDataEntry> m_matDatas; std::vector<Q3DStudio::CFilePath> m_cachedMatDatas; + qt3dsdm::Qt3DSDMInstanceHandle m_refMaterial; Q3DStudio::CUpdateableDocumentEditor m_UpdatableEditor; @@ -233,7 +234,7 @@ private: int groupIndex); QVector<GroupInspectorControl> computeTree(CInspectableBase *inspectBase); - bool isTreeRebuildRequired(CInspectableBase *inspectBase) const; + bool isTreeRebuildRequired(CInspectableBase *inspectBase); GroupInspectorControl computeGroup(CInspectableBase* inspectBase, int theIndex, bool disableAnimation = false, |