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

    InExcludeData\BaseList2d link confusion

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 240 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

      On 26/01/2013 at 09:07, xxxxxxxx wrote:

      Hi,

      i have got a BaseTag for which i have to throttle the tag execution for performance
      reasons. i am using a custom isdirty method, with which i am comparing the currrent
      state of the tag and its linked objects with a cached state. to do this, i also cache the
      basecontainer of the tag to compare this cache with copies of the tag basecontainer 
      created at a later point. 
      my tag contains LinkBoxGui and a InExcludeCustomGui elements. when i compare 
      these containers  against each other  the result is always False, unless i clear out 
      the link values before i store my bc cache.

      is this intended ? shouldn't __eq__ compare the objects cotained in the link fields in 
      a boolean manner (or ignore them) rather than checking if they are actually the same 
      object with the same memory address ? are my assumptions correct or am i doing 
      something wrong here ?

      class foo(object) :
      	def __init__(self) :
      		self.Cache = None
        
      	def methodA(self, node) :
      		self.Cache = node.GetData()
        
      	def methodB(self, node) :
      		# always true
      		if self.Cache != node.GetData() :
      			pass
      

      a link to the complete isDirty() method.

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 31/01/2013 at 22:58, xxxxxxxx wrote:

        Hi Ferdinand,

        imo it makes more sense when comparing link-fields, if the objects are actually
        the same, and not just have the same properties. I'm not even sure if
        the InExcludeData actually implements a specialized __eq__ behavior.

        my tip: compare them yourself the way you want.

        Best,
        Niklas

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 05/02/2013 at 16:28, xxxxxxxx wrote:

          InExcludeData  does not, but BaseContainer does. But BaseContainer also has a DirtyCount 
          method which I totally overlook at that point and which is working as expected for me. 
          However i still think this could be considered as a bug. BaseContainer should skip values which 
          are not comparable in a boolean manner (not providing the rich comparison methods). Currently 
          there is no difference between  == and is for BaseContainers containing any object links. You 
          can hardly call this intended or expected behaviour imho.

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