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 Count of existing preset libraries [SOLVED]

    SDK Help
    0
    3
    308
    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 20/08/2015 at 00:02, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:      
      Language(s) :

      ---------
      To browse preset libraries you need to specify a db_index in Alloc.

      AutoAlloc<SDKBrowsePresets> lib(db_index);

      If i want to parse all that are present i would need to how many there are. How do i get this value?

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

        On 20/08/2015 at 03:32, xxxxxxxx wrote:

        Hello,

        to browse the content of the preset library you could also use the category node returned by GetCategoryNode(). This could look like this:

          
        SDKBrowserContentNodeRef ref = SDKBrowser::GetCategoryNode(SDKBrowser::CategoryPresetNodes);  
        if (!ref)   
         return false;  
          
        for (ref = ref->GetDown(); ref; ref = ref->GetNext())  
        {  
         GePrint(ref->GetName());  
          
         // Check child elements  
         SDKBrowserContentNodeRef child = ref->GetDown();  
          
         while (child)  
         {  
             GePrint("----" + child->GetName());  
             child = child->GetNext();  
         }  
        }  
        

        best wishes,
        Sebastian

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

          On 20/08/2015 at 06:36, xxxxxxxx wrote:

          that seems to work
          thanks Sebastian!

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