Without having watched the video ... If you're trying to read the contents of 
maya binary file externally, check out the mayabinary.py module in the python 
cg kit:
http://cgkit.git.sourceforge.net/git/gitweb.cgi?p=cgkit/cgkit;a=blob;f=cgkit/mayabinary.py;h=4706e64feb129924a42869ede3146a7496d68de7;hb=HEAD

You can subclass it and override the callback methods to retrieve particular 
chunks you're interested in.  You could write file metadata in a file-save 
callback using the fileInfo command, and retrieve it in the 'HEAD' group (I 
think the chunks are named 'INFO').  It can be a handy way to record character 
, environment, and other sorts of data that would otherwise require opening the 
scene.  Use the abort method after you're done reading the HEAD group so you 
don't parse the whole file.

If you're gzipping files, override the read method and use the gzip module to 
get a file-like object, then pass it into the read method of the base class.

JP

Sent from my iPhone

On Jun 7, 2012, at 1:28 PM, Justin Israel <[email protected]> wrote:

> What parts are giving you trouble specifically though? That video is really 
> long as does a lot of stuff
> 
> Here are some examples:
> 
> # number of poly faces in scene?
> faceCount = cmds.polyEvaluate(cmds.ls(g=True), face=True)
> 
> # path and file size of current scene?
> import os
> name = cmds.file(q=True, sceneName=True)
> sizeBytes = os.path.getsize(name)
> 
> 
> 
> 
> On Thu, Jun 7, 2012 at 1:07 PM, Matias Volonte <[email protected]> 
> wrote:
> Justin thanks for answering. I will definitely check what your suggestion. 
> 
> Also, I found a youtube video that shows a similiar concept to what I need. I 
> would like to have a tool that access files and retrieves data (size, face 
> amount, file path, etc) and image of the scene. I already have built the core 
> of the tool, but for some reason is hard to achieve the scene data of the 
> maya.mb's file.
> 
> Pseudo example:
> http://www.youtube.com/watch?v=B2fE0sVeT44
> 
> Thanks and any tip will help.
> -- 
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings: 
> http://groups.google.com/group/python_inside_maya/subscribe
> 
> -- 
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings: 
> http://groups.google.com/group/python_inside_maya/subscribe

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to