W dniu 2013-10-23 11:01, Justin Israel pisze:
I don't have much experience trying to parse maya binary files, and cgkit doesn't give any indication really of how to handle the groups and chunks beyond it just giving them to you in the callbacks... But a quick google search turned up this mayatools python package:
https://mayatools.readthedocs.org/en/latest/binary.html

That perfect !
Here's a braindead snippet to get fileInfo as a dictionary:

def ExtractFileInfo(fPath):
    RES = {}
    f = open(fPath)
    p = Parser(f)

    Chunk = p.parse_next()
    max_cnt = 100
    fileInfoBlockFound = 0
    while( Chunk and max_cnt ):
        max_cnt -= 1
        if(fileInfoBlockFound == 1 and Chunk.tag != "FINF"):
            break

        if(Chunk.tag == "FINF"):
            fileInfoBlockFound = 1
            bits = string.split( str(Chunk.string), '\x00')
            RES[bits[0]] = string.join(bits[1:], ' ')

        Chunk = p.parse_next()

    return RES



--
You received this message because you are subscribed to the Google Groups "Python 
Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/52680E4E.8060504%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to