BLEN-335: Export environment light #1

Merged
Bogdan Nagirniak merged 13 commits from BLEN-335 into hydra-render 2023-02-17 14:46:46 +01:00
2 changed files with 8 additions and 8 deletions
Showing only changes of commit a9dbaa1207 - Show all commits

View File

@ -50,14 +50,14 @@ void BlenderSceneDelegate::update_material(Material *material)
}
}
void BlenderSceneDelegate::add_world(View3DShading &view3DShading, World &world)
void BlenderSceneDelegate::add_world(View3DShading *view3DShading, World *world)
{
SdfPath world_light_id = world_id(&view3DShading);
SdfPath world_light_id = world_id(view3DShading);
LOG(INFO) << "Add world: " << world_light_id;
if (world_data.shading != &view3DShading || world_data.world != &world) {
world_data = WorldData(&view3DShading, &world);
if (world_data.shading != view3DShading || world_data.world != world) {
world_data = WorldData(view3DShading, world);
GetRenderIndex().InsertSprim(HdPrimTypeTokens->domeLight, this, world_light_id);
}
else {
@ -262,7 +262,7 @@ void BlenderSceneDelegate::Populate(BL::Depsgraph &b_deps, View3D *v3d)
World *world = (World *)b_depsgraph->scene().world().ptr.data;
add_world(view3d->shading, *world);
add_world(&view3d->shading, world);
is_populated = true;
return;
@ -315,13 +315,13 @@ void BlenderSceneDelegate::Populate(BL::Depsgraph &b_deps, View3D *v3d)
if (id.is_a(&RNA_World)) {
World *world = (World *)b_depsgraph->scene().world().ptr.data;
add_world(view3d->shading, *world);
add_world(&view3d->shading, world);
continue;
}
if (id.is_a(&RNA_ShaderNodeTree)) {
World *world = (World *)b_depsgraph->scene().world().ptr.data;
add_world(view3d->shading, *world);
add_world(&view3d->shading, world);
continue;
}
}

View File

@ -50,7 +50,7 @@ private:
void update_material(Material *material);
void update_collection();
void update_visibility();
void add_world(View3DShading &view3DShading, World &world);
void add_world(View3DShading *view3DShading, World *world);
SdfPath world_id(View3DShading *view3DShading);
private: