On 04/01/2017 at 02:22, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 16+
Platform: Mac OSX ;
Language(s) : C++ ;
---------
Hi there,
I simply cannot get this to work. Please help!
I try to set the color and to exchange Texture links within an Advanced VRay material and its Advanced Bitmap Shader.
This is what I have so far (getting the link to a V-Ray Advanced Material from a Texture-Tag and trying to read out the shader loaded to the Diffuse Layer 1 -> Diffuse Color Texture slot) :
BaseTag* TexTag = MyObjekt->GetTag(Ttexture);
if (TexTag)
{
BaseMaterial* Material = ((TextureTag* )TexTag)->GetMaterial(true);
if (Material)
{
if (Material->GetType() == 5703)
{
// Material is of Type V-Ray Advanced Material
GeData Vray_data;
Material->GetParameter(DescID(4100), Vray_data, DESCFLAGS_GET_0); // VRAYMATERIAL_COLOR1_SHADER -> Texture link field in the material
BaseShader *shader = static_cast<BaseShader*>(Vray_data.GetLink(doc, 0));
}
}
}