-
Notifications
You must be signed in to change notification settings - Fork 79
JIRA: USDU-162 USD Recorder Integration #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beside the check for opened layer it looks good to me. Great job.
Add path validator and I'm good
|
|
||
| context = new ExportContext | ||
| { | ||
| scene = ExportHelpers.InitForSave(outputFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will throw an ApllicationException if the output file is already open.
Repro steps:
- Export once
- ImportAsGameobject
- select the UsdAsset to trigger the creation of a Scene
- start a recording -> BOOM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will leave it be for now: the error message is not too shabby and because of the tokens in the name this be a pre-validation.
If this occurs, Recording stops, Exists playmode and a console and recorder window error message is logged:
"ApplicationException: USD ERROR: A layer already exists with identifier '/d-unity-sdk/TestProject/Usd-Recorder/Recordings/Usd Clip.usd'"
sebastienduverne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (virtual review over the shoulder)
cguer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, some tiny improvements and one bug when exporting USDZ
Minor improvement
- Change default output file name from
<Recorder>to<Recorder>_<Take>(to avoid the risks of users overwriting their outputs by default)
Bug
An exception is logged when Recording a USDZ if there is a Timeline in the current scene and the Timeline Window is open.
Reproduction Steps
- Create an empty GameObject in the current scene and add a Timeline to it.
- Create a USD Recorder and change the source to any GameObject in the current scene
- Set the Export Format to USDZ
- Make sure that the Timeline window is currently opened in the Editor
- Start Recording
The following exception is logged:
System.IO.File.GetAttributes (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
UnityEditor.FileUtil.IsReadOnly (UnityEngine.Object asset) (at <0ba34cef20a14b1e8b24b1efe992a9d0>:0)
UnityEditor.Timeline.SequenceState.get_isReadOnly () (at Library/PackageCache/com.unity.timeline@1.6.0-pre.3/Editor/State/SequenceState.cs:63)
UnityEditor.Timeline.TimelineWindow.get_currentMode () (at Library/PackageCache/com.unity.timeline@1.6.0-pre.3/Editor/Window/TimelineWindow_Gui.cs:123)
UnityEditor.Timeline.TimelineWindow.DurationGUI (UnityEditor.Timeline.TimelineWindow+TimelineItemArea area, System.Double duration) (at Library/PackageCache/com.unity.timeline@1.6.0-pre.3/Editor/Window/TimelineWindow_Duration.cs:14)
UnityEditor.Timeline.TimelineWindow.SequencerGUI () (at Library/PackageCache/com.unity.timeline@1.6.0-pre.3/Editor/Window/TimelineWindow_Gui.cs:287)
UnityEditor.Timeline.TimelineWindow.DoLayout () (at Library/PackageCache/com.unity.timeline@1.6.0-pre.3/Editor/Window/TimelineWindow_Gui.cs:160)
UnityEditor.Timeline.TimelineWindow.OnGUI () (at Library/PackageCache/com.unity.timeline@1.6.0-pre.3/Editor/Window/TimelineWindow.cs:224)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <0ba34cef20a14b1e8b24b1efe992a9d0>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <0ba34cef20a14b1e8b24b1efe992a9d0>:0)
UnityEditor.DockArea.OldOnGUI () (at <0ba34cef20a14b1e8b24b1efe992a9d0>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Single pixelsPerPoint, System.Exception& immediateException) (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
Rethrow as ImmediateModeException
UnityEngine.UIElements.UIR.RenderChain.Render () (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.UIElements.Panel.UpdateForRepaint () (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <d98a0f9d3a9a450c9f1ea4983cb665e9>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <a58ba13cea6f47f98e8c8c75d33f99e3>:0)
|
|
||
| namespace UnityEditor.Formats.USD.Recorder | ||
| { | ||
| [RecorderSettings(typeof(UsdRecorder), "Usd Clip", "usd_recorder")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be "USD Clip" (with all caps). I'm not sure if it's the convention but it appears to be capitalized in the official Pixar documentation.
cguer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA approved 👍!
Tested on:
- 2021.2.0a17 (Windows only)
Purpose of this PR
USDU-162
Implement USD Recorder integration.
This is a repackaging of the timeline used recorder track.
Testing
Functional Testing status:
Added basic unit test and yamato project test trigger.
Manually exporting Cubes and skinned meshes.