3 * Copyright(c) 2023 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
20 using System.ComponentModel;
21 using System.Collections.Generic;
24 namespace Tizen.NUI.Scene3D
27 /// Index of BlendShape feature.
28 /// MotionValue should be float type.
30 [EditorBrowsable(EditorBrowsableState.Never)]
31 public class BlendShapeIndex : MotionIndex
34 /// Create an initialized motion index.
36 [EditorBrowsable(EditorBrowsableState.Never)]
37 public BlendShapeIndex()
42 /// The key of BlendShape.
44 [EditorBrowsable(EditorBrowsableState.Never)]
45 public PropertyKey BlendShapeId { get; set; } = null;
48 /// Convert from index to DALi engine using blend shape uniform name.
50 internal static string GetPropertyNameFromIndex(int index)
54 return "uBlendShapeWeight[" + index.ToString() + "]";
60 /// Get uniform name of blendshape.
62 internal override string GetPropertyName(ModelNode node)
64 if (BlendShapeId != null)
66 if (BlendShapeId.Type == PropertyKey.KeyType.Index)
68 return GetPropertyNameFromIndex(BlendShapeId.IndexKey);
72 // TODO : Not implement yet. We should make API that get the blendshape index from node by name.