ls [-allPaths] [-assemblies] [-cameras] [-dagObjects] [-dependencyNodes] [-exactType string] [-flatten] [-geometry] [-ghost] [-head int] [-hilite] [-intermediateObjects] [-invisible] [-leaf] [-lights] [-live] [-long] [-materials] [-noIntermediate] [-nodeTypes] [-objectsOnly] [-partitions] [-planes] [-preSelectHilite] [-readOnly] [-recursive boolean] [-references] [-renderGlobals] [-renderQualities] [-renderResolutions] [-renderSetups] [-selection] [-sets] [-shapes] [-shortNames] [-showType] [-tail int] [-templated] [-textures] [-transforms] [-type string] [-untemplated] [-visible]
[object [object...]]
ls は 「元に戻す」が可能、「照会」が不可能、「編集」が不可能 です。
ls コマンドでは、シーン内のオブジェクトの名前(およびオプションでタイプ名)が返されます。
ls は一般的に、名前(ワイルドカードを含む)またはタイプに基づいて、オブジェクトのフィルタ処理または突き合せを行うのに使用します。
デフォルトでは ls コマンドはシーン内のすべてのオブジェクトと突き合せを行いますが、-selection フラグを併用すると、選択したオブジェクトをフィルタリングまたはリスト表示することができます。
-showType フラグを使用してタイプ名を要求すると、タイプ名とオブジェクト名が組み合わさり、結果は <object, type> 値というペアになります。
| string[] |
| ロング ネーム(ショート ネーム) | 引数型 | プロパティ | ||
|---|---|---|---|---|
-long(-l)
|
|
|
||
|
||||
-shortNames(-sn)
|
|
|
||
|
||||
-head(-hd)
|
int
|
|
||
|
||||
-tail(-tl)
|
int
|
|
||
|
||||
-type(-typ)
|
string
|
|
||
|
||||
-exactType(-et)
|
string
|
|
||
|
||||
-showType(-st)
|
|
|
||
|
||||
-objectsOnly(-o)
|
|
|
||
|
||||
-selection(-sl)
|
|
|
||
|
||||
-live(-lv)
|
|
|
||
|
||||
-hilite(-hl)
|
|
|
||
|
||||
-preSelectHilite(-psh)
|
|
|
||
|
||||
-geometry(-g)
|
|
|
||
|
||||
-dependencyNodes(-dep)
|
|
|
||
|
||||
-dagObjects(-dag)
|
|
|
||
|
||||
-leaf(-lf)
|
|
|
||
|
||||
-assemblies(-as)
|
|
|
||
|
||||
-allPaths(-ap)
|
|
|
||
|
||||
-transforms(-tr)
|
|
|
||
|
||||
-shapes(-s)
|
|
|
||
|
||||
-lights(-lt)
|
|
|
||
|
||||
-cameras(-ca)
|
|
|
||
|
||||
-planes(-pl)
|
|
|
||
|
||||
-partitions(-pr)
|
|
|
||
|
||||
-sets(-set)
|
|
|
||
|
||||
-textures(-tex)
|
|
|
||
|
||||
-materials(-mat)
|
|
|
||
|
||||
-renderQualities(-rq)
|
|
|
||
|
||||
-renderResolutions(-rr)
|
|
|
||
|
||||
-renderGlobals(-rg)
|
|
|
||
|
||||
-renderSetups(-rs)
|
|
|
||
|
||||
-nodeTypes(-nt)
|
|
|
||
|
||||
-readOnly(-ro)
|
|
|
||
|
||||
-flatten(-fl)
|
|
|
||
|
||||
-visible(-v)
|
|
|
||
|
||||
-invisible(-iv)
|
|
|
||
|
||||
-intermediateObjects(-io)
|
|
|
||
|
||||
-noIntermediate(-ni)
|
|
|
||
|
||||
-templated(-tm)
|
|
|
||
|
||||
-untemplated(-ut)
|
|
|
||
|
||||
-ghost(-gh)
|
|
|
||
|
||||
-recursive(-r)
|
boolean
|
|
||
|
||||
-references(-rf)
|
|
|
||
|
||||
// create some objects to operate on and select them all.
// Note that there are two objects named circle1;
circle -n circle1; group; circle -n circle1;
sphere -n sphere1; group; instance;
select -ado;
// list all objects
ls;
// List all selected objects
ls -selection;
// List all hilited objects
ls -hilite;
// List last selected object
ls -selection -tail 1;
// List all objects named "sphere1". Note that since sphere1 is
// instanced, the command below lists only the first instance.
ls sphere1;
// To list all instances of sphere1, use the -ap/allPaths flag.
ls -ap sphere1;
// List all selected objects named "group*"
ls -sl "group*";
// List all geometry, lights and cameras in the DAG.
ls -geometry -lights -cameras;
// List all shapes in the dag.
ls -shapes;
// One thing to note is that it is better to always use the
// -l/long flag when listing nodes without any filter. This is
// because there may be two nodes with the same name (in this
// example, circle1). 'ls' will list the names of all the objects
// in the scene. Objects with the same name need a qualified
// path name which uniquely identifies the object. A command
// to select all objects such as "select `ls`" will fail because
// the object lookup can't resolve which "circle1" object is
// intended. To select all objects, you need the following:
// select `ls -l`;
// When trying to find a list of all objects of a specific
// type, one approach might be to list all objects and then
// use the nodeType command to then filter the list. As in:
// string $allObjects[];
// string $obj;
// $allObjects = `ls -l`;
// for ( $obj in $allObjects ) {
// if ( `nodeType $obj` == "surfaceShape" ) {
// print ($obj + "\n");
// }
// }
//
// The problem with this is that 'nodeType' returns the
// most derived type of the node. In this example, "surfaceShape"
// is a base type for nurbsSurface so nothing will be printed.
// To do this properly, the -typ/type flag should be used
// to list objects of a specific type as in:
// $allObjects = `ls -type surfaceShape`;
// for ( $obj in $allObjects ) {
// print ($obj + "\n");
// }
// List all geometry shapes and their types
ls -type geometryShape -showType;
// List all paths to all leaf nodes in the DAG
ls -dag -lf -ap;
// List all nodes below the selected node
ls -dag -ap -sl;
// List all dag nodes that are read-only (i.e. referenced nodes)
ls -dag -ro;
// List all ghosting objects
ls -ghost;
// List reference nodes associated with specific files
ls -references;
// List all reference nodes, including unknown and shared reference
// nodes
ls -type reference;