Data Channel Modifier Operator Classes
The Data_Channel Modifier uses operators to build its operation stack. These operators all derive from the IDataChannelEngineClass, and are of three types: input, process, and output (although some input operators can be used as process operators). This topic covers the available operator classes.
- Input Operators
- Operator_ColorElements : IDataChannelEngineClass {4bbc203f,0}
- Operator_ComponentSpace : IDataChannelEngineClass {e11aa33,0}
- Operator_Curvature : IDataChannelEngineClass {e12bb44,0}
- Operator_DeltaMush : IDataChannelEngineClass {c8b201a3,0}
- Operator_Distort : IDataChannelEngineClass {11fa2bba,0}
- Operator_EdgeInput : IDataChannelEngineClass {23300ccd,0}
- Operator_FaceInput : IDataChannelEngineClass {24421ae,0 }
- Operator_Maxscript : IDataChannelEngineClass {9acb27da,0}
- Operator_NodeInfluence : IDataChannelEngineClass {cba6531d,0}
- Operator_TensionDeform : IDataChannelEngineClass {4879315b,0}
- Operator_TransformElements : IDataChannelEngineClass {271928c8,0}
- Operator_Vector : IDataChannelEngineClass {44e12ccd,0}
- Operator_Velocity : IDataChannelEngineClass {e21bb55,0}
- Operator_VertexInput : IDataChannelEngineClass {da12aa01,0}
- Engine_Local_Space : IDataChannelEngineClass {e11aa22,0}
- Process Operators
- Operator_Invert: IDataChannelEngineClass {43aebba1,0}
- Operator_MaxscriptProcess(Maxscript Process) : IDataChannelEngineClass {bd92d5af,0}
- Operator_Normalize : IDataChannelEngineClass {62ebba1,0}
- Operator_Point3_To_Float : IDataChannelEngineClass {43cceb55,0}
- Operator_Scale : IDataChannelEngineClass {10e12bba,0}
- Operator_Smooth : IDataChannelEngineClass {93e12bba,0}
- Outputs
Input Operators
Input operators query data from the mesh and create a channel to flow down the stack.
Operator_ColorElements : IDataChannelEngineClass {4bbc203f,0}
Colors the elements of an object based on the stack information, a map, soft selection or vertex colors. Output can be randomized based on hue, luminance and saturation.
Properties:
.inputOption : integerThe color data input, where:
- 0 = Vertex Colors
- 1 = Map
- 2 = Soft Selection
- 3 = From Stack
.mapChannel : integerThe map channel, when inputOption = 1.
.map : texturemapThe map, when inputOption = 1.
.vertColorChannel : integerThe Vertex color channel, when inputOption = 0.
.colorOption : integerThe color option, where
- 0 = Face
- 1 = Element
.useColors : BooleanIndicates whether to apply colors to luminance.
.color1 : RGB colorThe luminance color 0.
.color2 : RGB colorThe luminance color 1.
.outputChannel : integerThe output VC channel.
.randomize : BooleanIndicates whether to randomize the output.
.unused1 : float.seed : integer.HRand : BooleanIndicates whether the randomizeHPercent value is used.
.SRand : BooleanIndicates whether the randomizeSPercent value is used.
.LRand : BooleanIndicates whether the randomizeLPercent value is used.
.randomizeHPercent : floatThe Hue luminance value.
.randomizeSPercent : floatThe Saturation luminance value.
.randomizeLPercent : floatThe Lightness luminance value.
.useElementCenter : booleanIndicates whether to use the element center when inputOption is 1 (Map).
Operator_ComponentSpace : IDataChannelEngineClass {e11aa33,0}
Copies the geometry’s X, Y, or Z position to the stack to be processed.
.component (Component_Space) : integer
.min : floatThe minimum value.
.max : floatThe maximum value.
.normalize : BooleanIndicates whether to normalize the values.
.space (XYZ_Space) : integerThe space dimension to use, where
- 0 = X
- 1 = Y
- 2 = Z
.node : nodeThe node from which to take the component space.
Operator_Curvature : IDataChannelEngineClass {e12bb44,0}
Uses the local surface curvature of the mesh to define a float value.
.convex (Convex) : floatThe Curvature convex value.
.flat (Flat) : floatThe Curvature flat value.
.concave (Concave) : floatThe Curvature concave value.
.scale (Scale) : floatThe scale value applied to the convex, flat, and concave values.
.hardEdgesOnly (Hard_Only) : Boolean default: FalseIndicates whether to compute hard edges only.
Operator_DeltaMush : IDataChannelEngineClass {c8b201a3,0}
Uses the mesh's default pose to smooth the mesh when it is deformed while retaining the original detail of the mesh.
.strength : float default: 1.0The strength value.
.iterations : integer default: 10The number of iterations.
.pinBorders : Boolean default: TrueIndicates whether to pin the borders.
.mask : boolean default: FalseIndicates whether to mask with vertex colors.
.maskMapChannel : integer default: 2The map channel to use, if mask is True.
.outputMode : integer default: 0The deform setting, where:
- 0 = Relaxed Base Mesh
- 1 = Relaxed
- 2 = Relaxed Delta
Operator_Distort : IDataChannelEngineClass {11fa2bba,0}
Uses a map to distort the vertex value.
Uses a map to distort the vertex value.
.map (Distort) : texturemapThe map associated with the distort.
.amountBox (Amount) : float default: 1.0The strength value applied to the distort.
.holdTex (Distort) : texturemapInternal and renamed
.holdMat (Distort) : materialInternal and renamed
Operator_EdgeInput : IDataChannelEngineClass {23300ccd,0}
Adds edge data into the stack.
.input : integerThe Edge Input mode, where:
- 0 = Selection
- 1 = Crease Weights
- 2 = Edge Angle
Operator_FaceInput : IDataChannelEngineClass {24421ae,0 }
Adds face data to the stack.
.input : integerSelects the edge input, where:
- 0 = Selection
- 1 = Material ID
- 2 = Smooth Group
- 3 = Area
- 4 = Normal
- 5 = Planarity
Operator_Maxscript : IDataChannelEngineClass {9acb27da,0}
Uses MAXScript to manipulate a channel's values. Possible return values are float or point3.
.dataType : integerThe output data type, where:
- 0 = Float
- 1 = Point3
.elementType : integerThe output element type, where:
- 0 = Vertices
- 1 = Faces
.script : stringGets or sets the MAXScript file associated with this operator.
Operator_NodeInfluence : IDataChannelEngineClass {cba6531d,0}
Returns a float value based on the distance between a selected node and a mesh vertex or a mesh element.
.node : nodeThe node associated with the operator.
.minRange : float default: 1.0The minimum Radius setting.
.minValue : float default: 1.0The minimum value setting.
.maxRange : float default: 80.0The maximum Radius setting.
.maxValue : float default: 0.0The maximum range value.
.mode : integerThe Influence mode, where:
- 0 = By Vertex
- 1 = By Element
- 2 = By Object
.hold (Hold_Frames) : integerThe hold time value.
.falloffCurve (Falloff_Curve) : maxObjectThe curve controlling the weight falloff over time. This object is of type CurveControl.
.radiusCurve (Radius_Curve) : maxObject The curve controlling radius over time. This object is of type CurveControl.
.strengthCurve (Strength_Curve) : maxObjectThe curve controlling strength over time. This object is of type CurveControl.
Operator_TensionDeform : IDataChannelEngineClass {4879315b,0}
Uses the mesh’s deformation to compute squash and stretch to define a value. These values can be used to drive morph targets within the operator.
.mode : integerThe tension deform mode, where:
- 0 = Edge Length Based
- 1 = Edge Angle Based
.enableDisplay : booleanNot used.
.deformMesh : booleanIndicates whether to deform the mesh.
.stretchColor (Stretch_Color) : colorNot used.
Stretch Adjustment Settings:
.stretch : floatThe stretch value.
.stretchRange (Stretch_Range) : floatThe stretch range
.stretchGrowShrink (Stretch_Grow_Shrink) : floatThe stretch grow/shrink value.
Stretch Deform Settings:
.stretchPush (Stretch_Push) : floatThe stretch deform push value.
.stretchRelax (Stretch_Relax) : integerThe stretch relax value.
.stretchUseMorph : booleanIndicates whether the stretch deform uses a morph target.
.stretchTarget : nodeThe node representing the stretch target.
.stretchMask : booleanIndicates whether to mask with vertex colors.
.stretchMapChannel : integerThe map channel to use for masking when stretchMask is True.
Squash Adjustment Settings:
.squashColor (Squash_Color) : colorNot used.
.squash : floatThe squash amount.
.squashRange (Squash_Range) : floatThe squash range amount.
.squashGrowShrink (Squash_Grow_Shrink) : floatThe squash grow/shrink amount.
Squash Deform Settings:
.squashPush (Squash_Push) : floatThe squash deform push amount.
.squashRelax (Squash_Relax) : integerThe squash relax value.
.squashUseMorph : booleanIndicates whether to use a morph target, indicated by the squashTarget.
.squashTarget : nodeThe squash target, used when squashUseMorph is True.
.squashMask : booleanIndicates whether to mask with vertex colors.
.squashMapChannel : integerThe map channel to use if squashMask is true.
Channel Output Settings:
.outputSquash : booleanIndicates whether to output the squash value.
.outputStretch : booleanIndicates whether to output the stretch value.
Operator_TransformElements : IDataChannelEngineClass {271928c8,0}
Uses channel information from the data channel’s operator stack, soft selection or vertex color to transform the elements’ position, rotation or scale.
.inputChannel : integer default 0Gets or sets the input channel, where:
- 0 = From Stack
- 1 = Soft Selection
- 2 = Vertex Color Luminance
- 3 = Vertex Color as XYZ
- 4 = None
.transformType : integer default: 3The transform type, where:
- 0 = Position
- 2 = Rotation
- 3 = Scale %
- 4 = Scale % Uniform
Offsets Settings
.XEnable : boolean
.YEnable : boolean
.ZEnable : booleanIndicates whether the x, y, or z offsets are enabled.
.xoffset1 (XOffset) : float
.yoffset1 (YOffset) : float
.zoffset1 (ZOffset) : floatThe minimum x, y or z offset.
.xoffset2 (XOffset) : float
.yoffset2 (YOffset) : float
.zoffset2 (ZOffset) : floatThe maximum x, y, or z offset.
Point at Node Settings
.pointAtNode : booleanIndicates whether to point at a node.
.pointNode : node The node to point to, if pointAtNode is true.
.axisMode : integer The axis mode, where:
- 0=X
- 1=Y
- 2=Z
.pointElements : boolean Indicates whether to point at individual elements.
Randomize Settings
.randomize : booleanIndicates whether to randomize the data.
.randomize1 (RandomizePercent) : float
.randomize2 (RandomizePercent) : floatThe minimum and maximum randomize settings.
.seed : integer The randomization seed.
.phase : float Controls the speed of the animation of the randomization function.
Operator_Vector : IDataChannelEngineClass {44e12ccd,0}
Allows you to combine an external vector with the stack data.
.space : integer
.dir : integer
.node : node
.x : float
.y : float
.z : float
Operator_Velocity : IDataChannelEngineClass {e21bb55,0}
Uses the mesh's velocity to return a Point3, where the (x,y,z) equates to the motion of the three axes.
.timeOffset (Time_Offset) : integer
.worldSpace (World_Space) : boolean
.noTranslation (No_Translation) : boolean
Operator_VertexInput : IDataChannelEngineClass {da12aa01,0}
Uses channel information from the mesh as an input. Channels include, existing map channels, average normal, vertex position and vertex selection values.
.input (Channel) : integer The input type, where:
- 0=Position
- 1=Average Normals
- 2=Map Channel 1
- 3=Map Channel 2
- 4=Vertex Selection
- 5+ = any additional populated data channels
.internal (Channel_Num) : integer Internal use only, do no use.
.XYZ (Sub_Channel_Num) : integer Indicates the axes to include in the data, where:
- 0=XYZ
- 1=X
- 2=Y
- 3=Z
.deprecated (Name) : string Deprecated, do not use.
Engine_Local_Space : IDataChannelEngineClass {e11aa22,0}
Copies the geometry's position on to the stack to be processed.
.min : float
.max : float The minimum and maximum values to use.
.normalize : boolean Indicates whether to normalize the data.
.space (XYZ_Space) : integer The reference coordinate system to use, where:
- 0=Local
- 1=World
- 2=Node
.node : node The node to use for the coordinate system, when space = 2.
Process Operators
Process operators modify data by applying operations to the data flowing through the stack.
Operator_Clamp: IDataChannelEngineClass {20e12bba,0}
Limits the value of channel flowing through the stack.
.clampMin (Min) : float
.clampMax (Max) : float Minimum and maximum clamp values.
Operator_ConvertToSubObjectType : IDataChannelEngineClass {ac311ccd,0}
Copies the data from one sub object type to another.
.subObject : integer The sub object type to convert to, which corresponds to the selected item position in the Convert To dropdown in the UI, and which depends on the incoming data type. For example, when the incoming data is from the vertex channel, 0 = Edge and 1 = Face.
.vertex : integer When the Convert To target is vertex, this corresponds to the Vertex Channel Type selection, where:
- 0=Position
- 1=Normal
- 2=Map
.mapChan : integer When vertex=2 (Map), this indicates the map channel.
Operator_Curve : IDataChannelEngineClass {73e12bba,0}
Remaps the value of data in the channel based on a curve.
.curve : maxObject The curve object.
.normalize (Normalize) : boolean Engine_Decay (const MAXClass): decay Indicates whether the curve is normalized.
Operator_Decay : IDataChannelEngineClass {10fa2cc9,0}
Causes the changes in a channel to persist or decay over time.
Properties:
.decay : float The decay per frame.
.samples : integer The number of record samples.
.smooth : boolean Indicates whether to apply smoothing.
.iterations : integer The number of smoothing iterations, if smooth=true.
.deprecated (Max_Crossing) : integer Deprecated, do not use.
.curve : maxObject The custom decay curve.
.useCurve (Use_Curve) : boolean Indicates whether to apply a custom decay curve.
.resetType : integer The Cache reset type where:
- 0 = "Use Frame For Reset Data"
- 1 = "Reset Data To Zero"
.resetFrame (Reset_Frame) : integer The reset frame, when resetType = 0, "Use Frame For Reset Data".
Interfaces:
DecayProvides access to the Reset() and Record() methods.
Operator_GeoQuantize : IDataChannelEngineClass {1d9111c5,0}
Modifies the data based on geometry so that all vertices in an element share the same value.
.mode : integer The data source, where:
- 0=By Vertex
- 1=By Element
- 2=By Object
Operator_Invert: IDataChannelEngineClass {43aebba1,0}
Inverts the values in the data channel.
.invert (Invert) : boolean Indicates whether to perform an inversion.
Operator_MaxscriptProcess(Maxscript Process) : IDataChannelEngineClass {bd92d5af,0}
This operator provides a way to manipulate mesh channel data using MAXScript, and is useful for performing manipulations not provided by other operators.
Overview
Whenever the Data Channel modifier is processing an object, the MAXScript Process operator will have its "Process" function called with arguments reflecting the data available for processing as well as the desired output options. The function format is:
on Process theNode theMesh inputElementType inputIndexChannel inputDataType inputData outputElementType outputIndexChannel outputDataType outputArray theTime do ( return 1 –- 1 == success; 0 = failure )The arguments are:
theNode: The node containing the object being processed
theMesh: The poly mesh being processed
inputElementType: The element type being processed. This is determined by the preceding operator’s output. The types are:
1: Vertex 2: Edge 3: Face 4: None 5: Don’t Care
inputIndexChannel: The index channel of the data being processed. This is determined by the preceding operator’s output. The types are:
1: None 2: Position 3: Normal 4: Map Channel
inputDataType: The data type of the data being processed. This is determined by the preceding operator’s output. The types are:
1: Integer 2: Float 3: Point3 4: Matrix3 5: Integer Array 6: Float Array 7: Point3 Array 8: Matrix3 Array
inputData: The input data, matching the inputDataType, also determined by the preceding operator’s output. For example, if the inputDataType is 7, the inputData will be a Point3 array.
outputElementType: The element type of the output data to be produced by the script. This is determined by the "Output" group’s "Element Type" selection in the user interface, and the values are the same as for the inputElementType, above.
outputIndexChannel: The index channel of the output data to be produced by the script. This is determined by the "Output" group’s "Index Channel" selection in the user interface, and the values are the same as for the inputIndexChannel, above.
outputDataType: The data type for the output to be produced by the script. . This is determined by the "Output" group’s "Data Type" selection in the user interface, and the values are the same as for the inputDataType, above.
outputArray: The array containing the output data. The array type must match the outputDataType and should be the appropriate length, based on the inputElementType (for example, if the element type is Vertex, the array should contain a value for each vertex in the mesh.)
theTime: The time at which the evaluation is happening.
Default Script
The default script contained in the operator provides a simple example of processing. To try it out:create a Box and apply a Data Channel Modifier.
In the Data Channel modifier UI, add the following operators, in this order, then close the Add Operators dialog:
- Vertex Input
- Maxscript Process
- Vertex Output
Select the Maxscript Process operator and set the Output options to the following:
- Element Type: Vertices
- Index Channel: Position
- Data Type: Point3 Array
Now move the time slider back and forth. You will see the box moving along the X axis, with the X values increasing and decreasing in sync with the time slider position.
If you open the Listener, you will see some output from the script, which is printing the various values.
Properties
.script : stringGets/sets the script string. A default script is provided that processes channel data as an example.
.outputElementType : integerThe type of data the script should output, where:
- 0 = vertices
- 1 = edges
- 2 = faces
- 3 = none
- 4 = don't care
.outputDataType : integerThe type of data the script will produce, where:
- 0 = int
- 1 = float
- 2 = Point3
- 3 = Matrix3
- 4 = int array
- 5 = float array
- 6 = Point3 array
- 7 = Matrix3 array
.outputIndexChannel : integerThe channel for the output data, if any, where:
- 0 = None
- 1 = Position
- 2 = Normal
- 3 = Map Channel
Operator_Normalize : IDataChannelEngineClass {62ebba1,0}
Normalizes the values in a channel to a range.
.normalizeMin (Min) : float
.normalizeMax (Max) : float The minimum and maximum values to normalize to.
.rangeOverride (Use_Range) : booleanIndicates whether to limit normalization to values in a range.
.rangeMin (Min_Range) : float
.rangeMax (Max_Range) : floatThe range minimum and maximum to limit normalization to, if rangeOverride is true.
Operator_Point3_To_Float : IDataChannelEngineClass {43cceb55,0}
Converts a Point3 channel to a float channel.
.floatType (Point3_To_Float) : integerThe type of float to convert to, where:
- 0=Length
- 1=X
- 2=Y
- 3=Z
Operator_Scale : IDataChannelEngineClass {10e12bba,0}
Multiplies a channel by a value.
.scale : floatThe factor by which to scale the channel data.
Operator_Smooth : IDataChannelEngineClass {93e12bba,0}
Smooths the values of a channel based on their neighbor's value.
.iteration : integerThe number of smoothing iterations.
.amount : floatThe smoothing amount to apply.
.deprecated (Geom) : booleanDeprecated parameter, do not use.
Outputs
Output operators output the stack data back to the mesh.
Operator_VertexOutput : IDataChannelEngineClass {abcdaa33,0}
Outputs the stack data to a specific geometry channel in the mesh.
.output (Channel) : integerThe output data type, where:
- 0=Position
- 1=Vertex Color
- 2=Map Channel
- 3=Normals
- 4=Vertex Selection
- 5=Vertex Crease
- 6=VData
.channelNum (Channel_Num) : integerWhen the output type is Map Channel or VData, this is the Channel Number.
.XYZ (Sub_Map_Channel) : integerThe X, Y, or Z setting, when the output type is Position, Vertex Color, Map Channel, or Normals, where:
- 0=X
- 1=Y
- 2=Z
.deprecated (Channel_Name) : stringDeprecated parameter, do not use.
.replace (Replace_Type) : integerThe replacement method, where:
- 0=Replace
- 1=Add
- 2=Subtract
- 3=Multiply
Operator_FaceOutput : IDataChannelEngineClass {323fa2e,0}
Outputs the stack face data to the mesh.
.output : integerThe data type to output where:
- 0=Selection
- 1=Material ID
- 2=Smoothing Group
.type : integerThe type of output operation, where:
- 0=Replace
- 1=Add
- 2=Subtract
- 3=Multiply
Operator_EdgeOutput : IDataChannelEngineClass {111aa3d,0}
Outputs the stack edge data to the mesh.
.output : integerThe data type to output where:
- 0=Selection
- 1=Crease Weights
.type : integerThe type of output operation, where:
- 0=Replace
- 1=Add
- 2=Subtract
- 3=Multiply
