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

    GetDEnabling() TypeError on parent-call

    PYTHON Development
    0
    2
    251
    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
      Helper
      last edited by

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

      On 08/08/2012 at 03:23, xxxxxxxx wrote:

      Hello,

      I'm still confused about the GetDEnabling() thing, where we should include a call to the base-classes' method. There are several topics where the issue I'm currently having appears, and we couldn't find a solution to it.
      Yannick told me he couldn't ever reproduce this error, and as soon as I wanted to show him some code that triggers it, I couldn't reproduce it either. 😂

      But now I have a piece of code that invokes the error, and I don't really understand it. Sometimes the parent-call works, and sometimes it doesn't. 😠

      This is my code so far:

          def GetDEnabling(self, op, descid, data, flags, itemdesc) :  
            rid = descid[0].id  
            value = True  
        
            # Just like the original Cube primitive, we will disable PRIM_CUBE_SEP  
            # when PRIM_CUBE_DOFILLET is active.  
            if rid == c4d.PRIM_CUBE_SEP:  
                value = not op[c4d.PRIM_CUBE_DOFILLET]  
        
            # PRIM_CUBE_FRAD and PRIM_CUBE_SUBF will be disabled when  
            # PRIM_CUBE_DOFILLET is not activeated.  
            elif rid in (c4d.PRIM_CUBE_FRAD, c4d.PRIM_CUBE_SUBF) :  
                value = op[c4d.PRIM_CUBE_DOFILLET]  
        
            # NRPRIM_DCUBE_INNERFOFFSET will be disabled when PRIM_CUBE_DOFILLET  
            # is not activated.  
            elif rid == c4d.NRPRIM_DCUBE_INNERFOFFSET:  
                value = op[c4d.PRIM_CUBE_DOFILLET]  
        
            # Otherwise, ask your parents!  
            else:  
                print "-> Parent Call for id", rid  
                value = super(DoubleCubeData, self).GetDEnabling(op, descid, data,  
                                                                 flags, itemdesc)  
        
            return bool(value)
      

      Fine so far. It used to work some minutes ago, and then suddenly, it didn't work for some elements.

      I have made a screencast that is intended to show the error more precisely and understandable.
      At the last part of the video, I do print "Parent call for id xx failed" when the parent-call failed. It will not be printed for some of the elements. That is because no parent-call is made for those elements (for example when I click in the "Seperate Surfaces" element or drag on the "Fillet Radius").
      It seems like only the parent-call for the element that is currently being changed in the AM fails.

      The video is located here.

      Can someone enlighten me about the issue? 😠
      -Niklas

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

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

        On 08/08/2012 at 06:17, xxxxxxxx wrote:

        Thanks for investigating this.
        Yes, I've now been able to reproduce this issue calling NodeData.GetDEnabling().
        Please submit this bug.

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