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
    1. Maxon Developers Forum
    2. curtwart
    C
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    curtwart

    @curtwart

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

    curtwart Unfollow Follow

    Latest posts made by curtwart

    • RE: Get all BaseListLink parameters using specific BaseObject

      Thank you for this write up, I started writing something similar, but this is a huge help understanding how to get and set the data for BaseLink. I'll need to add FieldList and InExcludeData as you mentioned, knowing the getting and adding the new object is a little more involved than just setting the property id directly. I'll reach out here again if I have any followups.

      posted in Cinema 4D SDK
      C
      curtwart
    • Get all BaseListLink parameters using specific BaseObject

      Hey guys, I'm new to working in Cinema 4D and the Cinema 4D python SDK, I am trying to relink a BaseObject into DTYPE_BASELISTLINK parameters after running a join on a BaseObject. I'm wondering if there is a simple way to get all other objects a single BaseObject is linked within, something like a get all objects a BaseObject is referenced by. I have a code snippet below that hopefully demonstrates what I'm trying to achieve.

      def join_object(obj : c4d.BaseObject):
          # Gets the objects that the obj is used in
          linked_objects = get_references(obj)
      
          # Join the object, this will remove the obj from all of its linked parameters of type DTYPE_BASELISTLINK
          new_obj = c4d.utils.SendModelingCommand(command=c4d.MCOMMAND_JOIN, list=[obj], doc=doc)[0]
          doc.InsertObject(new_obj, None, obj)
          obj.Remove()
      
          # Relink the new_obj into where the obj was used
          relink_object(linked_objects, obj)
      
          return new_obj
      
      posted in Cinema 4D SDK python 2024
      C
      curtwart