M3D ScriptOp Descriptions

EDIT THIS

CONDITIONS

AlignmentDiff

Takes two alignments and compares to a previously-calculated alignment difference (by using AlignmentMath helper scriptOp), and then outputs the percentage difference between the two alignments compared to the original alignment difference.

This script is useful when storing intial alignments between particles and detecting how far out of alignment they are.

IfNotUndefined

OLD - DO NOT USE

'''IfUndefined'''

Connect an input float, point3, spin or alignment, and if that value is undefined then output the corresponding 'user' input value.

This script is useful in dealing with undefined values and allows you to provide a default value if the input is undefined.

NOTE: only connect one set of values per data type – e.g. do not mix multiple types of inputs.

='IsAlive3'=

Simply detects if a particle is truly "alive" at that moment in time.

Remember when particles are told to "die" they are tagged for deletion ON THE NEXT SAMPLE.

This script allows you to check if the particle is truly alive or not (tagged for deletion == not alive).

PLEASE DO NOT USE EARLIER VERSIONS OF THIS SCRIPT (e.g. IsAlive, and IsAlive2 – these are being phased out).

'IsDying'

Is the particle tagged for deletion? e.g. did it just receive a Particle Die command or is it at the end of its lifespan?

'IsUndefined'

Reports if the input value is undefined or not.

Only test one type of input. Probably doesn't handle multiple values properly yet.

'IsSimStart'

Returns true if this is the first evaluation step of the sim (e.g. the very beginning of the entire sim).

Works if TP is set to Animation or User-Defined start frame.

'IsWholeFrame'

If TP is sampling per half frame or smaller… this condition will report if the current time-sample is a whole frame or not (e.g. frame 14, or frame 21 will report true).

Frames 14.5 or 21.1 will report false.

OPERATORS

Sub-category: '"m3d"'

'Alignment Inverse'

Returns the inverse alignment of the input alignment. Basically, flip all 3 axes.

'AlignmentVecCross'

Takes an input Direction and calculates the cross product with [0,0,1] and returns the Alignment.

'CombineUniqueID'

Takes two PID integer values and constructs a new integer using the following formula:

if (ID1 > ID2) then ( CombineUniqueID = ((ID1 + ID2) as integer) + 999000 ) else ( CombineUniqueID = ((ID2 + ID1) as integer) + 999000 )

This script is useful for jointing two particles with surface markers, or anytime you need a (fairly) unique number to identify. Ask Scarr for more details if needed.

'MatrixMath'

Need to do some matrix math? This is your operator.

'MatrixXform'

Similar to MatrixMath, but this also allows transforming a point3 value through a matrix.

'Noise4_2D'

Creates a 2D version of a Noise4 field using the user-supplied float values. See the Maxscript help file for more info (search: Noise)

'ReflectionDir'

Take an incoming direction, a hit position and a hit normal and calculate the proper reflected direction or reflected alignment.

WARNING: this operator is math intensive (aka SLOW!) and would be better suited as a pure C++ operator.

'SetSpin'

Similar to the regular 'Spin' operator, but allows inputting spin speed in either degrees or radians per second.

'SpinLimit'

Limit the spin of the particles in either degrees or radians per second. If the particle's spin speed is above the limit it will be set to the limit.

'ThreeVecAlignment'

Takes three input directions and constructs an alignment space.

NOTE: it is entirely possible to created skewed alignment spaces using this operator.

'TwoVecAlignment'

Take an X direction and Y direction and create an Alignment. Assumes Z+ for the Z direction.

'VectorDivergence3'

WARNING: DO NOT USE THIS OPERATOR unless you know what you're doing and absolutely have to.

This operator is extremely math intensive and will slow your sims dramatically.

It takes two velocities, masses, and 'frag thresholds' and outputs multiple values.

This was an early script attempt at calculate pressure-based fragging.

Needs a serious re-write!

Sub-category: '"m3d_util"'

tp_scriptop_collectionsave

tp_scriptop_collectionload

tp_scriptop_datarecorder

tp_scriptop_makejointnodes

HELPERS

Sub-category: '"m3d_util"'

'DebugPID'

Specify the PID and it will report certain info about the particle.

'NodeUserDefinedPropsMultiDev'

Takes a Node input and outputs any matching User-Defined Properties it finds (based on output name).

Use in conjunction with Obj2Particle.

The user-defined property values can be assigned with the script "Machine3D TP User-Defined Props" (ScriptDepot\Thinking Particles)

The silly long name was due to it being in dev, and reading multiple user-defined properties, duh. ;)

'NodeUserProps1'

Reads and returns User-Defined Properties on incoming nodes. Use this with Obj2Particle.

'NodeInfo'

Evaluates the incoming mesh and outputs information about it.

WARNING!!! This can be really slow with heavy meshes.

'NodeVolume'

Calculates and returns the volume of the node. WARNING: slow with heavy meshes.

'NodeVertCount'

Calculates and returns the vertex count of the node.

'NodeWireColor'

Reads the wirecolor of the node and outputs the raw wirecolor (zero to 1.0 values), or also RGB/HSV in 0-255 format.

'Note'

Want to add extra documentation to your setup? Use Note. Just be aware it does not word-wrap, so hit Enter manually.

'VBUserDefinedProps'

Reads user-defined properties on the input node.

Use in conjunction with Obj2Particle.

The user-defined property values can be assigned with the script "Machine3D TP VB User-Defined Props" (ScriptDepot\Thinking Particles)

Sub-category: '"m3d"'

'AlignmentMath'

Perform alignment math operations.

'LifeProgress'

Simple function of age/lifespan. Returns 0.0 to 1.0 (although 1.0 means dead so might not report…)

'MinMeanMax'

Takes a Group input and you choose the value you want to know about and it reports the minimum, mean, and maximum values for that group.

'Scan Subtree' will analyze all child groups as well.

This script is very useful if you want to do things like emit dust off particles and want to know what the smallest and largest particle values are.

'Noise2D'

BROKEN – NEEDS WORK.

'PID Compare'

Takes two particle inputs and compares their PID values.

We ran into cases where an Expression was unable to properly compare PID integers, so this was created.

'PID Compare 2'

Includes an 'ON' input for extra control.

Should remove one of these two helpers…

'Particle Switch'

Takes three particle inputs. If PID 0 = PID 1 then output PID 2, else output PID 1.

This script is useful in cases where you need to test if two particles are the same particle, in which case you'd want to switch an use another particle instead.

'SplineSampler'

Takes a Node input (should be a spline object, typically read from a multiNode or NodeSelector).

Specify a 'stepSize' in worldspace and this script outputs certain information like the curve length, total steps based on stepSize, multiple positions along the spline, alignments at those points along the spline, whether the output position step is a start or end point, and a 'thisStep' (which I believe is a 0-1 float of progress along the spline).

This script is especially handy for creating chains and ropes, but can also be used to birth particles along a spline.

'SplineSamplerBasic'

OLD - DO NOT USE.

'VectorTransform'

Takes a vector and an alignment and an optional position and translates the vector through the alignment (matrix math), and optionally performs the calculation from the given position.

'multiNode'

DO NOT USE – use ALO\MultiNode3 instead.

Ability to pick multiple scene nodes and then access those nodes via the 'Node Index' input. Use the "Node Index" input to access the node from the numbered list. You can use an Iterator (with an Integer + 1) to iterate through a series of nodes, however this does not appear to work with UDeflector.

'multiNode2'

DO NOT USE – use ALO\MultiNode3 instead.

Same as multiNode, but also outputs node Position and Visibility values (if it has keys for this).