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

    Get selected CKeys

    Scheduled Pinned Locked Moved SDK Help
    11 Posts 0 Posters 773 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 10/09/2009 at 05:31, xxxxxxxx wrote:

      Use GetNBit() and ChangeNBit() with a key to determine and set the selection state in the four avaible timelines. The bits are:

      NBIT_TL1_SELECT
      NBIT_TL2_SELECT
      NBIT_TL3_SELECT
      NBIT_TL4_SELECT

      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 10/09/2009 at 06:14, xxxxxxxx wrote:

        Thanks!! 🙂

        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 10/09/2009 at 22:35, xxxxxxxx wrote:

          Not sure why but when I try using the GetNBit(NBIT_TL1_SELECT) like you mentioned above, I keep getting false returned even though I see the key selected.

          Here is a snippet of code

          //Set Curr_Key to first found key
          Curr_Key =Curr_Seq->GetKey(0);
          //Loop through all the keys on this track
          while(Curr_Key )
          {                         GePrint(LongToString(Curr_Key->GetTime().GetFrame(GetActiveDocument()->GetFps())));
                                   GePrint(LongToString(Curr_Key->GetNBit(NBIT_TL1_SELECT)));

          //When an active key                if(Curr_Key->GetNBit(NBIT_TL1_SELECT)     || Curr_Key->GetNBit(NBIT_TL2_SELECT) || Curr_Key->GetNBit(NBIT_TL3_SELECT) || Curr_Key->GetNBit(NBIT_TL4_SELECT))
          {
          //DO something
          GePrint("ENTERED");
          }

          I have confirmed that the keys exist and the 1st GePrint statement show print the value of their time. But the second one always comes up as zero/false. And I cannot get into the above if statement. Any advice?

          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 11/09/2009 at 09:29, xxxxxxxx wrote:

            Howdy,

            Since GetNBit() is accessing bits, you probably need to do this instead:

            > \> GePrint(LongToString(Curr_Key->GetNBit() & NBIT_TL1_SELECT) \>

            Adios,
            Cactus Dan

            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 11/09/2009 at 12:47, xxxxxxxx wrote:

              Howdy,

              DOH! Sorry, I was thinking of a different function, so disregard what I posted above. :o(

              Adios,
              Cactus Dan

              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 11/09/2009 at 17:41, xxxxxxxx wrote:

                Ok so then I still need help on this one.

                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 14/09/2009 at 02:11, xxxxxxxx wrote:

                  Quote: Originally posted by njt0001 on 11 September 2009
                  >
                  > * * *
                  >
                  > Ok so then I still need help on this one.
                  >
                  > * * *

                  Sorry but I can't confirm. This is working fine for me.

                  > \> Bool MenuTest::Execute(BaseDocument \*doc) \> { \>      BaseObject \*op = NULL; \>      op = doc->GetActiveObject(); \>      if (!op) return FALSE; \> \>      CTrack \*track = NULL; \>      track = op->GetFirstCTrack(); \>      if (!track) return FALSE; \> \>      CCurve \*curve = NULL; \>      curve = track->GetCurve(CC_CURVE, TRUE); \>      if (!curve) return FALSE; \> \>      CKey \*key = NULL; \>      LONG keycnt = curve->GetKeyCount(); \> \>      for (LONG i=0; i<keycnt; i++) \>      { \>           key = curve->GetKey(i); \>           if (!key) return FALSE; \> \>           if (key->GetNBit(NBIT_TL1_SELECT)) GePrint("key"+LongToString(i)+" TL1"); \>           if (key->GetNBit(NBIT_TL2_SELECT)) GePrint("key"+LongToString(i)+" TL2"); \>           if (key->GetNBit(NBIT_TL3_SELECT)) GePrint("key"+LongToString(i)+" TL3"); \>           if (key->GetNBit(NBIT_TL4_SELECT)) GePrint("key"+LongToString(i)+" TL4"); \>      } \> \>      return TRUE; \> } \>

                  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 14/09/2009 at 08:50, xxxxxxxx wrote:

                    Oh ok, well I see it when I select a key in keymode, but when I try switching to Fcurve mode it only displays the keys that are selected in Keymode not the keys I select in Fcurve mode. Any thoughts?

                    Thanks,
                    nate

                    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 14/09/2009 at 09:06, xxxxxxxx wrote:

                      For F-Curve keys use these:

                      NBIT_TL1_SELECT2
                      NBIT_TL2_SELECT2
                      NBIT_TL3_SELECT2
                      NBIT_TL4_SELECT2

                      At some point these bits will be documented in a proper way. But for now you have to go by the name, they are usally quite self-explanatory.

                      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 14/09/2009 at 11:06, xxxxxxxx wrote:

                        Thanks Matthias, that should do it!

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