58 PlugRegistry::GetInstance().RegisterPlugins(
path_get(
"usd"));
61 const UsdStageRefPtr stage = UsdStage::Open(filepath);
63 LOG_ERROR <<
"USD failed to read " << filepath;
68 const SdfPath root_path = SdfPath::AbsoluteRootPath();
69 const SdfPath task_path(
"/_hdCycles/DummyHdTask");
72 HdRenderSettingsMap settings_map;
73 settings_map.insert(std::make_pair(HdCyclesRenderSettingsTokens->stageMetersPerUnit,
74 VtValue(UsdGeomGetStageMetersPerUnit(stage))));
81 render_index.get(), root_path);
84 HdRprimCollection collection(HdTokens->geometry, HdReprSelector(HdReprTokens->smoothHull));
85 collection.SetRootPath(root_path);
87 render_index->InsertTask<
DummyHdTask>(scene_delegate.get(), task_path);
90 HdDirtyListSharedPtr dirty_list = std::make_shared<HdDirtyList>(collection,
91 *(render_index.get()));
92 render_index->EnqueuePrimsToSync(dirty_list, collection);
94 render_index->EnqueueCollectionToSync(collection);
98 const UsdPrim &stage_root = stage->GetPseudoRoot();
99 scene_delegate->Populate(stage_root.GetStage()->GetPrimAtPath(root_path), {});
102 HdTaskContext task_context;
103 HdTaskSharedPtrVector tasks;
104 tasks.push_back(render_index->GetTask(task_path));
106 render_index->SyncAll(&tasks, &task_context);
112 for (
const UsdPrim &prim : stage->Traverse()) {
113 if (prim.IsA<UsdGeomCamera>()) {
114 HdSprim *sprim = render_index->GetSprim(HdPrimTypeTokens->camera, prim.GetPath());