# How Vray translator for maya works?

**URL:** <https://forums.chaos.com/t/how-vray-translator-for-maya-works/40449>\
**Category:** General\
**Created:** [February 21, 2012, 9:54am UTC](https://forums.chaos.com/t/how-vray-translator-for-maya-works/40449 "2012-02-21T09:54:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![thekraken](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@thekraken](https://forums.chaos.com/u/thekraken)\
**Post date:** [February 21, 2012, 9:54am UTC](https://forums.chaos.com/t/how-vray-translator-for-maya-works/40449/1 "2012-02-21T09:54:54Z")

</div>

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 :

```auto
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

---

<div class="post-metadata">

**Author:** ![thekraken](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@thekraken](https://forums.chaos.com/u/thekraken)\
**Post date:** [February 21, 2012, 10:04am UTC](https://forums.chaos.com/t/how-vray-translator-for-maya-works/40449/2 "2012-02-21T10:04:47Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![vlado](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vlado](https://forums.chaos.com/u/vlado)\
**Post date:** [February 21, 2012, 3:55pm UTC](https://forums.chaos.com/t/how-vray-translator-for-maya-works/40449/3 "2012-02-21T15:55:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![thekraken](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@thekraken](https://forums.chaos.com/u/thekraken)\
**Post date:** [February 21, 2012, 4:37pm UTC](https://forums.chaos.com/t/how-vray-translator-for-maya-works/40449/4 "2012-02-21T16:37:03Z")

</div>

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

```auto
 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!!

---

<div class="post-metadata">

**Author:** ![vlado](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vlado](https://forums.chaos.com/u/vlado)\
**Post date:** [February 21, 2012, 4:50pm UTC](https://forums.chaos.com/t/how-vray-translator-for-maya-works/40449/5 "2012-02-21T16:50:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![thekraken](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@thekraken](https://forums.chaos.com/u/thekraken)\
**Post date:** [February 21, 2012, 5:16pm UTC](https://forums.chaos.com/t/how-vray-translator-for-maya-works/40449/6 "2012-02-21T17:16:36Z")

</div>

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

```auto

 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

---

<div class="post-metadata">

**Author:** ![vlado](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vlado](https://forums.chaos.com/u/vlado)\
**Post date:** [February 21, 2012, 5:30pm UTC](https://forums.chaos.com/t/how-vray-translator-for-maya-works/40449/7 "2012-02-21T17:30:51Z")

</div>

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

Best regards,  
Vlado

---

<div class="post-metadata">

**Author:** ![thekraken](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@thekraken](https://forums.chaos.com/u/thekraken)\
**Post date:** [February 21, 2012, 5:44pm UTC](https://forums.chaos.com/t/how-vray-translator-for-maya-works/40449/8 "2012-02-21T17:44:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vlado](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vlado](https://forums.chaos.com/u/vlado)\
**Post date:** [February 22, 2012, 8:00am UTC](https://forums.chaos.com/t/how-vray-translator-for-maya-works/40449/9 "2012-02-22T08:00:13Z")

</div>

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
