Export arbitrary time samples - #4675
Conversation
…> guide type It was causing a coding error when -frameSample was used.
- UsdMayaWriteUtil::GetTimeSamples now takes an optional userTimeSamples vector, merged with the samples computed from frameRange subframeOffsets and stride, always included even when frameRange is empty. Duplicates are removed before merging, to avoid evaluating/writing the same frame twice. - Only validate stride when frameRange is actually used, since it has no effect otherwise. - Add a new timeSample token support to UsdMayaJobExportArgs, mirroring the frameSample token. - Add -timeSample/-ts flag to MayaUSDExportCommand. - On the MPxFileTranslator path, the timeSample option is gated by the animation option, matching the frameRange option's behaviour.
70df798 to
b9ae245
Compare
b9ae245 to
97fab8a
Compare
|
Hey @jufrantz! I discussed it with some folks on the team, there was some debate about whether instead we should improve frame range to support multiple ranges and individual frames ex: [1-10, 15, 18, 20-45], but it's true that individual frames would still get affected by the frameSample offset. So this new parameter would still be a benefit. However, we're wondering if "timeSample" is the clearest name for the parameter. Thanks! |
|
Hi @scottrenaud, Thanks for your feedback! Yes, definitely, supporting multiple frame ranges would be more interesting, and it would cover our use case. Having frameSample apply to those extra frames wouldn't be a problem for us either. That said, I'm not sure how to add this cleanly while keeping back-compatibility with the current command syntaxes ( For the single-frame parameter, the range specification differs between the command arguments and the options dict/options-string formats:
Rather than
Let me know what you think. Happy to go with Julien |
This PR adds a new
-timeSample/-tsflag toMayaUSDExportCommand(and the dictionary option on the MPxFileTranslator path), letting users export an explicit, arbitrary list of absolute time samples, regardless of-frameRange/-frameStride/-frameSample.We need this in some specific export workflows. It mirrors a capability available in Maya's
AbcExportplugin, which lets users repeat-frameRangewith single-point frameRanges to export isolated samples.Included Changes
UsdMayaWriteUtil::GetTimeSamplesnow takes an optionaluserTimeSamplesvector, merged with the samples computed fromframeRange,subframeOffsetsandstride, always included even whenframeRangeis empty. Duplicates are removed before merging, to avoid evaluating/writing the same frame twice.stridewhenframeRangeis actually used, since it has no effect otherwise.timeSampletoken support toUsdMayaJobExportArgs, mirroring theframeSampletoken.-timeSample/-tsflag toMayaUSDExportCommand.MPxFileTranslatorpath, thetimeSampleoption is gated by theanimationoption, matching theframeRangeoption's behaviour.UsdMayaUtil::GetDictionaryFromArgDatabaseto handlevector<double>guide type. It was already causing a coding error when-frameSamplewas used.-timeSampleflag inlib/mayaUsd/commands/Readme.md.