Hey @Hexbob6,
I assume because the original Redshift Shader Graph editor uses an xpresso-like editor, that could be the reason for me being unable to toggle it in a similar way to the other managers? Strange that the Redshift IPR allows me to toggle, however, although it isn't xpresso-like so perhaps that's the reason?
Yes, the legacy Redshift material graph is using GraphView, a.k.a., Xpresso. And which dialogs support this folding feature and which not is primarily guided by feasibility and efficiency reasons.
There never was an Open/Close Xpresso command in Cinema 4D as that would have been an ambiguous command since there can be dozens of Xpresso graphs in a scene. It is not an unsolvable problem, the new Node Editor has the same problem and it does solve it. But solving something like this would be more costly than throwing the four or five lines of code in there which realize the folding behavior in other dialogs.
The Thinking Particles dialog in the Xpresso window on the other hand, does not have any such restrictions, at least I see none, and simply has not been adapted for efficiency reasons, as there are A LOT of dialogs in Cinema 4D.
In any case, if you think that a feature X is missing in of our products, I would invite you to Submit Feedback in the
Share your Ideas section of our end user support.
So, to confirm, you're saying there isn't a work around for such editors if they haven't been retrofitted, either via python or otherwise?
Yes, a dialog shipped with Cinema 4D which is wrapped by a command which does not implement this behavior cannot be retrofitted by third parties. The reason for this is that the dialogs that realize things such as Node Editor, Object Manager, Xpresso Manager, etc. are not exposed in the public API. We only expose their associated commands. This is an intentional decision.
As a bonus question, do you know of a way to toggle tabbed groups of managers with an icon (and not via the folding behaviour accessed by ctrl+clicking the hamburger menu). For example, pressing the red icon could close/hide the whole of the purple area despite it consisting of 2 tabbed groups?
Hm, I do not think so. There is AFAIK not a built-in feature like that, but the appropriate place to ask this would be end user support. Wrapping two commands into one (with either a full blown plugin or just a script) is not a problem. But dialog folding is undefined for tabbed dialogs as you show it in your screenshot. You could also file a feature request here in our support center.
What you can however do, is put multiple dialogs into a layout, and write yourself either a script or plugin which cycles through them, fold/unfolding them one by one. Not exactly the same, but similar 🙂 For an example, see the end of my posting.
Cheers,
Ferdinand
Result:
![](/assets/uploads/files/1683974899734-toggle_blah.gif)
Code:
"""Cycles the folding state of dialogs associated with multiple commands.
Must be run as a Script Manager script. Could also be realized as a CommandData plugin for a fancier
solution.
"""
from typing import Optional
import c4d
# ID definitions for the timeline and node editor commands. Technically not necessary, we could also
# use the the integers directly, but makes things nicer to read.
c4d.CID_TIMELINE_MANAGER: int = 465001541
c4d.CID_NODEEDITOR_MANAGER: int = 465002211
# Define the folding group we want to create, i.e., the script will cycle through these command IDs,
# folding and unfolding dialogs associated with the command, each time it is pressed.
PID_FOLDING_GROUP: tuple[int] = (c4d.CID_TIMELINE_MANAGER, c4d.CID_NODEEDITOR_MANAGER)
# If #True, a state will be added at the end of the cycle, showing all dialogs.
SHOW_ALL_AT_END: bool = False
# If #True, a state will be added at the end of the cycle, hiding all dialogs.
HIDE_ALL_AT_END: bool = True
def GetNextCommandId() -> int | bool:
"""Determines the command ID of the next item in #PID_TOGGLE_GROUP.
"""
# Get the check state of all commands in PID_TOGGLE_GROUP.
states: list[bool] = [c4d.IsCommandChecked(pid) for pid in PID_FOLDING_GROUP]
if not any(states):
return PID_FOLDING_GROUP[0]
i: int = states.index(True)
# Everything is open
if all(states):
return False if HIDE_ALL_AT_END else 0
# The cycle has reached the end
elif i == len(PID_FOLDING_GROUP) - 1:
if SHOW_ALL_AT_END:
return True
elif HIDE_ALL_AT_END:
return False
else:
return PID_FOLDING_GROUP[0]
# Pick the next item
return PID_FOLDING_GROUP[i+1]
def main() -> None:
"""Switches the group #PID_TOGGLE_GROUP to the next state.
"""
cid: int | bool = GetNextCommandId()
for item in PID_FOLDING_GROUP:
# Show the item when it is hidden and the to be shown item or all items should be shown.
if not c4d.IsCommandChecked(item) and (cid == item or cid is True):
c4d.CallCommand(item)
# Hide the item when it is shown and not the to be shown item or all items should be hidden.
elif c4d.IsCommandChecked(item) and (cid != item or cid is False):
c4d.CallCommand(item)
if __name__ == '__main__':
main()