@@ -125,6 +125,56 @@ static ModelExporter Create ()
125
125
return new ModelExporter ( ) ;
126
126
}
127
127
128
+ /// <summary>
129
+ /// Which components map from Unity Object to Fbx Object
130
+ /// </summary>
131
+ ///
132
+ public enum FbxNodeRelationType
133
+ {
134
+ NodeAttribute ,
135
+ Property ,
136
+ Material
137
+ }
138
+
139
+ public static Dictionary < System . Type , KeyValuePair < System . Type , FbxNodeRelationType > > MapsToFbxObject = new Dictionary < System . Type , KeyValuePair < System . Type , FbxNodeRelationType > > ( )
140
+ {
141
+ { typeof ( Transform ) , new KeyValuePair < System . Type , FbxNodeRelationType > ( typeof ( FbxProperty ) , FbxNodeRelationType . Property ) } ,
142
+ { typeof ( MeshFilter ) , new KeyValuePair < System . Type , FbxNodeRelationType > ( typeof ( FbxMesh ) , FbxNodeRelationType . NodeAttribute ) } ,
143
+ { typeof ( SkinnedMeshRenderer ) , new KeyValuePair < System . Type , FbxNodeRelationType > ( typeof ( FbxMesh ) , FbxNodeRelationType . NodeAttribute ) } ,
144
+ { typeof ( Light ) , new KeyValuePair < System . Type , FbxNodeRelationType > ( typeof ( FbxLight ) , FbxNodeRelationType . NodeAttribute ) } ,
145
+ { typeof ( Camera ) , new KeyValuePair < System . Type , FbxNodeRelationType > ( typeof ( FbxCamera ) , FbxNodeRelationType . NodeAttribute ) } ,
146
+ { typeof ( Material ) , new KeyValuePair < System . Type , FbxNodeRelationType > ( typeof ( FbxSurfaceMaterial ) , FbxNodeRelationType . Material ) } ,
147
+ } ;
148
+
149
+ /// <summary>
150
+ /// Return True is Unity component is animatable
151
+ ///
152
+ public static bool IsAnimatable ( System . Type componentType ) { return GetAnimatableProperties ( componentType ) . Any ( ) ; }
153
+
154
+ private static HashSet < System . Type > m_animatableTypes = new HashSet < System . Type > ( ) { typeof ( System . Single ) } ;
155
+
156
+ public static IEnumerable < System . Reflection . PropertyInfo > GetAnimatableProperties ( System . Type componentType )
157
+ {
158
+ return from p in componentType . GetProperties ( )
159
+ where IsAnimatableProperty ( p )
160
+ select p ;
161
+ }
162
+
163
+ private static bool IsAnimatableProperty ( System . Reflection . PropertyInfo p )
164
+ {
165
+ // assume any custom attribute is System.ObsoleteAttribute
166
+ return m_animatableTypes . Contains ( p . PropertyType ) &&
167
+ ! p . GetCustomAttributes ( true ) . Any ( ) ;
168
+ }
169
+
170
+ /// <summary>
171
+ /// Which components map to FbxProperty
172
+ /// </summary>
173
+ public static HashSet < System . Type > MapsToFbxProperty = new HashSet < System . Type > ( )
174
+ {
175
+ typeof ( Transform ) ,
176
+ } ;
177
+
128
178
/// <summary>
129
179
/// Map Unity material name to FBX material object
130
180
/// </summary>
@@ -2273,7 +2323,7 @@ public void Dispose ()
2273
2323
{
2274
2324
}
2275
2325
2276
- public bool Verbose { private set { ; } get { return false ; } }
2326
+ public bool Verbose { private set { ; } get { return true ; } }
2277
2327
2278
2328
/// <summary>
2279
2329
/// manage the selection of a filename
0 commit comments