forked from izrik/FbxSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFbxAnimCurveNode.cs
156 lines (124 loc) · 4.18 KB
/
FbxAnimCurveNode.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
using System;
using System.Collections.Generic;
namespace FbxSharp
{
public class FbxAnimCurveNode : FbxObject
{
public FbxAnimCurveNode(String name="")
: base(name)
{
Properties.Add(channelRootProperty);
}
#region Utility Functions
protected readonly FbxPropertyT<float> channelRootProperty = new FbxPropertyT<float>("d");
protected class Channel
{
public Channel(FbxProperty prop)
{
Property = prop;
Curves = prop.SrcObjects.CreateCollectionView<FbxAnimCurve>();
}
public string Name { get { return Property.Name; } }
public readonly FbxProperty Property;
public readonly CollectionView<FbxAnimCurve> Curves;
}
protected readonly List<Channel> channels = new List<Channel>();
public bool IsAnimated(bool pRecurse=false)
{
throw new NotImplementedException();
}
public bool GetAnimationInterval(TimeSpan pTimeInterval)
{
throw new NotImplementedException();
}
public bool IsComposite()
{
throw new NotImplementedException();
}
public FbxAnimCurveNode Find(string pName)
{
throw new NotImplementedException();
}
public uint GetChannelsCount()
{
return (uint)channels.Count;
}
public int GetChannelIndex(string pChannelName)
{
return channels.FindIndex(c => c.Name == pChannelName);
}
public string GetChannelName(int pChannelId)
{
return channels[pChannelId].Name;
}
public void ResetChannels()
{
throw new NotImplementedException();
}
public bool AddChannel<T>(string pChnlName, T pValue)
{
var prop = new FbxPropertyT<T>(pChnlName, pValue);
var ch = new Channel(prop);
Properties.Add(prop);
channels.Add(ch);
return true;
}
public void SetChannelValue<T>(string pChnlName, T pValue)
{
channels[GetChannelIndex(pChnlName)].Property.Set(pValue);
}
public void SetChannelValue<T>(uint pChnlId, T pValue)
{
channels[(int)pChnlId].Property.Set(pValue);
}
public T GetChannelValue<T>(string pChnlName, T pInitVal)
{
throw new NotImplementedException();
}
public T GetChannelValue<T>(uint pChnlId, T pInitVal)
{
throw new NotImplementedException();
}
public static FbxAnimCurveNode CreateTypedCurveNode(FbxProperty pProperty, FbxScene pScene)
{
throw new NotImplementedException();
}
#endregion
#region Animation Curve Management
public bool DisconnectFromChannel(FbxAnimCurve pCurve, uint pChnlId)
{
throw new NotImplementedException();
}
public bool ConnectToChannel(FbxAnimCurve pCurve, string pChnl, bool pInFront=false)
{
channels[GetChannelIndex(pChnl)].Property.ConnectSrcObject(pCurve);
return true;
}
public bool ConnectToChannel(FbxAnimCurve pCurve, uint pChnlId, bool pInFront=false)
{
channels[(int)pChnlId].Property.ConnectSrcObject(pCurve);
return true;
}
public FbxAnimCurve CreateCurve(string pCurveNodeName, string pChannel)
{
throw new NotImplementedException();
}
public FbxAnimCurve CreateCurve(string pCurveNodeName, uint pChannelId=0)
{
throw new NotImplementedException();
}
public int GetCurveCount(uint pChannelId, string pCurveNodeName=null)
{
return channels[(int)pChannelId].Curves.Count;
}
public FbxAnimCurve GetCurve(uint pChannelId, uint pId=0, string pCurveNodeName=null)
{
return channels[(int)pChannelId].Curves[(int)pId];
}
#endregion
public override string GetNameSpacePrefix()
{
return "AnimCurveNode::";
}
}
}