Synopsis

DPK_bcs [flags] [String…]

The command is Undoable, Queryable, and Editable

Description

The DPK_bcs command is used to create, configure, and query DPK_bcs nodes.

This command is designed to do different things based on the combination of the given flags. This means that a certain flag can have a fundamentally different meaning in one call than in another. To simplify the description of the flags, each of the three modes create, edit, and query has its own section. A special UI section describes the edit and query flags for pure UI operations.

Create Mode

The flags in this list can be used in the create mode of the command. A command runs in create mode when neither the -edit nor the -query flag is used. In this mode, the command always creates a new bcs node. When no nodes are specified as argument to the command, the current selection is used. If more than one object is specified (or selected), the last specified will be the deformed object and the others will be added as dataPoints. Each dataPoint will have a weight, by default, so that the resulting setup is equal to a Blend Shape setup.

Advanced Info

When you undo the creation of a bcs node (by undoing this command), the internal MObject will not be deleted (it’s just removed from the scene). This is no problem, at all. It just means that you can’t unload the plugin during this Maya session, even when opening a new scene. Forcing an unload will not work either. The reason is that the deformer mel command (which is internally used to create the construction history) somehow keeps the object, even when undone.

Return Value

string - the created bcs node

Create Flags

Flags (short/long)Argument(s)Return

-n/-name

string

 

Used to specify the name of the node being created.

-bf/-before

 

 

If the default behavior for insertion/appending into/onto the existing chain is not what you want then you can use this flag to force the command to stick the deformer node before the selected node in the chain even if a new geometry shape has to be created in order to do so.

-af/-after

 

 

If the default behavior for insertion/appending into/onto the existing chain is not what you want then you can use this flag to force the command to stick the deformer node after the selected node in the chain even if a new geometry shape has to be created in order to do so.

-sp/-split

 

 

Branches off a new chain in the dependency graph instead of inserting/appending the deformer into/onto an existing chain.

-foc/-frontOfChain

 

 

This command is used to specify that the new deformer node should be placed ahead (upstream) of existing deformer and skin nodes in the shape’s history (but not ahead of existing tweak nodes). The input to the deformer will be the upstream shape rather than the visible downstream shape, so the behavior of this flag is the most intuitive if the downstream deformers are in their reset (hasNoEffect) position when the new deformer is added.

-par/-parallel

 

 

This command is used to specify that the new deformer node should be placed parallel to existing deformer and skin nodes in the shape’s history.

-ex/-exclusive

string

 

Puts the deformation set in a deform partition.

-en/-envelope

double

 

Set the envelope value for the deformer, controlling how much of the total deformation gets applied. Default is 1.0.

-dcw/-dontCreateWeight

 

 

Specifies that dataPoints will have no position and can’t be controlled until they have been assigned one.

-sep/-separationPattern

string string

 

Specifies the separation pattern for the left and right side, respectively. An empty string means use the default. Default is "%sL" and "%sR".

-fi/-freezeInput

bool

 

If set to true, the input geometry isn’t expected to change. This is useful to increase performance, because many things can make the node think the input has changed, even if it didn’t (such as moving the transform etc.). If the input changes and these changes are not ignored, all dataPoints have to be updated. The result would be that moving the base’s transform is very slow with a bigger bcs. The default is to ignore changes (true).

-fa/-falloffAxis

x|y|z

 

Specifies the axis across which the falloff is applied to separate the left and right sub-dataPoints. Default: x

-dfo/-defaultFalloffs

float[]

 

Falloff curves are used to create automatic left and right (unilateral) dataPoints of full (bilateral) dataPoints. By default, three falloff curves are set up when a new bcs node is created. The curves depend on the dimensions of the base geometry in the specified falloffAxis. All curves are centered on the pivot of the base geometry. The curves are:

  1. narrow: This curve ranges over 5% of the base object.

  2. mid: This ranges over 15%.

  3. wide: This ranges over 30%.

You can edit these curves as you like and create as many additional curves as you want. These are just used as a starting point. If you’d like to start with different default curves, specify this -dfo flag with a float array, containing the curves’ dimensions. The values range from 0 to 1 and define over how much of the length of the base in the falloffAxis’ direction the curve should be applied. 1 means use a falloff that starts with 100% at the end of one side and slowly fade to 0% at the end of the other side. 0 results in a straight cut in the middle of the object.

-abi/-autoBilateral

string

 

If specified, the selected geometry objects will be added as bilateral dataPoints if their name matches the given string. The weight and the dataPoint will get the object’s name without the part that has matched. If the string is empty, the default ("^Bi[0-9]*_") is used.

-cfn/-checkFalloffNumber

 

 

Only in combination with the -abi flag. Specifies that a number extracted from the match of the bilateral pattern string is used to choose the falloff for the separation. The falloff indices are 0-based.

E.g.: There’s an object with the name:

    "Bi2_AU12"

The bcs command is:

    DPK_bcs -abi "" -cfn;

The result is that we get “AU12” as a bilateral weight (“AU12L” and “AU12R”). The created dataPoint uses the third falloff curve, which is the wide curve by default.

-ai/-autoInbetween

string

 

Specifies a match string used to automatically create inbetweens. If several objects differ only in the part that matches the string, they are sorted and added to the same weight equally distributed in the 0 to 1 range. If there is an object that has the same name but without the inbetween suffix, it is placed at position 1.

Advanced Info

All but the last weightPosition will have a layer of 1 and all dataPoints will be relative. If the string is empty, the default ("_i[^_]*$") is used.

-usn/-useSuffixNumber

float

 

Only in combination with the -ai flag. Specifies that the last characters of the match string of the -ai flag are interpreted as a number. This number is then multiplied with the given float argument and defines the position of the new dataPoint.

E.g.: Let’s say we have these target objects:

    "Bi_AU12_i50"
    "Bi_AU12_i75"
    "Bi_AU12"

The command is then:

    DPK_bcs -abi "" -ai "" -usn 0.01;

The result is that we have one bilateral weight called AU12 with two weight value elements (“AU12L” and “AU12R”) and two inbetweens, one at 0.5 and one at 0.75 and, of course, the main target at position 1. A value of 0 means use the default of 0.01.

Edit Mode

The edit mode is used to configure an existing bcs node.

Here, the flags for the edit mode of the command are listed and described. The command runs in edit mode when the -edit flag is specified. In this mode, the command expects a bcs node (or related geometry) as the command argument. If no such argument is specified, the selection is used.

Return Value

various - depending on the specified flags

Edit Flags

Flags (short/long)Argument(s)Return

-en/-envelope

double

 

Set the envelope value for the deformer, controlling how much of the total deformation gets applied. Default is 1.0.

-fp/-fullPath

 

 

Specifies that the full path should be returned in some of the actions (e.g., when creating dataPoint geometry using -dp -gt).

-f/-force

 

 

If defined, indirect deletion will be performed without an error. This ensures there is nothing deleted that you don’t explicitly specify.

-w/-weight

int/intArray

 

Specifies the weight(s) to use for some of the operations.

-wpg/-wPosGrp

int/intArray

 

Specifies the wPosGrp(s) to use for some of the operations.

-wp/-wPos

int/intArray

 

Specifies the weight position(s) to use for some of the operations.

-dp/-dataPoint

int/intArray

 

Specifies the dataPoint(s) to use for some of the operations.

-dpg/-dataPointGrp

int/intArray

 

Specifies the dataPoint group(s) to use for some of the operations.

-fo/-falloff

int/intArray

 

Specifies the falloff(s) to use for some of the operations.

If used with the -dp flag, makes the specified dataPoint use the specified falloff for building its two unilateral sub-dataPoints.

If used alone, specifies that the given falloff should become the current editing falloff. Note that this operation will not be added to the undo queue even though it changes an attribute.

-d/-delete

 

bool

This flag deletes the weight, wPosGrp, wPos, dataPoint, or dataPoint group, depending on what is given through the -w, -wpg, -wp, -dp, -dpg, or -fo flag. Only one of these may be defined at once.

When a weight, wPosGrp, or wPos should be deleted but there’s at least one dataPoint that uses any of the affected weight positions, the command will fail and return false, unless the -f flag is also specified. In this case, the dataPoints are also deleted and dataPoints that are instances of the deleted dataPoints are converted to absolute dataPoints.

If you delete a dataPoint or dataPoint group and a dataPoint is the target of an instanced dataPoint, the -f flag specifies that the instance should be converted to an absolute dataPoint. Otherwise, the command will fail.

If all dataPoints of a dataPoint group are deleted, the group will also be deleted.

If deleting a falloff that is used by at least one dataPoint, the command will fail when the -f flag isn’t specified.

-cw/-createWeight

 

int

Creates a new weight and returns its index. The -n, -wn, and -bi flags can be used with this flag to configure the new weight.

-wn/-weightNeutral

double

 

Sets the neutral value of the given (or new) weight. Default is 0.

-bi/-bilateral

bool

 

If set to true, the (new or given) weight will be converted into a bilateral weight. All dataPoints using this weight will be converted into bilateral dataPoints. Their falloffs then define the left-right separation.

-cwp/-createWPos

 

int

Creates a new weightPosition and returns its id. This flag has to be used in conjunction with either the -w or the -wpg flag. If used with the -w flag, a new wPosGroup is created for the weight and the new weightPosition will be created in this new group. If a group is specified with the -wpg flag, the weightPosition is created in it. To configure this new wPos, you can use the flags -wpp, -wpl, and -wpi. It is important to note that the position of the wPos has to be unique within its group (i.e., no other wPos can have this position, including the neutral value of the weight). Also, if the wPos should get a layer other than 0, it cannot be a border position.

-wpp/-wPosPosition

double

 

Moves the given weight position to the new position.

-wpl/-wPosLayer

int

 

Moves the given weight position into the specified layer.

-wpi/-wPosInterp

string

 

Changes the interpolation mode of the given weight position to the string argument. Possible values are linear, flat, precise, spline, enhanced, arc, inverseArc, and disabled.

-rw/-reorderWeights

int[]

int[]

Changes the order of the weights. The given array should contain the weights’ old indices in the order they should be in. Weights that aren’t listed in this array are appended to the end in their current order. This will change the index you use to access a certain weight and the int arrays containing the dpGroup weight data. It will also change the order in which weightPositions are listed in dataPoint positions, as they have to be sorted based on their weight’s index.

Returns an int array containing the new index of each weight. Since weights can be sparse, this array will contain elements with the value -1 for missing elements.

-cdp/-createDataPoint

 

int

Creates one new dataPoint. You can specify its name with the -n flag. Other options can be set using the flags -dpp, -dpm, -fo and -dpi. If you want to connect an existing geometry object to the dataPoint, specify it using the -go and -gm flags. If the -dpi flag is specified, adding -dpm 2 is optional.

Returns the created dataPoint.

-cdps/-createDataPoints

string[]

int[]

Creates one or more dataPoints using the objects in the string array argument. The way the dataPoints are created is similar to when creating a new bcs node. The flags -abi, -cfn, -ai, -usn, and -dcw are used to specify the exact behavior. You can specify neither the positions of the new dataPoints, nor their names. This can only be done indirectly using the mentioned additional flags.

Returns the created dataPoints.

-dcw/-dontCreateWeight

 

 

Specifies that dataPoints will have no position and can’t be controlled until they have been assigned one.

-go/-geometryObject

string

 

Used to specify an existing geometry object for some operations. It is used, e.g., with the -cdp flag. If used with just the -dp flag (and optionally with the -gt and/or -gm flags), connects the specified object to the dataPoint. Note that this will overwrite all current deformation data of the dataPoint. Use the -gm flag to specify whether the geometry should represent the relative or absolute data of the dataPoint. By default, the geometry is absolute. The -gt flag defines the type of the geometry (default is edit). The view geometry types cannot be used for connecting existing objects.

-gm/-geometryMode

bool

 

Specifies whether the geometry for certain operations should be relative (false) or absolute (true). This is used, e.g., when creating geometry for a dataPoint so that it can be edited, viewed, etc.. Default is true (absolute).

-gt/-geometryType

string

string[] or string

Specifies with which geometry of a dataPoint we should work. A dataPoint can have six different types of geometry, each being either relative or absolute.

  • edit
    This geometry is used to edit the main deformation data of the dataPoint. If the dataPoint is bilateral, this geometry controls the combination of the left and right sub-dataPoints.

  • left
    If the dataPoint is bilateral, this geometry is used to specify the left sub-dataPoint’s deformation. This is done after the falloff has been applied to the sub-dataPoint. This means that the relative geometry of this geometry type is the tweak that is added to the deformation that results from the falloff.

  • right
    Same as above, but for the right sub-dataPoint.

  • view
    This geometry is used to view the data of the dataPoint. It is useful when you, e.g., edit the absolute geometry and want to see the relative geometry at the same time. Furthermore, when you edit a dataPoint that influences the data of another dataPoint, you can only view the other dataPoint’s changes when you use this view geometry, as any edit geometry would overwrite these changes.

  • leftView
    The view geometry for the left sub-dataPoint. Used for the same reasons as the main view geometry.

  • rightView
    Same as above, but for the right sub-dataPoint.

If used with just the -dp or -dpg flag (and optionally the -gm and -fp flag), creates the specified geometry and connects it to the dataPoint(s). Note that this is not possible if this geometry already exists. When creating geometry objects, three special arguments can be used to create geometry that is not connected. These are free, leftFree, and rightFree.

Returns the created objects as a string array containing one element for each dataPoint. If used without any other flags, creates the neutral geometry and returns one string. In this case, the string argument is ignored.

-dis/-disconnect

 

 

Disconnects all edit and view geometry from the dataPoint(s) specified with the -dp flag. You can use the -gt flag to only disconnect a certain type of geometry from the dataPoint(s).

If no geometry is connected, this command does nothing.

Example:

// Get the ID of a dataPoint called 'smile*mOpen'.
int $dp = `DPK_bcs -q -gdp -called "smile*mOpen" $bcsNode`;

// Disconnect any left view geometry.
DPK_bcs -e -dp $dp -disconnect -gt "leftView" $bcsNode;

// Disconnect all geometry.
DPK_bcs -e -dp $dp -disconnect $bcsNode;

-dpp/-dataPointPosition

int[]

 

Specifies a position for a dataPoint. A position consists of a list of weightPositions (specified using their id). Each weight position has to be of a different weight. Furthermore, if there is another dataPoint that uses positions of exactly the same weights as the specified position, they have to be of the same wPosGroups.

E.g., if there are two weights with the following positions and position groups:

    weight1
      group 1
        0.5
        1.0
      group 2
        0.6
        1.0
    weight2
      group 1
        1.0

Let’s say there’s one dataPoint that uses position 0.6 of weight1 and 1.0 of weight2. You cannot create a second dataPoint with 0.5 of weight1 and 1.0 of weight2, since 0.5 is of a different group than the position that is used by the first dataPoint. However, a valid position would be 1.0 of weight1 (group 2) and 1.0 of weight2.

If used with only the -dp flag, moves the given dataPoint to the specified position.

-dpm/-dataPointMode

string

 

Converts the given dataPoint into a relative, absolute, or instanced dataPoint. If converting to an instance, the -dpi flag can be used to define the dataPoint of which this dataPoint should be an instance. The argument can be either an int or the mode: 0 == relative, 1 == absolute, 2 == instance.

-dpi/-dataPointInstance

int

 

Specifies the dataPoint of which the given dataPoint should become an instance. Note that specifying an instance target is only valid if the dataPoint is an instance.

-rdp/-resetDataPoint

 

 

Removes the data of the specified dataPoint. By default, all data (main, left, and right) is removed. A relative dataPoint will have no influence on the deformation anymore, as its stored deformation is zero. An absolute dataPoint, however, will have zero absolute data, resulting in the neutral geometry if the dataPoint is reached. To delete only a certain type of data, use the -gt flag and specify one of the three edit types.

-cpdp/-copyDataPoint

int

 

Copies the geometry data from one dataPoint to any number of dataPoints. The argument to this flag is the dataPoint to copy from. The dataPoints to copy to are specified with the -dp flag. Use the -gm flag to specify whether to copy absolute or relative data. This is independent from the mode of the dataPoints. By default, the absolute data is copied.

-mt/-mirrorTweaks

bool

 

Mirrors the unilateral tweaks from one side of a given bilateral dataPoint to the other. If the boolean is false, mirrors from left to right, otherwise, mirrors from right to left. The side to mirror to can’t have edit geometry.

-dpen/-dataPointEnable

bool

 

Enables or disables the specified dataPoint, depending on the argument. DataPoints are enabled by default. If a dataPoint is disabled, it doesn’t affect the deformation anymore. However, it keeps its position.

-cfo/-createFalloff

 

int

Creates a new falloff. Use the -name flag to specify the name of the new falloff. Use the -fo flag to specify a falloff to copy. Returns the index of the created falloff.

-fzm/-falloffZoom

float

 

Sets the falloffScale attribute to the specified value. Since this is (almost) a pure UI operation, there’s no undo for this action. Valid values range from 0.01 to 1000. You can use this to virtually zoom into our out of the current editing falloff. This has no effect on the interpretation of the falloff, just the display is changed.

-fsh/-falloffShift

float

 

Sets the falloffShift attribute to the specified value. Since this is (almost) a pure UI operation, there’s no undo for this action. Use this to shift the falloff curve to the left or right in the ramp eidting control. This has no effect on the interpretation of the falloff, just the display is changed.

-fa/-falloffAxis

string

 

Specifies the axis across which the falloff is applied to separate the left and right sub-dataPoints. Possible values are x, y, and z.

-fi/-freezeInput

bool

 

Specifies whether input changes are ignored or not. If the argument is true, the input geometry is not checked for changes. You should leave this setting at its default of true for most cases. Only consider disabling this function if there is changing history before the bcs node or if you manually edit the intermediate object that is the input of the bcs. Setting this to false will lead to frequent updates of all dataPoints, triggered by just moving the base geometry or editing one dataPoint’s shape.

-sep/-separationPattern

string string

 

Sets the separation pattern for the left and right sides of bilateral weights. The string "%s" will be replaced by the name of the control weight. The default is "%sL" and "%sR".

-n/-name

string

string

Only in combination with the -w, -dp, or -fo flag (or when creating new ones). Sets the name of the specified weight, dataPoint, or falloff to the given string.

Returns the new name (which may be different due to resolving name clashing).

-up/-update

 

 

Updates the bcs node’s internal data. Use this e.g. to force that geometry is read in during MEL execution when you want to delete the objects right after connection. Without this step, no geometry data would be copied.

Query Mode

The query mode is used to get information about the bcs setup. It is invoked by specifying the -query flag. As in edit mode, a bcs node (or related geometry object) is expected as command argument. If none is specified, the current selection is used.

Return Value

various - depending on the specified flags

Query Flags

Flags (short/long)Argument(s)Return

-fp/-fullPath

 

 

Specifies that the full path should be returned in some of the queries (e.g., -geometry).

-g/-geometry

 

string[]

Returns a string array containing all objects being deformed by this deformer.

-en/-envelope

 

double

Returns the envelope value of the deformer.

-w/-weight

int/intArray

bool

Specifies the weight(s) to use for some of the queries (e.g., the -gbi flag). If used alone, returns whether all specified control weights exist. If used with the -name flag, returns the name of the weight. If the -name and -gwv flags are used with the -w flag, returns a string array with the weight value names of the weight.

-wvn/-weightValueName

string/stringArray

bool

Specifies the weightValue(s) by their name. If used alone, returns whether all exist on the given bcs node.

-wpg/-wPosGrp

int/intArray

bool

Specifies the wPosGrp(s) to use for some of the queries (e.g., the -gwpp flag). If used alone, returns whether all weight position groups (wPosGrps) exist.

-wp/-wPos

int/intArray

bool

Specifies the weight position(s) to use for some of the queries. If used alone, returns whether all weight positions (wPos) exist.

-dp/-dataPoint

int/intArray

bool

Specifies the dataPoint(s) to use for some of the queries. If used alone, returns whether all dataPoints exist.

-dpg/-dataPointGrp

int/intArray

bool/int

Specifies the dataPoint group(s) to use for some of the queries. If used alone, returns whether the dataPoint groups (dpGrps) exist.

-fo/-falloff

int/intArray

 

Specifies the falloff(s) to use for some of the queries. If used alone, returns whether all specified falloffs exist.

-nos/-noSparse

 

 

Only in combination with other flags. Specifies that some of the returns should ignore missing elements and not return a sparse array.

-num/-number

 

 

Only in combination with other flags. See their description.

-gwv/-getWeightValue

 

various

Returns various lists of weight values depending on the flag combination:

  • -num:
    Returns the number of weight value elements.

  • -w:
    Returns the weight value element(s) that belong to the specified weight as an int array with one or two elements. If the -name flag is also specified, returns the weight values’ names instead.

  • -name:
    Returns a string array with the names of all weight values. Use the -bi flag to specify if only the weight value names of bilateral or non-bilateral weights should be returned.

  • -wpg:
    Returns the one or two weight value elements that belong to the weight to which the specified wPosGrp belongs.

  • -wp:
    Returns the weight value elements of the weight to which the specified wPos belongs.

-gw/-getWeight

 

various

Returns various lists of weights depending on the flag combination:

  • Nothing:
    If used alone, returns the indices of all existing weights. The -bi flag can be used to list only the bilateral or non-bilateral weights.

  • -num:
    Returns the number of existing weights. (-bi)

  • -name:
    Returns a string array with the names of all weights. Unless the -nos flag is also specified, the indices at which the names are stored correspond to the weights’ indices. Thus, the returned string array can have more elements than the int array. In this case, the string array has empty elements to indicate that there’s no weight at this index. (-bi)

  • -called:
    Returns the ID (as an int) of the weight with the given name or -1 if no weight with the specified name is found.

  • -w -bi:
    Used to filter the given weights and return only the bilateral or non-bilateral ones. (-num)

  • -wvn:
    Returns the weights of the specified weightValues. Each given weightValue will have an element in the return array. An element of -1 means that the given string is not a weightValue. Can be used with the -name flag to get the weight names instead.

  • -wpg:
    Returns the weights to which the specified wPosGrps belong.

  • -wp:
    Returns the weights to which the specified wPos belong.

  • -dp:
    Returns the weight(s) of which the specified dataPoint(s) use positions. If the -num flag is also specified, returns the number of these weights.

  • -dpg:
    Returns the weights that are used by the dataPoint group. If the -num flag is also specified, returns the number of these weights.

  • -fo:
    Returns the weights dataPoints of which use any of the specified falloffs. (-num)

-gwpg/-getWPosGrp

 

various

Returns various lists of wPosGrps depending on the flag combination:

  • Nothing:
    Returns all wPosGroups as an int array.

  • -num:
    Returns the total number of wPosGrps.

  • -w:
    Returns all wPosGrps of the specified weight(s). If the -num flag is also specified, returns the number of wPosGrps the weights have together.

  • -wp:
    Returns the wPosGrps to which the specified wps belong.

  • -dp:
    Returns the wPosGrps wPositions of which are used by the specified dataPoint(s).

  • -dpg:
    Returns the wPosGrps that are used by the specified dpGroup(s).

  • -fo:
    Returns the wPosGrps dataPoints of which use any of the specified falloffs. (-num)

-gwp/-getWPos

 

various

Returns various lists of wPositions depending on the flag combination:

  • Nothing:
    Returns an int array with all existing weight positions.

  • -num:
    Returns the number of existing weight positions.

  • -w:
    Returns all weight positions of the specified weight(s). If the -num flag is also specified, returns the number of these wPositions. If the -wpp flag is specified, returns only those wPositions that are at the given position.

  • -wpg:
    Returns all weight positions of the specified wPosGrp(s). If the -num flag is also specified, returns the number of wPosition of the specified wPosGrps. If the -wpp flag is also given, returns only the wPositions with the given pos.

  • -dp:
    Returns all weight positions that are used by any of the specified dataPoints. If just one dataPoint is specified, returns the same as the -gdpp query. (-num)

  • -dpg:
    Returns the weight positions that can be used by dataPoints of this group. This is not the same as when querying which wPositions are used by the dataPoints in the group. (-num)

  • -fo:
    Returns all weight positions dataPoints of which use any of the specified falloffs. (-num)

-gdp/-getDataPoint

 

various

Returns various lists of dataPoints depending on the flag combination:

  • Nothing:
    Returns an int array with all existing dataPoints. If the -bi flag is specified, returns only bilateral or non-bilateral dataPoints. The -dpm flag can be used to only list dataPoints with the given mode.

  • -num:
    Returns the total number of dataPoints. (-bi & -dpm)

  • -name:
    Returns the names of all dataPoints as a string array. Unless the -nos flag is also specified, the array will contain the names on indices that correspond to the dataPoints’ indices. If the dataPoint attr is a sparse array, the returned array will have empty elements to indicate missing dataPoints. (-bi & -dpm)

  • -called:
    Returns the ID (as an int) of the dataPoint with the given name or -1 if no dataPoint with the specified name is found.

  • -dpp:
    Returns the dataPoint at the specified position. There can only be one dataPoint at a position, so this returns a single int, not an array. If there’s no dataPoint at this position, returns -1.

  • -dpi:
    Returns all dataPoints that are instances of the specified dataPoint. If the -fp flag is specified, also returns the dataPoints that are instances of these instances… (-num)

  • -w:
    Returns all dataPoints that use any weight position of any of the specified weights. If used with the -ex flag, returns the dataPoints that use just positions of the specified weights. If the -num flag is also specified, returns the number of these dataPoints.

  • -wpg:
    Returns all dataPoints that use any wPos of any of the specified wPosGrps. If the -ex flag is also specified, only dataPoints that use no other weight positions are listed. If the -num flag is also specified, returns the number of these dataPoints.

  • -wp:
    Returns all dataPoints that use any of specified wPositions. If the -ex flag is also specified, only dataPoints that use no other positions are listed. If the -num flag is also specified, returns the number of these dataPoints.

  • -dp:
    Only with the -bi and/or -dpm flag. Used to filter the given dataPoints. (-num)

  • -dpg:
    Returns all dataPoint of the specified dataPoint group(s). If the -num flag is also specified, returns the number of these dataPoints.

  • -fo:
    Returns all dataPoints that use any of the specified falloffs. (-num)

-gdpg/-getDataPointGrp

 

various

Returns various lists of dpGroups depending on the flag combination:

  • Nothing:
    Returns all existing dataPoint groups as an int array.

  • -num:
    Returns the number of existing dataPoint groups.

  • -w:
    Returns the dataPoint groups that use any of the specified weights. If used with the -ex flag, returns only those groups that use no other weight. (-num)

  • -wpg:
    Returns the dataPoint groups that use any of the specified wPosGrps. If the -ex flag is also specified, only dpGroups that use no other wPosGrps are listed. (-num)

  • -wp:
    Returns the dataPoint groups dataPoints of which use any of the specified weight positions. If used with the -ex flag, returns only those groups of which no dataPoint uses a weight position that is not listed. (-num)

  • -dp:
    Returns the dataPoint groups of the specified dataPoint(s).

  • -fo:
    Returns the dpGroups dataPoints of which use any of the specified falloffs. (-num)

-gfo/-getFalloff

 

various

Returns various lists of falloffs depending on the flag combination:

  • Nothing:
    Returns all existing falloffs as an int array.

  • -num:
    Returns the number of existing falloffs.

  • -name:
    Returns the names of all falloffs as a string array. The array may contain empty elements to simulate the sparse array of falloffs. If -nos is specified, the array will only contain the names and no empty elements.

  • -called:
    Returns the ID (as an int) of the falloff with the given name or -1 if no falloff with the specified name is found.

  • -dp:
    Returns the falloff used by the specified dataPoint. If the dataPoint isn’t bilateral or uses no falloff, -1 is returned.

  • -dpg:
    Returns all falloffs that are used by any of the dataPoints in the specified group(s). (-num)

-ca/-called

string

int

Used together with -gw, -gdp or -gfo only. Returns the ID of the weight/dataPoint/falloff with the given name.

-d/-delete

 

bool

In query mode, this flag returns whether the specified weight(s), wPosGroup(s), weightPosition(s), dataPoint(s), dataPointGroup(s), or falloff(s) can be deleted without the -force flag.

Note that when deleting a weightPosition, the remaining weightPositions in the wPosGroup have to have a valid configuration (i.e. the border positions have to be on layer 0). Use the -force flag in this query to check, whether the specified weightPositions can be deleted with the -force flag.

-bi/-bilateral

bool

bool

If used with a weight, returns whether the bilateral state of the weight can be set to the flag argument. A weight can always be made bilateral. If the weight is bilateral and should be made non-bilateral, there may be some dataPoints that would also have to be converted to non-bilateral. If there’s unilateral geometry for one of those dataPoints, we cannot set the weight to non-bilateral. In this case, the return is false.

For combinations with other flags, see their description.

-wn/-weightNeutral

float

bool

Returns whether the neutral value of the given weight can be changed to the value of the argument without resulting in invalid weight position configurations.

-gwn/-getWeightNeutral

 

float

Returns the neutral value of the given weight.

-gbi/-getBilateral

 

bool

Returns whether the given weight or dataPoint is bilateral or not.

-wpp/-wPosPosition

double

bool

Returns whether the specified wPos can be moved to the specified position without resulting in an invalid wPosGrp configuration.

-gwpp/-getWPosPosition

 

double

Returns the position of the specified wPos.

-wpl/-wPosLayer

int

bool

Returns whether the given weight position can be moved to the given layer without resulting in an invalid weight position configuration.

-gwpl/-getWPosLayer

 

int

Returns the layer of the position which is defined by the -wp flag.

-gwpi/-getWPosInterp

 

string

Returns the interpolation of the weight position given by the -wp flag. Possible values are linear, flat, precise, spline, enhanced, arc, inverseArc, and disabled.

-dpp/-dataPointPosition

int[]

bool

Returns whether the given position is valid. A position consists of zero or more weightPositions. A valid position cannot have more than one wPos of one weight. Also, if there are dataPoints using the same weight combination as the specified position, each wPos has to belong to the same wPosGroup as the weightPositions of these other dataPoints. This avoids unresolvable dataPoint dependencies.

-gdpp/-getDataPointPosition

 

int[]

Returns the position of the dataPoint given by the -dp flag. This is the same as the -gwp -dp flag combination when only one dataPoint is specified. (-num)

-gdpm/-getDataPointMode

 

int

Returns the mode of the dataPoint given by the -dp flag. 0 == relative, 1 == absolute, 2 == instance.

-gdpi/-getDataPointInstance

 

int

Returns the dataPoint of which the given dataPoint is an instance. If the -fp flag is also specified and the direct instance target is an instance itself, traverses the dataPoint instance chain up to the dataPoint that isn’t an instance and thus controls all the others. If the instance target is the neutral geometry or if the specified dataPoint is not an instance, returns -1.

-go/-geometryObject

 

string[]

Returns the geometry object(s) that are connected to the dataPoint(s) specified via the -dp or -dpg flag. There’s one string for each dataPoint containing the most appropriate object or an empty string when there’s no geometry. This means that for setups with more than one base geometry shape, the transform that contains all the shapes is returned. If there’s no such transform, the hierarchy has been messed up and the transform of the first shape is returned.

The -gt flag can be used to specify the type of geometry to look for (default is edit). (-fp)

-gt/-geometryType

string

 

Specifies the type of geometry we’re querying. Possible values are edit, left, right, view, leftView, and rightView.

-gm/-geometryMode

 

int

Returns the mode of the specified dataPoint’s geometry. The -gt flag can be used to query the different geometries of the dataPoint. The return is 0 for relative and 1 for absolute. -1 is returned if no geometry of the specified type exists for the specified dataPoint.

With the -force flag specified, the mode of the last or currently connected geometry will be returned.

-dpen/-dataPointEnable

 

bool

Returns true if at least one of the specified dataPoints is enabled.

-dpw/-dataPointWeights

 

float[]

Returns a float array with the dataPoint weights that would result at a specified point in the weight space. This point can be specified using the following flags:

  • Nothing:
    When used on its own, the -dpw flag uses the current weight values as weight space position.

  • -wsp1:
    Specify the weight space position using one float array with an element for each weight value. See the -wsp1 flag for more details.

  • -wsp2:
    Specify the weight space position using two float arrays with left/right elements for each weight. See the -wsp2 flag for more details.

  • -dp:
    Use the dataPoint position of the given dataPoint as weight space position.

  • -dpp:
    Specifies the weight space position using an array of weightPositions (-dpp). Note that the wPos array has to be a valid position for an existing or non-existing dataPoint.

The returned array has one element for each dataPoint. If the dataPoint indices are sparse, the unused elements are left at 0.

Use the -side flag to control which part of the dataPoints’ weights should be returned. The values have the following effect:

  • mainEffective
    Same as without the -side flag. This returns an effective weight of each dataPoint. It corresponds roughly to how much each dataPoint affects the output.

  • main
    Returns the calculated weightings of the non-bilateral part of each dataPoint.

  • left
    Returns the calculated weightings of the left part of each dataPoint.

  • right
    Returns the calculated weightings of the right part of each dataPoint.

-s/-side

string

 

Used with -dpw only. Specifies the sub-dataPoints whose weights should be returned. Possible values are left, right, main, and mainEffective.

-wsp1/-weightSpacePosition1

float[]

 

Used with -dpw only. Specify the weight space position with a single float array containing an element for each weight value. This means that the indices do NOT correspond to weight IDs. Instead, they correspond to the result of ‘-query -gwv -name’.

-wsp2/-weightSpacePosition2

float[] float[]

 

Used with -dpw only. Specify the weight space position with two float arrays containing an element for each weight. The first array specifies the value to use for the left sides and for non-bilateral weights. The second array specifies the values for the right sides.

-he/-hasEdits

 

int

Returns whether the dataPoints given via the -dp flag contain any deltas. Use the -tolerance flag to specify a tolerance for detecting if a DP has delta vectors.

The returned value will be the number of DPs of the given DPs that have the kind of deltas queried.

If used without the -gt flag, counts each DP that has deltas on its main part or any left or right unilateral tweaks (created by modeling unilateral tweak geometry).

You can also specify a specific part of the DP that will be checked using the -gt flag:

  • With -gt "edit", counts any DP that adds any deltas to the pure mix if it is fully active. This means that a DP that has only unilateral tweaks but no main deformation will not be counted. However, a DP that has a main deformation and is bilateral without any tweaks (meaning the left and right parts add up to the bilateral part) will be counted.

  • With -gt "left" or -gt "right", only bilateral DPs that have unilateral tweaks on their left/right parts will be counted. This means that a bilateral DP for which left or right edit geometry has not been modified will not be counted, even if there are non-zero deltas on the left or right side.

Examples:

// Assuming DPs 0 and 1 have edits, the following will return 2.
DPK_bcs -query -hasEdits -dp {0,1,2} "bcsNode";

// Examples querying specific parts of a DP including a tolerance.
DPK_bcs -query -hasEdits -tol 1e-6 -dp 1 -gt "edit" "bcsNode";
DPK_bcs -query -hasEdits -tol 1e-6 -dp 2 -gt "left" "bcsNode";
DPK_bcs -query -hasEdits -tol 1e-6 -dp 3 -gt "right" "bcsNode";

-tol/-tolerance

float

 

In combination with the -he/-hasEdits flag, the specified tolerance is used to decide if a DP’s delta vectors should be counted. The recommended tolerance is 1e-6, since the numerical precision in Maya produces negligible deltas with a length in the order of 1e-7 (that is 0.0000001).

-gcf/-getCurrentFalloff

 

int

Returns the falloff that is currently being edited. If there’s no such falloff, -1 is returned. If used with the -name flag, returns the name of the falloff being edited (empty if the falloff doesn’t exist).

-fzm/-falloffZoom

 

float

Returns the current edit falloff zoom.

-fsh/-falloffShift

 

float

Returns the current edit falloff shift value.

-fa/-falloffAxis

 

string

Returns the axis across which the falloff is applied to separate the left and right sub-dataPoints. Possible values are x, y, and z.

-fi/-freezeInput

 

bool

Returns whether input changes are ignored or not.

-sep/-separationPattern

string string

bool

Returns true if the specified separation patterns are valid.

-gsep/-getSeparationPattern

 

string[]

Returns the separation pattern for the left and right sides of bilateral weights in a string array with two elements.

-n/-name

 

string

Only in combination with the -w, -dp, or -fo flag. Returns the name of the specified weight, dataPoint, or falloff.

UI Related Flags

The following flags are used for UI related operations and queries. They’re listed separately from the other flags, because they don’t change or query a bcs node’s setup. To be more specific, they manage textScrollList UI controls. You can register a TSL (as I use to call it) and let the command take care of filling the list with weights or dataPoints. As long as the list is registered, it will be maintained and always contain the most current items (given, you’ve used the -updateLists flag correctly). The command also implements the expanding/collapsing mechanism.

Due to the method the lists’ view modes work, a weight list needs one dataPoint list it can relate to (and vice-versa). Since you might want more than one such pair, each list has a dataID. If a weight and a dataPoint list have the same dataID, they can see each other and their view modes work with the other list’s selection. In case two weight lists (or two dataPoint lists) have the same ID, they behave as if they show the same data. That means if you select or expand something in one list, the other will also have that item selected or expanded (in the same mode). The lists, however, can have different view modes. This allows for a nice feature when you have one weight list’s selection drive the content of another weight list, etc..

Return Value

various - depending on the specified flags

UI Flags - Edit

Here’s a list of UI flags that can be used in the command’s edit mode (with the -edit flag).

Flags (short/long)Argument(s)Return

-rl/-registerList

string

 

Registers the specified TSL for the given bcs node. The type of the list is specified using the -lt flag. Use the -lid flag to define the dataID of the new list entry. The -lm flag can be used to set the initial mode of the list.

Warning

When querying the list, you always have to use the exact same string with which you’ve registered the list (even when Maya can refer to the TSL with the short and long name).

Since registering a TSL as a weight or dataPoint list will occupy the selectCommand and doubleClickCommand of the TSL, these commands are provided by the bcs command. Use the -sc and/or -dcc flags to specify the needed commands through the bcs. The current sc and dcc commands of the TSL are lost.

You can use the -lo, -lsc, and -sm flags to further configure the list.

-dl/-deregisterList

 

 

Removes the specified TSL from the internal list table and frees it for other uses (such as registering it for a different bcs node). If used as a scriptJob, the -job flag has to be specified too. The list is specified as the argument to the command.

-j/-job

 

 

Used in conjunction with the -dl flag to specify that the deregistration happens in a scriptJob.

-lm/-listMode

string

 

Specifies the list mode when registering lists. If the command arg is a registered TSL, its mode is set to the given flag arg.

Values for weight lists: all, selected, related, or validOnly

Values for dp lists: all, selected, related, or included

-lid/-listDataID

int

 

Specifies the list’s dataID when registering lists. By default, a new dataID is reserved for the list.

-sc/-selectCommand

string

 

Since the selectCommand of a registered TSL is occupied by the bcs command, you can use this to add/change a selectCommand that is called after the internal list processing. The list is specified as the argument to the command.

-dcc/-doubleClickCommand

string

 

Since the doubleClickCommand of a registered TSL is occupied by the bcs command, you can use this to add/change a doubleClickCommand that is called after the internal list processing. The list is specified as the argument to the command.

-lo/-listOffset

int

 

Used to specify the number of unselected items above the first selected item in the list. This has an effect on the list when its selection is changed indirectly. This is the case when changing its mode or when adding/deleting an item. Collapsing and expanding also rebuilds the lists and thus changes the selection. Default is 5.

-lsc/-listSepChar

string

 

This string is used by dataPoint lists to separate the weights of a group. Default is "*".

-sm/-sortMethod

bool

 

Specifies the sorting method for dataPoint lists. If set to false (the default), sorts the dataPoint groups so that the group with the least used weights is the first and the one with the most used weights the last. If true, the groups are sorted based on the first weight’s index.

-ws/-weightSelection

 

 

Used as callback for selection changes of weightLists. Will update all lists with the same dataID (except the specified one). The list is specified as the argument to the command.

-dps/-dataPointSelection

 

 

Used as callback for selection changes of dataPointLists. Will update all lists with the same dataID (except the specified one). The list is specified as the argument to the command.

-wex/-weightExpand

 

 

Toggles expand state of selected items in the weightList. The list is specified as the argument to the command.

-dex/-dataPointExpand

 

 

Toggles expand state of selected items in the dataPointList. The list is specified as the argument to the command.

-exp/-expand

bool

 

Expands or collapses the weights, wPosGrps, and/or dataPointGroups (specified using the -w, -wpg, and -dpg flags).

If the command arg is a bcs node, the -lm flag can be used to specify the mode in which the items should be edited and the -lid flag has to be present to specify the dataID.

If the command arg is a TSL, its mode and dataID is used.

If the bool argument of this flag is true, expands the items, if it is false, collapses them.

If an item that should be expanded is not visible in the list, either due to its parent being collapsed (only wPosGrps), or due to it not being listed in the mode, it cannot be edited. The parent weight is not expanded even if this would make the wPosGrp visible.

-sl/-select

bool

 

Selects the weights, wPosGrps, weightPositions, dataPoints, and/or dataPointGroups (specified using the -w, -wpg, -wp, -dp, and -dpg flags).

The -lm and -lid flags can be used to specify the lists to select in. If the command argument is a TSL, these two flags can be omitted.

If the -ul flag is given, all affected TSLs are updated.

If the bool argument of this flag is true, replaces the current selection with the specified one (only the selection of the specified types is replaced). If it is false, the specified items are added to the current selection.

If an item that should be selected is not visible in the list, either due to its parent being collapsed, or due to it not being listed in the mode, it cannot be selected. The parent item is not expanded even if this would make the item visible.

Returns the number of items that are newly selected.

-ul/-updateLists

 

 

This will sync the registered TSLs with the node’s data. You can also specify it together with all flag combinations that change weights or dataPoints in a way that has an effect on the lists.

Use this after one or a series of calls that change the node. E.g., when you’ve deleted dataPoints, the lists are not updated automatically. This is done to avoid many redundant (and slow) updates when many calls are performed in a row. After such calls, this flag ensures all UI lists contain the most current data.

If used together with the -undo flag, does the list update in an undo and not in the actual call. Use this before a series of calls that change the node.

If used with the -redo flag, does the update in a redo of the action. Use after a series of calls that change the node.

The -force flag can be used to force an update of all lists, even those that are not marked as dirty.

-u/-undo

 

 

Used together with the -ul flag. See its description.

-r/-redo

 

 

Used together with the -ul flag. See its description.

UI Flags - Query

Here’s a list of UI flags that can be used in the command’s query mode (with the -query flag).

Flags (short/long)Argument(s)Return

-awl/-allWeightLists

 

string[]

Returns a string array with all weightLists of the given bcs node.

-adl/-allDataPointLists

 

string[]

Returns a string array with all dataPointLists of the given bcs node.

-lt/-listType

 

string

Returns the type of the given TSL. The return string can be either "weightList", "dataPointList", or empty when the list is not registered.

-lm/-listMode

 

string

Returns the mode of the list. The list is specified as the argument to the command. Possible return values are:

For weight lists: all, selected, related, or validOnly

For dp lists: all, selected, related, or included

-lid/-listDataID

 

int/int[]

Returns the specified list’s dataID. If the command arg is not a registered TSL but a bcs node, returns all dataIDs that exist for the bcs node.

-sc/-selectCommand

 

string

Returns the selectCommand that is registered for the list.

-dcc/-doubleClickCommand

 

string

Returns the doubleClickCommand that is registered for the list.

-ws/-weightSelection

string int

int[]

Returns the selected weights, wPosGrps, or weightPositions, depending on which of the three flags (-gw, -gwpg, or -gwp) is specified.

When -gwpg and -gwp are both specified, returns the selected wPosGrps and those, weightPositions of which are selected.

With -gw and -gwpg and/or -gwp, returns the selected weights and those, wPosGrps (or weightPositions) of which are selected.

The arguments to this flag are the mode and the dataID of which we want the selection. The command argument should be the bcs node. If the command arg is a TSL that is registered with the command, the flag args are ignored and the mode, dataID, and bcs node of the list are used. (-num)

-dps/-dataPointSelection

string int

int[]

Returns the selected dataPoints or dataPointGroups, depending on which of the flags (-gdp or -gdpg) is specified.

If -gdpg and -gdp are both specified, returns the selected dpGroups and those, dataPoints of which are selected.

The arguments to this flag are the mode and the dataID of which we want the selection. The command argument should be the bcs node. If the command arg is a TSL that is registered with the command, the flag args are ignored and the mode, dataID, and bcs node of the list are used. (-num)

Examples

// Create a bcs node with the currently selected objects.
DPK_bcs;
// Result: DPK_bcs1 //


// Get the number of created weights.
DPK_bcs -q -gw -num "DPK_bcs1";
// Result: 4 //


// Create a dataPoint that is the combination of the first and second weight.
// To do this, we first need the wPositions of these weights.
int $pos[] = `DPK_bcs -q -gwp -w {0,1} "DPK_bcs1"`;
// Result: 1 2 //


// Using these weightPositions as a dataPointPosition, we'll create a new dp.
int $dp = `DPK_bcs -edit -cdp -dpp $pos "DPK_bcs1"`;
// Result: 4 //


// To allow us to edit this dataPoint, we create absolute geometry for it.
DPK_bcs -edit -dp $dp -gt "edit" -gm true "DPK_bcs1";
// Result: AU12_AU27 //