Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    How to use GeGetVersionType

    SDK Help
    0
    7
    452
    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

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

      On 19/08/2004 at 11:00, xxxxxxxx wrote:

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

      ---------
      Howdy,

      I'd like to have my plugin check to see if it's running with a demo version of C4D, but I'm not sure I understand how to use GeGetVersionType().

      I tried this...

      LONG cVersion = GeGetVersionType();
      if (cVersion == VERSION_DEMO)

      ...but that's obviously wrong.

      When I printed the LONG value, the number came up 147.

      Adios,
      Cactus Dan

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

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

        On 20/08/2004 at 12:17, xxxxxxxx wrote:

        if(GeGetVersionType()&VERSION;_DEMO)

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

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

          On 20/08/2004 at 14:06, xxxxxxxx wrote:

          Howdy,

          Thanks Samir. That worked, only I decided to use it this way:

          if (!(GeGetVersionType()&VERSION;_DEMO))

          Just out of curiosity, can you offer an explination as to what the &VERSION;_DEMO after the function call actually means?

          Thanks again.

          Adios,
          Cactus Dan

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

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

            On 21/08/2004 at 00:20, xxxxxxxx wrote:

            & is a bitwise logical AND operator. Bits between the two comparators that are both 1 remain 1 while those that aren't are 0.

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

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

              On 21/08/2004 at 05:28, xxxxxxxx wrote:

              Exactly and as these are bitflags they can only be checked with the bit operator. (sometimes it works with a relational operator but don´t trust them 🙂

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

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

                On 21/08/2004 at 07:21, xxxxxxxx wrote:

                Howdy,

                Aha, I think I understand now, but double check me on this.

                When GeGetVersionType() returns the long value 147, it's binary form is 10010011 (the demo version), and when it returns 131, it's binary form is 10000011 (my licensed version). The version bits are shown in the operatingsystem.h file as:

                // GeGetVersionType
                #define VERSION_CINEMA4D          (1<<0)
                #define VERSION_BODYPAINT          (1<<1)
                #define VERSION_NET                         (1<<2)
                #define VERSION_SERVER               (1<<3)
                #define VERSION_DEMO                    (1<<4)
                #define VERSION_BENCHMARK          (1<<6)
                #define VERSION_BODYPAINT2     (1<<7)

                The line #define VERSION_DEMO   (1<<4) is saying that VERSION_DEMO is 00010000 (in binary form). So, using the & operator on the returned value and the VERSION_DEMO value...

                10010011 - GeGetVersionType()
                00010000 - VERSION_DEMO

                will return a result of 00010000 which is TRUE for that bit and...

                10000011 - GeGetVersionType()
                00010000 - VERSION_DEMO

                will return a result of 00000000 which is FALSE for that bit.

                Is this correct?

                Adios,
                Cactus Dan

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

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

                  On 24/08/2004 at 06:51, xxxxxxxx wrote:

                  Si 🙂
                  In general, use & to check bits, and | to set bits.
                  a & b = ( b if all bits of b are set in a; != b else )
                  a | b = c, where c is a plus all set bits of b

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