Which code sets an animated value on an attribute at frame 24?
- Exam domain
- Data Modeling13% of the exam
- Difficulty
- Medium
- In this mock
- 7 questions on this domainPractise this domain
Why the exam asks this
Data Modeling (13% of the exam)
Objective in the exam guide: Prims, properties, primvars, value types, timeSamples and built-in schemas
timeSamples are named.
Why C is the answer
attr.Set(value, Usd.TimeCode(24))
Set takes an optional time code. Without one, the default value is written; with one, a time sample is written.
Remember: Pass a time code to Set.
How it works
Attributes hold a default plus optional time samples.
In detail
- Set(value, time) writes a sample.
- Set(value) writes the default.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. attr.SetMetadata("frame", 24) and then attr.Set(value)Wrong
There is no frame metadata for samples.
B. stage.SetTimeCode(24, attr, value)Wrong
Stages have no such method.
C. attr.Set(value, Usd.TimeCode(24))Right
Pass a time code to Set.
D. attr.Set(value) followed by stage.SetStartTimeCode(24) so the value starts at that frameWrongMost tempting
That writes the default and changes the stage range.
Why it tempts: Stage time range sounds related.
Use case
An illustrative scenario, not a real incident.
Illustrative: a converter writes a joint rotation at every frame with Set(value, time).
See it in different ways
stateDiagram-v2 state "No opinion" as s0 state "Default value" as s1 state "Time-sampled" as s2 [*] --> s0 s0 --> s1: Set value s1 --> s2: Set value with time s2 --> [*]
How to read this chart
- It starts at "No opinion".
- From "No opinion", "Set value" moves it to "Default value".
- From "Default value", "Set value with time" moves it to "Time-sampled".
- It ends at "Time-sampled".
flowchart LR S0["Get attribute"] --> S1["Loop frames"] --> S2["Set value with TimeCode"] --> S3["Save"]
How to read this chart
- Read it in order: Get attribute, then Loop frames, then Set value with TimeCode, then Save.