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-11 17:02:46 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-11 17:02:46 +0300
commit204c167c72fe20448200dc0a1504a84762ffd926 (patch)
tree5f0adb8c5de4f8a0dd6406eabaa65fd36e3ff5ca /source/blender/blenkernel/intern
parent9e439197edcdae1ec9445524bd85bed85249f497 (diff)
parent78a8d3685bd3487eb0b5dd55793f94fe7235e377 (diff)
Merge branch 'master' into blender2.8
Conflicts: source/blender/blenkernel/BKE_mesh.h source/blender/blenkernel/intern/mesh_convert.c source/blender/editors/interface/interface_eyedropper_color.c source/blender/editors/object/object_add.c source/blender/editors/space_image/image_ops.c source/blender/makesrna/intern/rna_image.c source/blender/windowmanager/intern/wm_draw.c
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/bpath.c2
-rw-r--r--source/blender/blenkernel/intern/image.c62
-rw-r--r--source/blender/blenkernel/intern/mesh_convert.c14
-rw-r--r--source/blender/blenkernel/intern/node.c4
-rw-r--r--source/blender/blenkernel/intern/packedFile.c2
5 files changed, 42 insertions, 42 deletions
diff --git a/source/blender/blenkernel/intern/bpath.c b/source/blender/blenkernel/intern/bpath.c
index 82d9f9f8f69..7c9e57b039e 100644
--- a/source/blender/blenkernel/intern/bpath.c
+++ b/source/blender/blenkernel/intern/bpath.c
@@ -442,7 +442,7 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
/* image may have been painted onto (and not saved, T44543) */
!BKE_image_is_dirty(ima))
{
- BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
+ BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_RELOAD);
BKE_image_walk_all_users(bmain, ima, bpath_traverse_image_user_cb);
}
}
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 9a29a8a898b..c1ecabcfb5a 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -498,7 +498,7 @@ void BKE_image_make_local(Main *bmain, Image *ima, const bool lib_local)
BKE_id_make_local_generic(bmain, &ima->id, true, lib_local);
}
-void BKE_image_merge(Image *dest, Image *source)
+void BKE_image_merge(Main *bmain, Image *dest, Image *source)
{
/* sanity check */
if (dest && source && dest != source) {
@@ -516,7 +516,7 @@ void BKE_image_merge(Image *dest, Image *source)
}
BLI_spin_unlock(&image_spin);
- BKE_libblock_free(G.main, source);
+ BKE_libblock_free(bmain, source);
}
}
@@ -615,7 +615,7 @@ Image *BKE_image_load(Main *bmain, const char *filepath)
/* otherwise creates new. */
/* does not load ibuf itself */
/* pass on optional frame for #name images */
-Image *BKE_image_load_exists_ex(const char *filepath, bool *r_exists)
+Image *BKE_image_load_exists_ex(Main *bmain, const char *filepath, bool *r_exists)
{
Image *ima;
char str[FILE_MAX], strtest[FILE_MAX];
@@ -624,10 +624,10 @@ Image *BKE_image_load_exists_ex(const char *filepath, bool *r_exists)
BLI_path_abs(str, BKE_main_blendfile_path_from_global());
/* first search an identical filepath */
- for (ima = G.main->image.first; ima; ima = ima->id.next) {
+ for (ima = bmain->image.first; ima; ima = ima->id.next) {
if (ima->source != IMA_SRC_VIEWER && ima->source != IMA_SRC_GENERATED) {
STRNCPY(strtest, ima->name);
- BLI_path_abs(strtest, ID_BLEND_PATH(G.main, &ima->id));
+ BLI_path_abs(strtest, ID_BLEND_PATH(bmain, &ima->id));
if (BLI_path_cmp(strtest, str) == 0) {
if ((BKE_image_has_anim(ima) == false) ||
@@ -646,12 +646,12 @@ Image *BKE_image_load_exists_ex(const char *filepath, bool *r_exists)
if (r_exists)
*r_exists = false;
- return BKE_image_load(G.main, filepath);
+ return BKE_image_load(bmain, filepath);
}
-Image *BKE_image_load_exists(const char *filepath)
+Image *BKE_image_load_exists(Main *bmain, const char *filepath)
{
- return BKE_image_load_exists_ex(filepath, NULL);
+ return BKE_image_load_exists_ex(bmain, filepath, NULL);
}
static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type,
@@ -753,7 +753,7 @@ Image *BKE_image_add_generated(
/* Create an image image from ibuf. The refcount of ibuf is increased,
* caller should take care to drop its reference by calling
* IMB_freeImBuf if needed. */
-Image *BKE_image_add_from_imbuf(ImBuf *ibuf, const char *name)
+Image *BKE_image_add_from_imbuf(Main *bmain, ImBuf *ibuf, const char *name)
{
/* on save, type is changed to FILE in editsima.c */
Image *ima;
@@ -762,7 +762,7 @@ Image *BKE_image_add_from_imbuf(ImBuf *ibuf, const char *name)
name = BLI_path_basename(ibuf->name);
}
- ima = image_alloc(G.main, name, IMA_SRC_FILE, IMA_TYPE_IMAGE);
+ ima = image_alloc(bmain, name, IMA_SRC_FILE, IMA_TYPE_IMAGE);
if (ima) {
STRNCPY(ima->name, ibuf->name);
@@ -931,12 +931,12 @@ void BKE_image_tag_time(Image *ima)
}
#if 0
-static void tag_all_images_time()
+static void tag_all_images_time(Main *bmain)
{
Image *ima;
int ctime = PIL_check_seconds_timer_i();
- ima = G.main->image.first;
+ ima = bmain->image.first;
while (ima) {
if (ima->bindcode || ima->repbind || ima->ibufs.first) {
ima->lastused = ctime;
@@ -990,17 +990,17 @@ static uintptr_t image_mem_size(Image *image)
return size;
}
-void BKE_image_print_memlist(void)
+void BKE_image_print_memlist(Main *bmain)
{
Image *ima;
uintptr_t size, totsize = 0;
- for (ima = G.main->image.first; ima; ima = ima->id.next)
+ for (ima = bmain->image.first; ima; ima = ima->id.next)
totsize += image_mem_size(ima);
printf("\ntotal image memory len: %.3f MB\n", (double)totsize / (double)(1024 * 1024));
- for (ima = G.main->image.first; ima; ima = ima->id.next) {
+ for (ima = bmain->image.first; ima; ima = ima->id.next) {
size = image_mem_size(ima);
if (size)
@@ -1013,7 +1013,7 @@ static bool imagecache_check_dirty(ImBuf *ibuf, void *UNUSED(userkey), void *UNU
return (ibuf->userflags & IB_BITMAPDIRTY) == 0;
}
-void BKE_image_free_all_textures(void)
+void BKE_image_free_all_textures(Main *bmain)
{
#undef CHECK_FREED_SIZE
@@ -1023,14 +1023,14 @@ void BKE_image_free_all_textures(void)
uintptr_t tot_freed_size = 0;
#endif
- for (ima = G.main->image.first; ima; ima = ima->id.next)
+ for (ima = bmain->image.first; ima; ima = ima->id.next)
ima->id.tag &= ~LIB_TAG_DOIT;
- for (tex = G.main->tex.first; tex; tex = tex->id.next)
+ for (tex = bmain->tex.first; tex; tex = tex->id.next)
if (tex->ima)
tex->ima->id.tag |= LIB_TAG_DOIT;
- for (ima = G.main->image.first; ima; ima = ima->id.next) {
+ for (ima = bmain->image.first; ima; ima = ima->id.next) {
if (ima->cache && (ima->id.tag & LIB_TAG_DOIT)) {
#ifdef CHECK_FREED_SIZE
uintptr_t old_size = image_mem_size(ima);
@@ -1066,11 +1066,11 @@ void BKE_image_free_anim_ibufs(Image *ima, int except_frame)
BLI_spin_unlock(&image_spin);
}
-void BKE_image_all_free_anim_ibufs(int cfra)
+void BKE_image_all_free_anim_ibufs(Main *bmain, int cfra)
{
Image *ima;
- for (ima = G.main->image.first; ima; ima = ima->id.next)
+ for (ima = bmain->image.first; ima; ima = ima->id.next)
if (BKE_image_is_animated(ima))
BKE_image_free_anim_ibufs(ima, cfra);
}
@@ -2548,17 +2548,17 @@ struct anim *openanim(const char *name, int flags, int streamindex, char colorsp
/* forces existence of 1 Image for renderout or nodes, returns Image */
/* name is only for default, when making new one */
-Image *BKE_image_verify_viewer(int type, const char *name)
+Image *BKE_image_verify_viewer(Main *bmain, int type, const char *name)
{
Image *ima;
- for (ima = G.main->image.first; ima; ima = ima->id.next)
+ for (ima = bmain->image.first; ima; ima = ima->id.next)
if (ima->source == IMA_SRC_VIEWER)
if (ima->type == type)
break;
if (ima == NULL)
- ima = image_alloc(G.main, name, IMA_SRC_VIEWER, type);
+ ima = image_alloc(bmain, name, IMA_SRC_VIEWER, type);
/* happens on reload, imagewindow cannot be image user when hidden*/
if (ima->id.us == 0)
@@ -2709,7 +2709,7 @@ void BKE_image_init_imageuser(Image *ima, ImageUser *iuser)
image_init_imageuser(ima, iuser);
}
-void BKE_image_signal(Image *ima, ImageUser *iuser, int signal)
+void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal)
{
if (ima == NULL)
return;
@@ -2771,7 +2771,7 @@ void BKE_image_signal(Image *ima, ImageUser *iuser, int signal)
if (iuser)
iuser->ok = 1;
- BKE_image_walk_all_users(G.main, ima, image_tag_frame_recalc);
+ BKE_image_walk_all_users(bmain, ima, image_tag_frame_recalc);
break;
@@ -2783,13 +2783,13 @@ void BKE_image_signal(Image *ima, ImageUser *iuser, int signal)
if (totfiles != BLI_listbase_count_at_most(&ima->packedfiles, totfiles + 1)) {
/* in case there are new available files to be loaded */
image_free_packedfiles(ima);
- BKE_image_packfiles(NULL, ima, ID_BLEND_PATH(G.main, &ima->id));
+ BKE_image_packfiles(NULL, ima, ID_BLEND_PATH(bmain, &ima->id));
}
else {
ImagePackedFile *imapf;
for (imapf = ima->packedfiles.first; imapf; imapf = imapf->next) {
PackedFile *pf;
- pf = newPackedFile(NULL, imapf->filepath, ID_BLEND_PATH(G.main, &ima->id));
+ pf = newPackedFile(NULL, imapf->filepath, ID_BLEND_PATH(bmain, &ima->id));
if (pf) {
freePackedFile(imapf->packedfile);
imapf->packedfile = pf;
@@ -2841,7 +2841,7 @@ void BKE_image_signal(Image *ima, ImageUser *iuser, int signal)
* this also makes sure all scenes are accounted for. */
{
Scene *scene;
- for (scene = G.main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
if (scene->nodetree) {
nodeUpdateID(scene->nodetree, &ima->id);
}
@@ -3533,7 +3533,7 @@ static ImBuf *load_image_single(
BLI_addtail(&ima->packedfiles, imapf);
STRNCPY(imapf->filepath, filepath);
- imapf->packedfile = newPackedFile(NULL, filepath, ID_BLEND_PATH(G.main, &ima->id));
+ imapf->packedfile = newPackedFile(NULL, filepath, ID_BLEND_PATH_FROM_GLOBAL(&ima->id));
}
}
}
@@ -4371,7 +4371,7 @@ void BKE_image_user_file_path(ImageUser *iuser, Image *ima, char *filepath)
BLI_stringenc(filepath, head, tail, numlen, frame);
}
- BLI_path_abs(filepath, ID_BLEND_PATH(G.main, &ima->id));
+ BLI_path_abs(filepath, ID_BLEND_PATH_FROM_GLOBAL(&ima->id));
}
bool BKE_image_has_alpha(struct Image *image)
diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c
index acd0cf32b13..33b38d60183 100644
--- a/source/blender/blenkernel/intern/mesh_convert.c
+++ b/source/blender/blenkernel/intern/mesh_convert.c
@@ -544,9 +544,9 @@ Mesh *BKE_mesh_new_nomain_from_curve(Object *ob)
}
/* this may fail replacing ob->data, be sure to check ob->type */
-void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, const bool use_orco_uv, const char *obdata_name, bool temporary)
+void BKE_mesh_from_nurbs_displist(
+ Main *bmain, Object *ob, ListBase *dispbase, const bool use_orco_uv, const char *obdata_name, bool temporary)
{
- Main *bmain = G.main;
Object *ob1;
DerivedMesh *dm = ob->derivedFinal;
Mesh *me;
@@ -642,7 +642,7 @@ void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, const bool use
}
}
-void BKE_mesh_from_nurbs(Object *ob)
+void BKE_mesh_from_nurbs(Main *bmain, Object *ob)
{
Curve *cu = (Curve *) ob->data;
bool use_orco_uv = (cu->flag & CU_UV_ORCO) != 0;
@@ -652,7 +652,7 @@ void BKE_mesh_from_nurbs(Object *ob)
disp = ob->curve_cache->disp;
}
- BKE_mesh_from_nurbs_displist(ob, &disp, use_orco_uv, cu->id.name, false);
+ BKE_mesh_from_nurbs_displist(bmain, ob, &disp, use_orco_uv, cu->id.name, false);
}
typedef struct EdgeLink {
@@ -812,7 +812,7 @@ void BKE_mesh_to_curve_nurblist(const Mesh *me, ListBase *nurblist, const int ed
}
}
-void BKE_mesh_to_curve(Depsgraph *depsgraph, Scene *scene, Object *ob)
+void BKE_mesh_to_curve(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob)
{
/* make new mesh data from the original copy */
Mesh *me_eval = mesh_get_eval_final(depsgraph, scene, ob, CD_MASK_MESH);
@@ -823,7 +823,7 @@ void BKE_mesh_to_curve(Depsgraph *depsgraph, Scene *scene, Object *ob)
BKE_mesh_to_curve_nurblist(me_eval, &nurblist, 1);
if (nurblist.first) {
- Curve *cu = BKE_curve_add(G.main, ob->id.name + 2, OB_CURVE);
+ Curve *cu = BKE_curve_add(bmain, ob->id.name + 2, OB_CURVE);
cu->flag |= CU_3D;
cu->nurb = nurblist;
@@ -929,7 +929,7 @@ Mesh *BKE_mesh_new_from_object(
/* convert object type to mesh */
uv_from_orco = (tmpcu->flag & CU_UV_ORCO) != 0;
- BKE_mesh_from_nurbs_displist(tmpobj, &dispbase, uv_from_orco, tmpcu->id.name + 2, true);
+ BKE_mesh_from_nurbs_displist(bmain, tmpobj, &dispbase, uv_from_orco, tmpcu->id.name + 2, true);
tmpmesh = tmpobj->data;
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index bf25306028f..72a34d35715 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -2050,11 +2050,11 @@ void ntreeLocalSync(bNodeTree *localtree, bNodeTree *ntree)
/* merge local tree results back, and free local tree */
/* we have to assume the editor already changed completely */
-void ntreeLocalMerge(bNodeTree *localtree, bNodeTree *ntree)
+void ntreeLocalMerge(Main *bmain, bNodeTree *localtree, bNodeTree *ntree)
{
if (ntree && localtree) {
if (ntree->typeinfo->local_merge)
- ntree->typeinfo->local_merge(localtree, ntree);
+ ntree->typeinfo->local_merge(bmain, localtree, ntree);
ntreeFreeTree(localtree);
MEM_freeN(localtree);
diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c
index baa88f00985..07cd28da556 100644
--- a/source/blender/blenkernel/intern/packedFile.c
+++ b/source/blender/blenkernel/intern/packedFile.c
@@ -622,7 +622,7 @@ int unpackImage(Main *bmain, ReportList *reports, Image *ima, int how)
}
if (ret_value == RET_OK) {
- BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
+ BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_RELOAD);
}
return(ret_value);