Close

Experimental:Math Combine POP

Summary

The Math Combine POP can do numerous math operations in one node, and is an expansion of the more elementary Math POP and Math Mix POP:

In addition to what Math Mix does:

  • On the New page it lets you create new attributes with constant values, with more control over type and size, usable in the Combine page and output directly unless you delete them on the Output page.
  • On the Pre page it has a set of pre-process blocks where you operate on one attribute per block, similar to the Math POP.
  • On the Post page it has a set of post-process blocks after the Combine page, operating on one attribute at a time again, with re-ranging.
  • On the Output page it gives more control over keeping or deleting temporary attributes.

Handling Inputs: Math Combine handles inputs differently than Math Mix: In the Math Combine POP you explicitly select the attributes from all the inputs, you can rename them, and these selected attributes go to the output (unless you delete them on the output page). Math Mix POP auto-names all the inputs’ attributes (in2_Tex for example), but the attributes don’t go to the output except for the first input's attributes. Math Combine POP treats inputs the same way as the Attribute Combine POP, which essentially hides which POPs the attributes come from. Note that anything you select on the Inputs page does not copy the attribute data - it remains as all references to attribute arrays in the incoming POPs.

The difference between the Uniforms page an the New page: The New pages creates a full array of data, one per point constant value per point, and it is output from the POP like any attribute. Uniforms are named constant values that does not create any new data and is not output from the POP.

The Pre page and Post page (similar to the Math POP) are sequential blocks that operate on one parameter per block, with these parameters:

  • Scope - which attribute to operate on
  • Parameter Size (default 1) (Parameter Size means how many sets of parameters, like Parameter Size of 3 will present a set of parameters for each of X, Y and Z.
  • Pre page has:
    • Order menu (Add Multiply Op, Multiply Add Op, Op Add Multiply, Op Add Multiply)
    • Multiply float
    • Add float
    • Operation - all the unary operations of the Combine page
  • Post page has:
    • Re-ranging parameters
    • casting to integers, doubles, floats
  • Quantize - rounding and also logic operations (> 0, == 0, …)
  • Result Scope (in which attribute to put the result, whether it is an existing set of components or a new attribute)

Output page:

  • Delete Attributes - which ones to delete from the output
  • Delete New Attributes toggle
  • Output Secondary Attributes - outputs ones created in the POP

Note that on the Common page you can select to output only the attributes that were affected in the POP, useful for cases where you want to output one attribute per POP.

Note the pop-up info contains pseudocode of the operations in this POP, for easier reading.

Attaching an Info DAT will show you raw GLSL code that is generated.

PythonIcon.pngmathcombinePOP_Class


Parameters - Inputs Page

Attribute Class attribclass - -
  • Point point -
  • Vertex vertex -
  • Primitive primitive -

Length Mismatch lengthmismatchnotif - -
  • Ignore ignore -
  • Warning warning -
  • Error error -

Length Mismatch Action lengthmismatchaction - -
  • Hold hold -
  • Repeat repeat -
  • Zero zero -
  • One one -
  • None none -

Group group -

Input input -

In POP input0pop -

In Attributes input0attrs - -
  • * * -

Rename to input0renameto -


Parameters - Uniforms Page

Vector vec -

Name vec0name -

Type vec0type - -
  • float float -
  • float2 float2 -
  • float3 float3 -
  • float4 float4 -
  • double double -
  • double2 double2 -
  • double3 double3 -
  • double4 double4 -
  • int int -
  • int2 int2 -
  • int3 int3 -
  • int4 int4 -
  • uint uint -
  • uint2 uint2 -
  • uint3 uint3 -
  • uint4 uint4 -

Value vec0value - -
  • Value vec0value0 -
  • Value vec0value1 -
  • Value vec0value2 -
  • Value vec0value3 -


Parameters - New Page

New Attribute attr -

Name attr0name - -
  • Custom custom -
  • N n -
  • Color color -
  • Tex tex -
  • PointScale pointscale -
  • LineWidth linewidth -

Custom Name attr0customname -

Type attr0type - -
  • float float -
  • double double -
  • int int -
  • uint uint -
  • dir dir -
  • dbl dir ddir -

Number of Components attr0numcomps - -
  • 1 1 -
  • 2 2 -
  • 3 3 -
  • 4 4 -

Default Value attr0defvalue - -
  • Default Value attr0defvalue1 -
  • Default Value attr0defvalue2 -
  • Default Value attr0defvalue3 -
  • Default Value attr0defvalue4 -


Parameters - Pre Page

Pre pre -

Scope pre0scope -

Parameter Size pre0parsize - -
  • 1 1 -
  • 2 2 -
  • 3 3 -
  • 4 4 -

Order pre0order - -
  • Multiply, Add, Operation multaddop -
  • Add, Multiply, Operation addmultop -
  • Operation, Multiply, Add opmultadd -
  • Operation, Add, Multiply opaddmult -

Multiply pre0mult -

Add pre0add -

Operation pre0oper - -
  • None none -
  • abs(A) abs -
  • sign(A) sign -
  • sqrt(A) sqrt -
  • A * A square -
  • 1 / A inverse -
  • floor(A) floor -
  • round(A) round -
  • ceil(A) ceil -
  • int(A) int -
  • fract(A) fract -
  • degrees(A) degrees -
  • radians(A) radians -
  • normalize(A) normalize -
  • exp10(A) exp10 -
  • exp2(A) exp2 -
  • exp(A) exp -
  • log10(A) log10 -
  • log2(A) log2 -
  • ln(A) ln -
  • sin(A) sin -
  • cos(A) cos -
  • tan(A) tan -
  • asin(A) asin -
  • acos(A) acos -
  • atan(A) atan -
  • dbtopow(A) dbtopow -
  • powtodb(A) powtodb -
  • dbtoamp(A) dbtoamp -
  • amptodb(A) amptodb -

Quantize pre0quantize - -
  • Off off -
  • Floor floor -
  • Round round -
  • Ceiling ceiling -
  • > 0 gt0 -
  • >= 0 gteq0 -
  • == 0 eq0 -
  • != 0 neq0 -
  • <= 0 lteq0 -
  • < 0 lt0 -

Result Scope pre0resultscope - -
  • Color Color -
  • Color(0) Color(1) Color(2) Color(0) Color(1) Color(2) -
  • N N -
  • Tex Tex -


Parameters - Combine Page

Combine comb -

Operation comb0oper - -
  • None none -
  • A copya -
  • abs(A) abs -
  • sign(A) sign -
  • sqrt(A) sqrt -
  • A * A square -
  • 1 / A inverse -
  • floor(A) floor -
  • round(A) round -
  • ceil(A) ceil -
  • int(A) int -
  • fract(A) fract -
  • normalize(A) normalize -
  • exp10(A) exp10 -
  • exp2(A) exp2 -
  • exp(A) exp -
  • log10(A) log10 -
  • log2(A) log2 -
  • ln(A) ln -
  • sin(A) sin -
  • cos(A) cos -
  • tan(A) tan -
  • asin(A) asin -
  • acos(A) acos -
  • atan(A) atan -
  • degrees(A) degrees -
  • radians(A) radians -
  • length(A) length -
  • compadd(A) compadd -
  • compsub(A) compsub -
  • compmult(A) compmult -
  • compdiv(A) compdiv -
  • compavg(A) compavg -
  • compmin(A) compmin -
  • compmax(A) compmax -
  • A + B add -
  • A - B asubb -
  • B - A bsuba -
  • A * B mult -
  • A / B adivb -
  • B / A bdiva -
  • A ** B apowerb -
  • logB(A) logba -
  • avg(A, B) avg -
  • min(A, B) min -
  • max(A, B) max -
  • mod(A, B) mod -
  • int(A / B) intadivb -
  • A > B gt -
  • A >= B gte -
  • A < B lt -
  • A <= B lte -
  • A == B eq -
  • A != B ne -
  • atan2(A, B) atan2 -
  • dot(A, B) dot -
  • angle(A, B) angle -
  • cross(A, B) cross -
  • A + B * C aaddbmultc -
  • A * B + C amultbaddc -
  • A + B + C aaddbaddc -
  • A * B * C amultbmultc -
  • rangefrom(A, B, C) rangefrom -
  • rangeto(A, B, C) rangeto -
  • mix(A, B, C) mix -
  • A if C else B ifelse -
  • loop(A, B, C) loop -
  • zigzag(A, B, C) zigzag -
  • clamp(A, B, C) clamp -
  • smoothstep(A, B, C) smoothstep -
  • B <= A < C bltealtc -
  • B < A <= C bltaltec -
  • B < A < C bltaltec -
  • B <= A <= C bltaltec -

Scope A comb0scopea -

Scope B comb0scopeb -

Scope C comb0scopec -

Result Scope comb0result - -
  • Color Color -
  • Color(0) Color(1) Color(2) Color(0) Color(1) Color(2) -
  • N N -
  • Tex Tex -


Parameters - Post Page

Post post -

Scope post0scope -

Parameter Size post0parsize - -
  • 1 1 -
  • 2 2 -
  • 3 3 -
  • 4 4 -

Map from Low post0fromlow -

Map from High post0fromhigh -

Map to Low post0tolow -

Map to High post0tohigh -

Quantize post0quantize - -
  • Off off -
  • Floor floor -
  • Round round -
  • Ceiling ceiling -
  • > 0 gt0 -
  • >= 0 gteq0 -
  • == 0 eq0 -
  • != 0 neq0 -
  • <= 0 lteq0 -
  • < 0 lt0 -

Cast to post0castto - -
  • Automatic auto -
  • Float float -
  • Int int -

Result Scope post0result - -
  • Color Color -
  • Color(0) Color(1) Color(2) Color(0) Color(1) Color(2) -
  • N N -
  • Tex Tex -


Parameters - Output Page

Delete Attributes delattribs -

Delete New Attributes delnewattribs -

Output Secondary Attributes outputsecondary - -
  • * * -


Parameters - Common Page

Bypass bypass -

Delete Input Attributes delinputattrs -


Operator Inputs

  • Input 0: -


Info CHOP Channels

Extra Information for the Math Combine POP can be accessed via an Info CHOP.

Common POP Info Channels

Common Operator Info Channels

  • total_cooks - Number of times the operator has cooked since the process started.
  • cook_time - Duration of the last cook in milliseconds.
  • cook_frame - Frame number when this operator was last cooked relative to the component timeline.
  • cook_abs_frame - Frame number when this operator was last cooked relative to the absolute time.
  • cook_start_time - Time in milliseconds at which the operator started cooking in the frame it was cooked.
  • cook_end_time - Time in milliseconds at which the operator finished cooking in the frame it was cooked.
  • cooked_this_frame - 1 if operator was cooked this frame.
  • warnings - Number of warnings in this operator if any.
  • errors - Number of errors in this operator if any.


TouchDesigner Build: