26 November 2006

query a directory name

How can I build a file browser dialog, to select a file that doesn't yet exist? Or to select a directory only?
  • fileBrowserDialog
  • Notes: The docs on this suck, so this is what you need to do:
  • Example:
    • First, built the file brower dialog: -mode is telling it what to do:
      • fileBrowserDialog -mode 2 -fileCommand "procName" -actionName "whatYouAreDoing";
        • -mode 0 is for reading files, so if you type in a name that dosn't exist, the browers will give an error
        • -mode 1 & 2 are pretty much the same and are for for writing to file, so you can speficy your own filename inthe browers.
        • -mode 4 is for selecting directories only.
        • -fileCommand is the name of the below proc, that the fileBrowserDialog? passes its info to.
        • -actionName is simply what is printed in the UI, telling the user what is going on
    • Next, you need to build a proc, that can take the return from the FBD, and then do something with it. It needs to be in the below format, but the proc name, and var names can change.
      • global proc procName(string $result, string $type){
        textFieldButtonGrp -e -tx $result controlName;}
    • So, the fileBrowserDialog passes its info, via the $result argument, into the "procName" proc. Then procName will update controlName with $result.

  • Another issue: By default you can't specify WHERE the dialog will open too. It appears that it bases where it opens on where Maya's current workspace is. SO, to tell it where to go, you'd need to do something like this:
    • // query Maya's current workspace:
      string $mayaWorkspace = `workspace -q -dir`;
      // set the workspace to where you want the dialog to open:
      workspace -dir $myCustomPath;
      // run the dialog code:
      fileBrowserDialog ....
      // and set the workspace back again:
      workspace -dir $mayaWorkspace
  • Annoying!
I find this article to be extremely useful, so I'll get it pasted. The original article is in here

16 November 2006

2isted Maya File Manager


Based on soBrowser by Safak Oner. Modified to suit office pipeline. Added, modified, remove, and enhance some features. Also fixing some problems regarding compatibility with windows2000 and Maya6.

The script is also a way to learn MEL. I now realize MEL is powerful!

yet complicated... ^^

Project ini cuman buat latihan scripting. I hope one day I can create my own script :)

09 November 2006

Finally an update :)



Super sibuk belakangan.. Lebih banyak ngurusin pipeline kantor. Barusan kelar ngeset renderfarm. Well.. setelah beberapa trial dan attempt, kita decide make Muster 4.5. Sebelumnya ngetes drQueue tapi terlalu complicated dan lebih linux based, ngetes NDRserver, ini simple banget. Ga ada instalasi, dan ga ada setup network segala, dan berjalan dengan baek. Kita ga pakai karena ga ada support buat mental ray for maya. Custom string bisa dilakukan (dengan memasukkan "render -r mr ...", namun hanya berfungsi pada 1 komputer. Enfuzion keliatan terlalu rumit dan memerlukan sebuah dedicated server, maka kita batalkan. Royal render keliatan bagus, namun lebih ke linux based. RenderPal seems to be sooo good.. Tapi karena sebelumnya kita udah nginstall muster (tapi versi jadul) maka portnya clash. Akhirnya setelah ngetes beberapa candidates, we decided to enchance Muster performance.

Buat yg biasa render big size buat print, ada satu tool yg bagus dari renderpal, namanya renderpal 2004 workstation. Fungsinya bisa jadi render batch manager, jadi di maya ga usah lagi manual ngetik command .bat . Bisa juga automate imageslicing (dan support mental ray for maya). But sadly, tidak ada network render support, but hey... it's FREE :)

Hehe...wait for another exciting upcoming script. Gw enjoy banget modifying/developing script ini buat internal use di kantor doank. Walau hanya modifikasi dari script orang, setidaknya saya mengalami banyak proses belajar dalam hal scripting :)