AttachRigidBodies

Description

Connects rigid bodies together with a rigid constraint and places the contraint at the specified position in global space. If the input list contains only one body, the body will be attached to the world. If the list contains no bodies, a constraint will not be created.

Scripting Syntax

    AttachRigidBodies( Name, [Bodies], Px, Py, Pz )

Parameters

Parameter | Type | Description
Name | String | Type of constraint (e.g. hinge, ballsocket, spring) to attach to the rigid bodies
Bodies [in/out] | String | List of rigid bodies Default Value: Current selection
Px [in/out] | Double | Constraint x coordinate (global space) Default Value: 0
Py [in/out] | Double | Constraint y coordinate (global space) Default Value: 0
Pz [in/out] | Double | Constraint z coordinate (global space) Default Value: 0

Return Value

Returns the Constraint object.

Examples

VBScript Example

    '
    ' Attach two cubes with a ball and socket constraint.
    ' Put the constraint at the origin.
    '
    set cube1 = CreatePrim("Cube", "MeshSurface")
    SetValue cube1 & ".cube.length", 1
    Translate , 2, 0, 0, siAbsolute

    set cube2 = CreatePrim("Cube", "MeshSurface")
    SetValue cube2 & ".cube.length", 1
    Translate , -2, 0, 0, siAbsolute

    CreateActiveRigidBody cube1 &","& cube2
    set l_cns = AttachRigidBodies("BallSocket", cube1 &","& cube2, 0, 0, 0)
    logmessage typename(l_cns)

    'Results of running this script:
    'INFO : "X3DObject"

See Also

SetRigidBodyInitState | GetRigidBodyInitStateFromAnim | CreateActiveRigidBody | CreatePassiveRigidBody
RemoveRigidBody |  |  |

Autodesk Softimage v7.5