Esempio n. 1
0
        //[MenuItem("Window/TimeFlowShiki")]
        public static ARIMotionScoreWindow ShowEditor(ARIMotionMainWindow parent)
        {
            ARIMotionScoreWindow window = EditorWindow.GetWindow <ARIMotionScoreWindow>();

            window.parent_ = parent;
            window.scores_ = parent.scores_;
            window.Show();
            return(window);
        }
Esempio n. 2
0
 public void SelectPreviousTackOfTimelines(string currentActiveObjectId)
 {
     if (ARIMotionScoreWindow.IsTackId(currentActiveObjectId))
     {
         foreach (var timelineTrack in timelineTracks_)
         {
             timelineTrack.SelectPreviousTackOf(currentActiveObjectId);
         }
     }
 }
Esempio n. 3
0
 //エディタウインドウ開く
 void OpenEditorWindow()
 {
     if (scoreWindow_ == null)
     {
         scoreWindow_ = ARIMotionScoreWindow.ShowEditor(this);
         ARIMotionScoreWindow.ParentEmit = Emit;
     }
     else
     {
         scoreWindow_.Focus();
     }
 }
Esempio n. 4
0
 public void DeleteObjectById(string deletedObjectId, bool isCancel)
 {
     foreach (var timelineTrack in timelineTracks_)
     {
         if (ARIMotionScoreWindow.IsTimelineId(deletedObjectId))
         {
             if (timelineTrack.timelineId_ == deletedObjectId)
             {
                 timelineTrack.Deleted(isCancel);
             }
         }
         if (ARIMotionScoreWindow.IsTackId(deletedObjectId))
         {
             timelineTrack.DeleteTackById(deletedObjectId, isCancel);
         }
     }
 }
Esempio n. 5
0
        public void SelectAboveObjectById(string currentActiveObjectId)
        {
            if (ARIMotionScoreWindow.IsTimelineId(currentActiveObjectId))
            {
                var candidateTimelines   = timelineTracks_.Where(timeline => timeline.IsExistTimeline_).OrderBy(timeline => timeline.GetIndex()).ToList();
                var currentTimelineIndex = candidateTimelines.FindIndex(timeline => timeline.timelineId_ == currentActiveObjectId);

                if (0 < currentTimelineIndex)
                {
                    var targetTimeline = timelineTracks_[currentTimelineIndex - 1];
                    Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, targetTimeline.timelineId_));
                    return;
                }

                return;
            }

            if (ARIMotionScoreWindow.IsTackId(currentActiveObjectId))
            {
                /*
                 *      select another timeline's same position tack.
                 */
                var currentActiveTack = TackById(currentActiveObjectId);

                var currentActiveTackStart = currentActiveTack.start_;
                var currentTimelineId      = currentActiveTack.parentTimelineId_;

                var aboveTimeline = AboveTimeline(currentTimelineId);
                if (aboveTimeline != null)
                {
                    var nextActiveTacks = aboveTimeline.TacksByStart(currentActiveTackStart);
                    if (nextActiveTacks.Any())
                    {
                        var targetTack = nextActiveTacks[0];
                        Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, targetTack.tackId_));
                    }
                    else
                    {
                        // no tack found, select timeline itself.
                        Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, aboveTimeline.timelineId_));
                    }
                }
                return;
            }
        }
Esempio n. 6
0
        public TackPoint GetTackById(string selectObjectId)
        {
            TackPoint res = null;

            foreach (var timelineTrack in timelineTracks_)
            {
                if (ARIMotionScoreWindow.IsTackId(selectObjectId))
                {
                    res = timelineTrack.GetTackById(selectObjectId);
                    //見つかったら抜けないとNULLで上書きしてしまう
                    if (res != null)
                    {
                        break;
                    }
                }
            }

            return(res);
        }
Esempio n. 7
0
        public void SelectBelowObjectById(string currentActiveObjectId)
        {
            if (ARIMotionScoreWindow.IsTimelineId(currentActiveObjectId))
            {
                var cursoredTimelineIndex = timelineTracks_.FindIndex(timeline => timeline.timelineId_ == currentActiveObjectId);
                if (cursoredTimelineIndex < timelineTracks_.Count - 1)
                {
                    var targetTimelineIndex = cursoredTimelineIndex + 1;
                    var targetTimeline      = timelineTracks_[targetTimelineIndex];
                    Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, targetTimeline.timelineId_));
                }
                return;
            }

            if (ARIMotionScoreWindow.IsTackId(currentActiveObjectId))
            {
                /*
                 *      select another timeline's same position tack.
                 */
                var currentActiveTack = TackById(currentActiveObjectId);

                var currentActiveTackStart = currentActiveTack.start_;
                var currentTimelineId      = currentActiveTack.parentTimelineId_;

                var belowTimeline = BelowTimeline(currentTimelineId);
                if (belowTimeline != null)
                {
                    var nextActiveTacks = belowTimeline.TacksByStart(currentActiveTackStart);
                    if (nextActiveTacks.Any())
                    {
                        var targetTack = nextActiveTacks[0];
                        Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, targetTack.tackId_));
                    }
                    else
                    {
                        // no tack found, select timeline itself.
                        Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, belowTimeline.timelineId_));
                    }
                }
                return;
            }
        }
Esempio n. 8
0
        public int GetStartFrameById(string objectId)
        {
            if (ARIMotionScoreWindow.IsTimelineId(objectId))
            {
                return(-1);
            }

            if (ARIMotionScoreWindow.IsTackId(objectId))
            {
                var targetContainedTimelineIndex = GetTackContainedTimelineIndex(objectId);
                if (0 <= targetContainedTimelineIndex)
                {
                    var foundStartFrame = timelineTracks_[targetContainedTimelineIndex].GetStartFrameById(objectId);
                    if (0 <= foundStartFrame)
                    {
                        return(foundStartFrame);
                    }
                }
            }

            return(-1);
        }
Esempio n. 9
0
        public void SelectNextTackOfTimelines(string currentActiveObjectId)
        {
            if (ARIMotionScoreWindow.IsTimelineId(currentActiveObjectId))
            {
                foreach (var timelineTrack in timelineTracks_)
                {
                    if (timelineTrack.timelineId_ == currentActiveObjectId)
                    {
                        timelineTrack.SelectDefaultTackOrSelectTimeline();
                    }
                }
                return;
            }

            if (ARIMotionScoreWindow.IsTackId(currentActiveObjectId))
            {
                foreach (var timelineTrack in timelineTracks_)
                {
                    timelineTrack.SelectNextTackOf(currentActiveObjectId);
                }
            }
        }