Re: Eternal flipbook

Date : Thu, 01 Sep 2005 10:32:20 -0700
To : XSI(at)Softimage.COM
From : Andy Jones <andy(at)thefront.com>
Subject : Re: Eternal flipbook
Hey,

Here's a little script that I cobbled together a while ago to make flipbooking sequences a little easier. Basically, I found that if you circumvent the browser entirely by constructing a flipbook command line, it's much faster. Of course, this means you don't get to pick all the options that normally come up in the dialog.

There's two files -- a batch file and a vbscript file. The vbscript file should work directly if you drag an image file on it (should be fine to use any one image file from a sequence). And the batch file is there so you can set up frames to open with this script by default if you want -- it appears maybe you can't open files with a vbscript file directly in Windows. You'll note the scripts are pretty hacked together, and you'll probably have to fix the paths so that they work with your particular situation. I haven't done any serious testing either, so the whole thing might just break for no good reason.

Also, if your network has slow file browsing for some reason, I'm sure this script will still be slow to start...


Anyway, in a file called "LaunchFlip.bat" put the following text and replace C:\util\ with the path to where you actually want the vbs file to be stored:


cscript C:\util\LaunchFlip.vbs %1


And in a file called "LaunchFlip.vbs", put the following:

Dim filename
Dim mkBatchCmd
Dim sequence
Dim seqStart, seqEnd
Dim baseName
Dim extension
Dim dotOnePos
Dim dotTwoPos
Dim padSize

Set objArgs = WScript.Arguments

if (WScript.Arguments.Count > 0) Then

   filename = objArgs(0)
   dotOnePos = InStrRev(filename, ".")
   dotTwoPos = InStrRev(Left(filename, dotOnePos - 1), ".")
   sequence = Left(filename, dotTwoPos)
   extension = Right(filename, Len(filename) - dotOnePos)
   folderName = Left(filename, InStrRev(filename, "\"))
   filename = Right(sequence, Len(sequence) - Len(folderName))
   Dim oShell
   Set oShell = WScript.CreateObject("WScript.Shell")
   Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")

   Set oFolder = oFSO.GetFolder(folderName)

   Set oFiles = oFolder.Files

padSize = dotOnePos - dotTwoPos - 1
dim oFile
seqStart = 1000000
seqEnd = -1000000
Dim mFilename
Dim num


'WScript.Echo filename
Dim i
i = 0
For Each oFile In oFiles
mFilename = oFile.Name
num = GetFrameNumber(mFilename, Left(filename, Len(filename) - 1))
If num <> "Error" Then
num = CInt(num)
'WScript.Echo mFilename
If seqStart > num Then
seqStart = num
End If
If seqEnd < num Then
seqEnd = num
End If
End If
Next
set oFile = oFSO.CreateTextFile("c:\TempBatch.bat", true)
oFile.WriteLine("call c:\Softimage\XSI_4.2\Application\bin\setenv.bat")
oFile.WriteLine("flip " & sequence & extension & " " & seqStart & " " & seqEnd & " -p " & BuildPad(padSize))
oFile.Close


   oShell.Run "C:\TempBatch.bat", true

End If

Function GetFrameNumber(pFilename, pBasename)
Dim mDotOne
Dim mDotTwo


mDotOne = InStrRev(pFilename, ".")
mDotTwo = InStrRev(Left(pFilename, mDotOne - 1), ".")
Dim mBasename
mBasename = Left(pFilename, mDotTwo - 1)
GetFrameNumber = "Error"
'WScript.Echo mBasename & " " & pBasename
If mBasename = pBasename Then
frameNumber = Left(pFilename, mDotOne - 1)
frameNumber = Right(frameNumber, Len(frameNumber) - InStr(frameNumber, "."))
GetFrameNumber = frameNumber
End If
End Function


Function BuildPad(size)
Dim mPad, i
mPad = "(fn)."
For i = 1 To size
mPad = mPad & "#"
Next


   mPad = mPad & "(ext)"
   BuildPad = mPad
End Function



Bruce MacDougall wrote:

We've got framecycler here (Standard 2.52 - no longer available) - hitting F5 while browsing a linux NAS over Gigabit Ethernet usually gets a refresh within 10 seconds. Lots of other reasons to recommend it as well, like quick compositing, audio support and ability to create, save and open sequence playlists. The nice thing about flipbook, however, is the price.
Bruce MacDougall
Northwest Imaging & FX


    ----- Original Message -----
    *From:* Bernard Lebel <mailto:3dbernard(at)gmail.com>
    *To:* XSI(at)Softimage.COM <mailto:XSI(at)Softimage.COM>
    *Sent:* Thursday, September 01, 2005 8:09 AM
    *Subject:* Re: Eternal flipbook

    I'm considering FrameCycler for this reason.

    Bernard


On 9/1/05, guillaume laforge <guillaume.laforge.3d(at)gmail.com <mailto:guillaume.laforge.3d(at)gmail.com>> wrote:

    >  I also noticed that Digital Fusion is faster than Flipbook to
    browse and
    > load file, so it's not only a windows pb ?

    ---
    Unsubscribe? Mail Majordomo(at)Softimage.COM
    <mailto:Majordomo(at)Softimage.COM> with the following text in body:
    unsubscribe xsi


--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.