├── .gitignore ├── LICENSE ├── README.md └── Unity4 ├── Assembly-CSharp-Editor-vs.csproj ├── Assembly-CSharp-Editor.csproj ├── Assembly-CSharp-vs.csproj ├── Assembly-CSharp.csproj ├── Assets ├── AnimationCurveTools.meta └── AnimationCurveTools │ ├── Editor.meta │ ├── Editor │ ├── AnimationCurveExtractor.cs │ ├── AnimationCurveExtractor.cs.meta │ ├── BetterAnimationCurveFieldDrawer.cs │ └── BetterAnimationCurveFieldDrawer.cs.meta │ ├── Test.meta │ └── Test │ ├── .DS_Store │ ├── AnAnimation.anim │ ├── AnAnimation.anim.meta │ ├── TestObject.prefab │ ├── TestObject.prefab.meta │ ├── ThingWithAnimationCurve.cs │ └── ThingWithAnimationCurve.cs.meta ├── ProjectSettings ├── AudioManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshLayers.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── QualitySettings.asset ├── TagManager.asset └── TimeManager.asset ├── Unity4-csharp.sln └── Unity4.sln /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) 2 | [Bb]in/ 3 | [Oo]bj/ 4 | 5 | # mstest test results 6 | TestResults 7 | 8 | ## Ignore Visual Studio temporary files, build results, and 9 | ## files generated by popular Visual Studio add-ons. 10 | 11 | # User-specific files 12 | *.suo 13 | *.user 14 | *.sln.docstates 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Rr]elease/ 19 | x64/ 20 | *_i.c 21 | *_p.c 22 | *.ilk 23 | *.obj 24 | *.pch 25 | *.pdb 26 | *.pgc 27 | *.pgd 28 | *.rsp 29 | *.sbr 30 | *.tlb 31 | *.tli 32 | *.tlh 33 | *.tmp 34 | *.log 35 | *.vspscc 36 | *.vssscc 37 | .builds 38 | 39 | # Visual C++ cache files 40 | ipch/ 41 | *.aps 42 | *.ncb 43 | *.opensdf 44 | *.sdf 45 | 46 | # Visual Studio profiler 47 | *.psess 48 | *.vsp 49 | *.vspx 50 | 51 | # Guidance Automation Toolkit 52 | *.gpState 53 | 54 | # ReSharper is a .NET coding add-in 55 | _ReSharper* 56 | 57 | # NCrunch 58 | *.ncrunch* 59 | .*crunch*.local.xml 60 | 61 | # Installshield output folder 62 | [Ee]xpress 63 | 64 | # DocProject is a documentation generator add-in 65 | DocProject/buildhelp/ 66 | DocProject/Help/*.HxT 67 | DocProject/Help/*.HxC 68 | DocProject/Help/*.hhc 69 | DocProject/Help/*.hhk 70 | DocProject/Help/*.hhp 71 | DocProject/Help/Html2 72 | DocProject/Help/html 73 | 74 | # Click-Once directory 75 | publish 76 | 77 | # Publish Web Output 78 | *.Publish.xml 79 | 80 | # NuGet Packages Directory 81 | packages 82 | 83 | # Windows Azure Build Output 84 | csx 85 | *.build.csdef 86 | 87 | # Windows Store app package directory 88 | AppPackages/ 89 | 90 | # Others 91 | [Bb]in 92 | [Oo]bj 93 | sql 94 | TestResults 95 | [Tt]est[Rr]esult* 96 | *.Cache 97 | ClientBin 98 | [Ss]tyle[Cc]op.* 99 | ~$* 100 | *.dbmdl 101 | Generated_Code #added for RIA/Silverlight projects 102 | 103 | # Backup & report files from converting an old project file to a newer 104 | # Visual Studio version. Backup files are not needed, because we have git ;-) 105 | _UpgradeReport_Files/ 106 | Backup*/ 107 | UpgradeLog*.XML 108 | 109 | Unity4/Assets/.DS_Store 110 | Unity4/Library 111 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 JoshuaGlazer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | AnimationCurveTools 2 | =================== 3 | 4 | Tools for copying and pasting Unity3d AnimationCurves, and for extracting AnimationCurves from imported Animations 5 | 6 | I use AnimationCurves for a lot of things ( specifically tweens, changing colors, simulating root motion without Mecanim, faking physical interactions between adjacent pieces in a game I'm working on ) and sometimes it's really helpful to be able to copy and paste a curve from one prefab to another. Unity left out this feature, so here's a hand project that supports it. With this custom AnimationCurve inspector, you can right click on the name of an AnimationCurve field in the inspector and select "Copy Animation Curve": 7 | 8 | 9 | Then you can click on any other AnimationCurve field and paste that data in using the "Paste Animation Curve" option and the curve will be copied over for you to edit or use how you please. 10 | 11 | 12 | 13 | You may have noticed that there's a third option in the popup menu- "Extract From Animation..." Instead of copying and pasting, this will let you take data from an Animation imported as part of an FBX and copy it into your AnimationCurve. I wrote this for Max Axe because, for performance reasons on old hardware, we had to switch from Mecanim back to legacy animation and didn't want to lose the root motion built into the main character's animation. So, I extracted the root motion channel from Max's run animation and used that to offset his position in the world after the artists had nulled the track back out. To extract an animation, simply choose the top option from the popup menu: 14 | 15 | 16 | This will open up a new Animation Curve window, waiting for you to select an Animation. This can be any animation- either a standalone .Anim or an animation embedded in an .fbx. After you've done that, you can select the transform and channel you'd like to extract, from a nicely hierarchical menu setup that mirrors your skeleton. 17 | 18 | 19 | In this case I'm just grabbing the m_LocalPosition.z from the C_Global_ctrl since that has Max's root motion translation in it ( he doesn't move form side to side ) 20 | 21 | After that, you'll see the Data from that curve nicely display in the Data field, so you can make sure you selected what you thought you selected and not just some similarly named controller left in the exported art file. 22 | 23 | 24 | Finally, press Extract and the data will get copied into your curve! 25 | 26 | 27 | There you go, ready to rock with your Animation Curve Tools and your awesome new Animation Curve data. Cheers! 28 | -------------------------------------------------------------------------------- /Unity4/Assembly-CSharp-Editor-vs.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {8450CD95-2E39-7280-C7B3-5ED1A96B1489} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp-Editor 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_4_5_0;UNITY_4_5;UNITY_STANDALONE_OSX;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_GAMECENTER;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_OSX;UNITY_PRO_LICENSE 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll 43 | 44 | 45 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.Graphs.dll 53 | 54 | 55 | 56 | 57 | {7A70A05E-C436-8E06-4266-05DBE96BDCFB} Assembly-CSharp-vs 58 | 59 | 60 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /Unity4/Assembly-CSharp-Editor.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {8450CD95-2E39-7280-C7B3-5ED1A96B1489} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp-Editor 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_4_5_0;UNITY_4_5;UNITY_STANDALONE_OSX;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_GAMECENTER;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_OSX;UNITY_PRO_LICENSE 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll 43 | 44 | 45 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.Graphs.dll 53 | 54 | 55 | 56 | 57 | {7A70A05E-C436-8E06-4266-05DBE96BDCFB} Assembly-CSharp 58 | 59 | 60 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /Unity4/Assembly-CSharp-vs.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {7A70A05E-C436-8E06-4266-05DBE96BDCFB} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_4_5_0;UNITY_4_5;UNITY_STANDALONE_OSX;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_GAMECENTER;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_OSX;UNITY_PRO_LICENSE 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll 43 | 44 | 45 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Unity4/Assembly-CSharp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {7A70A05E-C436-8E06-4266-05DBE96BDCFB} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_4_5_0;UNITY_4_5;UNITY_STANDALONE_OSX;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_GAMECENTER;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_OSX;UNITY_PRO_LICENSE 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll 43 | 44 | 45 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Unity4/Assets/AnimationCurveTools.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39de64d6a9ce5437cb106c782cd997bd 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Unity4/Assets/AnimationCurveTools/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 237e35843c6c14f1da92a3eabd69f380 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Unity4/Assets/AnimationCurveTools/Editor/AnimationCurveExtractor.cs: -------------------------------------------------------------------------------- 1 | 2 | // Original code by: Joshua Glazer 3 | // Updated to Unity 4.3.4 by: Aurelio Provedo [aurelioprovedo@gmail.com] 4 | using System; 5 | using UnityEngine; 6 | using UnityEditor; 7 | 8 | 9 | public class AnimationCurveExtractor : EditorWindow 10 | { 11 | 12 | 13 | public void Init(SerializedProperty inTargetProperty) 14 | { 15 | //keep the iterator in its current state... 16 | _PopupTargetAnimationCurveProperty = inTargetProperty; 17 | } 18 | 19 | void OnGUI() 20 | { 21 | AnimationClip anim = EditorGUILayout.ObjectField("Source Animation", _SourceAnimationClip, typeof(AnimationClip), false) as AnimationClip; 22 | 23 | if (anim != _SourceAnimationClip) 24 | { 25 | _SourceAnimationClip = anim; 26 | if (anim != null) 27 | { 28 | #if !UNITY_4_2 29 | _Curves = AnimationUtility.GetCurveBindings(anim); 30 | #else 31 | _Curves = AnimationUtility.GetAllCurves(anim); 32 | #endif 33 | 34 | _SelectedCurveIndex = 0; 35 | int curveCount = _Curves.Length; 36 | _CurveNames = new string[curveCount]; 37 | for (int i = 0; i < curveCount; ++i) 38 | { 39 | if (_Curves[i].path == "") 40 | { 41 | _CurveNames[i] = _Curves[i].propertyName; 42 | } 43 | else 44 | { 45 | _CurveNames[i] = _Curves[i].path + "/" + _Curves[i].propertyName; 46 | } 47 | } 48 | } 49 | else 50 | { 51 | _Curves = null; 52 | _CurveNames = null; 53 | } 54 | } 55 | 56 | if (_Curves != null && _Curves.Length > 0) 57 | { 58 | _SelectedCurveIndex = EditorGUILayout.Popup("Source Curve", _SelectedCurveIndex, _CurveNames); 59 | 60 | #if !UNITY_4_2 61 | EditorGUILayout.CurveField("Data", AnimationUtility.GetEditorCurve(_SourceAnimationClip, _Curves[_SelectedCurveIndex])); 62 | #else 63 | EditorGUILayout.CurveField("Data", _Curves[_SelectedCurveIndex].curve); 64 | #endif 65 | 66 | /* 67 | _ShouldZeroOriginalCurve = EditorGUILayout.Toggle( "Should Zero Original Curve", _ShouldZeroOriginalCurve ); 68 | */ 69 | 70 | if (GUILayout.Button("Extract!")) 71 | { 72 | Extract(); 73 | Close(); 74 | } 75 | } 76 | 77 | 78 | 79 | } 80 | 81 | private void Extract() 82 | { 83 | #if !UNITY_4_2 84 | AnimationCurve sourceCurve = AnimationUtility.GetEditorCurve(_SourceAnimationClip, _Curves[_SelectedCurveIndex]); 85 | #else 86 | AnimationCurve sourceCurve = _Curves[_SelectedCurveIndex].curve; 87 | #endif 88 | 89 | _PopupTargetAnimationCurveProperty.animationCurveValue = AnimationCurveCopier.CreateCopy(sourceCurve); 90 | _PopupTargetAnimationCurveProperty.serializedObject.ApplyModifiedProperties(); 91 | 92 | /* 93 | *we would need to copy this back in if we want it to work... 94 | if( _ShouldZeroOriginalCurve ) 95 | { 96 | Keyframe[] keys = sourceCurve.keys; 97 | for( int i = 0, c = keys.Length; i < c; ++i ) 98 | { 99 | keys[ i ].value = 0; 100 | } 101 | sourceCurve.keys = keys; 102 | } 103 | */ 104 | } 105 | 106 | private SerializedProperty _PopupTargetAnimationCurveProperty; 107 | 108 | private AnimationClip _SourceAnimationClip; 109 | 110 | #if !UNITY_4_2 111 | private EditorCurveBinding[] _Curves; 112 | #else 113 | private AnimationClipCurveData[] _Curves; 114 | #endif 115 | 116 | private string[] _CurveNames; 117 | private int _SelectedCurveIndex; 118 | //private bool _ShouldZeroOriginalCurve; 119 | } 120 | 121 | 122 | public static class AnimationCurveCopier 123 | { 124 | public static void Copy(AnimationCurve inSource, AnimationCurve inDest) 125 | { 126 | inDest.keys = inSource.keys; 127 | inDest.preWrapMode = inSource.preWrapMode; 128 | inDest.postWrapMode = inSource.postWrapMode; 129 | } 130 | 131 | public static AnimationCurve CreateCopy(AnimationCurve inSource) 132 | { 133 | AnimationCurve newCurve = new AnimationCurve(); 134 | Copy(inSource, newCurve); 135 | return newCurve; 136 | } 137 | } 138 | 139 | -------------------------------------------------------------------------------- /Unity4/Assets/AnimationCurveTools/Editor/AnimationCurveExtractor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf641b15af5ec40abbf397858a0e132d 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Unity4/Assets/AnimationCurveTools/Editor/BetterAnimationCurveFieldDrawer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEditor; 4 | 5 | 6 | [CustomPropertyDrawer( typeof( AnimationCurve ) )] 7 | public class BetterAnimationCurveFieldDrawer : PropertyDrawer 8 | { 9 | [MenuItem ("CONTEXT/AnimationCurve/Extract From Animation...")] 10 | static void ExtractAnimationCurve( MenuCommand inCommand ) 11 | { 12 | if( _PopupTargetAnimationCurveProperty != null ) 13 | { 14 | AnimationCurveExtractor aceWindow = AnimationCurveExtractor.GetWindow( typeof( AnimationCurveExtractor ) ) as AnimationCurveExtractor; 15 | aceWindow.Init( _PopupTargetAnimationCurveProperty ); 16 | } 17 | } 18 | 19 | [MenuItem ("CONTEXT/AnimationCurve/Copy Animation Curve")] 20 | static void CopyAnimationCurve( MenuCommand inCommand ) 21 | { 22 | if( _PopupTargetAnimationCurveProperty != null ) 23 | { 24 | _ClipBoardAnimationCurve = AnimationCurveCopier.CreateCopy( _PopupTargetAnimationCurveProperty.animationCurveValue ); 25 | } 26 | } 27 | 28 | [MenuItem ("CONTEXT/AnimationCurve/Paste Animation Curve")] 29 | static void PasteAnimationCurve( MenuCommand inCommand ) 30 | { 31 | if( _PopupTargetAnimationCurveProperty != null ) 32 | { 33 | _PopupTargetAnimationCurveProperty.serializedObject.Update(); 34 | _PopupTargetAnimationCurveProperty.animationCurveValue = AnimationCurveCopier.CreateCopy( _ClipBoardAnimationCurve ); 35 | _PopupTargetAnimationCurveProperty.serializedObject.ApplyModifiedProperties(); 36 | } 37 | } 38 | 39 | 40 | 41 | // Draw the property inside the given rect 42 | public override void OnGUI ( Rect inRect, SerializedProperty inProperty, GUIContent inLabel ) 43 | { 44 | 45 | var evt = Event.current; 46 | if( evt.type == EventType.ContextClick ) 47 | { 48 | var mousePos = evt.mousePosition; 49 | if ( inRect.Contains( mousePos ) ) 50 | { 51 | _PopupTargetAnimationCurveProperty = inProperty.Copy(); 52 | inProperty.serializedObject.Update(); 53 | EditorUtility.DisplayPopupMenu( new Rect( mousePos.x,mousePos.y, 0, 0 ), "CONTEXT/AnimationCurve/", null ); 54 | } 55 | } 56 | else 57 | { 58 | inLabel = EditorGUI.BeginProperty( inRect, inLabel, inProperty ); 59 | EditorGUI.BeginChangeCheck (); 60 | AnimationCurve newCurve = EditorGUI.CurveField( inRect, inLabel, inProperty.animationCurveValue ); 61 | 62 | if( EditorGUI.EndChangeCheck() ) 63 | { 64 | inProperty.animationCurveValue = newCurve; 65 | } 66 | 67 | EditorGUI.EndProperty (); 68 | 69 | 70 | } 71 | 72 | 73 | 74 | } 75 | 76 | private static AnimationCurve _ClipBoardAnimationCurve = new AnimationCurve(); 77 | 78 | //meun command context isn't working, so we'll just stash it here... 79 | private static SerializedProperty _PopupTargetAnimationCurveProperty = null; 80 | 81 | } 82 | -------------------------------------------------------------------------------- /Unity4/Assets/AnimationCurveTools/Editor/BetterAnimationCurveFieldDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a4c25c35eb724c49a792f473fbcbc26 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Unity4/Assets/AnimationCurveTools/Test.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3701d722aedd24664adf296a73375763 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Unity4/Assets/AnimationCurveTools/Test/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshuaGlazer/AnimationCurveTools/a158e83e64b430564fac9e47ec74da4bd83217a3/Unity4/Assets/AnimationCurveTools/Test/.DS_Store -------------------------------------------------------------------------------- /Unity4/Assets/AnimationCurveTools/Test/AnAnimation.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshuaGlazer/AnimationCurveTools/a158e83e64b430564fac9e47ec74da4bd83217a3/Unity4/Assets/AnimationCurveTools/Test/AnAnimation.anim -------------------------------------------------------------------------------- /Unity4/Assets/AnimationCurveTools/Test/AnAnimation.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7cd3cf58a6c464517997736212c6cf94 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Unity4/Assets/AnimationCurveTools/Test/TestObject.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshuaGlazer/AnimationCurveTools/a158e83e64b430564fac9e47ec74da4bd83217a3/Unity4/Assets/AnimationCurveTools/Test/TestObject.prefab -------------------------------------------------------------------------------- /Unity4/Assets/AnimationCurveTools/Test/TestObject.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 225b5ca09645647ff94e5b5aba5a3f5b 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Unity4/Assets/AnimationCurveTools/Test/ThingWithAnimationCurve.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class ThingWithAnimationCurve : MonoBehaviour 5 | { 6 | 7 | public AnimationCurve EvilGlowingEyeAlpha; 8 | public AnimationCurve HairLossOverTime; 9 | public AnimationCurve RootMotion; 10 | 11 | // Use this for initialization 12 | void Start () { 13 | 14 | } 15 | 16 | // Update is called once per frame 17 | void Update () { 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Unity4/Assets/AnimationCurveTools/Test/ThingWithAnimationCurve.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4754004b463e443f798ccecc47a35b74 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Unity4/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshuaGlazer/AnimationCurveTools/a158e83e64b430564fac9e47ec74da4bd83217a3/Unity4/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /Unity4/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshuaGlazer/AnimationCurveTools/a158e83e64b430564fac9e47ec74da4bd83217a3/Unity4/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /Unity4/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshuaGlazer/AnimationCurveTools/a158e83e64b430564fac9e47ec74da4bd83217a3/Unity4/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /Unity4/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshuaGlazer/AnimationCurveTools/a158e83e64b430564fac9e47ec74da4bd83217a3/Unity4/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /Unity4/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshuaGlazer/AnimationCurveTools/a158e83e64b430564fac9e47ec74da4bd83217a3/Unity4/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /Unity4/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshuaGlazer/AnimationCurveTools/a158e83e64b430564fac9e47ec74da4bd83217a3/Unity4/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /Unity4/ProjectSettings/NavMeshLayers.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshuaGlazer/AnimationCurveTools/a158e83e64b430564fac9e47ec74da4bd83217a3/Unity4/ProjectSettings/NavMeshLayers.asset -------------------------------------------------------------------------------- /Unity4/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshuaGlazer/AnimationCurveTools/a158e83e64b430564fac9e47ec74da4bd83217a3/Unity4/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /Unity4/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshuaGlazer/AnimationCurveTools/a158e83e64b430564fac9e47ec74da4bd83217a3/Unity4/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /Unity4/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshuaGlazer/AnimationCurveTools/a158e83e64b430564fac9e47ec74da4bd83217a3/Unity4/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /Unity4/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshuaGlazer/AnimationCurveTools/a158e83e64b430564fac9e47ec74da4bd83217a3/Unity4/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /Unity4/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshuaGlazer/AnimationCurveTools/a158e83e64b430564fac9e47ec74da4bd83217a3/Unity4/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /Unity4/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshuaGlazer/AnimationCurveTools/a158e83e64b430564fac9e47ec74da4bd83217a3/Unity4/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /Unity4/Unity4-csharp.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual Studio 2008 3 | 4 | Project("{04226888-D485-9849-11B2-3362DA1952E2}") = "Unity4", "Assembly-CSharp-vs.csproj", "{7A70A05E-C436-8E06-4266-05DBE96BDCFB}" 5 | EndProject 6 | Project("{04226888-D485-9849-11B2-3362DA1952E2}") = "Unity4", "Assembly-CSharp-Editor-vs.csproj", "{8450CD95-2E39-7280-C7B3-5ED1A96B1489}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {7A70A05E-C436-8E06-4266-05DBE96BDCFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {7A70A05E-C436-8E06-4266-05DBE96BDCFB}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {7A70A05E-C436-8E06-4266-05DBE96BDCFB}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {7A70A05E-C436-8E06-4266-05DBE96BDCFB}.Release|Any CPU.Build.0 = Release|Any CPU 18 | {8450CD95-2E39-7280-C7B3-5ED1A96B1489}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {8450CD95-2E39-7280-C7B3-5ED1A96B1489}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {8450CD95-2E39-7280-C7B3-5ED1A96B1489}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {8450CD95-2E39-7280-C7B3-5ED1A96B1489}.Release|Any CPU.Build.0 = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | GlobalSection(MonoDevelopProperties) = preSolution 27 | StartupItem = Assembly-CSharp.csproj 28 | Policies = $0 29 | $0.TextStylePolicy = $1 30 | $1.inheritsSet = null 31 | $1.scope = text/x-csharp 32 | $0.CSharpFormattingPolicy = $2 33 | $2.inheritsSet = Mono 34 | $2.inheritsScope = text/x-csharp 35 | $2.scope = text/x-csharp 36 | $0.TextStylePolicy = $3 37 | $3.FileWidth = 120 38 | $3.TabWidth = 4 39 | $3.EolMarker = Unix 40 | $3.inheritsSet = Mono 41 | $3.inheritsScope = text/plain 42 | $3.scope = text/plain 43 | EndGlobalSection 44 | 45 | EndGlobal 46 | -------------------------------------------------------------------------------- /Unity4/Unity4.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual Studio 2008 3 | 4 | Project("{04226888-D485-9849-11B2-3362DA1952E2}") = "Unity4", "Assembly-CSharp.csproj", "{7A70A05E-C436-8E06-4266-05DBE96BDCFB}" 5 | EndProject 6 | Project("{04226888-D485-9849-11B2-3362DA1952E2}") = "Unity4", "Assembly-CSharp-Editor.csproj", "{8450CD95-2E39-7280-C7B3-5ED1A96B1489}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {7A70A05E-C436-8E06-4266-05DBE96BDCFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {7A70A05E-C436-8E06-4266-05DBE96BDCFB}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {7A70A05E-C436-8E06-4266-05DBE96BDCFB}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {7A70A05E-C436-8E06-4266-05DBE96BDCFB}.Release|Any CPU.Build.0 = Release|Any CPU 18 | {8450CD95-2E39-7280-C7B3-5ED1A96B1489}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {8450CD95-2E39-7280-C7B3-5ED1A96B1489}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {8450CD95-2E39-7280-C7B3-5ED1A96B1489}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {8450CD95-2E39-7280-C7B3-5ED1A96B1489}.Release|Any CPU.Build.0 = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | GlobalSection(MonoDevelopProperties) = preSolution 27 | StartupItem = Assembly-CSharp.csproj 28 | Policies = $0 29 | $0.TextStylePolicy = $1 30 | $1.inheritsSet = null 31 | $1.scope = text/x-csharp 32 | $0.CSharpFormattingPolicy = $2 33 | $2.inheritsSet = Mono 34 | $2.inheritsScope = text/x-csharp 35 | $2.scope = text/x-csharp 36 | $0.TextStylePolicy = $3 37 | $3.FileWidth = 120 38 | $3.TabWidth = 4 39 | $3.EolMarker = Unix 40 | $3.inheritsSet = Mono 41 | $3.inheritsScope = text/plain 42 | $3.scope = text/plain 43 | EndGlobalSection 44 | EndGlobal 45 | --------------------------------------------------------------------------------