Cleanup: name macros w/ matching BEGIN/END
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
/* for FOREACH_NODETREE */
|
||||
/* for FOREACH_NODETREE_BEGIN */
|
||||
#include "DNA_lamp_types.h"
|
||||
#include "DNA_material_types.h"
|
||||
#include "DNA_node_types.h"
|
||||
@@ -643,17 +643,17 @@ void BKE_node_tree_unlink_id(ID *id, struct bNodeTree *ntree);
|
||||
* Examples:
|
||||
*
|
||||
* \code{.c}
|
||||
* FOREACH_NODETREE(bmain, nodetree, id) {
|
||||
* FOREACH_NODETREE_BEGIN(bmain, nodetree, id) {
|
||||
* if (id == nodetree)
|
||||
* printf("This is a linkable node tree");
|
||||
* } FOREACH_NODETREE_END
|
||||
* } FOREACH_NODETREE_END;
|
||||
*
|
||||
* FOREACH_NODETREE(bmain, nodetree, id) {
|
||||
* FOREACH_NODETREE_BEGIN(bmain, nodetree, id) {
|
||||
* if (nodetree->idname == "ShaderNodeTree")
|
||||
* printf("This is a shader node tree);
|
||||
* if (GS(id) == ID_MA)
|
||||
* printf(" and it's owned by a material");
|
||||
* } FOREACH_NODETREE_END
|
||||
* } FOREACH_NODETREE_END;
|
||||
* \endcode
|
||||
*
|
||||
* \{
|
||||
@@ -674,7 +674,7 @@ void BKE_node_tree_iter_init(struct NodeTreeIterStore *ntreeiter, struct Main *b
|
||||
bool BKE_node_tree_iter_step(struct NodeTreeIterStore *ntreeiter,
|
||||
struct bNodeTree **r_nodetree, struct ID **r_id);
|
||||
|
||||
#define FOREACH_NODETREE(bmain, _nodetree, _id) \
|
||||
#define FOREACH_NODETREE_BEGIN(bmain, _nodetree, _id) \
|
||||
{ \
|
||||
struct NodeTreeIterStore _nstore; \
|
||||
bNodeTree *_nodetree; \
|
||||
@@ -687,7 +687,7 @@ bool BKE_node_tree_iter_step(struct NodeTreeIterStore *ntreeiter,
|
||||
#define FOREACH_NODETREE_END \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
} ((void)0)
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
@@ -2792,7 +2792,7 @@ static void dag_id_flush_update(Main *bmain, Scene *sce, ID *id)
|
||||
* could be with the current depsgraph design/
|
||||
*/
|
||||
if (idtype == ID_IM) {
|
||||
FOREACH_NODETREE(bmain, ntree, parent_id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, parent_id) {
|
||||
if (ntree->type == NTREE_SHADER) {
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -2802,7 +2802,7 @@ static void dag_id_flush_update(Main *bmain, Scene *sce, ID *id)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (idtype == ID_MSK) {
|
||||
|
||||
@@ -406,10 +406,10 @@ static void libblock_remap_data_postprocess_nodetree_update(Main *bmain, ID *new
|
||||
ntreeVerifyNodes(bmain, new_id);
|
||||
|
||||
/* Update node trees as necessary. */
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
/* make an update call for the tree */
|
||||
ntreeUpdateTree(bmain, ntree);
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -226,7 +226,7 @@ static void update_typeinfo(Main *bmain, const struct bContext *C, bNodeTreeType
|
||||
if (!bmain)
|
||||
return;
|
||||
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
bNode *node;
|
||||
bNodeSocket *sock;
|
||||
|
||||
@@ -257,7 +257,7 @@ static void update_typeinfo(Main *bmain, const struct bContext *C, bNodeTreeType
|
||||
if (socktype && STREQ(sock->idname, socktype->idname))
|
||||
node_socket_set_typeinfo(ntree, sock, unregister ? NULL : socktype);
|
||||
}
|
||||
FOREACH_NODETREE_END
|
||||
FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
/* Try to initialize all typeinfo in a node tree.
|
||||
@@ -2998,13 +2998,13 @@ static void ntree_validate_links(bNodeTree *ntree)
|
||||
|
||||
void ntreeVerifyNodes(struct Main *main, struct ID *id)
|
||||
{
|
||||
FOREACH_NODETREE(main, ntree, owner_id) {
|
||||
FOREACH_NODETREE_BEGIN(main, ntree, owner_id) {
|
||||
bNode *node;
|
||||
|
||||
for (node = ntree->nodes.first; node; node = node->next)
|
||||
if (node->typeinfo->verifyfunc)
|
||||
node->typeinfo->verifyfunc(ntree, node, id);
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
void ntreeUpdateTree(Main *bmain, bNodeTree *ntree)
|
||||
@@ -3770,7 +3770,7 @@ void free_nodesystem(void)
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* NodeTree Iterator Helpers (FOREACH_NODETREE) */
|
||||
/* NodeTree Iterator Helpers (FOREACH_NODETREE_BEGIN) */
|
||||
|
||||
void BKE_node_tree_iter_init(struct NodeTreeIterStore *ntreeiter, struct Main *bmain)
|
||||
{
|
||||
|
||||
@@ -1940,13 +1940,13 @@ void BKE_scene_update_tagged(EvaluationContext *eval_ctx, Main *bmain, Scene *sc
|
||||
if (!use_new_eval && DAG_id_type_tagged(bmain, ID_NT)) {
|
||||
float ctime = BKE_scene_frame_get(scene);
|
||||
|
||||
FOREACH_NODETREE(bmain, ntree, id)
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id)
|
||||
{
|
||||
AnimData *adt = BKE_animdata_from_id(&ntree->id);
|
||||
if (adt && (adt->recalc & ADT_RECALC_ANIM))
|
||||
BKE_animsys_evaluate_animdata(scene, &ntree->id, adt, ctime, 0);
|
||||
}
|
||||
FOREACH_NODETREE_END
|
||||
FOREACH_NODETREE_END;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2925,16 +2925,16 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open))
|
||||
#endif
|
||||
|
||||
/* set node->typeinfo pointers */
|
||||
FOREACH_NODETREE (main, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN (main, ntree, id) {
|
||||
ntreeSetTypes(NULL, ntree);
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
|
||||
/* verify static socket templates */
|
||||
FOREACH_NODETREE (main, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN (main, ntree, id) {
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next)
|
||||
node_verify_socket_templates(ntree, node);
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
|
||||
{
|
||||
bool has_old_groups = false;
|
||||
@@ -2950,7 +2950,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open))
|
||||
}
|
||||
|
||||
if (has_old_groups) {
|
||||
FOREACH_NODETREE (main, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN (main, ntree, id) {
|
||||
/* updates external links for all group nodes in a tree */
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -2960,7 +2960,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open))
|
||||
lib_node_do_versions_group_indices(node);
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
for (bNodeTree *ntree = main->nodetree.first; ntree; ntree = ntree->id.next) {
|
||||
@@ -2981,7 +2981,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open))
|
||||
* so have to clean up all of them ...
|
||||
*/
|
||||
|
||||
FOREACH_NODETREE(main, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(main, ntree, id) {
|
||||
if (ntree->flag & NTREE_DO_VERSIONS_CUSTOMNODES_GROUP) {
|
||||
bNode *input_node = NULL, *output_node = NULL;
|
||||
int num_inputs = 0, num_outputs = 0;
|
||||
@@ -3067,7 +3067,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open))
|
||||
ntree->flag &= ~(NTREE_DO_VERSIONS_CUSTOMNODES_GROUP | NTREE_DO_VERSIONS_CUSTOMNODES_GROUP_CREATE_INTERFACE);
|
||||
}
|
||||
}
|
||||
FOREACH_NODETREE_END
|
||||
FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
/* verify all group user nodes */
|
||||
@@ -3077,10 +3077,10 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open))
|
||||
|
||||
/* make update calls where necessary */
|
||||
{
|
||||
FOREACH_NODETREE(main, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(main, ntree, id) {
|
||||
/* make an update call for the tree */
|
||||
ntreeUpdateTree(main, ntree);
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2700,7 +2700,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
|
||||
if (bmain->versionfile < 259 || (bmain->versionfile == 259 && bmain->subversionfile < 2)) {
|
||||
{
|
||||
/* Convert default socket values from bNodeStack */
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
bNode *node;
|
||||
bNodeSocket *sock;
|
||||
|
||||
@@ -2717,8 +2717,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
|
||||
do_versions_socket_default_value_259(sock);
|
||||
|
||||
ntree->update |= NTREE_UPDATE;
|
||||
}
|
||||
FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -688,7 +688,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
|
||||
if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 2)) {
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_SHADER) {
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -702,7 +702,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 4)) {
|
||||
@@ -1330,7 +1330,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
|
||||
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 9)) {
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_SHADER) {
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -1344,7 +1344,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 10)) {
|
||||
@@ -1359,7 +1359,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_COMPOSIT) {
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -1371,7 +1371,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
{
|
||||
@@ -1429,7 +1429,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
|
||||
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 13)) {
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_COMPOSIT) {
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -1442,13 +1442,13 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 14)) {
|
||||
ParticleSettings *part;
|
||||
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_COMPOSIT) {
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -1461,7 +1461,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
|
||||
/* keep compatibility for dupliobject particle size */
|
||||
for (part = bmain->particle.first; part; part = part->id.next)
|
||||
@@ -1471,7 +1471,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
|
||||
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 17)) {
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_COMPOSIT) {
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -1487,7 +1487,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 18)) {
|
||||
@@ -1614,14 +1614,14 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
|
||||
if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 1)) {
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_SHADER) {
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next)
|
||||
if (node->type == SH_NODE_TEX_COORD)
|
||||
node->flag |= NODE_OPTIONS;
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 2)) {
|
||||
@@ -1723,7 +1723,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
/* Fix for bug #32982, internal_links list could get corrupted from r51630 onward.
|
||||
* Simply remove bad internal_links lists to avoid NULL pointers.
|
||||
*/
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
bNode *node;
|
||||
bNodeLink *link, *nextlink;
|
||||
|
||||
@@ -1735,7 +1735,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 6)) {
|
||||
@@ -1923,7 +1923,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_COMPOSIT) {
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -1937,7 +1937,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
else if (bmain->versionfile < 266 || (bmain->versionfile == 266 && bmain->subversionfile < 1)) {
|
||||
/* texture use alpha was removed for 2.66 but added back again for 2.66a,
|
||||
@@ -2002,7 +2002,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
|
||||
// add storage for compositor translate nodes when not existing
|
||||
if (MAIN_VERSION_OLDER(bmain, 265, 11)) {
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_COMPOSIT) {
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -2011,13 +2011,13 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (MAIN_VERSION_OLDER(bmain, 266, 2)) {
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
do_versions_nodetree_customnodes(ntree, ((ID *)ntree == id));
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (MAIN_VERSION_OLDER(bmain, 266, 2)) {
|
||||
@@ -2056,7 +2056,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
|
||||
/* Set flag for delayed do_versions in lib_verify_nodetree. It needs valid typeinfo pointers ... */
|
||||
{
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
/* XXX This should be kept without version check for now!
|
||||
* As long as USE_NODE_COMPAT_CUSTOMNODES is active, files will write links
|
||||
* to tree interface sockets for forward compatibility. These links need to be removed again
|
||||
@@ -2071,7 +2071,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
if (MAIN_VERSION_OLDER(bmain, 266, 2))
|
||||
ntree->flag |= NTREE_DO_VERSIONS_CUSTOMNODES_GROUP_CREATE_INTERFACE;
|
||||
}
|
||||
FOREACH_NODETREE_END
|
||||
FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (MAIN_VERSION_OLDER(bmain, 266, 3)) {
|
||||
@@ -2083,14 +2083,14 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
* so do this now to ensure old files don't break.
|
||||
*/
|
||||
bNode *node;
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (id == &ntree->id)
|
||||
continue; /* already fixed for node groups */
|
||||
|
||||
for (node = ntree->nodes.first; node; node = node->next)
|
||||
nodeUniqueName(ntree, node);
|
||||
}
|
||||
FOREACH_NODETREE_END
|
||||
FOREACH_NODETREE_END;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2399,7 +2399,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
|
||||
if (!MAIN_VERSION_ATLEAST(bmain, 269, 1)) {
|
||||
/* Removal of Cycles SSS Compatible falloff */
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_SHADER) {
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -2410,12 +2410,12 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (!MAIN_VERSION_ATLEAST(bmain, 269, 2)) {
|
||||
/* Initialize CDL settings for Color Balance nodes */
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_COMPOSIT) {
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -2437,7 +2437,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (!MAIN_VERSION_ATLEAST(bmain, 269, 3)) {
|
||||
@@ -2590,7 +2590,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
SEQ_END
|
||||
}
|
||||
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_COMPOSIT) {
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -2608,7 +2608,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingPlaneTrack", "float", "image_opacity")) {
|
||||
|
||||
@@ -379,7 +379,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
|
||||
/* nodes don't use fixed node->id any more, clean up */
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_COMPOSIT) {
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -388,7 +388,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
|
||||
{
|
||||
bScreen *screen;
|
||||
@@ -779,7 +779,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "NodePlaneTrackDeformData", "char", "flag")) {
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_COMPOSIT) {
|
||||
bNode *node;
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -792,7 +792,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
FOREACH_NODETREE_END
|
||||
FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "Camera", "GPUDOFSettings", "gpu_dof")) {
|
||||
@@ -879,7 +879,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
|
||||
if (!MAIN_VERSION_ATLEAST(bmain, 274, 2)) {
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
bNode *node;
|
||||
bNodeSocket *sock;
|
||||
|
||||
@@ -902,7 +902,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (!MAIN_VERSION_ATLEAST(bmain, 274, 4)) {
|
||||
@@ -1694,7 +1694,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
|
||||
/* Fix for T50736, Glare comp node using same var for two different things. */
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "NodeGlare", "char", "star_45")) {
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_COMPOSIT) {
|
||||
ntreeSetTypes(NULL, ntree);
|
||||
for (bNode *node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -1713,7 +1713,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "SurfaceDeformModifierData", "float", "mat[4][4]")) {
|
||||
@@ -1727,11 +1727,11 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
}
|
||||
}
|
||||
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_COMPOSIT) {
|
||||
do_versions_compositor_render_passes(ntree);
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (!MAIN_VERSION_ATLEAST(bmain, 279, 0)) {
|
||||
@@ -1852,7 +1852,7 @@ void do_versions_after_linking_270(Main *bmain)
|
||||
{
|
||||
/* To be added to next subversion bump! */
|
||||
if (!MAIN_VERSION_ATLEAST(bmain, 279, 0)) {
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_COMPOSIT) {
|
||||
ntreeSetTypes(NULL, ntree);
|
||||
for (bNode *node = ntree->nodes.first; node; node = node->next) {
|
||||
@@ -1861,7 +1861,7 @@ void do_versions_after_linking_270(Main *bmain)
|
||||
}
|
||||
}
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (!MAIN_VERSION_ATLEAST(bmain, 279, 2)) {
|
||||
|
||||
@@ -3113,7 +3113,7 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree)
|
||||
#ifdef USE_NODE_COMPAT_CUSTOMNODES
|
||||
static void customnodes_add_deprecated_data(Main *mainvar)
|
||||
{
|
||||
FOREACH_NODETREE(mainvar, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(mainvar, ntree, id) {
|
||||
bNodeLink *link, *last_link = ntree->links.last;
|
||||
|
||||
/* only do this for node groups */
|
||||
@@ -3160,13 +3160,12 @@ static void customnodes_add_deprecated_data(Main *mainvar)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
static void customnodes_free_deprecated_data(Main *mainvar)
|
||||
{
|
||||
FOREACH_NODETREE(mainvar, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(mainvar, ntree, id) {
|
||||
bNodeLink *link, *next_link;
|
||||
|
||||
for (link = ntree->links.first; link; link = next_link) {
|
||||
@@ -3175,8 +3174,7 @@ static void customnodes_free_deprecated_data(Main *mainvar)
|
||||
nodeRemLink(ntree, link);
|
||||
}
|
||||
}
|
||||
}
|
||||
FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2095,7 +2095,7 @@ void ED_object_single_users(Main *bmain, Scene *scene, const bool full, const bo
|
||||
}
|
||||
|
||||
/* Relink nodetrees' pointers that have been duplicated. */
|
||||
FOREACH_NODETREE(bmain, ntree, id)
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id)
|
||||
{
|
||||
/* This is a bit convoluted, we want to root ntree of copied IDs and only those,
|
||||
* so we first check that old ID has been copied and that ntree is root tree of old ID,
|
||||
@@ -2104,7 +2104,7 @@ void ED_object_single_users(Main *bmain, Scene *scene, const bool full, const bo
|
||||
ntree = ntreeFromID(id->newid);
|
||||
BKE_libblock_relink_to_newid(&ntree->id);
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
|
||||
/* Relink datablock pointer properties */
|
||||
{
|
||||
|
||||
@@ -167,11 +167,11 @@ void ED_node_tag_update_nodetree(Main *bmain, bNodeTree *ntree, bNode *node)
|
||||
|
||||
/* look through all datablocks, to support groups */
|
||||
if (do_tag_update) {
|
||||
FOREACH_NODETREE(bmain, tntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, tntree, id) {
|
||||
/* check if nodetree uses the group */
|
||||
if (ntreeHasTree(tntree, ntree))
|
||||
ED_node_tag_update_id(id);
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
if (ntree->type == NTREE_TEXTURE)
|
||||
|
||||
@@ -329,10 +329,10 @@ void snode_dag_update(bContext *C, SpaceNode *snode)
|
||||
|
||||
/* for groups, update all ID's using this */
|
||||
if (snode->edittree != snode->nodetree) {
|
||||
FOREACH_NODETREE(bmain, tntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, tntree, id) {
|
||||
if (ntreeHasTree(tntree, snode->edittree))
|
||||
DAG_id_tag_update(id, 0);
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
DAG_id_tag_update(snode->id, 0);
|
||||
@@ -2452,17 +2452,17 @@ static int node_shader_script_update_exec(bContext *C, wmOperator *op)
|
||||
|
||||
if (text) {
|
||||
/* clear flags for recursion check */
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_SHADER)
|
||||
ntree->done = false;
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
|
||||
FOREACH_NODETREE(bmain, ntree, id) {
|
||||
FOREACH_NODETREE_BEGIN(bmain, ntree, id) {
|
||||
if (ntree->type == NTREE_SHADER) {
|
||||
if (!ntree->done)
|
||||
found |= node_shader_script_update_text_recursive(engine, type, ntree, text);
|
||||
}
|
||||
} FOREACH_NODETREE_END
|
||||
} FOREACH_NODETREE_END;
|
||||
|
||||
if (!found)
|
||||
BKE_report(op->reports, RPT_INFO, "Text not used by any node, no update done");
|
||||
|
||||
Reference in New Issue
Block a user