[NUI.Scene3D] Make API to apply ModelMotion + Support string animatable + Scene3D...
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Scene3D / src / public / Controls / Model.cs
1 /*
2  * Copyright(c) 2023 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 using System;
19 using System.Runtime.InteropServices;
20 using System.ComponentModel;
21 using Tizen.NUI;
22 using Tizen.NUI.Binding;
23 using Tizen.NUI.BaseComponents;
24
25 namespace Tizen.NUI.Scene3D
26 {
27     /// <summary>
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.
31     /// </summary>
32     ///
33     /// <remarks>
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.
37     ///
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.
42     ///
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.
47     ///
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.
52     /// </remarks>
53     ///
54     /// <example>
55     /// <code>
56     /// Model model = new Model(modelUrl)
57     /// {
58     ///     Size = new Size(width, height),
59     /// };
60     /// model.ResourcesLoaded += (s, e) =>
61     /// {
62     ///     model.PivotPoint = new Vector3(0.5f, 0.5f, 0.5f); // Use center as a Pivot.
63     ///
64     ///     int animationCount = model.GetAnimationCount();
65     ///     if(animationCount > 0)
66     ///     {
67     ///         // Play an Animation of index 0.
68     ///         model.GetAnimation(0).Play();
69     ///     }
70     /// };
71     /// model.SetImageBasedLightSource(diffuseUrl, specularUrl, scaleFactor);
72     /// window.Add(model);
73     ///
74     /// </code>
75     /// </example>
76     /// <since_tizen> 10 </since_tizen>
77     public partial class Model : View
78     {
79         internal Model(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
80         {
81         }
82
83         /// <summary>
84         /// Create an initialized Model.
85         /// </summary>
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>
88         /// <remarks>
89         /// If resourceDirectoryUrl is empty, the parent directory url of modelUrl is used for resource url.
90         ///
91         /// http://tizen.org/privilege/mediastorage for local files in media storage.
92         /// http://tizen.org/privilege/externalstorage for local files in external storage.
93         /// </remarks>
94         /// <since_tizen> 10 </since_tizen>
95         public Model(string modelUrl, string resourceDirectoryUrl = "") : this(Interop.Model.ModelNew(modelUrl, resourceDirectoryUrl), true)
96         {
97             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
98             this.PositionUsesAnchorPoint = true;
99         }
100
101         /// <summary>
102         /// Create an initialized Model.
103         /// </summary>
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)
107         {
108             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109             this.PositionUsesAnchorPoint = true;
110         }
111
112         /// <summary>
113         /// Copy constructor.
114         /// </summary>
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)
118         {
119             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
120         }
121
122         /// <summary>
123         /// Assignment operator.
124         /// </summary>
125         /// <param name="model">Source object to be assigned.</param>
126         /// <returns>Reference to this.</returns>
127         internal Model Assign(Model model)
128         {
129             Model ret = new Model(Interop.Model.ModelAssign(SwigCPtr, Model.getCPtr(model)), false);
130             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131             return ret;
132         }
133
134         /// <summary>
135         /// Set/Get the ImageBasedLight ScaleFactor.
136         /// Scale factor controls light source intensity in [0.0f, 1.0f]
137         /// </summary>
138         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
139         [EditorBrowsable(EditorBrowsableState.Never)]
140         public float ImageBasedLightScaleFactor
141         {
142             set
143             {
144                 SetImageBasedLightScaleFactor(value);
145             }
146             get
147             {
148                 return GetImageBasedLightScaleFactor();
149             }
150         }
151
152         /// <summary>
153         /// Adds modelNode to this Model.
154         /// </summary>
155         /// <param name="modelRoot">Root of a ModelNode tree</param>
156         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
157         [EditorBrowsable(EditorBrowsableState.Never)]
158         public void AddModelNode(ModelNode modelRoot)
159         {
160             Interop.Model.AddModelNode(SwigCPtr, ModelNode.getCPtr(modelRoot));
161             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162         }
163
164         /// <summary>
165         /// Removes modelNode from this Model.
166         /// </summary>
167         /// <param name="modelRoot">Root of a ModelNode tree to be removed</param>
168         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
169         [EditorBrowsable(EditorBrowsableState.Never)]
170         public void RemoveModelNode(ModelNode modelRoot)
171         {
172             Interop.Model.RemoveModelNode(SwigCPtr, ModelNode.getCPtr(modelRoot));
173             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174         }
175
176         /// <summary>
177         /// Removes Returns a child ModelNode object with a name that matches nodeName.
178         /// </summary>
179         /// <param name="nodeName">The name of the child ModelNode object you want to find.</param>
180         /// <returns>Child ModelNode that has nodeName as name.</returns>
181         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
182         [EditorBrowsable(EditorBrowsableState.Never)]
183         public ModelNode FindChildModelNodeByName(string nodeName)
184         {
185             global::System.IntPtr cPtr = Interop.Model.FindChildModelNodeByName(SwigCPtr, nodeName);
186             ModelNode ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as ModelNode;
187             if (ret == null)
188             {
189                 // Register new animatable into Registry.
190                 ret = new ModelNode(cPtr, true);
191             }
192             else
193             {
194                 // We found matched NUI animatable. Reduce cPtr reference count.
195                 HandleRef handle = new HandleRef(this, cPtr);
196                 Tizen.NUI.Interop.BaseHandle.DeleteBaseHandle(handle);
197                 handle = new HandleRef(null, IntPtr.Zero);
198             }
199             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200             return ret;
201         }
202
203         /// <summary>
204         /// Changes Image Based Light according to the given input textures.
205         /// </summary>
206         /// <param name="diffuseUrl">The path of Cube map image that will be used as a diffuse IBL source.</param>
207         /// <param name="specularUrl">The path of Cube map image that will be used as a specular IBL source.</param>
208         /// <param name="scaleFactor">Scale factor that controls light source intensity in [0.0f, 1.0f]. Default value is 1.0f.</param>
209         /// <remarks>
210         /// http://tizen.org/privilege/mediastorage for local files in media storage.
211         /// http://tizen.org/privilege/externalstorage for local files in external storage.
212         /// </remarks>
213         /// <since_tizen> 10 </since_tizen>
214         public void SetImageBasedLightSource(string diffuseUrl, string specularUrl, float scaleFactor = 1.0f)
215         {
216             Interop.Model.SetImageBasedLightSource(SwigCPtr, diffuseUrl, specularUrl, scaleFactor);
217             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218         }
219
220         /// <summary>
221         /// Gets number of animations that has been loaded from model file.
222         /// </summary>
223         /// <remarks>
224         /// This method should be called after Model load has been finished.
225         /// </remarks>
226         /// <returns>The number of loaded animations.</returns>
227         /// <since_tizen> 10 </since_tizen>
228         public uint GetAnimationCount()
229         {
230             uint ret = Interop.Model.GetAnimationCount(SwigCPtr);
231             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232             return ret;
233         }
234
235         /// <summary>
236         /// Gets animation at the index.
237         /// </summary>
238         /// <remarks>
239         /// This method should be called after Model load has been finished.
240         /// </remarks>
241         /// <param name="index">Index of animation to be retrieved.</param>
242         /// <returns>Animation at the index.</returns>
243         /// <since_tizen> 10 </since_tizen>
244         public Animation GetAnimation(uint index)
245         {
246             global::System.IntPtr cPtr = Interop.Model.GetAnimation(SwigCPtr, index);
247             Animation ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Animation;
248             if(ret == null)
249             {
250                 // Register new animation into Registry.
251                 ret = new Animation(cPtr, true);
252             }
253             else
254             {
255                 // We found matched NUI animation. Reduce cPtr reference count.
256                 HandleRef handle = new HandleRef(this, cPtr);
257                 Tizen.NUI.Interop.Animation.DeleteAnimation(handle);
258                 handle = new HandleRef(null, IntPtr.Zero);
259             }
260             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261             return ret;
262         }
263
264         /// <summary>
265         /// Retrieves animation with the given name.
266         /// Note: This method should be called after Model load finished.
267         /// </summary>
268         /// <param name="name">String name of animation to be retrieved.</param>
269         /// <returns>Animation that has the given name.</returns>
270         /// <since_tizen> 10 </since_tizen>
271         public Animation GetAnimation(string name)
272         {
273             global::System.IntPtr cPtr = Interop.Model.GetAnimation(SwigCPtr, name);
274             Animation ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Animation;
275             if(ret == null)
276             {
277                 // Register new animation into Registry.
278                 ret = new Animation(cPtr, true);
279             }
280             else
281             {
282                 // We found matched NUI animation. Reduce cPtr reference count.
283                 HandleRef handle = new HandleRef(this, cPtr);
284                 Tizen.NUI.Interop.Animation.DeleteAnimation(handle);
285                 handle = new HandleRef(null, IntPtr.Zero);
286             }
287             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288             return ret;
289         }
290
291         /// <summary>
292         /// Gets number of camera parameters that has been loaded from model file.
293         /// </summary>
294         /// <remarks>
295         /// This method should be called after Model load has been finished.
296         /// </remarks>
297         /// <returns>The number of loaded camera parameters.</returns>
298         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
299         [EditorBrowsable(EditorBrowsableState.Never)]
300         public uint GetCameraCount()
301         {
302             uint ret = Interop.Model.GetCameraCount(SwigCPtr);
303             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
304             return ret;
305         }
306
307         /// <summary>
308         /// Generate Camera using camera parameters at the index.
309         /// If camera parameter is valid, create new Camera.
310         /// Else, return empty Handle.
311         /// </summary>
312         /// <remarks>
313         /// This method should be called after Model load has been finished.
314         /// </remarks>
315         /// <returns>Generated Camera by the index, or empty Handle if generation failed.</returns>
316         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
317         [EditorBrowsable(EditorBrowsableState.Never)]
318         public Camera GenerateCamera(uint index)
319         {
320             global::System.IntPtr cPtr = Interop.Model.GenerateCamera(SwigCPtr, index);
321             Camera ret = new Camera(cPtr, true); // Always create new camera.
322             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
323             return ret;
324         }
325
326         /// <summary>
327         /// Apply camera parameters at the index to inputed Camera.
328         /// If camera parameter is valid and camera is not empty, apply parameters.
329         /// It will change camera's transform and near / far / fov or orthographic size / aspect ratio (if defined)
330         /// </summary>
331         /// <remarks>
332         /// This method should be called after Model load has been finished.
333         /// </remarks>
334         /// <param name="index">Index of camera to be retrieved.</param>
335         /// <param name="camera">Camera to be applied parameter.</param>
336         /// <returns>True if Apply successed. False otherwise.</returns>
337         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
338         [EditorBrowsable(EditorBrowsableState.Never)]
339         public bool ApplyCamera(uint index, Camera camera)
340         {
341             bool ret = false;
342             if(camera?.HasBody() == true)
343             {
344                 ret = Interop.Model.ApplyCamera(SwigCPtr, index, Camera.getCPtr(camera));
345                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
346             }
347             return ret;
348         }
349
350         /// <summary>
351         /// Load bvh animation and assign to model.
352         /// Scale is additional scale factor of bvh animation. It is possible that
353         /// Model's scale may not matched with bvh animation scale.
354         /// If scale is null, default use as Vector3.ONE
355         /// </summary>
356         /// <param name="bvhFilename">Name of bvh format file.</param>
357         /// <param name="scale">Scale value of bvh animation match with model.</param>
358         /// <returns>Animaion of bvh</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 Animation LoadBvhAnimation(string bvhFilename, Vector3 scale = null, bool translateRootFromModelNode = true)
362         {
363             global::System.IntPtr cPtr = Interop.Model.LoadBvhAnimation(SwigCPtr, bvhFilename, Vector3.getCPtr(scale), translateRootFromModelNode);
364             Animation ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Animation;
365             if(ret == null)
366             {
367                 // Register new animation into Registry.
368                 ret = new Animation(cPtr, true);
369             }
370             else
371             {
372                 // We found matched NUI animation. Reduce cPtr reference count.
373                 HandleRef handle = new HandleRef(this, cPtr);
374                 Tizen.NUI.Interop.Animation.DeleteAnimation(handle);
375                 handle = new HandleRef(null, IntPtr.Zero);
376             }
377             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
378             return ret;
379         }
380
381         /// <summary>
382         /// Load bvh animation and assign to model.
383         /// Scale is additional scale factor of bvh animation. It is possible that
384         /// Model's scale may not matched with bvh animation scale.
385         /// If scale is null, default use as Vector3.ONE
386         /// </summary>
387         /// <param name="bvhBuffer">Contents of bvh format file.</param>
388         /// <param name="scale">Scale value of bvh animation match with model.</param>
389         /// <returns>Animaion of bvh</returns>
390         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
391         [EditorBrowsable(EditorBrowsableState.Never)]
392         public Animation LoadBvhAnimationFromBuffer(string bvhBuffer, Vector3 scale = null, bool translateRootFromModelNode = true)
393         {
394             global::System.IntPtr cPtr = Interop.Model.LoadBvhAnimationFromBuffer(SwigCPtr, bvhBuffer, bvhBuffer.Length, Vector3.getCPtr(scale), translateRootFromModelNode);
395             Animation ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Animation;
396             if (ret == null)
397             {
398                 // Register new animation into Registry.
399                 ret = new Animation(cPtr, true);
400             }
401             else
402             {
403                 // We found matched NUI animation. Reduce cPtr reference count.
404                 HandleRef handle = new HandleRef(this, cPtr);
405                 Tizen.NUI.Interop.Animation.DeleteAnimation(handle);
406                 handle = new HandleRef(null, IntPtr.Zero);
407             }
408             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
409             return ret;
410         }
411
412         /// <summary>
413         /// Load facial animation and assign to model.
414         /// </summary>
415         /// <param name="facialFilename">Name of json format file what we predefined.</param>
416         /// <returns>Animaion of facial</returns>
417         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
418         [EditorBrowsable(EditorBrowsableState.Never)]
419         public Animation LoadFacialAnimation(string facialFilename)
420         {
421             global::System.IntPtr cPtr = Interop.Model.LoadFacialAnimation(SwigCPtr, facialFilename);
422             Animation ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Animation;
423             if (ret == null)
424             {
425                 // Register new animation into Registry.
426                 ret = new Animation(cPtr, true);
427             }
428             else
429             {
430                 // We found matched NUI animation. Reduce cPtr reference count.
431                 HandleRef handle = new HandleRef(this, cPtr);
432                 Tizen.NUI.Interop.Animation.DeleteAnimation(handle);
433                 handle = new HandleRef(null, IntPtr.Zero);
434             }
435             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
436             return ret;
437         }
438
439         /// <summary>
440         /// Load facial animation and assign to model.
441         /// </summary>
442         /// <param name="facialBuffer">Contents of json format file what we predefined.</param>
443         /// <returns>Animaion of facial</returns>
444         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
445         [EditorBrowsable(EditorBrowsableState.Never)]
446         public Animation LoadFacialAnimationFromBuffer(string facialBuffer)
447         {
448             global::System.IntPtr cPtr = Interop.Model.LoadFacialAnimationFromBuffer(SwigCPtr, facialBuffer, facialBuffer.Length);
449             Animation ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Animation;
450             if (ret == null)
451             {
452                 // Register new animation into Registry.
453                 ret = new Animation(cPtr, true);
454             }
455             else
456             {
457                 // We found matched NUI animation. Reduce cPtr reference count.
458                 HandleRef handle = new HandleRef(this, cPtr);
459                 Tizen.NUI.Interop.Animation.DeleteAnimation(handle);
460                 handle = new HandleRef(null, IntPtr.Zero);
461             }
462             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
463             return ret;
464         }
465
466         /// <summary>
467         /// Prototype of animation generate by MotionData
468         /// </summary>
469         /// <param name="motionData">Inputed list of pair of MotionIndex and MotionValue.</param>
470         /// <param name="durationMilliSeconds">The duration in milliseconds.</param>
471         /// <returns>Generated animation by input motion data</returns>
472         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
473         [EditorBrowsable(EditorBrowsableState.Never)]
474         public Animation GenerateMotionDataAnimation(MotionData motionData, int durationMilliSeconds)
475         {
476             return InternalGenerateMotionDataAnimation(motionData, durationMilliSeconds);
477         }
478
479         /// <summary>
480         /// Prototype of MotionData setter.
481         /// Note that this API didn't apply KeyFrames animation.
482         /// If you want to apply the animation, please use <see cref="GenerateMotionDataAnimation(MotionData, int)"/> and play the result.
483         /// </summary>
484         /// <param name="motionData">Inputed list of pair of MotionIndex and MotionValue.</param>
485         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
486         [EditorBrowsable(EditorBrowsableState.Never)]
487         public void SetMotionData(MotionData motionData)
488         {
489             InternalSetMotionData(motionData);
490         }
491
492         /// <summary>
493         /// Retrieves model root Actor.
494         /// </summary>
495         /// <returns>Root View of the model.</returns>
496         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
497         [EditorBrowsable(EditorBrowsableState.Never)]
498         private ModelNode GetModelRoot()
499         {
500             global::System.IntPtr cPtr = Interop.Model.GetModelRoot(SwigCPtr);
501             ModelNode ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as ModelNode;
502             if (ret == null)
503             {
504                 // Register new animatable into Registry.
505                 ret = new ModelNode(cPtr, true);
506             }
507             else
508             {
509                 // We found matched NUI animatable. Reduce cPtr reference count.
510                 HandleRef handle = new HandleRef(this, cPtr);
511                 Tizen.NUI.Interop.BaseHandle.DeleteBaseHandle(handle);
512                 handle = new HandleRef(null, IntPtr.Zero);
513             }
514             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
515             return ret;
516         }
517
518         /// <summary>
519         /// Set the ImageBasedLight ScaleFactor.
520         /// </summary>
521         /// <param name="scaleFactor">Scale factor that controls light source intensity in [0.0f, 1.0f].</param>
522         private void SetImageBasedLightScaleFactor(float scaleFactor)
523         {
524             Interop.Model.SetImageBasedLightScaleFactor(SwigCPtr, scaleFactor);
525             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
526         }
527
528         /// <summary>
529         /// Get the ImageBasedLight ScaleFactor.
530         /// </summary>
531         /// <returns>ImageBasedLightScaleFactor that controls light source intensity.</returns>
532         private float GetImageBasedLightScaleFactor()
533         {
534             float scaleFactor = Interop.Model.GetImageBasedLightScaleFactor(SwigCPtr);
535             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
536             return scaleFactor;
537         }
538
539         /// <summary>
540         /// Release swigCPtr.
541         /// </summary>
542         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
543         [EditorBrowsable(EditorBrowsableState.Never)]
544         protected override void ReleaseSwigCPtr(global::System.Runtime.InteropServices.HandleRef swigCPtr)
545         {
546             Interop.Model.DeleteModel(swigCPtr);
547         }
548     }
549 }