From 88e3e9c550db8ac43848341e75ff26f246d12e5d Mon Sep 17 00:00:00 2001 From: OVOAOVO <2410651402@qq.com> Date: Fri, 1 Mar 2024 19:24:08 +0800 Subject: [PATCH] EC World fixed --- .../Source/Editor/ECWorld/ECWorldConsumer.cpp | 30 +++++++++---------- .../Source/Editor/ECWorld/ECWorldConsumer.h | 1 - Engine/Source/ThirdParty/AssetPipeline | 2 +- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/Engine/Source/Editor/ECWorld/ECWorldConsumer.cpp b/Engine/Source/Editor/ECWorld/ECWorldConsumer.cpp index 7a4db0b8..1ab977cb 100644 --- a/Engine/Source/Editor/ECWorld/ECWorldConsumer.cpp +++ b/Engine/Source/Editor/ECWorld/ECWorldConsumer.cpp @@ -76,12 +76,11 @@ void ECWorldConsumer::Execute(const cd::SceneDatabase* pSceneDatabase) auto ParseMeshWithParticles= [&](cd::MeshID meshID, const cd::ParticleEmitter& emitter) { - engine::Entity meshEntity = m_pSceneWorld->GetWorld()->CreateEntity(); - + engine::Entity emitterEntity = m_pSceneWorld->GetWorld()->CreateEntity(); engine::MaterialType* pMaterialType = m_pSceneWorld->GetParticleMaterialType(); const auto& mesh = pSceneDatabase->GetMesh(meshID.Data()); - AddParticleEmitter(meshEntity, mesh, pMaterialType->GetRequiredVertexFormat(),emitter); + AddParticleEmitter(emitterEntity, mesh, pMaterialType->GetRequiredVertexFormat(), emitter); }; // There are multiple kinds of cases in the SceneDatabase: @@ -90,22 +89,23 @@ void ECWorldConsumer::Execute(const cd::SceneDatabase* pSceneDatabase) // 3. Node hierarchy. // Another case is that we want to skip Node/Mesh which alreay parsed previously. std::set parsedMeshIDs; - m_particleMinID = 0; - for (const auto& mesh : pSceneDatabase->GetMeshes()) + if (pSceneDatabase->GetParticleEmitterCount()) { - if (m_meshMinID > mesh.GetID().Data()) - { - continue; - } - - if (pSceneDatabase->GetParticleEmitterCount()) + for (auto& particleEmitter : pSceneDatabase->GetParticleEmitters()) { - ParseMeshWithParticles(mesh.GetID(), pSceneDatabase->GetParticleEmitter(m_particleMinID)); - parsedMeshIDs.insert(mesh.GetID().Data()); - ++m_particleMinID; + ParseMeshWithParticles(particleEmitter.GetMeshID(), particleEmitter); + parsedMeshIDs.insert(particleEmitter.GetID().Data()); } - else + } + else + { + for (const auto& mesh : pSceneDatabase->GetMeshes()) { + if (m_meshMinID > mesh.GetID().Data()) + { + continue; + } + ParseMesh(mesh.GetID(), cd::Transform::Identity()); parsedMeshIDs.insert(mesh.GetID().Data()); } diff --git a/Engine/Source/Editor/ECWorld/ECWorldConsumer.h b/Engine/Source/Editor/ECWorld/ECWorldConsumer.h index 84cfdbfb..8359055a 100644 --- a/Engine/Source/Editor/ECWorld/ECWorldConsumer.h +++ b/Engine/Source/Editor/ECWorld/ECWorldConsumer.h @@ -79,7 +79,6 @@ class ECWorldConsumer final : public cdtools::IConsumer uint32_t m_nodeMinID; uint32_t m_meshMinID; - uint32_t m_particleMinID = 0; }; } \ No newline at end of file diff --git a/Engine/Source/ThirdParty/AssetPipeline b/Engine/Source/ThirdParty/AssetPipeline index dce55bdd..4a5644f7 160000 --- a/Engine/Source/ThirdParty/AssetPipeline +++ b/Engine/Source/ThirdParty/AssetPipeline @@ -1 +1 @@ -Subproject commit dce55bddd8e5f4cbbdb10990e0c3b7886a834052 +Subproject commit 4a5644f700720e95e425a415620d058a32dcf47a