THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 14/08/2003 at 15:04, xxxxxxxx wrote:
Cinema 4D Version: 8.100
Platform: Windows ;
Language(s) : C++ ;
I have a VP plugin and have a instant preview directly in the rendersettings dialog. The preview is created by internally rendering another document that executes the VP plugin itself. Ok, that works and the preview is updated (so the other scene is rendered and shown in the Bitmapbutton) whenever a user changes a value in the plugin (means any gui element changes like clicking a button etc.). But the preview is also calculated when the user switches between the quicktabs even if I oppress the automatic update.
David already gave me the tipp to cache the rendered bitmap and return it when the dirty variable is not incremented.
Ok, but I cannot make it work. No matter how I try to allocate another bitmap and no matter where, it either does not work as expected (shows black because of freeing the bitmap which needs to be done) or Cinema 4D crashes (when I for example do not free it properly). I tried so many ways and am sitting in front of this for 2 days now, I´m kinda...down :=
So the question is: where can I allocate and free a bitmap for caching sensibly? I only have my VP plugin class. Thanks for any info/ideas.
On 14/08/2003 at 15:07, xxxxxxxx wrote:
ah and here is the code in my message function:
if (type == MSG_DESCRIPTION_GETBITMAP)
DescriptionGetBitmap* dgb = static_cast<DescriptionGetBitmap*>(data);
if (dgb->id == QCFX_PREVIEW)
/*if(cachefilled) //if picture rendered and dirty variable == 0
RenderPreview rp; //Render Thread
rp.dgb = dgb;
rp.vdata = vdata;
rp.current = (BaseDocument* )node->GetDocument()->GetClone(0,NULL);
rp.update = b_dirty;
On 15/08/2003 at 10:02, xxxxxxxx wrote:
What is it that your plugin is supposed to do exactly?
On 15/08/2003 at 12:11, xxxxxxxx wrote:
Do you still need to know this samir? in Message this is the code I have (cut down) :
DescriptionGetBitmap *rbs=(DescriptionGetBitmap* )data;
BaseList2D *bl=(BaseList2D* )node;
if (doc) doc=(BaseDocument* )doc->GetClone(NULL,NULL);
then you change the dirty in SetDParameter(). You basically give C4D a clone of your BaseBitmap always keeping the original for your plugin.
On 15/08/2003 at 14:05, xxxxxxxx wrote:
thanks. I really couldn´t make it but this code looks more logical than mine though
On 15/08/2003 at 16:08, xxxxxxxx wrote:
But wait, where are you allocating (and freeing) the bitmap (pPreviewMap)? That´s actually my problem
On 16/08/2003 at 11:39, xxxxxxxx wrote:
tzz, forget about it. you are cloning it...man I´m glad I have two weeks of vacation now