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

    Camera matrix during animation

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 305 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 26/08/2012 at 11:53, xxxxxxxx wrote:

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

      ---------
      Hi,

      I'm trying to get the inverse camera matrix of the render basedraw for an animation export. I step through the animation keys of the active camera object:

        
      doc->SetTime(bt); // Set Time to key->GetTime();   
      doc->ExecutePasses(NULL, TRUE, TRUE, TRUE, BUILDFLAGS_0);        
      EventAdd(); // don't know whether that's required in this case   
      BaseDraw *bd = doc->GetRenderBaseDraw();   
      Matrix m = bd->GetMi();   
      ...   
      

      The matrix won't change during animation. It keeps the values from the first frame! Do I have to send another kind of update message?

      If I use the inverted global matrix of the camera object, it works, but I would prefer to use the matrix from the render basedraw.

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

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

        On 01/09/2012 at 13:29, xxxxxxxx wrote:

        I dunno if this will help or not, but after the EventAdd(), add this:

          
          DrawViews(DRAWFLAGS_FORCEFULLREDRAW | DRAWFLAGS_NO_THREAD, NULL);    // force completion of cache rebuild  
        

        ...I use that sequence of calls when I'm dealing with animating the document.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

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

          On 01/09/2012 at 13:32, xxxxxxxx wrote:

          ...more specifically, I have a 'version compatibility' routine that I call...

            
          //-------------------------------------------------------------  
          // cmpAnimateDocument()  
          //-------------------------------------------------------------  
          void cmpAnimateDocument(BaseDocument *pDoc, const BaseTime& frameTime)  
          {  
          //    StopAllThreads();  
            pDoc->SetTime(frameTime);  
            
          #ifdef _R12_SDK_  
            pDoc->ExecutePasses(NULL, TRUE, TRUE, TRUE, BUILDFLAGS_0);  
          #elif _R11p5_SDK_  
            pDoc->ExecutePasses(NULL, TRUE, TRUE, TRUE);  
          #else  
            pDoc->AnimateDocument(NULL, TRUE, TRUE);  
          #endif  
            EventAdd();  
          #ifdef _R12_SDK_  
            DrawViews(DRAWFLAGS_FORCEFULLREDRAW | DRAWFLAGS_NO_THREAD, NULL);    // force completion of cache rebuild  
          #elif _R10p1_SDK_  
            DrawViews(DA_FORCEFULLREDRAW | DA_NO_THREAD, NULL);  
          #else  
            DrawViews(DA_FORCEFULLREDRAW);  
          #endif  
          }  
          
          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

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

            On 02/09/2012 at 13:41, xxxxxxxx wrote:

            OK, thanks. I'll try it tomorrow. But I dont't want the editor windows being redrawed since it's called very often.

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