forked from blender/blender
Recreate PreviewEngine when render_delegate_name is changed #36
@ -25,7 +25,7 @@ Engine::Engine(RenderEngine *bl_engine, const std::string &render_delegate_name)
|
||||
pxr::TF_PY_ALLOW_THREADS_IN_SCOPE();
|
||||
render_delegate_ = registry.CreateRenderDelegate(pxr::TfToken(render_delegate_name_));
|
||||
|
||||
/* Current USD (23.02) has limited support for Vulkan. To make it works USD should be built
|
||||
/* USD has limited support for Vulkan. To make it works USD should be built
|
||||
* with PXR_ENABLE_VULKAN_SUPPORT=TRUE which is not possible now */
|
||||
if (GPU_backend_get_type() == GPU_BACKEND_VULKAN) {
|
||||
BLI_setenv("HGI_ENABLE_VULKAN", "1");
|
||||
|
@ -15,7 +15,7 @@ CLG_LOGREF_DECLARE_GLOBAL(LOG_RENDER_HYDRA_SCENE, "render.hydra.scene");
|
||||
BlenderSceneDelegate::BlenderSceneDelegate(pxr::HdRenderIndex *parent_index,
|
||||
pxr::SdfPath const &delegate_id,
|
||||
BlenderSceneDelegate::EngineType engine_type,
|
||||
std::string render_delegate_name)
|
||||
const std::string &render_delegate_name)
|
||||
: HdSceneDelegate(parent_index, delegate_id),
|
||||
engine_type(engine_type),
|
||||
render_delegate_name(render_delegate_name)
|
||||
@ -258,6 +258,8 @@ InstancerData *BlenderSceneDelegate::instancer_data(pxr::SdfPath const &id, bool
|
||||
{
|
||||
pxr::SdfPath p_id;
|
||||
if (child_id) {
|
||||
/* Getting instancer path id from child Mesh instance (consist with 3 path elements) and
|
||||
* Light instance (consist with 4 path elements) */
|
||||
int n = id.GetPathElementCount();
|
||||
if (n == 3) {
|
||||
p_id = id.GetParentPath();
|
||||
|
@ -30,7 +30,7 @@ class BlenderSceneDelegate : public pxr::HdSceneDelegate {
|
||||
BlenderSceneDelegate(pxr::HdRenderIndex *parent_index,
|
||||
pxr::SdfPath const &delegate_id,
|
||||
BlenderSceneDelegate::EngineType engine_type,
|
||||
std::string render_delegate_name);
|
||||
const std::string &render_delegate_name);
|
||||
~BlenderSceneDelegate() override = default;
|
||||
|
||||
/* Delegate methods */
|
||||
|
Loading…
Reference in New Issue
Block a user