Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Retrieve GvNodeMaster from Xpresso Editor/Manager

    Cinema 4D SDK
    python 2023
    2
    3
    582
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      Thodos
      last edited by

      Hi!
      Is it possible to retrieve GvNodeMaster from Xpresso BasePlugin?
      I've checked Python API and it looks like there's no way of doing it.
      But given the behaviour of Xpresso Editor and how it's Created - Xpresso window definitely knows what NodeMaster it has.
      A solution for that would be much appreciated!

      P.S. I'm using Python API that needs to know NodeMaster of the opened editor window in order for it to work correctly and seamlessly.

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @Thodos
        last edited by ferdinand

        Hello @Thodos,

        Welcome to the Plugin Café forum and the Cinema 4D development community, it is great to have you with us!

        Getting Started

        Before creating your next postings, we would recommend making yourself accustomed with our Forum and Support Guidelines, as they line out details about the Maxon SDK Group support procedures. Of special importance are:

        • Support Procedures: Scope of Support: Lines out the things we will do and what we will not do.
        • Support Procedures: Confidential Data: Most questions should be accompanied by code but code cannot always be shared publicly. This section explains how to share code confidentially with Maxon.
        • Forum Structure and Features: Lines out how the forum works.
        • Structure of a Question: Lines out how to ask a good technical question. It is not mandatory to follow this exactly, but you should follow the idea of keeping things short and mentioning your primary question in a clear manner.

        About your First Question

        Okay, there seem to be some misconceptions here:

        1. A c4d.plugins.BasePlugin represents a registered plugin hook, e.g., the MyObjectPluginData hook with the ID 123456789. For the example case, the BasePlugin node is neither a representation of a MyObjectPluginData instance nor a BaseObject instance representing such MyObjectPluginData instance. BasePlugin is just a bundle of metadata so that one can browse the installed plugins in a Cinema 4D instance.
        2. We do not expose the UIs of Cinema 4D in the API, something like 'need[ing] to know the opened editor window' is not possible. You do not have access to dialogs.
        3. A GraphView node graph is attached as a branch to a scene element. In the case of the Xpresso tag there are convenience functions and types to access that graph like XPressoTag.GetNodeMaster and GvNodeMaster. But you can always access the GraphView branch via normal branching, I have used that for eaxample recently here in the function IterRsGraphGraphs in that example code.
        4. The GraphView dialog is non-public and you cannot access the information of which graph it is currently displaying. But you can get the active master node with c4d.modules.graphview.GetMaster(id). That limits your access to native Xpresso graphs and excludes for example render engine material graphs.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        T 1 Reply Last reply Reply Quote 1
        • T
          Thodos @ferdinand
          last edited by

          Hello @ferdinand !
          Thank you for such a fast reply!
          Looks like c4d.modules.graphview.GetMaster(0) does the trick, I was confused at first about "id" in the arguments, but looks like 0 really gives the current active GvNodeMaster!

          Cheers,
          Max.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post