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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-04-15 14:28:32 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-04-15 14:28:32 +0400
commit9a85013692322f8a821b8228ad552f84d2a215e9 (patch)
tree666bb54fa093429d65b6b0322e8058c03f5fe223 /source/blender/editors
parent2b018673509fe7a38a6332fae00bd605335bd286 (diff)
Merge various small changes from render branch:
* Division by zero fix for TNT SVD code. * Sound fix, in case ffmpeg decode fails, don't use the samples. * Fix for incorrect bounds of transformed objects in new raytracing code. * Gave memory arena's a name used for allocations for easier memory usage debugging. * Dupligroup no_draw option was using layers but not restrict view/render setting. (not a bugfix exactly but would do display list context switching while drawing for no reason). * Fix objects instanced on hair particles not giving consistent results when the object is transformed. * New math functions: madd_v4_v4fl, len_squared_v3v3, interp_v4_v4v4v4, mul_v4_m4v4, SH and form factor functions, box_minmax_bounds_m4. * mul_m4_m4m4 and mul_m3_m3m3 now accept the same pointers for multiple arguments. * endjob callback for WM jobs system. * Geometry node uv/color layer now has search list/autocomplete. * Various small buildsystem tweaks, not strictly needed yet in trunk.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/armature/meshlaplacian.c4
-rw-r--r--source/blender/editors/interface/interface_icons.c14
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c3
-rw-r--r--source/blender/editors/object/object_bake.c2
-rw-r--r--source/blender/editors/physics/physics_fluid.c2
-rw-r--r--source/blender/editors/render/render_internal.c21
-rw-r--r--source/blender/editors/render/render_preview.c4
-rw-r--r--source/blender/editors/screen/screendump.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c4
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c2
-rw-r--r--source/blender/editors/space_file/filelist.c2
-rw-r--r--source/blender/editors/space_node/drawnode.c16
-rw-r--r--source/blender/editors/space_node/node_edit.c2
-rw-r--r--source/blender/editors/space_outliner/outliner.c2
-rw-r--r--source/blender/editors/space_view3d/SConscript2
-rw-r--r--source/blender/editors/uvedit/uvedit_draw.c6
-rw-r--r--source/blender/editors/uvedit/uvedit_parametrizer.c4
17 files changed, 56 insertions, 36 deletions
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index bc50befa2a9..4f0805cd0d6 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -1764,7 +1764,7 @@ static void harmonic_coordinates_bind(Scene *scene, MeshDeformModifierData *mmd,
else
mdb->weights= MEM_callocN(sizeof(float)*mdb->totvert*mdb->totcagevert, "MDefWeights");
- mdb->memarena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE);
+ mdb->memarena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "harmonic coords arena");
BLI_memarena_use_calloc(mdb->memarena);
/* make bounding box equal size in all directions, add padding, and compute
@@ -1804,7 +1804,7 @@ static void harmonic_coordinates_bind(Scene *scene, MeshDeformModifierData *mmd,
/* free temporary MDefBoundIsects */
BLI_memarena_free(mdb->memarena);
- mdb->memarena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE);
+ mdb->memarena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "harmonic coords arena");
/* start with all cells untyped */
for(a=0; a<mdb->size3; a++)
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index d08ec2f92c5..1e2b166ca82 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -518,12 +518,14 @@ static void init_internal_icons()
else
icontype= ICON_TYPE_BUFFER;
- for (y=0; y<ICON_GRID_ROWS; y++) {
- for (x=0; x<ICON_GRID_COLS; x++) {
- def_internal_icon(bbuf, BIFICONID_FIRST + y*ICON_GRID_COLS + x,
- x*(ICON_GRID_W+ICON_GRID_MARGIN)+ICON_GRID_MARGIN,
- y*(ICON_GRID_H+ICON_GRID_MARGIN)+ICON_GRID_MARGIN, ICON_GRID_W,
- icontype);
+ if(bbuf) {
+ for (y=0; y<ICON_GRID_ROWS; y++) {
+ for (x=0; x<ICON_GRID_COLS; x++) {
+ def_internal_icon(bbuf, BIFICONID_FIRST + y*ICON_GRID_COLS + x,
+ x*(ICON_GRID_W+ICON_GRID_MARGIN)+ICON_GRID_MARGIN,
+ y*(ICON_GRID_H+ICON_GRID_MARGIN)+ICON_GRID_MARGIN, ICON_GRID_W,
+ icontype);
+ }
}
}
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 72219df04c9..b66fa6da06c 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -648,8 +648,7 @@ void extrude_mesh(Scene *scene, Object *obedit, EditMesh *em, wmOperator *op, sh
* This shouldn't be necessary, derived queries should be
* automatically building this data if invalid. Or something.
*/
-// DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
- object_handle_update(scene, obedit);
+ DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
/* individual faces? */
// BIF_TransformSetUndo("Extrude");
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c
index d3f9847d9b9..9a9461da62e 100644
--- a/source/blender/editors/object/object_bake.c
+++ b/source/blender/editors/object/object_bake.c
@@ -263,7 +263,7 @@ static int objects_bake_render_invoke(bContext *C, wmOperator *op, wmEvent *_eve
steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, WM_JOB_EXCL_RENDER|WM_JOB_PRIORITY);
WM_jobs_customdata(steve, bkr, bake_freejob);
WM_jobs_timer(steve, 0.2, NC_IMAGE, 0); /* TODO - only draw bake image, can we enforce this */
- WM_jobs_callbacks(steve, bake_startjob, NULL, bake_update);
+ WM_jobs_callbacks(steve, bake_startjob, NULL, bake_update, NULL);
G.afbreek= 0;
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index 6f5b8924a13..1647892fd13 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -1005,7 +1005,7 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
/* setup job */
WM_jobs_customdata(steve, fb, fluidbake_free);
WM_jobs_timer(steve, 0.1, NC_SCENE|ND_FRAME, NC_SCENE|ND_FRAME);
- WM_jobs_callbacks(steve, fluidbake_startjob, NULL, NULL);
+ WM_jobs_callbacks(steve, fluidbake_startjob, NULL, NULL, NULL);
WM_jobs_start(CTX_wm_manager(C), steve);
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index 187f726519f..47dd95eb17b 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -87,11 +87,11 @@ void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volat
/* xmin here is first subrect x coord, xmax defines subrect width */
xmin = renrect->xmin + rr->crop;
- xmax = renrect->xmax - xmin - rr->crop;
+ xmax = renrect->xmax - xmin + rr->crop;
if (xmax<2) return;
ymin= renrect->ymin + rr->crop;
- ymax= renrect->ymax - ymin - rr->crop;
+ ymax= renrect->ymax - ymin + rr->crop;
if(ymax<2)
return;
renrect->ymin= renrect->ymax;
@@ -544,6 +544,13 @@ static void render_startjob(void *rjv, short *stop, short *do_update)
// free_main(mainp);
}
+static void render_endjob(void *rjv)
+{
+ /* XXX render stability hack */
+ G.rendering = 0;
+ WM_main_add_notifier(NC_WINDOW, NULL);
+}
+
/* called by render, check job 'stop' value or the global */
static int render_breakjob(void *rjv)
{
@@ -560,8 +567,9 @@ static int render_breakjob(void *rjv)
static int screen_render_modal(bContext *C, wmOperator *op, wmEvent *event)
{
/* no running blender, remove handler and pass through */
- if(0==WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C)))
+ if(0==WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C))) {
return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH;
+ }
/* running render */
switch (event->type) {
@@ -645,7 +653,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, WM_JOB_EXCL_RENDER|WM_JOB_PRIORITY);
WM_jobs_customdata(steve, rj, render_freejob);
WM_jobs_timer(steve, 0.2, NC_SCENE|ND_RENDER_RESULT, 0);
- WM_jobs_callbacks(steve, render_startjob, NULL, NULL);
+ WM_jobs_callbacks(steve, render_startjob, NULL, NULL, render_endjob);
/* get a render result image, and make sure it is empty */
ima= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result");
@@ -669,6 +677,11 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
WM_cursor_wait(0);
WM_event_add_notifier(C, NC_SCENE|ND_RENDER_RESULT, scene);
+ /* we set G.rendering here already instead of only in the job, this ensure
+ main loop or other scene updates are disabled in time, since they may
+ have started before the job thread */
+ G.rendering = 1;
+
/* add modal handler for ESC */
WM_event_add_modal_handler(C, op);
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index aef652cd116..50d45f0c8e8 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -1121,7 +1121,7 @@ void ED_preview_icon_job(const bContext *C, void *owner, ID *id, unsigned int *r
/* setup job */
WM_jobs_customdata(steve, sp, shader_preview_free);
WM_jobs_timer(steve, 0.1, NC_MATERIAL, NC_MATERIAL);
- WM_jobs_callbacks(steve, common_preview_startjob, NULL, NULL);
+ WM_jobs_callbacks(steve, common_preview_startjob, NULL, NULL, NULL);
WM_jobs_start(CTX_wm_manager(C), steve);
}
@@ -1147,7 +1147,7 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M
/* setup job */
WM_jobs_customdata(steve, sp, shader_preview_free);
WM_jobs_timer(steve, 0.1, NC_MATERIAL, NC_MATERIAL);
- WM_jobs_callbacks(steve, common_preview_startjob, NULL, shader_preview_updatejob);
+ WM_jobs_callbacks(steve, common_preview_startjob, NULL, shader_preview_updatejob, NULL);
WM_jobs_start(CTX_wm_manager(C), steve);
}
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index b6cb6978dc1..122424385be 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -323,7 +323,7 @@ static int screencast_exec(bContext *C, wmOperator *op)
/* setup job */
WM_jobs_customdata(steve, sj, screenshot_freejob);
WM_jobs_timer(steve, 0.1, 0, NC_SCREEN|ND_SCREENCAST);
- WM_jobs_callbacks(steve, screenshot_startjob, NULL, screenshot_updatejob);
+ WM_jobs_callbacks(steve, screenshot_startjob, NULL, screenshot_updatejob, NULL);
WM_jobs_start(CTX_wm_manager(C), steve);
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index df2e4032257..40bc4dc4c87 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -3083,7 +3083,7 @@ static void project_paint_begin(ProjPaintState *ps)
ps->thread_tot = BLI_system_thread_count();
}
for (a=0; a<ps->thread_tot; a++) {
- ps->arena_mt[a] = BLI_memarena_new(1<<16);
+ ps->arena_mt[a] = BLI_memarena_new(1<<16, "project paint arena");
}
arena = ps->arena_mt[0];
@@ -3706,7 +3706,7 @@ static void *do_projectpaint_thread(void *ph_v)
pos_ofs[0] = pos[0] - lastpos[0];
pos_ofs[1] = pos[1] - lastpos[1];
- smearArena = BLI_memarena_new(1<<16);
+ smearArena = BLI_memarena_new(1<<16, "paint smear arena");
}
/* avoid a square root with every dist comparison */
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index 06a574d2e83..97cee5c730f 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -262,6 +262,8 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
case ND_KEYINGSET:
buttons_area_redraw(sa, BCONTEXT_SCENE);
break;
+ case ND_RENDER_RESULT:
+ break;
case ND_MODE:
case ND_LAYER:
default:
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 9dd16586946..b5754404a0f 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -1352,7 +1352,7 @@ void thumbnails_start(struct FileList* filelist, const struct bContext* C)
steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), filelist, 0);
WM_jobs_customdata(steve, tj, thumbnails_free);
WM_jobs_timer(steve, 0.5, NC_WINDOW, NC_WINDOW);
- WM_jobs_callbacks(steve, thumbnails_startjob, NULL, thumbnails_update);
+ WM_jobs_callbacks(steve, thumbnails_startjob, NULL, thumbnails_update, NULL);
/* start the job */
WM_jobs_start(CTX_wm_manager(C), steve);
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 5d3c00b113d..7e79b4b822e 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -349,11 +349,21 @@ static void node_shader_buts_vect_math(uiLayout *layout, bContext *C, PointerRNA
static void node_shader_buts_geometry(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
+ PointerRNA obptr= CTX_data_pointer_get(C, "active_object");
uiLayout *col;
-
+
col= uiLayoutColumn(layout, 0);
- uiItemR(col, ptr, "uv_layer", 0, "UV", 0);
- uiItemR(col, ptr, "color_layer", 0, "VCol", 0);
+
+ if(obptr.data && RNA_enum_get(&obptr, "type") == OB_MESH) {
+ PointerRNA dataptr= RNA_pointer_get(&obptr, "data");
+
+ uiItemPointerR(col, ptr, "uv_layer", &dataptr, "uv_textures", "", 0);
+ uiItemPointerR(col, ptr, "color_layer", &dataptr, "vertex_colors", "", 0);
+ }
+ else {
+ uiItemR(col, ptr, "uv_layer", 0, "UV", 0);
+ uiItemR(col, ptr, "color_layer", 0, "VCol", 0);
+ }
}
static void node_shader_buts_dynamic(uiLayout *layout, bContext *C, PointerRNA *ptr)
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index f1aa9f745ee..767dd753766 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -176,7 +176,7 @@ void snode_composite_job(const bContext *C, ScrArea *sa)
/* setup job */
WM_jobs_customdata(steve, cj, compo_freejob);
WM_jobs_timer(steve, 0.1, NC_SCENE, NC_SCENE|ND_COMPO_RESULT);
- WM_jobs_callbacks(steve, compo_startjob, compo_initjob, compo_updatejob);
+ WM_jobs_callbacks(steve, compo_startjob, compo_initjob, compo_updatejob, NULL);
WM_jobs_start(CTX_wm_manager(C), steve);
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c
index 44baea0737f..291c67d22ff 100644
--- a/source/blender/editors/space_outliner/outliner.c
+++ b/source/blender/editors/space_outliner/outliner.c
@@ -4764,11 +4764,9 @@ static void restrictbutton_r_lay_cb(bContext *C, void *poin, void *poin2)
static void restrictbutton_modifier_cb(bContext *C, void *poin, void *poin2)
{
- Scene *scene = (Scene *)poin;
Object *ob = (Object *)poin2;
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- object_handle_update(scene, ob);
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
}
diff --git a/source/blender/editors/space_view3d/SConscript b/source/blender/editors/space_view3d/SConscript
index ba521a5fb1a..1d8e01f2b1b 100644
--- a/source/blender/editors/space_view3d/SConscript
+++ b/source/blender/editors/space_view3d/SConscript
@@ -13,5 +13,7 @@ incs += ' #source/kernel/gen_system'
if env['WITH_BF_GAMEENGINE']:
defs.append('GAMEBLENDER=1')
+if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
+ incs += ' ' + env['BF_PTHREADS_INC']
env.BlenderLib ( 'bf_editors_space_view3d', sources, Split(incs), defines = defs, libtype=['core'], priority=[40] )
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c
index e3bf1e83247..335e17b8796 100644
--- a/source/blender/editors/uvedit/uvedit_draw.c
+++ b/source/blender/editors/uvedit/uvedit_draw.c
@@ -839,12 +839,6 @@ void draw_uvedit_main(SpaceImage *sima, ARegion *ar, Scene *scene, Object *obedi
show_uvshadow= ED_space_image_show_uvshadow(sima, obedit);
if(show_uvedit || show_uvshadow) {
- /* this is basically the same object_handle_update as in the 3d view,
- * here we have to do it as well for the object we are editing if we
- * are displaying the final result */
- if(obedit && (sima->flag & SI_DRAWSHADOW))
- object_handle_update(scene, obedit);
-
if(show_uvshadow)
draw_uvs_shadow(sima, obedit);
else
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index dbc04f85497..9dfa0934ad2 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -4027,7 +4027,7 @@ static void p_smooth(PChart *chart)
MEM_freeN(nodesx);
MEM_freeN(nodesy);
- arena = BLI_memarena_new(1<<16);
+ arena = BLI_memarena_new(1<<16, "param smooth arena");
root = p_node_new(arena, tri, esize*2, minv, maxv, 0);
for (v=chart->verts; v; v=v->nextlink)
@@ -4047,7 +4047,7 @@ ParamHandle *param_construct_begin()
PHandle *handle = MEM_callocN(sizeof*handle, "PHandle");
handle->construction_chart = p_chart_new(handle);
handle->state = PHANDLE_STATE_ALLOCATED;
- handle->arena = BLI_memarena_new((1<<16));
+ handle->arena = BLI_memarena_new((1<<16), "param construct arena");
handle->aspx = 1.0f;
handle->aspy = 1.0f;