改造 Linux 版 Maya 的 File Browser

因為工作的關係,我們一直以來都是使用 Linux 版的 Maya,導致曾經一度有錯覺,覺得 Linux 的東西就是比較好,即便是商業軟體 Maya,也是 Linux 版的比其它平台的版本來得優。事後證明這是種一相情願的想法,MS Windows 雖然在安全性與 GUI 的設計上進展緩慢,但它對 programmer 非常的友善,加上商業化的行為比較健全,所以多的是軟體公司或個人程式設計師在上頭寫了不少好的軟體,…說了這麼多,只是想說,MS Windows 版的 Maya 在 GUI 方面,的確有不錯的地方。 ...

March 12, 2009 · 2 分鐘 · Drake Guan

偷天鋼索人

偷天鋼索人(Man on Wire) 偷得浮生半日閒的一個下午,我們躲在台北街頭一個小小的房間。客廳正放映著安吉莉娜裘莉與約翰馬可維奇主演的陌生的孩子; 另一個房間正放映著不知名的片子。是的,其實我們只是這一個禮拜來,有點累了,外加外頭下了點毛毛細雨而不想出門,於是買了午餐就匆匆回家抓部電影看而已。 ...

March 9, 2009 · 2 分鐘 · Drake Guan

Drake Loves to Play Warcraft III

Actually, I have been playing Dota AllStars from 2004 …

March 7, 2009 · 1 分鐘 · Drake Guan

How to clean up "Render Stats" of all geometry in Maya?

No matter what renderer you are going to use, you should take care of geometry’s “Render Stats” before rendering, especially when you are planning to decompose a rendering job into several layers/passes. Here is a quick python scripts based on pymel to do that. from pymel import * def dgVerifyRenderStats(surfaces=None): ''' dgVerifyRenderStats deps: none verify and adjust all surface's render stats. double sided, opposite, smooth shading, motion blur visible in reflections/refractions, casts/receive shadows primary visibility ''' def _verifier(surface): surface.doubleSided.set(0) surface.opposite.set(0) surface.smoothShading.set(1) surface.motionBlur.set(1) surface.visibleInReflections.set(1) surface.visibleInRefractions.set(1) surface.castsShadows.set(1) surface.receiveShadows.set(1) surface.primaryVisibility.set(1) # save the selection selections = ls(selection=True) if surfaces is None: surfaces = ls(long=True, type='surfaceShape') map(_verifier, surfaces) # restore the selection select(selections, r=True)

March 5, 2009 · 1 分鐘 · Drake Guan

How to make Maya output all messages into console/terminal?

Recently, Timothy and I were talking about some interesting about message in Maya. For daily tasks in Digimax, Timothy has to handle a mass of Maya scene files in batch way such that he can make it on schedule. But there are so many tasks and Maya scene files! He has spent some time preparing several scripts (Mel or Python, but most of them are Python) for that task. It seems work well but sometimes, he needs to get output messages from Maya for debugging and other scripts. For example, one Python script when invoked inside Maya would output a list of filtered and managed nodes in one Maya scene and after that, we can apply some other programs/scripts on nodes by this message. ...

February 28, 2009 · 4 分鐘 · Drake Guan

Syntax Highlighting for RenderMan by Javascript

使用 RenderMan 的資訊人,比例相對來得少,我們很容易可以遇到一位使用 Java, C/C++, C#, PHP, Javascript, Perl, PHP 的程式人員,因應他們的需求而產生的 editor 也多如牛毛,幾乎可以說每一個月就有一個玩意兒被提出來供這些廣大的程式設計人員使用與把玩。 ...

February 28, 2009 · 2 分鐘 · Drake Guan

如何讓 Maya 裏的所有 message 都丟到 console 外頭?

前天 Timothy 和我聊到一個非常有趣的事。 他因為工作需要,常常要批次(batch)處理一大堆的 Maya scene files,透過一些他自行寫的 scripts 來執行一些例行性的工作。然後他需要把 Maya 產生的任何 message 都以某種型式丟出來,方便他 debug 或是分析。我們兩個人在想,有哪些方法可以做到?(從這點可以看出來,Timothy 是一位非常稱職的 RD/TD,會汲汲於想一些方法來做 mass production,而不是手動一個一個處理。因為即使你手動做得再快,只要量一大,還是有一定的速度上限~) 我們最後釐清了需求: Maya 會由 terminal/console 下執行,所有的 message 要能正常輸出,而不是只留在 Maya Script Editor 裏頭。 message 包括:Maya 本身產生的;Mel 的 print;Python 的 print。 解法: 要讓 Python 的 print 得以輸出到 terminal,只要把 sys.stdout 由原來的 Maya Output object 換成 sys.stdout 即可。 要讓 Mel 的 print 與 Maya 原生的 message 輸出到 terminal 的話,需要利用到 Maya API 裏頭 CommandMessage 所提供的 CommandOutputCallback。向 Maya 註冊一個 callback 後,每當有任何一個 command 的 output 時,這個 callback 就會被呼叫,然後我們可以來決定怎麼處理這個 output message。 For Python’s print: ...

February 24, 2009 · 2 分鐘 · Drake Guan

Maya 的 Splash Window

有天(2007/10)突然心血來潮,想說認識了 7 年有餘的 Maya(從大五寫遊戲開始,至進入太極影音工作),還真不曉得它的歷史,要了解一個軟體的歷史得花不少時間,但如果只是抓抓圖的話,可就比較快了。那就來收集一下 Maya 歷年版本的 Splash Window 好了。不過目前還缺不少版本中… 如果有人有其它版本的 splash window,還請通知一下 :) ...

February 22, 2009 · 3 分鐘 · Drake Guan