How to correctly get maxon::NimbusInterface?
-
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,
Kentmaxon::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);
-
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.