From: seungho baek Date: Wed, 14 Dec 2022 09:12:23 +0000 (+0900) Subject: [Tizen] Change to use AnimatedProperty instead of name for getActor X-Git-Tag: accepted/tizen/7.0/unified/20221228.170449~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c851acfe489572db2a4073b2ead3b0b3e99aede;p=platform%2Fcore%2Fuifw%2Fdali-demo.git [Tizen] Change to use AnimatedProperty instead of name for getActor Change-Id: If7d5a3354b8f75525cde3d84fa0b5cdbabe6ea95 Signed-off-by: seungho baek --- 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)