2017年3月12日 星期日

[Maya]Custom shelf define

Maya custom shelf directory could be set in Maya.eng such as MAYA_SHELF_PATH=D:/Working/Maya/shelf

But note a one problem, If you as well as define  MAYA_SCRIPT_PATH ,you must take MAYA_SHELF_PATH before!

Otherwise, The definition wouldn't go correctly

Chiaxin

2017年3月5日 星期日

[Maya]Maya的路徑動態連結(Dynamic Path Link)

Maya的動態連結 Dynamic Path Link

這個名字是我自己取的 總之就是一般化(泛化)我們的工作路徑

怎麼辦到呢? 一般我們用的貼圖路徑及Reference路徑都是採絕對路徑

這個在分享彼此之間的檔案時很不方便

因為可能在我的本機我把檔案放在D:\Workspace\Project

而其他人可能把檔案放在E:\workdata\project

這樣的話檔案轉移到他那裡的時候 路徑連結就會斷掉了!

因此我們可以增加一個變數去控制上層的路徑

找到C:\users\<USERNAME>\documents\maya\<MAYA-VERSION>\Maya.env

<USERNAME>是你的電腦名稱
<MAYA-VERSION>是你的Maya 版本

用記事本將之打開 加入這一行

PROJECTWORKS=D:\Workspace\Project

之後在打包檔案的時候你只要將Texture or Reference路徑改為

$PROJECTWORKS\assets\sourceimages\texture.tga
or
$PROJECTWORKS\assets\assets.ma

對方只要在自己的Maya.env改變PROJECTWORKS就可以指定他電腦的相對路徑!

但是這個做法可能需要一些打包Package Script來幫忙我們改路徑..

Chiaxin

[MentalRay] Maya Custom Shader Install

How to intall Mental Ray Custom Shader ?

Mental Ray shaders commonly place in 

C:\Program Files\Autodesk\mentalrayForMaya2015\shaders (in Maya2015)

example : MayaShaders.dll

It is a binary data, and the mi place in include : MayaShaders.mi

so you need a pairs file : shader.dll and shader.mi

If you want to place them to custom path

example - D:\shaders\mentalray\

You must to set Maya environment to let Maya know what shader do you install

In common, Maya.env in C:\users\<Username>\documents\maya\<MayaVersion>

We just add two line

MI_CUSTOM_SHADER_PATH=D:\shaders\mentalray\include
MI_LIBRARY_PATH=D:\shaders\mentalray\lib

In here, "lib" just a classify, you also could be place in D:\shaders\mentalray

Best is create yourself AETemplates directory and icon directory

You will not get messy in many file

Try to add 

MAYA_CUSTOM_TEMPLATE_PATH=D:\custom\maya\2015-x64\AETemplates
XBMLANGPATH=D:\custom\maya\2015-x64\prefs\icons

Their are AETemplate & Icons for yours

MI_CUSTOM_SHADER_PATH & MI_LIBRARY_PATH make Maya got custom shaders

Finally, we find C:\Program Files\Autodesk\mentalrayForMaya2015\maya.rayrc

open it and add

registry "{DSO}" value "dll" end registry
registry "{_CUSTOM_SHADERS}" value "D:/shaders/mentalray" end registry
link "{_CUSTOM_SHADERS}/lib/shader.{DSO}"
mi "{_CUSTOM_SHADERS}/include/shader.mi"

Complete install, we now can be use custom shader in Maya

Following reference :

https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/Maya/files/GUID-3A452245-0676-4FFB-AAF5-72A10F77C54C-htm.html

https://knowledge.autodesk.com/support/maya/learn-explore/caas/mne-help/global/docs/maya2014/en_us/files/mrfMS-Load-shaders-htm.html