57 PlugRegistry::GetInstance().RegisterPlugins(
path_get(
"usd"));
60 const UsdStageRefPtr stage = UsdStage::Open(filepath);
62 fprintf(stderr,
"%s read error\n", filepath);
67 const SdfPath root_path = SdfPath::AbsoluteRootPath();
68 const SdfPath task_path(
"/_hdCycles/DummyHdTask");
71 HdRenderSettingsMap settings_map;
72 settings_map.insert(std::make_pair(HdCyclesRenderSettingsTokens->stageMetersPerUnit,
73 VtValue(UsdGeomGetStageMetersPerUnit(stage))));
80 render_index.get(), root_path);
83 HdRprimCollection collection(HdTokens->geometry, HdReprSelector(HdReprTokens->smoothHull));
84 collection.SetRootPath(root_path);
86 render_index->InsertTask<
DummyHdTask>(scene_delegate.get(), task_path);
89 HdDirtyListSharedPtr dirty_list = std::make_shared<HdDirtyList>(collection,
90 *(render_index.get()));
91 render_index->EnqueuePrimsToSync(dirty_list, collection);
93 render_index->EnqueueCollectionToSync(collection);
97 const UsdPrim &stage_root = stage->GetPseudoRoot();
98 scene_delegate->Populate(stage_root.GetStage()->GetPrimAtPath(root_path), {});
101 HdTaskContext task_context;
102 HdTaskSharedPtrVector tasks;
103 tasks.push_back(render_index->GetTask(task_path));
105 render_index->SyncAll(&tasks, &task_context);
111 for (
const UsdPrim &prim : stage->Traverse()) {
112 if (prim.IsA<UsdGeomCamera>()) {
113 HdSprim *sprim = render_index->GetSprim(HdPrimTypeTokens->camera, prim.GetPath());