#ifndef DALI_SCENE3D_LOADER_BLEND_SHAPE_DETAILS_H
#define DALI_SCENE3D_LOADER_BLEND_SHAPE_DETAILS_H
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-// INTERNAL INCLUDES
-#include "dali-scene3d/public-api/api.h"
-
// EXTERNAL INCLUDES
+#include <dali/public-api/actors/actor.h>
+#include <dali/public-api/common/vector-wrapper.h>
+#include <dali/public-api/object/weak-handle.h>
+#include <dali/public-api/rendering/shader.h>
+#include <limits> ///< for std::numeric_limits
#include <string>
-#include "dali/public-api/actors/actor.h"
-#include "dali/public-api/rendering/shader.h"
-namespace Dali
-{
-namespace Scene3D
-{
-namespace Loader
+// INTERNAL INCLUDES
+#include <dali-scene3d/public-api/api.h>
+
+namespace Dali::Scene3D::Loader
{
struct MeshDefinition;
struct MeshGeometry;
struct DALI_SCENE3D_API BlendShapes
{
+ using Index = uint32_t;
+ static constexpr Index INVALID_INDEX = std::numeric_limits<Index>::max();
+
enum class Version
{
VERSION_1_0,
};
};
+ struct BlendShapeData
+ {
+ std::vector<std::string> names;
+ std::vector<float> weights;
+ std::vector<float> unnormalizeFactors;
+ Version version{Scene3D::Loader::BlendShapes::Version::INVALID};
+ uint32_t bufferOffset{0};
+ int32_t components{0x0};
+ Dali::WeakHandle<Actor> mActor;
+ };
+
// shader properties - animatable (uniforms)
static const char* NUMBER_OF_BLEND_SHAPES; ///< Integer number of blend shapes loaded.
static const char* UNNORMALIZE_FACTOR; ///< Scalar(s) for position components of blend shapes; Version 1.0: float array (1 per blend shape); Version 2.0: single float.
/**
* @brief Registers properties based on the mesh definition (and geometry) and identified by the above string constants,
- * on the given @a shader and @a actor.
+ * on the given @a renderer and @a actor.
+ * @SINCE_2_0.7
*/
- static void ConfigureProperties(const std::pair<MeshDefinition, MeshGeometry>& mesh, Shader shader, Actor actor);
+ static void ConfigureProperties(const BlendShapeData& data, Renderer renderer);
BlendShapes() = delete;
};
-} // namespace Loader
-} // namespace Scene3D
-} // namespace Dali
+} // namespace Dali::Scene3D::Loader
#endif // DALI_SCENE3D_LOADER_BLEND_SHAPE_DETAILS_H