How to hide object local coordinates
-
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()
-
-
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 -
@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!
-
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