Assign Xbitmap

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 26/02/2010 at 11:43, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   10 
Platform:   Windows  ;   
Language(s) :   C.O.F.F.E.E  ;

---------
Hello,
I am trying to put graphic-file into  color channel of a material. I tried to recover coffee code from c++ code. But it doesnt work.
//get first material
var mat = GetActiveDocument()->GetFirstMaterial();

//get data container  
var con = mat->GetMainData();  

//create new shader  
var shader = AllocShader(Xbitmap);  

//configure shader  
var f = new(Filename);  
f->SetFullString("c:\\	est.bmp");  
shader#BITMAPSHADER_FILENAME = f;  
shader#BITMAPSHADER_INTERPOLATION = BITMAPSHADER_INTERPOLATION_NONE;  
shader->Message(MSG_UPDATE);  

//add shader to container  
println(con->SetData(MATERIAL_COLOR_SHADER, shader), true);  
//return container to material  
mat->SetMainData(con);  

//update material  
mat->Message(MSG_UPDATE);  
mat->Update();  

//super update  
EventAdd();  

I am glad to every hint I may get

Greetings

Jimbo

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 27/02/2010 at 02:52, xxxxxxxx wrote:

I think I found the answer myself
" Note: At the moment there's no way to insert an allocated shader into a material with C.O.F.F.E.E.."
See BaseShader at C.O.F.F.E.E. SDK R9.1