Primitive Matching Patterns Flashcards

(69 cards)

1
Q

What is the purpose of the Primitives parameter in LOP nodes?

A

Selects which USD primitives the node applies to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can you define a path pattern that matches any number of characters in a name?

A

*

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What symbol matches any single character in a path pattern?

A

?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Fill in the blank: To match all children of /Kitchen, the pattern is _______.

A

/Kitchen/*

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the syntax ** match in a path pattern?

A

Any number of levels of hierarchy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you match all primitives specified by a collection attribute?

A

/path_to_prim.collection:collection_name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the shortcut syntax to match any prims specified by the KeyLights collection on the /House/LivingRoom primitive?

A

%/House/LivingRoom/KeyLights

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are auto collections in USD primitive patterns?

A

A collection-like mechanism invoked using the collection syntax

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the %abstract(auto_type) syntax do?

A

Matches all primitives that are abstract

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Fill in the blank: To match all primitives that are not active, the pattern is _______.

A

%active:false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the %defined(bool) syntax match?

A

Primitives that are defined or not defined

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does the %children(primpattern, strict=bool) syntax do?

A

Matches all children of another primitive or group of primitives

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

True or False: The %closerthan(primpath, distance) syntax matches all primitives more than a certain distance from a primitive.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the function of the %commonroots(primpattern) auto collection?

A

Matches the most deeply nested primitive that contains all primitives in the supplied pattern

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Fill in the blank: To match all primitives more than 10 units from /cameras/camera1, the pattern is _______.

A

%fartherthan:/cameras/camera1,10

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does the %foreach(primpattern, per_path_pattern) syntax do?

A

Matches all primitives that match the union of running the per_path_pattern for each primitive that matches the primary primpattern

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What does the %instance(primpath=None) syntax do?

A

Matches all primitives that share an instance prototype with the supplied primitive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Fill in the blank: To keep a subset of primitives that match the supplied primpattern, the syntax is %keep(______).

A

primpattern, start=int, end=int, count=int, interval=int

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What does the %geofrommat(primpattern, bindingpurpose) syntax match?

A

All primitives bound to a material

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the default value for the count argument in the %keep(primpattern) syntax?

A

1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

True or False: The %instanceproxy(bool) syntax matches all primitives that are instance proxies.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What does the %descendants(primpattern, strict=bool) syntax do?

A

Matches all descendants of another primitive or group of primitives

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What do the optional t arguments in auto collections specify?

A

The time range over which the bounding box is calculated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What does the command %keeprandom do?

A

Keeps a subset of primitives that match the supplied primpattern in a random order, then removes until only the specified fraction remains.

The defaults value is 0.5 for fraction and 0.0 for seed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is the purpose of the %kind function?
Match primitives based on their USD kind, with an optional strict argument to control matching of subkinds. ## Footnote Auto-collecting primitives with %kind(assembly) does not work as expected when applied to /root.
26
How do you match all primitives of kind group, including subkinds?
%kind:group ## Footnote This matches all subkinds of group.
27
How do you match all primitives of kind group, excluding subkinds?
%kind(group, strict=true) ## Footnote The strict argument is set to true.
28
What does the %lowest function do?
Matches primitives that match the pattern, ensuring that direct children do not also match. ## Footnote This is roughly the opposite of the highest auto collection.
29
What is the function of %matfromgeo?
Matches all materials bound to any primitive on a branch of the scene graph tree. ## Footnote Requires a path to specify the root of the scene graph branch.
30
What does the command %minimalset do?
Matches the minimal set of primitives needed for an inheritable value to be set on all listed primitives. ## Footnote Useful for minimizing the number of opinions authored.
31
What does the %noancestors function do?
Removes any primitive in the group that is an ancestor of any other primitive in the group.
32
How do you find all direct parents of a specific primitive?
%parents(‹primpattern›) ## Footnote The strict argument can be used to control the results.
33
What does the %payload function match?
Matches all primitives that have a payload composition arc.
34
What is the purpose of the %purpose function?
Matches all primitives with one of a set of purposes.
35
How do you match all primitives that reference a specific primitive?
%reference(‹primpattern›) ## Footnote This matches all primitives that reference, inherit from, or specialize the specified pattern.
36
What does the %referencedby function do?
Matches all primitives referenced by a specified pattern.
37
What does the %rel function match?
Matches all primitives targeted by a specified relationship.
38
What is the function of %rendercamera?
Matches the camera targeted by the default RenderSettings prim.
39
What does the %renderproducts function return?
Matches all RenderProducts targeted by the default RenderSettings prim.
40
What is the purpose of the %rendersettings function?
Matches the default render settings on the current stage.
41
How do you match all RenderVars targeted by RenderProducts?
%rendervars(‹primpath›) ## Footnote Can also specify a different RenderSettings prim.
42
What does the %rule function do?
Matches all primitives that satisfy a specified selection rule.
43
What is the purpose of the %shadertype function?
Matches all UsdShade primitives with a SourceId that matches provided patterns.
44
What does the %specifier function match?
Matches all primitives configured with one of the listed specifiers.
45
How do you match all primitives of a particular USD type?
%type(‹primtype1›, ‹primtype2›, …) ## Footnote The strict argument controls matching of derived types.
46
What does the %variant function match?
Matches all primitives with a particular variant set selection.
47
What does the %visible function check?
Matches all primitives that are visible or invisible based on the optional argument.
48
What is the use of VEX code enclosed in curly braces?
Evaluates to return 1 for match or 0 for no match.
49
How do you match primitives whose type is Mesh using VEX?
{ usd_istype(0, @primpath, "Mesh") } ## Footnote This checks if the primitive type matches Mesh.
50
What does the '+' operator do in pattern matching?
Combines two or more patterns to match primitives that match any of the sub-patterns.
51
How do you perform an intersection in pattern matching?
Use the '&' operator to select only primitives that match all sub-patterns.
52
What do the '-' or '^' operators do in pattern matching?
Subtracts prims that match the pattern on the right side from those on the left side.
53
What is the purpose of parentheses in pattern matching?
Groups patterns together to treat them as a single pattern.
54
What do the tokens << and >> select in pattern matching?
Select all ancestor or descendant primitives, respectively.
55
What does the Prune operator '~' do?
Stops traversal of the scene graph tree when a specified condition is found.
56
What is a common performance issue when evaluating primitive patterns?
Evaluating patterns can be expensive for very large scenes.
57
What is the purpose of the Prune operator (~)?
To stop the traversal of the scene graph tree when a component is found
58
What is the most efficient search in pattern evaluation?
A search that doesn’t happen
59
How can you improve performance when evaluating primitive patterns?
Use Pruning (~) to prevent traversals and limit the scope using And (&) operators
60
What does the And (&) operator do in pattern evaluation?
It uses information about one part of the pattern to limit the number of primitives evaluated against another part
61
What is a practical example of limiting traversal in VEX Expressions?
/world/props/** & { usd_iskind(0, @primpath, 'component') }
62
What happens when you match a primitive pattern that starts with *?
It requires a full traversal of the stage
63
How can providing a prefix in a pattern improve performance?
It confines the traversal to a specific branch, making it faster
64
What does the performance monitor pane’s node cook timing for LOP nodes do?
It separates out the time spent evaluating primitive patterns
65
What do the And (&) and Not (- or ^) operators bind to?
The closest single pattern on each side
66
How do you express '/* but not /b or /c' using grouping?
/* - (/a /b)
67
What is the function of the hou.LopSelectionRule object?
It evaluates the matching primitives given a stage and a primitive pattern string
68
Fill in the blank: A more efficient way to find Xforms outside of components is using _______.
[Prune operator ~]
69
True or False: The And operator can help reduce the number of primitives that run through VEX.
True