From 2c851acfe489572db2a4073b2ead3b0b3e99aede Mon Sep 17 00:00:00 2001 From: seungho baek Date: Wed, 14 Dec 2022 18:12:23 +0900 Subject: [PATCH] [Tizen] Change to use AnimatedProperty instead of name for getActor Change-Id: If7d5a3354b8f75525cde3d84fa0b5cdbabe6ea95 Signed-off-by: seungho baek --- examples/scene3d-model/scene3d-model-example.cpp | 13 ++++++++++--- examples/scene3d/scene3d-example.cpp | 4 ++-- examples/scene3d/scene3d-extension.h | 4 ++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/examples/scene3d-model/scene3d-model-example.cpp b/examples/scene3d-model/scene3d-model-example.cpp index 1ae62e4..bf86b18 100644 --- a/examples/scene3d-model/scene3d-model-example.cpp +++ b/examples/scene3d-model/scene3d-model-example.cpp @@ -216,6 +216,8 @@ public: { mWindow = application.GetWindow(); + mWindow.GetRootLayer().SetProperty(Dali::Layer::Property::BEHAVIOR, Dali::Layer::Behavior::LAYER_3D); + // Get a handle to the mWindow mWindow.SetBackgroundColor(Color::WHITE); @@ -283,11 +285,16 @@ public: mModel.SetImageBasedLightSource(uri_diffuse_texture, uri_specular_texture, 0.6f); mWindow.Add(mModel); + + mModel.ResourceReadySignal().Connect(this, &Scene3DModelExample::ResourceReadySignal); + } + + void ResourceReadySignal(Control control) + { if(mModel.GetAnimationCount() > 0) { - Animation animation = (index == 0u) ? mModel.GetAnimation(0u) : mModel.GetAnimation("idleToSquatClip_0"); - animation.Play(); - animation.SetLoopCount(0); + mModel.GetAnimation(0u).Play(); + mModel.GetAnimation(0u).SetLoopCount(0); } } diff --git a/examples/scene3d/scene3d-example.cpp b/examples/scene3d/scene3d-example.cpp index 2c634c8..fa5ff00 100644 --- a/examples/scene3d/scene3d-example.cpp +++ b/examples/scene3d/scene3d-example.cpp @@ -269,8 +269,8 @@ Actor LoadScene(std::string sceneName, CameraActor camera, std::vectorempty()) { - auto getActor = [&root](const std::string& name) { - return root.FindChildByName(name); + auto getActor = [&root](const Scene3D::Loader::AnimatedProperty& property) { + return root.FindChildByName(property.mNodeName); }; animation = (*animations)[0].ReAnimate(getActor); diff --git a/examples/scene3d/scene3d-extension.h b/examples/scene3d/scene3d-extension.h index d4cc6ca..7317d32 100644 --- a/examples/scene3d/scene3d-extension.h +++ b/examples/scene3d/scene3d-extension.h @@ -94,8 +94,8 @@ private: } auto root = mSceneLoader->mScene; - auto getActor = [&root](const std::string& name) { - return root.FindChildByName(name); + auto getActor = [&root](const Dali::Scene3D::Loader::AnimatedProperty& property) { + return root.FindChildByName(property.mNodeName); }; if(mSceneLoader->mSceneAnimations.size() > animationIndex) -- 2.7.4