MAXScript Extensions > MAXScript Extensions for Particle Flow > Particle Flow Classes > Tests >

# Lock_Bond : Helper

    Lock_Bond- superclass: helper; super-superclass:node - 33:0 - classID:#(1395943682, 515064320)

Value > MAXWrapper > Node > Helper >Lock_Bond

| Particle Flow - Quick Navigation

Description:

The Lock_Bond operator attaches particles to objects, and can lock them to the object even as it animates. Particles can move over an object's surface, or the bond can be broken, causing particles to fly or break off from the object.

The standard Position Object operator is also able to lock particles to an object, but because it chooses particle positions at random on the object's surface, particles can drift when the object is animated. The Position Object operator's main limitation is that it cannot be applied to particles that have already established their positions. Since the Position Object operator generates new particle positions regardless the old ones, there is the illusion that each particle shifts to a new location instantaneously. With Lock_Bond, you can force the particles to maintain their original positions with respect to an animated surface.

In addition, Lock_Bond can also lock particle orientation. This means that particles with a definite orientation, such as darts or arrows, can maintain their orientation to the object even as it rotates. You can also limit particles' rotation from their original orientations for fine control over wind and gravity effects.

You can also dampen particle motion to simulate air, fluid, or friction as particles move across a surface or through the air.

Lock_Bond also serves as a test for particles breaking off from the object. See the parameter Break Off When Exceeds for information on the test performed.

The Lock_Bond test was first added to 3ds Max as part of the Creativity Extension to 3ds Max 2009 and became an integral part of 3ds Max 2010.It was previously available in the Particle Flow Tools Box #1.

Constructor:

    Lock_Bond...

Properties:

## Lock On Objects

    <Lock_Bond>.Lock_On_Objects : node array

Get/set the array of geometry objects to lock onto.

    <Lock_Bond>.Lock_Type : radiobtnIndex

Get/set the Lock Type radio button selection index.

Possible values are:

0 - Lock To Object (default)

1 - Lock To Surface

    <Lock_Bond>.Animated_Surface : boolean

Get/set the state of the Animated Surface option.

Use this option when the object's surface changes shape or detail over time, such as with animated sub-objects or parameters, morphing, or a skin modifier. If the object is animated through transforms only (position, rotation, scale), leave this option turned off to reduce processing time.

    <Lock_Bond>.Snap_To_Surface : boolean

Get/set the state of the Snap To Surface option.

This option differs from Lock to Surface, which locks particles to the surface but maintains the distance each particle had from the surface upon entering the event. Snap to Surface forces particles to lie on the object's surface.

## Position Lock/Bond

    <Lock_Bond>.Restrict_Position_To_Surface : boolean

Forces particles to stay on the object's surface while they are moving. When the Force parameter is less than 100%, particles can move from their original positions based on Speed and Force operators within the event. In this case, turning on Restrict to Surface forces the particles to move only to other parts of the surface without leaving the surface itself.

    <Lock_Bond>.Use_Position_Offset_Limit : boolean

Get/set the state of the Offset checkbox. If this option is set to false, particles are not limited in their movement.

    <Lock_Bond>.Position_Offset_Limit : worldUnits

Get/set the Offset value which defines the maximum distance a particle can move from its lock point.

    <Lock_Bond>.Use_Speed_Limit : boolean

Get/set the state of the Speed Limit checkbox. If set to true and particles cannot keep up with lock points on an animated object, particles' speed will be limited to the.Speed_Limit value even if Force is 100%. In other words, the Speed Limit, if turned on, overrides the Force %

    <Lock_Bond>.Speed_Limit : worldUnits

Sets the maximum speed that a particle can travel, in units per frame.

    <Lock_Bond>.Position_Force : percent

Sets the amount of force holding the particle to its lock point. A 100% Force attempts to keep particles stuck to their lock points. When Force is set to values lower than 100%, particles can be moved off their lock points based on Speed and Force operators in the event. The lower the Force %, the more influence Speed and Force operators have on the particles.

If Force is less than 100% and Restrict to Surface is turned on, particles will move along the object's surface. If Force is less than 100% and Restrict to Surface is off, particles will move off the surface but retain their relationships to lock points. In either case, particle movement will be based on Speed and Force operators, and will be restricted by Offset Limit and Speed Limit if these parameters are turned on.

When Force is set to 100% and Restrict to Surface is turned on, particles are strictly locked to the object or surface, and do not move. If Force is 100% and Restrict to Surface is turned off, particles are locked to the object unless Break Off When Exceeds is enabled and the object is animated at a sufficient speed to break off particles.

    <Lock_Bond>.Position_Dampening_Type : integer

Get/set the selection index of the Dampening drop-down list which controls how particles are slowed down, simulating various resistence forces.

Possible values are:

0 - None - No dampening is applied, other than the default dampening on oscillating forces from Speed and Force operators.

1 - Friction - Simulates a surface friction effect, which gradually slows particles until they stop moving.

2 - Air/Fluid - Simulates the resistance of a medium such as air or water, which slows particles but never stops them completely.

3 - Both - Combines both forces, Friction and Air/Water.

    <Lock_Bond>.Dampening_Friction : worldUnits

Get/set the Friction value.

    <Lock_Bond>.Dampening_Resistance (Birth_Texture_operator_Warning) : worldUnits

Get/set the Resistance value.

    <Lock_Bond>.Speed_Unit : worldUnits

Get/set the Speed Unit value.

### No Force In Central Zone

    <Lock_Bond>.Use_No_Acceleration_Zone : boolean

Get/set the state of the For Acceleration checkbox. When set to true, acceleration forces in each particle's centraz zone are turned off. This prevents the particle from slowing down to a stop.

    <Lock_Bond>.Use_No_Dampening_Zone : boolean

Get/set the state of the For Dampening checkbox.When set to true, dampening forces in each particle's centraz zone are turned off. This prevents particles from being slowed by friction and coming to a stop.

    <Lock_Bond>.Zone_Radius : worldUnits

Get/set the Radius value defining the radius of the central zone around a lock point.

## Rotation Lock/Bond

    <Lock_Bond>.Use_Rotation_Offset_Limit : boolean

Get/set the state of the Offset Limit checkbox. When set to true, the Offset Limit will be used.

    <Lock_Bond>.Rotation_Offset_Limit : angle

Get/set the value of the Offset Limit property which controls the maximum number of degrees by which a particle can deviate from its lock point's rotation.

    <Lock_Bond>.Use_Spin_Limit : boolean

Get/set the state of the Spin Limit checkbox. When set to true, the Spin Limit will be used.

    <Lock_Bond>.Spin_Limit : angle

Get/set the value of the Spin Limit property which controls the maximum number of degrees per frame that a particle can rotate. If Spin Limit is turned on and particles cannot keep up with lock points that are rotating, particles will be limited to the Spin Limit even if Force is 100%. In other words, the Spin Limit, if turned on, overrides the Force %.

    <Lock_Bond>.Rotation_Force : percent

Get/set the value of the Force%property which controls the amount by which the particle's rotation is forced to match its lock point's rotation. When Force is 100%, particles maintain their original orientations, unless limited to rotate by Spin Limit settings. When Force is less than 100%, particles can be rotated with Force operators. The lower the Force value, the more a particle can be influenced by Force operators and inertial properties of a particle.

    <Lock_Bond>.Rotation_Dampening : percent

Get/set the value of the Dampening%property which controls the amount of resistance that holds a particle back from catching up with the lock point's rotation. A 0% creates no dampening, while 100% prevents the particle from rotating at all. If the Offset Limit is set, Dampening cannot cause the particle rotation to deviate from the lock point's rotation by more than the Offset Limit, even if Dampening is set to 100%. In other words, the Offset Limit overrides the Dampening value.

    <Lock_Bond>.Induced_By_Speed_Change : boolean

Get/set the state of the Induced By Speed Change checkbox. When set to true, it causes particle rotation to occur due to surface's animation even when particles' positions are locked to their lock points. This allows the simulation of the effect of a particle with a springy attachment to a surface. Since the center of gravity of a particle doesn't coincide with the lock point, any movement of the underlying surface initiates a rotational movement of a particle.

    <Lock_Bond>.Inertial_Size : worldUnits

Get/set the value of the Inertial Size value which controls the distance between the pivot point of a particle and the particle’s center of gravity. For example, a strand of grass's inertial size is a half length of the strand. Smaller values induce a stronger rotation. This option is used only when.Induced_By_Speed_Change is set to true.

## Break Off

    <Lock_Bond>.Use_Break_Off_Test : boolean

Get/set the state of the Break Off When Exceeds option.

    <Lock_Bond>.Break_Off_Type : radiobtnIndex

Get/set the Break Off Type radio button selection.

Possible values are:

0 - Speed (default)

1 - Accel

    <Lock_Bond>.Break_Off_Speed : worldUnits

Get/set the Break Off Speed value. When the particle's speed exceeds this value and.Use_Break_Off_Test is set to true, the particle will break off from the surface and start moving again.

    <Lock_Bond>.Break_Off_Acceleration : worldUnits

Get/set the Break Off Acceleration value. When the particle's acceleration exceeds this value and.Use_Break_Off_Test is set to true, the particle will break off from the surface and start moving again.

    <Lock_Bond>.Break_Off_Variation : percent

Get/set the Break Off Variation value. It is used to introduce a random variation of the Break Off Speed and Acceleration values.

    <Lock_Bond>.Break_If_Outwards_Only : boolean

Get/set the state of the Break If Outwards Only option. When set to true, particles will break off only if moving along the surface normals. When set to true, particles will break off when the limits are exceeded regardless of the direction of motion.

## Parameters Animation

    <Lock_Bond>.Sync_Type(Sync_By_Type) : integer

Get/set the selection index of the Sync By drop-down list.

Possible values are:

0 - Absolute Time (default)

1 - Particle Age

2 - Event Duration

## Uniqueness

    <Lock_Bond>.Random_Seed : integer

Get/set the Random Seed value.

## Lock_Bond Interfaces:

The following Interfaces are exposed by the Lock_Bond Class:

Interface: action

Interface: operator

Interface: PViewItem

#### See Also

- Particle Flow Classes