Merge branch 'blender-v4.2-release'
This also reverts da2a262658a396 and 57e925b38feb19b and fixes a merge conflict in `action.cc`.
This commit is contained in:
commit
5360722449
@ -127,8 +127,12 @@ template<typename T> static void shrink_array(T **array, int *num, const int shr
|
||||
|
||||
bool Action::is_empty() const
|
||||
{
|
||||
/* The check for emptyness has to include the check for an empty `groups` ListBase because of the
|
||||
* animation filtering code. With the functions `rearrange_action_channels` and
|
||||
* `join_groups_action_temp` the ownership of FCurves is temporarily transferred to the `groups`
|
||||
* ListBase leaving `curves` potentially empty. */
|
||||
return this->layer_array_num == 0 && this->slot_array_num == 0 &&
|
||||
BLI_listbase_is_empty(&this->curves);
|
||||
BLI_listbase_is_empty(&this->curves) && BLI_listbase_is_empty(&this->groups);
|
||||
}
|
||||
bool Action::is_action_legacy() const
|
||||
{
|
||||
@ -140,7 +144,7 @@ bool Action::is_action_layered() const
|
||||
/* This is a valid layered Action if there is ANY layered info (because that
|
||||
* takes precedence) or when there is no legacy info. */
|
||||
return this->layer_array_num > 0 || this->slot_array_num > 0 ||
|
||||
BLI_listbase_is_empty(&this->curves);
|
||||
(BLI_listbase_is_empty(&this->curves) && BLI_listbase_is_empty(&this->groups));
|
||||
}
|
||||
|
||||
blender::Span<const Layer *> Action::layers() const
|
||||
|
@ -275,14 +275,17 @@ void VolumeGridData::ensure_grid_loaded() const
|
||||
});
|
||||
if (!loaded_grid) {
|
||||
if (grid_) {
|
||||
/* Create a dummy grid of the expected type. */
|
||||
loaded_grid = grid_->createGrid("");
|
||||
}
|
||||
else {
|
||||
/* Create a dummy grid. We can't really know the expected data type here. */
|
||||
loaded_grid = openvdb::FloatGrid::create();
|
||||
const openvdb::Name &grid_type = grid_->type();
|
||||
if (openvdb::GridBase::isRegistered(grid_type)) {
|
||||
/* Create a dummy grid of the expected type. */
|
||||
loaded_grid = openvdb::GridBase::createGrid(grid_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!loaded_grid) {
|
||||
/* Create a dummy grid. We can't really know the expected data type here. */
|
||||
loaded_grid = openvdb::FloatGrid::create();
|
||||
}
|
||||
BLI_assert(loaded_grid);
|
||||
BLI_assert(loaded_grid.unique());
|
||||
BLI_assert(loaded_grid->isTreeUnique());
|
||||
|
@ -144,8 +144,10 @@ static void world_blend_write(BlendWriter *writer, ID *id, const void *id_addres
|
||||
{
|
||||
World *wrld = (World *)id;
|
||||
|
||||
/* Clean up, important in undo case to reduce false detection of changed datablocks. */
|
||||
/* Clean up runtime data, important in undo case to reduce false detection of changed
|
||||
* datablocks. */
|
||||
BLI_listbase_clear(&wrld->gpumaterial);
|
||||
wrld->last_update = 0;
|
||||
|
||||
/* write LibData */
|
||||
BLO_write_id_struct(writer, World, id_address, &wrld->id);
|
||||
@ -226,4 +228,5 @@ void BKE_world_eval(Depsgraph *depsgraph, World *world)
|
||||
{
|
||||
DEG_debug_print_eval(depsgraph, __func__, world->id.name, world);
|
||||
GPU_material_free(&world->gpumaterial);
|
||||
world->last_update = DEG_get_update_count(depsgraph);
|
||||
}
|
||||
|
@ -175,7 +175,6 @@ void Instance::update_eval_members()
|
||||
void Instance::view_update()
|
||||
{
|
||||
sampling.reset();
|
||||
sync.view_update();
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
@ -318,6 +318,11 @@ class Instance {
|
||||
return flags;
|
||||
}
|
||||
|
||||
int get_recalc_flags(const ::World &world)
|
||||
{
|
||||
return world.last_update > depsgraph_last_update_ ? ID_RECALC_SHADING : 0;
|
||||
}
|
||||
|
||||
private:
|
||||
static void object_sync_render(void *instance_,
|
||||
Object *ob,
|
||||
|
@ -34,13 +34,6 @@ namespace blender::eevee {
|
||||
*
|
||||
* \{ */
|
||||
|
||||
void SyncModule::view_update()
|
||||
{
|
||||
if (DEG_id_type_updated(inst_.depsgraph, ID_WO)) {
|
||||
world_updated_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
ObjectHandle &SyncModule::sync_object(const ObjectRef &ob_ref)
|
||||
{
|
||||
ObjectKey key(ob_ref.object);
|
||||
@ -56,11 +49,10 @@ ObjectHandle &SyncModule::sync_object(const ObjectRef &ob_ref)
|
||||
return handle;
|
||||
}
|
||||
|
||||
WorldHandle SyncModule::sync_world()
|
||||
WorldHandle SyncModule::sync_world(const ::World &world)
|
||||
{
|
||||
WorldHandle handle;
|
||||
handle.recalc = world_updated_ ? int(ID_RECALC_SHADING) : 0;
|
||||
world_updated_ = false;
|
||||
handle.recalc = inst_.get_recalc_flags(world);
|
||||
return handle;
|
||||
}
|
||||
|
||||
|
@ -155,16 +155,12 @@ class SyncModule {
|
||||
|
||||
Map<ObjectKey, ObjectHandle> ob_handles = {};
|
||||
|
||||
bool world_updated_ = false;
|
||||
|
||||
public:
|
||||
SyncModule(Instance &inst) : inst_(inst){};
|
||||
~SyncModule(){};
|
||||
|
||||
void view_update();
|
||||
|
||||
ObjectHandle &sync_object(const ObjectRef &ob_ref);
|
||||
WorldHandle sync_world();
|
||||
WorldHandle sync_world(const ::World &world);
|
||||
|
||||
void sync_mesh(Object *ob,
|
||||
ObjectHandle &ob_handle,
|
||||
|
@ -104,7 +104,7 @@ void World::sync()
|
||||
WorldHandle wo_handle = {0};
|
||||
if (inst_.scene->world != nullptr) {
|
||||
/* Detect world update before overriding it. */
|
||||
wo_handle = inst_.sync.sync_world();
|
||||
wo_handle = inst_.sync.sync_world(*inst_.scene->world);
|
||||
has_update = wo_handle.recalc != 0;
|
||||
}
|
||||
|
||||
|
@ -91,8 +91,13 @@ typedef struct World {
|
||||
/** Light-group membership information. */
|
||||
struct LightgroupMembership *lightgroup;
|
||||
|
||||
void *_pad1;
|
||||
|
||||
/** Runtime. */
|
||||
ListBase gpumaterial;
|
||||
/* The Depsgraph::update_count when this World was last updated. */
|
||||
uint64_t last_update;
|
||||
|
||||
} World;
|
||||
|
||||
/* **************** WORLD ********************* */
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "NOD_socket.hh"
|
||||
#include "NOD_socket_search_link.hh"
|
||||
|
||||
#include "RNA_access.hh"
|
||||
#include "RNA_enum_types.hh"
|
||||
|
||||
namespace blender::nodes {
|
||||
|
Loading…
Reference in New Issue
Block a user