Use the tab name, Open that window?
Can I use the tab name and open that window?
I want to switch the Viewports and Project Settings windows to Python.
Access to tabs in the SDK is rarely written.
Asking for help. Thank You.
Use the tab name, Open that window?
Can I use the tab name and open that window?
I want to switch the Viewports and Project Settings windows to Python.
Access to tabs in the SDK is rarely written.
Asking for help. Thank You.
Hello @ymoon,
thank you for reaching out to us. Neither the Python nor C++ Cinema 4D API do not provide control over existing/native window and dialog elements of Cinema 4D. You have only access to the things you have implemented yourself. This is an intentional decision and not a feature gap.
In the Cinema 4D API, you do not have control over the active tabs in a layout. What you can do is:
DescriptionCutomGUI
in Python, other than in C++, setting the active tab is not possible.ActiveObjectManager_SetMode
with which you can switch the mode of the Attribute Manager. It has no direct equivalent in Python, but you can emulate is functionality with this code:"""Opens the projects settings in the Attribute Manager.
"""
import c4d
def main() -> None:
"""
"""
c4d.gui.ActiveObjectManager_SetObject(
c4d.ACTIVEOBJECTMODE_DOCUMENT, # The mode to set, the document mode herel.
c4d.BaseList2D(c4d.Onull), # A dummy object which does not matter in this case,
# because there is only one relevant document node.
c4d.ACTIVEOBJECTMANAGER_SETOBJECTS_OPEN # Open a new AM if there is none open.
)
c4d.EventAdd()
if __name__ == '__main__':
main()
Cheers,
Ferdinand
PS: Please state your used version of Cinema 4D in the future when it is not the most recent one.
MAXON SDK Specialist
developers.maxon.net
@ferdinand
There is no command to invoke the viewport window, so I was looking for an alternative. I will tagging the version in the next post. (R2023) Thank You.