On 10/12/2014 at 08:56, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R15
Platform: Windows ;
Language(s) : C++ ;
---------
I have a material with a Filter in the Luminance channel.
With a dialog I can change the settings of the Filter in the material.
Settings like Hue and Lightness.
So in a command plugin with a dialog in Command:
Bool MainDialog::Command(Int32 id, const BaseContainer& msg)
//Get dialoginput
GetFloat(ID_FILTER_HUE, C4DomeLS.filterHue);
....
// set Filter values in mat (given material)
// including
// mat->Message(MSG_UPDATE);
// mat->Update(true, true);
// EventAdd(EVENT_FORCEREDRAW);
SetLayerShaderInfo(mat, &C4DomeLS);
// get mat preview and display it in the dialog
BaseBitmap* bmp = mat->GetPreview(0);
foldFilter->SetImage(bmp, true, false);
// for test reasons, show bmp also in preview
ShowBitmap(bmp);
What I see is that the material is updated ok and shown correct in the material manager, but not in the dialog. Also the ShowBitmap is not correct. I have to give the same dialog command again to show the correct result. The second timeis ok.
It looks as doing the mat update and getting the preview in one command function is not possible (not synchronized / updated).
Am I missing something here?
-Pim