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

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:
Returns:

All Nodes inside the material

Return type:

List of Node

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

RemoveShader(node)[source]

Remove a shader inside the material.

Parameters:node (Node) – Tee node object to remove.
Returns:True if delete overthiwe False.
Return type:Bool
SetMat(mat)[source]

Set the mat to act on.

Parameters:mat (c4d.BaseMaterial.) – The material to act on. Only accept a Redshift Material.
Raises:TypeError