Please excuse me, but I am still struggling with understanding what is going on here. This could be simply because I am not the most proficient Cinema 4D user and are not aware of all end-user functionalities.
The context-menu you are opening in your screen cast (thanks for sharing it, always helps a lot), is that a modified or built-in context menu of Cinema 4D or is that a plugin of yours? I cannot find anything in
2023.1.3 what would exactly resemble it.
When I open the "standard" context menu for an object in the object manager, I cannot reproduce your behaviour.
In case it is your code which is running there, and you simply want know if the Material Manager is already open, your should check out c4d.IsCommandChecked(id), when it returns
True, then the command is "checked", which in case of the foldable managers as the Asset Browser, Material Manager, Coordinate Manager, etc., means that they are unfolded. When you then invoke
CallCommand on an already opened manager, it will close the manager. I used this for example in the Python Asset API examples to open the Asset Browser when it is not already open.
If that is not the problem, I will have to ask for more information:
- Which exact version are you using?
- Is the context menu you show part of a default installation?
- If so, how do you invoke it?
- Anything else noteworthy? Because as you see from my screen cast, just creating two node materials from Object Manager does not result in the same behavior.
When this is about native features (and not a plugin or script), this would be also more a bug report for our Support Center.