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:
authorTon Roosendaal <ton@blender.org>2006-02-09 22:47:53 +0300
committerTon Roosendaal <ton@blender.org>2006-02-09 22:47:53 +0300
commit5e3d30c276f33e57f4a8e726ec6593210ade0217 (patch)
tree683a567427e456b37b6d507af69ff44d61ffba78
parentdaefa2afc6603a889f21047fedb0d3ecba5b1157 (diff)
Feature:
- Appending Images now re-assigns relative paths, to match with the file as currently being used Bugfix: - Memory error in creating preview render rects... gave no issues here, but i guess that's not saying anything! Hope its more stable now. :)
-rw-r--r--source/blender/blenkernel/intern/library.c14
-rw-r--r--source/blender/blenkernel/intern/node_composite.c4
-rw-r--r--source/blender/src/interface_icons.c2
-rw-r--r--source/blender/src/previewrender.c9
4 files changed, 20 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 4680a44d836..f8117140e8f 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -860,6 +860,16 @@ void clear_id_newpoins()
}
}
+/* only for library fixes */
+static void image_fix_relative_path(Image *ima)
+{
+ if(ima->id.lib==NULL) return;
+ if(strncmp(ima->name, "//", 2)==0) {
+ BLI_convertstringcode(ima->name, ima->id.lib->filename, 0);
+ BLI_makestringcode(G.sce, ima->name);
+ }
+}
+
/* if lib!=NULL, only all from lib local */
void all_local(Library *lib)
{
@@ -880,6 +890,10 @@ void all_local(Library *lib)
id->flag &= ~(LIB_EXTERN|LIB_INDIRECT|LIB_NEW);
if(id->lib) {
+ /* relative file patch */
+ if(GS(id->name)==ID_IM)
+ image_fix_relative_path((Image *)id);
+
id->lib= NULL;
new_id(lbarray[a], id, 0); /* new_id only does it with double names */
sort_alpha_id(lbarray[a], id);
diff --git a/source/blender/blenkernel/intern/node_composite.c b/source/blender/blenkernel/intern/node_composite.c
index ab1e21d9fb9..d9022671133 100644
--- a/source/blender/blenkernel/intern/node_composite.c
+++ b/source/blender/blenkernel/intern/node_composite.c
@@ -487,14 +487,10 @@ static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in,
/* stack order input sockets: col, alpha, z */
if(node->id && (node->flag & NODE_DO_OUTPUT)) { /* only one works on out */
- RenderData *rd= data;
Image *ima= (Image *)node->id;
CompBuf *cbuf, *inbuf= in[0]->data;
int rectx, recty;
- /* re-create output, derive size from scene */
-// rectx= (rd->size*rd->xsch)/100;
-// recty= (rd->size*rd->ysch)/100;
if(inbuf==NULL) {
rectx= 320; recty= 256;
}
diff --git a/source/blender/src/interface_icons.c b/source/blender/src/interface_icons.c
index 614ebcefbb8..fd9ea289f9e 100644
--- a/source/blender/src/interface_icons.c
+++ b/source/blender/src/interface_icons.c
@@ -685,7 +685,7 @@ static void icon_set_image(ID* id, DrawInfo* di)
di->rect = MEM_callocN(di->rw*di->rh*sizeof(unsigned int), "laprevrect");
ri.cury = 0;
- ri.rect = 0;
+ ri.rect = NULL;
ri.pr_rectx = di->rw;
ri.pr_recty = di->rh;
diff --git a/source/blender/src/previewrender.c b/source/blender/src/previewrender.c
index 4fbd42bacbe..bbe8cb94b20 100644
--- a/source/blender/src/previewrender.c
+++ b/source/blender/src/previewrender.c
@@ -110,7 +110,7 @@
#define PR_YMAX 195
-void set_previewrect(RenderInfo *ri, int win)
+static void set_previewrect(RenderInfo *ri, int win)
{
rctf viewplane;
@@ -349,9 +349,10 @@ void BIF_previewrender(struct ID *id, struct RenderInfo *ri, struct ScrArea *are
if(ri->cury>=ri->pr_recty) return;
- if(ri->rect==NULL) {
- ri->rect= MEM_callocN(sizeof(int)*ri->pr_rectx*ri->pr_recty, "butsrect");
- }
+ /* because preview render size differs all the time, we alloc here to make sure its right size */
+ if(ri->rect)
+ MEM_freeN(ri->rect);
+ ri->rect= MEM_callocN(sizeof(int)*ri->pr_rectx*ri->pr_recty, "BIF_previewrender");
/* check for return with a new event */
if(pr_method!=PR_ICON_RENDER && qtest()) {