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
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. o_kniemeyer
    O
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 4
    • Best 1
    • Controversial 0
    • Groups 0

    o_kniemeyer

    @o_kniemeyer

    2
    Reputation
    3
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    o_kniemeyer Unfollow Follow

    Best posts made by o_kniemeyer

    • RE: How to correctly get maxon::NimbusInterface?

      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.

      posted in Cinema 4D SDK
      O
      o_kniemeyer

    Latest posts made by o_kniemeyer

    • RE: How to correctly get maxon::NimbusInterface?

      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.

      posted in Cinema 4D SDK
      O
      o_kniemeyer
    • RE: Overriding `NodeData::GetAccessedObjects(..)` prevents cache generation of cloned hierarchy

      The function GetAndCheckHierarchyClone creates clones of all children, therefore it has to read everything from the children and you need ACCESSED_OBJECTS_MASK::ALL in the read part. It'll also mark the children as being consumed by your generator so that they don't create virtual objects on their own (only their clones in the cache of your generator will create virtual objects), and for this mark you need ACCESSED_OBJECTS_MASK::CACHE in the write part.

      GetAndCheckHierarchyClone doesn't read global matrices, so the GLOBAL_MATRIX flag isn't needed.

      The flags in the other call can be reduced to access.MayAccess(node, ACCESSED_OBJECTS_MASK::NONE, ACCESSED_OBJECTS_MASK::CACHE). That's because your GetVirtualObjects doesn't read anything from the generator itself (NONE), it'll only set up its virtual objects (CACHE). As soon as you access the BaseContainer of your generator, you have to add DATA. For the matrix MATRIX or even GLOBAL_MATRIX etc.

      posted in Cinema 4D SDK
      O
      o_kniemeyer
    • RE: Overriding `NodeData::GetAccessedObjects(..)` prevents cache generation of cloned hierarchy

      There's no way for you to know if an object implements GetAccessedObjects or not. And even if there was a way, that wouldn't help in general because that implementation could still decide to call MayAccessAnything(), e.g. based on the object's settings. You need the knowledge that the connect object supports GetAccessedObjects AND won't call MayAccessAnything() in the configuration which you create in your code.

      The only clean way would be to call GetAccessedObjects on the connect object within MyGenerator::GetAccessedObjects. That's what node->GetAccessedObjectsOfFirstChildHierarchy() does with the object's children. But you don't have the connect object yet in GetAccessedObjects, so that's not feasible.

      posted in Cinema 4D SDK
      O
      o_kniemeyer
    • RE: Overriding `NodeData::GetAccessedObjects(..)` prevents cache generation of cloned hierarchy

      Hi Deyan,

      your code for GetAccessedObjects is correct. The problem is that you use the connect object, and this object doesn't implement GetAccessedObjects yet. There are a lot of objects in the C4D code base, and we at Maxon haven't had the time yet to implement GetAccessedObjects for all of them.

      A GetAccessedObjects implementation has to tell about all access which GetVirtualObjects will make to the scene, and also about all access which the objects created by GetVirtualObjects will make to the scene when GetVirtualObjects is called on them. Also all objects created by GetVirtualObjects have to support GetAccessedObjects. The connect object doesn't, so your code fails.

      The connect object will support GetAccessedObjects in 2024.4. So you have to wait a bit, I'm sorry.

      posted in Cinema 4D SDK
      O
      o_kniemeyer