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

    plugin missing after scene save

    Scheduled Pinned Locked Moved SDK Help
    12 Posts 0 Posters 789 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 30/04/2009 at 01:09, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   9.6+ 
      Platform:      
      Language(s) :     C++  ;

      ---------
      Hi.

      Im experiencing some strange issue.

      I have a generator plugin that works fine so far.
      But when i save a scene with it, and try to load the scene later, i always get that dialog stating my plugin is missing!

      Funny thing is that its there, bc when i dismiss the dialog, i can fo into plugin menu and insert my generator from there..

      What am i doing wrong ?
      Might be sth wrong in my init/Message/RegisterPlugin functions, so that the plugi gets loaded too late or sth ?

      thanks,
      Daniel

      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 30/04/2009 at 01:17, xxxxxxxx wrote:

        Hi, which methods do you overload? Did you implement ObjectData::Read() or ObjectData::Write() ?

        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 30/04/2009 at 03:25, xxxxxxxx wrote:

          thanks for your answer.

          i overloaded these:
          -------------------
          Init
          GetVirtualObjects
          Message
          Draw
          DetectHandle
          MoveHandle
          CreateVirtualWindow
          GetDDescription

          i did not implement read and write, bc i thought that's only neccessary when i want to store plugin settings that are not in the basecontainer (judging from the docs).

          Also i thought read and write is only about the settings, but the dialog text says the whole plugin is missing (even though its ion the menu).

          Here's the exact dialog text:
          'Several plugins used in the scene are missing. Saving may cause loss of plugin data! ..'

          It kinda looks like the plugin is not there during the document loading phase, but later is ?
          just an assumption though..

          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 30/04/2009 at 03:33, xxxxxxxx wrote:

            Hard to tell without any code. Can you post stripped down source code of your plugin that shows the problem?

            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 30/04/2009 at 03:40, xxxxxxxx wrote:

              sure, but what code part would you need ? 😉

              i dont know where the problem lies, everyrging is working well.
              only when i load a scene, in which my generator was saved, it gives the message.

              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 30/04/2009 at 03:40, xxxxxxxx wrote:

                Maybe you register the plugin too late. That might be the reason why you can create an object but which is not there on loading a scene. Are you sure you register the Plugin in PluginStart() and use the correct Priority?

                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 30/04/2009 at 03:50, xxxxxxxx wrote:

                  yes i did it in plugin start, not sure though what you mean with priorities. Do i have to change sth in the PluginMessage() part ?

                  heres my complete main.cpp, which is based on the 9.6 sdk. My generator code is based on the atom.cpp example.

                  > <code>
                  > #include "c4d.h"
                  > #include <string.h>
                  >
                  > // forward declarations
                  > Bool RegisterPluginX(); // tool plugin
                  > Bool RegisterPluginY(); // generator plugin
                  >
                  >
                  > Bool PluginStart(void){
                  >      
                  >      if (!RegisterPluginX()){
                  >           GePrint("failed to register PluginX!");
                  >           return FALSE;     
                  >      }
                  >      if (!RegisterPluginY()){
                  >           GePrint("failed to register PluginY!");
                  >           return FALSE;     
                  >      }
                  >
                  >      return TRUE;
                  > }
                  >
                  > void PluginEnd(void){
                  > }
                  >
                  > Bool PluginMessage(LONG id, void *data){
                  >      //use the following lines to set a plugin priority
                  >      //
                  >      switch (id)
                  >      {
                  >           case C4DPL_INIT_SYS:
                  >                if (!resource.Init()) return FALSE; // don't start plugin without resource
                  >                //if (!RegisterExampleDataType()) return FALSE;
                  >                return TRUE;
                  >
                  >           case C4DMSG_PRIORITY:
                  >                return TRUE;
                  >
                  >           case C4DPL_BUILDMENU:
                  >                //EnhanceMainMenu();      
                  >                break;
                  >                
                  >           case C4DPL_COMMANDLINEARGS:
                  >                {
                  >                     C4DPL_CommandLineArgs *args = (C4DPL_CommandLineArgs* )data;
                  >                     LONG i;
                  >
                  >                     for (i=0;i<args->argc;i++){
                  >                          if (!args->argv _) continue;
                  >                          
                  >                          if (!strcmp(args->argv _,"--help") || !strcmp(args- >argv _,"-help")){
                  >                               // do not clear the entry so that other plugins can make their output!!!
                  >                               GePrint("\x01-SDK is here :-)");
                  >                          }
                  >                          else if (!strcmp(args->argv _,"-SDK"))      {
                  >                               args->argv _= NULL;
                  >                               GePrint("\x01-SDK executed:-)");
                  >                          }
                  >                          else if (!strcmp(args->argv _,"-plugincrash")){
                  >                               args->argv _= NULL;
                  >                               *((LONG* )0) = 1234;
                  >                          }
                  >                     }
                  >                }
                  >                break;
                  >
                  >           case C4DPL_EDITIMAGE:
                  >                {
                  >                     C4DPL_EditImage *editimage = (C4DPL_EditImage* )data;
                  >                     if (!data) break;
                  >                     if (editimage->return_processed) break;
                  >                     GePrint("C4DSDK - Edit Image Hook: "+editimage->imagefn->GetString());
                  >                     // editimage->return_processed = TRUE; if image was processed
                  >                }
                  >                return FALSE;
                  >      }
                  >
                  >      return FALSE;
                  > }
                  > </code>

                  there's no error msg in the console, so the plugin was registered correctly, just too late i guess..

                  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 30/04/2009 at 03:57, xxxxxxxx wrote:

                    Can you please also post the definitions of RegisterPluginX() and RegisterPluginY().

                    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 30/04/2009 at 04:03, xxxxxxxx wrote:

                      here it is:

                      > <code>
                      > Bool RegisterPluginX(){
                      >      return RegisterToolPlugin(ID_PLUGIN_X, GeLoadString(IDS_PLUGIN_X), 0,"pluginX.tif", GeLoadString(IDS_PLUGIN_X), gNew PluginX);     
                      > }
                      >
                      > Bool RegisterPluginY(void){
                      >      
                      > #ifndef C4D_R9
                      >      return RegisterObjectPlugin(ID_PLUGIN_Y,GeLoadString(IDS_PLUGIN_Y),OBJECT_GENERATOR|OBJECT_INPUT,PluginY::Alloc,"Opluginy","pluginY.tif",0);
                      > #else
                      >      return RegisterObjectPlugin(ID_PLUGIN_Y,GeLoadString(IDS_PLUGIN_Y),OBJECT_GENERATOR|OBJECT_INPUT|OBJECT_USECACHECOLOR,PluginY::Alloc,"Opluginy","pluginY.tif","pluginY_small.tif",0);
                      > #endif
                      > }
                      > </code>

                      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 30/04/2009 at 04:19, xxxxxxxx wrote:

                        ok i tried sth out now:

                        in the init function of my generator plugin, i put 2 GePrint().

                        oen at the start and the other one at the end of the init function.

                        when i load a scene with my generator now, i see the first msg from the start of Init, then the error dialog pops up, and thats it.

                        no second message, which should state the successfull Init of my Generator..

                        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 30/04/2009 at 04:43, xxxxxxxx wrote:

                          ok i got it..

                          in my init im checking if there is a doc and an active object.. this returned false at some point when loading a saved scene.

                          i fixed it now, thanks everybody.

                          greetings,
                          Daniel

                          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 30/04/2009 at 08:45, xxxxxxxx wrote:

                            Just for closure here, one shouldn't be checking for the existence of documents, objects, tags, materials, plugins, etc. in Init() as, during scene load, they may not have been created yet.

                            If you need to do so, check for MSG_MULTI_DOCUMENTIMPORTED in your overloaded Message() method.

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