12
12
using System . Security . Permissions ;
13
13
14
14
[ assembly: InternalsVisibleTo ( "Unity.Formats.Fbx.Editortests" ) ]
15
+ [ assembly: InternalsVisibleTo ( "Unity.ProBuilder.AddOns.Editor" ) ]
15
16
16
17
namespace UnityEditor . Formats . Fbx . Exporter
17
18
{
@@ -61,7 +62,7 @@ protected ModelExportException(SerializationInfo info, StreamingContext context)
61
62
/// To do so, simply use its ExportObject and ExportObjects methods. Default export
62
63
/// options are used when exporting the objects to the FBX file.
63
64
/// </summary>
64
- public class ModelExporter : System . IDisposable
65
+ public sealed class ModelExporter : System . IDisposable
65
66
{
66
67
const string Title =
67
68
"Created by FBX Exporter from Unity Technologies" ;
@@ -883,7 +884,7 @@ bool ExportMesh (MeshInfo meshInfo, FbxNode fbxNode)
883
884
/// Export GameObject as a skinned mesh with material, bones, a skin and, a bind pose.
884
885
/// </summary>
885
886
[ SecurityPermission ( SecurityAction . LinkDemand ) ]
886
- protected bool ExportSkinnedMesh ( GameObject unityGo , FbxScene fbxScene , FbxNode fbxNode )
887
+ private bool ExportSkinnedMesh ( GameObject unityGo , FbxScene fbxScene , FbxNode fbxNode )
887
888
{
888
889
if ( ! unityGo || fbxNode == null )
889
890
{
@@ -1126,7 +1127,7 @@ boneWeights [i].weight3
1126
1127
/// <summary>
1127
1128
/// Export bind pose of mesh to skeleton
1128
1129
/// </summary>
1129
- protected bool ExportBindPose ( SkinnedMeshRenderer skinnedMesh , FbxNode fbxMeshNode ,
1130
+ private bool ExportBindPose ( SkinnedMeshRenderer skinnedMesh , FbxNode fbxMeshNode ,
1130
1131
FbxScene fbxScene , Dictionary < SkinnedMeshRenderer , Transform [ ] > skinnedMeshToBonesMap )
1131
1132
{
1132
1133
if ( fbxMeshNode == null || skinnedMeshToBonesMap == null || fbxScene == null )
@@ -1297,7 +1298,7 @@ internal bool ExportTransform (UnityEngine.Transform unityTransform, FbxNode fbx
1297
1298
/// if this game object is a model prefab then export with shared components
1298
1299
/// </summary>
1299
1300
[ SecurityPermission ( SecurityAction . LinkDemand ) ]
1300
- protected bool ExportInstance ( GameObject unityGo , FbxNode fbxNode )
1301
+ private bool ExportInstance ( GameObject unityGo , FbxNode fbxNode )
1301
1302
{
1302
1303
if ( ! unityGo || fbxNode == null )
1303
1304
{
@@ -1350,7 +1351,7 @@ protected bool ExportInstance(GameObject unityGo, FbxNode fbxNode)
1350
1351
/// <summary>
1351
1352
/// Exports camera component
1352
1353
/// </summary>
1353
- protected bool ExportCamera ( GameObject unityGO , FbxScene fbxScene , FbxNode fbxNode )
1354
+ private bool ExportCamera ( GameObject unityGO , FbxScene fbxScene , FbxNode fbxNode )
1354
1355
{
1355
1356
if ( ! unityGO || fbxScene == null || fbxNode == null )
1356
1357
{
@@ -1387,7 +1388,7 @@ protected bool ExportCamera (GameObject unityGO, FbxScene fbxScene, FbxNode fbxN
1387
1388
/// Supported types: point, spot and directional
1388
1389
/// Cookie => Gobo
1389
1390
/// </summary>
1390
- protected bool ExportLight ( GameObject unityGo , FbxScene fbxScene , FbxNode fbxNode )
1391
+ private bool ExportLight ( GameObject unityGo , FbxScene fbxScene , FbxNode fbxNode )
1391
1392
{
1392
1393
if ( ! unityGo || fbxScene == null || fbxNode == null )
1393
1394
{
@@ -1457,7 +1458,7 @@ protected bool ExportLight (GameObject unityGo, FbxScene fbxScene, FbxNode fbxNo
1457
1458
return true ;
1458
1459
}
1459
1460
1460
- protected bool ExportCommonConstraintProperties < TUnityConstraint , TFbxConstraint > ( TUnityConstraint uniConstraint , TFbxConstraint fbxConstraint , FbxNode fbxNode )
1461
+ private bool ExportCommonConstraintProperties < TUnityConstraint , TFbxConstraint > ( TUnityConstraint uniConstraint , TFbxConstraint fbxConstraint , FbxNode fbxNode )
1461
1462
where TUnityConstraint : IConstraint where TFbxConstraint : FbxConstraint
1462
1463
{
1463
1464
fbxConstraint . Active . Set ( uniConstraint . constraintActive ) ;
@@ -1468,7 +1469,7 @@ protected bool ExportCommonConstraintProperties<TUnityConstraint,TFbxConstraint>
1468
1469
return true ;
1469
1470
}
1470
1471
1471
- protected struct ExpConstraintSource
1472
+ private struct ExpConstraintSource
1472
1473
{
1473
1474
private FbxNode m_node ;
1474
1475
public FbxNode node
@@ -1491,7 +1492,7 @@ public ExpConstraintSource(FbxNode node, float weight)
1491
1492
}
1492
1493
}
1493
1494
1494
- protected List < ExpConstraintSource > GetConstraintSources ( IConstraint unityConstraint )
1495
+ private List < ExpConstraintSource > GetConstraintSources ( IConstraint unityConstraint )
1495
1496
{
1496
1497
if ( unityConstraint == null )
1497
1498
{
@@ -1514,7 +1515,7 @@ protected List<ExpConstraintSource> GetConstraintSources(IConstraint unityConstr
1514
1515
return fbxSources ;
1515
1516
}
1516
1517
1517
- protected void AddFbxNodeToConstraintsMapping < T > ( FbxNode fbxNode , T fbxConstraint , System . Type uniConstraintType ) where T : FbxConstraint
1518
+ private void AddFbxNodeToConstraintsMapping < T > ( FbxNode fbxNode , T fbxConstraint , System . Type uniConstraintType ) where T : FbxConstraint
1518
1519
{
1519
1520
Dictionary < FbxConstraint , System . Type > constraintMapping ;
1520
1521
if ( ! MapConstrainedObjectToConstraints . TryGetValue ( fbxNode , out constraintMapping ) )
@@ -1525,7 +1526,7 @@ protected void AddFbxNodeToConstraintsMapping<T>(FbxNode fbxNode, T fbxConstrain
1525
1526
constraintMapping . Add ( fbxConstraint , uniConstraintType ) ;
1526
1527
}
1527
1528
1528
- protected bool ExportPositionConstraint ( IConstraint uniConstraint , FbxScene fbxScene , FbxNode fbxNode )
1529
+ private bool ExportPositionConstraint ( IConstraint uniConstraint , FbxScene fbxScene , FbxNode fbxNode )
1529
1530
{
1530
1531
if ( fbxNode == null )
1531
1532
{
@@ -1556,7 +1557,7 @@ protected bool ExportPositionConstraint(IConstraint uniConstraint, FbxScene fbxS
1556
1557
return true ;
1557
1558
}
1558
1559
1559
- protected bool ExportRotationConstraint ( IConstraint uniConstraint , FbxScene fbxScene , FbxNode fbxNode )
1560
+ private bool ExportRotationConstraint ( IConstraint uniConstraint , FbxScene fbxScene , FbxNode fbxNode )
1560
1561
{
1561
1562
if ( fbxNode == null )
1562
1563
{
@@ -1591,7 +1592,7 @@ protected bool ExportRotationConstraint(IConstraint uniConstraint, FbxScene fbxS
1591
1592
return true ;
1592
1593
}
1593
1594
1594
- protected bool ExportScaleConstraint ( IConstraint uniConstraint , FbxScene fbxScene , FbxNode fbxNode )
1595
+ private bool ExportScaleConstraint ( IConstraint uniConstraint , FbxScene fbxScene , FbxNode fbxNode )
1595
1596
{
1596
1597
if ( fbxNode == null )
1597
1598
{
@@ -1624,7 +1625,7 @@ protected bool ExportScaleConstraint(IConstraint uniConstraint, FbxScene fbxScen
1624
1625
return true ;
1625
1626
}
1626
1627
1627
- protected bool ExportAimConstraint ( IConstraint uniConstraint , FbxScene fbxScene , FbxNode fbxNode )
1628
+ private bool ExportAimConstraint ( IConstraint uniConstraint , FbxScene fbxScene , FbxNode fbxNode )
1628
1629
{
1629
1630
if ( fbxNode == null )
1630
1631
{
@@ -1690,7 +1691,7 @@ protected bool ExportAimConstraint(IConstraint uniConstraint, FbxScene fbxScene,
1690
1691
return true ;
1691
1692
}
1692
1693
1693
- protected bool ExportParentConstraint ( IConstraint uniConstraint , FbxScene fbxScene , FbxNode fbxNode )
1694
+ private bool ExportParentConstraint ( IConstraint uniConstraint , FbxScene fbxScene , FbxNode fbxNode )
1694
1695
{
1695
1696
if ( fbxNode == null )
1696
1697
{
@@ -1746,7 +1747,7 @@ protected bool ExportParentConstraint(IConstraint uniConstraint, FbxScene fbxSce
1746
1747
1747
1748
private delegate bool ExportConstraintDelegate ( IConstraint c , FbxScene fs , FbxNode fn ) ;
1748
1749
1749
- protected bool ExportConstraints ( GameObject unityGo , FbxScene fbxScene , FbxNode fbxNode )
1750
+ private bool ExportConstraints ( GameObject unityGo , FbxScene fbxScene , FbxNode fbxNode )
1750
1751
{
1751
1752
if ( ! unityGo )
1752
1753
{
@@ -1912,7 +1913,7 @@ internal void ExportAnimationSamples (AnimationCurve uniAnimCurve, FbxAnimCurve
1912
1913
/// <param name="constrainedNode"></param>
1913
1914
/// <param name="uniConstraintType"></param>
1914
1915
/// <returns></returns>
1915
- protected FbxConstraint GetFbxConstraint ( FbxNode constrainedNode , System . Type uniConstraintType )
1916
+ private FbxConstraint GetFbxConstraint ( FbxNode constrainedNode , System . Type uniConstraintType )
1916
1917
{
1917
1918
if ( uniConstraintType == null || ! uniConstraintType . GetInterfaces ( ) . Contains ( typeof ( IConstraint ) ) )
1918
1919
{
@@ -1939,7 +1940,7 @@ protected FbxConstraint GetFbxConstraint(FbxNode constrainedNode, System.Type un
1939
1940
return null ;
1940
1941
}
1941
1942
1942
- protected FbxProperty GetFbxProperty ( FbxNode fbxNode , string fbxPropertyName , System . Type uniPropertyType )
1943
+ private FbxProperty GetFbxProperty ( FbxNode fbxNode , string fbxPropertyName , System . Type uniPropertyType )
1943
1944
{
1944
1945
if ( fbxNode == null )
1945
1946
{
@@ -1980,7 +1981,7 @@ protected FbxProperty GetFbxProperty(FbxNode fbxNode, string fbxPropertyName, Sy
1980
1981
/// quaternion to euler and various other stuff.
1981
1982
/// </summary>
1982
1983
[ SecurityPermission ( SecurityAction . LinkDemand ) ]
1983
- protected void ExportAnimationCurve ( FbxNode fbxNode ,
1984
+ private void ExportAnimationCurve ( FbxNode fbxNode ,
1984
1985
AnimationCurve uniAnimCurve ,
1985
1986
float frameRate ,
1986
1987
string uniPropertyName ,
@@ -2080,7 +2081,7 @@ public float Convert(float value)
2080
2081
/// Export an AnimationClip as a single take
2081
2082
/// </summary>
2082
2083
[ SecurityPermission ( SecurityAction . LinkDemand ) ]
2083
- protected void ExportAnimationClip ( AnimationClip uniAnimClip , GameObject uniRoot , FbxScene fbxScene )
2084
+ private void ExportAnimationClip ( AnimationClip uniAnimClip , GameObject uniRoot , FbxScene fbxScene )
2084
2085
{
2085
2086
if ( ! uniAnimClip || ! uniRoot || fbxScene == null ) return ;
2086
2087
@@ -2476,7 +2477,7 @@ ref Dictionary<GameObject, RotationCurve> rotations
2476
2477
/// Export the Animator component on this game object
2477
2478
/// </summary>
2478
2479
[ SecurityPermission ( SecurityAction . LinkDemand ) ]
2479
- protected void ExportAnimation ( GameObject uniRoot , FbxScene fbxScene )
2480
+ private void ExportAnimation ( GameObject uniRoot , FbxScene fbxScene )
2480
2481
{
2481
2482
if ( ! uniRoot )
2482
2483
{
@@ -2531,7 +2532,7 @@ protected void ExportAnimation (GameObject uniRoot, FbxScene fbxScene)
2531
2532
/// <summary>
2532
2533
/// configures default camera for the scene
2533
2534
/// </summary>
2534
- protected void SetDefaultCamera ( FbxScene fbxScene )
2535
+ private void SetDefaultCamera ( FbxScene fbxScene )
2535
2536
{
2536
2537
if ( fbxScene == null ) { return ; }
2537
2538
@@ -3114,7 +3115,7 @@ internal static IExportData GetExportData(GameObject go, IExportOptions exportOp
3114
3115
/// This function exports the other components and animation.
3115
3116
/// </summary>
3116
3117
[ SecurityPermission ( SecurityAction . LinkDemand ) ]
3117
- protected bool ExportComponents ( FbxScene fbxScene , bool exportAnim = true )
3118
+ private bool ExportComponents ( FbxScene fbxScene , bool exportAnim = true )
3118
3119
{
3119
3120
var animationNodes = new HashSet < GameObject > ( ) ;
3120
3121
@@ -3175,7 +3176,7 @@ protected bool ExportComponents(FbxScene fbxScene, bool exportAnim = true)
3175
3176
/// </summary>
3176
3177
/// <returns><c>true</c>, if object has animation, <c>false</c> otherwise.</returns>
3177
3178
/// <param name="go">Go.</param>
3178
- protected bool GameObjectHasAnimation ( GameObject go ) {
3179
+ private bool GameObjectHasAnimation ( GameObject go ) {
3179
3180
return go != null &&
3180
3181
( go . GetComponent < Animator > ( ) ||
3181
3182
go . GetComponent < Animation > ( ) ||
@@ -4054,14 +4055,9 @@ bool ExportMesh (GameObject gameObject, FbxNode fbxNode)
4054
4055
/// </summary>
4055
4056
public void Dispose ( )
4056
4057
{
4057
- Dispose ( true ) ;
4058
4058
System . GC . SuppressFinalize ( this ) ;
4059
4059
}
4060
4060
4061
- protected virtual void Dispose ( bool cleanUpManaged )
4062
- {
4063
- }
4064
-
4065
4061
internal bool Verbose { get { return ExportSettings . instance . VerboseProperty ; } }
4066
4062
4067
4063
/// <summary>
0 commit comments