public static void SelectAnimationClip(AnimationClip clip) { if (AnimationWindow == null || clip == null) { return; } AnimationClip[] animationClips = AnimationUtility.GetAnimationClips(Selection.activeGameObject); int index = 0; while (index < animationClips.Length) { if (animationClips[index] == clip) { break; } index++; } if (index == animationClips.Length) { Debug.LogError("Couldn't find clip " + clip.name); } else { ActiveAnimationClipProperty.SetValue(GetState(), clip, null); } AnimationWindow.Repaint(); }
public static void ControllerChanged() { foreach (AnimationWindow current in AnimationWindow.GetAllAnimationWindows()) { current.OnControllerChange(); } }
public static TimelineWindowTimeControl CreateTimeController(TimelineWindow.TimelineState state, TimelineWindowTimeControl.ClipData clipData) { AnimationWindow window = EditorWindow.GetWindow <AnimationWindow>(); TimelineWindowTimeControl timelineWindowTimeControl = ScriptableObject.CreateInstance <TimelineWindowTimeControl>(); timelineWindowTimeControl.Init(state.GetWindow(), window.get_state(), clipData); return(timelineWindowTimeControl); }
public static void SetCurrentFrame(int frame, float time) { if (AnimationWindow == null) { return; } CurrentTimeField.SetValue(GetState(), time); AnimationWindow.Repaint(); }
public static void SetAnimationWindowCurrentFrame(int frame) { AnimationWindow window = EditorWindow.GetWindow <AnimationWindow>(); if (window) { window.get_state().set_currentFrame(frame); } }
static void StopAnimationPlaybackAndPreviewing() { var animWindows = AnimationWindow.GetAllAnimationWindows(); foreach (var animWindow in animWindows) { animWindow.state.StopPreview(); animWindow.state.StopPlayback(); } }
private void LoadWif(string path) { var animationVM = new AnimationViewModel(); WifLoader.LoadInSeparateThread(path, animationVM.CreateReceiver()); var viewer = new AnimationWindow(animationVM); viewer.Show(); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); //MainWindow window = new LuckyDraw.MainWindow(); //window.Show(); AnimationWindow winodw = new AnimationWindow(); winodw.Show(); }
internal static void AddNewCurve(AddCurvesPopupPropertyNode node) { if (!AnimationWindow.EnsureAllHaveClips()) { return; } AnimationWindowUtility.CreateDefaultCurves(AddCurvesPopup.s_State, node.curveBindings); TreeViewItem treeViewItem = (!(node.parent.displayName == "GameObject")) ? node.parent.parent : node.parent; AddCurvesPopup.s_State.m_hierarchyState.selectedIDs.Clear(); AddCurvesPopup.s_State.m_hierarchyState.selectedIDs.Add(treeViewItem.id); AddCurvesPopup.s_State.m_HierarchyData.SetExpanded(treeViewItem, true); AddCurvesPopup.s_State.m_HierarchyData.SetExpanded(node.parent.id, true); AddCurvesPopup.s_State.m_CurveEditorIsDirty = true; }
public static int GetAnimationWindowCurrentFrame() { AnimationWindow window = EditorWindow.GetWindow <AnimationWindow>(); int result; if (window) { result = window.get_state().get_currentFrame(); } else { result = -1; } return(result); }
private void InitializeUI() { _guiManager = new GuiManager(GraphicsContext.WindowSize); _guiRenderer = new GuiRenderer(GraphicsContext, new Faceless()); _guiLoader = new XmlLoader(_guiManager); UVMapper.Register(_guiLoader); MatImage.Register(_guiLoader); ModelPartWindow = new ModelPartWindow(_guiLoader.Load("modelEditorSelectedModelPart.xml", _guiManager.Desktop), _editor); ModelPartFaceWindow = new ModelPartFaceWindow(_guiLoader.Load("modelEditorSelectedModelPartFace.xml", _guiManager.Desktop), _editor); ButtonPanelWindow = new ButtonPanelWindow(_guiLoader.Load("epicEditButtons.xml", _guiManager.Desktop), _editor); MaterialsWindow = new MaterialsWindow(_guiLoader.Load("materialsWindow.xml", _guiManager.Desktop), _editor); AnchorWindow = new AnchorWindow(_guiLoader.Load("modelEditorSelectedAnchor.xml", _guiManager.Desktop), _editor); AnimationWindow = new AnimationWindow(_guiLoader.Load("animationWindow.xml", _guiManager.Desktop), _editor); _editor.EditMode = EditMode.Geometry; _guiManager.Desktop.Transparent = true; StaticTaskQueue.TaskQueue.CreateRepeatingTask("UpdateUI", _guiManager.Update, 20); }
private void OnRenderScript() { if (HasFilename() && Configuration.AUTO_SAVE) { Save(); } var animationVM = new AnimationViewModel(); var raytracer = new Renderer(); var receiver = animationVM.CreateReceiver(); try { raytracer.Render(this.Source.Text, receiver); var viewer = new AnimationWindow(animationVM); viewer.Show(); } catch (Exception e) { MessageBox.Show(e.Message); } }
public static void EditAnimationClipWithTimeController(AnimationClip animationClip, TimelineWindowTimeControl timeController, Object sourceObject) { AnimationWindow window = EditorWindow.GetWindow <AnimationWindow>(); window.EditSequencerClip(animationClip, sourceObject, timeController); }