Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    How to correctly get maxon::NimbusInterface?

    Cinema 4D SDK
    2023 2024 c++
    2
    2
    363
    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.
    • kbarK
      kbar
      last edited by

      I noticed a new function in 2025 called FindOrCreateCorrespondingBaseList.

      I went looking to see if I can find the corresponding function that works in 2023/2024 and it seems to be NbmFindOrCreateCorrespondingBaseList.

      The code below seems to work, but I just want to make sure that casting from maxon::NimbusBaseRef to maxon::NimbusInterface* is actually correct.

      (maxon::NimbusInterface*)nbmBase
      

      I can't seem to find any documentation about this anywhere.

      Thanks,
      Kent

      maxon::NimbusForwardRef nimbusRef = material->GetNimbusRef(maxon::Id("com.autodesk.arnold.nodespace"));
      maxon::NimbusBaseRef &nimbusBaseRef = nimbusRef.GetBase();
      
      // This is in 2025 an up
      // BaseList2D* imageNodeBaseObject = nimbusBaseRef.FindOrCreateCorrespondingBaseList(imageNode.GetPath()) iferr_ignore(""_s);
      
      // This is for 2023 and 2024
      maxon::NimbusBaseInterface* nbmBase = nimbusBaseRef.GetPointer();
      const maxon::CString& nodePath = imageNode.GetPath().ToCString() iferr_ignore(""_s);
      BaseList2D* imageNodeBaseObject = NbmFindOrCreateCorrespondingBaseList((maxon::NimbusInterface*)nbmBase, nodePath) iferr_ignore(""_s);
      
      DescID texturePathID;
      // This is in 2025 and up
      //nimbusBaseRef.GetDescID(filenamePort.GetPath(), texturePathID);
      
      // This is for 2023 and 2024
      NbmPortToDescID((maxon::NimbusInterface*)nbmBase, imageNode, filenamePort, texturePathID);
      

      https://www.gamelogicdesign.com
      https://www.plugins4d.com

      1 Reply Last reply Reply Quote 0
      • O
        o_kniemeyer
        last edited by

        Hi Kent,
        the cast is safe. In the public API, NimbusInterface is an incomplete type. Only NimbusBaseInterface is defined there. But internally, NimbusInterface is derived from NimbusBaseInterface, therefore you can safely do the cast.

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