How Vray translator for maya works?

Hi all,

we’d like to develop a special material for our project ( maya+vray ). After reading the SDK, we decided to use the material plugin. The question is we got nothing in final image, here is how we did the work:

1. Compile a maya material plugin like the Blinn project in samples.
2. Compile a vray material plugin (material, not BRDF)
3. Add description in desc.txt
4. Set all environnement variables for desc.txt and plugin PATH.

we still got nothing, the we said maybe the maya scene has not been properly translated to vray. We exported a material.vrscene to see if our plugin maya is translated as we hoped, in fact, NO! we got :

BRDFLayered VRayMyDiffuse@brdflayered {
  brdfs=List(
  );
  transparency=Color(0, 0, 0);
  channels=List(
  );
}

MtlSingleBRDF VRayMyDiffuse@material {
  brdf=VRayMyDiffuse@brdflayered;
}

Since this question stopped us from a week ago, now we really need some help to figure out how the translator works!

HELP PLEASE!

Any help will be appreciated

in fact, we just need to write a single “Shader”( like a shader in renderman, or a fragement shader in GLSL) in vray, and we thought that the Class Material may be a good option to do that, what do you think about that? any advice please?

Works fine for me over here, so perhaps something went wrong along the way. Is your .DLL/.so/.dylib plugin loaded at all in Maya?

Best regards,
Vlado

Thanks god, you replied me!

Before, we tried compiling vray plugin in XCode4, apparently the .so has not been loaded, cuz we got an error message from the maya terminal. However when we compiled with .mak, no error messages, so we assumed that the vray plugin is loaded.
May be the plugins is not properly coded?

we copy the vray_mtldiffuse.cpp in samples and instead of doing

SIMPLE_PLUGIN_LIBRARY(MtlDiffuse_PluginID, EXT_MATERIAL, "MtlDiffuse", "Diffuse Material plugin for VRay", MtlDiffuse, MtlDiffuseParams);

we did

 PLUGIN_DESC(VRayMyDiffuse_PluginID, EXT_MATERIAL, "VRayMyDiffuse", VRayMyDiffuse, VRayMyDiffuseParams);
PLUGIN_LIBRARY("VRayMyDiffuse", "My Diffuse Material plugin for VRay");

the rest of codes is kept exactly the same as vray_mtldiffuse.cpp.

Could that be sufficient to define a Vray-plugin? Is there something missing?

Thank you very much!!

Did you change the VRayMyDiffuse_PluginID number? Also, on Mac OS X you can check if a particular .so file is loaded with the following command (but I’m sure you know this):lsof -p [i]maya_pid[/i] | grep [i]so_file_name[/i]where maya_pid is the Maya process identifier, which you can get with the command ps ax and so_file_name is the name of the .so file for your plugin.

Best regards,
Vlado

yes, we did change the plugin’s ID, and “lsof” told us the .so is loaded… it doesnt work. We’d like to know if there is a way to check if the desc.txt worked?

Here is what we added in Content/vray/shaders/desc.txt


 VRayMyDiffuse  VRayMyDiffuse{
  "plgDiffuse"        	texture		"diffuse"		texture 	INPUT
  "plgDiffuse_tex_mult" 	number		"diffuse_tex_mult"	number 	INPUT
  "plgReflection" 		texture 	"reflection" 		texture INPUT
  "plgTransparency" 	texture 	"transparency"		texture INPUT	
  ""                         texture "outColor"       texture OUTPUT

}

Thank you very much

Best regards

One thing that I see is that you need a space between “VRayMyDiffuse” and the following “{”

Best regards,
Vlado

OH MY GODDDD! That’s it…LOOOL MAYA still crashed after that(that’s our problem), but the maya scene is correctly translated !!! thank you VERY MUCH!!! probably we will come back to you for other questions in material plugin’s development, but you just opened a door for us… thank you again.

Best Regards

kraken

Very well then. We need to make our shader description file parser a bit more robust so that it can handle such cases…

Best regards,
Vlado