Even though there are still many work to be done I like to share a simple python script I wrote for converting standard Maya material to aiStandard material. This is useful when importing a fbx or obj file where the shaders are usually not imported and default to Maya's standard shader like lambert or phong.
Right now it doesn't do any fancy reconnection other than use Maya's "replaceNode" function. It does try to reconnect transparency and alpha to opacity and transparency channel of aiStandard if you have that connected previously.
There is no UI so please use python command line or script editor.
Here is the content of README:
Summary
Replace Maya Standard material with MtoA aiStandard material
URL: http://dennispython.blogspot.tw/
----
Install
Extract content into a where Maya can source the script files, i.e., Maya's script path.
You can save the run script into Shelf as well.
----
Usage
--
the convert() function
--
First import the package.
Select the shaders you intented to convert in Hypershade.
Run the convert function.
For example:
import mayaMat_to_aiStandard as mMat2Ai
mMat2Ai.convert()
--
the trimTexPath() function
--
This utility function will trim the absolte path of the texture file in the selected texture node into relative path. It will only keep the last folder one level up from the texture file.(e.g., sourceiamges/texture_file.tif)
Import package.
Select the texture read node in Hypershade.
run the trimTexPath function.
For example:
import mayaMat_to_aiStandard as mMat2Ai
mMat2Ai.trimTexPath()
before trim: /home/user/tex/some_folder/sourceimages/texture_file.tif
after trim: sourceimages/texture_file.tif
--
batch_aiSubdiv function
--
batch change arnold subdiv type.
import mayaMat_to_aiStandard as mMat2Ai
mMat2Ai.batch("catclark")
list of arguments: "catclark", "linear", "none"
Right now it doesn't do any fancy reconnection other than use Maya's "replaceNode" function. It does try to reconnect transparency and alpha to opacity and transparency channel of aiStandard if you have that connected previously.
There is no UI so please use python command line or script editor.
Here is the content of README:
Summary
Replace Maya Standard material with MtoA aiStandard material
URL: http://dennispython.blogspot.tw/
----
Install
Extract content into a where Maya can source the script files, i.e., Maya's script path.
You can save the run script into Shelf as well.
----
Usage
--
the convert() function
--
First import the package.
Select the shaders you intented to convert in Hypershade.
Run the convert function.
For example:
import mayaMat_to_aiStandard as mMat2Ai
mMat2Ai.convert()
--
the trimTexPath() function
--
This utility function will trim the absolte path of the texture file in the selected texture node into relative path. It will only keep the last folder one level up from the texture file.(e.g., sourceiamges/texture_file.tif)
Import package.
Select the texture read node in Hypershade.
run the trimTexPath function.
For example:
import mayaMat_to_aiStandard as mMat2Ai
mMat2Ai.trimTexPath()
before trim: /home/user/tex/some_folder/sourceimages/texture_file.tif
after trim: sourceimages/texture_file.tif
--
batch_aiSubdiv function
--
batch change arnold subdiv type.
import mayaMat_to_aiStandard as mMat2Ai
mMat2Ai.batch("catclark")
list of arguments: "catclark", "linear", "none"
沒有留言:
張貼留言