Retrieve GvNodeMaster from Xpresso Editor/Manager
-
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.
-
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:
- A c4d.plugins.BasePlugin represents a registered plugin hook, e.g., the
MyObjectPluginData
hook with the ID123456789
. For the example case, theBasePlugin
node is neither a representation of aMyObjectPluginData
instance nor aBaseObject
instance representing suchMyObjectPluginData
instance.BasePlugin
is just a bundle of metadata so that one can browse the installed plugins in a Cinema 4D instance. - 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.
- A
GraphView
node graph is attached as a branch to a scene element. In the case of theXpresso
tag there are convenience functions and types to access that graph likeXPressoTag.GetNodeMaster
andGvNodeMaster
. But you can always access theGraphView
branch via normal branching, I have used that for eaxample recently here in the functionIterRsGraphGraphs
in that example code. - 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 -
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.