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

    Demo Plugin Version.

    Scheduled Pinned Locked Moved SDK Help
    18 Posts 0 Posters 1.2k 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 13/02/2010 at 06:02, xxxxxxxx wrote:

      Okay so I tried this in the main.cpp..

        
      Bool PluginStart(void)  
      {  
        // example of installing a crashhandler  
        old_handler = C4DOS.CrashHandler; // backup the original handler (must be called!)  
        C4DOS.CrashHandler = SDKCrashHandler; // insert the own handler  
        //GePrint("PLANET X GENERATOR IS AVAILABLE FOR DEMO USE ONLY!");  
          
            if (GeGetVersionType() &VERSION_SAVABLEDEMO_ACTIVE || VERSION_SAVABLEDEMO || VERSION_DEMO)  
            {  
                GePrint("PLANET X GENERATOR IS AVAILABLE FOR DEMO USE ONLY!");  
            }  
        
            else  
            {  
                GePrint("NOT THE DEMO");  
                GePrint("THE VERSION TYPE IS " + LongToString(GeGetVersionType()));  
                if (!IsSerialOKHook()) return FALSE; //don't load plugins if key is wrong      
            }  
        
        // Planet Object  
        if (!RegisterPlanet()) return FALSE;  
        // Sun Object  
        if (!RegisterSun()) return FALSE;  
        // Space Object  
        if (!RegisterSpace()) return FALSE;  
        //SERIAL NUMBER  
        if (!RegisterPlanetXSerial()) return FALSE;  
        
        return RegisterPlanet() && RegisterSun() && RegisterSpace();  
      }  
        
      

      When I am in the demo mode I get the plugin enabled and I am able to use it and as expected, the console prints out....

      PLANET X GENERATOR IS AVAILABLE FOR DEMO USE ONLY!

      However, when I am using my registered copy of the plugin, I am also able to use it and the console prints out...

      PLANET X GENERATOR IS AVAILABLE FOR DEMO USE ONLY!

      Why do you think this is happening?

      ~Shawn

      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 13/02/2010 at 07:01, xxxxxxxx wrote:

        Well...  thanks to a heaping helping of kindness from Cactus Dan,  this problem has been solved.   Here's the final working code for the PluginStart();

          
        Bool PluginStart(void)  
        {  
          // example of installing a crashhandler  
          old_handler = C4DOS.CrashHandler; // backup the original handler (must be called!)  
          C4DOS.CrashHandler = SDKCrashHandler; // insert the own handler  
          //GePrint("PLANET X GENERATOR IS AVAILABLE FOR DEMO USE ONLY!");  
            
              if(GeGetVersionType()&VERSION_SAVABLEDEMO_ACTIVE || GeGetVersionType()&VERSION_SAVABLEDEMO || GeGetVersionType()&VERSION_DEMO)  
              {  
                  GePrint("PLANET X GENERATOR IS AVAILABLE FOR DEMO USE ONLY!");  
              }  
          
              else  
              {  
                  GePrint("NOT THE DEMO");  
                  GePrint("THE VERSION TYPE IS " + LongToString(GeGetVersionType()));  
                  if (!IsSerialOKHook()) return FALSE; //don't load plugins if key is wrong      
              }  
          
          // Planet Object  
          if (!RegisterPlanet()) return FALSE;  
          // Sun Object  
          if (!RegisterSun()) return FALSE;  
          // Space Object  
          if (!RegisterSpace()) return FALSE;  
          //SERIAL NUMBER  
          if (!RegisterPlanetXSerial()) return FALSE;  
          
          return RegisterPlanet() && RegisterSun() && RegisterSpace();  
        }  
        
        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 13/02/2010 at 07:31, xxxxxxxx wrote:

          The line looks strange to me:

          GeGetVersionType() &VERSION;_SAVABLEDEMO_ACTIVE || VERSION_SAVABLEDEMO || VERSION_DEMO
          

          Shouldn't it be:

          GeGetVersionType() == VERSION_SAVABLEDEMO_ACTIVE || VERSION_SAVABLEDEMO || VERSION_DEMO
          

          [EDIT]Oh no, wait. Forget about this. & is correct.[/EDIT]

          Cheers,
          Jack

          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 13/02/2010 at 07:33, xxxxxxxx wrote:

            Actually, that looks strange to me, too:

                // Planet Object   
                if (!RegisterPlanet()) return FALSE;   
                // Sun Object   
                if (!RegisterSun()) return FALSE;   
                // Space Object   
                if (!RegisterSpace()) return FALSE;   
                //SERIAL NUMBER   
                if (!RegisterPlanetXSerial()) return FALSE;   
              
                return RegisterPlanet() && RegisterSun() && RegisterSpace();   
            

            So, you first try to register the plugins. When this succeeds, you register them all again and return the result? Why don't you just return TRUE at the end of the function, since they're already registered?

            Cheers,
            Jack

            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 13/02/2010 at 07:45, xxxxxxxx wrote:

              so instead of

              return RegisterPlanet() && RegisterSun() && RegisterSpace();  
              

              do...

              return TRUE;  
              

              ?

              ~Shawn

              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 13/02/2010 at 09:53, xxxxxxxx wrote:

                GeGetVersionType() returns a bit mask. So you have to check against your own bit mask.

                Remember that || and & & are compare operators.
                | and & are bit mask operators.

                Following line of code checks if the result of GeGetversionType() has one of the specified bits set.

                  
                if (GeGetVersionType() & (VERSION_SAVABLEDEMO_ACTIVE | VERSION_SAVABLEDEMO | VERSION_DEMO))  
                {  
                  //do something  
                }  
                

                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 13/02/2010 at 14:57, xxxxxxxx wrote:

                  Originally posted by xxxxxxxx

                  so instead of

                  return RegisterPlanet() && RegisterSun() && RegisterSpace();
                  do...

                  return TRUE;
                  ?

                  Yes. You have already called all Register functions before, so if the function reaches this point, you can just return TRUE. If one of the Register functions does not work out (returns FALSE) the PluginStart function is cancelled anyway and FALSE is returned.

                  Cheers,
                  Jack

                  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 15/02/2010 at 02:00, xxxxxxxx wrote:

                    Originally posted by xxxxxxxx

                    And what is the exact dependency? From R11 on checking for these two instead of VERSON_DEMO? Is VERSON_DEMO completely gone now or should one still check for it? Thanks

                    VERSION_DEMO is not used anymore since the R11 demo version.

                    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 15/02/2010 at 02:07, xxxxxxxx wrote:

                      Originally posted by xxxxxxxx

                      hmm, it seems to me that the demo does not call SNCheck at all. Is that right?

                      The demo version doesn't support the SNHookClass because it has no Personalioze dialog anyway.

                      Check in C4DPL_INIT_SYS for the Cinema version (that's where you would register the SNHookClass too).

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

                        Thanks Matthias.

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