RedshiftWrapper.Redshift module¶
-
class
RedshiftWrapper.
Redshift
[source]¶ Bases:
RedshiftWrapper.MetaName
The main wrapper arround Redshift API.
Member doUndo: (Bool) True if the wrapper have to call GvMaster.AddUndo() before any change otherwise False. Member _mat: (c4d.BaseMaterial) The redshift material we act on. Member _gvMaster: (c4d.modules.graphview.GvNodeMaster) The Node master of self.mat. -
CreateConnection
(SrcNode, DestNode, SrcParameter=None, DestParameter=None)[source]¶ Connect two Nodes together.
Parameters: - SrcNode (
Node
or c4d.modules.graphview.GvPort) – The source Node (The one with an output) or GvPort of the source Node returned by Node.ExposeParameter or Node.SearchPort - DestNode (
Node
or c4d.modules.graphview.GvPort) – The destination Node (The one with an input) or GvPort of the destination Node returned by Node.ExposeParameter or Node.SearchPort - SrcParameter (int or str) – Id of the source GvPort (not the ID of the parameter) or the name of the source GvPort PARAMETER WILL BE IGNORED IF GvPORT IS USED IN SrcNode !!!
- DestParameter (int or str) – Id of the destination GvPort (not the ID of the parameter) or the name of the destination GvPort PARAMETER WILL BE IGNORED IF GvPORT IS USED IN DestNode !!!
Returns: True if connection is created overthiwe False
Return type: Bool
- SrcNode (
-
CreateMaterial
(MatType=1000)[source]¶ Create a new redshift material.
Parameters: MatType (int) – The type of the Redshift shader (from 1001, Material to 1010 Volume) Returns: Created material or None if it’s fail Return type: c4d.Material or None.
-
CreateShader
(shaderType, x=-1, y=-1, NodeBefore=None)[source]¶ Create a shader inside the material.
Parameters: - shaderType (Int or Str.) – Int (a Cinema 4D Node look at https://developers.maxon.net/docs/Cinema4DPythonSDK/html/types/gvnodes.html) or a Redshift Node member loot at
MetaclassName
. - x (int) – X position in the Xpresso windows.
- y (int) – Y position in the Xpresso windows.
- NodeBefore (
Node
or c4d.modules.graphview.GvNode) – The node to insert before (Change execution order !!)
Returns: All Nodes inside the material
Return type: List of
Node
- shaderType (Int or Str.) – Int (a Cinema 4D Node look at https://developers.maxon.net/docs/Cinema4DPythonSDK/html/types/gvnodes.html) or a Redshift Node member loot at
-
GetAllNodes
(removeMasterGroup=True, gvNode=None, nodeList=None)[source]¶ Get all nodes inside the material. Use redshift.GatAllNodes(), only removeMasterGroup is needed other parameters are for internal use.
Parameters: removeMasterGroup (Bool.) – True to remove the Shader Group that hold all other Node otherwise false. Returns: All Nodes inside the material. Return type: List of Node
-
RemoveConnection
(port, node=None, portType=None)[source]¶ Disconnect all connection from a given port of Nodes.
Parameters: - port (int, str or c4d.modules.graphview.GvPort) – Id of the GvPort (not the ID of the parameter), Name of the GvPort or The GvPort of the Node returned by Node.ExposeParameter or Node.SearchPort
- node (
Node
) – The Node that host the GvPort who want to remove connection PARAMETER WILL BE IGNORED IF GvPORT IS USED IN port !!! - portType (int) – GV_PORT_INPUT or GV_PORT_OUTPUT PARAMETER WILL BE IGNORED IF GvPORT IS USED IN port !!!
Returns: True if connection is created overthiwe False
Return type: Bool
-