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

    Launch the ContentBrowser at the User folder

    SDK Help
    0
    5
    398
    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 31/10/2013 at 10:58, xxxxxxxx wrote:

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

      ---------
      Hi,
      I can't get the Content Browser to launch with the .lib4d/User/ folder selected by default.
      I can successfully launch the CB to any other folder if it's a regular folder. But this .lib4d stuff is different.
      The docs seem to indicate that I'm supposed to use URLs. But I can't get it to work:
      Example:

        
        Filename user_dir = "preset://user.lib4d/Objects/Cube";  
        SDKBrowserURL myUrl = SDKBrowserURL(user_dir);   
        GePrint(myUrl.GetString());                       // prints file://localhost/preset://user.lib4d/Objects/Cube  
        
        SDKBrowser *cb = NULL;                         //Create a Content Browser instance  
        Bool exists = cb->ExistsPreset(myUrl);         //Returns 0...It doesn't find the objects directory even though it exists!!  
        GePrint(LongToString(exists));  
        
        cb->OpenNewBrowser(myUrl, 0);                 //Supposed to open the Content Browser window at specific directory..But fails!!
      

      What am I doing wrong?

      -ScottA

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

        On 31/10/2013 at 14:35, xxxxxxxx wrote:

        Never mind. I managed figure it out.
        I guess we must use the GetString() function on the presets locations.

        This code will launch the Content Browser at the User Folder (if it exists)

            Filename user_dir = "preset://user.lib4d/Objects";      
          SDKBrowser *cb = NULL;                            //Create a Content Browser instance  
          cb->OpenNewBrowser(user_dir.GetString(), 0);
        

        -ScottA

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

          On 01/11/2013 at 08:25, xxxxxxxx wrote:

          Thanks for sharing the solution.
          I tried to solve this in python too, but did not manage?
          Is it also possible in Python?

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

            On 01/11/2013 at 09:37, xxxxxxxx wrote:

            The content browser class is not wrapped in Python. You can however add a C++ function to your plugin

            as you started to do here https://developers.maxon.net/forum/topic/7509/9393_return-string-to-python which
            will open the SDK Browser for you.

            Best,
            -Niklas

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

              On 01/11/2013 at 11:34, xxxxxxxx wrote:

              Yes, this opens great opportunities.

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