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 using System.Runtime.InteropServices;
20 using System.ComponentModel;
22 using Tizen.NUI.Binding;
23 using Tizen.NUI.BaseComponents;
25 namespace Tizen.NUI.Scene3D
28 /// Model is a Class to show 3D mesh objects.
29 /// Model supports glTF 2.0 and DLI model formats.
30 /// Physically Based Rendering with Image Based Lighting is also supported.
34 /// Since NUI uses a left-handed coordinate system, loaded models are transformed into a left-handed coordinate system with Y pointing down.
35 /// The Animations defined in the glTF or DLI are also loaded and can be retrieved by using <see cref="GetAnimation(uint)"/> and <see cref="GetAnimation(string)"/> methods.
36 /// The number of animation is also retrieved by GetAnimationCount() method.
38 /// Model also supports Physically Based Rendering(PBR) with Image Based Lighting(IBL).
39 /// For the IBL, two cube map textures(diffuse and specular) are required.
40 /// Model supports 4 types layout for Cube Map: Vertical/Horizontal Cross layouts, and Vertical/Horizontal Array layouts.
41 /// And also, ktx format with cube map is supported.
43 /// The model and IBL textures start to be loaded asynchronously when the Model object is on Window.
44 /// ResourcesLoaded signal notifies that the loading of the model and IBL resources have been completed.
45 /// If Model or IBL is requested to be loaded before the other loading is completed, the ResourcesLoaded signal is called after all resources are loaded.
46 /// <see cref="GetAnimation(uint)"/> and <see cref="GetAnimation(string)"/> methods can be used after the model loading is finished.
48 /// By default, the loaded mesh has its own size and <see cref="PivotPoint"/> inferred from position of vertices.
49 /// The <see cref="PivotPoint"/> can be modified after model loading is finished.
50 /// If user set size property, the mesh will be scaled to the input size.
51 /// Default value of <see cref="ParentOrigin"/> of the Model is Center.
56 /// Model model = new Model(modelUrl)
58 /// Size = new Size(width, height),
60 /// model.ResourcesLoaded += (s, e) =>
62 /// model.PivotPoint = new Vector3(0.5f, 0.5f, 0.5f); // Use center as a Pivot.
64 /// int animationCount = model.GetAnimationCount();
65 /// if(animationCount > 0)
67 /// // Play an Animation of index 0.
68 /// model.GetAnimation(0).Play();
71 /// model.SetImageBasedLightSource(diffuseUrl, specularUrl, scaleFactor);
72 /// window.Add(model);
76 /// <since_tizen> 10 </since_tizen>
77 public partial class Model : View
79 internal Model(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
84 /// Create an initialized Model.
86 /// <param name="modelUrl">model file url.(e.g. glTF, and DLI).</param>
87 /// <param name="resourceDirectoryUrl"> The url to derectory containing resources: binary, image etc.</param>
89 /// If resourceDirectoryUrl is empty, the parent directory url of modelUrl is used for resource url.
91 /// http://tizen.org/privilege/mediastorage for local files in media storage.
92 /// http://tizen.org/privilege/externalstorage for local files in external storage.
94 /// <since_tizen> 10 </since_tizen>
95 public Model(string modelUrl, string resourceDirectoryUrl = "") : this(Interop.Model.ModelNew(modelUrl, resourceDirectoryUrl), true)
97 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
98 this.PositionUsesPivotPoint = true;
102 /// Create an initialized Model.
104 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
105 [EditorBrowsable(EditorBrowsableState.Never)]
106 public Model() : this(Interop.Model.ModelNew(), true)
108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109 this.PositionUsesPivotPoint = true;
113 /// Copy constructor.
115 /// <param name="model">Source object to copy.</param>
116 /// <since_tizen> 10 </since_tizen>
117 public Model(Model model) : this(Interop.Model.NewModel(Model.getCPtr(model)), true)
119 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
120 this.PositionUsesPivotPoint = model.PositionUsesPivotPoint;
124 /// Assignment operator.
126 /// <param name="model">Source object to be assigned.</param>
127 /// <returns>Reference to this.</returns>
128 internal Model Assign(Model model)
130 Model ret = new Model(Interop.Model.ModelAssign(SwigCPtr, Model.getCPtr(model)), false);
131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
132 ret.PositionUsesPivotPoint = model.PositionUsesPivotPoint;
137 /// Set/Get the ImageBasedLight ScaleFactor.
138 /// Scale factor controls light source intensity in [0.0f, 1.0f]
140 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
141 [EditorBrowsable(EditorBrowsableState.Never)]
142 public float ImageBasedLightScaleFactor
146 SetImageBasedLightScaleFactor(value);
150 return GetImageBasedLightScaleFactor();
155 /// Retrieves root ModelNode of this Model.
157 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
158 [EditorBrowsable(EditorBrowsableState.Never)]
159 public ModelNode ModelRoot
163 return GetModelRoot();
168 /// Adds modelNode to this Model.
170 /// <param name="modelNode">Root of a ModelNode tree</param>
171 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
172 [EditorBrowsable(EditorBrowsableState.Never)]
173 public void AddModelNode(ModelNode modelNode)
175 Interop.Model.AddModelNode(SwigCPtr, ModelNode.getCPtr(modelNode));
176 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180 /// Removes modelNode from this Model.
182 /// <param name="modelNode">Root of a ModelNode tree to be removed</param>
183 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
184 [EditorBrowsable(EditorBrowsableState.Never)]
185 public void RemoveModelNode(ModelNode modelNode)
187 Interop.Model.RemoveModelNode(SwigCPtr, ModelNode.getCPtr(modelNode));
188 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192 /// Removes Returns a child ModelNode object with a name that matches nodeName.
194 /// <param name="nodeName">The name of the child ModelNode object you want to find.</param>
195 /// <returns>Child ModelNode that has nodeName as name.</returns>
196 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
197 [EditorBrowsable(EditorBrowsableState.Never)]
198 public ModelNode FindChildModelNodeByName(string nodeName)
200 global::System.IntPtr cPtr = Interop.Model.FindChildModelNodeByName(SwigCPtr, nodeName);
201 ModelNode ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as ModelNode;
204 // Store the value of PositionUsesAnchorPoint from dali object (Since View object automatically change PositionUsesPivotPoint value as false, we need to keep value.)
205 HandleRef handle = new HandleRef(this, cPtr);
206 bool originalPositionUsesAnchorPoint = Object.InternalGetPropertyBool(handle, View.Property.PositionUsesAnchorPoint);
207 handle = new HandleRef(null, IntPtr.Zero);
209 // Register new animatable into Registry.
210 ret = new ModelNode(cPtr, true);
211 ret.PositionUsesPivotPoint = originalPositionUsesAnchorPoint;
215 // We found matched NUI animatable. Reduce cPtr reference count.
216 HandleRef handle = new HandleRef(this, cPtr);
217 Tizen.NUI.Interop.BaseHandle.DeleteBaseHandle(handle);
218 handle = new HandleRef(null, IntPtr.Zero);
220 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225 /// Changes Image Based Light according to the given input textures.
227 /// <param name="diffuseUrl">The path of Cube map image that will be used as a diffuse IBL source.</param>
228 /// <param name="specularUrl">The path of Cube map image that will be used as a specular IBL source.</param>
229 /// <param name="scaleFactor">Scale factor that controls light source intensity in [0.0f, 1.0f]. Default value is 1.0f.</param>
231 /// http://tizen.org/privilege/mediastorage for local files in media storage.
232 /// http://tizen.org/privilege/externalstorage for local files in external storage.
234 /// <since_tizen> 10 </since_tizen>
235 public void SetImageBasedLightSource(string diffuseUrl, string specularUrl, float scaleFactor = 1.0f)
237 Interop.Model.SetImageBasedLightSource(SwigCPtr, diffuseUrl, specularUrl, scaleFactor);
238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
242 /// Gets number of animations that has been loaded from model file.
245 /// This method should be called after Model load has been finished.
247 /// <returns>The number of loaded animations.</returns>
248 /// <since_tizen> 10 </since_tizen>
249 public uint GetAnimationCount()
251 uint ret = Interop.Model.GetAnimationCount(SwigCPtr);
252 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
257 /// Gets animation at the index.
260 /// This method should be called after Model load has been finished.
262 /// <param name="index">Index of animation to be retrieved.</param>
263 /// <returns>Animation at the index.</returns>
264 /// <since_tizen> 10 </since_tizen>
265 public Animation GetAnimation(uint index)
267 global::System.IntPtr cPtr = Interop.Model.GetAnimation(SwigCPtr, index);
268 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Animation;
271 // Register new animation into Registry.
272 ret = new Animation(cPtr, true);
276 // We found matched NUI animation. Reduce cPtr reference count.
277 HandleRef handle = new HandleRef(this, cPtr);
278 Tizen.NUI.Interop.Animation.DeleteAnimation(handle);
279 handle = new HandleRef(null, IntPtr.Zero);
281 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
286 /// Retrieves animation with the given name.
287 /// Note: This method should be called after Model load finished.
289 /// <param name="name">String name of animation to be retrieved.</param>
290 /// <returns>Animation that has the given name.</returns>
291 /// <since_tizen> 10 </since_tizen>
292 public Animation GetAnimation(string name)
294 global::System.IntPtr cPtr = Interop.Model.GetAnimation(SwigCPtr, name);
295 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Animation;
298 // Register new animation into Registry.
299 ret = new Animation(cPtr, true);
303 // We found matched NUI animation. Reduce cPtr reference count.
304 HandleRef handle = new HandleRef(this, cPtr);
305 Tizen.NUI.Interop.Animation.DeleteAnimation(handle);
306 handle = new HandleRef(null, IntPtr.Zero);
308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
313 /// Gets number of camera parameters that has been loaded from model file.
316 /// This method should be called after Model load has been finished.
318 /// <returns>The number of loaded camera parameters.</returns>
319 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
320 [EditorBrowsable(EditorBrowsableState.Never)]
321 public uint GetCameraCount()
323 uint ret = Interop.Model.GetCameraCount(SwigCPtr);
324 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
329 /// Generate Camera using camera parameters at the index.
330 /// If camera parameter is valid, create new Camera.
331 /// Else, return empty Handle.
334 /// This method should be called after Model load has been finished.
336 /// <param name="index">Index of camera to be generated.</param>
337 /// <returns>Generated Camera by the index, or empty Handle if generation failed.</returns>
338 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
339 [EditorBrowsable(EditorBrowsableState.Never)]
340 public Camera GenerateCamera(uint index)
342 global::System.IntPtr cPtr = Interop.Model.GenerateCamera(SwigCPtr, index);
343 Camera ret = new Camera(cPtr, true); // Always create new camera.
344 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
349 /// Apply camera parameters at the index to inputed Camera.
350 /// If camera parameter is valid and camera is not empty, apply parameters.
351 /// It will change camera's transform and near / far / fov or orthographic size / aspect ratio (if defined)
354 /// This method should be called after Model load has been finished.
356 /// <param name="index">Index of camera to be retrieved.</param>
357 /// <param name="camera">Camera to be applied parameter.</param>
358 /// <returns>True if Apply successed. False otherwise.</returns>
359 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
360 [EditorBrowsable(EditorBrowsableState.Never)]
361 public bool ApplyCamera(uint index, Camera camera)
364 if (camera?.HasBody() == true)
366 ret = Interop.Model.ApplyCamera(SwigCPtr, index, Camera.getCPtr(camera));
367 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
373 /// Load bvh animation and assign to model.
374 /// Scale is additional scale factor of bvh animation. It is possible that
375 /// Model's scale may not matched with bvh animation scale.
376 /// If scale is null, default use as Vector3.ONE
378 /// <param name="bvhFilename">Name of bvh format file.</param>
379 /// <param name="scale">Scale value of bvh animation match with model.</param>
380 /// <param name="translateRootFromModelNode">Whether we should translate the bvh root from it's ModelNode position or not.</param>
381 /// <returns>Animaion of bvh</returns>
382 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
383 [EditorBrowsable(EditorBrowsableState.Never)]
384 [Obsolete("Do not use this LoadBvhAnimation. Use MotionData.LoadMotionCaptureAnimation and GenerateMotionDataAnimation instead.")]
385 public Animation LoadBvhAnimation(string bvhFilename, Vector3 scale = null, bool translateRootFromModelNode = true)
387 global::System.IntPtr cPtr = Interop.Model.LoadBvhAnimation(SwigCPtr, bvhFilename, Vector3.getCPtr(scale), translateRootFromModelNode);
388 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Animation;
391 // Register new animation into Registry.
392 ret = new Animation(cPtr, true);
396 // We found matched NUI animation. Reduce cPtr reference count.
397 HandleRef handle = new HandleRef(this, cPtr);
398 Tizen.NUI.Interop.Animation.DeleteAnimation(handle);
399 handle = new HandleRef(null, IntPtr.Zero);
401 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
406 /// Load bvh animation and assign to model.
407 /// Scale is additional scale factor of bvh animation. It is possible that
408 /// Model's scale may not matched with bvh animation scale.
409 /// If scale is null, default use as Vector3.ONE
411 /// <param name="bvhBuffer">Contents of bvh format file.</param>
412 /// <param name="scale">Scale value of bvh animation match with model.</param>
413 /// <param name="translateRootFromModelNode">Whether we should translate the bvh root from it's ModelNode position or not.</param>
414 /// <returns>Animaion of bvh</returns>
415 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
416 [EditorBrowsable(EditorBrowsableState.Never)]
417 [Obsolete("Do not use this LoadBvhAnimationFromBuffer. Use MotionData.LoadMotionCaptureAnimationFromBuffer and GenerateMotionDataAnimation instead.")]
418 public Animation LoadBvhAnimationFromBuffer(string bvhBuffer, Vector3 scale = null, bool translateRootFromModelNode = true)
420 global::System.IntPtr cPtr = Interop.Model.LoadBvhAnimationFromBuffer(SwigCPtr, bvhBuffer, bvhBuffer.Length, Vector3.getCPtr(scale), translateRootFromModelNode);
421 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Animation;
424 // Register new animation into Registry.
425 ret = new Animation(cPtr, true);
429 // We found matched NUI animation. Reduce cPtr reference count.
430 HandleRef handle = new HandleRef(this, cPtr);
431 Tizen.NUI.Interop.Animation.DeleteAnimation(handle);
432 handle = new HandleRef(null, IntPtr.Zero);
434 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
439 /// Load facial animation and assign to model.
441 /// <param name="facialFilename">Name of json format file what we predefined.</param>
442 /// <returns>Animaion of facial</returns>
443 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
444 [EditorBrowsable(EditorBrowsableState.Never)]
445 [Obsolete("Do not use this LoadFacialAnimation. Use MotionData.LoadBlendShapeAnimation and GenerateMotionDataAnimation instead.")]
446 public Animation LoadFacialAnimation(string facialFilename)
448 return LoadBlendShapeAnimation(facialFilename);
452 /// Load facial animation and assign to model.
454 /// <param name="facialBuffer">Contents of json format file what we predefined.</param>
455 /// <returns>Animaion of facial</returns>
456 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
457 [EditorBrowsable(EditorBrowsableState.Never)]
458 [Obsolete("Do not use this LoadFacialAnimationFromBuffer. Use MotionData.LoadBlendShapeAnimationFromBuffer and GenerateMotionDataAnimation instead.")]
459 public Animation LoadFacialAnimationFromBuffer(string facialBuffer)
461 return LoadBlendShapeAnimationFromBuffer(facialBuffer);
465 /// Load blendshape animation and assign to model from json file.
467 /// <param name="jsonFilename">Name of json format file what we predefined.</param>
468 /// <returns>Animaion of facial</returns>
469 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
470 [EditorBrowsable(EditorBrowsableState.Never)]
471 [Obsolete("Do not use this LoadBlendShapeAnimation. Use MotionData.LoadBlendShapeAnimation and GenerateMotionDataAnimation instead.")]
472 public Animation LoadBlendShapeAnimation(string jsonFilename)
474 global::System.IntPtr cPtr = Interop.Model.LoadBlendShapeAnimation(SwigCPtr, jsonFilename);
475 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Animation;
478 // Register new animation into Registry.
479 ret = new Animation(cPtr, true);
483 // We found matched NUI animation. Reduce cPtr reference count.
484 HandleRef handle = new HandleRef(this, cPtr);
485 Tizen.NUI.Interop.Animation.DeleteAnimation(handle);
486 handle = new HandleRef(null, IntPtr.Zero);
488 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
493 /// Load morphing animation and assign to model from json string.
495 /// <param name="jsonBuffer">Contents of json format file what we predefined.</param>
496 /// <returns>Animaion of facial</returns>
497 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
498 [EditorBrowsable(EditorBrowsableState.Never)]
499 [Obsolete("Do not use this LoadBlendShapeAnimationFromBuffer. Use MotionData.LoadBlendShapeAnimationFromBuffer and GenerateMotionDataAnimation instead.")]
500 public Animation LoadBlendShapeAnimationFromBuffer(string jsonBuffer)
502 global::System.IntPtr cPtr = Interop.Model.LoadBlendShapeAnimationFromBuffer(SwigCPtr, jsonBuffer, jsonBuffer.Length);
503 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Animation;
506 // Register new animation into Registry.
507 ret = new Animation(cPtr, true);
511 // We found matched NUI animation. Reduce cPtr reference count.
512 HandleRef handle = new HandleRef(this, cPtr);
513 Tizen.NUI.Interop.Animation.DeleteAnimation(handle);
514 handle = new HandleRef(null, IntPtr.Zero);
516 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
521 /// Generate animation by MotionData.
522 /// If there is no animatable item for MotionData, return null.
524 /// <param name="motionData">Source motion data.</param>
525 /// <returns>Generated animation from then given motion data, or null if there is no animatable item in <paramref name="motionData"/></returns>
526 /// <since_tizen> 11 </since_tizen>
527 public Animation GenerateMotionDataAnimation(MotionData motionData)
529 global::System.IntPtr cPtr = Interop.Model.GenerateMotionDataAnimation(SwigCPtr, MotionData.getCPtr(motionData));
530 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Animation;
533 // Register new animation into Registry.
534 ret = new Animation(cPtr, true);
538 // We found matched NUI animation. Reduce cPtr reference count.
539 HandleRef handle = new HandleRef(this, cPtr);
540 Tizen.NUI.Interop.Animation.DeleteAnimation(handle);
541 handle = new HandleRef(null, IntPtr.Zero);
543 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
545 // It is possible if there is no animatable properties exist on inputed motionData.
546 // In this case, let we return null.
556 /// Set values from MotionData.
557 /// Note that this method doesn not apply KeyFrames animation.
558 /// If you want to apply the animation, please use <see cref="GenerateMotionDataAnimation(MotionData)"/> and play the result.
560 /// <param name="motionData">Source motion data.</param>
561 /// <since_tizen> 11 </since_tizen>
562 public void SetMotionData(MotionData motionData)
564 Interop.Model.SetMotionData(SwigCPtr, MotionData.getCPtr(motionData));
565 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
569 /// Retrieves model root Actor.
571 /// <returns>Root View of the model.</returns>
572 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
573 [EditorBrowsable(EditorBrowsableState.Never)]
574 private ModelNode GetModelRoot()
576 global::System.IntPtr cPtr = Interop.Model.GetModelRoot(SwigCPtr);
577 ModelNode ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as ModelNode;
580 // Store the value of PositionUsesAnchorPoint from dali object (Since View object automatically change PositionUsesPivotPoint value as false, we need to keep value.)
581 HandleRef handle = new HandleRef(this, cPtr);
582 bool originalPositionUsesAnchorPoint = Object.InternalGetPropertyBool(handle, View.Property.PositionUsesAnchorPoint);
583 handle = new HandleRef(null, IntPtr.Zero);
585 // Register new animatable into Registry.
586 ret = new ModelNode(cPtr, true);
587 ret.PositionUsesPivotPoint = originalPositionUsesAnchorPoint;
591 // We found matched NUI animatable. Reduce cPtr reference count.
592 HandleRef handle = new HandleRef(this, cPtr);
593 Tizen.NUI.Interop.BaseHandle.DeleteBaseHandle(handle);
594 handle = new HandleRef(null, IntPtr.Zero);
596 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
601 /// Set the ImageBasedLight ScaleFactor.
603 /// <param name="scaleFactor">Scale factor that controls light source intensity in [0.0f, 1.0f].</param>
604 private void SetImageBasedLightScaleFactor(float scaleFactor)
606 Interop.Model.SetImageBasedLightScaleFactor(SwigCPtr, scaleFactor);
607 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
611 /// Get the ImageBasedLight ScaleFactor.
613 /// <returns>ImageBasedLightScaleFactor that controls light source intensity.</returns>
614 private float GetImageBasedLightScaleFactor()
616 float scaleFactor = Interop.Model.GetImageBasedLightScaleFactor(SwigCPtr);
617 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
622 /// Release swigCPtr.
624 // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
625 [EditorBrowsable(EditorBrowsableState.Never)]
626 protected override void ReleaseSwigCPtr(global::System.Runtime.InteropServices.HandleRef swigCPtr)
628 Interop.Model.DeleteModel(swigCPtr);