Show render progress



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

    On 30/01/2009 at 10:19, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   10.5/11 
    Platform:   Windows  ;   Mac OSX  ; 
    Language(s) :     C++  ;

    ---------
    Hello All,
    in my plugin have a command to render in picture viewer a specific status of my scene, and all works fine with renderdocument.
    the only problem is i can't update the render progression in picture viewer.
    i can see only final resoult.
    any idea ?
    Franz



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

    On 02/02/2009 at 12:13, xxxxxxxx wrote:

    any help :(
    sorry for insistence :)
    Franz



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

    On 02/02/2009 at 16:43, xxxxxxxx wrote:

    By coincidence, I just saw something, maybe it's a start for your research...

    I just had a look at struct RenderNotificationData (you get this e.g. from the data of message MSG_MULTI_RENDERNOTIFICATION), and there I saw a pointer to class Render which has a function void UpdateScreen(void).

    I don't know if you have access to the Render class anywhere in your plugin, but it may be worth a try ;-)

    Cheers,
    Jack



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

    On 02/02/2009 at 23:08, xxxxxxxx wrote:

    Thanks Jack,
    i'll try immediatly.
     
    all the best
    Franz



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

    On 03/02/2009 at 04:36, xxxxxxxx wrote:

    ok dont find way,
    here my code:

        
        
        
        
        struct MyPrivateData
        
        
        
        
        {
        
        
        
        
        BaseBitmap* bmp;
        
        
        
        
        };
        
        
        
        
        void TakeProgressFunction (Real p, void* private_data)
        
        
        
        
        { 
        
        
        
        
        StatusSetBar(p);
        
        
        
        
        GePrint (RealToString(p));
        
        
        
        
        MyPrivateData *pd = static_cast<MyPrivateData*>(private_data);
        
        
        
        
        ShowBitmap(pd->bmp);
        
        
        
        
        }
        
        
        
        
        class TakeRenderThread : public Thread
        
        
        
        
        {
        
        
        
        
        private:
        
        
        
        
        BaseDocument *m_doc;
        
        
        
        
        BaseBitmap *m_bmp;
        
        
        
        
        BaseContainer m_rc;
        
        
        
        
        
        
        
        
        
        
        public:
        
        
        
        
        TakeRenderThread(BaseDocument *doc, BaseBitmap *bmp, BaseContainer rc ) { m_doc = doc; m_bmp = bmp; m_rc = rc; }
        
        
        
        
        virtual ~TakeRenderThread() { m_doc = NULL; m_bmp = NULL; End(); Wait(FALSE); }
        
        
        
        
        virtual void Main(void);
        
        
        
        
        virtual const CHAR *GetThreadName(void) { return "TakeRenderThread"; }
        
        
        
        
        };
        
        
        
        
         
        
        
        
        
        void TakeRenderThread::Main(void)
        
        
        
        
        {
        
        
        
        
        GePrint("Render thread");
        
        
        
        
        if(RenderDocument(m_doc, m_rc, TakeProgressFunction, NULL ,m_bmp, RENDERFLAG_EXTERNAL, this->Get()) != RAY_OK)
        
        
        
        
        GePrint("not ok");
        
        
        
        
        }
        
        
        
        
        class rendertake : public CommandData
        
        
        
        
        {
        
        
        
        
        public:
        
        
        
        
        virtual Bool Execute(BaseDocument *doc);
        
        
        
        
        };
        
        
        
        
        Bool rendertake::Execute(BaseDocument *doc)
        
        
        
        
        {
        
        
        
        
        BaseBitmap * bmp = BaseBitmap::Alloc();
        
        
        
        
        if(!bmp) return FALSE;
        
        
        
        
        BaseDocument *cdoc = (BaseDocument* )doc->GetClone(COPY_DOCUMENT, NULL);
        
        
        
        
        
        
        
        BaseContainer rc = cdoc->GetActiveRenderData()->GetData();
        
        
        
        
        bmp->Init(rc.GetLong(RDATA_XRES), rc.GetLong(RDATA_YRES), 24);
        
        
        
        
        
        
        
        
        
        
        
        
        
        TakeRenderThread rt(cdoc, bmp, rc);
        
        
        
        
        rt.Start(FALSE);
        
        
        
        
        
        
        
        
        
        
        
        
        
        BaseDocument::Free(cdoc); 
        
        
        
        
        BaseBitmap::Free(bmp);
        
        
        
        
        return TRUE;
        
        
        
        
        }
        
        
        
    

    if ound it in a old post, the ShowBitmap(pd->bmp), crash.
    any idea ?
    Franz



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

    On 07/02/2009 at 14:58, xxxxxxxx wrote:

    ok i change some code, band now in progressfunction myprivatedata is not null, but cinema crash on showbitmap :(
    Here my code, please any help ?
    struct MyPrivateData
    {
    BaseBitmap* bmp;
    };
    void TakeProgressFunction (Real p, void* private_data)
    {
    StatusSetBar(p);
    GePrint (RealToString(p));
    MyPrivateData *pd = static_cast<MyPrivateData*>(private_data);
    ShowBitmap(pd->bmp);
    }
    class TakeRenderThread : public Thread
    {
    private:
    BaseDocument *m_doc;
    BaseBitmap *m_bmp;
    BaseContainer m_rc;
    MyPrivateData m_pd;
    public:
    TakeRenderThread(BaseDocument *doc, BaseBitmap *bmp, BaseContainer rc , MyPrivateData pd ,) { m_doc = doc; m_bmp = bmp; m_rc = rc; m_pd = pd;}
    virtual ~TakeRenderThread() { m_doc = NULL; m_bmp = NULL; End(); Wait(FALSE); }
    virtual void Main(void);
    virtual const CHAR *GetThreadName(void) { return "TakeRenderThread"; }
    };
    void TakeRenderThread::Main(void)
    {
    GePrint("Render thread");
    if(RenderDocument(m_doc, m_rc, TakeProgressFunction, &m_pd ,m_bmp, RENDERFLAG_EXTERNAL, this->Get()) != RAY_OK)
    GePrint("not ok");
    }
    class rendertake : public CommandData
    {
    public:
    virtual Bool Execute(BaseDocument *doc);
    };
    Bool rendertake::Execute(BaseDocument *doc)
    {
    BaseBitmap * bmp = BaseBitmap::Alloc();
    if(!bmp) return FALSE;
    BaseDocument *cdoc = (BaseDocument* )doc->GetClone(COPY_DOCUMENT, NULL);
    BaseContainer rc = cdoc->GetActiveRenderData()->GetData();
    bmp->Init(rc.GetLong(RDATA_XRES), rc.GetLong(RDATA_YRES), 24);
    MyPrivateData pd;
    pd.bmp = bmp;
    TakeRenderThread rt(cdoc, bmp, rc, pd);
    rt.Start(FALSE);
    BaseDocument::Free(cdoc);
    return TRUE;

    }



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

    On 09/02/2009 at 14:16, xxxxxxxx wrote:

    ok, working on it ......
    i found some ligth, but i need some help please.
    ok my progress function don't crash if i set cinema to a single thread.
    this perhaps mean i should to use MpThread, i saw menutest example in sdk, but for my little experience i can't apply it on my renderdocument thread.
    Can anyone help me?
    Maxon Support ????
    best and sorry for insistence

    Franz



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

    On 09/02/2009 at 14:49, xxxxxxxx wrote:

    I am sorry, I am working on it but I have no solution yet.

    cheers,
    Matthias



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

    On 09/02/2009 at 23:25, xxxxxxxx wrote:

    hello Mathias,
    Thanks, i'll waith :)
    Franz


Log in to reply