mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
Evaluate xformOps at startTimeCode for static viewers
Set env.timecode to startTimeCode (if authored) when converting Stage to RenderScene. This ensures xformOps with TimeSamples are evaluated at the initial pose for static viewers like materialx.js that don't support animation playback. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -936,7 +936,11 @@ class TinyUSDZLoaderNative {
|
||||
// RenderScene: Scene graph object which is suited for GL/Vulkan renderer
|
||||
tinyusdz::tydra::RenderSceneConverter converter;
|
||||
|
||||
// env.timecode = timecode; // TODO
|
||||
// Set timecode to startTimeCode if authored, so xformOps with TimeSamples
|
||||
// are evaluated at the start time (initial pose) for static viewers
|
||||
if (stage.metas().startTimeCode.authored()) {
|
||||
env.timecode = stage.metas().startTimeCode.get_value();
|
||||
}
|
||||
loaded_ = converter.ConvertToRenderScene(env, &render_scene_);
|
||||
if (!loaded_) {
|
||||
std::cerr << "Failed to convert USD Stage to RenderScene: \n"
|
||||
@@ -1047,7 +1051,11 @@ class TinyUSDZLoaderNative {
|
||||
// RenderScene: Scene graph object which is suited for GL/Vulkan renderer
|
||||
tinyusdz::tydra::RenderSceneConverter converter;
|
||||
|
||||
// env.timecode = timecode; // TODO
|
||||
// Set timecode to startTimeCode if authored, so xformOps with TimeSamples
|
||||
// are evaluated at the start time (initial pose) for static viewers
|
||||
if (stage.metas().startTimeCode.authored()) {
|
||||
env.timecode = stage.metas().startTimeCode.get_value();
|
||||
}
|
||||
loaded_ = converter.ConvertToRenderScene(env, &render_scene_);
|
||||
if (!loaded_) {
|
||||
std::cerr << "Failed to convert USD Stage to RenderScene: \n"
|
||||
|
||||
Reference in New Issue
Block a user