- 
                Notifications
    
You must be signed in to change notification settings  - Fork 80
 
[Draft][USDU-331] Make package samples more user friendly #367
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
          
     Draft
      
      
            lee-aandrew
  wants to merge
  36
  commits into
  dev
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
make_samples_user_friendly
  
      
      
   
  
    
  
  
  
 
  
      
    base: dev
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Draft
                    Changes from 15 commits
      Commits
    
    
            Show all changes
          
          
            36 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      c4b7a8b
              
                Ignores two unstable test cases until a fix has been found
              
              
                lee-aandrew 464ea5b
              
                Merge branch 'dev' of https://github.com/Unity-Technologies/usd-unity…
              
              
                lee-aandrew 7af60ed
              
                Merge branch 'dev' of https://github.com/Unity-Technologies/usd-unity…
              
              
                lee-aandrew 20dc1c7
              
                Merge branch 'dev' of https://github.com/Unity-Technologies/usd-unity…
              
              
                lee-aandrew 4236bd0
              
                Merge branch 'dev' of https://github.com/Unity-Technologies/usd-unity…
              
              
                lee-aandrew 2d14b87
              
                Merge branch 'dev' of https://github.com/Unity-Technologies/usd-unity…
              
              
                lee-aandrew bb60d3e
              
                Merge branch 'dev' of https://github.com/Unity-Technologies/usd-unity…
              
              
                lee-aandrew fa6e626
              
                HelloUSD to be a bit more user-friendly
              
              
                lee-aandrew c354a2a
              
                Make Samples more user-friendly: ExportMesh, ImportProcessor, UsdTime…
              
              
                lee-aandrew 8ec4518
              
                fix formatting issue
              
              
                lee-aandrew 8f76aee
              
                Set up Samples properly according to Unity documentation
              
              
                lee-aandrew 24392f2
              
                add removal of Samples.meta file
              
              
                lee-aandrew 8399af7
              
                Revert "add removal of Samples.meta file"
              
              
                lee-aandrew bbd2308
              
                Revert "Set up Samples properly according to Unity documentation"
              
              
                lee-aandrew 9656bc2
              
                Update HelloUSD and Separated out + updated ExportMeshWithAnimation s…
              
              
                lee-aandrew 5bc6608
              
                Adds Export Mesh Example
              
              
                lee-aandrew 7eff80c
              
                Applies code review comments & fixes formatting issue
              
              
                lee-aandrew 786ea4b
              
                fixes variable naming miss
              
              
                lee-aandrew 9891944
              
                Quick clean up of non-used using references and Additional comments
              
              
                lee-aandrew e02a734
              
                Adds ExportMeshTransformOverride Sample
              
              
                lee-aandrew 9588f2c
              
                Removes hard coded color codes & adds more comments where needed
              
              
                lee-aandrew 92da6e3
              
                Removed tree object from Export Mesh example as the tree object was a…
              
              
                lee-aandrew 33e3782
              
                Quick Scene update for ExportMeshTransformOverride
              
              
                lee-aandrew be78943
              
                Fix naming issues
              
              
                lee-aandrew 721337d
              
                Changes ExportMeshExample and ExportMeshWithAnimationExample back to …
              
              
                lee-aandrew 5d5827b
              
                Redo HelloUSD to be more informative
              
              
                lee-aandrew fcba3e5
              
                Applies Vicky's PR Review suggestions
              
              
                lee-aandrew e9f8a52
              
                Apply formatting fix
              
              
                lee-aandrew fba3a79
              
                Adds Import Materials Sample Sample changes
              
              
                lee-aandrew b446bff
              
                Update Copyright comments
              
              
                lee-aandrew 94483f0
              
                Changes Import Mesh Sample to only be Import Mesh
              
              
                lee-aandrew 04d33ab
              
                Changes Import Processort Samples
              
              
                lee-aandrew eddf389
              
                Adds ExportAnimationWithRecorder sample
              
              
                lee-aandrew 149d34f
              
                Change UsdTimelinePlayable Sample
              
              
                lee-aandrew 8891a7b
              
                Apply review suggestions
              
              
                lee-aandrew 5f6ce5a
              
                Apply review suggestion for ExportAnimationWithRecorderExample
              
              
                lee-aandrew File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| using System; | ||
| using System.IO; | ||
| using System.Runtime.CompilerServices; | ||
| using UnityEditor; | ||
| using UnityEngine; | ||
| 
     | 
||
| namespace Unity.Formats.USD | ||
| { | ||
| public static class SampleUtils | ||
| { | ||
| /// <summary> | ||
| /// Utils functions for the package Samples | ||
| /// </summary> | ||
| 
     | 
||
| private static EditorWindow GetConsoleWindow() | ||
| { | ||
| var editorWindowTypes = TypeCache.GetTypesDerivedFrom<EditorWindow>(); | ||
| foreach (var type in editorWindowTypes) | ||
| { | ||
| if (type.Name == "ConsoleWindow") | ||
| { | ||
| return EditorWindow.GetWindow(type); | ||
| } | ||
| } | ||
| 
     | 
||
| throw new System.Exception("Error could not find ConsoleWindow type"); | ||
| } | ||
| 
     | 
||
| public static void FocusConsoleWindow() | ||
| { | ||
| var consoleWindow = GetConsoleWindow(); | ||
| consoleWindow.Focus(); | ||
| } | ||
| } | ||
| } | 
        
          
          
            11 changes: 11 additions & 0 deletions
          
          11 
        
  package/com.unity.formats.usd/Editor/Utils/SampleUtils.cs.meta
  
  
      
      
   
        
      
      
    Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
      
      Oops, something went wrong.
      
    
  
        
          
          
            55 changes: 0 additions & 55 deletions
          
          55 
        
  package/com.unity.formats.usd/Samples/ExportMesh/Editor/ExportMeshExampleEditor.cs
  
  
      
      
   
        
      
      
    This file was deleted.
      
      Oops, something went wrong.
      
    
  
        
          
          
            2 changes: 1 addition & 1 deletion
          
          2 
        
  ...ect/Usd-Development/Assets/Resources.meta → ....usd/Samples/ExportMeshWithAnimation.meta
  
  
      
      
   
        
      
      
    Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
      
      Oops, something went wrong.
      
    
  
            File renamed without changes.
          
    
            File renamed without changes.
          
    
        
          
          
            72 changes: 72 additions & 0 deletions
          
          72 
        
  ...ormats.usd/Samples/ExportMeshWithAnimation/Editor/ExportMeshWithAnimationExampleEditor.cs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| // Copyright 2017 Google Inc. All rights reserved. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
| 
     | 
||
| using UnityEngine; | ||
| using UnityEditor; | ||
| using System.IO; | ||
| 
     | 
||
| namespace Unity.Formats.USD.Examples | ||
| { | ||
| [CustomEditor(typeof(ExportMeshWithAnimationExample))] | ||
| public class ExportMeshExampleEditor : Editor | ||
| { | ||
| public override void OnInspectorGUI() | ||
| { | ||
| DrawDefaultInspector(); | ||
| 
     | 
||
| ExportMeshWithAnimationExample script = (ExportMeshWithAnimationExample)target; | ||
| 
     | 
||
| if (!EditorApplication.isPlaying) | ||
| { | ||
| if (GUILayout.Button("Play Scene to Start Animation")) | ||
| { | ||
| EditorApplication.isPlaying = true; | ||
| } | ||
| } | ||
| else | ||
| { | ||
| if (script.IsFinishedRecording) | ||
| { | ||
| if (GUILayout.Button("Recording Complete - Stop Scene")) | ||
| { | ||
| EditorApplication.isPlaying = false; | ||
| Debug.Log($"<color=#00FF00>Open the <b>'Assets' Folder</b> in your Unity 'Project' Window to see your newly exported USD file <{script.m_newUsdFileName}></color>"); | ||
| SampleUtils.FocusConsoleWindow(); | ||
| } | ||
| } | ||
| 
     | 
||
| else | ||
| { | ||
| if (script.IsRecording) | ||
| { | ||
| GUI.backgroundColor = Color.white; | ||
| var labelStyle = new GUIStyle() { fontStyle = FontStyle.Bold, alignment = TextAnchor.MiddleCenter }; | ||
| labelStyle.normal.textColor = Color.white; | ||
| GUILayout.Label("Recording...", labelStyle); | ||
| } | ||
| else | ||
| { | ||
| GUI.backgroundColor = Color.red; | ||
| if (GUILayout.Button("Record Animation")) | ||
| { | ||
| EditorApplication.isPaused = false; | ||
| script.StartRecording(); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| 
     | 
||
| } | ||
| } | ||
| } | ||
            File renamed without changes.
          
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
            File renamed without changes.
          
    
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
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.
Should be "Recording Complete - Exit Playmode"