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

    How to hide object local coordinates

    Cinema 4D SDK
    python
    3
    5
    1.2k
    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.
    • kangddanK
      kangddan
      last edited by

      7b9f12b54b0c4ba56d6173ae4b89eb2.png As shown in the picture, I have hidden the selected objects in the outliner, but when I middle-click on the Null object, I can still see the local coordinate axes in the viewport and the number of selected objects in the attribute panel. Is there any way to completely hide these objects?

      import c4d
      
      doc = c4d.documents.GetActiveDocument()
      
      def hide_obj():
          doc.StartUndo()
          sel=doc.GetSelection()
      
          for obj in sel:
              doc.AddUndo(c4d.UNDOTYPE_CHANGE, obj)
              obj.ChangeNBit(c4d.NBIT_OHIDE, c4d.NBITCONTROL_SET)
      
          doc.EndUndo()
          c4d.EventAdd()
      
      if __name__ == '__main__':
          hide_obj()
      

      https://github.com/kangddan

      1 Reply Last reply Reply Quote 0
      • kangddanK
        kangddan
        last edited by

        1699083633584.jpg

        https://github.com/kangddan

        1 Reply Last reply Reply Quote 0
        • i_mazlovI
          i_mazlov
          last edited by

          Hello @kangddan ,

          Welcome to the Plugin Café forum and the Cinema 4D development community, it is great to have you with us!

          Getting Started

          Before creating your next postings, we would recommend making yourself accustomed with our Forum and Support Guidelines, as they line out details about the Maxon SDK Group support procedures. Of special importance are:

          • Support Procedures: Scope of Support: Lines out the things we will do and what we will not do.
          • Support Procedures: Confidential Data: Most questions should be accompanied by code but code cannot always be shared publicly. This section explains how to share code confidentially with Maxon.
          • Forum Structure and Features: Lines out how the forum works.
          • Structure of a Question: Lines out how to ask a good technical question. It is not mandatory to follow this exactly, but you should follow the idea of keeping things short and mentioning your primary question in a clear manner.

          About your First Question

          Depending on what's the major effect you're trying to achieve there could be some other ways for it.

          Using c4d.NBIT_OHIDE hides the objects from the object manager but does not destroy them. In other words, your cubes are still in the Onull hierarchy, so when you select Onull and all its children, you select all 4 objects.

          I don't think you can control the visibility of the axes handles through bits, because even if you use c4d.NBIT_EHIDE flag, you would still see the handles when having objects selected.

          Cheers,
          Ilia

          MAXON SDK Specialist
          developers.maxon.net

          chuanzhenC 1 Reply Last reply Reply Quote 1
          • chuanzhenC
            chuanzhen @i_mazlov
            last edited by

            @i_mazlov Is it possible to achieve the layer lock operation method by not creating a layer? It seems that the layer lock can be achieved without displaying the local coordinate axes!
            ff7c4a69-01ad-4bc3-bf44-d807d34536d6-image.png

            相信我,可以的!

            1 Reply Last reply Reply Quote 0
            • i_mazlovI
              i_mazlov
              last edited by

              @chuanzhen ,

              Sorry for the delayed answer.

              The layer.locked behavior is integrated deeply in the internal code of cinema bypassing common cinema pipelines. Unfortunately, there's no good way to imitate such behavior without using layers.

              In case you decide to proceed with the layer approach, there's an example in github repo highlighting the usage of SetLayerData() function: layer_creates_r13.py.

              Cheers,
              Ilia

              MAXON SDK Specialist
              developers.maxon.net

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