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

    Get the last selected directory

    SDK Help
    0
    3
    470
    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 24/09/2017 at 03:03, xxxxxxxx wrote:

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

      ---------
      Hello.

      Every time I create an Xbitmap shader in a material, I get the "Open File" dialog to select an image.
      This dialog shows to the last selected directory. How do I get that "Last Selected Directory" ?
      Is there a way such as GeGetC4DPath(C4D_PATH_DESKTOP) or do I have to manually save the last-selected-directory in Preferences ?

      Thank you.

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

        On 26/09/2017 at 08:52, xxxxxxxx wrote:

        Hi Peterakos, thanks for writing us.

        The information is already stored in the world settings container but accessing this data is not officially supported resulting it more as an hack rather than an official approach.

        To access it use ID 90001.

          
        BaseContainer* worldSettings = GetWorldContainer();  
        if (worldSettings)  
        {  
          Filename lastSelectedDir = worldSettings.GetFilename(90001)  
        }  
        

        Best, Riccardo

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

          On 28/09/2017 at 05:55, xxxxxxxx wrote:

          Hello and thank you for your help.

          Can I also set 90001 filename to the preferred directory ? Does Cinema 4D use the same directory to load and save files ?

          Thank you !

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