Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [2.5.2] - 2020-12-16
### Fixed
- Fixed an issue where changing the active camera would be recorded one frame too late.
- Fixed an exception that would occur when undoing a Timeline Recorder Clip copy-paste action while the Inspector is active.
- Made the Animation Clip Recorder respect the Start Frame/Time setting instead of always recording from the first frame.
- Fixed Game View recording to get the expected rendering resolution, regardless of the current Game View dimensions.
- Fixed missing descriptions in Scripting API documentation.
  • Loading branch information
Unity Technologies committed Dec 16, 2020
1 parent acb9829 commit 4e9d241
Show file tree
Hide file tree
Showing 75 changed files with 618 additions and 166 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this package will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [2.5.2] - 2020-12-16
### Fixed
- Fixed an issue where changing the active camera would be recorded one frame too late.
- Fixed an exception that would occur when undoing a Timeline Recorder Clip copy-paste action while the Inspector is active.
- Made the Animation Clip Recorder respect the Start Frame/Time setting instead of always recording from the first frame.
- Fixed Game View recording to get the expected rendering resolution, regardless of the current Game View dimensions.
- Fixed missing descriptions in Scripting API documentation.

## [2.5.0-pre.1] - 2020-11-02
### Added
- Added a new sample showing how to set up a movie recording session via script.
Expand Down
6 changes: 5 additions & 1 deletion Documentation~/OutputFileProperties.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The **+Wildcards** menu helps you quickly append them to the file name string, b

| Placeholder | Description | Resolved value example |
|--|--|--|
| `<Recorder>` |The Recorder name, as it appears in the Recorder list. | `My Recorder` |
| `<Recorder>` | • In Recorder window: the Recorder name from the Recorder list.<br />• In Timeline track: the name of the Recorder clip. | `My Recorder` |
| `<Time>` | The time the recording is generated. Uses the `00h00m` format. | `16h52m` |
| `<Take>` | The **Take Number** value. Uses the `000` format. | `002` |
| `<Date>` | The date the recording is generated. Uses the `yyyy-MM-dd` format. | `2020-11-03` |
Expand All @@ -40,3 +40,7 @@ The **+Wildcards** menu helps you quickly append them to the file name string, b
| `<Resolution>` | The output image dimensions (width by height) in pixels. Uses the `WxH` format. | `1920x1080` |
| `<Frame>` | The current frame number. Uses the `0000` format.<br/><br/>This is useful for Image Sequence Recorders which output each frame as a separate file. | `0154` |
| `<Extension>` | The file extension of the output format (without the period). | `png` |
| `<GameObject>` | The name of the GameObject being recorded. | `My GameObject` |
| `<GameObjectScene>` | The name of the Scene containing the GameObject being Recorded. | `My Scene` |

**Note:** Some placeholders might not be available depending on the Recorder type you are using.
4 changes: 2 additions & 2 deletions Documentation~/RecorderImage.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ Use this section to set up the media format you need to save the recorded images
|:---|:---|:---|
| **Media File Format** || The file encoding format.<br/><br/>Choose **PNG**, **JPEG**, or **EXR** ([OpenEXR](https://en.wikipedia.org/wiki/OpenEXR)). The Recorder encodes EXR in 16 bits. |
| **Color Space** | | The color space (gamma curve and gamut) to use in the output images. |
| | sRGB, sRGB | Uses sRGB gamma curve and sRGB primaries. |
| | Linear, sRGB (unclamped) | Uses linear color space with sRGB primaries.<br/>This option is only available when you set the **Format** to **EXR**.<br/><br/>**Important:** To get the expected unclamped values in the output images, you must:<br/><br/>• Disable any Tonemapping post-processing effects in your Scene (menu: **Edit > Project Settings > HDRP Default Settings** and deselect **Tonemapping**) and in any Volume that includes a Tonemapping override (select the Volume, navigate in the Inspector and deselect **Tonemapping** if present).<br/><br/>• Disable **Dithering** on the Camera selected for the capture (in the Inspector, navigate to **General** and deselect **Dithering**). |
| | sRGB, sRGB | Uses sRGB curve and sRGB primaries. |
| | Linear, sRGB (unclamped) | Uses linear curve and sRGB primaries.<br/>This option is only available when you set the **Format** to **EXR**.<br/><br/>**Important:** To get the expected unclamped values in the output images, you must:<br/><br/>• Disable any Tonemapping post-processing effects in your Scene (menu: **Edit > Project Settings > HDRP Default Settings** and deselect **Tonemapping**) and in any Volume that includes a Tonemapping override (select the Volume, navigate in the Inspector and deselect **Tonemapping** if present).<br/><br/>• Disable **Dithering** on the Camera selected for the capture (in the Inspector, navigate to **General** and deselect **Dithering**). |
| **Include Alpha** || Enable this property to include the alpha channel in the recording. Disable it to only record the RGB channels.<br/><br/>This property is not available when the selected **Media File Format** doesn't support transparency, or when **Capture** is set to **Game View**. |

## Output File
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
Binary file added Editor/Assets/d_animation_recorder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 92 additions & 0 deletions Editor/Assets/d_animation_recorder.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
14 changes: 12 additions & 2 deletions Editor/Sources/FileNameGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public static class DefaultWildcard
/// </summary>
public static readonly string Project = GeneratePattern("Project");
/// <summary>
/// The product name from the build settings (a combination of the Unity Project name and the output file extension).
/// The product name from the build settings:
/// [PlayerSettings.productName](https://docs.unity3d.com/ScriptReference/PlayerSettings-productName.html).
/// </summary>
public static readonly string Product = GeneratePattern("Product");
/// <summary>
Expand All @@ -78,17 +79,26 @@ public static class DefaultWildcard
/// The current frame ID (a four-digit zero-padded number).
/// </summary>
public static readonly string Frame = GeneratePattern("Frame");

/// <summary>
/// The file extension of the output format.
/// </summary>
public static readonly string Extension = GeneratePattern("Extension");

/// <summary>
/// Formats a tag to be recognized as a wildcard.
/// </summary>
/// <param name="tag">The name of the tag.</param>
/// <returns>The formatted tag.</returns>
public static string GeneratePattern(string tag)
{
return "<" + tag + ">";
}
}

/// <summary>
/// A class that provides a way to generate names of output files, with support for wildcards.
/// </summary>
[Serializable]
public class FileNameGenerator
{
Expand Down Expand Up @@ -179,7 +189,7 @@ internal string AbsolutePath
}

/// <summary>
/// Use this property to ensure that the generated file is saved in the Assets folder.
/// Specifies whether the generated file is saved in the Assets folder or not.
/// </summary>
public bool ForceAssetsFolder
{
Expand Down
2 changes: 1 addition & 1 deletion Editor/Sources/FileNameGeneratorDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected override void Initialize(SerializedProperty property)
if (EditorGUIUtility.isProSkin)
iconName = "d_" + iconName;

s_OpenPathIcon = Resources.Load<Texture2D>(iconName);
s_OpenPathIcon = UnityHelpers.LoadLocalPackageAsset<Texture2D>($"{iconName}.png");
}

if (target != null)
Expand Down
21 changes: 21 additions & 0 deletions Editor/Sources/Helpers/UnityHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System.IO;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;
using UnityEditor.Recorder.Input;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.Recorder;
using UnityEngine.SceneManagement;
using UnityEngine.UIElements;
using UnityObject = UnityEngine.Object;

namespace UnityEditor.Recorder
Expand Down Expand Up @@ -164,5 +166,24 @@ internal static Texture2D RGBA32_to_RGB24(Texture2D tex)

return newTex;
}

/// <summary>
/// Load an asset from the current package's Editor/Assets folder.
/// </summary>
/// <param name="relativeFilePathWithExtension">The relative filename inside the Editor/Assets folder, without
/// leading slash.</param>
/// <typeparam name="T">The type of asset to load</typeparam>
/// <returns></returns>
internal static T LoadLocalPackageAsset<T>(string relativeFilePathWithExtension) where T : Object
{
T result = default(T);
var fullPathInProject = $"Packages/com.unity.recorder/Editor/Assets/{relativeFilePathWithExtension}";

if (File.Exists(fullPathInProject))
result = AssetDatabase.LoadAssetAtPath(fullPathInProject, typeof(T)) as T;
else
Debug.LogError($"Local asset file {fullPathInProject} not found.");
return result;
}
}
}
19 changes: 19 additions & 0 deletions Editor/Sources/ImageInputSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,29 @@ namespace UnityEditor.Recorder
[Serializable]
public class ImageInputSelector : InputSettingsSelector
{
/// <summary>
/// The settings when the input is set to Game View.
/// </summary>
[SerializeField] public GameViewInputSettings gameViewInputSettings = new GameViewInputSettings();

/// <summary>
/// The settings when the input is set to Targeted Camera.
/// </summary>
[SerializeField] public CameraInputSettings cameraInputSettings = new CameraInputSettings();

/// <summary>
/// The settings when the input is set to 360 View.
/// </summary>
[SerializeField] public Camera360InputSettings camera360InputSettings = new Camera360InputSettings();

/// <summary>
/// The settings when the input is set to Render Texture Asset.
/// </summary>
[SerializeField] public RenderTextureInputSettings renderTextureInputSettings = new RenderTextureInputSettings();

/// <summary>
/// The settings when the input is set to Texture Sampling.
/// </summary>
[SerializeField] public RenderTextureSamplerSettings renderTextureSamplerSettings = new RenderTextureSamplerSettings();

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions Editor/Sources/Recorder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public abstract class Recorder : ScriptableObject
/// </summary>
protected internal int RecordedFramesCount { get; internal set; }

/// <summary>
/// The list of inputs to the Recorder, representing the sources of the captured data.
/// </summary>
protected List<RecorderInput> m_Inputs;

void Awake()
Expand Down
9 changes: 4 additions & 5 deletions Editor/Sources/RecorderController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ public RecorderControllerSettings Settings
}

/// <summary>
/// A RecorderController requires a RecorderControllerSettings.
/// The constructor of the RecorderController.
/// </summary>
/// <param name="settings">The RecorderControllerSettings to be used by this RecorderController.</param>
/// <see cref="RecorderControllerSettings"/>
/// <param name="settings">The settings to be used by this RecorderController.</param>
public RecorderController(RecorderControllerSettings settings)
{
m_Settings = settings;
Expand All @@ -40,7 +39,7 @@ public RecorderController(RecorderControllerSettings settings)
/// To start recording once you've called this method, you must call <see cref="StartRecording"/>.
/// </summary>
/// <remarks>
/// This method sets up the internal data for the recording session and pauses the simulation to ensure a proper synchronization between the Recorder and the Unity Editor.
/// Sets up the internal data for the recording session and pauses the simulation to ensure a proper synchronization between the Recorder and the Unity Editor.
/// </remarks>
public void PrepareRecording()
{
Expand Down Expand Up @@ -140,7 +139,7 @@ public bool StartRecording()
}

/// <summary>
/// Use this method to know if all recorders are done recording.
/// Use this method to know if all recorders are done recording.
/// A recording stops:
/// 1. The settings is set to a time (or frame) interval and the end time (or last frame) was reached.
/// 2. Calling the StopRecording method.
Expand Down
Loading

0 comments on commit 4e9d241

Please sign in to comment.