From b160bfa1f94722346e59a732961ee5f253a75b8d Mon Sep 17 00:00:00 2001 From: Richard Huang Date: Fri, 1 Jul 2022 14:03:09 +0100 Subject: [PATCH 1/1] Make sure to register blendshape weight properties for all the nodes with blendshapes Change-Id: Ia78fe48a91ed98b5313bf90f14a2a98fe6d461ed --- .../public-api/blend-shape-details.cpp | 29 ++++++++++++---------- dali-scene-loader/public-api/scene-definition.cpp | 5 ---- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/dali-scene-loader/public-api/blend-shape-details.cpp b/dali-scene-loader/public-api/blend-shape-details.cpp index 9e76924..8607b15 100644 --- a/dali-scene-loader/public-api/blend-shape-details.cpp +++ b/dali-scene-loader/public-api/blend-shape-details.cpp @@ -52,7 +52,7 @@ void BlendShapes::ConfigureProperties(const std::pair(index))); - shader.RegisterProperty(COMPONENT_SIZE, Property::Value(static_cast(mesh.second.blendShapeBufferOffset))); + shader.RegisterProperty(NUMBER_OF_BLEND_SHAPES, Property::Value(static_cast(index))); + shader.RegisterProperty(COMPONENT_SIZE, Property::Value(static_cast(mesh.second.blendShapeBufferOffset))); - // Create a read only property to preserve the components of the blend shape. - int32_t components = 0x0; - for(auto& bs : mesh.first.mBlendShapes) - { - components |= (bs.deltas.IsDefined() * Component::POSITIONS) | - (bs.normals.IsDefined() * Component::NORMALS) | (bs.tangents.IsDefined() * Component::TANGENTS); + // Create a read only property to preserve the components of the blend shape. + int32_t components = 0x0; + for(auto& bs : mesh.first.mBlendShapes) + { + components |= (bs.deltas.IsDefined() * Component::POSITIONS) | + (bs.normals.IsDefined() * Component::NORMALS) | (bs.tangents.IsDefined() * Component::TANGENTS); + } + shader.RegisterProperty(COMPONENTS, components, Property::AccessMode::READ_ONLY); } - shader.RegisterProperty(COMPONENTS, components, Property::AccessMode::READ_ONLY); } } // namespace SceneLoader diff --git a/dali-scene-loader/public-api/scene-definition.cpp b/dali-scene-loader/public-api/scene-definition.cpp index 9da16fc..ff8bdfa 100644 --- a/dali-scene-loader/public-api/scene-definition.cpp +++ b/dali-scene-loader/public-api/scene-definition.cpp @@ -1097,11 +1097,6 @@ bool SceneDefinition::ConfigureBlendshapeShaders(const ResourceBundle& ++i; } while(true); - requests.erase(std::remove_if(requests.begin(), requests.end(), [](const BlendshapeShaderConfigurationRequest& bscr) { - return !bscr.mShader; - }), - requests.end()); - // Configure the rest. bool ok = true; -- 2.7.4