Merge branch 'blender-v4.0-release' into main
This commit is contained in:
@@ -1460,12 +1460,15 @@ macro(find_python_module_file
|
||||
)
|
||||
if(${out_var_abs})
|
||||
set(_${out_var_abs}_DEPS "${_python_mod_file_deps_test}" CACHE STRING "")
|
||||
string(LENGTH "${_python_root}" _python_root_len)
|
||||
string(SUBSTRING ${${out_var_abs}} ${_python_root_len} -1 ${out_var_rel})
|
||||
unset(_python_root_len)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(${out_var_abs})
|
||||
string(LENGTH "${_python_root}" _python_root_len)
|
||||
string(SUBSTRING ${${out_var_abs}} ${_python_root_len} -1 ${out_var_rel})
|
||||
unset(_python_root_len)
|
||||
endif()
|
||||
|
||||
unset(_python_mod_file_deps_test)
|
||||
unset(_python_base)
|
||||
unset(_python_root)
|
||||
|
||||
@@ -1335,6 +1335,7 @@ url_manual_mapping = (
|
||||
("bpy.types.geometrynodeindexofnearest*", "modeling/geometry_nodes/geometry/sample/index_of_nearest.html#bpy-types-geometrynodeindexofnearest"),
|
||||
("bpy.types.geometrynodeinputcurvetilt*", "modeling/geometry_nodes/curve/read/curve_tilt.html#bpy-types-geometrynodeinputcurvetilt"),
|
||||
("bpy.types.geometrynodeinputscenetime*", "modeling/geometry_nodes/input/scene/scene_time.html#bpy-types-geometrynodeinputscenetime"),
|
||||
("bpy.types.geometrynodepointstocurves*", "modeling/geometry_nodes/point/points_to_curves.html#bpy-types-geometrynodepointstocurves"),
|
||||
("bpy.types.geometrynodepointstovolume*", "modeling/geometry_nodes/point/points_to_volume.html#bpy-types-geometrynodepointstovolume"),
|
||||
("bpy.types.geometrynodescaleinstances*", "modeling/geometry_nodes/instances/scale_instances.html#bpy-types-geometrynodescaleinstances"),
|
||||
("bpy.types.geometrynodesetcurvenormal*", "modeling/geometry_nodes/curve/write/set_curve_normal.html#bpy-types-geometrynodesetcurvenormal"),
|
||||
|
||||
@@ -35,6 +35,7 @@ HydraSceneDelegate::HydraSceneDelegate(pxr::HdRenderIndex *parent_index,
|
||||
: HdSceneDelegate(parent_index, delegate_id)
|
||||
{
|
||||
instancer_data_ = std::make_unique<InstancerData>(this, instancer_prim_id());
|
||||
world_data_ = std::make_unique<WorldData>(this, world_prim_id());
|
||||
}
|
||||
|
||||
pxr::HdMeshTopology HydraSceneDelegate::GetMeshTopology(pxr::SdfPath const &id)
|
||||
@@ -214,7 +215,7 @@ void HydraSceneDelegate::populate(Depsgraph *deps, View3D *v3d)
|
||||
set_light_shading_settings();
|
||||
set_world_shading_settings();
|
||||
update_collection();
|
||||
update_world();
|
||||
world_data_->update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,26 +339,6 @@ InstancerData *HydraSceneDelegate::instancer_data(pxr::SdfPath const &id, bool c
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void HydraSceneDelegate::update_world()
|
||||
{
|
||||
if (!world_data_) {
|
||||
if (!shading_settings.use_scene_world || (shading_settings.use_scene_world && scene->world)) {
|
||||
world_data_ = std::make_unique<WorldData>(this, world_prim_id());
|
||||
world_data_->init();
|
||||
world_data_->insert();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!shading_settings.use_scene_world || (shading_settings.use_scene_world && scene->world)) {
|
||||
world_data_->update();
|
||||
}
|
||||
else {
|
||||
world_data_->remove();
|
||||
world_data_ = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HydraSceneDelegate::check_updates()
|
||||
{
|
||||
bool do_update_collection = false;
|
||||
@@ -406,9 +387,7 @@ void HydraSceneDelegate::check_updates()
|
||||
{
|
||||
do_update_collection = true;
|
||||
}
|
||||
if (id->recalc & ID_RECALC_AUDIO_VOLUME &&
|
||||
((scene->world && !world_data_) || (!scene->world && world_data_)))
|
||||
{
|
||||
if (id->recalc & ID_RECALC_AUDIO_VOLUME) {
|
||||
do_update_world = true;
|
||||
}
|
||||
break;
|
||||
@@ -421,7 +400,7 @@ void HydraSceneDelegate::check_updates()
|
||||
ITER_END;
|
||||
|
||||
if (do_update_world) {
|
||||
update_world();
|
||||
world_data_->update();
|
||||
}
|
||||
if (do_update_collection) {
|
||||
update_collection();
|
||||
|
||||
@@ -105,7 +105,6 @@ class HydraSceneDelegate : public pxr::HdSceneDelegate {
|
||||
MaterialData *material_data(pxr::SdfPath const &id) const;
|
||||
InstancerData *instancer_data(pxr::SdfPath const &id, bool child_id = false) const;
|
||||
|
||||
void update_world();
|
||||
void check_updates();
|
||||
void update_collection();
|
||||
bool set_light_shading_settings();
|
||||
|
||||
@@ -42,7 +42,6 @@ WorldData::WorldData(HydraSceneDelegate *scene_delegate, pxr::SdfPath const &pri
|
||||
void WorldData::init()
|
||||
{
|
||||
data_.clear();
|
||||
data_[pxr::UsdLuxTokens->orientToStageUpAxis] = true;
|
||||
|
||||
float intensity = 1.0f;
|
||||
float exposure = 1.0f;
|
||||
@@ -58,6 +57,9 @@ void WorldData::init()
|
||||
/* TODO: Create nodes parsing system */
|
||||
|
||||
bNode *output_node = ntreeShaderOutputNode(world->nodetree, SHD_OUTPUT_ALL);
|
||||
if (!output_node) {
|
||||
return;
|
||||
}
|
||||
const Span<bNodeSocket *> input_sockets = output_node->input_sockets();
|
||||
bNodeSocket *input_socket = nullptr;
|
||||
|
||||
@@ -127,6 +129,7 @@ void WorldData::init()
|
||||
}
|
||||
}
|
||||
|
||||
data_[pxr::UsdLuxTokens->orientToStageUpAxis] = true;
|
||||
data_[pxr::HdLightTokens->intensity] = intensity;
|
||||
data_[pxr::HdLightTokens->exposure] = exposure;
|
||||
data_[pxr::HdLightTokens->color] = color;
|
||||
@@ -138,9 +141,22 @@ void WorldData::init()
|
||||
void WorldData::update()
|
||||
{
|
||||
ID_LOG(1, "");
|
||||
init();
|
||||
scene_delegate_->GetRenderIndex().GetChangeTracker().MarkSprimDirty(prim_id,
|
||||
pxr::HdLight::AllDirty);
|
||||
|
||||
if (!scene_delegate_->shading_settings.use_scene_world ||
|
||||
(scene_delegate_->shading_settings.use_scene_world && scene_delegate_->scene->world))
|
||||
{
|
||||
init();
|
||||
if (data_.empty()) {
|
||||
remove();
|
||||
return;
|
||||
}
|
||||
insert();
|
||||
scene_delegate_->GetRenderIndex().GetChangeTracker().MarkSprimDirty(prim_id,
|
||||
pxr::HdLight::AllDirty);
|
||||
}
|
||||
else {
|
||||
remove();
|
||||
}
|
||||
}
|
||||
|
||||
void WorldData::write_transform()
|
||||
|
||||
Reference in New Issue
Block a user