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

    get Object Visible when is it active [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    8 Posts 0 Posters 751 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 11/01/2015 at 04:12, xxxxxxxx wrote:

      Hey

      is there a way to make sure that a object plugin  is visible when is it selected - and after that back to the original visibility

      Thanks

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

        On 11/01/2015 at 09:06, xxxxxxxx wrote:

        Hi Conner,
        not sure, but do you mean like activating "Viewport Solo Single" and "Viewport Solo Selection"?

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

          On 11/01/2015 at 10:26, xxxxxxxx wrote:

          By selecting the Objekt in the Objekt manager - i like to make it visible even when parent objects are hidden in the editor

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

            On 13/01/2015 at 01:58, xxxxxxxx wrote:

            Just to make sure, I'm not searching into the wrong direction, are we talking about arbitrary objects here? Or to you want to achieve this behavior only for objects created by your own object plugin?

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

              On 13/01/2015 at 03:03, xxxxxxxx wrote:

              Primary I like to achieve this for my own Object from my object plugin.

              Secondary it will be a nice option to achieve this behavior for all children of my Object

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

                On 15/01/2015 at 04:35, xxxxxxxx wrote:

                Hi,

                I did some research on this.
                You have several options to achieve this for your own object.
                Both the GetVirtualObjects() as well as the Execute() function of your ObjectData plugin get called on selection changes. You can check the BIT_ACTIVE and based on that call SetEditorMode() accordingly.

                Just be careful, to make this behavior clearly understandable for your user. He should have an option to turn off such functionality. Otherwise he may get confused, as he might set the visibility of the object manually and may wonder, why it gets overridden.

                For arbitrary objects you can basically use the same techniques, but would implement them in a SceneHookData plugin.
                Sorry, I keep forgetting, I'm in the Python subform... So for arbitrary objects you'd use a SceneHookData plugin and the same techniques described above, if you were writing it in C++. As you try to do it in Python, you unfortunately have no SceneHook. So I don't think, this is possible to do in Python. Sorry.

                I hope, this helps.

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

                  On 11/03/2015 at 12:02, xxxxxxxx wrote:

                  Just want to ask, if my answer helped and if you made progress with your project?

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

                    On 11/03/2015 at 12:05, xxxxxxxx wrote:

                    Hey Andreas,

                    Yes absolut - not the beautiful solution but in this case it work.

                    def GetVirtualObjects(self, op, hh) :
                            if op.GetBit(c4d.BIT_ACTIVE) == True:
                                op.SetEditorMode(c4d.MODE_ON)            
                            else:
                                op.SetEditorMode(c4d.MODE_UNDEF)
                            return None
                      
                    
                    
                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post