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
    • Recent
    • Tags
    • Users
    • Login

    R12 Parameters don't animate

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 365 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 02/10/2010 at 15:57, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:      
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      In R11.5 and lower I use scripts to export and import animation to text files
      (ie chan export and import).
      In R12 only the PSR values are keyframed (CallCommand(12410)) correct
      but not object parameters when importing.
      Using "Add Keyframe Selection", keys are set but no animation are set.
      Values are simply not recognized.

      Could this be connected to the pointselection/linkfield issue (no update until Event)?

      Below is the part in the loop that sets FocalLength and Aperture (R11.5 OK, R12 not).

        
      // asize is the amount of columns in txt file   
      // warray is the column used   
        
        
          if(op->IsInstanceOf(Ocamera) && asize > 7 )   
             {   
              var apert = op#CAMERAOBJECT_APERTURE / aspect;   
                 {   
                 if(format == 0 && warray[7]!=NULL) op#CAMERA_FOCUS = apert/(2*tan(Radians(warray[7])/2)); // chan verticalFOV   
        
                 if(format == 1 && warray[7]!=NULL && warray[8]!=NULL)   
                    {   
                       op#CAMERA_FOCUS = (warray[7]);        // chan TG 2.1 Focal Length   
                       op#CAMERAOBJECT_APERTURE = warray[8]; // chan TG 2.1 Aperture Width mm   
                    }   
        
                 if(format == 2 && warray[7]!=NULL) op#CAMERA_FOCUS          = (warray[7]); // ASCII Focal Length   
                 if(format == 2 && warray[8]!=NULL) op#CAMERAOBJECT_APERTURE = (warray[8]); // ASCII Aperture mm   
                }   
              EventAdd(EVENT_ANIMATE); // <- tried but no go   
             op->Message(MSG_UPDATE); // <- tried but no go   
             }   
          EventAdd();   
        
          CallCommand(12410);//record   
        
          DrawViews(DRAWFLAGS_STATICBREAK);//R12   
      

      Cheers
      Lennart

      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/10/2010 at 17:49, xxxxxxxx wrote:

        I also just tried setting the values to the base container of op
        instead of using the # operator, but still no go I'm afraid.

        Cheers
        Lennart

        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 04/10/2010 at 02:27, xxxxxxxx wrote:

          Sorry, I can't confirm.
          This simple test code will record keyframes of a sphere's radius. Of course you have to make the radius a key frame selection before running the script. The Cinema 4D help does say so too.

            
          var op = doc->GetActiveObject();  
            
          var time = new(BaseTime);  
          var i;  
          for (i=0; i<10; i++)  
          {  
            time->SetFrame(i, doc->GetFps());  
            doc->SetTime(time);  
            doc->AnimateDocument(0);  
            EventAdd();  
            DrawViews(DRAWFLAGS_FORCEFULLREDRAW);  
            op#PRIM_SPHERE_RAD = i*10.0;  
            CallCommand(12410);  
          }  
          

          **Parameter

          When in this mode, in conjunction with Key-Selections, only the selected parameters will be applied when recording keyframes. This works both in the Autokeying mode as well as when recording keyframes manually (Record Active Objects).**

          cheers,
          Matthias

          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 04/10/2010 at 10:16, xxxxxxxx wrote:

            Thanks Matthias for checking and the example.

            Yes I know that and that is what I do (use KeyFrame Selection)
            As I mentioned, keys -are- set for the camera parameters
            but no correct values are set.

            However, what I found out was:
            First, the DrawViews(DRAWFLAGS_FORCEFULLREDRAW) isn't called
            at the "same" moment as the R11 "DrawViews(DA_STATICBREAK)".
            I need to put the DrawView Command before the Record command
            or I get some very erratic keys (wrong values at wrong time).

            Second,
            In R11, to check a valid value in a column from the txt file I use,
            if(array[n] != NULL)

            In R12 I need to use,
            if(array[n] != NOTOK)

            So far it seems to work as it should.

            Cheers
            Lennart

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