Merge again...

This commit is contained in:
Bastien Montagne 2017-08-07 20:48:22 +02:00
parent 41830cc432
commit e673c9dc93
8 changed files with 25 additions and 16 deletions

View File

@ -38,7 +38,8 @@ struct LightProbe;
void BKE_lightprobe_init(struct LightProbe *probe);
void *BKE_lightprobe_add(struct Main *bmain, const char *name);
struct LightProbe *BKE_lightprobe_copy(struct Main *bmain, struct LightProbe *probe);
void BKE_lightprobe_copy_data(struct Main *bmain, struct LightProbe *probe_dst, const struct LightProbe *probe_src, const int flag);
struct LightProbe *BKE_lightprobe_copy(struct Main *bmain, const struct LightProbe *probe);
void BKE_lightprobe_make_local(struct Main *bmain, struct LightProbe *probe, const bool lib_local);
void BKE_lightprobe_free(struct LightProbe *probe);

View File

@ -1333,7 +1333,7 @@ void BKE_libblock_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int fla
id_copy_animdata(bmain, new_id, (flag & LIB_ID_COPY_ACTIONS) != 0 && (flag & LIB_ID_CREATE_NO_MAIN) == 0);
if ((flag & LIB_ID_CREATE_NO_DEG_TAG) == 0 && (flag & LIB_ID_CREATE_NO_MAIN) == 0) {
DAG_id_type_tag(bmain, GS(new_id->name));
DEG_id_type_tag(bmain, GS(new_id->name));
}
*r_newid = new_id;

View File

@ -913,7 +913,7 @@ void BKE_id_free_ex(Main *bmain, void *idv, int flag, const bool use_flag_from_i
const short type = GS(id->name);
if (bmain && (flag & LIB_ID_FREE_NO_DEG_TAG) == 0) {
DAG_id_type_tag(bmain, type);
DEG_id_type_tag(bmain, type);
}
#ifdef WITH_PYTHON

View File

@ -59,22 +59,32 @@ void *BKE_lightprobe_add(Main *bmain, const char *name)
{
LightProbe *probe;
probe = BKE_libblock_alloc(bmain, ID_LP, name);
probe = BKE_libblock_alloc(bmain, ID_LP, name, 0);
BKE_lightprobe_init(probe);
return probe;
}
LightProbe *BKE_lightprobe_copy(Main *bmain, LightProbe *probe)
/**
* Only copy internal data of LightProbe ID from source to already allocated/initialized destination.
* You probably nerver want to use that directly, use id_copy or BKE_id_copy_ex for typical needs.
*
* WARNING! This function will not handle ID user count!
*
* \param flag Copying options (see BKE_library.h's LIB_ID_COPY_... flags for more).
*/
void BKE_lightprobe_copy_data(
Main *UNUSED(bmain), LightProbe *UNUSED(probe_dst), const LightProbe *UNUSED(probe_src), const int UNUSED(flag))
{
LightProbe *probe_new;
/* Nothing to do here. */
}
probe_new = BKE_libblock_copy(bmain, &probe->id);
BKE_id_copy_ensure_local(bmain, &probe->id, &probe_new->id);
return probe_new;
LightProbe *BKE_lightprobe_copy(Main *bmain, const LightProbe *probe)
{
LightProbe *probe_copy;
BKE_id_copy_ex(bmain, &probe->id, (ID **)&probe_copy, 0, false);
return probe_copy;
}
void BKE_lightprobe_make_local(Main *bmain, LightProbe *probe, const bool lib_local)

View File

@ -1186,7 +1186,7 @@ void BKE_object_copy_data(Main *UNUSED(bmain), Object *ob_dst, const Object *ob_
BKE_pose_rebuild(ob_dst, ob_dst->data);
}
defgroup_copy_list(&ob_dst->defbase, &ob_src->defbase);
BKE_object_facemap_copy_list(&obn->fmaps, &ob->fmaps);
BKE_object_facemap_copy_list(&ob_dst->fmaps, &ob_src->fmaps);
BKE_constraints_copy_ex(&ob_dst->constraints, &ob_src->constraints, flag_subdata, true);
ob_dst->mode = OB_MODE_OBJECT;

View File

@ -228,9 +228,7 @@ void BKE_scene_copy_data(Main *bmain, Scene *sce_dst, const Scene *sce_src, cons
sce_dst->ed = NULL;
sce_dst->theDag = NULL;
sce_dst->depsgraph = NULL;
sce_dst->obedit = NULL;
sce_dst->stats = NULL;
sce_dst->fps_info = NULL;
BLI_duplicatelist(&(sce_dst->base), &(sce_src->base));

View File

@ -137,7 +137,7 @@ static bool UNUSED_FUNCTION(workspaces_is_screen_used)(
WorkSpace *BKE_workspace_add(Main *bmain, const char *name)
{
WorkSpace *new_workspace = BKE_libblock_alloc(bmain, ID_WS, name);
WorkSpace *new_workspace = BKE_libblock_alloc(bmain, ID_WS, name, 0);
return new_workspace;
}

View File

@ -918,7 +918,7 @@ void deg_free_copy_on_write_datablock(ID *id_cow)
return;
}
}
BKE_libblock_free_datablock(id_cow);
BKE_libblock_free_datablock(id_cow, 0);
BKE_libblock_free_data(id_cow, false);
/* Signal datablock as not being expanded. */
id_cow->name[0] = '\0';