Access Object Manager Fold and Unfold?
-
Hi,
I'm trying to create a shortcut for folding and unfolding the object manager. Is this possible in the API?
You can check the post here for reference. The first post will do.
https://www.cineversity.com/forums/viewthread/3436/Thank you
-
Hi depending what you really want to do there is multiple ways for doing it.
import c4d def Unfold(obj): obj.ChangeNBit(c4d.NBIT_OM1_FOLD, c4d.NBITCONTROL_SET) obj.ChangeNBit(c4d.NBIT_OM2_FOLD, c4d.NBITCONTROL_SET) obj.ChangeNBit(c4d.NBIT_OM3_FOLD, c4d.NBITCONTROL_SET) obj.ChangeNBit(c4d.NBIT_OM4_FOLD, c4d.NBITCONTROL_SET) def Fold(obj): obj.ChangeNBit(c4d.NBIT_OM1_FOLD, c4d.NBITCONTROL_CLEAR) obj.ChangeNBit(c4d.NBIT_OM2_FOLD, c4d.NBITCONTROL_CLEAR) obj.ChangeNBit(c4d.NBIT_OM3_FOLD, c4d.NBITCONTROL_CLEAR) obj.ChangeNBit(c4d.NBIT_OM4_FOLD, c4d.NBITCONTROL_CLEAR) def FoldSelected(): c4d.CallCommand(100004803) # Fold Selected def UnfoldSelected(): c4d.CallCommand(100004802) # Unfold Selected def FoldAll(): c4d.CallCommand(100004749) # Fold All def UnfoldAll(): c4d.CallCommand(100004748) # Unfold All # Main function def main(): FoldAll() c4d.EventAdd() # Execute main() if __name__=='__main__': main()
Note: That Un/Fold Selected/All are commands already available.
If you have any question, let me know.
Cheers,
Maxime. -
@m_adam said in Access Object Manager Fold and Unfold?:
c4d.CallCommand(100004803)
Thanks for the response. Sorry for the confusion, but I'm not after the folding/unfolding of an object but the whole manager.
Here is a video posted in the link above for illustration:
https://www.dropbox.com/s/kt0oeez7q6kfwjr/c4d101_toggle_panels_manager.mp4?dl=0As stated in the link above,
"The software is in Maya. It allows me to hide and unhide the outliner (object manager in C4D).
It’s helpful since I can hide panel/manager that occupies space."The software is in Maya. It allows me to hide and unhide the outliner (object manager in C4D). It’s helpful since I can hide panel/manager that occupies space.The alternative is layouts. The problem is when I have to update the buttons (add or remove), I have to adjust it to other layouts. It’s a bit cumbersome by then.
I’d prefer the toggle/collapse panels instead.
Is this possible?"
Thank you
-
You don't need a script for that. When in the Object Manager, look at the menu (File/Edit/View...). There is this point pattern to the left of it that contains the window menu.
Ctrl-leftclick on it, and it folds into a neat bar. Click the point pattern of this bar to unfold the OM again.
I am not aware of a keyboard shortcut for that functionality - and I doubt it would make sense since you need to specify the window to fold anyway, which is done by clicking in this case (thereby pointing the mouse at the desired window).
(You also don't have any window functions in the API, so you couldn't write a script even if you would be content with having as many keyboard shortcuts as possible Object Managers, which IMHO is awkward.)
-
Hi Bentraje, thanks for reaching out us.
With regard to your request, I confirm that it's not possible to programmatically fold/unfold a generic manager being the API involved in controlling the managers' behavior not exposed. In addition, being possible to open multiple managers (of the same or of a different type) at the same time it's currently impossible to identify on which windows to execute the fold/unfold task.
Best, Riccardo
-
Thanks for confirmation @Cairyn and @r_gigante
Sorry for being picky. Just had some muscle memory from other softwares that wanted to port to C4D.
Anyhow, will settle for the Ctrl+LMB as specified by @CairynThanks again have a great day ahead!