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
    • Recent
    • Tags
    • Users
    • Login

    Polygon selection tag out of bounds

    Scheduled Pinned Locked Moved PYTHON Development
    8 Posts 0 Posters 612 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 30/04/2014 at 11:51, xxxxxxxx wrote:

      In a plugin that I created, when I switch modes (from Point mode to Edge mode, or from Edge mode to Polygon mode, or whatever), after having created a Polygon Selection Tag, I get this message:

      A problem with this project has been detected:
      Object "Landscape" - Polygon selection tag out of bounds.
      Please save and contact MAXON Support
      with a description of the last used commands, actions or plugins.

      This message only appears when I have a Polygon Selection Tag attached to the object.
      What could be happening?

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

        On 30/04/2014 at 12:39, xxxxxxxx wrote:

        What's your plugin do?

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

          On 30/04/2014 at 14:15, xxxxxxxx wrote:

          It is a tag that dynamically hides polygon faces from polygonal objects.
          It works just fine when there is no selection tag attached to the object.
          It also works fine when I attach a new selection tag manually, using the Set Selection command.
          But when the object has a selection tag that was created by the plugin, it results in that error message when I switch modes.

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

            On 30/04/2014 at 14:51, xxxxxxxx wrote:

            All of a sudden, it started to work.
            Damn!! Go figure.
            Got to do more testing, trying to break it.
            I don't want to release plugins that return error messages at random occasions 🙂

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

              On 30/04/2014 at 14:58, xxxxxxxx wrote:

              Ok, if I create a tag using:

              result=utils.SendModelingCommand(command=c4d.MCOMMAND_GENERATESELECTION,list[op],mode=c4d.MODELINGCOMMANDMODE_POLYGONSELECTION,bc=c4d.BaseContainer(),doc=doc)

              The error occasionally (most of the time) will appear.
              If I create the tag with:

              sel_tag=op.MakeTag(c4d.Tpolygonselection)
              tag_selection=sel_tag.GetBaseSelect()
              selection.CopyTo(tag_selection)

              It all works fine.
              Well, at least I found a way to make it work.

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

                On 30/04/2014 at 15:37, xxxxxxxx wrote:

                NOPE!!! False alarm.
                It still returns the error.
                Damn! Could someone help me on this?

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

                  On 30/04/2014 at 16:05, xxxxxxxx wrote:

                  Most of the problems I've had with adding tags & objects with code have been from the tag or object taking too long to physically create itself.
                  So when the code goes to the next line and tries to edit that tag or object. It can't do it because C4D hasn't finished building it yet.

                  What seems to be the safest way (where I've had the most luck) of creating these things is to do it in the Message() method. And using MSG_MENUPREPARE to test if C4D is ready to proceed.

                  def Message(self, node, type, data) :  
                    
                    #Get the object the tag will be added to   
                    obj = op.GetObject()   
                    if not obj: return False  
                    
                    if type == c4d.MSG_MENUPREPARE:  
                    
                        polytag = c4d.BaseTag(c4d.Tpolygonselection)   
                        obj.InsertTag(polytag, 0)  
                     
                    return MyPlugin.Message(node, type, data)
                  

                  -ScottA

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

                    On 30/04/2014 at 16:27, xxxxxxxx wrote:

                    Thank you Scott. I will give it a try.

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