Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-06-12 13:28:14 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-12 13:28:14 +0300
commit5508b572ea9bb2d3b758cae6898035005e8ebb2a (patch)
treeed65bfb15b368be1f4516fb6b73fa8a332d3444a /source/blender/editors
parent75bcb70c60172e61d2e564c88f78843d617eb919 (diff)
Cleanup: remove some G.main from ED's animsys.
The easy ones - there some much, much trickier to tackle there...
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/armature/armature_relations.c4
-rw-r--r--source/blender/editors/object/object_add.c10
-rw-r--r--source/blender/editors/object/object_relations.c22
-rw-r--r--source/blender/editors/space_node/node_group.c17
4 files changed, 28 insertions, 25 deletions
diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c
index 3506b8a8a60..acdda9980d9 100644
--- a/source/blender/editors/armature/armature_relations.c
+++ b/source/blender/editors/armature/armature_relations.c
@@ -374,7 +374,7 @@ int join_armature_exec(bContext *C, wmOperator *op)
}
else {
/* merge in data - we'll fix the drivers manually */
- BKE_animdata_merge_copy(&ob->id, &base->object->id, ADT_MERGECOPY_KEEP_DST, false);
+ BKE_animdata_merge_copy(bmain, &ob->id, &base->object->id, ADT_MERGECOPY_KEEP_DST, false);
}
}
@@ -385,7 +385,7 @@ int join_armature_exec(bContext *C, wmOperator *op)
}
else {
/* merge in data - we'll fix the drivers manually */
- BKE_animdata_merge_copy(&arm->id, &curarm->id, ADT_MERGECOPY_KEEP_DST, false);
+ BKE_animdata_merge_copy(bmain, &arm->id, &curarm->id, ADT_MERGECOPY_KEEP_DST, false);
}
}
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 519f5910624..039ea518b23 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -2036,7 +2036,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
/* duplicates using userflags */
if (dupflag & USER_DUP_ACT) {
- BKE_animdata_copy_id_action(&obn->id, true);
+ BKE_animdata_copy_id_action(bmain, &obn->id, true);
}
if (dupflag & USER_DUP_MAT) {
@@ -2050,7 +2050,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
id_us_min(id);
if (dupflag & USER_DUP_ACT) {
- BKE_animdata_copy_id_action(&obn->mat[a]->id, true);
+ BKE_animdata_copy_id_action(bmain, &obn->mat[a]->id, true);
}
}
}
@@ -2066,7 +2066,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
}
if (dupflag & USER_DUP_ACT) {
- BKE_animdata_copy_id_action(&psys->part->id, true);
+ BKE_animdata_copy_id_action(bmain, &psys->part->id, true);
}
id_us_min(id);
@@ -2196,9 +2196,9 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
if (dupflag & USER_DUP_ACT) {
bActuator *act;
- BKE_animdata_copy_id_action((ID *)obn->data, true);
+ BKE_animdata_copy_id_action(bmain, (ID *)obn->data, true);
if (key) {
- BKE_animdata_copy_id_action((ID *)key, true);
+ BKE_animdata_copy_id_action(bmain, (ID *)key, true);
}
/* Update the duplicated action in the action actuators */
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 03ded0f71e5..727b7d69723 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -1891,7 +1891,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, const int flag)
/* Needed to remap texcomesh below. */
me = ob->data = ID_NEW_SET(ob->data, BKE_mesh_copy(bmain, ob->data));
if (me->key) /* We do not need to set me->key->id.newid here... */
- BKE_animdata_copy_id_action((ID *)me->key, false);
+ BKE_animdata_copy_id_action(bmain, (ID *)me->key, false);
break;
case OB_MBALL:
ob->data = ID_NEW_SET(ob->data, BKE_mball_copy(bmain, ob->data));
@@ -1903,12 +1903,12 @@ static void single_obdata_users(Main *bmain, Scene *scene, const int flag)
ID_NEW_REMAP(cu->bevobj);
ID_NEW_REMAP(cu->taperobj);
if (cu->key) /* We do not need to set cu->key->id.newid here... */
- BKE_animdata_copy_id_action((ID *)cu->key, false);
+ BKE_animdata_copy_id_action(bmain, (ID *)cu->key, false);
break;
case OB_LATTICE:
ob->data = lat = ID_NEW_SET(ob->data, BKE_lattice_copy(bmain, ob->data));
if (lat->key) /* We do not need to set lat->key->id.newid here... */
- BKE_animdata_copy_id_action((ID *)lat->key, false);
+ BKE_animdata_copy_id_action(bmain, (ID *)lat->key, false);
break;
case OB_ARMATURE:
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -1929,7 +1929,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, const int flag)
* AnimData structure, which is not what we want.
* (sergey)
*/
- BKE_animdata_copy_id_action((ID *)ob->data, false);
+ BKE_animdata_copy_id_action(bmain, (ID *)ob->data, false);
id_us_min(id);
}
@@ -1943,7 +1943,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, const int flag)
}
}
-static void single_object_action_users(Scene *scene, const int flag)
+static void single_object_action_users(Main *bmain, Scene *scene, const int flag)
{
Object *ob;
Base *base;
@@ -1952,7 +1952,7 @@ static void single_object_action_users(Scene *scene, const int flag)
ob = base->object;
if (!ID_IS_LINKED(ob) && (flag == 0 || (base->flag & SELECT)) ) {
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
- BKE_animdata_copy_id_action(&ob->id, false);
+ BKE_animdata_copy_id_action(bmain, &ob->id, false);
}
}
}
@@ -1975,7 +1975,7 @@ static void single_mat_users(Main *bmain, Scene *scene, const int flag, const bo
if (ma->id.us > 1) {
man = BKE_material_copy(bmain, ma);
- BKE_animdata_copy_id_action(&man->id, false);
+ BKE_animdata_copy_id_action(bmain, &man->id, false);
man->id.us = 0;
assign_material(bmain, ob, man, a, BKE_MAT_ASSIGN_USERPREF);
@@ -1986,7 +1986,7 @@ static void single_mat_users(Main *bmain, Scene *scene, const int flag, const bo
if (tex->id.us > 1) {
id_us_min(&tex->id);
tex = BKE_texture_copy(bmain, tex);
- BKE_animdata_copy_id_action(&tex->id, false);
+ BKE_animdata_copy_id_action(bmain, &tex->id, false);
man->mtex[b]->tex = tex;
}
}
@@ -2013,7 +2013,7 @@ static void do_single_tex_user(Main *bmain, Tex **from)
}
else if (tex->id.us > 1) {
texn = ID_NEW_SET(tex, BKE_texture_copy(bmain, tex));
- BKE_animdata_copy_id_action(&texn->id, false);
+ BKE_animdata_copy_id_action(bmain, &texn->id, false);
tex->id.newid = (ID *)texn;
id_us_min(&tex->id);
*from = texn;
@@ -2100,7 +2100,7 @@ void ED_object_single_users(Main *bmain, Scene *scene, const bool full, const bo
if (full) {
single_obdata_users(bmain, scene, 0);
- single_object_action_users(scene, 0);
+ single_object_action_users(bmain, scene, 0);
single_mat_users_expand(bmain);
single_tex_users_expand(bmain);
}
@@ -2438,7 +2438,7 @@ static int make_single_user_exec(bContext *C, wmOperator *op)
single_mat_users(scene, flag, true);
#endif
if (RNA_boolean_get(op->ptr, "animation")) {
- single_object_action_users(scene, flag);
+ single_object_action_users(bmain, scene, flag);
}
BKE_main_id_clear_newpoins(bmain);
diff --git a/source/blender/editors/space_node/node_group.c b/source/blender/editors/space_node/node_group.c
index 5d326a0be38..926fff7a3b6 100644
--- a/source/blender/editors/space_node/node_group.c
+++ b/source/blender/editors/space_node/node_group.c
@@ -260,7 +260,7 @@ static int node_group_ungroup(Main *bmain, bNodeTree *ntree, bNode *gnode)
waction = wgroup->adt->action = BKE_action_copy(bmain, wgroup->adt->action);
/* now perform the moving */
- BKE_animdata_separate_by_basepath(&wgroup->id, &ntree->id, &anim_basepaths);
+ BKE_animdata_separate_by_basepath(bmain, &wgroup->id, &ntree->id, &anim_basepaths);
/* paths + their wrappers need to be freed */
for (ld = anim_basepaths.first; ld; ld = ldn) {
@@ -397,7 +397,8 @@ void NODE_OT_group_ungroup(wmOperatorType *ot)
/* ******************** Separate operator ********************** */
/* returns 1 if its OK */
-static int node_group_separate_selected(bNodeTree *ntree, bNodeTree *ngroup, float offx, float offy, int make_copy)
+static int node_group_separate_selected(
+ Main *bmain, bNodeTree *ntree, bNodeTree *ngroup, float offx, float offy, int make_copy)
{
bNodeLink *link, *link_next;
bNode *node, *node_next, *newnode;
@@ -492,7 +493,7 @@ static int node_group_separate_selected(bNodeTree *ntree, bNodeTree *ngroup, flo
LinkData *ld, *ldn = NULL;
/* now perform the moving */
- BKE_animdata_separate_by_basepath(&ngroup->id, &ntree->id, &anim_basepaths);
+ BKE_animdata_separate_by_basepath(bmain, &ngroup->id, &ntree->id, &anim_basepaths);
/* paths + their wrappers need to be freed */
for (ld = anim_basepaths.first; ld; ld = ldn) {
@@ -524,12 +525,13 @@ static const EnumPropertyItem node_group_separate_types[] = {
static int node_group_separate_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
SpaceNode *snode = CTX_wm_space_node(C);
bNodeTree *ngroup, *nparent;
int type = RNA_enum_get(op->ptr, "type");
float offx, offy;
- ED_preview_kill_jobs(CTX_wm_manager(C), CTX_data_main(C));
+ ED_preview_kill_jobs(CTX_wm_manager(C), bmain);
/* are we inside of a group? */
ngroup = snode->edittree;
@@ -543,13 +545,13 @@ static int node_group_separate_exec(bContext *C, wmOperator *op)
switch (type) {
case NODE_GS_COPY:
- if (!node_group_separate_selected(nparent, ngroup, offx, offy, 1)) {
+ if (!node_group_separate_selected(bmain, nparent, ngroup, offx, offy, 1)) {
BKE_report(op->reports, RPT_WARNING, "Cannot separate nodes");
return OPERATOR_CANCELLED;
}
break;
case NODE_GS_MOVE:
- if (!node_group_separate_selected(nparent, ngroup, offx, offy, 0)) {
+ if (!node_group_separate_selected(bmain, nparent, ngroup, offx, offy, 0)) {
BKE_report(op->reports, RPT_WARNING, "Cannot separate nodes");
return OPERATOR_CANCELLED;
}
@@ -681,6 +683,7 @@ static int node_get_selected_minmax(bNodeTree *ntree, bNode *gnode, float *min,
static void node_group_make_insert_selected(const bContext *C, bNodeTree *ntree, bNode *gnode)
{
+ Main *bmain = CTX_data_main(C);
bNodeTree *ngroup = (bNodeTree *)gnode->id;
bNodeLink *link, *linkn;
bNode *node, *nextn;
@@ -742,7 +745,7 @@ static void node_group_make_insert_selected(const bContext *C, bNodeTree *ntree,
if (ntree->adt) {
LinkData *ld, *ldn = NULL;
- BKE_animdata_separate_by_basepath(&ntree->id, &ngroup->id, &anim_basepaths);
+ BKE_animdata_separate_by_basepath(bmain, &ntree->id, &ngroup->id, &anim_basepaths);
/* paths + their wrappers need to be freed */
for (ld = anim_basepaths.first; ld; ld = ldn) {