Add possibility to render USD file for testing purposes #49

Merged
Bogdan Nagirniak merged 4 commits from BLEN-428 into hydra-render 2023-06-02 13:07:31 +02:00
Showing only changes of commit 5770b07915 - Show all commits

View File

@ -43,6 +43,8 @@ Engine::Engine(RenderEngine *bl_engine, const std::string &render_delegate_name)
render_index_.reset(pxr::HdRenderIndex::New(render_delegate_.Get(), hd_drivers)); render_index_.reset(pxr::HdRenderIndex::New(render_delegate_.Get(), hd_drivers));
free_camera_delegate_ = std::make_unique<pxr::HdxFreeCameraSceneDelegate>( free_camera_delegate_ = std::make_unique<pxr::HdxFreeCameraSceneDelegate>(
render_index_.get(), pxr::SdfPath::AbsoluteRootPath().AppendElementString("freeCamera")); render_index_.get(), pxr::SdfPath::AbsoluteRootPath().AppendElementString("freeCamera"));
scene_delegate_ = std::make_unique<BlenderSceneDelegate>(
render_index_.get(), pxr::SdfPath::AbsoluteRootPath().AppendElementString("scene"), this);
render_task_delegate_ = std::make_unique<RenderTaskDelegate>( render_task_delegate_ = std::make_unique<RenderTaskDelegate>(
render_index_.get(), pxr::SdfPath::AbsoluteRootPath().AppendElementString("renderTask")); render_index_.get(), pxr::SdfPath::AbsoluteRootPath().AppendElementString("renderTask"));
if (render_delegate_name == "HdStormRendererPlugin") { if (render_delegate_name == "HdStormRendererPlugin") {
@ -56,10 +58,6 @@ Engine::Engine(RenderEngine *bl_engine, const std::string &render_delegate_name)
void Engine::sync(Depsgraph *depsgraph, bContext *context) void Engine::sync(Depsgraph *depsgraph, bContext *context)
{ {
if (!scene_delegate_) {
scene_delegate_ = std::make_unique<BlenderSceneDelegate>(
render_index_.get(), pxr::SdfPath::AbsoluteRootPath().AppendElementString("scene"), this);
}
scene_delegate_->populate(depsgraph, context); scene_delegate_->populate(depsgraph, context);
} }