Skip to content

Commit 13a1c1f

Browse files
authored
Merge pull request #247 from Unity-Technologies/UNI-32765-don't-export-camera-custom-props
UNI-32765 don't export camera's custom properties
2 parents 2ee472d + 85ccd9a commit 13a1c1f

File tree

1 file changed

+0
-53
lines changed

1 file changed

+0
-53
lines changed

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -825,18 +825,6 @@ protected bool ExportCamera (GameObject unityGO, FbxScene fbxScene, FbxNode fbxN
825825
fbxCamera.SetFarPlane (unityCamera.farClipPlane*UnitScaleFactor);
826826
#endregion
827827

828-
// Export backgroundColor as a custom property
829-
// NOTE: export on fbxNode so that it will show up in Maya
830-
ExportColorProperty (fbxNode, unityCamera.backgroundColor,
831-
MakeName("backgroundColor"),
832-
"The color with which the screen will be cleared.");
833-
834-
// Export clearFlags as a custom property
835-
// NOTE: export on fbxNode so that it will show up in Maya
836-
ExportIntProperty (fbxNode, (int)unityCamera.clearFlags,
837-
MakeName("clearFlags"),
838-
"How the camera clears the background.");
839-
840828
fbxNode.SetNodeAttribute (fbxCamera);
841829

842830
// set +90 post rotation to counteract for FBX camera's facing +X direction by default
@@ -861,47 +849,6 @@ protected void SetDefaultCamera (FbxScene fbxScene)
861849
fbxScene.GetGlobalSettings ().SetDefaultCamera (DefaultCamera);
862850
}
863851

864-
/// <summary>
865-
/// Export Component's color property
866-
/// </summary>
867-
bool ExportColorProperty (FbxObject fbxObject, Color value, string name, string label)
868-
{
869-
// create a custom property for component value
870-
var fbxProperty = FbxProperty.Create (fbxObject, Globals.FbxColor4DT, name, label);
871-
if (!fbxProperty.IsValid ()) {
872-
throw new System.NullReferenceException ();
873-
}
874-
875-
FbxColor fbxColor = new FbxColor(value.r, value.g, value.b, value.a );
876-
877-
fbxProperty.Set (fbxColor);
878-
879-
// Must be marked user-defined or it won't be shown in most DCCs
880-
fbxProperty.ModifyFlag (FbxPropertyFlags.EFlags.eUserDefined, true);
881-
fbxProperty.ModifyFlag (FbxPropertyFlags.EFlags.eAnimatable, true);
882-
883-
return true;
884-
}
885-
886-
/// <summary>
887-
/// Export Component's int property
888-
/// </summary>
889-
bool ExportIntProperty (FbxObject fbxObject, int value, string name, string label)
890-
{
891-
// create a custom property for component value
892-
var fbxProperty = FbxProperty.Create (fbxObject, Globals.FbxIntDT, name, label);
893-
if (!fbxProperty.IsValid ()) {
894-
throw new System.NullReferenceException ();
895-
}
896-
fbxProperty.Set (value);
897-
898-
// Must be marked user-defined or it won't be shown in most DCCs
899-
fbxProperty.ModifyFlag (FbxPropertyFlags.EFlags.eUserDefined, true);
900-
fbxProperty.ModifyFlag (FbxPropertyFlags.EFlags.eAnimatable, true);
901-
902-
return true;
903-
}
904-
905852
/// <summary>
906853
/// Ensures that the inputted name is unique.
907854
/// If a duplicate name is found, then it is incremented.

0 commit comments

Comments
 (0)