Go to: Synopsis. Return value. Related. Flags. Python examples.
lightlink(
objects
, [b=boolean], [hierarchy=boolean], [light=name], [make=boolean], [object=name], [sets=boolean], [shapes=boolean], [transforms=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
lightlink is undoable, queryable, and NOT editable.
This command is used to make, break and query light linking
relationships between lights/sets of lights and objects/sets of
objects.
If no make, break or query flag is specified and both lights and
objects flags are present, the make flag is assumed to be specified.
If no make, break or query flag is specified and only one of the
lights and objects flags is present, the query flag is assumed to be
specified.
You can specify as many lights and objects as you like, using the
multiuse -light and -object flags.
A better way to perform light linking is to make sets of lights and
sets of geometry. If you create a set which contains lights (such as
the ceiling lights in your scene) and a set which contains geometry
(such as the geometry of your character), you can then link the
set containing lights with the set containing geometry
in order to get those lights to illuminate those pieces of geometry.
In addition, you can add and remove lights and geometry from their
respective sets without having to make and break light links.
In query mode, return type is based on queried flag.
ambientLight, directionalLight, exclusiveLightCheckBox, lightList, pointLight, spotLight, spotLightPreviewPort
b, hierarchy, light, make, object, sets, shapes, transforms
Long name (short name) |
Argument types |
Properties |
make(m)
|
boolean
|
|
|
The presence of this flag on the command indicates that the
command is being invoked to make links between lights and
renderable objects.
|
|
b(b)
|
boolean
|
|
|
The presence of this flag on the command indicates that the
command is being invoked to break links between lights and
renderable objects.
|
|
light(l)
|
name
|
|
|
The argument to the light flag specifies a node to be used by
the command in performing the action as if the node is a light.
This is a multiuse flag -- many light nodes can be specified in
a single invocation of the lightlink command.
|
|
object(o)
|
name
|
|
|
The argument to the object flag specifies a node to be used by
the command in performing the action as if the node is an object.
This is a multiuse flag -- many object nodes can be specified in
a single invocation of the lightlink command.
|
|
shapes(shp)
|
boolean
|
|
|
When querying, specifies whether the result should include shapes
linked to the queried light/object. Default is true.
|
|
transforms(t)
|
boolean
|
|
|
When querying, specifies whether the result should include
transforms immediately above shapes linked to the queried
light/object. Default is true.
|
|
hierarchy(h)
|
boolean
|
|
|
When querying, specifies whether the result should include the
hierarchy of transforms above shapes linked to the queried
light/object. The transforms considered part of the hierarchy do
not include the transform immediately above the shape. Default
is true.
|
|
sets(set)
|
boolean
|
|
|
When querying, specifies whether the result should include sets
linked to the queried light/object. Default is true.
|
|
Flag can appear in Create mode of command
|
Flag can appear in Edit mode of command
|
Flag can appear in Query mode of command
|
Flag can have multiple arguments, passed either as a tuple or a list.
|
import maya.cmds as cmds
cmds.lightlink( light=('spotLight1', 'pointLight2', 'ambientLight4'), object=('apple', 'orange', 'banana') )
# causes a light link to be "created between" each of the lights
# spotLight1, pointLight2, ambientLight4 and each of the objects
# apple, orange, banana. This creates 9 links. Note that no make,
# break or query flag is specified so make is assumed since both
# lights and objects are specified.
cmds.lightlink( make=True, light='ceilingLightSet', object='apple' )
# causes a light link to be "created between" the ceiling lights and
# the apple geometry. If apple is already illuminated by
# ceilingLightSet, then nothing changes and a warning is produced.
cmds.lightlink( object='stillLifeSet', light='spotLight1' )
# causes a light link to be "created between" spotLight1 and the still
# life. If stillLifeSet is already illuminated by spotLight1, then
# nothing changes and a warning is produced. Note: no make, break or
# query flag is specified so the make flag is assumed since both lights
# and objects are specified.
cmds.lightlink( light=('ceilingLightSet', 'floorLightSet'), object='tableAndChairsSet' )
# causes a light link to be "created between" each of the light sets
# ceilingLightSet, floorLightSet and the object set tableAndChairsSet.
cmds.lightlink( query=True, light='ceilingLightSet' )
# will return a string array of objects which are illuminated by the
# set ceilingLightSet. For example, the return value might be:
# stillLifeSet table chair floor roomWallsSet binky
cmds.lightlink( query=True, object='apple' )
# will return a string array of lights which illuminate the object
# apple. For example, the return value might be ceilingLightSet
# spotLight1 spotLight2 ambientLight1
cmds.lightlink( object='apple' )
# will return a string array of lights which illuminate the object
# apple. For example, the return value might be ceilingLightSet
# spotLight1 spotLight2 ambientLight1. Note that no make, break
# or query flag is specified, so query is assumed since no lights
# are specified.
cmds.lightlink( b=True, light='ceilingLightSet', object='apple' )
# causes the light set ceilingLightSet to no longer illuminate the
# object apple. If ceilingLightSet was already not illuminating apple,
# nothing changes and a warning is produced.