On 24/09/2015 at 04:03, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R17
Platform: Windows ;
Language(s) : C++ ;
---------
Hello.
Not sure if it's a bug or not but when i create a C4D material and then i try to retrieve it's specular parameters, i get wrong values.
Here is the test case:
-Create a C4D Material.
-Use only Reflectance channel (disable the rest).
-Go to Reflectance > Default Specular and set reflection color and brightness.
-Get the parameters:
TextureTag* tag = (TextureTag* )object->GetTag(Ttexture);
Material* material = (Material* )GetParameterLink(*tag,TEXTURETAG_MATERIAL,Mmaterial);
Vector s_color = < Get MATERIAL_SPECULAR_COLOR Parameter >
Real s_brightness = < Get MATERIAL_SPECULAR_BRIGHTNESS Parameter >
This is how i get the parameters (Vector Example) :
GeData ge_data;
if (object.GetParameter(DescLevel(param_id), ge_data, DESCFLAGS_GET_0))
return ge_data.GetVector();
The above code returns always 1,1,1 for color and 1 for brightness.
Now, what's strange is that if i save the project and try the above procedure again, i get the correct values (using the exact same code).
Do i do anything wrong ?
Thank you for your time.