Merge branch 'blender-v2.83-release'

Conflicts:
	source/blender/blenkernel/intern/lib_query.c
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
This commit is contained in:
Bastien Montagne 2020-04-28 15:37:19 +02:00
commit 6278b48ea1
14 changed files with 246 additions and 32 deletions

View File

@ -1011,7 +1011,13 @@ bool OSLRenderServices::get_userdata(
return false; /* disabled by lockgeom */
}
#if OSL_LIBRARY_VERSION_CODE >= 11100
TextureSystem::TextureHandle *OSLRenderServices::get_texture_handle(ustring filename,
OSL::ShadingContext *)
#else
TextureSystem::TextureHandle *OSLRenderServices::get_texture_handle(ustring filename)
#endif
{
OSLTextureHandleMap::iterator it = textures.find(filename);
@ -1365,6 +1371,17 @@ bool OSLRenderServices::environment(ustring filename,
return status;
}
#if OSL_LIBRARY_VERSION_CODE >= 11100
bool OSLRenderServices::get_texture_info(ustring filename,
TextureHandle *texture_handle,
TexturePerthread *,
OSL::ShadingContext *,
int subimage,
ustring dataname,
TypeDesc datatype,
void *data,
ustring *)
#else
bool OSLRenderServices::get_texture_info(OSL::ShaderGlobals *sg,
ustring filename,
TextureHandle *texture_handle,
@ -1372,6 +1389,7 @@ bool OSLRenderServices::get_texture_info(OSL::ShaderGlobals *sg,
ustring dataname,
TypeDesc datatype,
void *data)
#endif
{
OSLTextureHandle *handle = (OSLTextureHandle *)texture_handle;

View File

@ -173,7 +173,12 @@ class OSLRenderServices : public OSL::RendererServices {
void *val,
bool derivatives) override;
#if OSL_LIBRARY_VERSION_CODE >= 11100
TextureSystem::TextureHandle *get_texture_handle(ustring filename,
OSL::ShadingContext *context) override;
#else
TextureSystem::TextureHandle *get_texture_handle(ustring filename) override;
#endif
bool good(TextureSystem::TextureHandle *texture_handle) override;
@ -224,6 +229,17 @@ class OSLRenderServices : public OSL::RendererServices {
float *dresultdt,
ustring *errormessage) override;
#if OSL_LIBRARY_VERSION_CODE >= 11100
bool get_texture_info(ustring filename,
TextureHandle *texture_handle,
TexturePerthread *texture_thread_info,
OSL::ShadingContext *shading_context,
int subimage,
ustring dataname,
TypeDesc datatype,
void *data,
ustring *errormessage) override;
#else
bool get_texture_info(OSL::ShaderGlobals *sg,
ustring filename,
TextureHandle *texture_handle,
@ -231,6 +247,7 @@ class OSLRenderServices : public OSL::RendererServices {
ustring dataname,
TypeDesc datatype,
void *data) override;
#endif
static bool get_background_attribute(
KernelGlobals *kg, ShaderData *sd, ustring name, TypeDesc type, bool derivatives, void *val);

View File

@ -179,6 +179,17 @@ void IDP_Reset(IDProperty *prop, const IDProperty *reference);
# define IDP_Id(prop) ((ID *)(prop)->data.pointer)
#endif
/**
* Call a callback for each idproperty in the hierarchy under given root one (included).
*
*/
typedef void (*IDPForeachPropertyCallback)(IDProperty *id_property, void *user_data);
void IDP_foreach_property(struct IDProperty *id_property_root,
const int type_filter,
IDPForeachPropertyCallback callback,
void *user_data);
/* Format IDProperty as strings */
char *IDP_reprN(const struct IDProperty *prop, uint *r_len);
void IDP_repr_fn(const IDProperty *prop,

View File

@ -1130,4 +1130,45 @@ void IDP_Reset(IDProperty *prop, const IDProperty *reference)
}
}
/**
* Loop through all ID properties in hierarchy of given \a id_property_root included.
*
* \note Container types (groups and arrays) are processed after applying the callback on them.
*
* \param type_filter: If not 0, only apply callback on properties of matching types, see
* IDP_TYPE_FILTER_ enum in DNA_ID.h.
*/
void IDP_foreach_property(IDProperty *id_property_root,
const int type_filter,
IDPForeachPropertyCallback callback,
void *user_data)
{
if (!id_property_root) {
return;
}
if (type_filter == 0 || (1 << id_property_root->type) & type_filter) {
callback(id_property_root, user_data);
}
/* Recursive call into container types of ID properties. */
switch (id_property_root->type) {
case IDP_GROUP: {
LISTBASE_FOREACH (IDProperty *, loop, &id_property_root->data.group) {
IDP_foreach_property(loop, type_filter, callback, user_data);
}
break;
}
case IDP_IDPARRAY: {
IDProperty *loop = IDP_Array(id_property_root);
for (int i = 0; i < id_property_root->len; i++) {
IDP_foreach_property(&loop[i], type_filter, callback, user_data);
}
break;
}
default:
break; /* Nothing to do here with other types of IDProperties... */
}
}
/** \} */

View File

@ -173,41 +173,20 @@ static void library_foreach_ID_link(Main *bmain,
int flag,
LibraryForeachIDData *inherit_data);
static void library_foreach_idproperty_ID_link(LibraryForeachIDData *data,
IDProperty *prop,
int flag)
static void library_foreach_idpropertiesForeachIDLink(IDProperty *id_prop, void *user_data)
{
if (!prop) {
return;
}
BLI_assert(id_prop->type == IDP_ID);
switch (prop->type) {
case IDP_GROUP: {
LISTBASE_FOREACH (IDProperty *, loop, &prop->data.group) {
library_foreach_idproperty_ID_link(data, loop, flag);
}
break;
}
case IDP_IDPARRAY: {
IDProperty *loop = IDP_Array(prop);
for (int i = 0; i < prop->len; i++) {
library_foreach_idproperty_ID_link(data, &loop[i], flag);
}
break;
}
case IDP_ID:
FOREACH_CALLBACK_INVOKE_ID(data, prop->data.pointer, flag);
break;
default:
break; /* Nothing to do here with other types of IDProperties... */
}
LibraryForeachIDData *data = (LibraryForeachIDData *)user_data;
FOREACH_CALLBACK_INVOKE_ID(data, id_prop->data.pointer, IDWALK_CB_USER);
FOREACH_FINALIZE_VOID;
}
static void library_foreach_node_socket(LibraryForeachIDData *data, bNodeSocket *sock)
{
library_foreach_idproperty_ID_link(data, sock->prop, IDWALK_CB_USER);
IDP_foreach_property(
sock->prop, IDP_TYPE_FILTER_ID, library_foreach_idpropertiesForeachIDLink, &data);
switch ((eNodeSocketDatatype)sock->type) {
case SOCK_OBJECT: {
@ -371,7 +350,8 @@ static void library_foreach_paint(LibraryForeachIDData *data, Paint *paint)
static void library_foreach_bone(LibraryForeachIDData *data, Bone *bone)
{
library_foreach_idproperty_ID_link(data, bone->prop, IDWALK_CB_USER);
IDP_foreach_property(
bone->prop, IDP_TYPE_FILTER_ID, library_foreach_idpropertiesForeachIDLink, data);
LISTBASE_FOREACH (Bone *, curbone, &bone->childbase) {
library_foreach_bone(data, curbone);
@ -677,7 +657,8 @@ static void library_foreach_ID_link(Main *bmain,
IDWALK_CB_USER | IDWALK_CB_OVERRIDE_LIBRARY_REFERENCE);
}
library_foreach_idproperty_ID_link(&data, id->properties, IDWALK_CB_USER);
IDP_foreach_property(
id->properties, IDP_TYPE_FILTER_ID, library_foreach_idpropertiesForeachIDLink, &data);
AnimData *adt = BKE_animdata_from_id(id);
if (adt) {
@ -713,7 +694,8 @@ static void library_foreach_ID_link(Main *bmain,
CALLBACK_INVOKE(seq->clip, IDWALK_CB_USER);
CALLBACK_INVOKE(seq->mask, IDWALK_CB_USER);
CALLBACK_INVOKE(seq->sound, IDWALK_CB_USER);
library_foreach_idproperty_ID_link(&data, seq->prop, IDWALK_CB_USER);
IDP_foreach_property(
seq->prop, IDP_TYPE_FILTER_ID, library_foreach_idpropertiesForeachIDLink, &data);
LISTBASE_FOREACH (SequenceModifierData *, smd, &seq->modifiers) {
CALLBACK_INVOKE(smd->mask_id, IDWALK_CB_USER);
}
@ -871,7 +853,8 @@ static void library_foreach_ID_link(Main *bmain,
data.cb_flag |= proxy_cb_flag;
for (pchan = object->pose->chanbase.first; pchan; pchan = pchan->next) {
library_foreach_idproperty_ID_link(&data, pchan->prop, IDWALK_CB_USER);
IDP_foreach_property(
pchan->prop, IDP_TYPE_FILTER_ID, library_foreach_idpropertiesForeachIDLink, &data);
CALLBACK_INVOKE(pchan->custom, IDWALK_CB_USER);
BKE_constraints_id_loop(
&pchan->constraints, library_foreach_constraintObjectLooper, &data);
@ -1058,7 +1041,8 @@ static void library_foreach_ID_link(Main *bmain,
for (node = ntree->nodes.first; node; node = node->next) {
CALLBACK_INVOKE_ID(node->id, IDWALK_CB_USER);
library_foreach_idproperty_ID_link(&data, node->prop, IDWALK_CB_USER);
IDP_foreach_property(
node->prop, IDP_TYPE_FILTER_ID, library_foreach_idpropertiesForeachIDLink, &data);
LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) {
library_foreach_node_socket(&data, sock);
}

View File

@ -78,6 +78,7 @@ extern "C" {
#include "BKE_fcurve.h"
#include "BKE_gpencil.h"
#include "BKE_gpencil_modifier.h"
#include "BKE_idprop.h"
#include "BKE_idtype.h"
#include "BKE_image.h"
#include "BKE_key.h"
@ -480,6 +481,18 @@ void DepsgraphNodeBuilder::build_id(ID *id)
}
}
static void build_idproperties_callback(IDProperty *id_property, void *user_data)
{
DepsgraphNodeBuilder *builder = reinterpret_cast<DepsgraphNodeBuilder *>(user_data);
BLI_assert(id_property->type == IDP_ID);
builder->build_id(reinterpret_cast<ID *>(id_property->data.pointer));
}
void DepsgraphNodeBuilder::build_idproperties(IDProperty *id_property)
{
IDP_foreach_property(id_property, IDP_TYPE_FILTER_ID, build_idproperties_callback, this);
}
void DepsgraphNodeBuilder::build_collection(LayerCollection *from_layer_collection,
Collection *collection)
{
@ -508,6 +521,8 @@ void DepsgraphNodeBuilder::build_collection(LayerCollection *from_layer_collecti
/* Collection itself. */
id_node = add_id_node(&collection->id);
id_node->is_directly_visible = is_collection_visible;
build_idproperties(collection->id.properties);
}
if (from_layer_collection != nullptr) {
/* If we came from layer collection we don't go deeper, view layer
@ -620,6 +635,7 @@ void DepsgraphNodeBuilder::build_object(int base_index,
/* Parameters, used by both drivers/animation and also to inform dependency
* from object's data. */
build_parameters(&object->id);
build_idproperties(object->id.properties);
/* Build animation data,
*
* Do it now because it's possible object data will affect
@ -934,6 +950,7 @@ void DepsgraphNodeBuilder::build_action(bAction *action)
if (built_map_.checkIsBuiltAndTag(action)) {
return;
}
build_idproperties(action->id.properties);
add_operation_node(&action->id, NodeType::ANIMATION, OperationCode::ANIMATION_EVAL);
}
@ -1039,6 +1056,7 @@ void DepsgraphNodeBuilder::build_world(World *world)
NodeType::SHADING,
OperationCode::WORLD_UPDATE,
function_bind(BKE_world_eval, _1, world_cow));
build_idproperties(world->id.properties);
/* Animation. */
build_animdata(&world->id);
build_parameters(&world->id);
@ -1221,6 +1239,7 @@ void DepsgraphNodeBuilder::build_shapekeys(Key *key)
if (built_map_.checkIsBuiltAndTag(key)) {
return;
}
build_idproperties(key->id.properties);
build_animdata(&key->id);
build_parameters(&key->id);
/* This is an exit operation for the entire key datablock, is what is used
@ -1275,6 +1294,7 @@ void DepsgraphNodeBuilder::build_object_data_geometry_datablock(ID *obdata, bool
/* Make sure we've got an ID node before requesting CoW pointer. */
(void)add_id_node((ID *)obdata);
ID *obdata_cow = get_cow_id(obdata);
build_idproperties(obdata->properties);
/* Animation. */
build_animdata(obdata);
/* ShapeKeys */
@ -1380,10 +1400,20 @@ void DepsgraphNodeBuilder::build_armature(bArmature *armature)
if (built_map_.checkIsBuiltAndTag(armature)) {
return;
}
build_idproperties(armature->id.properties);
build_animdata(&armature->id);
build_parameters(&armature->id);
/* Make sure pose is up-to-date with armature updates. */
add_operation_node(&armature->id, NodeType::ARMATURE, OperationCode::ARMATURE_EVAL);
build_armature_bones(&armature->bonebase);
}
void DepsgraphNodeBuilder::build_armature_bones(ListBase *bones)
{
LISTBASE_FOREACH (Bone *, bone, bones) {
build_idproperties(bone->prop);
build_armature_bones(&bone->childbase);
}
}
void DepsgraphNodeBuilder::build_camera(Camera *camera)
@ -1391,6 +1421,7 @@ void DepsgraphNodeBuilder::build_camera(Camera *camera)
if (built_map_.checkIsBuiltAndTag(camera)) {
return;
}
build_idproperties(camera->id.properties);
build_animdata(&camera->id);
build_parameters(&camera->id);
if (camera->dof.focus_object != nullptr) {
@ -1403,6 +1434,7 @@ void DepsgraphNodeBuilder::build_light(Light *lamp)
if (built_map_.checkIsBuiltAndTag(lamp)) {
return;
}
build_idproperties(lamp->id.properties);
build_animdata(&lamp->id);
build_parameters(&lamp->id);
/* light's nodetree */
@ -1422,6 +1454,7 @@ void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree)
bNodeTree *ntree_cow = get_cow_datablock(ntree);
/* General parameters. */
build_parameters(&ntree->id);
build_idproperties(ntree->id.properties);
/* Animation, */
build_animdata(&ntree->id);
/* Shading update. */
@ -1434,6 +1467,14 @@ void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree)
function_bind(BKE_nodetree_shading_params_eval, _1, ntree_cow, ntree));
/* nodetree's nodes... */
LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) {
build_idproperties(bnode->prop);
LISTBASE_FOREACH (bNodeSocket *, socket, &bnode->inputs) {
build_idproperties(socket->prop);
}
LISTBASE_FOREACH (bNodeSocket *, socket, &bnode->outputs) {
build_idproperties(socket->prop);
}
ID *id = bnode->id;
if (id == nullptr) {
continue;
@ -1482,6 +1523,13 @@ void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree)
}
}
LISTBASE_FOREACH (bNodeSocket *, socket, &ntree->inputs) {
build_idproperties(socket->prop);
}
LISTBASE_FOREACH (bNodeSocket *, socket, &ntree->outputs) {
build_idproperties(socket->prop);
}
// TODO: link from nodetree to owner_component?
}
@ -1499,6 +1547,7 @@ void DepsgraphNodeBuilder::build_material(Material *material)
NodeType::SHADING,
OperationCode::MATERIAL_UPDATE,
function_bind(BKE_material_eval, _1, material_cow));
build_idproperties(material->id.properties);
/* Material animation. */
build_animdata(&material->id);
build_parameters(&material->id);
@ -1523,6 +1572,7 @@ void DepsgraphNodeBuilder::build_texture(Tex *texture)
return;
}
/* Texture itself. */
build_idproperties(texture->id.properties);
build_animdata(&texture->id);
build_parameters(&texture->id);
/* Texture's nodetree. */
@ -1543,6 +1593,7 @@ void DepsgraphNodeBuilder::build_image(Image *image)
return;
}
build_parameters(&image->id);
build_idproperties(image->id.properties);
add_operation_node(
&image->id, NodeType::GENERIC_DATABLOCK, OperationCode::GENERIC_DATABLOCK_UPDATE);
}
@ -1571,6 +1622,7 @@ void DepsgraphNodeBuilder::build_cachefile(CacheFile *cache_file)
ID *cache_file_id = &cache_file->id;
add_id_node(cache_file_id);
CacheFile *cache_file_cow = get_cow_datablock(cache_file);
build_idproperties(cache_file_id->properties);
/* Animation, */
build_animdata(cache_file_id);
build_parameters(cache_file_id);
@ -1588,6 +1640,7 @@ void DepsgraphNodeBuilder::build_mask(Mask *mask)
}
ID *mask_id = &mask->id;
Mask *mask_cow = (Mask *)ensure_cow_id(mask_id);
build_idproperties(mask->id.properties);
/* F-Curve based animation. */
build_animdata(mask_id);
build_parameters(mask_id);
@ -1624,6 +1677,7 @@ void DepsgraphNodeBuilder::build_freestyle_linestyle(FreestyleLineStyle *linesty
ID *linestyle_id = &linestyle->id;
build_parameters(linestyle_id);
build_idproperties(linestyle->id.properties);
build_animdata(linestyle_id);
build_nodetree(linestyle->nodetree);
}
@ -1635,6 +1689,7 @@ void DepsgraphNodeBuilder::build_movieclip(MovieClip *clip)
}
ID *clip_id = &clip->id;
MovieClip *clip_cow = (MovieClip *)ensure_cow_id(clip_id);
build_idproperties(clip_id->properties);
/* Animation. */
build_animdata(clip_id);
build_parameters(clip_id);
@ -1657,6 +1712,7 @@ void DepsgraphNodeBuilder::build_lightprobe(LightProbe *probe)
}
/* Placeholder so we can add relations and tag ID node for update. */
add_operation_node(&probe->id, NodeType::PARAMETERS, OperationCode::LIGHT_PROBE_EVAL);
build_idproperties(probe->id.properties);
build_animdata(&probe->id);
build_parameters(&probe->id);
}
@ -1668,6 +1724,7 @@ void DepsgraphNodeBuilder::build_speaker(Speaker *speaker)
}
/* Placeholder so we can add relations and tag ID node for update. */
add_operation_node(&speaker->id, NodeType::AUDIO, OperationCode::SPEAKER_EVAL);
build_idproperties(speaker->id.properties);
build_animdata(&speaker->id);
build_parameters(&speaker->id);
if (speaker->sound != nullptr) {
@ -1686,6 +1743,7 @@ void DepsgraphNodeBuilder::build_sound(bSound *sound)
NodeType::AUDIO,
OperationCode::SOUND_EVAL,
function_bind(BKE_sound_evaluate, _1, bmain_, sound_cow));
build_idproperties(sound->id.properties);
build_animdata(&sound->id);
build_parameters(&sound->id);
}
@ -1714,6 +1772,7 @@ void DepsgraphNodeBuilder::build_scene_sequencer(Scene *scene)
/* Make sure data for sequences is in the graph. */
Sequence *seq;
SEQ_BEGIN (scene->ed, seq) {
build_idproperties(seq->prop);
if (seq->sound != nullptr) {
build_sound(seq->sound);
}

View File

@ -39,6 +39,7 @@ struct FreestyleLineSet;
struct FreestyleLineStyle;
struct GHash;
struct ID;
struct IDProperty;
struct Image;
struct Key;
struct LayerCollection;
@ -150,6 +151,8 @@ class DepsgraphNodeBuilder : public DepsgraphBuilder {
virtual void build_id(ID *id);
virtual void build_idproperties(IDProperty *id_property);
virtual void build_scene_render(Scene *scene, ViewLayer *view_layer);
virtual void build_scene_parameters(Scene *scene);
virtual void build_scene_compositor(Scene *scene);
@ -200,6 +203,7 @@ class DepsgraphNodeBuilder : public DepsgraphBuilder {
virtual void build_rig(Object *object, bool is_object_visible);
virtual void build_proxy_rig(Object *object);
virtual void build_armature(bArmature *armature);
virtual void build_armature_bones(ListBase *bones);
virtual void build_shapekeys(Key *key);
virtual void build_camera(Camera *camera);
virtual void build_light(Light *lamp);

View File

@ -244,6 +244,7 @@ void DepsgraphNodeBuilder::build_rig(Object *object, bool is_object_visible)
/* Custom properties. */
if (pchan->prop != nullptr) {
build_idproperties(pchan->prop);
add_operation_node(
&object->id, NodeType::PARAMETERS, OperationCode::PARAMETERS_EVAL, nullptr, pchan->name);
}
@ -323,6 +324,7 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *object)
/* Custom properties. */
if (pchan->prop != nullptr) {
build_idproperties(pchan->prop);
add_operation_node(
&object->id, NodeType::PARAMETERS, OperationCode::PARAMETERS_EVAL, nullptr, pchan->name);
}

View File

@ -57,6 +57,7 @@ void DepsgraphNodeBuilder::build_scene_parameters(Scene *scene)
return;
}
build_parameters(&scene->id);
build_idproperties(scene->id.properties);
add_operation_node(&scene->id, NodeType::PARAMETERS, OperationCode::SCENE_EVAL);
/* NOTE: This is a bit overkill and can potentially pull a bit too much into the graph, but:
*

View File

@ -78,6 +78,7 @@ extern "C" {
#include "BKE_effect.h"
#include "BKE_fcurve.h"
#include "BKE_gpencil_modifier.h"
#include "BKE_idprop.h"
#include "BKE_image.h"
#include "BKE_key.h"
#include "BKE_layer.h"
@ -566,6 +567,18 @@ void DepsgraphRelationBuilder::build_id(ID *id)
}
}
static void build_idproperties_callback(IDProperty *id_property, void *user_data)
{
DepsgraphRelationBuilder *builder = reinterpret_cast<DepsgraphRelationBuilder *>(user_data);
BLI_assert(id_property->type == IDP_ID);
builder->build_id(reinterpret_cast<ID *>(id_property->data.pointer));
}
void DepsgraphRelationBuilder::build_idproperties(IDProperty *id_property)
{
IDP_foreach_property(id_property, IDP_TYPE_FILTER_ID, build_idproperties_callback, this);
}
void DepsgraphRelationBuilder::build_collection(LayerCollection *from_layer_collection,
Object *object,
Collection *collection)
@ -579,6 +592,7 @@ void DepsgraphRelationBuilder::build_collection(LayerCollection *from_layer_coll
* recurses into all the nested objects and collections. */
return;
}
build_idproperties(collection->id.properties);
const bool group_done = built_map_.checkIsBuiltAndTag(collection);
OperationKey object_transform_final_key(object != nullptr ? &object->id : nullptr,
NodeType::TRANSFORM,
@ -692,6 +706,7 @@ void DepsgraphRelationBuilder::build_object(Base *base, Object *object)
final_transform_key,
"Simulation -> Final Transform");
}
build_idproperties(object->id.properties);
/* Animation data */
build_animdata(&object->id);
/* Object data. */
@ -1368,6 +1383,7 @@ void DepsgraphRelationBuilder::build_action(bAction *action)
if (built_map_.checkIsBuiltAndTag(action)) {
return;
}
build_idproperties(action->id.properties);
if (!BLI_listbase_is_empty(&action->curves)) {
TimeSourceKey time_src_key;
ComponentKey animation_key(&action->id, NodeType::ANIMATION);
@ -1613,6 +1629,7 @@ void DepsgraphRelationBuilder::build_world(World *world)
if (built_map_.checkIsBuiltAndTag(world)) {
return;
}
build_idproperties(world->id.properties);
/* animation */
build_animdata(&world->id);
build_parameters(&world->id);
@ -1891,6 +1908,7 @@ void DepsgraphRelationBuilder::build_shapekeys(Key *key)
if (built_map_.checkIsBuiltAndTag(key)) {
return;
}
build_idproperties(key->id.properties);
/* Attach animdata to geometry. */
build_animdata(&key->id);
build_parameters(&key->id);
@ -2070,6 +2088,7 @@ void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata)
if (built_map_.checkIsBuiltAndTag(obdata)) {
return;
}
build_idproperties(obdata->properties);
/* Animation. */
build_animdata(obdata);
build_parameters(obdata);
@ -2182,8 +2201,18 @@ void DepsgraphRelationBuilder::build_armature(bArmature *armature)
if (built_map_.checkIsBuiltAndTag(armature)) {
return;
}
build_idproperties(armature->id.properties);
build_animdata(&armature->id);
build_parameters(&armature->id);
build_armature_bones(&armature->bonebase);
}
void DepsgraphRelationBuilder::build_armature_bones(ListBase *bones)
{
LISTBASE_FOREACH (Bone *, bone, bones) {
build_idproperties(bone->prop);
build_armature_bones(&bone->childbase);
}
}
void DepsgraphRelationBuilder::build_camera(Camera *camera)
@ -2191,6 +2220,7 @@ void DepsgraphRelationBuilder::build_camera(Camera *camera)
if (built_map_.checkIsBuiltAndTag(camera)) {
return;
}
build_idproperties(camera->id.properties);
build_animdata(&camera->id);
build_parameters(&camera->id);
if (camera->dof.focus_object != nullptr) {
@ -2207,6 +2237,7 @@ void DepsgraphRelationBuilder::build_light(Light *lamp)
if (built_map_.checkIsBuiltAndTag(lamp)) {
return;
}
build_idproperties(lamp->id.properties);
build_animdata(&lamp->id);
build_parameters(&lamp->id);
/* light's nodetree */
@ -2227,11 +2258,20 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree)
if (built_map_.checkIsBuiltAndTag(ntree)) {
return;
}
build_idproperties(ntree->id.properties);
build_animdata(&ntree->id);
build_parameters(&ntree->id);
ComponentKey shading_key(&ntree->id, NodeType::SHADING);
/* nodetree's nodes... */
LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) {
build_idproperties(bnode->prop);
LISTBASE_FOREACH (bNodeSocket *, socket, &bnode->inputs) {
build_idproperties(socket->prop);
}
LISTBASE_FOREACH (bNodeSocket *, socket, &bnode->outputs) {
build_idproperties(socket->prop);
}
ID *id = bnode->id;
if (id == nullptr) {
continue;
@ -2296,6 +2336,13 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree)
}
}
LISTBASE_FOREACH (bNodeSocket *, socket, &ntree->inputs) {
build_idproperties(socket->prop);
}
LISTBASE_FOREACH (bNodeSocket *, socket, &ntree->outputs) {
build_idproperties(socket->prop);
}
OperationKey shading_update_key(&ntree->id, NodeType::SHADING, OperationCode::MATERIAL_UPDATE);
OperationKey shading_parameters_key(
&ntree->id, NodeType::SHADING_PARAMETERS, OperationCode::MATERIAL_UPDATE);
@ -2315,6 +2362,7 @@ void DepsgraphRelationBuilder::build_material(Material *material)
if (built_map_.checkIsBuiltAndTag(material)) {
return;
}
build_idproperties(material->id.properties);
/* animation */
build_animdata(&material->id);
build_parameters(&material->id);
@ -2347,6 +2395,7 @@ void DepsgraphRelationBuilder::build_texture(Tex *texture)
}
/* texture itself */
ComponentKey texture_key(&texture->id, NodeType::GENERIC_DATABLOCK);
build_idproperties(texture->id.properties);
build_animdata(&texture->id);
build_parameters(&texture->id);
@ -2375,6 +2424,7 @@ void DepsgraphRelationBuilder::build_image(Image *image)
if (built_map_.checkIsBuiltAndTag(image)) {
return;
}
build_idproperties(image->id.properties);
build_parameters(&image->id);
}
@ -2395,6 +2445,7 @@ void DepsgraphRelationBuilder::build_cachefile(CacheFile *cache_file)
if (built_map_.checkIsBuiltAndTag(cache_file)) {
return;
}
build_idproperties(cache_file->id.properties);
/* Animation. */
build_animdata(&cache_file->id);
build_parameters(&cache_file->id);
@ -2424,6 +2475,7 @@ void DepsgraphRelationBuilder::build_mask(Mask *mask)
return;
}
ID *mask_id = &mask->id;
build_idproperties(mask_id->properties);
/* F-Curve animation. */
build_animdata(mask_id);
build_parameters(mask_id);
@ -2462,6 +2514,7 @@ void DepsgraphRelationBuilder::build_freestyle_linestyle(FreestyleLineStyle *lin
ID *linestyle_id = &linestyle->id;
build_parameters(linestyle_id);
build_idproperties(linestyle_id->properties);
build_animdata(linestyle_id);
build_nodetree(linestyle->nodetree);
}
@ -2472,6 +2525,7 @@ void DepsgraphRelationBuilder::build_movieclip(MovieClip *clip)
return;
}
/* Animation. */
build_idproperties(clip->id.properties);
build_animdata(&clip->id);
build_parameters(&clip->id);
}
@ -2481,6 +2535,7 @@ void DepsgraphRelationBuilder::build_lightprobe(LightProbe *probe)
if (built_map_.checkIsBuiltAndTag(probe)) {
return;
}
build_idproperties(probe->id.properties);
build_animdata(&probe->id);
build_parameters(&probe->id);
}
@ -2490,6 +2545,7 @@ void DepsgraphRelationBuilder::build_speaker(Speaker *speaker)
if (built_map_.checkIsBuiltAndTag(speaker)) {
return;
}
build_idproperties(speaker->id.properties);
build_animdata(&speaker->id);
build_parameters(&speaker->id);
if (speaker->sound != nullptr) {
@ -2505,6 +2561,7 @@ void DepsgraphRelationBuilder::build_sound(bSound *sound)
if (built_map_.checkIsBuiltAndTag(sound)) {
return;
}
build_idproperties(sound->id.properties);
build_animdata(&sound->id);
build_parameters(&sound->id);
}
@ -2530,6 +2587,7 @@ void DepsgraphRelationBuilder::build_scene_sequencer(Scene *scene)
Sequence *seq;
bool has_audio_strips = false;
SEQ_BEGIN (scene->ed, seq) {
build_idproperties(seq->prop);
if (seq->sound != nullptr) {
build_sound(seq->sound);
ComponentKey sound_key(&seq->sound->id, NodeType::AUDIO);

View File

@ -54,6 +54,7 @@ struct FCurve;
struct FreestyleLineSet;
struct FreestyleLineStyle;
struct ID;
struct IDProperty;
struct Image;
struct Key;
struct LayerCollection;
@ -196,6 +197,8 @@ class DepsgraphRelationBuilder : public DepsgraphBuilder {
virtual void build_id(ID *id);
virtual void build_idproperties(IDProperty *id_property);
virtual void build_scene_render(Scene *scene, ViewLayer *view_layer);
virtual void build_scene_parameters(Scene *scene);
virtual void build_scene_compositor(Scene *scene);
@ -267,6 +270,7 @@ class DepsgraphRelationBuilder : public DepsgraphBuilder {
virtual void build_proxy_rig(Object *object);
virtual void build_shapekeys(Key *key);
virtual void build_armature(bArmature *armature);
virtual void build_armature_bones(ListBase *bones);
virtual void build_camera(Camera *camera);
virtual void build_light(Light *lamp);
virtual void build_nodetree(bNodeTree *ntree);

View File

@ -356,6 +356,7 @@ void DepsgraphRelationBuilder::build_rig(Object *object)
}
/* Links between operations for each bone. */
LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
build_idproperties(pchan->prop);
OperationKey bone_local_key(
&object->id, NodeType::BONE, pchan->name, OperationCode::BONE_LOCAL);
OperationKey bone_pose_key(
@ -464,6 +465,7 @@ void DepsgraphRelationBuilder::build_proxy_rig(Object *object)
OperationKey pose_done_key(&object->id, NodeType::EVAL_POSE, OperationCode::POSE_DONE);
OperationKey pose_cleanup_key(&object->id, NodeType::EVAL_POSE, OperationCode::POSE_CLEANUP);
LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
build_idproperties(pchan->prop);
OperationKey bone_local_key(
&object->id, NodeType::BONE, pchan->name, OperationCode::BONE_LOCAL);
OperationKey bone_ready_key(

View File

@ -52,6 +52,7 @@ void DepsgraphRelationBuilder::build_scene_parameters(Scene *scene)
if (built_map_.checkIsBuiltAndTag(scene, BuilderMap::TAG_PARAMETERS)) {
return;
}
build_idproperties(scene->id.properties);
build_parameters(&scene->id);
OperationKey parameters_eval_key(
&scene->id, NodeType::PARAMETERS, OperationCode::PARAMETERS_EXIT);

View File

@ -106,6 +106,18 @@ enum {
IDP_NUMTYPES = 10,
};
/** Used by some IDP utils, keep values in sync with type enum above. */
enum {
IDP_TYPE_FILTER_STRING = 1 << 0,
IDP_TYPE_FILTER_INT = 1 << 1,
IDP_TYPE_FILTER_FLOAT = 1 << 2,
IDP_TYPE_FILTER_ARRAY = 1 << 5,
IDP_TYPE_FILTER_GROUP = 1 << 6,
IDP_TYPE_FILTER_ID = 1 << 7,
IDP_TYPE_FILTER_DOUBLE = 1 << 8,
IDP_TYPE_FILTER_IDPARRAY = 1 << 9,
};
/*->subtype */
/* IDP_STRING */