Inverting a Sequence

(Originally posted by elporti on 8/30/2006)

Dear all,
I have 2 sequences and I want to merge the second one into the first one but in an inversed running way (to reconstruct an entire object). Can someone help me in doing so?

 

Comments

  • edited June 2013

    (Originally posted by Chris Tully on 8/30/2006)

    Here is a short macro that will reverse a sequence. From there it is a simple menu choice to append the reversed sequence to an other sequence.

    Sub ReverseSeq()
    	Dim DocId As Integer
    	Dim NewId As Integer
    	Dim nFrames As Integer
    	Dim i As Integer
    	Dim DummyPt As POINTAPI
    	Dim SeqApplyState As Integer
    
    	DocId = IpDocClick("Please click on the sequence to reverse", DummyPt)
    	If DocId < 0 Then
    		ret = IpMacroStop("You must select a sequence of at least two frames for this macro to function.", MS_MODAL)
    		Exit Sub
    	End If
    
    	ret = IpSeqGet(SEQGET_NUMFRAMES, nFrames)
    
    	If nFrames <= 1 Then
    		ret = IpMacroStop("You must select a sequence of at least two frames for this macro to function.", MS_MODAL)
    		Exit Sub
    	End If
    
    	ret = IpSeqGet(SEQGET_APPLY, SeqApplyState)
    	ret = IpSeqSet(SEQ_APPLY, 1)
    
    	ret = IpAppSelectDoc(DocId)
    	ret = IpSeqPlay(0)
    	ret = IpWsCopyFrames(0, 1)
    	NewId = IpWsCreateFromClipboard()
    
    	For i = 1 To nFrames - 1
    		ret = IpAppSelectDoc(DocId)
    		ret = IpSeqPlay(i)
    		ret = IpWsCopyFrames(i, 1)
    		ret = IpAppSelectDoc(NewId)
    		ret = IpWsPasteFrames(0)
    	Next i
    	ret = IpSeqSet(SEQ_APPLY, SeqApplyState)
    End Sub
    
    
Sign In or Register to comment.