Softimage SDK Programmer's Guide > Plug-in Development > Working with Operators >

# About Connection Sets

When you connect an operator to the scene graph (the set of data nodes in the Softimage scene), that operator requires a special set of input and output ports. For example, the only valid input port to connect to the Loft operator is on a NURBS curve (not a point, not a mesh, etc.). A ConnectionSet uses a specialized string syntax to delimit groups you are specifying as input.

A connection set is identified with a string expression containing a list of groups separated with a semi-colon (;). Inside each group is a list of objects or components separated with a comma (,). A set is specified either with group or port objects.

A group-level connection set is a high-level connection (implicit) specification whereas a port-level set (explicit) provides the actual objects that are connected on the operator's ports. In other words, group-level connection sets can accept objects and automatically resolve the underlying port connections, whereas port-level connection specify the exact node connection point for each port. For example, the Lattice operator takes a connection set containing the following groups and ports:

Groups | Ports | Example
--- | --- | ---
0 (the object to be deformed) | the object's primitive | sphere.polymsh
the object's global kinematics | sphere.kine.global
the object's global kinematics | sphere.kine.global
(optional) a list of subcomponents on the object (such as a point cluster) | sphere.polymsh.cls.point
(optional) a weightmap on the object | sphere.polymsh.cls.WeightMapCls.Weight_Map
the object's primitive | sphere.polymsh
1 (the lattice deformer) | the lattice's implicit primitive | lattice.lattice
the lattice's global kinematics | lattice.kine.global

The syntax for group-level and port-level connection sets differs slightly in that you indicate that you are explicitly specifying port-level connections in the connection set with square brackets ([ and ]) inside the double-quotation marks.

Note

The ApplyOp command supports only group-level connection sets. To specify a port-level connection sets, use the ApplyOperator command.

For example, to explicitly specify the port connections you would use this connection set string:

    "[sphere.polymsh, sphere.kine.global, sphere.kine.global, , , sphere.polymsh; lattice.lattice, lattice.kine.global]"

... and to leave the specific connections up to Softimage to resolve you would use this connection set string:

    "sphere;lattice"

VBScript Example: Group-level connection sets

Many of the envelope commands, such as SIApplyFlexEnv, use group-level connection sets to pass the envelope object in the main group of the connection set and the bones and effectors in the secondary group:

    ' Build a simple Envelope with no picking required.
    CreatePrim "Sphere", "MeshSurface"
    Create2DSkeleton -0.019, 3.703, 0.000, -0.795, 0.000, 0.000, 0.000, 0.000, 1.000, 1
    AppendBone , 0.000, -3.509, 0.000
    SelectObj "sphere", , True
    SIApplyFlexEnv "sphere;bone,bone1,eff", False, False

The connection set is divided into main and secondary groups using the semi-colon (;), and the members of each group are delimited using the comma (,), so in the case of sphere;bone,bone1,eff, the first group ('sphere') represents the envelope, and the second group ('bone,bone1,eff') represents the items to be enveloped.

VBScript Example: Port-level connection sets

The Lattice (deform) operator is an operator for which you can specify a port-level connection set instead of a group-level connection set, provided you use the ApplyOperator command. Here is an example of how to use this to connect a lattice to a primitive and then to a cluster:

    GetPrimLattice(null, null, null, null, null);
    CreatePrim("Sphere", "MeshSurface", null, null);
    SelectGeometryComponents("sphere.pnt[9-29]");
    CreateCluster(null);
    SelectGeometryComponents("lattice.pnt[(0,2,0),(0,2,1),(0,2,2),(0,2,3),(0,2,4),(0,3,0),(0,3,1),(0,3,2),(0,3,3),(0,3,4),(0,4,0),(0,4,1),(0,4,2),(0,4,3),(0,4,4),(1,2,0),(1,2,1),(1,2,2),(1,2,3),(1,2,4),(1,3,0),(1,3,1),(1,3,2),(1,3,3),(1,3,4),(1,4,0),(1,4,1),(1,4,2),(1,4,3),(1,4,4),(2,2,0),(2,2,1),(2,2,2),(2,2,3),(2,2,4),(2,3,0),(2,3,1),(2,3,2),(2,3,3),(2,3,4),(2,4,0),(2,4,1),(2,4,2),(2,4,3),(2,4,4),(3,2,0),(3,2,1),(3,2,2),(3,2,3),(3,2,4),(3,3,0),(3,3,1),(3,3,2),(3,3,3),(3,3,4),(3,4,0),(3,4,1),(3,4,2),(3,4,3),(3,4,4),(4,2,0),(4,2,1),(4,2,2),(4,2,3),(4,2,4),(4,3,0),(4,3,1),(4,3,2),(4,3,3),(4,3,4),(4,4,0),(4,4,1),(4,4,2),(4,4,3),(4,4,4)]");
    Scale(null, 1, 0.222437137330754, 1, siRelative, siLocal, siObj, siXYZ, null, null, null, null, null, null, null, 0);
    Translate(null, 0, -1.17562305635889, 0, siRelative, siLocal, siObj, siXYZ, null, null, null, null, null, null, null, null, null, 0);

    SetValue("Context.constructionmode", siConstructionModeModelling);

    // This is the standard Group Level way of calling ApplyOp
    // It applies the lattice on the sphere point cluster
    ApplyOp("Lattice","sphere.polymsh.cls.Point;lattice");

    // This does exactly the same thing, but you can specify each and every port you want to connect
    ApplyOperator("Lattice","[sphere.polymsh,sphere.kine.global,sphere.kine.global,sphere.polymsh.cls.Point,,sphere.polymsh;lattice.lattice,lattice.kine.global]");

    // Set the ContructionHistory mode to Animation
    SetValue("Context.constructionmode", siConstructionModeAnimation);

    // It applies the lattice on the whole sphere, standard portgroup level
    ApplyOp("Lattice","sphere.polymsh.cls.Point;lattice");

    // This does exactly the same thing, but you can specify each and every port you want to connect
    ApplyOperator("Lattice","[sphere.polymsh,sphere.kine.global,sphere.kine.global,sphere.polymsh.cls.Point,,;lattice.lattice,lattice.kine.global]");

For a complete list of all operators and the details of their connection sets, see Operator Presets.

ConnectionSets and the Dictionary Object

The SDK provides a complete set of information about the connection set for each operator. You can query the Dictionary object directly in the Script Editor to get the complete set of information on each operator, or a list of all operators matching their family name (siFamily):

    Application.LogMessage Dictionary.Info( "FlexibleEnvelope" )

    ' Output:
    'INFO : FlexibleEnvelope
    'Families = Operators, DeformOperators
    'Number Of Groups = 2
    '
    	'Group(0)
    	'Flags = E3DOPGROUP_MAIN
    	'Bounds = 1..1
    	'Filter = components for deforms
    	'Pick Prompt = Deformation Value
    '
    	'Group(1)
    	'Flags =<undefined>
    	'Bounds = 1..N
    	'Filter = <undefined>
    	'Pick Prompt = Skeleton Object
    'Pick Node
    'Pick Branch
    '
    '