Re: import flame tracker to XSI?

Date : Mon, 17 Oct 2005 17:29:09 +0200
To : XSI(at)Softimage.COM
From : Guy Rabiller <guy(at)alamaison.fr>
Subject : Re: import flame tracker to XSI?

Hi Stefan,

its pretty easy to parse such file. The first field, before the column is the frame number, second field before the coma is the X value, then after the coma the Y value.

Use this kind of script ( its a ugly vbscript but it works ):

    ' ---[ Parse File ]-------------------------------------------------------
    LogMessage CNS_NAME & " >>> Parsing File.."
    Dim aXKeys,aYKeys
    Set oFSO  = CreateObject("Scripting.FileSystemObject")
    Set oFile = oFSO.GetFile( "YourFileName" )
    Set oTS   = oFile.OpenAsTextStream( 1, 0 )
    nbKeys = 1
    Redim aXKeys(0)
    Redim aYKeys(0)
    Do While oTS.AtEndOfStream <> True
        Redim Preserve aXKeys(nbKeys)
        Redim Preserve aYKeys(nbKeys)
        strLine = oTS.ReadLine
        iPos1 = InStr(strLine,":")
        iFrameNumber = Left(strLine,iPos1-1)
        iPos2 = InStr(strLine,",")
        fXKey = Mid(strLine,iPos1+1,iPos2-1-iPos1)
        fYKey = Mid(strLine,iPos2+1)
        LogMessage strLine &" ( k:"& CInt(iFrameNumber) &" x:"& CDbl(fXKey) &" y:"& CDbl(fYKey) &")"
        '
        aXKeys(nbKeys-1) = CInt(iFrameNumber)
        aXKeys(nbKeys)   = (-1)*CDbl(fXKey)
        '
        aYKeys(nbKeys-1) = CInt(iFrameNumber)
        aYKeys(nbKeys)   = (-1)*CDbl(fYKey)
        '
        nbKeys = nbKeys + 2
    Loop
    oTS.Close()

The (-1)* has to be set or not depending of if you want to compensate or not the tracker.

Then you can set keyframes with the arrays:

    ' ---[ Create FCurves ]---------------------------------------------------
    oNull.Parameters("posx").AddFCurve2 aXKeys
    oNull.Parameters("posy").AddFCurve2 aYKeys


Be aware however that if the flame artist used some offset somewhere in its tree, then the result wont match.

*Allways* ask the flame artist about any offset prior to use such files!


Hope this helps.
--
guy rabiller | 3d technical director (at) LaMaison



Stefan Andersson wrote:
Hi All,

Does anyone know if its possible to import a flame tracker into XSI? I
would like to use the X and Y data from the tracker to put that onto a
null.

regards
stefan andersson

---
Unsubscribe? Mail 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.