Wednesday, September 15, 2010

Show File path and name in the Maya view

Making a shot film gave me a great lesson about many things. Especially about "Organizing."

When working "Repaired?", I had more than 30 shots for the whole sequence. Every each shot has tons of different versions and I switch those shots to the various versions every time in After Effects or Final Cut Pro.  Sometimes that could be a newest work, or it may be a shot which I worked 3 days ago.

But the thing I struggled was, I can't figure out what the current version of the shot I was watching in the sequence.

Maya default HUD doesn't support what the file name is. So I sometimes put the shot version number on the camera name like "Shot_13_v12" but it was annoying because it is not automatic. And I usually make a thousand of save files using Mel script when I work, like shot_13_0001.ma to shot_13_0130.ma, it's already 131 files for the shot #13. That means "Shot_13_v12" camera name is already in 131 files unless I didn't change it.

Now if you need to change the shot to #121 of the Shot_13_v12  in the sequence, you need to figure out what the current version is in the sequence first, visiting library folders in AE or FCP, which will make you frustrated if you need to deal with numbers of files at the same time.

So I asked my friend Sean that if he can help me a core command about showing file name on the view, he gave me a clue and I modified it so that it has a nice looking and can be toggled. As I use another custom HUD in the lower side of the view, I put this one to the top left.




if (`headsUpDisplay -ex "currentFIleFullName"` != 0) {
    // change the first number below if you need to change the position of this
    headsUpDisplay -rp 1 0;

}
else {
    headsUpDisplay
    // this number should be the same with upper one
    -section                1
    -block                   0
    -blockSize            "small"

    -label                    "Current File Path:"
    -labelFontSize      "small"
    -dfs                       "small"
    -command            "file -q -sn"
    -atr
    currentFIleFullName;


    global string $gHeadsUpDisplayMenu;

    menuItem
    -parent $gHeadsUpDisplayMenu
    -checkBox true
    -label "CurrentFile"
    -command "headsUpDisplay -e -vis #1 currentFIleFullName"
    -annotation "Current Filename: display current file name";

} ;

1 comment:

Pandalope said...

Woah, thanks! I know this is a super old post but it was exactly what I was looking for. I wanted the filename to be on the bottom left, opposite the other info I had on the bottom right (focal length and frame number), so I changed numbers to 5 and 1 (for some reason it kept telling me the 0 block was taken). Also, just

file -q -sn;

was giving the full path, so adding -shn gives us the short name of the file.

perfect for getting the shot name/version burned into your playblasts and can make sense of what you're looking at when you have a sequence in an edit :D


(also, PS, random to find out you're also an AnimSquad alum!)