Clear mesh callbacks on clone

This commit is contained in:
Anders Jenbo 2025-06-12 08:48:26 +02:00 committed by GitHub
parent 098e2a6894
commit 952a407f3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,6 +25,9 @@ HRESULT Direct3DRMMeshImpl::Clone(int flags, GUID iid, void** object)
auto* clone = new Direct3DRMMeshImpl(*this);
// We should not call the other meshes callbacks
clone->m_callbacks.clear();
for (auto& group : clone->m_groups) {
// Reusing the same texture and material on the new mesh instead of cloning them might not be correct
if (group.texture) {