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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    SceneSaver - before save dialog

    SDK Help
    0
    3
    287
    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

      On 13/05/2013 at 21:10, xxxxxxxx wrote:

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

      ---------
      My SceneSaver plugin requires one object to be selected to work correctly. At the moment this is handled through the FILEERROR return value (nothing gets saved and there is an error message in the Console). I'd rather have the user alerted right after the Export menu entry is selected. Is there a way to do this?

      Peter

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

        On 14/05/2013 at 04:16, xxxxxxxx wrote:

        See when Init() is called (NodeData from which SceneSaverData is derived).  If it is only called when the plugin is about to save with Save(), then you could check there instead and abort the Save() call by setting a flag member variable (Bool for instance).

        class MyPlugin : SceneSaverData  
        {  
          Bool abortSave;  
        };  
          
        ///  
          
        Bool MyPlugin::Init(GeListNode* node)  
        {  
          ...  
          BaseDocument*    doc =    node->GetDocument();  
          if (!doc)    return FALSE;  
          abortSave =    (doc->GetActiveObject())?FALSE:TRUE;  
          return TRUE;  
        }  
          
        FILEERROR MyPlugin::Save(...)  
        {  
          if (abortSave)    return FILEERROR_USERBREAK; // or something more appropriate (?)  
          ...  
        }
        

        No idea if this would help or work.  First check where Init() is called (print to the Console if needed) then see what happens with the code above added to your existing code.

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

          On 15/05/2013 at 21:22, xxxxxxxx wrote:

          Hi Robert
          It seems I only get to MyPlugin::Save after the file dialog. I don't see a way to intercept the dialog. Maybe one of these two is possible:

          1. return a custom FILEERROR which C4D would show in a dialog or
          2. instead of sending a message to the Console show some sort of dialog?

          So that at east the user knows why it didn't work.

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