Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

set "Visible in Editor" keyframe

 Post Reply Post Reply
Author
Message
pgrooff View Drop Down
Member
Member


Joined: 2010 Nov 05
Online Status: Offline
Posts: 714
Post Options Post Options   Quote pgrooff Quote  Post ReplyReply Direct Link To This Post Topic: set "Visible in Editor" keyframe
    Posted: 2017 Sep 06 at 2:46am

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


Edited by pgrooff - 2017 Sep 06 at 2:48am
Back to Top
gr4ph0s View Drop Down
Member
Member


Joined: 2015 Jul 07
Location: France
Online Status: Offline
Posts: 320
Post Options Post Options   Quote gr4ph0s Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Sep 06 at 2:52am
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)
Technical lover.
Back to Top
pgrooff View Drop Down
Member
Member


Joined: 2010 Nov 05
Online Status: Offline
Posts: 714
Post Options Post Options   Quote pgrooff Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Sep 06 at 3:05am
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
Back to Top
S_Bach View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2011 Jun 27
Online Status: Offline
Posts: 1302
Post Options Post Options   Quote S_Bach Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Sep 07 at 1:26am
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

SDK Support Engineer
Back to Top
pgrooff View Drop Down
Member
Member


Joined: 2010 Nov 05
Online Status: Offline
Posts: 714
Post Options Post Options   Quote pgrooff Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Sep 07 at 1:28am
Yes, that did the trick.

Thanks, Pim
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.094 seconds.