Skip to content

Commit 2c7944d

Browse files
committed
add back export geometry option
1 parent 005696c commit 2c7944d

File tree

5 files changed

+21
-1
lines changed

5 files changed

+21
-1
lines changed
7.03 KB
Loading

com.unity.formats.fbx/Documentation~/recorder.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Alternatively, the FBX Recorder can be added as a track in the Timeline.
1818

1919
| Property: | Function: |
2020
| :---------------------------- | :----------------------------------------------------------- |
21+
| __Export Geometry__ | Check this option to export the geometry of the recorded GameObject to FBX, if any. |
2122
| __File Name__ | The filename for the exported FBX. |
2223
| __Path__ | The path to export the FBX to. Can be outside of the Assets folder. |
2324
| __Take Number__ | The take number can be set and used in the filename. It automatically increments after each recording. |

com.unity.formats.fbx/Editor/Sources/Recorders/FbxRecorder/FbxRecorder.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ protected override void EndRecording(RecordingSession session)
6363
AnimationUtility.SetAnimationClips(animator, new AnimationClip[] { clip });
6464
var exportSettings = new ExportModelSettingsSerialize();
6565
var toInclude = ExportSettings.Include.ModelAndAnim;
66+
if (!settings.ExportGeometry)
67+
{
68+
toInclude = ExportSettings.Include.Anim;
69+
}
6670
exportSettings.SetModelAnimIncludeOption(toInclude);
6771
ModelExporter.ExportObject(clipName, root, exportSettings);
6872

com.unity.formats.fbx/Editor/Sources/Recorders/FbxRecorder/FbxRecorderSettings.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,21 @@
77
namespace UnityEditor.Formats.Fbx.Exporter
88
{
99
[RecorderSettings(typeof(FbxRecorder), "FBX", "fbx_recorder")]
10-
internal class FbxRecorderSettings : RecorderSettings
10+
public class FbxRecorderSettings : RecorderSettings
1111
{
12+
[SerializeField] bool m_exportGeometry = true;
13+
public bool ExportGeometry
14+
{
15+
get
16+
{
17+
return m_exportGeometry;
18+
}
19+
set
20+
{
21+
m_exportGeometry = value;
22+
}
23+
}
24+
1225
[SerializeField] AnimationInputSettings m_AnimationInputSettings = new AnimationInputSettings();
1326

1427
public AnimationInputSettings animationInputSettings

com.unity.formats.fbx/Editor/Sources/Recorders/FbxRecorder/FbxRecorderSettingsEditor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ protected override void FileTypeAndFormatGUI()
1414
EditorGUILayout.LabelField("Format", "FBX");
1515

1616
FbxRecorderSettings settings = target as FbxRecorderSettings;
17+
18+
settings.ExportGeometry = EditorGUILayout.Toggle("Export Geometry", settings.ExportGeometry);
1719
}
1820
}
1921
}

0 commit comments

Comments
 (0)