Skip to content

Commit b0db34c

Browse files
committed
Asset store release v0.2.0.27
Last minute additions: - Added RecorderClip end call back
1 parent 613c862 commit b0db34c

File tree

8 files changed

+73
-21
lines changed

8 files changed

+73
-21
lines changed

source/FrameRecorder/Core/Editor/AboutBox.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void OnGUI()
6666
GUILayout.BeginHorizontal();
6767
if (GUILayout.Button("Unity's User forum"))
6868
{
69-
Application.OpenURL("https://forum.unity.com/categories/betas-experimental-features.86/");
69+
Application.OpenURL("https://forum.unity.com/threads/unity-recorder-update.509458/");
7070
this.Close();
7171
}
7272
GUILayout.EndHorizontal();

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 = 25;
11+
public static int BuildNumber = 27;
1212
public static string Tag
1313
{
1414
get { return string.Format("{0}.{1:0000}", Version, BuildNumber); }

source/FrameRecorder/Core/Engine/Timeline/RecorderClip.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ namespace UnityEngine.Recorder.Timeline
1313
[System.ComponentModel.DisplayName("Recorder Clip")]
1414
public class RecorderClip : PlayableAsset, ITimelineClipAsset
1515
{
16+
public delegate void RecordingClipDoneDelegate(RecorderClip clip);
17+
18+
public static RecordingClipDoneDelegate OnClipDone;
19+
1620
[SerializeField]
1721
public RecorderSettings m_Settings;
1822

@@ -28,7 +32,7 @@ public ClipCaps clipCaps
2832

2933
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
3034
{
31-
var playable = ScriptPlayable<RecorderPlayableBehaviour>.Create( graph );
35+
var playable = ScriptPlayable<RecorderPlayableBehaviour>.Create(graph);
3236
var behaviour = playable.GetBehaviour();
3337
if (recorderType != null && UnityHelpers.IsPlaying())
3438
{
@@ -37,6 +41,18 @@ public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
3741
m_Recorder = RecordersInventory.GenerateNewRecorder(recorderType, m_Settings),
3842
m_RecorderGO = SceneHook.HookupRecorder(),
3943
};
44+
behaviour.OnEnd = () =>
45+
{
46+
try
47+
{
48+
if (OnClipDone != null) OnClipDone(this);
49+
}
50+
catch (Exception ex)
51+
{
52+
Debug.Log("OnClipDone call back generated an exception: " + ex.Message );
53+
Debug.LogException(ex);
54+
}
55+
};
4056
}
4157
return playable;
4258
}

source/FrameRecorder/Core/Engine/Timeline/RecorderPlayableBehaviour.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using UnityEngine.Playables;
23

34
namespace UnityEngine.Recorder.Timeline
@@ -18,6 +19,8 @@ public class RecorderPlayableBehaviour : PlayableBehaviour
1819
WaitForEndOfFrameComponent endOfFrameComp;
1920
bool m_FirstOneSkipped;
2021

22+
public Action OnEnd;
23+
2124
public override void OnGraphStart(Playable playable)
2225
{
2326
if (session != null)
@@ -30,8 +33,15 @@ public override void OnGraphStart(Playable playable)
3033

3134
public override void OnGraphStop(Playable playable)
3235
{
33-
if (session != null)
36+
if (session != null && session.recording)
37+
{
3438
session.EndRecording();
39+
session.Dispose();
40+
session = null;
41+
42+
if (OnEnd != null)
43+
OnEnd();
44+
}
3545
}
3646

3747
public override void PrepareFrame(Playable playable, FrameData info)
@@ -74,6 +84,9 @@ public override void OnBehaviourPause(Playable playable, FrameData info)
7484
session.EndRecording();
7585
session.Dispose();
7686
session = null;
87+
88+
if (OnEnd != null)
89+
OnEnd();
7790
}
7891

7992
m_PlayState = PlayState.Paused;

source/FrameRecorder/Inputs/Camera360/Editor/Camera360InputEditor.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ public class Camera360InputEditor : InputEditor
1717
SerializedProperty m_FlipFinalOutput;
1818
SerializedProperty m_StereoSeparation;
1919
SerializedProperty m_CubeMapSz;
20-
SerializedProperty m_OutputSizePower;
20+
SerializedProperty m_OutputWidth;
21+
SerializedProperty m_OutputHeight;
2122
SerializedProperty m_RenderStereo;
2223

2324
protected void OnEnable()
@@ -32,7 +33,8 @@ protected void OnEnable()
3233
m_StereoSeparation = pf.Find(w => w.m_StereoSeparation);
3334
m_FlipFinalOutput = pf.Find( w => w.m_FlipFinalOutput );
3435
m_CubeMapSz = pf.Find( w => w.m_MapSize );
35-
m_OutputSizePower = pf.Find(w => w.m_OutputSizePower);
36+
m_OutputWidth = pf.Find(w => w.m_OutputWidth);
37+
m_OutputHeight = pf.Find(w => w.m_OutputHeight);
3638
m_RenderStereo = pf.Find(w => w.m_RenderStereo);
3739
}
3840

@@ -60,14 +62,19 @@ public override void OnInspectorGUI()
6062
--EditorGUI.indentLevel;
6163
}
6264

63-
AddProperty(m_OutputSizePower, () =>
65+
AddProperty(m_OutputWidth, () =>
6466
{
65-
AddProperty(m_OutputSizePower, () => EditorGUILayout.PropertyField(m_OutputSizePower, new GUIContent("Output size (power of 2)")));
67+
AddProperty(m_OutputWidth, () => EditorGUILayout.PropertyField(m_OutputWidth, new GUIContent("Output width")));
68+
});
69+
70+
AddProperty(m_OutputHeight, () =>
71+
{
72+
AddProperty(m_OutputWidth, () => EditorGUILayout.PropertyField(m_OutputHeight, new GUIContent("Output height")));
6673
});
6774

6875
AddProperty(m_CubeMapSz, () =>
6976
{
70-
AddProperty(m_CubeMapSz, () => EditorGUILayout.PropertyField(m_CubeMapSz, new GUIContent("Cube map size (power of 2)")));
77+
AddProperty(m_CubeMapSz, () => EditorGUILayout.PropertyField(m_CubeMapSz, new GUIContent("Cube map width")));
7178
});
7279

7380
AddProperty(m_RenderStereo, () =>

source/FrameRecorder/Inputs/Camera360/Engine/Camera360Input.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ public override void BeginRecording(RecordingSession session)
4242
{
4343
if (settings360.m_FlipFinalOutput)
4444
m_VFlipper = new TextureFlipper();
45-
outputHeight = outputWidth = 1024;
45+
outputWidth = settings360.m_OutputWidth;
46+
outputHeight = settings360.m_OutputHeight;
4647
}
4748

4849
public override void NewFrameStarting(RecordingSession session)
@@ -152,13 +153,15 @@ bool PrepFrameRenderTexture()
152153

153154
outputRT = new RenderTexture(outputWidth, outputHeight, 24, RenderTextureFormat.ARGB32)
154155
{
155-
dimension = TextureDimension.Cube
156+
dimension = TextureDimension.Tex2D,
157+
antiAliasing = 1
156158
};
157-
m_Cubemap1 = new RenderTexture(256, 256, 24, RenderTextureFormat.ARGB32)
159+
m_Cubemap1 = new RenderTexture(settings360.m_MapSize, settings360.m_MapSize, 24, RenderTextureFormat.ARGB32)
158160
{
159-
dimension = TextureDimension.Cube
161+
dimension = TextureDimension.Cube ,
162+
160163
};
161-
m_Cubemap2 = new RenderTexture(256, 256, 24, RenderTextureFormat.ARGB32)
164+
m_Cubemap2 = new RenderTexture(settings360.m_MapSize, settings360.m_MapSize, 24, RenderTextureFormat.ARGB32)
162165
{
163166
dimension = TextureDimension.Cube
164167
};

source/FrameRecorder/Inputs/Camera360/Engine/Camera360InputSettings.cs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ public class Camera360InputSettings : ImageInputSettings
1313
public bool m_FlipFinalOutput = false;
1414
public bool m_RenderStereo = true;
1515
public float m_StereoSeparation = 0.065f;
16-
public int m_MapSize = 256;
17-
public int m_OutputSizePower = 1024;
16+
public int m_MapSize = 1024;
17+
public int m_OutputWidth = 1024;
18+
public int m_OutputHeight = 2048;
1819

1920
public override Type inputType
2021
{
@@ -31,16 +32,28 @@ public override bool ValidityCheck( List<string> errors )
3132
errors.Add("Missing camera tag");
3233
}
3334

34-
if (m_OutputSizePower != (1 << (int)Math.Log(m_OutputSizePower, 2)))
35+
if (m_OutputWidth != (1 << (int)Math.Log(m_OutputWidth, 2)))
3536
{
3637
ok =false;
37-
errors.Add("Output size must be a power of 2.");
38+
errors.Add("Output width must be a power of 2.");
3839
}
3940

40-
if (m_OutputSizePower < 128 || m_OutputSizePower > 8 * 1024)
41+
if (m_OutputWidth < 128 || m_OutputWidth > 8 * 1024)
4142
{
4243
ok = false;
43-
errors.Add( string.Format( "Output size must fall between {0} and {1}.", 128, 8*1024 ));
44+
errors.Add( string.Format( "Output width must fall between {0} and {1}.", 128, 8*1024 ));
45+
}
46+
47+
if (m_OutputHeight != (1 << (int)Math.Log(m_OutputHeight, 2)))
48+
{
49+
ok =false;
50+
errors.Add("Output height must be a power of 2.");
51+
}
52+
53+
if (m_OutputHeight < 128 || m_OutputHeight > 8 * 1024)
54+
{
55+
ok = false;
56+
errors.Add( string.Format( "Output height must fall between {0} and {1}.", 128, 8*1024 ));
4457
}
4558

4659
if (m_MapSize != (1 << (int)Math.Log(m_MapSize, 2)))

source/FrameRecorder/Recorders/ImageRecorder/Engine/ImageRecorderSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public override List<InputGroupFilter> GetInputGroups()
9292
#endif
9393
new TInputFilter<CBRenderTextureInputSettings>("Camera(s)"),
9494
#if UNITY_2018_1_OR_NEWER
95-
new TInputFilter<Camera360InputSettings>("360 view"),
95+
new TInputFilter<Camera360InputSettings>("360 View (feature preview)"),
9696
#endif
9797
new TInputFilter<RenderTextureSamplerSettings>("Sampling"),
9898
new TInputFilter<RenderTextureInputSettings>("Render Texture"),

0 commit comments

Comments
 (0)