public void AddNewTimelineContainer(USTimelineContainer timelineContainer) { var newHierarchyItem = CreateInstance(typeof(USTimelineContainerHierarchyItem)) as USTimelineContainerHierarchyItem; USUndoManager.RegisterCreatedObjectUndo(newHierarchyItem, "Add New Timeline Container"); USUndoManager.RegisterCompleteObjectUndo(newHierarchyItem, "Add New Timeline Container"); newHierarchyItem.SetupWithTimelineContainer(timelineContainer); USUndoManager.RegisterCompleteObjectUndo(USHierarchy, "Add New Timeline Container"); USHierarchy.AddHierarchyItemToRoot(newHierarchyItem as IUSHierarchyItem); }
public void OnSequenceChange(USSequencer newSequence) { CurrentSequence = newSequence; ZoomInfo.Reset(); ScrollInfo.Reset(); totalPixelWidthOfTimeline = 1.0f; UpdateCachedMarkerInformation(); if (USHierarchy == null) { USHierarchy = CreateInstance(typeof(USHierarchy)) as USHierarchy; } foreach (var newTimelineContainer in CurrentSequence.TimelineContainers) { var newHierarchyItem = CreateInstance(typeof(USTimelineContainerHierarchyItem)) as USTimelineContainerHierarchyItem; newHierarchyItem.SetupWithTimelineContainer(newTimelineContainer); USHierarchy.AddHierarchyItemToRoot(newHierarchyItem as IUSHierarchyItem); } SequenceWindow.Repaint(); }