Objects are still not displayed after ChangeNBit is works
-
Hi Everyone!
I'm Trying to use
GeListNode.ChangeNBit(c4d.NBIT_EHIDE, c4d.NBITCONTROL_SET)
to hide some objects and save the project file and close it.
And I open the project file again and try to usingGeListNode.ChangeNBit(c4d.NBIT_EHIDE, c4d.NBITCONTROL_CLEAR)
, I find that although the code works, but the hidden objects are still not displayed in viewport.Is this a bug or something special thing happend?
This is the project file I tested, and it's already hide the 4 objects top of the OM:
show-hide_test.c4dAnd this the simple testing code for displayed them:
import c4d doc: c4d.documents.BaseDocument # The currently active document. op: c4d.BaseObject | None # The primary selected object in `doc`. Can be `None`. def main() -> None: objs = doc.GetObjects() for obj in objs: if obj.GetNBit(c4d.NBIT_EHIDE): print(obj.ChangeNBit(c4d.NBIT_EHIDE, c4d.NBITCONTROL_CLEAR)) print(obj.GetNBit(c4d.NBIT_EHIDE)) c4d.EventAdd() if __name__ == '__main__': main()
P.S: I also found that after running the test code in the above project file and saving the project, closing it and then opening it again, those hidden objects came back.
-
Hi, thanks a lot for the report, I filled a bug report.
As a workaround you can enable and disable the deform mode and it will work.
import c4d doc: c4d.documents.BaseDocument # The currently active document. op: c4d.BaseObject | None # The primary selected object in `doc`. Can be `None`. def main() -> None: objs = doc.GetObjects() for obj in objs: if obj.GetNBit(c4d.NBIT_EHIDE): print(obj.ChangeNBit(c4d.NBIT_EHIDE, c4d.NBITCONTROL_CLEAR)) print(obj.GetNBit(c4d.NBIT_EHIDE)) if obj.GetDeformMode(): obj.SetDeformMode(False) obj.SetDeformMode(True) c4d.EventAdd() if __name__ == '__main__': main()
Cheers,
Maxime. -
-
Thank you for your reply and solution!
Cheers~