PyElementManagerInterface Class Reference

#include <py_element_manager.h>

Inheritance diagram for PyElementManagerInterface:

Detailed Description

Manage Python Elements representing various python elements available in Cinema 4D. Provides a unified way of dealing with any python elements regardless of their implementation.

Public Member Functions

MAXON_METHOD Result< void > EmbeddedElementAdded (PythonElementEmbeddedRef pyElem)
 
MAXON_METHOD Result< void > EmbeddedElementRemoved (PythonElementEmbeddedRef pyElem)
 
MAXON_METHOD Result< void > ScriptElementAdded (PythonElementBaseRef pyElem, PythonElementBaseRef parent=PythonElementBaseRef::DefaultValue())
 
MAXON_METHOD Result< void > ScriptElementRemoved (PythonElementBaseRef pyElem)
 
MAXON_METHOD Result< Opt< PythonElementBaseRef > > FindPyElementByPath (const String path) const
 
MAXON_METHOD Result< Opt< PythonElementBaseRef > > FindPyElementByBaseList2D (const BaseList2D *obj) const
 
MAXON_METHOD PythonElementBaseRef GetRoot () const
 
MAXON_METHOD WeakRef< PythonElementBaseRef > GetScriptsRoot () const
 
MAXON_METHOD WeakRef< PythonElementBaseRef > GetEmbeddedRoot () const
 
 MAXON_OBSERVABLE (void, ObservableNewEmbeddedElement,(PythonElementEmbeddedRef bl2D), ObservableCombinerRunAllComponent)
 
 MAXON_OBSERVABLE (void, ObservableDeletedEmbeddedElement,(PythonElementEmbeddedRef bl2D), ObservableCombinerRunAllComponent)
 
 MAXON_OBSERVABLE (void, ObservableNewScriptElement,(PythonElementScriptRef bl2D), ObservableCombinerRunAllComponent)
 
 MAXON_OBSERVABLE (void, ObservableDeletedScriptElement,(PythonElementScriptRef bl2D), ObservableCombinerRunAllComponent)
 

Private Member Functions

 MAXON_INTERFACE (PyElementManagerInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interfaces.py_element_manager")
 

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( PyElementManagerInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.interfaces.py_element_manager"   
)
private

◆ EmbeddedElementAdded()

MAXON_METHOD Result<void> EmbeddedElementAdded ( PythonElementEmbeddedRef  pyElem)

Notify a new object being created and triggers ObservableNewEmbeddedElement after it is inserted in the tree.

Parameters
[in]pyElemThe Python Embedded Element to add into the tree.

◆ EmbeddedElementRemoved()

MAXON_METHOD Result<void> EmbeddedElementRemoved ( PythonElementEmbeddedRef  pyElem)

Notify a python object being deleted and triggers ObservableDeletedEmbeddedElement before it is removed from the tree.

Parameters
[in]pyElemThe Python Embedded Element to add to the tree.

◆ ScriptElementAdded()

MAXON_METHOD Result<void> ScriptElementAdded ( PythonElementBaseRef  pyElem,
PythonElementBaseRef  parent = PythonElementBaseRef::DefaultValue() 
)

Notify a python script being created and triggers ObservableNewScriptElement after it is inserted in the tree.

Parameters
[in]pyElemThe Python Script Element to add into the tree.
[in]parentAn optional parent from the tree for the new Python Script Element added.

◆ ScriptElementRemoved()

MAXON_METHOD Result<void> ScriptElementRemoved ( PythonElementBaseRef  pyElem)

Notify a python script being deleted and triggers ObservableDeletedScriptElement before it is removed from the tree.

Parameters
[in]pyElemThe Python Script Element to add to the tree.

◆ FindPyElementByPath()

MAXON_METHOD Result<Opt<PythonElementBaseRef> > FindPyElementByPath ( const String  path) const

Find a given Python Element, from a Path (can be a file path, or an URL with a c4dfs scheme)

Parameters
[in]pathThe path to search for. @retun An optional Python Element if found.

◆ FindPyElementByBaseList2D()

MAXON_METHOD Result<Opt<PythonElementBaseRef> > FindPyElementByBaseList2D ( const BaseList2D obj) const

Find a given Python Embedded Element, from a given BaseList2D (can be a ScriptObject, or a regular Python object, like the Python Generator

Parameters
[in]objThe BaseList2D to search in the tree. @retun An optional Python Embedded Element if found.

◆ GetRoot()

MAXON_METHOD PythonElementBaseRef GetRoot ( ) const

Retrieves the root of the tree, there is always a root. This root contains 2 children PythonElementBasRef, Scripts and Embedded. @retun The root of all Python Elements.

◆ GetScriptsRoot()

MAXON_METHOD WeakRef<PythonElementBaseRef> GetScriptsRoot ( ) const

Retrieves the root of the tree containing all Python Element representing a Script in the Script Manager. @retun The Script root of all Python Script Elements.

◆ GetEmbeddedRoot()

MAXON_METHOD WeakRef<PythonElementBaseRef> GetEmbeddedRoot ( ) const

Retrieves the root of the tree containing all Python Embedded representing an object in the scene containing some python. @retun The Script root of all Python Embedded Elements.

◆ MAXON_OBSERVABLE() [1/4]

MAXON_OBSERVABLE ( void  ,
ObservableNewEmbeddedElement  ,
(PythonElementEmbeddedRef bl2D)  ,
ObservableCombinerRunAllComponent   
)

Fired when EmbeddedElementAdded() is called once the python element is inserted into the tree.

◆ MAXON_OBSERVABLE() [2/4]

MAXON_OBSERVABLE ( void  ,
ObservableDeletedEmbeddedElement  ,
(PythonElementEmbeddedRef bl2D)  ,
ObservableCombinerRunAllComponent   
)

Fired when NewBaseList2DAdded() is called before the python element is deleted from the tree.

◆ MAXON_OBSERVABLE() [3/4]

MAXON_OBSERVABLE ( void  ,
ObservableNewScriptElement  ,
(PythonElementScriptRef bl2D)  ,
ObservableCombinerRunAllComponent   
)

Fired when ScriptElementAdded() is called once the python script is inserted into the tree.

◆ MAXON_OBSERVABLE() [4/4]

MAXON_OBSERVABLE ( void  ,
ObservableDeletedScriptElement  ,
(PythonElementScriptRef bl2D)  ,
ObservableCombinerRunAllComponent   
)

Fired when ScriptElementRemoved() is called before the python script is deleted from the tree.