Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    how to save multil bitmap with render?

    Scheduled Pinned Locked Moved SDK Help
    1 Posts 0 Posters 127 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

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

      On 30/07/2007 at 02:27, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      I Want to render the animal and save to bitmap from each frame?
      how can I to do ?
      this my code advance:
      void ShadeAnimRender()
      {
       
       BaseDocument* doc = GetActiveDocument();
       BaseObject* null = doc->GetActiveObject();
          if (!null) return;
       
          RenderData* rd = doc->GetFirstRenderData();
       BaseContainer rdata = rd->GetData();
        
       rdata.SetData(RDATA_FRAMESEQUENCE,2);
       //// change 1 and 3 values to
       //// 0 for manual
       //// 1 for current frame
       //// 2 for all frames
       //// 3 preview range
       rdata.SetData(RDATA_SAVEIMAGE,1);
       ///////////////////////change 1 to
       ///////////////////////////// 0 for save off
       ///////////////////////////// 1 for save on
       rdata.SetFilename(RDATA_PATH, Filename(null->GetName()));
       LONG lngIndex = 0;
       for ( ; rd; rd->GetNext() ) //multi frame render loop for
       {
        if ( bRenderStop == TRUE )
        {//ABORT RENDER
         //BaseThread::TestBreak()
         break;
        }

      rd->SetData( rdata );
        doc->SetActiveRenderData( rd ); //delete this if console shows errors//
        EventAdd();

      BaseBitmap* bmp = BaseBitmap::Alloc();
        BaseBitmap* desbmp =  BaseBitmap::Alloc();
       
        bmp->Init(rdata.GetLong(RDATA_XRES),
          rdata.GetLong(RDATA_YRES));
       
        EventAdd(EVENT_FORCEREDRAW);

      RenderDocument(doc, rdata, NULL, NULL, bmp, TRUE , NULL);
       
        ////render to picture viewer
        //CallCommand( 12099 );
        if ( bmp )
        {
         bmp->ScaleBicubic( desbmp, 0, 0, bmp->GetBw(), bmp->GetBh(), 0, 0, 400, 400);
        }
           
              Filename strfilename( GeGetStartupPath() + "test_anim" +LongToString(lngIndex)+"jpg");
        bmp->Save( strfilename, FILTER_JPG , NULL,  SAVEBIT_32b*tchANNELS);
        BaseBitmap::Free( bmp);
        BaseBitmap::Free( desbmp );
       }

      }
       
      anyone can help with me to give me instance and modify the code?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post