summaryrefslogtreecommitdiff
path: root/Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2020-08-20 23:40:50 -0400
committerAndrew Lee <alee14498@protonmail.com>2020-08-20 23:40:50 -0400
commit3af4c218c0e70167db23a6303d2af30aff37d2fe (patch)
tree927f29edcf54ab562f40f3d1c6cb69287c7f5980 /Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner
parentb6daed0af784f4e9bc13329dd87c671b06ee1c65 (diff)
downloadProject-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.tar.gz
Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.tar.bz2
Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.zip
Removed a bunch of stuff; Changes
Diffstat (limited to 'Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner')
-rw-r--r--Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner/CurvesOwnerInspectorHelper.cs109
-rw-r--r--Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner/CurvesOwnerInspectorHelper.cs.meta11
-rw-r--r--Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner/ICurvesOwnerInspectorWrapper.cs14
-rw-r--r--Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner/ICurvesOwnerInspectorWrapper.cs.meta11
4 files changed, 0 insertions, 145 deletions
diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner/CurvesOwnerInspectorHelper.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner/CurvesOwnerInspectorHelper.cs
deleted file mode 100644
index c5c4405..0000000
--- a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner/CurvesOwnerInspectorHelper.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-using System;
-using UnityEngine;
-using UnityEngine.Timeline;
-
-namespace UnityEditor.Timeline
-{
- static class CurvesOwnerInspectorHelper
- {
- // Because what is animated is not the asset, but the instanced playable,
- // we apply the animation clip here to preview what is being shown
- // This could be improved doing something more inline with animation mode,
- // and reverting values that aren't be recorded later to avoid dirtying the asset
- public static void PreparePlayableAsset(ICurvesOwnerInspectorWrapper wrapper)
- {
- if (Event.current.type != EventType.Repaint)
- return;
-
- if (wrapper.serializedPlayableAsset == null)
- return;
-
- var curvesOwner = wrapper.curvesOwner;
- if (curvesOwner == null || curvesOwner.curves == null)
- return;
-
- var timelineWindow = TimelineWindow.instance;
- if (timelineWindow == null || timelineWindow.state == null)
- return;
-
- // requires preview mode. reset the eval time so previous value is correct value is displayed while toggling
- if (!timelineWindow.state.previewMode)
- {
- wrapper.lastEvalTime = -1;
- return;
- }
-
- var time = wrapper.ToLocalTime(timelineWindow.state.editSequence.time);
-
- // detect if the time has changed, or if the curves have changed
- if (Math.Abs(wrapper.lastEvalTime - time) < TimeUtility.kTimeEpsilon)
- {
- int curveVersion = AnimationClipCurveCache.Instance.GetCurveInfo(curvesOwner.curves).version;
- if (curveVersion == wrapper.lastCurveVersion)
- return;
-
- wrapper.lastCurveVersion = curveVersion;
- }
-
- wrapper.lastEvalTime = time;
-
- var clipInfo = AnimationClipCurveCache.Instance.GetCurveInfo(curvesOwner.curves);
- int count = clipInfo.bindings.Length;
- if (count == 0)
- return;
-
- wrapper.serializedPlayableAsset.Update();
-
- var prop = wrapper.serializedPlayableAsset.GetIterator();
- while (prop.NextVisible(true))
- {
- if (curvesOwner.IsParameterAnimated(prop.propertyPath))
- {
- var curve = curvesOwner.GetAnimatedParameter(prop.propertyPath);
- switch (prop.propertyType)
- {
- case SerializedPropertyType.Boolean:
- prop.boolValue = curve.Evaluate((float)time) > 0;
- break;
- case SerializedPropertyType.Float:
- prop.floatValue = curve.Evaluate((float)time);
- break;
- case SerializedPropertyType.Integer:
- prop.intValue = Mathf.FloorToInt(curve.Evaluate((float)time));
- break;
- case SerializedPropertyType.Color:
- SetAnimatedValue(curvesOwner, prop, "r", time);
- SetAnimatedValue(curvesOwner, prop, "g", time);
- SetAnimatedValue(curvesOwner, prop, "b", time);
- SetAnimatedValue(curvesOwner, prop, "a", time);
- break;
- case SerializedPropertyType.Quaternion:
- case SerializedPropertyType.Vector4:
- SetAnimatedValue(curvesOwner, prop, "w", time);
- goto case SerializedPropertyType.Vector3;
- case SerializedPropertyType.Vector3:
- SetAnimatedValue(curvesOwner, prop, "z", time);
- goto case SerializedPropertyType.Vector2;
- case SerializedPropertyType.Vector2:
- SetAnimatedValue(curvesOwner, prop, "x", time);
- SetAnimatedValue(curvesOwner, prop, "y", time);
- break;
- }
- }
- }
-
- wrapper.serializedPlayableAsset.ApplyModifiedPropertiesWithoutUndo();
- }
-
- static void SetAnimatedValue(ICurvesOwner clip, SerializedProperty property, string path, double localTime)
- {
- var prop = property.FindPropertyRelative(path);
- if (prop != null)
- {
- var curve = clip.GetAnimatedParameter(prop.propertyPath);
- if (curve != null)
- prop.floatValue = curve.Evaluate((float)localTime);
- }
- }
- }
-}
diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner/CurvesOwnerInspectorHelper.cs.meta b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner/CurvesOwnerInspectorHelper.cs.meta
deleted file mode 100644
index 17e8bb3..0000000
--- a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner/CurvesOwnerInspectorHelper.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 9a371bcbba2084dd0a8ebc6826aa8794
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner/ICurvesOwnerInspectorWrapper.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner/ICurvesOwnerInspectorWrapper.cs
deleted file mode 100644
index 0ce6f58..0000000
--- a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner/ICurvesOwnerInspectorWrapper.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using UnityEngine.Timeline;
-
-namespace UnityEditor.Timeline
-{
- interface ICurvesOwnerInspectorWrapper
- {
- ICurvesOwner curvesOwner { get; }
- SerializedObject serializedPlayableAsset { get; }
- int lastCurveVersion { get; set; }
- double lastEvalTime { get; set; }
-
- double ToLocalTime(double time);
- }
-}
diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner/ICurvesOwnerInspectorWrapper.cs.meta b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner/ICurvesOwnerInspectorWrapper.cs.meta
deleted file mode 100644
index 746e970..0000000
--- a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/CurvesOwner/ICurvesOwnerInspectorWrapper.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 926a61ff0dec44a5aab649acb411e9ad
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant: