Example #1
0
        // Render a timeline of sphere point keyframes.
        private void RenderSpherePointRowAndAdvance(ref Rect rect, SkyProfile profile, SpherePointKeyframeGroup group, ProfileGroupDefinition groupDefinition)
        {
            rect.height = SPHERE_POINT_ROW_HEIGHT;
            UpdateActiveSelectedRow(rect, group.id, groupDefinition.propertyKey);

            Rect valueRowRect;
            Rect nameRowRect;
            bool isActive;

            LoadRowInformation(ref rect, group.id, SPHERE_POINT_ROW_HEIGHT, out valueRowRect, out nameRowRect, out isActive);

            // Render debug points if this is active.
            if (isActive)
            {
                ShowSpherePointKeyframesInSkybox(group);
            }

            RenderRowTitle(nameRowRect, group.name, isActive, groupDefinition);
            SpherePointTimelineRow.RenderSpherePointRow(valueRowRect, profile, group);
        }
Example #2
0
        private bool RenderSpherePointGUI()
        {
            bool didModify = false;

            SpherePointKeyframe spherePointKeyframe = keyframe as SpherePointKeyframe;

            if (spherePointKeyframe == null)
            {
                return(false);
            }

            EditorGUILayout.BeginHorizontal();
            EditorGUI.BeginChangeCheck();
            SpherePoint selectedSpherePoint = SpherePointGUI.SpherePointField(spherePointKeyframe.spherePoint, true, keyframe.id);

            if (EditorGUI.EndChangeCheck())
            {
                spherePointKeyframe.spherePoint = selectedSpherePoint;
                didModify = true;
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            EditorGUI.BeginChangeCheck();
            GUIStyle style = GUI.skin.button;

            EditorGUILayout.PrefixLabel(
                new GUIContent("Normalize Speed",
                               "Adjust all keyframes so that there is a constant speed of animation between them."));
            GUILayout.Button(new GUIContent("Reposition All Keyframes..."), style);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(profile, "Normalize keyframe speeds");
                didModify = true;
                SpherePointTimelineRow.RepositionKeyframesForConstantSpeed(group as SpherePointKeyframeGroup);
            }
            EditorGUILayout.EndHorizontal();

            return(didModify);
        }