From cf47d5e0d6d8fcd47943e115a3de4b670088b40e Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Wed, 10 May 2023 17:11:44 +0900 Subject: [PATCH] [NUI.Scene3D] Change the API name for BlendShape morphing Since json file can change not only facial, The name of API is not good. Instead, Let we change the name of facial API as 'BlendShapeAnimation'. Now user can notify that this API can control all kinds of blendshape. Signed-off-by: Eunki, Hong --- .../src/internal/Interop/Interop.Model.cs | 4 +-- src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs | 36 +++++++++++++++++++--- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Model.cs b/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Model.cs index e94c06e..870e437 100755 --- a/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Model.cs +++ b/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Model.cs @@ -96,10 +96,10 @@ namespace Tizen.NUI.Scene3D public static extern global::System.IntPtr LoadBvhAnimationFromBuffer(global::System.Runtime.InteropServices.HandleRef model, string bvhBuffer, int bvhBufferLength, global::System.Runtime.InteropServices.HandleRef scale, bool translateRootFromModelNode); [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Model_LoadFacialAnimation_1")] - public static extern global::System.IntPtr LoadFacialAnimation(global::System.Runtime.InteropServices.HandleRef model, string facialFilename); + public static extern global::System.IntPtr LoadBlendShapeAnimation(global::System.Runtime.InteropServices.HandleRef model, string jsonFilename); [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Model_LoadFacialAnimation_2")] - public static extern global::System.IntPtr LoadFacialAnimationFromBuffer(global::System.Runtime.InteropServices.HandleRef model, string facialBuffer, int facialBufferLength); + public static extern global::System.IntPtr LoadBlendShapeAnimationFromBuffer(global::System.Runtime.InteropServices.HandleRef model, string jsonBuffer, int jsonBufferLength); } } } diff --git a/src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs b/src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs index 4969483..34253bf 100755 --- a/src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs +++ b/src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs @@ -419,9 +419,35 @@ namespace Tizen.NUI.Scene3D /// Animaion of facial // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Do not use this LoadFacialAnimation. Use LoadBlendShapeAnimation instead.")] public Animation LoadFacialAnimation(string facialFilename) { - global::System.IntPtr cPtr = Interop.Model.LoadFacialAnimation(SwigCPtr, facialFilename); + return LoadBlendShapeAnimation(facialFilename); + } + + /// + /// Load facial animation and assign to model. + /// + /// Contents of json format file what we predefined. + /// Animaion of facial + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Do not use this LoadFacialAnimationFromBuffer. Use LoadBlendShapeAnimationFromBuffer instead.")] + public Animation LoadFacialAnimationFromBuffer(string facialBuffer) + { + return LoadBlendShapeAnimationFromBuffer(facialBuffer); + } + + /// + /// Load blendshape animation and assign to model from json file. + /// + /// Name of json format file what we predefined. + /// Animaion of facial + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public Animation LoadBlendShapeAnimation(string jsonFilename) + { + global::System.IntPtr cPtr = Interop.Model.LoadBlendShapeAnimation(SwigCPtr, jsonFilename); Animation ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Animation; if (ret == null) { @@ -440,15 +466,15 @@ namespace Tizen.NUI.Scene3D } /// - /// Load facial animation and assign to model. + /// Load morphing animation and assign to model from json string. /// - /// Contents of json format file what we predefined. + /// Contents of json format file what we predefined. /// Animaion of facial // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] - public Animation LoadFacialAnimationFromBuffer(string facialBuffer) + public Animation LoadBlendShapeAnimationFromBuffer(string jsonBuffer) { - global::System.IntPtr cPtr = Interop.Model.LoadFacialAnimationFromBuffer(SwigCPtr, facialBuffer, facialBuffer.Length); + global::System.IntPtr cPtr = Interop.Model.LoadBlendShapeAnimationFromBuffer(SwigCPtr, jsonBuffer, jsonBuffer.Length); Animation ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Animation; if (ret == null) { -- 2.7.4