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

    Object deselects everything

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 592 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 06/05/2015 at 06:57, xxxxxxxx wrote:

      The title is not very explanatory but I will try to describe what is going on.
      I created an ObjectPlugin. It creates a mesh that is generated from a spline.
      The generated mesh is quite complex and, to create it I have to create Sweep objects, make then editable, join the body and caps into a single object, optimize the resulting mesh, perform a bridge operation between some sweeps and finally, gather all the editable sweeps into a single object and optimize everything.
      It is working.
      However, when I perform any operation that forces a new mesh calculation, after being calculated, any object that was selected previously, gets deselected.
      For example, if I select the spline (it is an independent object) that is used as the basis for the calculation of the mesh and I adjust any of its parameters, the mesh is re-calculated but after that, the spline gets deselected from the Object Manager and the Attribute Manager becomes empty.
      Could it be because, for some operations ( MCOMMAND_JOIN and ID_MODELING_BRIDGE_TOOL , for example), I used a different document generated by IsolateObjects?
      Is this a normal behavior when the code generated internal new documents or am I doing something wrong?

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

        On 06/05/2015 at 23:49, xxxxxxxx wrote:

        Hi Rui,

        If objects get deselected in the active document the selection state is definitely changed in your object plugin.
        If you're performing the modeling commands in another temp document the active document is not changed.
        I think you should check carefully your object plugin code.

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

          On 08/05/2015 at 03:22, xxxxxxxx wrote:

          Found the problem.
          The IsolateObjects command deselects the objects from the document.
          If I create a new BaseDocument and manually insert the objects there, nothing gets deselected.
          Maybe there is a bug in the IsolateObjects command.

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

            On 08/05/2015 at 06:39, xxxxxxxx wrote:

            Hi Rui,

            Originally posted by xxxxxxxx

            Found the problem.
            The IsolateObjects command deselects the objects from the document.
            If I create a new BaseDocument and manually insert the objects there, nothing gets deselected.
            Maybe there is a bug in the IsolateObjects command.

            I can't confirm this issue with IsolateObjects(). I've not been able to reproduce this behavior.
            Could you post some code showing it?
            Maybe run from inside a generator plugin the behavior is different. You could in that case try to call IsolateObjects() on a clone of the active document.

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

              On 08/05/2015 at 07:06, xxxxxxxx wrote:

              Well, my code is pretty complex. Really, really complex.
              But I performed strategic returns to try to find the culprit and I always got no deselection of objects when the return was placed right before the line containing IsolateObjects.
              If the return was placed after the IsolateObjects, the other objects got deselected when my ObjectPlugin code was executed.
              After replacing all the IsolateObjects (I had four) with manual creation of documents and InsertObject commands, it works fine.

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

                On 11/05/2015 at 09:02, xxxxxxxx wrote:

                If it's fine creating your own documents and inserting objects then I'll mark this thread as solved.
                IsolateObjects() is an heavy function and is only useful when called from the UI or a command.

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