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

    GetObject() on the Python Node inside the Xpresso

    Cinema 4D SDK
    r20 python
    2
    3
    568
    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.
    • B
      bentraje
      last edited by

      Hi,

      I'm trying to retrieve the host object of an Xpresso tag.
      If the set-up is simply a Python Tag (i.e. Host Object>Python Tag): The solution would be op.GetObject()
      However, my current set-up is within the Xpresso Tag (i.e. Host Object>Expresso Tag>Python Tag).
      I get an error that GetObject() is not included as GV Node method, which is consistent with the documentation.

      That said, is there a way to get the Host Object with the given set-up above? All the GV Node methods seems to concern with the ports.

      Thank you for looking at my problem

      1 Reply Last reply Reply Quote 0
      • S
        s_bach
        last edited by

        Hello,

        in an Xpresso Python Node, the "op" variable stores a reference to the corresponding GvNode (see Python Xpresso Node).

        Form that GvNode, you can obtain the GvNodeMaster with GetNodeMaster().

        From the GvNodeMaster, you can obtain the host Xpresso tag using GetOwner().

        Form that tag, you can obtain the object using GetObject().

        node = op
        nodeMaster = node.GetNodeMaster()
        owner = nodeMaster.GetOwner()
        hostObject = owner.GetObject()
        

        best wishes,
        Sebastian

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 1
        • B
          bentraje
          last edited by

          @s_bach

          Thank you! Works as expected.

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