THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/11/2009 at 10:55, xxxxxxxx wrote:
Cinema 4D Version: 11
Platform: Windows ;
Language(s) : C++ ;
I was wondering how I would get the gradient that is stored in a Description Element Gradient and set the gradient in a shader to that gradient that the user created with the description element.
Currently I set the gradient in the shader myself with this code.
AutoAlloc<Gradient> colorGradient; if (!colorGradient) return FALSE; // set up color gradient GradientKnot k1,k2; k1.col =Vector(0.29,0.67,0.98); k1.pos =0.0; k2.col =Vector(0.0,0.0,0.0); k2.pos =1.0; colorGradient->InsertKnot(k1); colorGradient->InsertKnot(k2);
I would like to set k1 and k2 to the colors that are found in the description element. Better yet, I would like to copy all of the gradient info from the gradient description element to the shader gradient without having to specify the # of knots ..
Can someone please explain how I would do this?