diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-01-19 13:44:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-01-19 13:47:57 +0300 |
commit | 08fe885d06a011e2d1613be7e3a41b56a8b0e880 (patch) | |
tree | 921a6d9b2bc571aefa37094edfa1e278e9770319 | |
parent | e46c49ff3dd67c7d759b581b677b4ab90cee3c46 (diff) | |
parent | 889321e22b70006a550c923c0ace18e75732e106 (diff) |
Merge branch 'master' into blender2.8
23 files changed, 83 insertions, 66 deletions
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index 8295fafba56..ca6d92efa80 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -387,7 +387,7 @@ static void group_eval_layer_collections( ListBase *layer_collections, LayerCollection *parent_layer_collection) { - LINKLIST_FOREACH (LayerCollection *, layer_collection, layer_collections) { + BLI_LISTBASE_FOREACH (LayerCollection *, layer_collection, layer_collections) { /* Evaluate layer collection itself. */ BKE_layer_eval_layer_collection(eval_ctx, layer_collection, diff --git a/source/blender/blenlib/BLI_linklist.h b/source/blender/blenlib/BLI_linklist.h index 367f1bb9de5..7eec54e67e1 100644 --- a/source/blender/blenlib/BLI_linklist.h +++ b/source/blender/blenlib/BLI_linklist.h @@ -30,9 +30,6 @@ /** \file BLI_linklist.h * \ingroup bli - * \brief Routines for working with singly linked lists - * of 'links' - pointers to other data. - * */ #include "BLI_compiler_attrs.h" diff --git a/source/blender/blenlib/BLI_listbase.h b/source/blender/blenlib/BLI_listbase.h index 1e931e6f0d7..2a0f4e6f814 100644 --- a/source/blender/blenlib/BLI_listbase.h +++ b/source/blender/blenlib/BLI_listbase.h @@ -128,9 +128,9 @@ if ((lb)->last && (lb_init || (lb_init = (lb)->last))) { \ (lb_iter != lb_init)); \ } -#define LINKLIST_FOREACH(type, var, list) \ - for (type var = (type)((list)->first); \ - var != NULL; \ +#define BLI_LISTBASE_FOREACH(type, var, list) \ + for (type var = (type)((list)->first); \ + var != NULL; \ var = (type)(((Link*)(var))->next)) #ifdef __cplusplus diff --git a/source/blender/blenlib/intern/BLI_linklist.c b/source/blender/blenlib/intern/BLI_linklist.c index 1500e23d72e..051792f7f7c 100644 --- a/source/blender/blenlib/intern/BLI_linklist.c +++ b/source/blender/blenlib/intern/BLI_linklist.c @@ -28,6 +28,10 @@ /** \file blender/blenlib/intern/BLI_linklist.c * \ingroup bli + * + * Routines for working with single linked lists of 'links' - pointers to other data. + * + * For double linked lists see 'BLI_listbase.h'. */ #include <stdlib.h> diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c index d2cf0cf49a2..96c3972d802 100644 --- a/source/blender/blenlib/intern/listbase.c +++ b/source/blender/blenlib/intern/listbase.c @@ -29,7 +29,9 @@ /** \file blender/blenlib/intern/listbase.c * \ingroup bli * - * Manipulations on ListBase structs + * Manipulations on double-linked list (#ListBase structs). + * + * For single linked lists see 'BLI_linklist.h' */ #include <string.h> diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 3502ca69414..ddae761cea0 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -429,7 +429,7 @@ void DepsgraphNodeBuilder::build_group(Group *group) } group_id->tag |= LIB_TAG_DOIT; /* Build group objects. */ - LINKLIST_FOREACH(Base *, base, &group->view_layer->object_bases) { + BLI_LISTBASE_FOREACH (Base *, base, &group->view_layer->object_bases) { build_object(NULL, base->object, DEG_ID_LINKED_INDIRECTLY); } /* Operation to evaluate the whole view layer. @@ -699,7 +699,7 @@ void DepsgraphNodeBuilder::build_animdata(ID *id) } /* drivers */ - LINKLIST_FOREACH (FCurve *, fcu, &adt->drivers) { + BLI_LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) { /* create driver */ build_driver(id, fcu); } @@ -817,7 +817,7 @@ void DepsgraphNodeBuilder::build_rigidbody(Scene *scene) /* objects - simulation participants */ if (rbw->group) { - LINKLIST_FOREACH (Base *, base, &rbw->group->view_layer->object_bases) { + BLI_LISTBASE_FOREACH (Base *, base, &rbw->group->view_layer->object_bases) { Object *object = base->object; if (!object || (object->type != OB_MESH)) @@ -870,7 +870,7 @@ void DepsgraphNodeBuilder::build_particles(Object *object) DEG_OPCODE_PARTICLE_SYSTEM_EVAL_INIT); /* particle systems */ - LINKLIST_FOREACH (ParticleSystem *, psys, &object->particlesystem) { + BLI_LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) { ParticleSettings *part = psys->part; /* Build particle settings operations. @@ -986,7 +986,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Object *object) // TODO: "Done" operation /* Cloth modifier. */ - LINKLIST_FOREACH (ModifierData *, md, &object->modifiers) { + BLI_LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) { if (md->type == eModifierType_Cloth) { build_cloth(object); } @@ -1231,7 +1231,7 @@ void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree) ntree), DEG_OPCODE_MATERIAL_UPDATE); /* nodetree's nodes... */ - LINKLIST_FOREACH (bNode *, bnode, &ntree->nodes) { + BLI_LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) { ID *id = bnode->id; if (id == NULL) { continue; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_layer_collection.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_layer_collection.cc index 79316e47022..137a79e7276 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_layer_collection.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_layer_collection.cc @@ -94,7 +94,7 @@ void DepsgraphNodeBuilder::build_layer_collections(ID *owner_id, ListBase *layer_collections, LayerCollectionState *state) { - LINKLIST_FOREACH (LayerCollection *, layer_collection, layer_collections) { + BLI_LISTBASE_FOREACH (LayerCollection *, layer_collection, layer_collections) { build_layer_collection(owner_id, layer_collection, state); } } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc index 531ea55cf5c..2fc42efa440 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc @@ -247,7 +247,7 @@ void DepsgraphNodeBuilder::build_rig(Object *object) op_node->set_as_exit(); /* bones */ - LINKLIST_FOREACH (bPoseChannel *, pchan, &object_cow->pose->chanbase) { + BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object_cow->pose->chanbase) { /* Node for bone evaluation. */ op_node = add_operation_node(&object->id, DEG_NODE_TYPE_BONE, pchan->name, NULL, DEG_OPCODE_BONE_LOCAL); @@ -293,7 +293,7 @@ void DepsgraphNodeBuilder::build_rig(Object *object) * as in ik-tree building * - Animated chain-lengths are a problem. */ - LINKLIST_FOREACH (bConstraint *, con, &pchan->constraints) { + BLI_LISTBASE_FOREACH (bConstraint *, con, &pchan->constraints) { switch (con->type) { case CONSTRAINT_TYPE_KINEMATIC: build_ik_pose(object, pchan, con); @@ -347,7 +347,7 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *object) object_cow), DEG_OPCODE_POSE_INIT); op_node->set_as_entry(); - LINKLIST_FOREACH (bPoseChannel *, pchan, &object_cow->pose->chanbase) { + BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object_cow->pose->chanbase) { /* Local bone transform. */ op_node = add_operation_node(&object->id, DEG_NODE_TYPE_BONE, diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc index 49772c4f852..4ca19f4e14f 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc @@ -84,7 +84,7 @@ void DepsgraphNodeBuilder::build_view_layer( * otherwise remapping will not replace objects with their CoW versions * for CoW bases. */ - LINKLIST_FOREACH(Base *, base, &view_layer->object_bases) { + BLI_LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) { Object *object = base->object; add_id_node(&object->id, false); } @@ -145,15 +145,15 @@ void DepsgraphNodeBuilder::build_view_layer( build_gpencil(scene->gpd); } /* Cache file. */ - LINKLIST_FOREACH (CacheFile *, cachefile, &bmain_->cachefiles) { + BLI_LISTBASE_FOREACH (CacheFile *, cachefile, &bmain_->cachefiles) { build_cachefile(cachefile); } /* Masks. */ - LINKLIST_FOREACH (Mask *, mask, &bmain_->mask) { + BLI_LISTBASE_FOREACH (Mask *, mask, &bmain_->mask) { build_mask(mask); } /* Movie clips. */ - LINKLIST_FOREACH (MovieClip *, clip, &bmain_->movieclip) { + BLI_LISTBASE_FOREACH (MovieClip *, clip, &bmain_->movieclip) { build_movieclip(clip); } /* Collections. */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 077bdd94f56..3cd239bff28 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -194,7 +194,7 @@ static bool particle_system_depends_on_time(ParticleSystem *psys) static bool object_particles_depends_on_time(Object *object) { - LINKLIST_FOREACH (ParticleSystem *, psys, &object->particlesystem) { + BLI_LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) { if (particle_system_depends_on_time(psys)) { return true; } @@ -347,7 +347,7 @@ void DepsgraphRelationBuilder::add_forcefield_relations( { ListBase *effectors = pdInitEffectors(NULL, scene, object, psys, eff, false); if (effectors != NULL) { - LINKLIST_FOREACH(EffectorCache *, eff, effectors) { + BLI_LISTBASE_FOREACH (EffectorCache *, eff, effectors) { if (eff->ob != object) { ComponentKey eff_key(&eff->ob->id, DEG_NODE_TYPE_TRANSFORM); add_relation(eff_key, key, name); @@ -428,13 +428,13 @@ void DepsgraphRelationBuilder::build_group(Object *object, Group *group) DEG_OPCODE_TRANSFORM_LOCAL); if (!group_done) { - LINKLIST_FOREACH(Base *, base, &group->view_layer->object_bases) { + BLI_LISTBASE_FOREACH (Base *, base, &group->view_layer->object_bases) { build_object(NULL, base->object); } group_id->tag |= LIB_TAG_DOIT; } - LINKLIST_FOREACH (Base *, base, &group->view_layer->object_bases) { + BLI_LISTBASE_FOREACH (Base *, base, &group->view_layer->object_bases) { ComponentKey dupli_transform_key(&base->object->id, DEG_NODE_TYPE_TRANSFORM); add_relation(dupli_transform_key, object_local_transform_key, "Dupligroup"); } @@ -776,7 +776,7 @@ void DepsgraphRelationBuilder::build_constraints(ID *id, else if (cti->get_constraint_targets) { ListBase targets = {NULL, NULL}; cti->get_constraint_targets(con, &targets); - LINKLIST_FOREACH (bConstraintTarget *, ct, &targets) { + BLI_LISTBASE_FOREACH (bConstraintTarget *, ct, &targets) { if (ct->tar == NULL) { continue; } @@ -961,7 +961,7 @@ void DepsgraphRelationBuilder::build_animdata_curves_targets(ID *id) /* Iterate over all curves and build relations. */ PointerRNA id_ptr; RNA_id_pointer_create(id, &id_ptr); - LINKLIST_FOREACH(FCurve *, fcu, &adt->action->curves) { + BLI_LISTBASE_FOREACH (FCurve *, fcu, &adt->action->curves) { PointerRNA ptr; PropertyRNA *prop; int index; @@ -999,7 +999,7 @@ void DepsgraphRelationBuilder::build_animdata_drivers(ID *id) return; } ComponentKey adt_key(id, DEG_NODE_TYPE_ANIMATION); - LINKLIST_FOREACH (FCurve *, fcu, &adt->drivers) { + BLI_LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) { OperationKey driver_key(id, DEG_NODE_TYPE_PARAMETERS, DEG_OPCODE_DRIVER, @@ -1023,7 +1023,7 @@ void DepsgraphRelationBuilder::build_animdata_drivers(ID *id) */ if (fcu->array_index > 0) { FCurve *fcu_prev = NULL; - LINKLIST_FOREACH (FCurve *, fcu_candidate, &adt->drivers) { + BLI_LISTBASE_FOREACH (FCurve *, fcu_candidate, &adt->drivers) { /* Writing to different RNA paths is */ const char *rna_path = fcu->rna_path ? fcu->rna_path : ""; if (!STREQ(fcu_candidate->rna_path, rna_path)) { @@ -1153,7 +1153,7 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu) const char *rna_path = fcu->rna_path ? fcu->rna_path : ""; const RNAPathKey self_key(id, rna_path); - LINKLIST_FOREACH (DriverVar *, dvar, &driver->variables) { + BLI_LISTBASE_FOREACH (DriverVar *, dvar, &driver->variables) { /* Only used targets. */ DRIVER_TARGETS_USED_LOOPER(dvar) { @@ -1268,7 +1268,7 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) /* objects - simulation participants */ if (rbw->group) { - LINKLIST_FOREACH (Base *, base, &rbw->group->view_layer->object_bases) { + BLI_LISTBASE_FOREACH (Base *, base, &rbw->group->view_layer->object_bases) { Object *object = base->object; if (object == NULL || object->type != OB_MESH) { continue; @@ -1322,7 +1322,7 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) /* constraints */ if (rbw->constraints) { - LINKLIST_FOREACH (Base *, base, &rbw->constraints->view_layer->object_bases) { + BLI_LISTBASE_FOREACH (Base *, base, &rbw->constraints->view_layer->object_bases) { Object *object = base->object; if (object == NULL || !object->rigidbody_constraint) { continue; @@ -1358,7 +1358,7 @@ void DepsgraphRelationBuilder::build_particles(Object *object) DEG_OPCODE_PARTICLE_SYSTEM_EVAL_INIT); /* particle systems */ - LINKLIST_FOREACH (ParticleSystem *, psys, &object->particlesystem) { + BLI_LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) { ParticleSettings *part = psys->part; /* Build particle settings relations. @@ -1435,8 +1435,8 @@ void DepsgraphRelationBuilder::build_particles(Object *object) /* boids */ if (part->boids) { - LINKLIST_FOREACH (BoidState *, state, &part->boids->states) { - LINKLIST_FOREACH (BoidRule *, rule, &state->rules) { + BLI_LISTBASE_FOREACH (BoidState *, state, &part->boids->states) { + BLI_LISTBASE_FOREACH (BoidRule *, rule, &state->rules) { Object *ruleob = NULL; if (rule->type == eBoidRuleType_Avoid) ruleob = ((BoidRuleGoalAvoid *)rule)->ob; @@ -1583,7 +1583,7 @@ void DepsgraphRelationBuilder::build_obdata_geom(Object *object) /* Modifiers */ if (object->modifiers.first != NULL) { - LINKLIST_FOREACH (ModifierData *, md, &object->modifiers) { + BLI_LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) { const ModifierTypeInfo *mti = modifierType_getInfo((ModifierType)md->type); if (mti->updateDepsgraph) { DepsNodeHandle handle = create_node_handle(obdata_ubereval_key); @@ -1804,7 +1804,7 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree) build_animdata(ntree_id); ComponentKey shading_key(ntree_id, DEG_NODE_TYPE_SHADING); /* nodetree's nodes... */ - LINKLIST_FOREACH (bNode *, bnode, &ntree->nodes) { + BLI_LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) { ID *id = bnode->id; if (id == NULL) { continue; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_layer_collection.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_layer_collection.cc index 452bd7b19e7..9cf82b5fb47 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_layer_collection.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_layer_collection.cc @@ -92,7 +92,7 @@ void DepsgraphRelationBuilder::build_layer_collections( ListBase *layer_collections, LayerCollectionState *state) { - LINKLIST_FOREACH (LayerCollection *, layer_collection, layer_collections) { + BLI_LISTBASE_FOREACH (LayerCollection *, layer_collection, layer_collections) { /* Recurs into the layer. */ build_layer_collection(owner_id, layer_collection, state); } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc index 2aff1ca33c7..ad812a4b505 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc @@ -341,8 +341,8 @@ void DepsgraphRelationBuilder::build_rig(Object *object) */ RootPChanMap root_map; bool pose_depends_on_local_transform = false; - LINKLIST_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { - LINKLIST_FOREACH (bConstraint *, con, &pchan->constraints) { + BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { + BLI_LISTBASE_FOREACH (bConstraint *, con, &pchan->constraints) { switch (con->type) { case CONSTRAINT_TYPE_KINEMATIC: build_ik_pose(object, pchan, con, &root_map); @@ -382,7 +382,7 @@ void DepsgraphRelationBuilder::build_rig(Object *object) } /* links between operations for each bone */ - LINKLIST_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { + BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { OperationKey bone_local_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL); OperationKey bone_pose_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_POSE_PARENT); OperationKey bone_ready_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY); @@ -445,7 +445,7 @@ void DepsgraphRelationBuilder::build_proxy_rig(Object *object) { OperationKey pose_init_key(&object->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT); OperationKey pose_done_key(&object->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE); - LINKLIST_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { + BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { OperationKey bone_local_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL); OperationKey bone_ready_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY); OperationKey bone_done_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc index 9b3e46df69a..cfb98fe2f79 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc @@ -78,7 +78,7 @@ void DepsgraphRelationBuilder::build_view_layer(Scene *scene, ViewLayer *view_la * passed to the evaluation functions. During relations builder we only * do NULL-pointer check of the base, so it's fine to pass original one. */ - LINKLIST_FOREACH(Base *, base, &view_layer->object_bases) { + BLI_LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) { build_object(base, base->object); } if (scene->camera != NULL) { @@ -105,11 +105,11 @@ void DepsgraphRelationBuilder::build_view_layer(Scene *scene, ViewLayer *view_la build_gpencil(scene->gpd); } /* Masks. */ - LINKLIST_FOREACH (Mask *, mask, &bmain_->mask) { + BLI_LISTBASE_FOREACH (Mask *, mask, &bmain_->mask) { build_mask(mask); } /* Movie clips. */ - LINKLIST_FOREACH (MovieClip *, clip, &bmain_->movieclip) { + BLI_LISTBASE_FOREACH (MovieClip *, clip, &bmain_->movieclip) { build_movieclip(clip); } /* Collections. */ diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index 128dfd0e556..3a78c9050f7 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -167,7 +167,7 @@ static bool pointer_to_component_node_criteria( return true; } else if (object->pose != NULL) { - LINKLIST_FOREACH(bPoseChannel *, pchan, &object->pose->chanbase) { + BLI_LISTBASE_FOREACH(bPoseChannel *, pchan, &object->pose->chanbase) { if (BLI_findindex(&pchan->constraints, con) != -1) { /* bone transforms */ *type = DEG_NODE_TYPE_BONE; diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index 5b07630240d..902cbe039cd 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -294,8 +294,8 @@ void DEG_graph_relations_update(Depsgraph *graph, void DEG_relations_tag_update(Main *bmain) { DEG_DEBUG_PRINTF("%s: Tagging relations for update.\n", __func__); - LINKLIST_FOREACH(Scene *, scene, &bmain->scene) { - LINKLIST_FOREACH(ViewLayer *, view_layer, &scene->view_layers) { + BLI_LISTBASE_FOREACH (Scene *, scene, &bmain->scene) { + BLI_LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) { Depsgraph *depsgraph = (Depsgraph *)BKE_scene_get_depsgraph(scene, view_layer, diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index f364ac52b38..e7c13083343 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -349,8 +349,8 @@ void deg_graph_id_tag_update(Main *bmain, Depsgraph *graph, ID *id, int flag) void deg_id_tag_update(Main *bmain, ID *id, int flag) { deg_graph_id_tag_update(bmain, NULL, id, flag); - LINKLIST_FOREACH(Scene *, scene, &bmain->scene) { - LINKLIST_FOREACH(ViewLayer *, view_layer, &scene->view_layers) { + BLI_LISTBASE_FOREACH (Scene *, scene, &bmain->scene) { + BLI_LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) { Depsgraph *depsgraph = (Depsgraph *)BKE_scene_get_depsgraph(scene, view_layer, @@ -455,8 +455,8 @@ void DEG_graph_on_visible_update(Main *bmain, Depsgraph *depsgraph) void DEG_on_visible_update(Main *bmain, const bool UNUSED(do_time)) { - LINKLIST_FOREACH(Scene *, scene, &bmain->scene) { - LINKLIST_FOREACH(ViewLayer *, view_layer, &scene->view_layers) { + BLI_LISTBASE_FOREACH (Scene *, scene, &bmain->scene) { + BLI_LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) { Depsgraph *depsgraph = (Depsgraph *)BKE_scene_get_depsgraph(scene, view_layer, diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c index f7ede251873..eebe69b7a19 100644 --- a/source/blender/editors/render/render_update.c +++ b/source/blender/editors/render/render_update.c @@ -202,7 +202,7 @@ void ED_render_engine_changed(Main *bmain) update_ctx.bmain = bmain; for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { update_ctx.scene = scene; - LINKLIST_FOREACH(ViewLayer *, view_layer, &scene->view_layers) { + BLI_LISTBASE_FOREACH(ViewLayer *, view_layer, &scene->view_layers) { /* TDODO(sergey): Iterate over depsgraphs instead? */ update_ctx.depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true); update_ctx.view_layer = view_layer; diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c index 3726d0f6294..1ffe62fbc00 100644 --- a/source/blender/editors/space_outliner/outliner_collections.c +++ b/source/blender/editors/space_outliner/outliner_collections.c @@ -483,7 +483,7 @@ static int collection_objects_add_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN (C, struct Object *, ob, selected_objects) { - LINKLIST_FOREACH(LinkData *, link, &data.scene_collections_array) { + BLI_LISTBASE_FOREACH (LinkData *, link, &data.scene_collections_array) { SceneCollection *scene_collection = link->data; BKE_collection_object_add( &scene->id, @@ -538,7 +538,7 @@ static int collection_objects_remove_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN (C, struct Object *, ob, selected_objects) { - LINKLIST_FOREACH(LinkData *, link, &data.scene_collections_array) { + BLI_LISTBASE_FOREACH (LinkData *, link, &data.scene_collections_array) { SceneCollection *scene_collection = link->data; BKE_collection_object_remove( bmain, diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 3fd044afe48..c8f38e5282b 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -449,7 +449,7 @@ static void outliner_object_reorder( TREESTORE(insert_element)->flag |= TSE_SELECTED; outliner_tree_traverse(soops, &soops->tree, 0, TSE_SELECTED, outliner_find_selected_objects, &data); - LINKLIST_FOREACH(LinkData *, link, &data.objects_selected_array) { + BLI_LISTBASE_FOREACH (LinkData *, link, &data.objects_selected_array) { TreeElement *ten_selected = (TreeElement *)link->data; /* Find parent scene-collection of object. */ if (ten_selected->parent) { diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index b78657ff11f..9f7b438e338 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1969,7 +1969,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) } // If modal, save settings back in scene if not set as operator argument - if (t->flag & T_MODAL) { + if ((t->flag & T_MODAL) || (op->flag & OP_IS_REPEAT)) { /* save settings if not set in operator */ /* skip saving proportional edit if it was not actually used */ @@ -1989,10 +1989,9 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) ts->proportional_objects = (proportional != PROP_EDIT_OFF); } - if ((prop = RNA_struct_find_property(op->ptr, "proportional_size")) && - !RNA_property_is_set(op->ptr, prop)) - { - ts->proportional_size = t->prop_size; + if ((prop = RNA_struct_find_property(op->ptr, "proportional_size"))) { + ts->proportional_size = + RNA_property_is_set(op->ptr, prop) ? RNA_property_float_get(op->ptr, prop) : t->prop_size; } if ((prop = RNA_struct_find_property(op->ptr, "proportional_edit_falloff")) && diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index f794c5cbaff..9ec34ac3823 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -405,13 +405,15 @@ enum { /* low level flag so exec() operators can tell if they were invoked, use with care. * typically this shouldn't make any difference, but it rare cases its needed (see smooth-view) */ OP_IS_INVOKE = (1 << 0), + /* So we can detect if an operators exec() call is activated from an interactive repeat. */ + OP_IS_REPEAT = (1 << 1), /* When the cursor is grabbed */ - OP_IS_MODAL_GRAB_CURSOR = (1 << 1), + OP_IS_MODAL_GRAB_CURSOR = (1 << 2), /* allow modal operators to have the region under the cursor for their context * (the regiontype is maintained to prevent errors) */ - OP_IS_MODAL_CURSOR_REGION = (1 << 2), + OP_IS_MODAL_CURSOR_REGION = (1 << 3), }; #endif /* __DNA_WINDOWMANAGER_TYPES_H__ */ diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index eda91c5156d..bcb5bb524f0 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -1586,6 +1586,11 @@ static void rna_def_operator_options_runtime(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Invoke", "True when invoked (even if only the execute callbacks available)"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); + prop = RNA_def_property(srna, "is_repeat", PROP_BOOLEAN, PROP_BOOLEAN); + RNA_def_property_boolean_sdna(prop, NULL, "flag", OP_IS_REPEAT); + RNA_def_property_ui_text(prop, "Repeat", "True when run from the redo panel"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + prop = RNA_def_property(srna, "use_cursor_region", PROP_BOOLEAN, PROP_BOOLEAN); RNA_def_property_boolean_sdna(prop, NULL, "flag", OP_IS_MODAL_CURSOR_REGION); RNA_def_property_ui_text(prop, "Focus Region", "Enable to use the region under the cursor for modal execution"); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 154e120cde8..6e559ef7157 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -867,14 +867,22 @@ static int wm_operator_exec(bContext *C, wmOperator *op, const bool repeat, cons return retval; if (op->type->exec) { - if (op->type->flag & OPTYPE_UNDO) + if (op->type->flag & OPTYPE_UNDO) { wm->op_undo_depth++; + } + if (repeat) { + op->flag |= OP_IS_REPEAT; + } retval = op->type->exec(C, op); OPERATOR_RETVAL_CHECK(retval); + if (repeat) { + op->flag &= ~OP_IS_REPEAT; + } - if (op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm) + if (op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm) { wm->op_undo_depth--; + } } /* XXX Disabled the repeat check to address part 2 of #31840. |