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

    set "Visible in Editor" keyframe

    SDK Help
    0
    5
    676
    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
      Helper
      last edited by

      On 06/09/2017 at 02:46, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:      
      Language(s) :

      ---------
      I have a tag plugin and I want to set the objects "Visible in Editor" using keyframes.

      Here my code.
      A keyframe is set on frame 0, but the value for "Visible in Editor" is not correct (always On).
      What am I doing wrong?

      track = CTrack::Alloc(op, DescID(ID_BASEOBJECT_VISIBILITY_EDITOR, DTYPE_LONG, 0)); 
      if (track) {
         // Add track to op
         op->InsertTrackSorted(track);
      		
         // Get track curve
         CCurve* curve = track->GetCurve();
         if (curve!=nullptr) {
            CKey* key = curve->AddKey(BaseTime(0.0));
            key->SetValue(curve, 1);		//set to Off
         }
      }
        
      
      

      -Pim

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

        On 06/09/2017 at 02:52, xxxxxxxx wrote:

        I already notice some "bugs" (key was not created) putting key at BaseTime(0.0). So this may be related.

        I end up by creating a key then move his time at BaseTime(0.0)

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

          On 06/09/2017 at 03:05, xxxxxxxx wrote:

          Actually the keyframe is set, but the Visible in Editor value is not set correctly.
          Perhaps it is because Long - Float issue.
          Visible in Editor is an integer, but SetValue() expects a Float?

          I did a test creating the keyframe at 1.0, but the result is the same (a value of 0 (On) is inserted in the key).

          -Pim

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

            On 07/09/2017 at 01:26, xxxxxxxx wrote:

            Hello,

            to set the value of animation tracks that do not store Float values you can use SetGeData(). See the CKey Manual.

            best wishes,
            Sebastian

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

              On 07/09/2017 at 01:28, xxxxxxxx wrote:

              Yes, that did the trick.

              Thanks, Pim

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