THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/04/2008 at 06:00, xxxxxxxx wrote:
Cinema 4D Version: 10.5
Platform: Mac OSX ;
Language(s) : C.O.F.F.E.E ;
Coming from 3ds Max+Vray, I used a gamma converter script for LWF and I would like to build a similar script for converting Vray materials in C4d to the LWF gamma of 0.55/0.454 by using a filter in the texture diffuse slot. Because I am still new to programming I would like to know how to call shaders in the texture map. Calling vectors and int's goes well in this first script to call the functions, but in the texturemap it goes wrong. I cannot use the GetChannel, this returns a Nill.
Can I insert a XslaFilter in the Texturemap and copy the current texture into that shader with C.O.F.F.E.E.? Or must I plunge into C++?
This is my current code:
I found the namings in the plugin description folders in the vray plugin folder.
As you can see below I can call vray colors/sliders and states, but when I try the same script on the texturemap it fails. So if someone can help further to insert a shader in the texture map, please let me know!
\> //Get the first material in the manager
\> var diffcolor1 = doc->GetFirstMaterial();
\> //Cycle through all materials
\> //Get all data from the selected material
\> var diffcolor1Bc = diffcolor1->GetContainer();
\> //Check the current state of the channel diffuse color 1
\> var currchannel=diffcolor1Bc->GetData(VRAYMATERIAL_USE_COLOR);
\> //Show in the console
\> //Set the state of this channel ON
\> //Set the texture of this channel to 50% gray
\> //Set the texture of this channel to 100% Transparent
\> //Set the texture of this channel to Filter (DOES NOT WORK YET, MUST I SET A UNIQUE CONTAINER?)
\> //Put the new data back into the origional data
\> //UPDATE THUMBNAIL
\> //Get Next Material
On 10/04/2008 at 08:49, xxxxxxxx wrote:
It's currently not possible in COFFEE to insert shaders into materials. It is possible with the C++ plugin API. You have to set the link of the shader and insert it into the material.
some sample in this thread
copy shader tree
On 10/04/2008 at 14:15, xxxxxxxx wrote:
Thanks for the quick reply,
Because I am totally new in C++, how can I test my scripts the fastest? Can I write C++ in C4d in the C.O.F.F.E.E. script editor or must I use an external scripter and open it in C4d through adding it in the plugin folder?
I tried to copy/paste some samples in the script editor, but I probably must paste it in a framework. Only I would like to write the functions first before setting up a menuplugin. Is that possible?