On 04/09/2014 at 10:10, xxxxxxxx wrote:
I took a look at the Melange documentation and it doesn't look like it allows what I am looking for.
This is my code to create a Shader of type Xlayer and insert it into the Color Shader field of a newly created material.
//Create a new material "Material1"
//and insert it in the document
BaseDocument* doc = GetActiveDocument();
Material* myMat = (Material* )BaseMaterial::Alloc(Mmaterial);
myMat->SetName("Material1");
doc->InsertMaterial(myMat);
EventAdd();
//Create a BaseShader of type Xlayer and insert in the
//MATERIAL_COLOR_SHADER
BaseContainer *data = NULL;
data = myMat->GetDataInstance();
BaseShader *shader = NULL;
shader = BaseShader::Alloc(Xlayer);
data->SetLink(MATERIAL_COLOR_SHADER, shader);
myMat->InsertShader(shader, NULL);
myMat->Update(TRUE, TRUE);
From here I'm trying to add the different Shader options or Effect options to the LayerShader. This is where I run into trouble, and most of the code examples I've found are dealing with bitmap images.
Johan