99#include "RNA_prototypes.hh"
143 if (id_info->id_cow !=
nullptr) {
156 IDNode *id_node =
nullptr;
157 ID *id_cow =
nullptr;
162 if (id_info !=
nullptr) {
168 id_info->
id_cow =
nullptr;
170 id_node =
graph_->add_id_node(
id, id_cow);
176 const bool is_newly_created = id_node->
components.is_empty();
178 if (is_newly_created) {
184 graph_->operations.append(op_cow);
193 if (id_type ==
ID_OB) {
201 visibility_operation = visibility_component->
add_operation(
nullptr,
209 graph_->operations.append(visibility_operation);
216 return graph_->find_id_node(
id);
221 return graph_->add_time_source();
226 const char *comp_name)
230 comp_node->
owner = id_node;
236 const char *comp_name)
239 if (id_node ==
nullptr) {
252 if (op_node ==
nullptr) {
253 op_node = comp_node->
add_operation(op, opcode, name, name_tag);
254 graph_->operations.append(op_node);
258 "add_operation: Operation already exists - %s has %s at %p\n",
269 const char *comp_name,
291 const char *comp_name,
298 if (operation !=
nullptr) {
312 if (operation !=
nullptr) {
320 const char *comp_name,
337 const char *comp_name,
343 if (comp_node ==
nullptr) {
363 return graph_->get_cow_id(id_orig);
395 id_info->
id_cow =
nullptr;
402 id_node->
id_cow =
nullptr;
416 graph_->clear_all_nodes();
417 graph_->operations.clear();
418 graph_->entry_tags.clear();
434 if (id_pointer->
orig_id ==
nullptr) {
438 if (id_node !=
nullptr && id_node->
id_cow !=
nullptr) {
454 if (id_node ==
nullptr) {
538 if (operation_node ==
nullptr) {
551 if (operation_node ==
nullptr) {
699 const bool is_collection_restricted = (collection->
flag & visibility_flag);
702 if (
built_map_.checkIsBuiltAndTag(collection)) {
730 if (from_layer_collection !=
nullptr) {
757 const bool has_object =
built_map_.checkIsBuiltAndTag(
object);
770 id_node->
has_base |= (base_index != -1);
793 id_node->
has_base |= (base_index != -1);
802 if (object->
parent !=
nullptr) {
843 (object->
pd->
tex !=
nullptr))
873 BKE_object_sync_to_original(depsgraph, object_cow);
896 if (base_index == -1) {
907 [view_layer_index =
view_layer_index_, scene_cow, object_cow, base_index, is_from_set](
909 BKE_object_eval_eval_base_flags(
910 depsgraph, scene_cow, view_layer_index, object_cow, base_index, is_from_set);
940 deg_evaluate_object_modifiers_mode_node_visibility(depsgraph, id_node);
949 [id_node, modifier_index, modifier_node](
::Depsgraph * ) {
961 if ((
modifier->mode & modifier_mode) == 0) {
966 graph_->has_animated_visibility =
true;
983 if (object->
data ==
nullptr) {
987 switch (object->
type) {
1028 if (materials_ptr !=
nullptr) {
1059 if (parent ==
nullptr) {
1088 if (object->
parent !=
nullptr) {
1143 BKE_object_eval_constraints(depsgraph, scene_cow, object_cow);
1158 BKE_object_eval_ptcache_reset(depsgraph, scene_cow, object_cow);
1172 BKE_object_eval_light_linking(depsgraph, object_cow);
1175 graph_->light_linking_cache.add_emitter(*
graph_->scene, *
object);
1185 if (collection ==
nullptr) {
1236 if (adt ==
nullptr) {
1239 if (adt->
action !=
nullptr) {
1264 int driver_index = 0;
1274 if (strip->act !=
nullptr) {
1277 else if (strip->strips.first !=
nullptr) {
1287 bool has_image_animation =
false;
1292 has_image_animation =
true;
1366 scene_, target_prop, dtar->rna_path))
1377 const char *camera_path)
1381 if (!
ELEM(marker->camera,
nullptr, scene->
camera)) {
1389 const char *rna_path_from_target_prop)
1391 if (rna_path_from_target_prop ==
nullptr || rna_path_from_target_prop[0] ==
'\0') {
1401 if (prop ==
nullptr) {
1518 BKE_rigidbody_eval_simulation(depsgraph,
1525 if (rbw->
group !=
nullptr) {
1528 if (object->type !=
OB_MESH) {
1531 if (object->rigidbody_object ==
nullptr) {
1547 BKE_rigidbody_object_sync_transforms(depsgraph, scene_cow, object_cow);
1556 if (rbc ==
nullptr || rbc->
ob1 ==
nullptr || rbc->
ob2 ==
nullptr) {
1606 if (
ELEM(particle_target->ob,
nullptr,
object)) {
1632 if (
built_map_.checkIsBuiltAndTag(particle_settings)) {
1650 BKE_particle_settings_eval_reset(depsgraph, particle_settings_cow);
1656 for (
MTex *mtex : particle_settings->
mtex) {
1657 if (mtex ==
nullptr || mtex->
tex ==
nullptr) {
1699 BKE_object_eval_uber_data(depsgraph, scene_cow, object_cow);
1762 if (cu->
bevobj !=
nullptr) {
1785 Curves *curves_id =
reinterpret_cast<Curves *
>(obdata);
1790 if (curves_id->
surface !=
nullptr) {
1838 if (
built_map_.checkIsBuiltAndTag(armature)) {
1880 if (
camera->dof.focus_object !=
nullptr) {
1926 if (ntree ==
nullptr) {
1947 bNodeTree *ntree_cow = reinterpret_cast<bNodeTree *>(id_cow);
1948 bke::node_tree_runtime::preprocess_geometry_node_tree_for_evaluation(
1954 for (
bNode *bnode : ntree->all_nodes()) {
1964 if (
id ==
nullptr) {
1968 if (id_type ==
ID_MA) {
1971 else if (id_type ==
ID_TE) {
1974 else if (id_type ==
ID_IM) {
1977 else if (id_type ==
ID_OB) {
1981 else if (id_type ==
ID_SCE) {
1988 if (node_scene->
camera !=
nullptr) {
1993 else if (id_type ==
ID_TXT) {
1996 else if (id_type ==
ID_MSK) {
1999 else if (id_type ==
ID_MC) {
2002 else if (id_type ==
ID_VF) {
2017 ntree->ensure_interface_cache();
2030 if (
built_map_.checkIsBuiltAndTag(material)) {
2052 for (
int i = 0; i < num_materials; i++) {
2053 if (materials[i] ==
nullptr) {
2074 if (
texture->ima !=
nullptr) {
2095 if (
built_map_.checkIsBuiltAndTag(cache_file)) {
2098 ID *cache_file_id = &cache_file->
id;
2139 for (
int i = 0; i < spline->tot_point; i++) {
2142 if (parent ==
nullptr || parent->
id ==
nullptr) {
2153 if (
built_map_.checkIsBuiltAndTag(linestyle)) {
2157 ID *linestyle_id = &linestyle->
id;
2169 ID *clip_id = &clip->
id;
2198 if (
built_map_.checkIsBuiltAndTag(speaker)) {
2206 if (speaker->
sound !=
nullptr) {
2222 BKE_sound_evaluate(depsgraph, bmain, sound_cow);
2244 if (
seq->sound !=
nullptr) {
2247 if (
seq->scene !=
nullptr) {
2263 if (scene->
ed ==
nullptr) {
2275 SEQ_eval_sequences(depsgraph, scene_cow, &scene_cow->ed->seqbase);
2298 BKE_scene_update_tag_audio_volume(depsgraph, scene_cow);
2306 Object *
object = base->object;
2324 if (
id ==
nullptr) {
2332 data->builder->build_id(
id);
2344 if (
id ==
nullptr) {
2352 data->builder->build_id(
id);
Blender kernel action and pose functionality.
AnimData * BKE_animdata_from_id(const ID *id)
void BKE_animsys_eval_animdata(struct Depsgraph *depsgraph, struct ID *id)
void BKE_animsys_eval_driver(struct Depsgraph *depsgraph, struct ID *id, int driver_index, struct FCurve *fcu_orig)
void BKE_cachefile_eval(Main *bmain, Depsgraph *depsgraph, CacheFile *cache_file)
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object)
void BKE_constraints_id_loop(struct ListBase *list, ConstraintIDFunc func, const int flag, void *userdata)
void BKE_curve_eval_geometry(Depsgraph *depsgraph, Curve *curve)
bool driver_get_target_property(const DriverTargetContext *driver_target_context, struct DriverVar *dvar, struct DriverTarget *dtar, struct PointerRNA *r_prop)
#define DRIVER_TARGETS_USED_LOOPER_BEGIN(dvar)
#define DRIVER_TARGETS_LOOPER_END
void BKE_gpencil_modifiers_foreach_ID_link(struct Object *ob, GreasePencilIDWalkFunc walk, void *user_data)
Low-level operations for grease pencil.
void IDP_foreach_property(IDProperty *id_property_root, int type_filter, blender::FunctionRef< void(IDProperty *id_property)> callback)
bool BKE_image_user_id_has_animation(ID *id)
void BKE_image_user_id_eval_animation(Depsgraph *depsgraph, ID *id)
Key * BKE_key_from_id(ID *id)
void BKE_lattice_eval_geometry(Depsgraph *depsgraph, Lattice *latt)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
ViewLayer * BKE_view_layer_default_render(const Scene *scene)
ListBase * BKE_view_layer_object_bases_get(ViewLayer *view_layer)
#define MAIN_ID_SESSION_UID_UNSET
void BKE_id_eval_properties_copy(ID *id_cow, ID *id)
@ IDWALK_IGNORE_EMBEDDED_ID
void BKE_library_foreach_ID_link(Main *bmain, ID *id, blender::FunctionRef< LibraryIDLinkCallback > callback, void *user_data, int flag)
General operations, lookup, etc. for blender lights.
void BKE_mask_eval_update(struct Depsgraph *depsgraph, struct Mask *mask)
void BKE_mask_eval_animation(struct Depsgraph *depsgraph, struct Mask *mask)
General operations, lookup, etc. for materials.
short * BKE_object_material_len_p(struct Object *ob)
struct Material *** BKE_object_material_array_p(struct Object *ob)
void BKE_mesh_eval_geometry(Depsgraph *depsgraph, Mesh *mesh)
void void void BKE_modifiers_foreach_ID_link(Object *ob, IDWalkFunc walk, void *user_data)
void BKE_movieclip_eval_update(struct Depsgraph *depsgraph, struct Main *bmain, struct MovieClip *clip)
#define NODE_CUSTOM_GROUP
General operations, lookup, etc. for blender objects.
void BKE_object_data_select_update(Depsgraph *depsgraph, ID *object_data)
void BKE_particle_system_eval_init(struct Depsgraph *depsgraph, struct Object *object)
bool BKE_ptcache_object_has(struct Scene *scene, struct Object *ob, int duplis)
API for Blender-side Rigid Body stuff.
void BKE_shaderfx_foreach_ID_link(struct Object *ob, ShaderFxIDWalkFunc walk, void *user_data)
void BKE_volume_eval_geometry(Depsgraph *depsgraph, Volume *volume)
#define BLI_assert_msg(a, msg)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define ID_TYPE_USE_COPY_ON_EVAL(_id_type)
#define ID_TYPE_SUPPORTS_PARAMS_WITHOUT_COW(id_type)
Object groups, one object can be in many groups at once.
@ COLLECTION_HIDE_VIEWPORT
@ eModifierFlag_UserModified
@ NTREE_RUNTIME_FLAG_HAS_IMAGE_ANIMATION
Object is a sort of wrapper for general info.
Types and defines for representing Rigid Body entities.
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between world
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between camera
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
BPy_StructRNA * depsgraph
virtual bool need_pull_base_into_graph(const Base *base)
static const char * get_rna_path_relative_to_scene_camera(const Scene *scene, const PointerRNA &target_prop, const char *rna_path)
DepsgraphBuilder(Main *bmain, Depsgraph *graph, DepsgraphBuilderCache *cache)
virtual bool is_modifier_visibility_animated(const Object *object, const ModifierData *modifier)
ComponentNode * find_component_node(const ID *id, NodeType comp_type, const char *comp_name="")
virtual void build_scene_parameters(Scene *scene)
virtual void build_scene_sequencer(Scene *scene)
virtual void build_object_data_camera(Object *object)
virtual void build_object_data_geometry(Object *object)
ID * ensure_cow_id(ID *id_orig)
virtual void build_object_pointcache(Object *object)
virtual void build_animdata(ID *id)
static void modifier_walk(void *user_data, struct Object *object, struct ID **idpoin, int cb_flag)
virtual void build_world(World *world)
virtual void build_object(int base_index, Object *object, eDepsNode_LinkedState_Type linked_state, bool is_visible)
OperationNode * ensure_operation_node(ID *id, NodeType comp_type, const char *comp_name, OperationCode opcode, const DepsEvalOperationCb &op=nullptr, const char *name="", int name_tag=-1)
virtual void build_id(ID *id, bool force_be_visible=false)
IDNode * add_id_node(ID *id)
virtual void build_freestyle_linestyle(FreestyleLineStyle *linestyle)
virtual void build_scene_speakers(Scene *scene, ViewLayer *view_layer)
virtual void build_cachefile(CacheFile *cache_file)
virtual void build_object_instance_collection(Object *object, bool is_object_visible)
virtual void build_object_data_speaker(Object *object)
OperationNode * add_operation_node(ComponentNode *comp_node, OperationCode opcode, const DepsEvalOperationCb &op=nullptr, const char *name="", int name_tag=-1)
virtual void build_vfont(VFont *vfont)
virtual void build_texture(Tex *tex)
OperationNode * find_operation_node(const ID *id, NodeType comp_type, const char *comp_name, OperationCode opcode, const char *name="", int name_tag=-1)
virtual void build_object_data(Object *object)
virtual void build_particle_settings(ParticleSettings *part)
static void constraint_walk(bConstraint *constraint, ID **idpoin, bool is_reference, void *user_data)
virtual void build_driver_id_property(const PointerRNA &target_prop, const char *rna_path_from_target_prop)
virtual void build_particle_systems(Object *object, bool is_object_visible)
virtual void build_dimensions(Object *object)
virtual void build_armature(bArmature *armature)
virtual void build_scene_audio(Scene *scene)
ComponentNode * add_component_node(ID *id, NodeType comp_type, const char *comp_name="")
virtual void build_driver_variables(ID *id, FCurve *fcurve)
virtual void build_shapekeys(Key *key)
virtual void build_action(bAction *action)
virtual void build_driver_scene_camera_variable(Scene *scene, const char *camera_path)
virtual void build_animdata_nlastrip_targets(ListBase *strips)
virtual void build_animation_images(ID *id)
virtual void build_material(Material *ma)
virtual void build_materials(Material **materials, int num_materials)
virtual void build_collection(LayerCollection *from_layer_collection, Collection *collection)
virtual void build_rigidbody(Scene *scene)
virtual void build_object_transform(Object *object)
virtual void build_light_linking_collection(Collection *collection)
virtual void build_movieclip(MovieClip *clip)
T * get_cow_datablock(const T *orig) const
virtual void build_object_data_light(Object *object)
Map< uint, IDInfo * > id_info_hash_
bool is_parent_collection_visible_
virtual void build_image(Image *image)
virtual void build_speaker(Speaker *speaker)
virtual void build_sound(bSound *sound)
Vector< PersistentOperationKey > needs_update_operations_
virtual void build_object_data_geometry_datablock(ID *obdata)
DepsgraphNodeBuilder(Main *bmain, Depsgraph *graph, DepsgraphBuilderCache *cache)
Vector< PersistentOperationKey > saved_entry_tags_
void update_invalid_cow_pointers()
virtual void build_object_flags(int base_index, Object *object, eDepsNode_LinkedState_Type linked_state)
ID * get_cow_id(const ID *id_orig) const
virtual void build_rig(Object *object)
TimeSourceNode * add_time_source()
virtual void build_parameters(ID *id)
virtual void build_lightprobe(LightProbe *probe)
int foreach_id_cow_detect_need_for_update_callback(ID *id_cow_self, ID *id_pointer)
virtual void build_nodetree(bNodeTree *ntree)
virtual void build_idproperties(IDProperty *id_property)
virtual void build_camera(Camera *camera)
virtual void build_light(Light *lamp)
IDNode * find_id_node(const ID *id)
virtual void build_armature_bones(ListBase *bones)
virtual void build_driver(ID *id, FCurve *fcurve, int driver_index)
virtual void build_object_light_linking(Object *object)
virtual void begin_build()
virtual void build_mask(Mask *mask)
bool has_operation_node(ID *id, NodeType comp_type, const char *comp_name, OperationCode opcode, const char *name="", int name_tag=-1)
virtual void build_nodetree_socket(bNodeSocket *socket)
virtual void build_armature_bone_collections(blender::Span< BoneCollection * > collections)
virtual void build_object_data_lightprobe(Object *object)
virtual void build_object_data_grease_pencil(Object *object)
virtual void build_generic_id(ID *id)
virtual void build_object_constraints(Object *object)
virtual void build_object_shading(Object *object)
void tag_previously_tagged_nodes()
virtual void build_object_modifiers(Object *object)
virtual void build_object_from_layer(int base_index, Object *object, eDepsNode_LinkedState_Type linked_state)
input_tx image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "preview_img") .compute_source("compositor_compute_preview.glsl") .do_static_compilation(true)
local_group_size(16, 16) .push_constant(Type texture
void SEQ_for_each_callback(ListBase *seqbase, SeqForEachFunc callback, void *user_data)
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
ccl_device_inline float4 mask(const int4 mask, const float4 a)
bNodeTree ** node_tree_ptr_from_id(ID *id)
static bool seq_node_build_cb(Sequence *seq, void *user_data)
uint64_t IDComponentsMask
@ NTREE_GEOMETRY_PREPROCESS
bool rna_prop_affects_parameters_node(const PointerRNA *ptr, const PropertyRNA *prop)
function< void(::Depsgraph *)> DepsEvalOperationCb
void deg_evaluate_object_node_visibility(::Depsgraph *depsgraph, IDNode *id_node)
void deg_create_eval_copy(::Depsgraph *graph, const IDNode *id_node)
bool deg_eval_copy_is_expanded(const ID *id_cow)
@ GENERIC_DATABLOCK_UPDATE
@ TRANSFORM_SIMULATION_INIT
@ OBJECT_FROM_LAYER_ENTRY
@ RIGIDBODY_TRANSFORM_COPY
@ SYNCHRONIZE_TO_ORIGINAL
@ PARTICLE_SETTINGS_RESET
@ NTREE_GEOMETRY_PREPROCESS
void deg_free_eval_copy_datablock(ID *id_cow)
bool deg_eval_copy_is_needed(const ID *id_orig)
eDepsNode_LinkedState_Type
@ DEG_ID_LINKED_INDIRECTLY
@ DEPSOP_FLAG_NEEDS_UPDATE
@ DEPSOP_FLAG_AFFECTS_VISIBILITY
@ DEPSOP_FLAG_USER_MODIFIED
static int foreach_id_cow_detect_need_for_update_callback(LibraryIDLinkCallbackData *cb_data)
void graph_id_tag_update(Main *bmain, Depsgraph *graph, ID *id, uint flags, eUpdateSource update_source)
@ DEG_UPDATE_SOURCE_USER_EDIT
@ DEG_UPDATE_SOURCE_RELATIONS
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
const char * RNA_property_identifier(const PropertyRNA *prop)
PointerRNA RNA_id_pointer_create(ID *id)
bool RNA_path_resolve_full(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
struct Object * textoncurve
struct ViewLayer * view_layer
struct bNodeTree * nodetree
struct Collection * blocker_collection
struct Collection * receiver_collection
struct bNodeTree * nodetree
struct bNodeTree * nodetree
struct Collection * instance_collection
ListBase greasepencil_modifiers
LightLinking * light_linking
struct Collection * instance_collection
struct Object * instance_object
struct Collection * constraints
struct Collection * group
struct RigidBodyWorld * rigidbody_world
bNodeTreeRuntimeHandle * runtime
OperationNode * find_operation(OperationIDKey key) const
OperationNode * add_operation(const DepsEvalOperationCb &op, OperationCode opcode, const char *name="", int name_tag=-1)
OperationNode * entry_operation
virtual string identifier() const override
DEGCustomDataMeshMasks previous_customdata_masks
IDComponentsMask previously_visible_components_mask
uint32_t previous_eval_flags
IDComponentsMask previously_visible_components_mask
DEGCustomDataMeshMasks customdata_masks
DEGCustomDataMeshMasks previous_customdata_masks
ComponentNode * add_component(NodeType type, const char *name="")
IDComponentsMask visible_components_mask
bool is_collection_fully_expanded
Map< ComponentIDKey, ComponentNode * > components
ComponentNode * find_component(NodeType type, const char *name="") const
eDepsNode_LinkedState_Type linked_state
uint32_t previous_eval_flags
const char * component_name
virtual void tag_update(Depsgraph *graph, eUpdateSource source) override
DepsEvalOperationCb evaluate
virtual string identifier() const override