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

    Get the original plugin instance somehow

    Scheduled Pinned Locked Moved PYTHON Development
    1 Posts 0 Posters 198 Views
    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.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 17/07/2011 at 06:10, xxxxxxxx wrote:

      Hi,

      Imagine the following:
        I have an ObjectData plugin that clones some objects.
        I also have a TagData that should modify the clones.
        Now, is there a way to get the original Instance of the ObjectData subclass in the Tag so I can call a function from it ?
        something like this:

      class MyObject(ObjectData) :  
        def __init__(self) :  
        self._clones = []  
        
        def **GetClones** (self) :  
        return self._clones[:]  
        
      class MyTag(TagData) :  
        def Execute(self, tag, doc, op, ...) :  
        clones = **op.GetClones()** # the method from 'MyObject'  
        for c in clones:  
          pos = c.GetAbsPos()  
          pos += tag[c4d.MODIFY_POSITION_VECTOR]  
          c.SetAbsPos(pos)
      

      Ideas ?
      Thanks !
      Niklas

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