Cleanup: move public doc-strings into headers for 'depsgraph'
- Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. Ref T92709
This commit is contained in:
parent
dffd032bc9
commit
566a458950
Notes:
blender-bot
2023-02-14 03:52:45 +01:00
Referenced by issue #93854, Relocate doc-strings into public headers Referenced by issue #92709, Code Style: documentation at declaration or definition
|
@ -80,45 +80,67 @@ extern "C" {
|
|||
/* ************************************************ */
|
||||
/* Depsgraph API */
|
||||
|
||||
/* CRUD ------------------------------------------- */
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name CRUD
|
||||
* \{ */
|
||||
|
||||
/* Get main depsgraph instance from context! */
|
||||
|
||||
/* Create new Depsgraph instance */
|
||||
/* TODO: what args are needed here? What's the building-graph entry point? */
|
||||
/**
|
||||
* Create new Depsgraph instance.
|
||||
*
|
||||
* TODO: what arguments are needed here? What's the building-graph entry point?
|
||||
*/
|
||||
Depsgraph *DEG_graph_new(struct Main *bmain,
|
||||
struct Scene *scene,
|
||||
struct ViewLayer *view_layer,
|
||||
eEvaluationMode mode);
|
||||
|
||||
/**
|
||||
* Replace the "owner" pointers (currently Main/Scene/ViewLayer) of this depsgraph.
|
||||
* Used for:
|
||||
* - Undo steps when we do want to re-use the old depsgraph data as much as possible.
|
||||
* - Rendering where we want to re-use objects between different view layers.
|
||||
*/
|
||||
void DEG_graph_replace_owners(struct Depsgraph *depsgraph,
|
||||
struct Main *bmain,
|
||||
struct Scene *scene,
|
||||
struct ViewLayer *view_layer);
|
||||
|
||||
/* Free Depsgraph itself and all its data */
|
||||
/** Free graph's contents and graph itself. */
|
||||
void DEG_graph_free(Depsgraph *graph);
|
||||
|
||||
/* Node Types Registry ---------------------------- */
|
||||
/** \} */
|
||||
|
||||
/* Register all node types */
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Node Types Registry
|
||||
* \{ */
|
||||
|
||||
/** Register all node types. */
|
||||
void DEG_register_node_types(void);
|
||||
|
||||
/* Free node type registry on exit */
|
||||
/** Free node type registry on exit. */
|
||||
void DEG_free_node_types(void);
|
||||
|
||||
/* Update Tagging -------------------------------- */
|
||||
/** \} */
|
||||
|
||||
/* Tag dependency graph for updates when visible scenes/layers changes. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Update Tagging
|
||||
* \{ */
|
||||
|
||||
/** Tag dependency graph for updates when visible scenes/layers changes. */
|
||||
void DEG_graph_tag_on_visible_update(Depsgraph *depsgraph, const bool do_time);
|
||||
|
||||
/* Tag all dependency graphs for update when visible scenes/layers changes. */
|
||||
/** Tag all dependency graphs for update when visible scenes/layers changes. */
|
||||
void DEG_tag_on_visible_update(struct Main *bmain, const bool do_time);
|
||||
|
||||
/* NOTE: Will return NULL if the flag is not known, allowing to gracefully handle situations
|
||||
* when recalc flag has been removed. */
|
||||
/**
|
||||
* \note Will return NULL if the flag is not known, allowing to gracefully handle situations
|
||||
* when recalc flag has been removed.
|
||||
*/
|
||||
const char *DEG_update_tag_as_string(IDRecalcFlag flag);
|
||||
|
||||
/** Tag given ID for an update in all the dependency graphs. */
|
||||
void DEG_id_tag_update(struct ID *id, int flag);
|
||||
void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, int flag);
|
||||
|
||||
|
@ -127,48 +149,68 @@ void DEG_graph_id_tag_update(struct Main *bmain,
|
|||
struct ID *id,
|
||||
int flag);
|
||||
|
||||
/* Tag all dependency graphs when time has changed. */
|
||||
/** Tag all dependency graphs when time has changed. */
|
||||
void DEG_time_tag_update(struct Main *bmain);
|
||||
|
||||
/* Tag a dependency graph when time has changed. */
|
||||
/** Tag a dependency graph when time has changed. */
|
||||
void DEG_graph_time_tag_update(struct Depsgraph *depsgraph);
|
||||
|
||||
/* Mark a particular datablock type as having changing. This does
|
||||
* not cause any updates but is used by external render engines to detect if for
|
||||
* example a datablock was removed. */
|
||||
/**
|
||||
* Mark a particular data-block type as having changing.
|
||||
* This does not cause any updates but is used by external
|
||||
* render engines to detect if for example a data-block was removed.
|
||||
*/
|
||||
void DEG_graph_id_type_tag(struct Depsgraph *depsgraph, short id_type);
|
||||
void DEG_id_type_tag(struct Main *bmain, short id_type);
|
||||
|
||||
/* Set a depsgraph to flush updates to editors. This would be done
|
||||
* for viewport depsgraphs, but not render or export depsgraph for example. */
|
||||
/**
|
||||
* Set a depsgraph to flush updates to editors. This would be done
|
||||
* for viewport depsgraphs, but not render or export depsgraph for example.
|
||||
*/
|
||||
void DEG_enable_editors_update(struct Depsgraph *depsgraph);
|
||||
|
||||
/* Check if something was changed in the database and inform editors about this. */
|
||||
/** Check if something was changed in the database and inform editors about this. */
|
||||
void DEG_editors_update(struct Depsgraph *depsgraph, bool time);
|
||||
|
||||
/* Clear recalc flags after editors or renderers have handled updates. */
|
||||
/** Clear recalc flags after editors or renderers have handled updates. */
|
||||
void DEG_ids_clear_recalc(Depsgraph *depsgraph, const bool backup);
|
||||
|
||||
/* Restore recalc flags, backed up by a previous call to DEG_ids_clear_recalc.
|
||||
* This also clears the backup. */
|
||||
/**
|
||||
* Restore recalc flags, backed up by a previous call to #DEG_ids_clear_recalc.
|
||||
* This also clears the backup.
|
||||
*/
|
||||
void DEG_ids_restore_recalc(Depsgraph *depsgraph);
|
||||
|
||||
/** \} */
|
||||
|
||||
/* ************************************************ */
|
||||
/* Evaluation Engine API */
|
||||
|
||||
/* Graph Evaluation ----------------------------- */
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Graph Evaluation
|
||||
* \{ */
|
||||
|
||||
/* Frame changed recalculation entry point. */
|
||||
/**
|
||||
* Frame changed recalculation entry point.
|
||||
*
|
||||
* \note The frame-change happened for root scene that graph belongs to.
|
||||
*/
|
||||
void DEG_evaluate_on_framechange(Depsgraph *graph, float frame);
|
||||
|
||||
/* Data changed recalculation entry point. */
|
||||
/**
|
||||
* Data changed recalculation entry point.
|
||||
* Evaluate all nodes tagged for updating.
|
||||
*/
|
||||
void DEG_evaluate_on_refresh(Depsgraph *graph);
|
||||
|
||||
/* Editors Integration -------------------------- */
|
||||
/** \} */
|
||||
|
||||
/* Mechanism to allow editors to be informed of depsgraph updates,
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Editors Integration
|
||||
*
|
||||
* Mechanism to allow editors to be informed of depsgraph updates,
|
||||
* to do their own updates based on changes.
|
||||
*/
|
||||
* \{ */
|
||||
|
||||
typedef struct DEGEditorUpdateContext {
|
||||
struct Main *bmain;
|
||||
|
@ -181,10 +223,14 @@ typedef void (*DEG_EditorUpdateIDCb)(const DEGEditorUpdateContext *update_ctx, s
|
|||
typedef void (*DEG_EditorUpdateSceneCb)(const DEGEditorUpdateContext *update_ctx,
|
||||
const bool updated);
|
||||
|
||||
/* Set callbacks which are being called when depsgraph changes. */
|
||||
/** Set callbacks which are being called when depsgraph changes. */
|
||||
void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, DEG_EditorUpdateSceneCb scene_func);
|
||||
|
||||
/* Evaluation ----------------------------------- */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Evaluation
|
||||
* \{ */
|
||||
|
||||
bool DEG_is_evaluating(const struct Depsgraph *depsgraph);
|
||||
|
||||
|
@ -192,7 +238,11 @@ bool DEG_is_active(const struct Depsgraph *depsgraph);
|
|||
void DEG_make_active(struct Depsgraph *depsgraph);
|
||||
void DEG_make_inactive(struct Depsgraph *depsgraph);
|
||||
|
||||
/* Evaluation Debug ------------------------------ */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Evaluation Debug
|
||||
* \{ */
|
||||
|
||||
void DEG_debug_print_begin(struct Depsgraph *depsgraph);
|
||||
|
||||
|
@ -232,6 +282,8 @@ void DEG_debug_print_eval_time(struct Depsgraph *depsgraph,
|
|||
const void *object_address,
|
||||
float time);
|
||||
|
||||
/** \} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
|
|
@ -50,17 +50,22 @@ extern "C" {
|
|||
|
||||
/* Graph Building -------------------------------- */
|
||||
|
||||
/* Build depsgraph for the given scene, and dump results in given graph container. */
|
||||
/** Build depsgraph for the given scene layer, and dump results in given graph container. */
|
||||
void DEG_graph_build_from_view_layer(struct Depsgraph *graph);
|
||||
|
||||
/* Build depsgraph for all objects (so also invisible ones) in the given view layer. */
|
||||
/**
|
||||
* Build depsgraph for all objects (so also invisible ones) in the given view layer.
|
||||
*/
|
||||
void DEG_graph_build_for_all_objects(struct Depsgraph *graph);
|
||||
|
||||
/* Special version of builder which produces dependency graph suitable for the render pipeline.
|
||||
* It will contain sequencer and compositor (if needed) and all their dependencies. */
|
||||
/**
|
||||
* Special version of builder which produces dependency graph suitable for the render pipeline.
|
||||
* It will contain sequencer and compositor (if needed) and all their dependencies.
|
||||
*/
|
||||
void DEG_graph_build_for_render_pipeline(struct Depsgraph *graph);
|
||||
|
||||
/* Builds minimal dependency graph for compositor preview.
|
||||
/**
|
||||
* Builds minimal dependency graph for compositor preview.
|
||||
*
|
||||
* Note that compositor editor might have pinned node tree, which is different from scene's node
|
||||
* tree.
|
||||
|
@ -69,18 +74,19 @@ void DEG_graph_build_for_compositor_preview(struct Depsgraph *graph, struct bNod
|
|||
|
||||
void DEG_graph_build_from_ids(struct Depsgraph *graph, struct ID **ids, const int num_ids);
|
||||
|
||||
/* Tag relations from the given graph for update. */
|
||||
/** Tag relations from the given graph for update. */
|
||||
void DEG_graph_tag_relations_update(struct Depsgraph *graph);
|
||||
|
||||
/* Create or update relations in the specified graph. */
|
||||
/** Create or update relations in the specified graph. */
|
||||
void DEG_graph_relations_update(struct Depsgraph *graph);
|
||||
|
||||
/* Tag all relations in the database for update. */
|
||||
/** Tag all relations in the database for update. */
|
||||
void DEG_relations_tag_update(struct Main *bmain);
|
||||
|
||||
/* Add Dependencies ----------------------------- */
|
||||
|
||||
/* Handle for components to define their dependencies from callbacks.
|
||||
/**
|
||||
* Handle for components to define their dependencies from callbacks.
|
||||
* This is generated by the depsgraph and passed to dependency callbacks
|
||||
* as a symbolic reference to the current DepsNode.
|
||||
* All relations will be defined in reference to that node.
|
||||
|
@ -159,23 +165,28 @@ void DEG_add_object_cache_relation(struct DepsNodeHandle *handle,
|
|||
struct CacheFile *cache_file,
|
||||
eDepsObjectComponentType component,
|
||||
const char *description);
|
||||
/* Adds relation from DEG_OPCODE_GENERIC_DATABLOCK_UPDATE of a given ID.
|
||||
* Is used for such entities as textures and images. */
|
||||
/**
|
||||
* Adds relation from #DEG_OPCODE_GENERIC_DATABLOCK_UPDATE of a given ID.
|
||||
* Is used for such entities as textures and images.
|
||||
*/
|
||||
void DEG_add_generic_id_relation(struct DepsNodeHandle *node_handle,
|
||||
struct ID *id,
|
||||
const char *description);
|
||||
|
||||
/* Special function which is used from modifiers' updateDepsgraph() callback
|
||||
/**
|
||||
* Special function which is used from modifiers' #updateDepsgraph() callback
|
||||
* to indicate that the modifier needs to know transformation of the object
|
||||
* which that modifier belongs to.
|
||||
* This function will take care of checking which operation is required to
|
||||
* have transformation for the modifier, taking into account possible simulation
|
||||
* solvers. */
|
||||
* have transformation for the modifier, taking into account possible simulation solvers.
|
||||
*/
|
||||
void DEG_add_modifier_to_transform_relation(struct DepsNodeHandle *node_handle,
|
||||
const char *description);
|
||||
|
||||
/* Adds relations from the given component of a given object to the given node
|
||||
* handle AND the component to the point cache component of the node's ID. */
|
||||
/**
|
||||
* Adds relations from the given component of a given object to the given node
|
||||
* handle AND the component to the point cache component of the node's ID.
|
||||
*/
|
||||
void DEG_add_object_pointcache_relation(struct DepsNodeHandle *node_handle,
|
||||
struct Object *object,
|
||||
eDepsObjectComponentType component,
|
||||
|
|
|
@ -37,7 +37,7 @@ struct ViewLayer;
|
|||
|
||||
/* ------------------------------------------------ */
|
||||
|
||||
/* NOTE: Those flags are same bitmask as G.debug_flags */
|
||||
/* NOTE: Those flags are same bit-mask as #G.debug_flags */
|
||||
|
||||
void DEG_debug_flags_set(struct Depsgraph *depsgraph, int flags);
|
||||
int DEG_debug_flags_get(const struct Depsgraph *depsgraph);
|
||||
|
@ -47,6 +47,12 @@ const char *DEG_debug_name_get(struct Depsgraph *depsgraph);
|
|||
|
||||
/* ------------------------------------------------ */
|
||||
|
||||
/**
|
||||
* Obtain simple statistics about the complexity of the depsgraph.
|
||||
* \param[out] r_outer: The number of outer nodes in the graph.
|
||||
* \param[out] r_operations: The number of operation nodes in the graph.
|
||||
* \param[out] r_relations: The number of relations between (executable) nodes in the graph.
|
||||
*/
|
||||
void DEG_stats_simple(const struct Depsgraph *graph,
|
||||
size_t *r_outer,
|
||||
size_t *r_operations,
|
||||
|
@ -64,16 +70,16 @@ void DEG_debug_stats_gnuplot(const struct Depsgraph *graph,
|
|||
|
||||
/* ************************************************ */
|
||||
|
||||
/* Compare two dependency graphs. */
|
||||
/** Compare two dependency graphs. */
|
||||
bool DEG_debug_compare(const struct Depsgraph *graph1, const struct Depsgraph *graph2);
|
||||
|
||||
/* Check that dependencies in the graph are really up to date. */
|
||||
/** Check that dependencies in the graph are really up to date. */
|
||||
bool DEG_debug_graph_relations_validate(struct Depsgraph *graph,
|
||||
struct Main *bmain,
|
||||
struct Scene *scene,
|
||||
struct ViewLayer *view_layer);
|
||||
|
||||
/* Perform consistency check on the graph. */
|
||||
/** Perform consistency check on the graph. */
|
||||
bool DEG_debug_consistency_check(struct Depsgraph *graph);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -47,87 +47,106 @@ struct ViewLayer;
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* *********************** DEG input data ********************* */
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name DEG input data
|
||||
* \{ */
|
||||
|
||||
/* Get scene that depsgraph was built for. */
|
||||
/** Get scene that depsgraph was built for. */
|
||||
struct Scene *DEG_get_input_scene(const Depsgraph *graph);
|
||||
|
||||
/* Get view layer that depsgraph was built for. */
|
||||
/** Get view layer that depsgraph was built for. */
|
||||
struct ViewLayer *DEG_get_input_view_layer(const Depsgraph *graph);
|
||||
|
||||
/* Get bmain that depsgraph was built for. */
|
||||
/** Get bmain that depsgraph was built for. */
|
||||
struct Main *DEG_get_bmain(const Depsgraph *graph);
|
||||
|
||||
/* Get evaluation mode that depsgraph was built for. */
|
||||
/** Get evaluation mode that depsgraph was built for. */
|
||||
eEvaluationMode DEG_get_mode(const Depsgraph *graph);
|
||||
|
||||
/* Get time that depsgraph is being evaluated or was last evaluated at. */
|
||||
/** Get time that depsgraph is being evaluated or was last evaluated at. */
|
||||
float DEG_get_ctime(const Depsgraph *graph);
|
||||
|
||||
/* ********************* DEG evaluated data ******************* */
|
||||
/** \} */
|
||||
|
||||
/* Check if given ID type was tagged for update. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name DEG evaluated data
|
||||
* \{ */
|
||||
|
||||
/** Check if given ID type was tagged for update. */
|
||||
bool DEG_id_type_updated(const struct Depsgraph *depsgraph, short id_type);
|
||||
bool DEG_id_type_any_updated(const struct Depsgraph *depsgraph);
|
||||
|
||||
/* Check if given ID type is present in the depsgraph */
|
||||
/** Check if given ID type is present in the depsgraph */
|
||||
bool DEG_id_type_any_exists(const struct Depsgraph *depsgraph, short id_type);
|
||||
|
||||
/* Get additional evaluation flags for the given ID. */
|
||||
/** Get additional evaluation flags for the given ID. */
|
||||
uint32_t DEG_get_eval_flags_for_id(const struct Depsgraph *graph, struct ID *id);
|
||||
|
||||
/* Get additional mesh CustomData_MeshMasks flags for the given object. */
|
||||
/** Get additional mesh CustomData_MeshMasks flags for the given object. */
|
||||
void DEG_get_customdata_mask_for_object(const struct Depsgraph *graph,
|
||||
struct Object *object,
|
||||
struct CustomData_MeshMasks *r_mask);
|
||||
|
||||
/* Get scene at its evaluated state.
|
||||
/**
|
||||
* Get scene at its evaluated state.
|
||||
*
|
||||
* Technically, this is a copied-on-written and fully evaluated version of the input scene.
|
||||
* This function will check that the data-block has been expanded (and copied) from the original
|
||||
* one. Assert will happen if it's not. */
|
||||
* one. Assert will happen if it's not.
|
||||
*/
|
||||
struct Scene *DEG_get_evaluated_scene(const struct Depsgraph *graph);
|
||||
|
||||
/* Get view layer at its evaluated state.
|
||||
* This is a shortcut for accessing active view layer from evaluated scene. */
|
||||
/**
|
||||
* Get view layer at its evaluated state.
|
||||
* This is a shortcut for accessing active view layer from evaluated scene.
|
||||
*/
|
||||
struct ViewLayer *DEG_get_evaluated_view_layer(const struct Depsgraph *graph);
|
||||
|
||||
/* Get evaluated version of object for given original one. */
|
||||
/** Get evaluated version of object for given original one. */
|
||||
struct Object *DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object);
|
||||
|
||||
/* Get evaluated version of given ID data-block. */
|
||||
/** Get evaluated version of given ID data-block. */
|
||||
struct ID *DEG_get_evaluated_id(const struct Depsgraph *depsgraph, struct ID *id);
|
||||
|
||||
/* Get evaluated version of data pointed to by RNA pointer */
|
||||
/** Get evaluated version of data pointed to by RNA pointer */
|
||||
void DEG_get_evaluated_rna_pointer(const struct Depsgraph *depsgraph,
|
||||
struct PointerRNA *ptr,
|
||||
struct PointerRNA *r_ptr_eval);
|
||||
|
||||
/* Get original version of object for given evaluated one. */
|
||||
/** Get original version of object for given evaluated one. */
|
||||
struct Object *DEG_get_original_object(struct Object *object);
|
||||
|
||||
/* Get original version of given evaluated ID data-block. */
|
||||
/** Get original version of given evaluated ID data-block. */
|
||||
struct ID *DEG_get_original_id(struct ID *id);
|
||||
|
||||
/* Check whether given ID is an original,
|
||||
/**
|
||||
* Check whether given ID is an original,
|
||||
*
|
||||
* Original IDs are considered all the IDs which are not covered by copy-on-write system and are
|
||||
* not out-of-main localized data-blocks. */
|
||||
* not out-of-main localized data-blocks.
|
||||
*/
|
||||
bool DEG_is_original_id(const struct ID *id);
|
||||
bool DEG_is_original_object(const struct Object *object);
|
||||
|
||||
/* Opposite of the above.
|
||||
*
|
||||
* If the data-block is not original it must be evaluated, and vice versa. */
|
||||
|
||||
bool DEG_is_evaluated_id(const struct ID *id);
|
||||
bool DEG_is_evaluated_object(const struct Object *object);
|
||||
|
||||
/* Check whether depsgraph is fully evaluated. This includes the following checks:
|
||||
/**
|
||||
* Check whether depsgraph is fully evaluated. This includes the following checks:
|
||||
* - Relations are up-to-date.
|
||||
* - Nothing is tagged for update. */
|
||||
* - Nothing is tagged for update.
|
||||
*/
|
||||
bool DEG_is_fully_evaluated(const struct Depsgraph *depsgraph);
|
||||
|
||||
/* ************************ DEG object iterators ********************* */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name DEG object iterators
|
||||
* \{ */
|
||||
|
||||
enum {
|
||||
DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY = (1 << 0),
|
||||
|
@ -207,7 +226,11 @@ void DEG_iterator_objects_end(struct BLI_Iterator *iter);
|
|||
|
||||
#define DEG_OBJECT_ITER_FOR_RENDER_ENGINE_END DEG_OBJECT_ITER_END
|
||||
|
||||
/* ************************ DEG ID iterators ********************* */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name DEG ID iterators
|
||||
* \{ */
|
||||
|
||||
typedef struct DEGIDIterData {
|
||||
struct Depsgraph *graph;
|
||||
|
@ -221,15 +244,20 @@ void DEG_iterator_ids_begin(struct BLI_Iterator *iter, DEGIDIterData *data);
|
|||
void DEG_iterator_ids_next(struct BLI_Iterator *iter);
|
||||
void DEG_iterator_ids_end(struct BLI_Iterator *iter);
|
||||
|
||||
/* ************************ DEG traversal ********************* */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name DEG traversal
|
||||
* \{ */
|
||||
|
||||
typedef void (*DEGForeachIDCallback)(ID *id, void *user_data);
|
||||
typedef void (*DEGForeachIDComponentCallback)(ID *id,
|
||||
eDepsObjectComponentType component,
|
||||
void *user_data);
|
||||
|
||||
/* NOTE: Modifies runtime flags in depsgraph nodes, so can not be used in
|
||||
* parallel. Keep an eye on that!
|
||||
/**
|
||||
* \note Modifies runtime flags in depsgraph nodes,
|
||||
* so can not be used in parallel. Keep an eye on that!
|
||||
*/
|
||||
void DEG_foreach_ancestor_ID(const Depsgraph *depsgraph,
|
||||
const ID *id,
|
||||
|
@ -240,8 +268,10 @@ void DEG_foreach_dependent_ID(const Depsgraph *depsgraph,
|
|||
DEGForeachIDCallback callback,
|
||||
void *user_data);
|
||||
|
||||
/* Starts traversal from given component of the given ID, invokes callback for every other
|
||||
* component which is directly on indirectly dependent on the source one. */
|
||||
/**
|
||||
* Starts traversal from given component of the given ID, invokes callback for every other
|
||||
* component which is directly on indirectly dependent on the source one.
|
||||
*/
|
||||
enum {
|
||||
/* Ignore transform solvers which depends on multiple inputs and affects final transform.
|
||||
* Is used for cases like snapping objects which are part of a rigid body simulation:
|
||||
|
@ -262,6 +292,8 @@ void DEG_foreach_dependent_ID_component(const Depsgraph *depsgraph,
|
|||
|
||||
void DEG_foreach_ID(const Depsgraph *depsgraph, DEGForeachIDCallback callback, void *user_data);
|
||||
|
||||
/** \} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
|
|
@ -390,8 +390,6 @@ void DepsgraphNodeBuilder::begin_build()
|
|||
* NOTE: This is split in two, a static function and a public method of the node builder, to allow
|
||||
* the code to access the builder's data more easily. */
|
||||
|
||||
/* `id_cow_self` is the user of `id_pointer`, see also `LibraryIDLinkCallbackData` struct
|
||||
* definition. */
|
||||
int DepsgraphNodeBuilder::foreach_id_cow_detect_need_for_update_callback(ID *id_cow_self,
|
||||
ID *id_pointer)
|
||||
{
|
||||
|
@ -440,21 +438,18 @@ static int foreach_id_cow_detect_need_for_update_callback(LibraryIDLinkCallbackD
|
|||
return builder->foreach_id_cow_detect_need_for_update_callback(id_cow_self, id);
|
||||
}
|
||||
|
||||
/* Check for IDs that need to be flushed (COW-updated) because the depsgraph itself created or
|
||||
* removed some of their evaluated dependencies.
|
||||
*
|
||||
* NOTE: Currently the only ID types that depsgraph may decide to not evaluate/generate COW
|
||||
* copies for, even though they are referenced by other data-blocks, are Collections and Objects
|
||||
* (through their various visibility flags, and the ones from LayerCollections too). However, this
|
||||
* code is kept generic as it makes it more future-proof, and optimization here would give
|
||||
* negligible performance improvements in typical cases.
|
||||
*
|
||||
* NOTE: This mechanism may also 'fix' some missing update tagging from non-depsgraph code in
|
||||
* some cases. This is slightly unfortunate (as it may hide issues in other parts of Blender
|
||||
* code), but cannot really be avoided currently.
|
||||
*/
|
||||
void DepsgraphNodeBuilder::update_invalid_cow_pointers()
|
||||
{
|
||||
/* NOTE: Currently the only ID types that depsgraph may decide to not evaluate/generate COW
|
||||
* copies for, even though they are referenced by other data-blocks, are Collections and Objects
|
||||
* (through their various visibility flags, and the ones from #LayerCollections too). However,
|
||||
* this code is kept generic as it makes it more future-proof, and optimization here would give
|
||||
* negligible performance improvements in typical cases.
|
||||
*
|
||||
* NOTE: This mechanism may also 'fix' some missing update tagging from non-depsgraph code in
|
||||
* some cases. This is slightly unfortunate (as it may hide issues in other parts of Blender
|
||||
* code), but cannot really be avoided currently. */
|
||||
|
||||
for (const IDNode *id_node : graph_->id_nodes) {
|
||||
if (id_node->previously_visible_components_mask == 0) {
|
||||
/* Newly added node/ID, no need to check it. */
|
||||
|
@ -1071,10 +1066,6 @@ void DepsgraphNodeBuilder::build_object_pointcache(Object *object)
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Build graph nodes for AnimData block and any animated images used.
|
||||
* \param id: ID-Block which hosts the AnimData
|
||||
*/
|
||||
void DepsgraphNodeBuilder::build_animdata(ID *id)
|
||||
{
|
||||
/* Special handling for animated images/sequences. */
|
||||
|
@ -1128,9 +1119,6 @@ void DepsgraphNodeBuilder::build_animdata_nlastrip_targets(ListBase *strips)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build graph nodes to update the current frame in image users.
|
||||
*/
|
||||
void DepsgraphNodeBuilder::build_animation_images(ID *id)
|
||||
{
|
||||
if (BKE_image_user_id_has_animation(id)) {
|
||||
|
@ -1152,12 +1140,6 @@ void DepsgraphNodeBuilder::build_action(bAction *action)
|
|||
add_operation_node(&action->id, NodeType::ANIMATION, OperationCode::ANIMATION_EVAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build graph node(s) for Driver
|
||||
* \param id: ID-Block that driver is attached to
|
||||
* \param fcu: Driver-FCurve
|
||||
* \param driver_index: Index in animation data drivers list
|
||||
*/
|
||||
void DepsgraphNodeBuilder::build_driver(ID *id, FCurve *fcurve, int driver_index)
|
||||
{
|
||||
/* Create data node for this driver */
|
||||
|
|
|
@ -102,6 +102,10 @@ class DepsgraphNodeBuilder : public DepsgraphBuilder {
|
|||
virtual void begin_build();
|
||||
virtual void end_build();
|
||||
|
||||
/**
|
||||
* `id_cow_self` is the user of `id_pointer`,
|
||||
* see also `LibraryIDLinkCallbackData` struct definition.
|
||||
*/
|
||||
int foreach_id_cow_detect_need_for_update_callback(ID *id_cow_self, ID *id_pointer);
|
||||
|
||||
IDNode *add_id_node(ID *id);
|
||||
|
@ -199,10 +203,23 @@ class DepsgraphNodeBuilder : public DepsgraphBuilder {
|
|||
virtual void build_rigidbody(Scene *scene);
|
||||
virtual void build_particle_systems(Object *object, bool is_object_visible);
|
||||
virtual void build_particle_settings(ParticleSettings *part);
|
||||
/**
|
||||
* Build graph nodes for #AnimData block and any animated images used.
|
||||
* \param id: ID-Block which hosts the #AnimData
|
||||
*/
|
||||
virtual void build_animdata(ID *id);
|
||||
virtual void build_animdata_nlastrip_targets(ListBase *strips);
|
||||
/**
|
||||
* Build graph nodes to update the current frame in image users.
|
||||
*/
|
||||
virtual void build_animation_images(ID *id);
|
||||
virtual void build_action(bAction *action);
|
||||
/**
|
||||
* Build graph node(s) for Driver
|
||||
* \param id: ID-Block that driver is attached to
|
||||
* \param fcu: Driver-FCurve
|
||||
* \param driver_index: Index in animation data drivers list
|
||||
*/
|
||||
virtual void build_driver(ID *id, FCurve *fcurve, int driver_index);
|
||||
virtual void build_driver_variables(ID *id, FCurve *fcurve);
|
||||
virtual void build_driver_id_property(ID *id, const char *rna_path);
|
||||
|
@ -280,6 +297,10 @@ class DepsgraphNodeBuilder : public DepsgraphBuilder {
|
|||
void *user_data);
|
||||
|
||||
void tag_previously_tagged_nodes();
|
||||
/**
|
||||
* Check for IDs that need to be flushed (COW-updated)
|
||||
* because the depsgraph itself created or removed some of their evaluated dependencies.
|
||||
*/
|
||||
void update_invalid_cow_pointers();
|
||||
|
||||
/* State which demotes currently built entities. */
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
namespace blender::deg {
|
||||
|
||||
/* Debug contents of map */
|
||||
void RootPChanMap::print_debug()
|
||||
{
|
||||
map_.foreach_item([](StringRefNull key, const Set<StringRefNull> &values) {
|
||||
|
@ -42,13 +41,11 @@ void RootPChanMap::print_debug()
|
|||
});
|
||||
}
|
||||
|
||||
/* Add a mapping. */
|
||||
void RootPChanMap::add_bone(const char *bone, const char *root)
|
||||
{
|
||||
map_.lookup_or_add_default(bone).add(root);
|
||||
}
|
||||
|
||||
/* Check if there's a common root bone between two bones. */
|
||||
bool RootPChanMap::has_common_root(const char *bone1, const char *bone2) const
|
||||
{
|
||||
const Set<StringRefNull> *bone1_roots = map_.lookup_ptr(bone1);
|
||||
|
|
|
@ -29,13 +29,13 @@ namespace blender {
|
|||
namespace deg {
|
||||
|
||||
struct RootPChanMap {
|
||||
/* Debug contents of map. */
|
||||
/** Debug contents of map. */
|
||||
void print_debug();
|
||||
|
||||
/* Add a mapping. */
|
||||
/** Add a mapping. */
|
||||
void add_bone(const char *bone, const char *root);
|
||||
|
||||
/* Check if there's a common root bone between two bones. */
|
||||
/** Check if there's a common root bone between two bones. */
|
||||
bool has_common_root(const char *bone1, const char *bone2) const;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -2073,7 +2073,8 @@ void DepsgraphRelationBuilder::build_shapekeys(Key *key)
|
|||
* and also for the links coming from the shapekey data-blocks
|
||||
* - Animation/Drivers affecting the parameters of the geometry are made to
|
||||
* trigger updates on the obdata geometry component, which then trigger
|
||||
* downstream re-evaluation of the individual instances of this geometry. */
|
||||
* downstream re-evaluation of the individual instances of this geometry.
|
||||
*/
|
||||
void DepsgraphRelationBuilder::build_object_data_geometry(Object *object)
|
||||
{
|
||||
ID *obdata = (ID *)object->data;
|
||||
|
@ -2868,7 +2869,8 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations()
|
|||
}
|
||||
}
|
||||
|
||||
/* Nested datablocks (node trees, shape keys) requires special relation to
|
||||
/**
|
||||
* Nested datablocks (node trees, shape keys) requires special relation to
|
||||
* ensure owner's datablock remapping happens after node tree itself is ready.
|
||||
*
|
||||
* This is similar to what happens in ntree_hack_remap_pointers().
|
||||
|
|
|
@ -83,7 +83,6 @@ bool DriverDescriptor::is_array() const
|
|||
return is_array_;
|
||||
}
|
||||
|
||||
/* Assumes that 'other' comes from the same RNA group, that is, has the same RNA path prefix. */
|
||||
bool DriverDescriptor::is_same_array_as(const DriverDescriptor &other) const
|
||||
{
|
||||
if (!is_array_ || !other.is_array_) {
|
||||
|
|
|
@ -37,14 +37,17 @@ namespace deg {
|
|||
/* Helper class for determining which relations are needed between driver evaluation nodes. */
|
||||
class DriverDescriptor {
|
||||
public:
|
||||
/* Drivers are grouped by their RNA prefix. The prefix is the part of the RNA
|
||||
/**
|
||||
* Drivers are grouped by their RNA prefix. The prefix is the part of the RNA
|
||||
* path up to the last dot, the suffix is the remainder of the RNA path:
|
||||
*
|
||||
* \code{.unparsed}
|
||||
* fcu->rna_path rna_prefix rna_suffix
|
||||
* ------------------------------- ---------------------- ----------
|
||||
* 'color' '' 'color'
|
||||
* 'rigidbody_world.time_scale' 'rigidbody_world' 'time_scale'
|
||||
* 'pose.bones["master"].location' 'pose.bones["master"]' 'location'
|
||||
* \endcode
|
||||
*/
|
||||
StringRef rna_prefix;
|
||||
StringRef rna_suffix;
|
||||
|
@ -54,7 +57,7 @@ class DriverDescriptor {
|
|||
|
||||
bool driver_relations_needed() const;
|
||||
bool is_array() const;
|
||||
/* Assumes that 'other' comes from the same RNA group, that is, has the same RNA path prefix. */
|
||||
/** Assumes that 'other' comes from the same RNA group, that is, has the same RNA path prefix. */
|
||||
bool is_same_array_as(const DriverDescriptor &other) const;
|
||||
OperationKey depsgraph_key() const;
|
||||
|
||||
|
|
|
@ -182,7 +182,6 @@ void Depsgraph::clear_id_nodes()
|
|||
clear_physics_relations(this);
|
||||
}
|
||||
|
||||
/* Add new relation between two nodes */
|
||||
Relation *Depsgraph::add_new_relation(Node *from, Node *to, const char *description, int flags)
|
||||
{
|
||||
Relation *rel = nullptr;
|
||||
|
@ -228,7 +227,6 @@ Relation *Depsgraph::check_nodes_connected(const Node *from,
|
|||
|
||||
/* Low level tagging -------------------------------------- */
|
||||
|
||||
/* Tag a specific node as needing updates. */
|
||||
void Depsgraph::add_entry_tag(OperationNode *node)
|
||||
{
|
||||
/* Sanity check. */
|
||||
|
@ -280,7 +278,6 @@ ID *Depsgraph::get_cow_id(const ID *id_orig) const
|
|||
/* **************** */
|
||||
/* Public Graph API */
|
||||
|
||||
/* Initialize a new Depsgraph */
|
||||
Depsgraph *DEG_graph_new(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluationMode mode)
|
||||
{
|
||||
deg::Depsgraph *deg_depsgraph = new deg::Depsgraph(bmain, scene, view_layer, mode);
|
||||
|
@ -288,10 +285,6 @@ Depsgraph *DEG_graph_new(Main *bmain, Scene *scene, ViewLayer *view_layer, eEval
|
|||
return reinterpret_cast<Depsgraph *>(deg_depsgraph);
|
||||
}
|
||||
|
||||
/* Replace the "owner" pointers (currently Main/Scene/ViewLayer) of this depsgraph.
|
||||
* Used for:
|
||||
* - Undo steps when we do want to re-use the old depsgraph data as much as possible.
|
||||
* - Rendering where we want to re-use objects between different view layers. */
|
||||
void DEG_graph_replace_owners(struct Depsgraph *depsgraph,
|
||||
Main *bmain,
|
||||
Scene *scene,
|
||||
|
@ -313,7 +306,6 @@ void DEG_graph_replace_owners(struct Depsgraph *depsgraph,
|
|||
}
|
||||
}
|
||||
|
||||
/* Free graph's contents and graph itself */
|
||||
void DEG_graph_free(Depsgraph *graph)
|
||||
{
|
||||
if (graph == nullptr) {
|
||||
|
|
|
@ -72,7 +72,7 @@ struct Depsgraph {
|
|||
IDNode *add_id_node(ID *id, ID *id_cow_hint = nullptr);
|
||||
void clear_id_nodes();
|
||||
|
||||
/* Add new relationship between two nodes. */
|
||||
/** Add new relationship between two nodes. */
|
||||
Relation *add_new_relation(Node *from, Node *to, const char *description, int flags = 0);
|
||||
|
||||
/* Check whether two nodes are connected by relation with given
|
||||
|
|
|
@ -252,7 +252,6 @@ struct Depsgraph *DEG_get_graph_from_handle(struct DepsNodeHandle *node_handle)
|
|||
/* ******************** */
|
||||
/* Graph Building API's */
|
||||
|
||||
/* Build depsgraph for the given scene layer, and dump results in given graph container. */
|
||||
void DEG_graph_build_from_view_layer(Depsgraph *graph)
|
||||
{
|
||||
deg::ViewLayerBuilderPipeline builder(graph);
|
||||
|
@ -283,7 +282,6 @@ void DEG_graph_build_from_ids(Depsgraph *graph, ID **ids, const int num_ids)
|
|||
builder.build();
|
||||
}
|
||||
|
||||
/* Tag graph relations for update. */
|
||||
void DEG_graph_tag_relations_update(Depsgraph *graph)
|
||||
{
|
||||
DEG_DEBUG_PRINTF(graph, TAG, "%s: Tagging relations for update.\n", __func__);
|
||||
|
@ -301,7 +299,6 @@ void DEG_graph_tag_relations_update(Depsgraph *graph)
|
|||
}
|
||||
}
|
||||
|
||||
/* Create or update relations in the specified graph. */
|
||||
void DEG_graph_relations_update(Depsgraph *graph)
|
||||
{
|
||||
deg::Depsgraph *deg_graph = (deg::Depsgraph *)graph;
|
||||
|
@ -312,7 +309,6 @@ void DEG_graph_relations_update(Depsgraph *graph)
|
|||
DEG_graph_build_from_view_layer(graph);
|
||||
}
|
||||
|
||||
/* Tag all relations for update. */
|
||||
void DEG_relations_tag_update(Main *bmain)
|
||||
{
|
||||
DEG_GLOBAL_DEBUG_PRINTF(TAG, "%s: Tagging relations for update.\n", __func__);
|
||||
|
|
|
@ -196,12 +196,6 @@ bool DEG_debug_consistency_check(Depsgraph *graph)
|
|||
|
||||
/* ------------------------------------------------ */
|
||||
|
||||
/**
|
||||
* Obtain simple statistics about the complexity of the depsgraph.
|
||||
* \param[out] r_outer: The number of outer nodes in the graph
|
||||
* \param[out] r_operations: The number of operation nodes in the graph
|
||||
* \param[out] r_relations: The number of relations between (executable) nodes in the graph
|
||||
*/
|
||||
void DEG_stats_simple(const Depsgraph *graph,
|
||||
size_t *r_outer,
|
||||
size_t *r_operations,
|
||||
|
|
|
@ -60,7 +60,6 @@ static void deg_flush_updates_and_refresh(deg::Depsgraph *deg_graph)
|
|||
deg::deg_evaluate_on_refresh(deg_graph);
|
||||
}
|
||||
|
||||
/* Evaluate all nodes tagged for updating. */
|
||||
void DEG_evaluate_on_refresh(Depsgraph *graph)
|
||||
{
|
||||
deg::Depsgraph *deg_graph = reinterpret_cast<deg::Depsgraph *>(graph);
|
||||
|
@ -77,7 +76,6 @@ void DEG_evaluate_on_refresh(Depsgraph *graph)
|
|||
deg_flush_updates_and_refresh(deg_graph);
|
||||
}
|
||||
|
||||
/* Frame-change happened for root scene that graph belongs to. */
|
||||
void DEG_evaluate_on_framechange(Depsgraph *graph, float frame)
|
||||
{
|
||||
deg::Depsgraph *deg_graph = reinterpret_cast<deg::Depsgraph *>(graph);
|
||||
|
|
|
@ -200,7 +200,6 @@ ID *DEG_get_evaluated_id(const Depsgraph *depsgraph, ID *id)
|
|||
return id_node->id_cow;
|
||||
}
|
||||
|
||||
/* Get evaluated version of data pointed to by RNA pointer */
|
||||
void DEG_get_evaluated_rna_pointer(const Depsgraph *depsgraph,
|
||||
PointerRNA *ptr,
|
||||
PointerRNA *r_ptr_eval)
|
||||
|
|
|
@ -755,7 +755,6 @@ const char *DEG_update_tag_as_string(IDRecalcFlag flag)
|
|||
|
||||
/* Data-Based Tagging. */
|
||||
|
||||
/* Tag given ID for an update in all the dependency graphs. */
|
||||
void DEG_id_tag_update(ID *id, int flag)
|
||||
{
|
||||
DEG_id_tag_update_ex(G.main, id, flag);
|
||||
|
@ -792,7 +791,6 @@ void DEG_graph_time_tag_update(struct Depsgraph *depsgraph)
|
|||
deg_graph->tag_time_source();
|
||||
}
|
||||
|
||||
/* Mark a particular data-block type as having changing. */
|
||||
void DEG_graph_id_type_tag(Depsgraph *depsgraph, short id_type)
|
||||
{
|
||||
if (id_type == ID_NT) {
|
||||
|
@ -817,7 +815,6 @@ void DEG_id_type_tag(Main *bmain, short id_type)
|
|||
}
|
||||
}
|
||||
|
||||
/* Update dependency graph when visible scenes/layers changes. */
|
||||
void DEG_graph_tag_on_visible_update(Depsgraph *depsgraph, const bool do_time)
|
||||
{
|
||||
deg::Depsgraph *graph = (deg::Depsgraph *)depsgraph;
|
||||
|
@ -837,8 +834,6 @@ void DEG_enable_editors_update(Depsgraph *depsgraph)
|
|||
graph->use_editors_update = true;
|
||||
}
|
||||
|
||||
/* Check if something was changed in the database and inform
|
||||
* editors about this. */
|
||||
void DEG_editors_update(Depsgraph *depsgraph, bool time)
|
||||
{
|
||||
deg::Depsgraph *graph = (deg::Depsgraph *)depsgraph;
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
|
||||
namespace deg = blender::deg;
|
||||
|
||||
/* Register all node types */
|
||||
void DEG_register_node_types()
|
||||
{
|
||||
/* register node types */
|
||||
|
@ -48,7 +47,6 @@ void DEG_register_node_types()
|
|||
deg::deg_register_operation_depsnodes();
|
||||
}
|
||||
|
||||
/* Free registry on exit */
|
||||
void DEG_free_node_types()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -50,7 +50,6 @@ void deg_editors_scene_update(const DEGEditorUpdateContext *update_ctx, bool upd
|
|||
|
||||
} // namespace blender::deg
|
||||
|
||||
/* Set callbacks which are being called when depsgraph changes. */
|
||||
void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, DEG_EditorUpdateSceneCb scene_func)
|
||||
{
|
||||
deg::deg_editor_update_id_cb = id_func;
|
||||
|
|
|
@ -361,13 +361,6 @@ static TaskPool *deg_evaluate_task_pool_create(DepsgraphEvalState *state)
|
|||
return BLI_task_pool_create_suspended(state, TASK_PRIORITY_HIGH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluate all nodes tagged for updating,
|
||||
* \warning This is usually done as part of main loop, but may also be
|
||||
* called from frame-change update.
|
||||
*
|
||||
* \note Time sources should be all valid!
|
||||
*/
|
||||
void deg_evaluate_on_refresh(Depsgraph *graph)
|
||||
{
|
||||
/* Nothing to update, early out. */
|
||||
|
|
|
@ -906,7 +906,9 @@ ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph, const IDNode
|
|||
return id_cow;
|
||||
}
|
||||
|
||||
/* NOTE: Depsgraph is supposed to have ID node already. */
|
||||
/**
|
||||
* \note Depsgraph is supposed to have ID node already.
|
||||
*/
|
||||
ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph, ID *id_orig)
|
||||
{
|
||||
IDNode *id_node = depsgraph->find_id_node(id_orig);
|
||||
|
@ -987,10 +989,12 @@ void discard_edit_mode_pointers(ID *id_cow)
|
|||
|
||||
} // namespace
|
||||
|
||||
/* Free content of the CoW data-block
|
||||
/**
|
||||
Free content of the CoW data-block.
|
||||
* Notes:
|
||||
* - Does not recurse into nested ID data-blocks.
|
||||
* - Does not free data-block itself. */
|
||||
* - Does not free data-block itself.
|
||||
*/
|
||||
void deg_free_copy_on_write_datablock(ID *id_cow)
|
||||
{
|
||||
if (!check_datablock_expanded(id_cow)) {
|
||||
|
|
|
@ -50,34 +50,40 @@ struct Depsgraph;
|
|||
class DepsgraphNodeBuilder;
|
||||
struct IDNode;
|
||||
|
||||
/* Makes sure given CoW data-block is brought back to state of the original
|
||||
/**
|
||||
* Makes sure given CoW data-block is brought back to state of the original
|
||||
* data-block.
|
||||
*/
|
||||
ID *deg_update_copy_on_write_datablock(const struct Depsgraph *depsgraph, const IDNode *id_node);
|
||||
ID *deg_update_copy_on_write_datablock(const struct Depsgraph *depsgraph, struct ID *id_orig);
|
||||
|
||||
/* Helper function which frees memory used by copy-on-written data-block. */
|
||||
/** Helper function which frees memory used by copy-on-written data-block. */
|
||||
void deg_free_copy_on_write_datablock(struct ID *id_cow);
|
||||
|
||||
/* Callback function for depsgraph operation node which ensures copy-on-write
|
||||
/**
|
||||
* Callback function for depsgraph operation node which ensures copy-on-write
|
||||
* data-block is ready for use by further evaluation routines.
|
||||
*/
|
||||
void deg_evaluate_copy_on_write(struct ::Depsgraph *depsgraph, const struct IDNode *id_node);
|
||||
|
||||
/* Check that given ID is properly expanded and does not have any shallow
|
||||
* copies inside. */
|
||||
/**
|
||||
* Check that given ID is properly expanded and does not have any shallow
|
||||
* copies inside.
|
||||
*/
|
||||
bool deg_validate_copy_on_write_datablock(ID *id_cow);
|
||||
|
||||
/* Tag given ID block as being copy-on-written. */
|
||||
/** Tag given ID block as being copy-on-written. */
|
||||
void deg_tag_copy_on_write_id(struct ID *id_cow, const struct ID *id_orig);
|
||||
|
||||
/* Check whether ID data-block is expanded.
|
||||
/**
|
||||
* Check whether ID data-block is expanded.
|
||||
*
|
||||
* TODO(sergey): Make it an inline function or a macro.
|
||||
*/
|
||||
bool deg_copy_on_write_is_expanded(const struct ID *id_cow);
|
||||
|
||||
/* Check whether copy-on-write data-block is needed for given ID.
|
||||
/**
|
||||
* Check whether copy-on-write data-block is needed for given ID.
|
||||
*
|
||||
* There are some exceptions on data-blocks which are covered by dependency graph
|
||||
* but which we don't want to start duplicating.
|
||||
|
|
|
@ -346,9 +346,6 @@ void invalidate_tagged_evaluated_data(Depsgraph *graph)
|
|||
|
||||
} // namespace
|
||||
|
||||
/* Flush updates from tagged nodes outwards until all affected nodes
|
||||
* are tagged.
|
||||
*/
|
||||
void deg_graph_flush_updates(Depsgraph *graph)
|
||||
{
|
||||
/* Sanity checks. */
|
||||
|
@ -395,7 +392,6 @@ void deg_graph_flush_updates(Depsgraph *graph)
|
|||
invalidate_tagged_evaluated_data(graph);
|
||||
}
|
||||
|
||||
/* Clear tags from all operation nodes. */
|
||||
void deg_graph_clear_tags(Depsgraph *graph)
|
||||
{
|
||||
/* Go over all operation nodes, clearing tags. */
|
||||
|
|
|
@ -30,12 +30,14 @@ namespace deg {
|
|||
|
||||
struct Depsgraph;
|
||||
|
||||
/* Flush updates from tagged nodes outwards until all affected nodes
|
||||
* are tagged.
|
||||
/**
|
||||
* Flush updates from tagged nodes outwards until all affected nodes are tagged.
|
||||
*/
|
||||
void deg_graph_flush_updates(struct Depsgraph *graph);
|
||||
|
||||
/* Clear tags from all operation nodes. */
|
||||
/**
|
||||
* Clear tags from all operation nodes.
|
||||
*/
|
||||
void deg_graph_clear_tags(struct Depsgraph *graph);
|
||||
|
||||
} // namespace deg
|
||||
|
|
|
@ -311,7 +311,6 @@ Node::~Node()
|
|||
}
|
||||
}
|
||||
|
||||
/* Generic identifier for Depsgraph Nodes. */
|
||||
string Node::identifier() const
|
||||
{
|
||||
return string(nodeTypeAsString(type)) + " : " + name;
|
||||
|
|
|
@ -201,6 +201,7 @@ struct Node {
|
|||
Node();
|
||||
virtual ~Node();
|
||||
|
||||
/** Generic identifier for Depsgraph Nodes. */
|
||||
virtual string identifier() const;
|
||||
|
||||
virtual void init(const ID * /*id*/, const char * /*subdata*/)
|
||||
|
|
|
@ -43,7 +43,9 @@ namespace blender::deg {
|
|||
/* *********** */
|
||||
/* Outer Nodes */
|
||||
|
||||
/* Standard Component Methods ============================= */
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Standard Component Methods
|
||||
* \{ */
|
||||
|
||||
ComponentNode::OperationIDKey::OperationIDKey()
|
||||
: opcode(OperationCode::OPERATION), name(""), name_tag(-1)
|
||||
|
@ -86,7 +88,6 @@ ComponentNode::ComponentNode()
|
|||
operations_map = new Map<ComponentNode::OperationIDKey, OperationNode *>();
|
||||
}
|
||||
|
||||
/* Initialize 'component' node - from pointer data given */
|
||||
void ComponentNode::init(const ID * /*id*/, const char * /*subdata*/)
|
||||
{
|
||||
/* hook up eval context? */
|
||||
|
@ -297,9 +298,12 @@ void ComponentNode::finalize_build(Depsgraph * /*graph*/)
|
|||
operations_map = nullptr;
|
||||
}
|
||||
|
||||
/* Bone Component ========================================= */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Bone Component
|
||||
* \{ */
|
||||
|
||||
/* Initialize 'bone component' node - from pointer data given */
|
||||
void BoneComponentNode::init(const ID *id, const char *subdata)
|
||||
{
|
||||
/* generic component-node... */
|
||||
|
@ -315,7 +319,11 @@ void BoneComponentNode::init(const ID *id, const char *subdata)
|
|||
this->pchan = BKE_pose_channel_find_name(object->pose, subdata);
|
||||
}
|
||||
|
||||
/* Register all components. =============================== */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Register All Components
|
||||
* \{ */
|
||||
|
||||
DEG_COMPONENT_NODE_DEFINE(Animation, ANIMATION, ID_RECALC_ANIMATION);
|
||||
/* TODO(sergey): Is this a correct tag? */
|
||||
|
@ -344,7 +352,11 @@ DEG_COMPONENT_NODE_DEFINE(GenericDatablock, GENERIC_DATABLOCK, 0);
|
|||
DEG_COMPONENT_NODE_DEFINE(Visibility, VISIBILITY, 0);
|
||||
DEG_COMPONENT_NODE_DEFINE(Simulation, SIMULATION, 0);
|
||||
|
||||
/* Node Types Register =================================== */
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Node Types Register
|
||||
* \{ */
|
||||
|
||||
void deg_register_component_depsnodes()
|
||||
{
|
||||
|
@ -375,4 +387,6 @@ void deg_register_component_depsnodes()
|
|||
register_node_typeinfo(&DNTI_SIMULATION);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
} // namespace blender::deg
|
||||
|
|
|
@ -67,6 +67,7 @@ struct ComponentNode : public Node {
|
|||
ComponentNode();
|
||||
~ComponentNode();
|
||||
|
||||
/** Initialize 'component' node - from pointer data given. */
|
||||
void init(const ID *id, const char *subdata) override;
|
||||
|
||||
virtual string identifier() const override;
|
||||
|
@ -224,6 +225,7 @@ DEG_COMPONENT_NODE_DECLARE_GENERIC(Simulation);
|
|||
|
||||
/* Bone Component */
|
||||
struct BoneComponentNode : public ComponentNode {
|
||||
/** Initialize 'bone component' node - from pointer data given. */
|
||||
void init(const ID *id, const char *subdata);
|
||||
|
||||
struct bPoseChannel *pchan; /* the bone that this component represents */
|
||||
|
|
|
@ -73,7 +73,6 @@ uint64_t IDNode::ComponentIDKey::hash() const
|
|||
BLI_ghashutil_strhash_p(name));
|
||||
}
|
||||
|
||||
/* Initialize 'id' node - from pointer data given. */
|
||||
void IDNode::init(const ID *id, const char *UNUSED(subdata))
|
||||
{
|
||||
BLI_assert(id != nullptr);
|
||||
|
|
|
@ -58,6 +58,7 @@ struct IDNode : public Node {
|
|||
const char *name;
|
||||
};
|
||||
|
||||
/** Initialize 'id' node - from pointer data given. */
|
||||
virtual void init(const ID *id, const char *subdata) override;
|
||||
void init_copy_on_write(ID *id_cow_hint = nullptr);
|
||||
~IDNode();
|
||||
|
|
|
@ -218,8 +218,6 @@ string OperationNode::identifier() const
|
|||
return string(operationCodeAsString(opcode)) + "(" + name + ")";
|
||||
}
|
||||
|
||||
/* Full node identifier, including owner name.
|
||||
* used for logging and debug prints. */
|
||||
string OperationNode::full_identifier() const
|
||||
{
|
||||
string owner_str = owner->owner->name;
|
||||
|
|
|
@ -233,6 +233,10 @@ struct OperationNode : public Node {
|
|||
OperationNode();
|
||||
|
||||
virtual string identifier() const override;
|
||||
/**
|
||||
* Full node identifier, including owner name.
|
||||
* used for logging and debug prints.
|
||||
*/
|
||||
string full_identifier() const;
|
||||
|
||||
virtual void tag_update(Depsgraph *graph, eUpdateSource source) override;
|
||||
|
|
Loading…
Reference in New Issue