2 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali-scene3d/internal/controls/model/model-impl.h>
22 #include <dali-toolkit/dali-toolkit.h>
23 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
24 #include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
25 #include <dali/devel-api/actors/actor-devel.h>
26 #include <dali/integration-api/debug.h>
27 #include <dali/public-api/math/math-utils.h>
28 #include <dali/public-api/object/type-registry-helper.h>
29 #include <dali/public-api/object/type-registry.h>
30 #include <dali/integration-api/adaptor-framework/adaptor.h>
34 #include <dali-scene3d/internal/controls/scene-view/scene-view-impl.h>
35 #include <dali-scene3d/public-api/controls/model/model.h>
36 #include <dali-scene3d/public-api/loader/animation-definition.h>
37 #include <dali-scene3d/public-api/loader/camera-parameters.h>
38 #include <dali-scene3d/public-api/loader/dli-loader.h>
39 #include <dali-scene3d/public-api/loader/gltf2-loader.h>
40 #include <dali-scene3d/public-api/loader/light-parameters.h>
41 #include <dali-scene3d/public-api/loader/load-result.h>
42 #include <dali-scene3d/public-api/loader/node-definition.h>
43 #include <dali-scene3d/public-api/loader/scene-definition.h>
44 #include <dali-scene3d/public-api/loader/shader-definition-factory.h>
58 return Scene3D::Model::New(std::string());
61 // Setup properties, signals and actions using the type-registry.
62 DALI_TYPE_REGISTRATION_BEGIN(Scene3D::Model, Toolkit::Control, Create);
63 DALI_TYPE_REGISTRATION_END()
65 static constexpr uint32_t OFFSET_FOR_DIFFUSE_CUBE_TEXTURE = 2u;
66 static constexpr uint32_t OFFSET_FOR_SPECULAR_CUBE_TEXTURE = 1u;
68 static constexpr Vector3 Y_DIRECTION(1.0f, -1.0f, 1.0f);
70 static constexpr bool DEFAULT_MODEL_CHILDREN_SENSITIVE = false;
71 static constexpr bool DEFAULT_MODEL_CHILDREN_FOCUSABLE = false;
77 pointMin = Vector3(std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), std::numeric_limits<float>::max());
78 pointMax = Vector3(std::numeric_limits<float>::min(), std::numeric_limits<float>::min(), std::numeric_limits<float>::min());
81 void ConsiderNewPointInVolume(const Vector3& position)
83 pointMin.x = std::min(position.x, pointMin.x);
84 pointMin.y = std::min(position.y, pointMin.y);
85 pointMin.z = std::min(position.z, pointMin.z);
87 pointMax.x = std::max(position.x, pointMax.x);
88 pointMax.y = std::max(position.y, pointMax.y);
89 pointMax.z = std::max(position.z, pointMax.z);
92 Vector3 CalculateSize()
94 return pointMax - pointMin;
97 Vector3 CalculatePivot()
99 Vector3 pivot = pointMin / (pointMin - pointMax);
100 for(uint32_t i = 0; i < 3; ++i)
102 // To avoid divid by zero
103 if(Dali::Equals(pointMin[i], pointMax[i]))
115 void ConfigureBlendShapeShaders(
116 Dali::Scene3D::Loader::ResourceBundle& resources, const Dali::Scene3D::Loader::SceneDefinition& scene, Actor root, std::vector<Dali::Scene3D::Loader::BlendshapeShaderConfigurationRequest>&& requests)
118 std::vector<std::string> errors;
119 auto onError = [&errors](const std::string& msg) { errors.push_back(msg); };
120 if(!scene.ConfigureBlendshapeShaders(resources, root, std::move(requests), onError))
122 Dali::Scene3D::Loader::ExceptionFlinger flinger(ASSERT_LOCATION);
123 for(auto& msg : errors)
125 flinger << msg << '\n';
130 void AddModelTreeToAABB(BoundingVolume& AABB, const Dali::Scene3D::Loader::SceneDefinition& scene, const Dali::Scene3D::Loader::Customization::Choices& choices, Dali::Scene3D::Loader::Index iNode, Dali::Scene3D::Loader::NodeDefinition::CreateParams& nodeParams, Matrix parentMatrix)
132 static constexpr uint32_t BOX_POINT_COUNT = 8;
133 static uint32_t BBIndex[BOX_POINT_COUNT][3] = {{0, 0, 0}, {0, 1, 0}, {1, 0, 0}, {1, 1, 0}, {0, 0, 1}, {0, 1, 1}, {1, 0, 1}, {1, 1, 1}};
136 const Dali::Scene3D::Loader::NodeDefinition* node = scene.GetNode(iNode);
137 Matrix localMatrix = node->GetLocalSpace();
138 Matrix::Multiply(nodeMatrix, localMatrix, parentMatrix);
141 if(node->GetExtents(nodeParams.mResources, volume[0], volume[1]))
143 for(uint32_t i = 0; i < BOX_POINT_COUNT; ++i)
145 Vector4 position = Vector4(volume[BBIndex[i][0]].x, volume[BBIndex[i][1]].y, volume[BBIndex[i][2]].z, 1.0f);
146 Vector4 objectPosition = nodeMatrix * position;
147 objectPosition /= objectPosition.w;
149 AABB.ConsiderNewPointInVolume(Vector3(objectPosition));
153 if(node->mCustomization)
155 if(!node->mChildren.empty())
157 auto choice = choices.Get(node->mCustomization->mTag);
158 Dali::Scene3D::Loader::Index i = std::min(choice != Dali::Scene3D::Loader::Customization::NONE ? choice : 0, static_cast<Dali::Scene3D::Loader::Index>(node->mChildren.size() - 1));
160 AddModelTreeToAABB(AABB, scene, choices, node->mChildren[i], nodeParams, nodeMatrix);
165 for(auto i : node->mChildren)
167 AddModelTreeToAABB(AABB, scene, choices, i, nodeParams, nodeMatrix);
172 } // anonymous namespace
174 Model::Model(const std::string& modelUrl, const std::string& resourceDirectoryUrl)
175 : Control(ControlBehaviour(DISABLE_SIZE_NEGOTIATION | DISABLE_STYLE_CHANGE_SIGNALS)),
177 mResourceDirectoryUrl(resourceDirectoryUrl),
179 mNaturalSize(Vector3::ZERO),
180 mModelPivot(AnchorPoint::CENTER),
181 mSceneIblScaleFactor(1.0f),
182 mIblScaleFactor(1.0f),
183 mModelChildrenSensitive(DEFAULT_MODEL_CHILDREN_SENSITIVE),
184 mModelChildrenFocusable(DEFAULT_MODEL_CHILDREN_FOCUSABLE),
185 mModelResourceReady(false),
186 mIblDiffuseResourceReady(true),
187 mIblSpecularResourceReady(true),
188 mIblDiffuseDirty(false),
189 mIblSpecularDirty(false)
195 ResetResourceTasks();
198 Dali::Scene3D::Model Model::New(const std::string& modelUrl, const std::string& resourceDirectoryUrl)
200 Model* impl = new Model(modelUrl, resourceDirectoryUrl);
202 Dali::Scene3D::Model handle = Dali::Scene3D::Model(*impl);
204 // Second-phase init of the implementation
205 // This can only be done after the CustomActor connection has been made...
211 const Actor Model::GetModelRoot() const
216 void Model::SetChildrenSensitive(bool enable)
218 if(mModelChildrenSensitive != enable)
220 mModelChildrenSensitive = enable;
223 mModelRoot.SetProperty(Dali::Actor::Property::SENSITIVE, mModelChildrenSensitive);
228 bool Model::GetChildrenSensitive() const
230 return mModelChildrenSensitive;
233 void Model::SetChildrenFocusable(bool enable)
235 if(mModelChildrenFocusable != enable)
237 mModelChildrenFocusable = enable;
240 mModelRoot.SetProperty(Dali::Actor::Property::KEYBOARD_FOCUSABLE, mModelChildrenFocusable);
241 mModelRoot.SetProperty(Dali::DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN, mModelChildrenFocusable);
246 bool Model::GetChildrenFocusable() const
248 return mModelChildrenFocusable;
251 void Model::SetImageBasedLightSource(const std::string& diffuseUrl, const std::string& specularUrl, float scaleFactor)
253 bool needIblReset = false;
254 bool isOnScene = Self().GetProperty<bool>(Dali::Actor::Property::CONNECTED_TO_SCENE);
255 if(mDiffuseIblUrl != diffuseUrl)
257 mDiffuseIblUrl = diffuseUrl;
258 if(mDiffuseIblUrl.empty())
264 mIblDiffuseDirty = true;
265 mIblDiffuseResourceReady = false;
269 if(mSpecularIblUrl != specularUrl)
271 mSpecularIblUrl = specularUrl;
272 if(mSpecularIblUrl.empty())
278 mIblSpecularDirty = true;
279 mIblSpecularResourceReady = false;
283 // If one or both of diffuse url and specular url are empty,
284 // we don't need to request to load texture.
287 if(mIblDiffuseLoadTask)
289 Dali::AsyncTaskManager::Get().RemoveTask(mIblDiffuseLoadTask);
290 mIblDiffuseLoadTask.Reset();
293 if(mIblSpecularLoadTask)
295 Dali::AsyncTaskManager::Get().RemoveTask(mIblSpecularLoadTask);
296 mIblSpecularLoadTask.Reset();
299 mIblDiffuseDirty = false;
300 mIblSpecularDirty = false;
301 mIblDiffuseResourceReady = true;
302 mIblSpecularResourceReady = true;
304 mDiffuseTexture.Reset();
305 mSpecularTexture.Reset();
306 UpdateImageBasedLightTexture();
310 if(isOnScene && mIblDiffuseDirty)
312 if(mIblDiffuseLoadTask)
314 Dali::AsyncTaskManager::Get().RemoveTask(mIblDiffuseLoadTask);
315 mIblDiffuseLoadTask.Reset();
317 mIblDiffuseLoadTask = new EnvironmentMapLoadTask(mDiffuseIblUrl, Scene3D::EnvironmentMapType::CUBEMAP, MakeCallback(this, &Model::OnIblDiffuseLoadComplete));
318 Dali::AsyncTaskManager::Get().AddTask(mIblDiffuseLoadTask);
319 mIblDiffuseDirty = false;
322 if(isOnScene && mIblSpecularDirty)
324 if(mIblSpecularLoadTask)
326 Dali::AsyncTaskManager::Get().RemoveTask(mIblSpecularLoadTask);
327 mIblSpecularLoadTask.Reset();
329 mIblSpecularLoadTask = new EnvironmentMapLoadTask(mSpecularIblUrl, Scene3D::EnvironmentMapType::CUBEMAP, MakeCallback(this, &Model::OnIblSpecularLoadComplete));
330 Dali::AsyncTaskManager::Get().AddTask(mIblSpecularLoadTask);
331 mIblSpecularDirty = false;
335 if(!Dali::Equals(mIblScaleFactor, scaleFactor))
337 mIblScaleFactor = scaleFactor;
338 UpdateImageBasedLightScaleFactor();
341 // If diffuse and specular textures are already loaded, emits resource ready signal here.
342 if(IsResourceReady())
344 Control::SetResourceReady(false);
348 void Model::SetImageBasedLightTexture(Dali::Texture diffuseTexture, Dali::Texture specularTexture, float scaleFactor)
350 // If input texture is wrong, Model is rendered with SceneView's IBL.
351 if(mDiffuseTexture != diffuseTexture || mSpecularTexture != specularTexture)
353 mDiffuseTexture = diffuseTexture;
354 mSpecularTexture = specularTexture;
355 mIblScaleFactor = scaleFactor;
356 UpdateImageBasedLightTexture();
360 void Model::SetImageBasedLightScaleFactor(float scaleFactor)
362 mIblScaleFactor = scaleFactor;
363 if(mDiffuseTexture && mSpecularTexture)
365 UpdateImageBasedLightScaleFactor();
369 float Model::GetImageBasedLightScaleFactor() const
371 return mIblScaleFactor;
374 uint32_t Model::GetAnimationCount() const
376 return mAnimations.size();
379 Dali::Animation Model::GetAnimation(uint32_t index) const
381 Dali::Animation animation;
382 if(mAnimations.size() > index)
384 animation = mAnimations[index].second;
389 Dali::Animation Model::GetAnimation(const std::string& name) const
391 Dali::Animation animation;
394 for(auto&& animationData : mAnimations)
396 if(animationData.first == name)
398 animation = animationData.second;
406 ///////////////////////////////////////////////////////////
411 void Model::OnInitialize()
413 // Make ParentOrigin as Center.
414 Self().SetProperty(Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
417 void Model::OnSceneConnection(int depth)
419 if(!mModelLoadTask && !mModelRoot)
421 Scene3D::Loader::InitializeGltfLoader();
422 mModelLoadTask = new ModelLoadTask(mModelUrl, mResourceDirectoryUrl, MakeCallback(this, &Model::OnModelLoadComplete));
423 Dali::AsyncTaskManager::Get().AddTask(mModelLoadTask);
425 // If diffuse and specular url is not valid, IBL does not need to be loaded.
426 if(!mDiffuseIblUrl.empty() && !mSpecularIblUrl.empty())
428 SetImageBasedLightSource(mDiffuseIblUrl, mSpecularIblUrl, mIblScaleFactor);
431 Actor parent = Self().GetParent();
434 Scene3D::SceneView sceneView = Scene3D::SceneView::DownCast(parent);
437 GetImpl(sceneView).RegisterSceneItem(this);
438 mParentSceneView = sceneView;
441 parent = parent.GetParent();
444 Control::OnSceneConnection(depth);
447 void Model::OnSceneDisconnection()
449 Scene3D::SceneView sceneView = mParentSceneView.GetHandle();
452 GetImpl(sceneView).UnregisterSceneItem(this);
453 mParentSceneView.Reset();
455 Control::OnSceneDisconnection();
458 Vector3 Model::GetNaturalSize()
462 DALI_LOG_ERROR("Model is still not loaded.\n");
463 return Vector3::ZERO;
469 float Model::GetHeightForWidth(float width)
472 padding = Self().GetProperty<Extents>(Toolkit::Control::Property::PADDING);
473 return Control::GetHeightForWidth(width) + padding.top + padding.bottom;
476 float Model::GetWidthForHeight(float height)
479 padding = Self().GetProperty<Extents>(Toolkit::Control::Property::PADDING);
480 return Control::GetWidthForHeight(height) + padding.start + padding.end;
483 void Model::OnRelayout(const Vector2& size, RelayoutContainer& container)
485 Control::OnRelayout(size, container);
489 bool Model::IsResourceReady() const
491 return mModelResourceReady && mIblDiffuseResourceReady && mIblSpecularResourceReady;
494 void Model::ScaleModel()
499 Vector3 size = Self().GetProperty<Vector3>(Dali::Actor::Property::SIZE);
500 if(size.x > 0.0f && size.y > 0.0f)
503 scale = std::min(size.x / mNaturalSize.x, scale);
504 scale = std::min(size.y / mNaturalSize.y, scale);
506 // Models in glTF and dli are defined as right hand coordinate system.
507 // DALi uses left hand coordinate system. Scaling negative is for change winding order.
508 mModelRoot.SetProperty(Dali::Actor::Property::SCALE, Y_DIRECTION * scale);
512 void Model::FitModelPosition()
516 // Loaded model pivot is not the model center.
517 mModelRoot.SetProperty(Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
518 mModelRoot.SetProperty(Dali::Actor::Property::ANCHOR_POINT, Vector3::ONE - mModelPivot);
522 void Model::CollectRenderableActor(Actor actor)
524 uint32_t rendererCount = actor.GetRendererCount();
527 mRenderableActors.push_back(actor);
530 uint32_t childrenCount = actor.GetChildCount();
531 for(uint32_t i = 0; i < childrenCount; ++i)
533 CollectRenderableActor(actor.GetChildAt(i));
537 void Model::UpdateImageBasedLightTexture()
539 Dali::Texture currentDiffuseTexture = (mDiffuseTexture && mSpecularTexture) ? mDiffuseTexture : mSceneDiffuseTexture;
540 Dali::Texture currentSpecularTexture = (mDiffuseTexture && mSpecularTexture) ? mSpecularTexture : mSceneSpecularTexture;
541 float currentIblScaleFactor = (mDiffuseTexture && mSpecularTexture) ? mIblScaleFactor : mSceneIblScaleFactor;
543 if(!currentDiffuseTexture || !currentSpecularTexture)
545 currentDiffuseTexture = mDefaultDiffuseTexture;
546 currentSpecularTexture = mDefaultSpecularTexture;
547 currentIblScaleFactor = Dali::Scene3D::Loader::EnvironmentDefinition::GetDefaultIntensity();
550 for(auto&& actor : mRenderableActors)
552 Actor renderableActor = actor.GetHandle();
555 uint32_t rendererCount = renderableActor.GetRendererCount();
556 for(uint32_t i = 0; i < rendererCount; ++i)
558 Dali::Renderer renderer = renderableActor.GetRendererAt(i);
561 Dali::TextureSet textures = renderer.GetTextures();
564 uint32_t textureCount = textures.GetTextureCount();
565 // EnvMap requires at least 2 texture, diffuse and specular
566 if(textureCount > 2u)
568 textures.SetTexture(textureCount - OFFSET_FOR_DIFFUSE_CUBE_TEXTURE, currentDiffuseTexture);
569 textures.SetTexture(textureCount - OFFSET_FOR_SPECULAR_CUBE_TEXTURE, currentSpecularTexture);
574 renderableActor.RegisterProperty(Dali::Scene3D::Loader::NodeDefinition::GetIblScaleFactorUniformName().data(), currentIblScaleFactor);
579 void Model::UpdateImageBasedLightScaleFactor()
581 if((!mDiffuseTexture || !mSpecularTexture) &&
582 (!mSceneDiffuseTexture || !mSceneSpecularTexture))
587 float currentIblScaleFactor = (mDiffuseTexture && mSpecularTexture) ? mIblScaleFactor : mSceneIblScaleFactor;
588 for(auto&& actor : mRenderableActors)
590 Actor renderableActor = actor.GetHandle();
593 renderableActor.RegisterProperty(Dali::Scene3D::Loader::NodeDefinition::GetIblScaleFactorUniformName().data(), currentIblScaleFactor);
598 void Model::NotifyImageBasedLightTexture(Dali::Texture diffuseTexture, Dali::Texture specularTexture, float scaleFactor)
600 if(mSceneDiffuseTexture != diffuseTexture || mSceneSpecularTexture != specularTexture)
602 mSceneDiffuseTexture = diffuseTexture;
603 mSceneSpecularTexture = specularTexture;
604 mSceneIblScaleFactor = scaleFactor;
605 // If Model IBL is not set, use SceneView's IBL.
606 if(!mDiffuseTexture || !mSpecularTexture)
608 UpdateImageBasedLightTexture();
613 void Model::NotifyImageBasedLightScaleFactor(float scaleFactor)
615 mSceneIblScaleFactor = scaleFactor;
616 if(mSceneDiffuseTexture && mSceneSpecularTexture)
618 UpdateImageBasedLightScaleFactor();
622 void Model::OnModelLoadComplete()
624 if(!mModelLoadTask->HasSucceeded())
626 ResetResourceTasks();
630 mModelRoot = Actor::New();
631 mModelRoot.SetProperty(Actor::Property::COLOR_MODE, ColorMode::USE_OWN_MULTIPLY_PARENT_COLOR);
634 auto* resources = &(mModelLoadTask->mResources);
635 auto* scene = &(mModelLoadTask->mScene);
636 Dali::Scene3D::Loader::Transforms xforms{Dali::Scene3D::Loader::MatrixStack{}, Dali::Scene3D::Loader::ViewProjection{}};
637 Dali::Scene3D::Loader::NodeDefinition::CreateParams nodeParams{*resources, xforms, {}, {}, {}};
638 uint32_t rootCount = 0u;
639 for(auto iRoot : scene->GetRoots())
641 resources->GenerateResources(mModelLoadTask->mResourceRefCounts[rootCount]);
643 if(auto actor = scene->CreateNodes(iRoot, mModelLoadTask->mResourceChoices, nodeParams))
645 scene->ConfigureSkeletonJoints(iRoot, resources->mSkeletons, actor);
646 scene->ConfigureSkinningShaders(*resources, actor, std::move(nodeParams.mSkinnables));
647 ConfigureBlendShapeShaders(*resources, *scene, actor, std::move(nodeParams.mBlendshapeRequests));
649 scene->ApplyConstraints(actor, std::move(nodeParams.mConstrainables));
651 mModelRoot.Add(actor);
654 AddModelTreeToAABB(AABB, *scene, mModelLoadTask->mResourceChoices, iRoot, nodeParams, Matrix::IDENTITY);
658 if(!resources->mEnvironmentMaps.empty())
660 mDefaultDiffuseTexture = resources->mEnvironmentMaps.front().second.mDiffuse;
661 mDefaultSpecularTexture = resources->mEnvironmentMaps.front().second.mSpecular;
664 if(!mModelLoadTask->mAnimations.empty())
666 auto getActor = [&](const Scene3D::Loader::AnimatedProperty& property)
669 if(property.mNodeIndex != Scene3D::Loader::INVALID_INDEX)
671 auto* node = scene->GetNode(property.mNodeIndex);
674 actor = mModelRoot.FindChildById(node->mNodeId);
679 actor = mModelRoot.FindChildByName(property.mNodeName);
685 for(auto&& animation : mModelLoadTask->mAnimations)
687 Dali::Animation anim = animation.ReAnimate(getActor);
689 mAnimations.push_back({animation.mName, anim});
693 mRenderableActors.clear();
694 CollectRenderableActor(mModelRoot);
696 UpdateImageBasedLightTexture();
697 UpdateImageBasedLightScaleFactor();
699 mNaturalSize = AABB.CalculateSize();
700 mModelPivot = AABB.CalculatePivot();
701 mModelRoot.SetProperty(Dali::Actor::Property::SIZE, mNaturalSize);
702 Vector3 controlSize = Self().GetProperty<Vector3>(Dali::Actor::Property::SIZE);
703 if(Dali::EqualsZero(controlSize.x) || Dali::EqualsZero(controlSize.y))
705 Self().SetProperty(Dali::Actor::Property::SIZE, mNaturalSize);
711 mModelRoot.SetProperty(Dali::Actor::Property::SENSITIVE, mModelChildrenSensitive);
712 mModelRoot.SetProperty(Dali::Actor::Property::KEYBOARD_FOCUSABLE, mModelChildrenFocusable);
713 mModelRoot.SetProperty(Dali::DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN, mModelChildrenFocusable);
715 Self().Add(mModelRoot);
717 Self().SetProperty(Dali::Actor::Property::ANCHOR_POINT, Vector3(mModelPivot.x, 1.0f - mModelPivot.y, mModelPivot.z));
719 mModelResourceReady = true;
721 if(IsResourceReady())
723 Control::SetResourceReady(false);
725 mModelLoadTask.Reset();
728 void Model::OnIblDiffuseLoadComplete()
730 mDiffuseTexture = (mIblDiffuseLoadTask->HasSucceeded()) ? mIblDiffuseLoadTask->GetEnvironmentMap().GetTexture() : Texture();
731 mIblDiffuseResourceReady = true;
732 if(mIblDiffuseResourceReady && mIblSpecularResourceReady)
736 mIblDiffuseLoadTask.Reset();
739 void Model::OnIblSpecularLoadComplete()
741 mSpecularTexture = (mIblSpecularLoadTask->HasSucceeded()) ? mIblSpecularLoadTask->GetEnvironmentMap().GetTexture() : Texture();
742 mIblSpecularResourceReady = true;
743 if(mIblDiffuseResourceReady && mIblSpecularResourceReady)
747 mIblSpecularLoadTask.Reset();
750 void Model::OnIblLoadComplete()
752 UpdateImageBasedLightTexture();
754 if(IsResourceReady())
756 Control::SetResourceReady(false);
760 void Model::ResetResourceTasks()
762 if(Dali::Adaptor::IsAvailable())
766 Dali::AsyncTaskManager::Get().RemoveTask(mModelLoadTask);
767 mModelLoadTask.Reset();
769 if(mIblDiffuseLoadTask)
771 Dali::AsyncTaskManager::Get().RemoveTask(mIblDiffuseLoadTask);
772 mIblDiffuseLoadTask.Reset();
774 if(mIblSpecularLoadTask)
776 Dali::AsyncTaskManager::Get().RemoveTask(mIblSpecularLoadTask);
777 mIblSpecularLoadTask.Reset();
782 } // namespace Internal
783 } // namespace Scene3D