From 17a4040a895eac9de18de73e09292b027b54b40e Mon Sep 17 00:00:00 2001 From: cpichard Date: Mon, 23 Jan 2023 17:39:49 +0000 Subject: [PATCH] convert arnold fps to usd frame+timecode per second (#1399) --- translator/writer/writer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/translator/writer/writer.cpp b/translator/writer/writer.cpp index 94bb6ec58c..698a705c90 100644 --- a/translator/writer/writer.cpp +++ b/translator/writer/writer.cpp @@ -71,6 +71,13 @@ void UsdArnoldWriter::Write(const AtUniverse *universe) _shutterEnd = AiNodeGetFlt(camera, AtString("shutter_end")); } + AtNode *options = AiUniverseGetOptions(universe); + if (options) { + const float fps = AiNodeGetFlt(options, AtString("fps")); + _stage->GetRootLayer()->SetFramesPerSecond(static_cast(fps)); + _stage->GetRootLayer()->SetTimeCodesPerSecond(static_cast(fps)); + } + // If a specific time was requested, we want to check if some data was already written // to this USD stage for other frames. We do this by checking the scene custom metadata // "timeCodeArray" , that will contain the list of frames