[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36737] trunk/blender/source/blender: - check paths are not empty strings before making blend file paths absolute or relative .

2011-05-17 Thread Campbell Barton
Revision: 36737
  
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36737
Author:   campbellbarton
Date: 2011-05-18 06:48:52 + (Wed, 18 May 2011)
Log Message:
---
- check paths are not empty strings before making blend file paths absolute or 
relative.
- when saving blend file with 'Remap Relative' enabled, don't try make paths 
absolute if the internal filename is invalid.
- use case insensitive path comparison on windows when checking if path 
remapping is needed & for comparing next/prev dirs in the file selector.

Modified Paths:
--
trunk/blender/source/blender/blenlib/intern/bpath.c
trunk/blender/source/blender/blenloader/intern/writefile.c
trunk/blender/source/blender/editors/space_file/filelist.c

Modified: trunk/blender/source/blender/blenlib/intern/bpath.c
===
--- trunk/blender/source/blender/blenlib/intern/bpath.c 2011-05-18 06:27:32 UTC 
(rev 36736)
+++ trunk/blender/source/blender/blenlib/intern/bpath.c 2011-05-18 06:48:52 UTC 
(rev 36737)
@@ -699,7 +699,12 @@

/* be sure there is low chance of the path being too short */
char filepath_relative[(FILE_MAXDIR * 2) + FILE_MAXFILE];
-   
+
+   if(basedir[0] == '\0') {
+   printf("makeFilesRelative: basedir='', this is a bug\n");
+   return;
+   }
+
BLI_bpathIterator_init(&bpi, bmain, basedir, 0);
while (!BLI_bpathIterator_isDone(bpi)) {
BLI_bpathIterator_getPath(bpi, filepath);
@@ -751,7 +756,10 @@
/* be sure there is low chance of the path being too short */
char filepath_absolute[(FILE_MAXDIR * 2) + FILE_MAXFILE];
 
-   BLI_assert(basedir[0] != '\0');
+   if(basedir[0] == '\0') {
+   printf("makeFilesAbsolute: basedir='', this is a bug\n");
+   return;
+   }
 
BLI_bpathIterator_init(&bpi, bmain, basedir, 0);
while (!BLI_bpathIterator_isDone(bpi)) {

Modified: trunk/blender/source/blender/blenloader/intern/writefile.c
===
--- trunk/blender/source/blender/blenloader/intern/writefile.c  2011-05-18 
06:27:32 UTC (rev 36736)
+++ trunk/blender/source/blender/blenloader/intern/writefile.c  2011-05-18 
06:48:52 UTC (rev 36737)
@@ -2547,10 +2547,18 @@
BLI_cleanup_dir(mainvar->name, dir1);
BLI_cleanup_dir(mainvar->name, dir2);
 
-   if(strcmp(dir1, dir2)==0)
+   if(BLI_path_cmp(dir1, dir2)==0) {
write_flags &= ~G_FILE_RELATIVE_REMAP;
-   else
-   makeFilesAbsolute(mainvar, G.main->name, NULL);
+   }
+   else {
+   if(G.relbase_valid) {
+   /* blend may not have been saved before. Tn 
this case
+* we should not have any relative paths, but 
if there
+* is somehow, an invalid or empty G.main->name 
it will
+* print an error, dont try make the absolute 
in this case. */
+   makeFilesAbsolute(mainvar, G.main->name, NULL);
+   }
+   }
}
 
BLI_make_file_string(G.main->name, userfilename, 
BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_STARTUP_FILE);

Modified: trunk/blender/source/blender/editors/space_file/filelist.c
===
--- trunk/blender/source/blender/editors/space_file/filelist.c  2011-05-18 
06:27:32 UTC (rev 36736)
+++ trunk/blender/source/blender/editors/space_file/filelist.c  2011-05-18 
06:48:52 UTC (rev 36737)
@@ -433,7 +433,7 @@
 
// check if already exists
if(previous_folder && previous_folder->foldername){
-   if(! strcmp(previous_folder->foldername, dir)){
+   if(BLI_path_cmp(previous_folder->foldername, dir)==0){
return;
}
}

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36736] trunk/blender/source: cleanup only

2011-05-17 Thread Campbell Barton
Revision: 36736
  
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36736
Author:   campbellbarton
Date: 2011-05-18 06:27:32 + (Wed, 18 May 2011)
Log Message:
---
cleanup only
- rename 'name', 'dir' --> 'filepath' where these actually represent a file 
path to avoid confusion.
- bugfix for possible (but unlikely) uninitialized string.
- remove commented script append function, now we have a python api for this.

Modified Paths:
--
trunk/blender/source/blender/blenkernel/intern/blender.c
trunk/blender/source/blender/blenloader/BLO_readfile.h
trunk/blender/source/blender/blenloader/BLO_writefile.h
trunk/blender/source/blender/blenloader/intern/readblenentry.c
trunk/blender/source/blender/blenloader/intern/readfile.c
trunk/blender/source/blender/blenloader/intern/readfile.h
trunk/blender/source/blender/blenloader/intern/writefile.c
trunk/blender/source/blender/windowmanager/WM_api.h
trunk/blender/source/blender/windowmanager/intern/wm_files.c
trunk/blender/source/blender/windowmanager/wm.h
trunk/blender/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp

Modified: trunk/blender/source/blender/blenkernel/intern/blender.c
===
--- trunk/blender/source/blender/blenkernel/intern/blender.c2011-05-18 
05:21:44 UTC (rev 36735)
+++ trunk/blender/source/blender/blenkernel/intern/blender.c2011-05-18 
06:27:32 UTC (rev 36736)
@@ -191,7 +191,7 @@
 /* note, this is called on Undo so any slow conversion functions here
  * should be avoided or check (mode!='u') */
 
-static void setup_app_data(bContext *C, BlendFileData *bfd, const char 
*filename) 
+static void setup_app_data(bContext *C, BlendFileData *bfd, const char 
*filepath)
 {
bScreen *curscreen= NULL;
Scene *curscene= NULL;
@@ -295,18 +295,18 @@
if(recover && bfd->filename[0] && G.relbase_valid) {
/* in case of autosave or quit.blend, use original filename 
instead
 * use relbase_valid to make sure the file is saved, else we 
get  in the filename */
-   filename= bfd->filename;
+   filepath= bfd->filename;
}
 #if 0
else if (!G.relbase_valid) {
/* otherwise, use an empty string as filename, rather than 
 */
-   filename="";
+   filepath="";
}
 #endif

/* these are the same at times, should never copy to the same location 
*/
-   if(G.main->name != filename)
-   BLI_strncpy(G.main->name, filename, FILE_MAX);
+   if(G.main->name != filepath)
+   BLI_strncpy(G.main->name, filepath, FILE_MAX);
 
/* baseflags, groups, make depsgraph, etc */
set_scene_bg(G.main, CTX_data_scene(C));
@@ -353,15 +353,15 @@
BLI_freelistN(&U.addons);
 }
 
-int BKE_read_file(bContext *C, const char *dir, ReportList *reports) 
+int BKE_read_file(bContext *C, const char *filepath, ReportList *reports)
 {
BlendFileData *bfd;
int retval= BKE_READ_FILE_OK;
 
-   if(strstr(dir, BLENDER_STARTUP_FILE)==NULL) /* dont print user-pref 
loading */
-   printf("read blend: %s\n", dir);
+   if(strstr(filepath, BLENDER_STARTUP_FILE)==NULL) /* dont print 
user-pref loading */
+   printf("read blend: %s\n", filepath);
 
-   bfd= BLO_read_from_file(dir, reports);
+   bfd= BLO_read_from_file(filepath, reports);
if (bfd) {
if(bfd->user) retval= BKE_READ_FILE_OK_USERPREFS;

@@ -372,10 +372,10 @@
retval= BKE_READ_FILE_FAIL;
}
else
-   setup_app_data(C, bfd, dir); // frees BFD
+   setup_app_data(C, bfd, filepath); // frees BFD
} 
else
-   BKE_reports_prependf(reports, "Loading %s failed: ", dir);
+   BKE_reports_prependf(reports, "Loading %s failed: ", filepath);

return (bfd?retval:BKE_READ_FILE_FAIL);
 }
@@ -521,19 +521,19 @@
/* disk save version */
if(UNDO_DISK) {
static int counter= 0;
-   char tstr[FILE_MAXDIR+FILE_MAXFILE];
+   char filepath[FILE_MAXDIR+FILE_MAXFILE];
char numstr[32];

-   /* calculate current filename */
+   /* calculate current filepath */
counter++;
counter= counter % U.undosteps; 

BLI_snprintf(numstr, sizeof(numstr), "%d.blend", counter);
-   BLI_make_file_string("/", tstr, btempdir, numstr);
+   BLI_make_file_string("/", filepath, btempdir, numstr);

-   success= BLO_write_file(CTX_data_main(C), tstr, G.fileflags, 
NULL, NULL);
+   success= BLO_write_file(CTX_data_main(C), filepath, 
G.fileflags, NULL, NULL);

-  

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36735] trunk/blender/source/blender: fix [#27405] Append objects with linked materials they dissapears after save

2011-05-17 Thread Campbell Barton
Revision: 36735
  
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36735
Author:   campbellbarton
Date: 2011-05-18 05:21:44 + (Wed, 18 May 2011)
Log Message:
---
fix [#27405] Append objects with linked materials they dissapears after save
when linking in files to an unsaved blend file, make all library paths absolute.

Modified Paths:
--
trunk/blender/source/blender/blenlib/intern/bpath.c
trunk/blender/source/blender/blenloader/intern/readfile.c

Modified: trunk/blender/source/blender/blenlib/intern/bpath.c
===
--- trunk/blender/source/blender/blenlib/intern/bpath.c 2011-05-17 18:37:44 UTC 
(rev 36734)
+++ trunk/blender/source/blender/blenlib/intern/bpath.c 2011-05-18 05:21:44 UTC 
(rev 36735)
@@ -750,7 +750,9 @@

/* be sure there is low chance of the path being too short */
char filepath_absolute[(FILE_MAXDIR * 2) + FILE_MAXFILE];
-   
+
+   BLI_assert(basedir[0] != '\0');
+
BLI_bpathIterator_init(&bpi, bmain, basedir, 0);
while (!BLI_bpathIterator_isDone(bpi)) {
BLI_bpathIterator_getPath(bpi, filepath);

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===
--- trunk/blender/source/blender/blenloader/intern/readfile.c   2011-05-17 
18:37:44 UTC (rev 36734)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c   2011-05-18 
05:21:44 UTC (rev 36735)
@@ -5511,22 +5511,33 @@
}
 }
 
-/* Always call this once you havbe loaded new library data to set the relative 
paths correctly in relation to the blend file */
+/* Always call this once you have loaded new library data to set the relative 
paths correctly in relation to the blend file */
 static void fix_relpaths_library(const char *basepath, Main *main)
 {
Library *lib;
/* BLO_read_from_memory uses a blank filename */
-   if (basepath==NULL || basepath[0] == '\0')
-   return;
-   
-   for(lib= main->library.first; lib; lib= lib->id.next) {
-   /* Libraries store both relative and abs paths, recreate 
relative paths,
-* relative to the blend file since indirectly linked libs will 
be relative to their direct linked library */
-   if (strncmp(lib->name, "//", 2)==0) { /* if this is relative to 
begin with? */
-   strncpy(lib->name, lib->filepath, sizeof(lib->name));
-   BLI_path_rel(lib->name, basepath);
+   if (basepath==NULL || basepath[0] == '\0') {
+   for(lib= main->library.first; lib; lib= lib->id.next) {
+   /* when loading a linked lib into a file which has not 
been saved,
+* there is nothing we can be relative to, so instead 
we need to make
+* it absolute. This can happen when appending an 
object with a relative
+* link into an unsaved blend file. See [#27405].
+* The remap relative option will make it relative 
again on save - campbell */
+   if (strncmp(lib->name, "//", 2)==0) {
+   strncpy(lib->name, lib->filepath, 
sizeof(lib->name));
+   }
}
}
+   else {
+   for(lib= main->library.first; lib; lib= lib->id.next) {
+   /* Libraries store both relative and abs paths, 
recreate relative paths,
+* relative to the blend file since indirectly linked 
libs will be relative to their direct linked library */
+   if (strncmp(lib->name, "//", 2)==0) { /* if this is 
relative to begin with? */
+   strncpy(lib->name, lib->filepath, 
sizeof(lib->name));
+   BLI_path_rel(lib->name, basepath);
+   }
+   }
+   }
 }
 
 /* ** READ SOUND *** */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36734] trunk/blender/source/blender/ blenkernel/intern/sequencer.c: This fixes:

2011-05-17 Thread Peter Schlaile
Revision: 36734
  
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36734
Author:   schlaile
Date: 2011-05-17 18:37:44 + (Tue, 17 May 2011)
Log Message:
---
This fixes:
[#27422] Strobe setting does not work with effect strip
[#27421] Some Settings of Adjustment Layers are not Functional.

Modified Paths:
--
trunk/blender/source/blender/blenkernel/intern/sequencer.c

Modified: trunk/blender/source/blender/blenkernel/intern/sequencer.c
===
--- trunk/blender/source/blender/blenkernel/intern/sequencer.c  2011-05-17 
16:21:06 UTC (rev 36733)
+++ trunk/blender/source/blender/blenkernel/intern/sequencer.c  2011-05-17 
18:37:44 UTC (rev 36734)
@@ -977,16 +977,22 @@
int sta = seq->start;
int end = seq->start+seq->len-1;
 
-   if(seq->len == 0) return -1;
+   if (seq->type & SEQ_EFFECT) {
+   end = seq->enddisp;
+   } 
 
+   if(end < sta) {
+   return -1;
+   }
+
if(seq->flag&SEQ_REVERSE_FRAMES) {  
/*reverse frame in this sequence */
-   if(cfra <= sta) nr= seq->len-1;
+   if(cfra <= sta) nr= end - sta;
else if(cfra >= end) nr= 0;
else nr= end - cfra;
} else {
if(cfra <= sta) nr= 0;
-   else if(cfra >= end) nr= seq->len-1;
+   else if(cfra >= end) nr= end - sta;
else nr= cfra - sta;
}

@@ -2036,8 +2042,9 @@
break;
}
case SEQ_EFFECT:
-   {   
-   ibuf = seq_render_effect_strip_impl(context, seq, cfra);
+   {
+   ibuf = seq_render_effect_strip_impl(
+   context, seq, seq->start + nr);
break;
}
case SEQ_IMAGE:

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36733] branches/cycles/source/blender: Render API: code cleanup.

2011-05-17 Thread Brecht Van Lommel
Revision: 36733
  
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36733
Author:   blendix
Date: 2011-05-17 16:21:06 + (Tue, 17 May 2011)
Log Message:
---
Render API: code cleanup.

Modified Paths:
--
branches/cycles/source/blender/editors/render/render_preview.c
branches/cycles/source/blender/editors/space_view3d/view3d_draw.c
branches/cycles/source/blender/render/extern/include/RE_engine.h
branches/cycles/source/blender/render/intern/pipeline/engine.c

Modified: branches/cycles/source/blender/editors/render/render_preview.c
===
--- branches/cycles/source/blender/editors/render/render_preview.c  
2011-05-17 16:20:07 UTC (rev 36732)
+++ branches/cycles/source/blender/editors/render/render_preview.c  
2011-05-17 16:21:06 UTC (rev 36733)
@@ -86,6 +86,7 @@
 
 #include "PIL_time.h"
 
+#include "RE_engine.h"
 #include "RE_pipeline.h"
 
 
@@ -99,15 +100,6 @@
 
 #include "render_intern.h"
 
-#define PR_XMIN10
-#define PR_YMIN5
-#define PR_XMAX200
-#define PR_YMAX195
-
-/* XXX */
-static int qtest(void) {return 0;}
-/* XXX */
-
 ImBuf* get_brush_icon(Brush *brush)
 {
static const int flags = IB_rect|IB_multilayer|IB_metadata;
@@ -174,123 +166,6 @@

 } ShaderPreview;
 
-
-
-/* unused now */
-void draw_tex_crop(Tex *tex)
-{
-   rcti rct;
-   int ret= 0;
-   
-   if(tex==NULL) return;
-   
-   if(tex->type==TEX_IMAGE) {
-   if(tex->cropxmin==0.0f) ret++;
-   if(tex->cropymin==0.0f) ret++;
-   if(tex->cropxmax==1.0f) ret++;
-   if(tex->cropymax==1.0f) ret++;
-   if(ret==4) return;
-   
-   rct.xmin= PR_XMIN+2+tex->cropxmin*(PR_XMAX-PR_XMIN-4);
-   rct.xmax= PR_XMIN+2+tex->cropxmax*(PR_XMAX-PR_XMIN-4);
-   rct.ymin= PR_YMIN+2+tex->cropymin*(PR_YMAX-PR_YMIN-4);
-   rct.ymax= PR_YMIN+2+tex->cropymax*(PR_YMAX-PR_YMIN-4);
-
-   glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); 
-
-   glColor3ub(0, 0, 0);
-   glRecti(rct.xmin+1,  rct.ymin-1,  rct.xmax+1,  rct.ymax-1); 
-
-   glColor3ub(255, 255, 255);
-   glRecti(rct.xmin,  rct.ymin,  rct.xmax,  rct.ymax);
-
-   glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);  
-   }
-   
-}
-
-/* temporal abuse; if id_code is -1 it only does texture solve! */
-void BIF_preview_changed(short UNUSED(id_code))
-{
-#if 0  
-   ScrArea *sa;
-   
-   for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
-   if(sa->spacetype==SPACE_BUTS) {
-   SpaceButs *sbuts= sa->spacedata.first;
-   if(sbuts->mainb==CONTEXT_SHADING) {
-   int tab= sbuts->tab[CONTEXT_SHADING];
-   if(tab==TAB_SHADING_MAT && (id_code==ID_MA || 
id_code==ID_TE)) {
-   if (sbuts->ri) sbuts->ri->curtile= 0;
-   addafterqueue(sa->win, RENDERPREVIEW, 
1);
-   }
-   else if(tab==TAB_SHADING_TEX && (id_code==ID_TE 
|| id_code==-1)) {
-   if (sbuts->ri) sbuts->ri->curtile= 0;
-   addafterqueue(sa->win, RENDERPREVIEW, 
1);
-   }
-   else if(tab==TAB_SHADING_LAMP && 
(id_code==ID_LA || id_code==ID_TE)) {
-   if (sbuts->ri) sbuts->ri->curtile= 0;
-   addafterqueue(sa->win, RENDERPREVIEW, 
1);
-   }
-   else if(tab==TAB_SHADING_WORLD && 
(id_code==ID_WO || id_code==ID_TE)) {
-   if (sbuts->ri) sbuts->ri->curtile= 0;
-   addafterqueue(sa->win, RENDERPREVIEW, 
1);
-   }
-   }
-   else if (sbuts->ri) 
-   sbuts->ri->curtile= 0;  /* ensure changes 
always result in re-render when context is restored */
-   }
-   else if(sa->spacetype==SPACE_NODE) {
-   SpaceNode *snode= sa->spacedata.first;
-   if(snode->treetype==NTREE_SHADER && (id_code==ID_MA || 
id_code==ID_TE)) {
-   snode_tag_dirty(snode);
-   }
-   }
-   else if(sa->spacetype==SPACE_VIEW3D) {
-   View3D *vd= sa->spacedata.first;
-   /* if is has a renderinfo, we consider that reason for 
signalling */
-   if (vd->ri) {
-   vd->ri->curtile= 0;
-  

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36732] trunk/blender/source/gameengine/ Converter/BL_BlenderDataConversion.cpp: fix for r36723 - putting extern Material inside code like that result

2011-05-17 Thread Nathan Letwory
Revision: 36732
  
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36732
Author:   jesterking
Date: 2011-05-17 16:20:07 + (Tue, 17 May 2011)
Log Message:
---
fix for r36723 - putting extern Material inside code like that results in wrong 
linking. Move to proper place so that linking goes right.

Revision Links:
--

http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36723

Modified Paths:
--
trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp

Modified: trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp
===
--- trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp  
2011-05-17 15:39:40 UTC (rev 36731)
+++ trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp  
2011-05-17 16:20:07 UTC (rev 36732)
@@ -143,9 +143,11 @@
 #include "BKE_customdata.h"
 #include "BKE_cdderivedmesh.h"
 #include "BKE_DerivedMesh.h"
+#include "BKE_material.h" /* give_current_material */
+
+extern Material defmaterial;   /* material.c */
 }
 
-#include "BKE_material.h" /* give_current_material */
 /* end of blender include block */
 
 #include "KX_BlenderInputDevice.h"
@@ -839,7 +841,6 @@
 
/* ckeck for texface since texface _only_ is used as a fallback 
*/
if(ma == NULL && tface == NULL) {
-   extern Material defmaterial;/* material.c */
ma= &defmaterial;
}
 

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36731] branches/cycles/source/blender: Render API: RenderEngine. update_progress function to set progress percentage.

2011-05-17 Thread Brecht Van Lommel
Revision: 36731
  
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36731
Author:   blendix
Date: 2011-05-17 15:39:40 + (Tue, 17 May 2011)
Log Message:
---
Render API: RenderEngine.update_progress function to set progress percentage.

Modified Paths:
--
branches/cycles/source/blender/makesrna/intern/rna_render.c
branches/cycles/source/blender/render/extern/include/RE_engine.h
branches/cycles/source/blender/render/intern/pipeline/engine.c

Modified: branches/cycles/source/blender/makesrna/intern/rna_render.c
===
--- branches/cycles/source/blender/makesrna/intern/rna_render.c 2011-05-17 
15:20:12 UTC (rev 36730)
+++ branches/cycles/source/blender/makesrna/intern/rna_render.c 2011-05-17 
15:39:40 UTC (rev 36731)
@@ -374,6 +374,10 @@
prop= RNA_def_string(func, "info", "", 0, "Info", "");
RNA_def_property_flag(prop, PROP_REQUIRED);
 
+   func= RNA_def_function(srna, "update_progress", 
"RE_engine_update_progress");
+   prop= RNA_def_float(func, "progress", 0, 0.0f, 1.0f, "", "Percentage of 
render that's done.", 0.0f, 1.0f);
+   RNA_def_property_flag(prop, PROP_REQUIRED);
+
func= RNA_def_function(srna, "report", "RE_engine_report");
prop= RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", "");
RNA_def_property_flag(prop, PROP_REQUIRED);

Modified: branches/cycles/source/blender/render/extern/include/RE_engine.h
===
--- branches/cycles/source/blender/render/extern/include/RE_engine.h
2011-05-17 15:20:12 UTC (rev 36730)
+++ branches/cycles/source/blender/render/extern/include/RE_engine.h
2011-05-17 15:39:40 UTC (rev 36731)
@@ -99,6 +99,7 @@
 
 LIBEXPORT int RE_engine_test_break(RenderEngine *engine);
 LIBEXPORT void RE_engine_update_stats(RenderEngine *engine, const char *stats, 
const char *info);
+LIBEXPORT void RE_engine_update_progress(RenderEngine *engine, float progress);
 LIBEXPORT void RE_engine_report(RenderEngine *engine, int type, const char 
*msg);
 
 int RE_engine_render(struct Render *re, int do_all);

Modified: branches/cycles/source/blender/render/intern/pipeline/engine.c
===
--- branches/cycles/source/blender/render/intern/pipeline/engine.c  
2011-05-17 15:20:12 UTC (rev 36730)
+++ branches/cycles/source/blender/render/intern/pipeline/engine.c  
2011-05-17 15:39:40 UTC (rev 36731)
@@ -209,6 +209,14 @@
re->i.statstr= NULL;
 }
 
+void RE_engine_update_progress(RenderEngine *engine, float progress)
+{
+   Render *re= engine->re;
+
+   CLAMP(progress, 0.0f, 1.0f);
+   re->progress(re->prh, progress);
+}
+
 void RE_engine_report(RenderEngine *engine, int type, const char *msg)
 {
BKE_report(engine->re->reports, type, msg);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36730] branches/cycles/source: Render API : add self.report() function for RenderEngine, for reporting warnings and errors.

2011-05-17 Thread Brecht Van Lommel
Revision: 36730
  
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36730
Author:   blendix
Date: 2011-05-17 15:20:12 + (Tue, 17 May 2011)
Log Message:
---
Render API: add self.report() function for RenderEngine, for reporting warnings 
and errors.

Modified Paths:
--
branches/cycles/source/blender/editors/render/render_internal.c
branches/cycles/source/blender/editors/render/render_update.c
branches/cycles/source/blender/makesrna/intern/rna_render.c
branches/cycles/source/blender/render/extern/include/RE_engine.h
branches/cycles/source/blender/render/extern/include/RE_pipeline.h
branches/cycles/source/blender/render/intern/include/render_types.h
branches/cycles/source/blender/render/intern/pipeline/engine.c
branches/cycles/source/blender/render/intern/source/pipeline.c
branches/cycles/source/creator/creator.c

Modified: branches/cycles/source/blender/editors/render/render_internal.c
===
--- branches/cycles/source/blender/editors/render/render_internal.c 
2011-05-17 14:26:45 UTC (rev 36729)
+++ branches/cycles/source/blender/editors/render/render_internal.c 
2011-05-17 15:20:12 UTC (rev 36730)
@@ -446,11 +446,15 @@
   since sequence rendering can call that recursively... (peter) */
seq_stripelem_cache_cleanup();
 
+   RE_SetReports(re, op->reports);
+
if(is_animation)
-   RE_BlenderAnim(re, mainp, scene, camera_override, lay, 
scene->r.sfra, scene->r.efra, scene->r.frame_step, op->reports);
+   RE_BlenderAnim(re, mainp, scene, camera_override, lay, 
scene->r.sfra, scene->r.efra, scene->r.frame_step);
else
RE_BlenderFrame(re, mainp, scene, NULL, camera_override, lay, 
scene->r.cfra, is_write_still);
 
+   RE_SetReports(re, NULL);
+
// no redraw needed, we leave state as we entered it
ED_update_for_newframe(mainp, scene, CTX_wm_screen(C), 1);
 
@@ -591,10 +595,14 @@
rj->do_update= do_update;
rj->progress= progress;
 
+   RE_SetReports(rj->re, rj->reports);
+
if(rj->anim)
-   RE_BlenderAnim(rj->re, rj->main, rj->scene, 
rj->camera_override, rj->lay, rj->scene->r.sfra, rj->scene->r.efra, 
rj->scene->r.frame_step, rj->reports);
+   RE_BlenderAnim(rj->re, rj->main, rj->scene, 
rj->camera_override, rj->lay, rj->scene->r.sfra, rj->scene->r.efra, 
rj->scene->r.frame_step);
else
RE_BlenderFrame(rj->re, rj->main, rj->scene, rj->srl, 
rj->camera_override, rj->lay, rj->scene->r.cfra, rj->write_still);
+
+   RE_SetReports(rj->re, NULL);
 }
 
 static void render_endjob(void *rjv)

Modified: branches/cycles/source/blender/editors/render/render_update.c
===
--- branches/cycles/source/blender/editors/render/render_update.c   
2011-05-17 14:26:45 UTC (rev 36729)
+++ branches/cycles/source/blender/editors/render/render_update.c   
2011-05-17 15:20:12 UTC (rev 36730)
@@ -43,6 +43,8 @@
 #include "DNA_view3d_types.h"
 #include "DNA_world_types.h"
 
+#include "BLI_utildefines.h"
+
 #include "BKE_context.h"
 #include "BKE_depsgraph.h"
 #include "BKE_icons.h"

Modified: branches/cycles/source/blender/makesrna/intern/rna_render.c
===
--- branches/cycles/source/blender/makesrna/intern/rna_render.c 2011-05-17 
14:26:45 UTC (rev 36729)
+++ branches/cycles/source/blender/makesrna/intern/rna_render.c 2011-05-17 
15:20:12 UTC (rev 36730)
@@ -32,6 +32,7 @@
 #include "DNA_scene_types.h"
 
 #include "RNA_define.h"
+#include "RNA_enum_types.h"
 
 #include "rna_internal.h"
 
@@ -373,6 +374,12 @@
prop= RNA_def_string(func, "info", "", 0, "Info", "");
RNA_def_property_flag(prop, PROP_REQUIRED);
 
+   func= RNA_def_function(srna, "report", "RE_engine_report");
+   prop= RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", "");
+   RNA_def_property_flag(prop, PROP_REQUIRED);
+   prop= RNA_def_string(func, "message", "", 0, "Report Message", "");
+   RNA_def_property_flag(prop, PROP_REQUIRED);
+
/* registration */
RNA_define_verify_sdna(0);
 

Modified: branches/cycles/source/blender/render/extern/include/RE_engine.h
===
--- branches/cycles/source/blender/render/extern/include/RE_engine.h
2011-05-17 14:26:45 UTC (rev 36729)
+++ branches/cycles/source/blender/render/extern/include/RE_engine.h
2011-05-17 15:20:12 UTC (rev 36730)
@@ -99,6 +99,7 @@
 
 LIBEXPORT int RE_engine_test_break(RenderEngine *engine);
 LIBEXPORT void RE_engine_update_stats(RenderEngine *engine, const char *stats, 
const char *info);
+LIBEXPORT void RE_engine_report(RenderEngine *engine, int type, const char 
*msg);
 
 int RE_engine_render(struct Render *re, int do_all);
 

Mo

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36729] branches/cycles: Render API: first step in updating RenderEngine to work according to:

2011-05-17 Thread Brecht Van Lommel
Revision: 36729
  
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36729
Author:   blendix
Date: 2011-05-17 14:26:45 + (Tue, 17 May 2011)
Log Message:
---
Render API: first step in updating RenderEngine to work according to:
http://wiki.blender.org/index.php/Dev:2.5/Source/Render/RenderEngineAPI

Modified Paths:
--
branches/cycles/intern/cycles/blender/addon/__init__.py
branches/cycles/intern/cycles/blender/addon/engine.py
branches/cycles/source/blender/blenkernel/BKE_depsgraph.h
branches/cycles/source/blender/blenkernel/BKE_scene.h
branches/cycles/source/blender/blenkernel/intern/depsgraph.c
branches/cycles/source/blender/blenkernel/intern/scene.c
branches/cycles/source/blender/editors/include/ED_render.h
branches/cycles/source/blender/editors/render/CMakeLists.txt
branches/cycles/source/blender/editors/render/render_shading.c
branches/cycles/source/blender/editors/space_view3d/space_view3d.c
branches/cycles/source/blender/editors/space_view3d/view3d_draw.c
branches/cycles/source/blender/makesrna/intern/rna_render.c
branches/cycles/source/blender/makesrna/intern/rna_scene_api.c
branches/cycles/source/blender/render/CMakeLists.txt
branches/cycles/source/blender/render/SConscript
branches/cycles/source/blender/render/extern/include/RE_engine.h
branches/cycles/source/blender/render/intern/pipeline/engine.c
branches/cycles/source/blender/windowmanager/intern/wm_event_system.c
branches/cycles/source/blenderplayer/bad_level_call_stubs/stubs.c

Added Paths:
---
branches/cycles/source/blender/editors/render/render_update.c

Modified: branches/cycles/intern/cycles/blender/addon/__init__.py
===
--- branches/cycles/intern/cycles/blender/addon/__init__.py 2011-05-17 
14:18:02 UTC (rev 36728)
+++ branches/cycles/intern/cycles/blender/addon/__init__.py 2011-05-17 
14:26:45 UTC (rev 36729)
@@ -47,17 +47,30 @@
def __del__(self):
engine.free(self)
 
-   def render(self, scene):
-   engine.create(self, scene, True)
-   engine.render(self, scene)
+   # final render
+   def update(self, data, scene):
+   engine.create(self, data, scene)
+   engine.update(self, data, scene)
 
-   def draw(self, scene):
+   def render(self):
+   engine.render(self)
+
+   # preview render
+   # def preview_update(self, context, id):
+   #   pass
+   #
+   # def preview_render(self):
+   #   pass
+   
+   # viewport render
+   def view_update(self, context):
if not self.session:
-   engine.create(self, scene, False)
-   engine.draw(self, scene)
+   engine.create(self, context.blend_data, context.scene,
+   context.region, context.space_data, 
context.region_data)
+   engine.update(self, context.blend_data, context.scene)
 
-   def update(self, scene):
-   engine.update(self, scene)
+   def view_draw(self, context):
+   engine.draw(self, context.region, context.space_data, 
context.region_data)
 
 def register():
properties.register()

Modified: branches/cycles/intern/cycles/blender/addon/engine.py
===
--- branches/cycles/intern/cycles/blender/addon/engine.py   2011-05-17 
14:18:02 UTC (rev 36728)
+++ branches/cycles/intern/cycles/blender/addon/engine.py   2011-05-17 
14:26:45 UTC (rev 36729)
@@ -23,20 +23,18 @@
import os.path
lib.init(os.path.dirname(__file__))
 
-def create(engine, scene, offline):
+def create(engine, data, scene, region = 0, v3d = 0, rv3d = 0):
from cycles import libcycles_blender as lib
-   data = bpy.data.as_pointer()
+
+   data = data.as_pointer()
scene = scene.as_pointer()
+   if region:
+   region = region.as_pointer()
+   if v3d:
+   v3d = v3d.as_pointer()
+   if rv3d:
+   rv3d = rv3d.as_pointer()
 
-   if not offline and bpy.context.area.type == 'VIEW_3D':
-   region = bpy.context.region.as_pointer()
-   v3d = bpy.context.space_data.as_pointer()
-   rv3d = bpy.context.region_data.as_pointer()
-   else:
-   region = 0
-   v3d = 0
-   rv3d = 0
-
engine.session = lib.create(engine.as_pointer(), data, scene, region, 
v3d, rv3d)
 
 def free(engine):
@@ -46,19 +44,18 @@
lib.free(engine.session)
del engine.session
 
-def render(engine, scene):
+def render(engine):
from cycles import libcycles_blender as lib
lib.render(engine.session)
 
-def update(engine, scene):
+def update(engine, data, scene):
from cycles i

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36728] branches/cycles/source/blender/ editors/interface/interface_panel.c: Cycles: panel header drawing tweak.

2011-05-17 Thread Brecht Van Lommel
Revision: 36728
  
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36728
Author:   blendix
Date: 2011-05-17 14:18:02 + (Tue, 17 May 2011)
Log Message:
---
Cycles: panel header drawing tweak.

Modified Paths:
--
branches/cycles/source/blender/editors/interface/interface_panel.c

Modified: branches/cycles/source/blender/editors/interface/interface_panel.c
===
--- branches/cycles/source/blender/editors/interface/interface_panel.c  
2011-05-17 09:13:14 UTC (rev 36727)
+++ branches/cycles/source/blender/editors/interface/interface_panel.c  
2011-05-17 14:18:02 UTC (rev 36728)
@@ -494,13 +494,13 @@
headrect.ymax= headrect.ymin + floor(PNL_HEADER/block->aspect + 0.001f);

{
-   float minx= rect->xmin+5.0f/block->aspect;
-   float maxx= rect->xmax-5.0f/block->aspect;
+   float minx= rect->xmin/block->aspect;
+   float maxx= rect->xmax/block->aspect;
float y= headrect.ymax;

glEnable(GL_BLEND);
glColor4f(0.0f, 0.0f, 0.0f, 0.1f);
-   uiSetRoundBox(15);
+   uiSetRoundBox(0);
uiDrawBox(GL_POLYGON, minx, headrect.ymin, maxx, y+1, 4);
glDisable(GL_BLEND);
}

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36727] trunk/blender/release/scripts/ startup/bl_ui/__init__.py: added other addon category.

2011-05-17 Thread Campbell Barton
Revision: 36727
  
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36727
Author:   campbellbarton
Date: 2011-05-17 09:13:14 + (Tue, 17 May 2011)
Log Message:
---
added other addon category.

Modified Paths:
--
trunk/blender/release/scripts/startup/bl_ui/__init__.py

Modified: trunk/blender/release/scripts/startup/bl_ui/__init__.py
===
--- trunk/blender/release/scripts/startup/bl_ui/__init__.py 2011-05-17 
07:03:12 UTC (rev 36726)
+++ trunk/blender/release/scripts/startup/bl_ui/__init__.py 2011-05-17 
09:13:14 UTC (rev 36727)
@@ -102,7 +102,8 @@
('Render', "Render", ""),
('Rigging', "Rigging", ""),
('Text Editor', "Text Editor", ""),
-   ('System', "System", "")
+   ('System', "System", ""),
+   ('Other', "Other", ""),
],
 name="Category",
 description="Filter add-ons by category",

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36726] branches/bmesh/blender: svn merge -r36672:36725 https://svn.blender.org/svnroot/bf-blender/trunk/ blender

2011-05-17 Thread Campbell Barton
Revision: 36726
  
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36726
Author:   campbellbarton
Date: 2011-05-17 07:03:12 + (Tue, 17 May 2011)
Log Message:
---
svn merge -r36672:36725 https://svn.blender.org/svnroot/bf-blender/trunk/blender

Revision Links:
--

http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36672

Modified Paths:
--
branches/bmesh/blender/CMakeLists.txt
branches/bmesh/blender/build_files/cmake/cmake_qtcreator_project.py
branches/bmesh/blender/build_files/cmake/macros.cmake
branches/bmesh/blender/build_files/scons/config/win32-vc-config.py
branches/bmesh/blender/build_files/scons/config/win64-vc-config.py
branches/bmesh/blender/build_files/scons/tools/Blender.py
branches/bmesh/blender/build_files/scons/tools/btools.py

branches/bmesh/blender/release/scripts/startup/bl_operators/add_mesh_torus.py
branches/bmesh/blender/release/scripts/startup/bl_ui/properties_data_mesh.py

branches/bmesh/blender/release/scripts/startup/bl_ui/properties_data_modifier.py
branches/bmesh/blender/release/scripts/startup/bl_ui/space_image.py
branches/bmesh/blender/release/scripts/startup/bl_ui/space_sequencer.py
branches/bmesh/blender/release/scripts/startup/bl_ui/space_view3d.py
branches/bmesh/blender/release/scripts/templates/operator_export.py
branches/bmesh/blender/release/scripts/templates/operator_mesh_add.py
branches/bmesh/blender/source/blender/blenkernel/BKE_colortools.h
branches/bmesh/blender/source/blender/blenkernel/BKE_sequencer.h
branches/bmesh/blender/source/blender/blenkernel/CMakeLists.txt
branches/bmesh/blender/source/blender/blenkernel/SConscript
branches/bmesh/blender/source/blender/blenkernel/intern/colortools.c
branches/bmesh/blender/source/blender/blenkernel/intern/icons.c
branches/bmesh/blender/source/blender/blenkernel/intern/object.c
branches/bmesh/blender/source/blender/blenkernel/intern/particle_system.c
branches/bmesh/blender/source/blender/blenkernel/intern/seqeffects.c
branches/bmesh/blender/source/blender/blenkernel/intern/sequencer.c
branches/bmesh/blender/source/blender/blenloader/intern/readfile.c
branches/bmesh/blender/source/blender/editors/animation/keyframing.c
branches/bmesh/blender/source/blender/editors/include/ED_view3d.h
branches/bmesh/blender/source/blender/editors/interface/interface_icons.c

branches/bmesh/blender/source/blender/editors/interface/interface_templates.c
branches/bmesh/blender/source/blender/editors/object/object_edit.c
branches/bmesh/blender/source/blender/editors/object/object_modifier.c
branches/bmesh/blender/source/blender/editors/physics/physics_ops.c
branches/bmesh/blender/source/blender/editors/physics/physics_pointcache.c
branches/bmesh/blender/source/blender/editors/sculpt_paint/sculpt.c
branches/bmesh/blender/source/blender/editors/space_action/action_select.c
branches/bmesh/blender/source/blender/editors/space_file/filelist.c
branches/bmesh/blender/source/blender/editors/space_image/CMakeLists.txt
branches/bmesh/blender/source/blender/editors/space_image/SConscript
branches/bmesh/blender/source/blender/editors/space_image/image_draw.c
branches/bmesh/blender/source/blender/editors/space_image/image_ops.c

branches/bmesh/blender/source/blender/editors/space_sequencer/sequencer_add.c

branches/bmesh/blender/source/blender/editors/space_sequencer/sequencer_draw.c

branches/bmesh/blender/source/blender/editors/space_sequencer/sequencer_edit.c
branches/bmesh/blender/source/blender/editors/space_view3d/view3d_draw.c
branches/bmesh/blender/source/blender/editors/space_view3d/view3d_edit.c
branches/bmesh/blender/source/blender/editors/space_view3d/view3d_header.c
branches/bmesh/blender/source/blender/editors/space_view3d/view3d_view.c
branches/bmesh/blender/source/blender/editors/uvedit/uvedit_unwrap_ops.c
branches/bmesh/blender/source/blender/imbuf/CMakeLists.txt
branches/bmesh/blender/source/blender/imbuf/IMB_imbuf_types.h
branches/bmesh/blender/source/blender/imbuf/SConscript
branches/bmesh/blender/source/blender/imbuf/intern/allocimbuf.c
branches/bmesh/blender/source/blender/makesdna/DNA_ID.h
branches/bmesh/blender/source/blender/makesdna/DNA_camera_types.h
branches/bmesh/blender/source/blender/makesdna/DNA_sequence_types.h
branches/bmesh/blender/source/blender/makesdna/DNA_view3d_types.h
branches/bmesh/blender/source/blender/makesrna/RNA_access.h
branches/bmesh/blender/source/blender/makesrna/SConscript
branches/bmesh/blender/source/blender/makesrna/intern/CMakeLists.txt
branches/bmesh/blender/source/blender/makesrna/intern/SConscript
branches/bmesh/blender/source/blender/makesrna/intern/rna_camera.c
branches/bmesh/blender/source/blender/makesrna/intern/rna_color.c
branches/bmesh/blend