Skip to content

Commit 0fffbda

Browse files
authored
Merge pull request #62 from Unity-Technologies/dev
bug fixes and cleanup
2 parents ade1d94 + ffed79f commit 0fffbda

9 files changed

Lines changed: 39 additions & 25 deletions

File tree

source/FrameRecorder/Core/Editor/RecorderWindow.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using UnityEngine.Recorder;
44
using UnityEngine;
5+
using UnityEngine.Recorder.Input;
56

67
namespace UnityEditor.Recorder
78
{
@@ -257,6 +258,7 @@ void UpdateRecordingProgress( GameObject go)
257258
void StartRecording()
258259
{
259260
m_State = EState.WaitingForPlayModeToStartRecording;
261+
GameViewSize.DisableMaxOnPlay();
260262
EditorApplication.isPlaying = true;
261263
m_FrameCount = Time.frameCount;
262264
return;

source/FrameRecorder/Core/Engine/RecorderVersion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace UnityEditor.Recorder
88
public class RecorderVersion : ScriptableObject
99
{
1010
public const string Version = "0.2"; // major.minor.build
11-
public static int BuildNumber = 27;
11+
public static int BuildNumber = 30;
1212
public static string Tag
1313
{
1414
get { return string.Format("{0}.{1:0000}", Version, BuildNumber); }

source/FrameRecorder/Core/Engine/RecordingSession.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using UnityEngine.Recorder.Input;
23

34
namespace UnityEngine.Recorder
45
{

source/FrameRecorder/Inputs/CBRenderTexture/Engine/GameViewSize.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ public static EditorWindow GetMainGameView()
2222
}
2323

2424

25+
public static void DisableMaxOnPlay()
26+
{
27+
var gameView = GetMainGameView();
28+
29+
if ((gameView.GetType().GetField("m_MaximizeOnPlay", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(gameView) as bool? )== true)
30+
{
31+
Debug.LogWarning("'Maximize on Play' not compatible wit recorder: disabling it!");
32+
gameView.GetType().GetField("m_MaximizeOnPlay", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(gameView, false);
33+
}
34+
}
35+
2536
public static void GetGameRenderSize(out int width, out int height)
2637
{
2738
var gameView = GetMainGameView();

source/FrameRecorder/Inputs/RenderTextureSampler/Editor/RenderTextureSamplerEditor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ public override void OnInspectorGUI()
7979
AddProperty(m_FinalSize, () =>
8080
{
8181
m_ResSelector.OnInspectorGUI( (target as ImageInputSettings).maxSupportedSize, m_FinalSize );
82+
if (m_FinalSize.intValue == (int)EImageDimension.Window)
83+
m_FinalSize.intValue = (int)EImageDimension.x720p_HD;
8284
if (m_FinalSize.intValue > renderSize.intValue)
8385
renderSize.intValue = m_FinalSize.intValue;
8486
});

source/FrameRecorder/Inputs/ScreenCapture/Engine/ScreenCaptureInput.cs

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,27 @@ public override void BeginRecording(RecordingSession session)
5959
outputHeight = (outputHeight + 1) & ~1;
6060
}
6161

62-
var size = GameViewSize.SetCustomSize(outputWidth, outputHeight) ?? GameViewSize.AddSize(outputWidth, outputHeight);
63-
if (GameViewSize.m_ModifiedResolutionCount == 0)
64-
GameViewSize.BackupCurrentSize();
65-
else
62+
break;
63+
}
64+
}
65+
66+
int w, h;
67+
GameViewSize.GetGameRenderSize(out w, out h);
68+
if (w != outputWidth || h != outputHeight)
69+
{
70+
var size = GameViewSize.SetCustomSize(outputWidth, outputHeight) ?? GameViewSize.AddSize(outputWidth, outputHeight);
71+
if (GameViewSize.m_ModifiedResolutionCount == 0)
72+
GameViewSize.BackupCurrentSize();
73+
else
74+
{
75+
if (size != GameViewSize.currentSize)
6676
{
67-
if (size != GameViewSize.currentSize)
68-
{
69-
Debug.LogError("Requestion a resultion change while a recorder's input has already requested one! Undefined behaviour.");
70-
}
77+
Debug.LogError("Requestion a resultion change while a recorder's input has already requested one! Undefined behaviour.");
7178
}
72-
GameViewSize.m_ModifiedResolutionCount++;
73-
m_ModifiedResolution = true;
74-
GameViewSize.SelectSize(size);
75-
break;
7679
}
80+
GameViewSize.m_ModifiedResolutionCount++;
81+
m_ModifiedResolution = true;
82+
GameViewSize.SelectSize(size);
7783
}
7884
#endif
7985

source/FrameRecorder/Packager/Private/Editor/FRPackager.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ static void DecrementVersion()
2323
static void GenerateAssetStorePackage()
2424
{
2525
var rootPath = FRPackagerPaths.GetRecorderRootPath();
26-
var type = Type.GetType("UnityEditor.Recorder.MovieRecorderPackager");
27-
if (type != null)
28-
{
29-
var method = type.GetMethod("GeneratePackage");
30-
method.Invoke(null, null);
31-
AssetDatabase.Refresh();
32-
}
3326

3427
UpdateVersion(1);
3528

@@ -43,7 +36,7 @@ static void GenerateAssetStorePackage()
4336
Path.Combine(rootPath, "Framework/Packager/Editor" ),
4437
Path.Combine(rootPath, "Extensions/UTJ" ),
4538
Path.Combine(rootPath, "Extensions/FCIntegration" ),
46-
Path.Combine(rootPath, "Extensions/MovieRecorder/Packaging" ),
39+
Path.Combine(rootPath, "Extensions/MovieRecorder" ),
4740
};
4841
var destFile = k_PackageName + " " + RecorderVersion.Stage + " v"+ RecorderVersion.Tag + ".unitypackage";
4942
AssetDatabase.ExportPackage(files, destFile, ExportPackageOptions.Recurse);

source/FrameRecorder/Recorders/AnimationRecorder/Editor/AnimationRecorder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace UnityEditor.Experimental.Recorder
1010
{
11-
[Recorder(typeof(AnimationRecorderSettings), "Animation", "Unity/Animation Recording")]
11+
[Recorder(typeof(AnimationRecorderSettings), "Animation Clips", "Unity/Animation Recording")]
1212
public class AnimationRecorder : GenericRecorder<AnimationRecorderSettings>
1313
{
1414
public override void RecordFrame(RecordingSession session)

source/FrameRecorder/Recorders/AnimationRecorder/Editor/AnimationRecorderSettingsEditor.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ public class AnimationRecorderSettingsEditor: RecorderEditor
1414
{
1515
private bool recorderSettings = false;
1616

17-
[MenuItem("Tools/Recorder/Animation")]
17+
[MenuItem("Tools/Recorder/Animation Clips")]
1818
private static void ShowRecorderWindow()
1919
{
20-
RecorderWindow.ShowAndPreselectCategory("Animation");
20+
RecorderWindow.ShowAndPreselectCategory("Animation Clips");
2121
}
22-
2322

2423
protected override void OnInputGui()
2524
{

0 commit comments

Comments
 (0)