From 478e90ffdcd3f00c9346f430583c5d99ffb61337 Mon Sep 17 00:00:00 2001 From: Tom Musgrove Date: Fri, 12 Mar 2010 00:22:33 +0000 Subject: [PATCH 001/153] Changed NTSC and PAL to be consistent with the ITU BT 601 spec, other variations can be done as custom if the user wants it. --- release/scripts/presets/render/D16.py | 7 ------- release/scripts/presets/render/D4.py | 7 ------- release/scripts/presets/render/SXGA.py | 7 ------- release/scripts/presets/render/TV_NTSC(D1)_16_colon_9.py | 7 ------- release/scripts/presets/render/TV_NTSC(D1)_4_colon_3.py | 7 ------- release/scripts/presets/render/TV_NTSC(DV)_4_colon_3.py | 7 ------- .../{TV_NTSC(DV)_16_colon_9.py => TV_NTSC_16_colon_9.py} | 4 ++-- .../presets/render/{TV_NTSC.py => TV_NTSC_4_colon_3.py} | 2 +- release/scripts/presets/render/TV_PAL.py | 7 ------- release/scripts/presets/render/TV_PAL_16_colon_9.py | 4 ++-- release/scripts/presets/render/TV_PAL_4_colon_3.py | 4 ++-- release/scripts/presets/render/WSXGA+.py | 7 ------- release/scripts/presets/render/WSXGA.py | 7 ------- release/scripts/presets/render/XGA.py | 7 ------- 14 files changed, 7 insertions(+), 77 deletions(-) delete mode 100644 release/scripts/presets/render/D16.py delete mode 100644 release/scripts/presets/render/D4.py delete mode 100644 release/scripts/presets/render/SXGA.py delete mode 100644 release/scripts/presets/render/TV_NTSC(D1)_16_colon_9.py delete mode 100644 release/scripts/presets/render/TV_NTSC(D1)_4_colon_3.py delete mode 100644 release/scripts/presets/render/TV_NTSC(DV)_4_colon_3.py rename release/scripts/presets/render/{TV_NTSC(DV)_16_colon_9.py => TV_NTSC_16_colon_9.py} (70%) rename release/scripts/presets/render/{TV_NTSC.py => TV_NTSC_4_colon_3.py} (85%) delete mode 100644 release/scripts/presets/render/TV_PAL.py delete mode 100644 release/scripts/presets/render/WSXGA+.py delete mode 100644 release/scripts/presets/render/WSXGA.py delete mode 100644 release/scripts/presets/render/XGA.py diff --git a/release/scripts/presets/render/D16.py b/release/scripts/presets/render/D16.py deleted file mode 100644 index aec7bb8f6ab..00000000000 --- a/release/scripts/presets/render/D16.py +++ /dev/null @@ -1,7 +0,0 @@ -bpy.context.scene.render.resolution_x = 2880 -bpy.context.scene.render.resolution_y = 2048 -bpy.context.scene.render.resolution_percentage = 100 -bpy.context.scene.render.pixel_aspect_x = 128 -bpy.context.scene.render.pixel_aspect_y = 135 -bpy.context.scene.render.fps = 24 -bpy.context.scene.render.fps_base = 1 diff --git a/release/scripts/presets/render/D4.py b/release/scripts/presets/render/D4.py deleted file mode 100644 index 614ae1f93e9..00000000000 --- a/release/scripts/presets/render/D4.py +++ /dev/null @@ -1,7 +0,0 @@ -bpy.context.scene.render.resolution_x = 1440 -bpy.context.scene.render.resolution_y = 1024 -bpy.context.scene.render.resolution_percentage = 100 -bpy.context.scene.render.pixel_aspect_x = 128 -bpy.context.scene.render.pixel_aspect_y = 135 -bpy.context.scene.render.fps = 24 -bpy.context.scene.render.fps_base = 1 diff --git a/release/scripts/presets/render/SXGA.py b/release/scripts/presets/render/SXGA.py deleted file mode 100644 index 92bf9b0b4b9..00000000000 --- a/release/scripts/presets/render/SXGA.py +++ /dev/null @@ -1,7 +0,0 @@ -bpy.context.scene.render.resolution_x = 1280 -bpy.context.scene.render.resolution_y = 1024 -bpy.context.scene.render.resolution_percentage = 100 -bpy.context.scene.render.pixel_aspect_x = 1 -bpy.context.scene.render.pixel_aspect_y = 1 -bpy.context.scene.render.fps = 24 -bpy.context.scene.render.fps_base = 1 diff --git a/release/scripts/presets/render/TV_NTSC(D1)_16_colon_9.py b/release/scripts/presets/render/TV_NTSC(D1)_16_colon_9.py deleted file mode 100644 index 0b6a7e51cdb..00000000000 --- a/release/scripts/presets/render/TV_NTSC(D1)_16_colon_9.py +++ /dev/null @@ -1,7 +0,0 @@ -bpy.context.scene.render.resolution_x = 720 -bpy.context.scene.render.resolution_y = 486 -bpy.context.scene.render.resolution_percentage = 100 -bpy.context.scene.render.pixel_aspect_x = 6 -bpy.context.scene.render.pixel_aspect_y = 5 -bpy.context.scene.render.fps = 30 -bpy.context.scene.render.fps_base = 1.001 diff --git a/release/scripts/presets/render/TV_NTSC(D1)_4_colon_3.py b/release/scripts/presets/render/TV_NTSC(D1)_4_colon_3.py deleted file mode 100644 index bcbccfb615d..00000000000 --- a/release/scripts/presets/render/TV_NTSC(D1)_4_colon_3.py +++ /dev/null @@ -1,7 +0,0 @@ -bpy.context.scene.render.resolution_x = 720 -bpy.context.scene.render.resolution_y = 486 -bpy.context.scene.render.resolution_percentage = 100 -bpy.context.scene.render.pixel_aspect_x = 9 -bpy.context.scene.render.pixel_aspect_y = 10 -bpy.context.scene.render.fps = 30 -bpy.context.scene.render.fps_base = 1.001 diff --git a/release/scripts/presets/render/TV_NTSC(DV)_4_colon_3.py b/release/scripts/presets/render/TV_NTSC(DV)_4_colon_3.py deleted file mode 100644 index 1b5d1931513..00000000000 --- a/release/scripts/presets/render/TV_NTSC(DV)_4_colon_3.py +++ /dev/null @@ -1,7 +0,0 @@ -bpy.context.scene.render.resolution_x = 720 -bpy.context.scene.render.resolution_y = 480 -bpy.context.scene.render.resolution_percentage = 100 -bpy.context.scene.render.pixel_aspect_x = 8 -bpy.context.scene.render.pixel_aspect_y = 9 -bpy.context.scene.render.fps = 30 -bpy.context.scene.render.fps_base = 1.001 diff --git a/release/scripts/presets/render/TV_NTSC(DV)_16_colon_9.py b/release/scripts/presets/render/TV_NTSC_16_colon_9.py similarity index 70% rename from release/scripts/presets/render/TV_NTSC(DV)_16_colon_9.py rename to release/scripts/presets/render/TV_NTSC_16_colon_9.py index 6f7d2b4d636..26833ba0c09 100644 --- a/release/scripts/presets/render/TV_NTSC(DV)_16_colon_9.py +++ b/release/scripts/presets/render/TV_NTSC_16_colon_9.py @@ -1,7 +1,7 @@ bpy.context.scene.render.resolution_x = 720 bpy.context.scene.render.resolution_y = 480 bpy.context.scene.render.resolution_percentage = 100 -bpy.context.scene.render.pixel_aspect_x = 32 -bpy.context.scene.render.pixel_aspect_y = 27 +bpy.context.scene.render.pixel_aspect_x = 40 +bpy.context.scene.render.pixel_aspect_y = 33 bpy.context.scene.render.fps = 30 bpy.context.scene.render.fps_base = 1.001 diff --git a/release/scripts/presets/render/TV_NTSC.py b/release/scripts/presets/render/TV_NTSC_4_colon_3.py similarity index 85% rename from release/scripts/presets/render/TV_NTSC.py rename to release/scripts/presets/render/TV_NTSC_4_colon_3.py index cd6322fd21a..219e9b0506d 100644 --- a/release/scripts/presets/render/TV_NTSC.py +++ b/release/scripts/presets/render/TV_NTSC_4_colon_3.py @@ -1,5 +1,5 @@ bpy.context.scene.render.resolution_x = 720 -bpy.context.scene.render.resolution_y = 480 +bpy.context.scene.render.resolution_y = 486 bpy.context.scene.render.resolution_percentage = 100 bpy.context.scene.render.pixel_aspect_x = 10 bpy.context.scene.render.pixel_aspect_y = 11 diff --git a/release/scripts/presets/render/TV_PAL.py b/release/scripts/presets/render/TV_PAL.py deleted file mode 100644 index 4a71ad021fe..00000000000 --- a/release/scripts/presets/render/TV_PAL.py +++ /dev/null @@ -1,7 +0,0 @@ -bpy.context.scene.render.resolution_x = 720 -bpy.context.scene.render.resolution_y = 576 -bpy.context.scene.render.resolution_percentage = 100 -bpy.context.scene.render.pixel_aspect_x = 54 -bpy.context.scene.render.pixel_aspect_y = 51 -bpy.context.scene.render.fps = 25 -bpy.context.scene.render.fps_base = 1 diff --git a/release/scripts/presets/render/TV_PAL_16_colon_9.py b/release/scripts/presets/render/TV_PAL_16_colon_9.py index 516209a877d..c8aa6616bb0 100644 --- a/release/scripts/presets/render/TV_PAL_16_colon_9.py +++ b/release/scripts/presets/render/TV_PAL_16_colon_9.py @@ -1,7 +1,7 @@ bpy.context.scene.render.resolution_x = 720 bpy.context.scene.render.resolution_y = 576 bpy.context.scene.render.resolution_percentage = 100 -bpy.context.scene.render.pixel_aspect_x = 64 -bpy.context.scene.render.pixel_aspect_y = 45 +bpy.context.scene.render.pixel_aspect_x = 16 +bpy.context.scene.render.pixel_aspect_y = 11 bpy.context.scene.render.fps = 25 bpy.context.scene.render.fps_base = 1 diff --git a/release/scripts/presets/render/TV_PAL_4_colon_3.py b/release/scripts/presets/render/TV_PAL_4_colon_3.py index 7f9cc0e3f76..45eaaf47e44 100644 --- a/release/scripts/presets/render/TV_PAL_4_colon_3.py +++ b/release/scripts/presets/render/TV_PAL_4_colon_3.py @@ -1,7 +1,7 @@ bpy.context.scene.render.resolution_x = 720 bpy.context.scene.render.resolution_y = 576 bpy.context.scene.render.resolution_percentage = 100 -bpy.context.scene.render.pixel_aspect_x = 16 -bpy.context.scene.render.pixel_aspect_y = 15 +bpy.context.scene.render.pixel_aspect_x = 12 +bpy.context.scene.render.pixel_aspect_y = 11 bpy.context.scene.render.fps = 25 bpy.context.scene.render.fps_base = 1 diff --git a/release/scripts/presets/render/WSXGA+.py b/release/scripts/presets/render/WSXGA+.py deleted file mode 100644 index b58c4b9971b..00000000000 --- a/release/scripts/presets/render/WSXGA+.py +++ /dev/null @@ -1,7 +0,0 @@ -bpy.context.scene.render.resolution_x = 1680 -bpy.context.scene.render.resolution_y = 1050 -bpy.context.scene.render.resolution_percentage = 100 -bpy.context.scene.render.pixel_aspect_x = 1 -bpy.context.scene.render.pixel_aspect_y = 1 -bpy.context.scene.render.fps = 24 -bpy.context.scene.render.fps_base = 1 diff --git a/release/scripts/presets/render/WSXGA.py b/release/scripts/presets/render/WSXGA.py deleted file mode 100644 index e5679c1ace3..00000000000 --- a/release/scripts/presets/render/WSXGA.py +++ /dev/null @@ -1,7 +0,0 @@ -bpy.context.scene.render.resolution_x = 1440 -bpy.context.scene.render.resolution_y = 900 -bpy.context.scene.render.resolution_percentage = 100 -bpy.context.scene.render.pixel_aspect_x = 1 -bpy.context.scene.render.pixel_aspect_y = 1 -bpy.context.scene.render.fps = 24 -bpy.context.scene.render.fps_base = 1 diff --git a/release/scripts/presets/render/XGA.py b/release/scripts/presets/render/XGA.py deleted file mode 100644 index 32d848e5cb2..00000000000 --- a/release/scripts/presets/render/XGA.py +++ /dev/null @@ -1,7 +0,0 @@ -bpy.context.scene.render.resolution_x = 1024 -bpy.context.scene.render.resolution_y = 768 -bpy.context.scene.render.resolution_percentage = 100 -bpy.context.scene.render.pixel_aspect_x = 1 -bpy.context.scene.render.pixel_aspect_y = 1 -bpy.context.scene.render.fps = 24 -bpy.context.scene.render.fps_base = 1 From 63c71425b7faee81995a758b54e60320cd4e3ddf Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Fri, 12 Mar 2010 02:43:36 +0000 Subject: [PATCH 002/153] Fixed [#21558] ctrl+c a material color and ctr+v it into new texture color results in darker color --- source/blender/editors/space_image/image_ops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index ed75b6dcef0..488cb7885b3 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1182,6 +1182,9 @@ static int new_exec(bContext *C, wmOperator *op) uvtestgrid= RNA_boolean_get(op->ptr, "uv_test_grid"); RNA_float_get_array(op->ptr, "color", color); color[3]= RNA_float_get(op->ptr, "alpha"); + + if (!floatbuf && scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) + linearrgb_to_srgb_v3_v3(color, color); ima = BKE_add_image_size(width, height, name, floatbuf, uvtestgrid, color); From 86c237b3a5a69a3614c11c46168bc366d661fa49 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Fri, 12 Mar 2010 02:44:18 +0000 Subject: [PATCH 003/153] Added ability to save and load planar environment maps, rather than only cube. --- .../blender/editors/render/render_shading.c | 33 +++++++++++-------- source/blender/makesrna/intern/rna_texture.c | 12 ++++++- source/blender/render/intern/source/envmap.c | 22 ++++++++++--- 3 files changed, 49 insertions(+), 18 deletions(-) diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 254d842dbb7..91655855a61 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -787,27 +787,35 @@ static int save_envmap(wmOperator *op, Scene *scene, EnvMap *env, char *str, int dx= env->cube[1]->x; - ibuf = IMB_allocImBuf(3*dx, 2*dx, 24, IB_rectfloat, 0); + if (env->type == ENV_CUBE) { + ibuf = IMB_allocImBuf(3*dx, 2*dx, 24, IB_rectfloat, 0); + + IMB_rectcpy(ibuf, env->cube[0], 0, 0, 0, 0, dx, dx); + IMB_rectcpy(ibuf, env->cube[1], dx, 0, 0, 0, dx, dx); + IMB_rectcpy(ibuf, env->cube[2], 2*dx, 0, 0, 0, dx, dx); + IMB_rectcpy(ibuf, env->cube[3], 0, dx, 0, 0, dx, dx); + IMB_rectcpy(ibuf, env->cube[4], dx, dx, 0, 0, dx, dx); + IMB_rectcpy(ibuf, env->cube[5], 2*dx, dx, 0, 0, dx, dx); + } + else if (env->type == ENV_PLANE) { + ibuf = IMB_allocImBuf(dx, dx, 24, IB_rectfloat, 0); + IMB_rectcpy(ibuf, env->cube[1], 0, 0, 0, 0, dx, dx); + } if (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) ibuf->profile = IB_PROFILE_LINEAR_RGB; - IMB_rectcpy(ibuf, env->cube[0], 0, 0, 0, 0, dx, dx); - IMB_rectcpy(ibuf, env->cube[1], dx, 0, 0, 0, dx, dx); - IMB_rectcpy(ibuf, env->cube[2], 2*dx, 0, 0, 0, dx, dx); - IMB_rectcpy(ibuf, env->cube[3], 0, dx, 0, 0, dx, dx); - IMB_rectcpy(ibuf, env->cube[4], dx, dx, 0, 0, dx, dx); - IMB_rectcpy(ibuf, env->cube[5], 2*dx, dx, 0, 0, dx, dx); - - if (BKE_write_ibuf(scene, ibuf, str, imtype, scene->r.subimtype, scene->r.quality)) + if (BKE_write_ibuf(scene, ibuf, str, imtype, scene->r.subimtype, scene->r.quality)) { retval = OPERATOR_FINISHED; + } else { BKE_reportf(op->reports, RPT_ERROR, "Error saving environment map to %s.", str); retval = OPERATOR_CANCELLED; } + IMB_freeImBuf(ibuf); ibuf = NULL; - + return retval; } @@ -862,8 +870,6 @@ static int envmap_save_poll(bContext *C) return 0; if (!tex->env || !tex->env->ok) return 0; - if (tex->env->type==ENV_PLANE) - return 0; if (tex->env->cube[1]==NULL) return 0; @@ -938,7 +944,8 @@ static int envmap_clear_all_exec(bContext *C, wmOperator *op) Tex *tex; for (tex=bmain->tex.first; tex; tex=tex->id.next) - BKE_free_envmapdata(tex->env); + if (tex->env) + BKE_free_envmapdata(tex->env); WM_event_add_notifier(C, NC_TEXTURE|NA_EDITED, tex); diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 01545735bb3..b5a4ac5db8c 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -349,6 +349,16 @@ static EnumPropertyItem *rna_ImageTexture_filter_itemf(bContext *C, PointerRNA * return item; } +static void rna_Envmap_source_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + Tex *tex= ptr->id.data; + + if (tex->env) + BKE_free_envmapdata(tex->env); + + rna_Texture_update(bmain, scene, ptr); +} + static PointerRNA rna_PointDensity_psys_get(PointerRNA *ptr) { PointDensity *pd= ptr->data; @@ -738,7 +748,7 @@ static void rna_def_environment_map(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "stype"); RNA_def_property_enum_items(prop, prop_source_items); RNA_def_property_ui_text(prop, "Source", ""); - RNA_def_property_update(prop, 0, "rna_Texture_update"); + RNA_def_property_update(prop, 0, "rna_Envmap_source_update"); prop= RNA_def_property(srna, "viewpoint_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "object"); diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index c455a229d63..7daf3e07105 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -74,15 +74,23 @@ static void envmap_split_ima(EnvMap *env, ImBuf *ibuf) dx= ibuf->y; dx/= 2; - if(3*dx != ibuf->x) { + if (3*dx == ibuf->x) { + env->type = ENV_CUBE; + } else if (ibuf->x == ibuf->y) { + env->type = ENV_PLANE; + } else { printf("Incorrect envmap size\n"); env->ok= 0; env->ima->ok= 0; + return; } - else { + + if (env->type == ENV_CUBE) { for(part=0; part<6; part++) { env->cube[part]= IMB_allocImBuf(dx, dx, 24, IB_rect|IB_rectfloat, 0); } + IMB_float_from_rect(ibuf); + IMB_rectcpy(env->cube[0], ibuf, 0, 0, 0, 0, dx, dx); IMB_rectcpy(env->cube[1], ibuf, @@ -97,6 +105,12 @@ static void envmap_split_ima(EnvMap *env, ImBuf *ibuf) 0, 0, 2*dx, dx, dx, dx); env->ok= ENV_OSA; } + else { /* ENV_PLANE */ + env->cube[1]= IMB_dupImBuf(ibuf); + IMB_float_from_rect(env->cube[1]); + + env->ok= ENV_OSA; + } } /* ------------------------------------------------------------------------- */ @@ -658,10 +672,11 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe texres->tin= 0.0; return 0; } + if(env->stype==ENV_LOAD) { env->ima= tex->ima; if(env->ima && env->ima->ok) { - if(env->cube[0]==NULL) { + if(env->cube[1]==NULL) { ImBuf *ibuf= BKE_image_get_ibuf(env->ima, NULL); if(ibuf) envmap_split_ima(env, ibuf); @@ -672,7 +687,6 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe } if(env->ok==0) { - texres->tin= 0.0; return 0; } From 4faedb3d91b8d57396c633c3f8b4c9d30bc8f2c4 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Fri, 12 Mar 2010 03:12:27 +0000 Subject: [PATCH 004/153] netrender: sensible timeout on connection attempt fix for operator api change --- release/scripts/io/netrender/operators.py | 4 ++-- release/scripts/io/netrender/utils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/release/scripts/io/netrender/operators.py b/release/scripts/io/netrender/operators.py index f667be68c84..4c027436560 100644 --- a/release/scripts/io/netrender/operators.py +++ b/release/scripts/io/netrender/operators.py @@ -104,7 +104,7 @@ class RENDER_OT_netclientanim(bpy.types.Operator): scene.network_render.job_id = client.clientSendJob(conn, scene, True) conn.close() - bpy.ops.screen.render('INVOKE_AREA', animation=True) + bpy.ops.render.render('INVOKE_AREA', animation=True) return {'FINISHED'} @@ -121,7 +121,7 @@ class RENDER_OT_netclientrun(bpy.types.Operator): return True def execute(self, context): - bpy.ops.screen.render('INVOKE_AREA', animation=True) + bpy.ops.render.render('INVOKE_AREA', animation=True) return {'FINISHED'} diff --git a/release/scripts/io/netrender/utils.py b/release/scripts/io/netrender/utils.py index 1d35ea00c99..fdf788daceb 100644 --- a/release/scripts/io/netrender/utils.py +++ b/release/scripts/io/netrender/utils.py @@ -110,7 +110,7 @@ def clientConnection(address, port, report = None, scan = True): return None try: - conn = http.client.HTTPConnection(address, port) + conn = http.client.HTTPConnection(address, port, timeout = 5) if conn: if clientVerifyVersion(conn): From 1337867378f3f0990bea74993564f8864f395520 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 12 Mar 2010 12:09:06 +0000 Subject: [PATCH 005/153] Fix #21183: info stats not updated immediately on undo. --- source/blender/editors/util/undo.c | 2 ++ source/blender/windowmanager/intern/wm_event_system.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index cf60490055f..46dc3a6cf8d 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -140,6 +140,8 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) undo_editmode_name(C, undoname); else undo_editmode_step(C, step); + + WM_event_add_notifier(C, NC_GEOM|ND_DATA, NULL); } } else { diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index b72bc02aca6..9ef94b5e1ff 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -217,7 +217,7 @@ void wm_event_do_notifiers(bContext *C) } } - if(ELEM4(note->category, NC_SCENE, NC_OBJECT, NC_GEOM, NC_SCENE)) { + if(ELEM5(note->category, NC_SCENE, NC_OBJECT, NC_GEOM, NC_SCENE, NC_WM)) { ED_info_stats_clear(CTX_data_scene(C)); WM_event_add_notifier(C, NC_SPACE|ND_SPACE_INFO, NULL); } From b0dd7b8c9c45ee9d76b83dd8d410df80410b0bf5 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 12 Mar 2010 12:09:58 +0000 Subject: [PATCH 006/153] Fix #21189: vertex paint not working with mirror modifier. --- source/blender/blenkernel/intern/DerivedMesh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 28b093cd693..9d7fbccec75 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -2125,7 +2125,7 @@ static void mesh_build_data(Scene *scene, Object *ob, CustomDataMask dataMask) Object *obact = scene->basact?scene->basact->object:NULL; int editing = paint_facesel_test(ob); /* weight paint and face select need original indicies because of selection buffer drawing */ - int needMapping = (ob==obact) && (editing || (ob->mode & OB_MODE_WEIGHT_PAINT) || editing); + int needMapping = (ob==obact) && (editing || (ob->mode & (OB_MODE_WEIGHT_PAINT|OB_MODE_VERTEX_PAINT)) || editing); clear_mesh_caches(ob); From 353a078d4c1fc12eb4c444f6d7a020652c23dd71 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 12 Mar 2010 12:29:12 +0000 Subject: [PATCH 007/153] Fix #21211: new indirect/environment/emit passes weren't showing up in compositor and outliner yet. --- source/blender/blenkernel/BKE_node.h | 4 +++- source/blender/blenkernel/intern/node.c | 8 +++++-- .../blender/editors/space_outliner/outliner.c | 15 +++++++++---- source/blender/makesdna/DNA_scene_types.h | 3 +-- .../nodes/intern/CMP_nodes/CMP_image.c | 22 +++++++++++++------ .../blender/render/intern/source/pipeline.c | 11 ---------- .../blender/render/intern/source/rendercore.c | 6 ----- .../blender/render/intern/source/shadeinput.c | 2 +- source/blender/render/intern/source/strand.c | 2 -- source/blender/render/intern/source/zbuf.c | 9 -------- 10 files changed, 37 insertions(+), 45 deletions(-) diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index a6ebb72320c..0e5ad8e3ee9 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -290,9 +290,11 @@ void ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMaterial *mat); #define RRES_OUT_AO 10 #define RRES_OUT_REFLECT 11 #define RRES_OUT_REFRACT 12 -#define RRES_OUT_RADIO 13 +#define RRES_OUT_INDIRECT 13 #define RRES_OUT_INDEXOB 14 #define RRES_OUT_MIST 15 +#define RRES_OUT_EMIT 16 +#define RRES_OUT_ENV 17 /* note: types are needed to restore callbacks, don't change values */ #define CMP_NODE_VIEWER 201 diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 844139dd871..77e54fe6769 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -2809,12 +2809,16 @@ static void force_hidden_passes(bNode *node, int passflag) if(!(passflag & SCE_PASS_REFLECT)) sock->flag |= SOCK_UNAVAIL; sock= BLI_findlink(&node->outputs, RRES_OUT_REFRACT); if(!(passflag & SCE_PASS_REFRACT)) sock->flag |= SOCK_UNAVAIL; - sock= BLI_findlink(&node->outputs, RRES_OUT_RADIO); - if(!(passflag & SCE_PASS_RADIO)) sock->flag |= SOCK_UNAVAIL; + sock= BLI_findlink(&node->outputs, RRES_OUT_INDIRECT); + if(!(passflag & SCE_PASS_INDIRECT)) sock->flag |= SOCK_UNAVAIL; sock= BLI_findlink(&node->outputs, RRES_OUT_INDEXOB); if(!(passflag & SCE_PASS_INDEXOB)) sock->flag |= SOCK_UNAVAIL; sock= BLI_findlink(&node->outputs, RRES_OUT_MIST); if(!(passflag & SCE_PASS_MIST)) sock->flag |= SOCK_UNAVAIL; + sock= BLI_findlink(&node->outputs, RRES_OUT_EMIT); + if(!(passflag & SCE_PASS_EMIT)) sock->flag |= SOCK_UNAVAIL; + sock= BLI_findlink(&node->outputs, RRES_OUT_ENV); + if(!(passflag & SCE_PASS_ENVIRONMENT)) sock->flag |= SOCK_UNAVAIL; } diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 541b3802249..1142bd96dcd 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -511,10 +511,17 @@ static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, Sc te->name= "Refraction"; te->directdata= &srl->passflag; - te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_RADIO); - te->name= "Radiosity"; + te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_INDIRECT); + te->name= "Indirect"; + te->directdata= &srl->passflag; + + te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_ENVIRONMENT); + te->name= "Environment"; + te->directdata= &srl->passflag; + + te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_EMIT); + te->name= "Emit"; te->directdata= &srl->passflag; - } @@ -4946,7 +4953,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar uiButSetFunc(bt, restrictbutton_r_lay_cb, tselem->id, NULL); layflag++; /* is lay_xor */ - if(ELEM6(tselem->nr, SCE_PASS_SPEC, SCE_PASS_SHADOW, SCE_PASS_AO, SCE_PASS_REFLECT, SCE_PASS_REFRACT, SCE_PASS_RADIO)) + if(ELEM8(tselem->nr, SCE_PASS_SPEC, SCE_PASS_SHADOW, SCE_PASS_AO, SCE_PASS_REFLECT, SCE_PASS_REFRACT, SCE_PASS_INDIRECT, SCE_PASS_EMIT, SCE_PASS_ENVIRONMENT)) bt= uiDefIconButBitI(block, TOG, tselem->nr, 0, (*layflag & tselem->nr)?ICON_DOT:ICON_BLANK1, (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, (short)te->ys, 17, OL_H-1, layflag, 0, 0, 0, 0, "Exclude this Pass from Combined"); uiButSetFunc(bt, restrictbutton_r_lay_cb, tselem->id, NULL); diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index c9339b4bddd..283408ba853 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -183,12 +183,11 @@ typedef struct SceneRenderLayer { #define SCE_PASS_REFRACT 1024 #define SCE_PASS_INDEXOB 2048 #define SCE_PASS_UV 4096 -#define SCE_PASS_RADIO 8192 /* Radio removed, can use for new GI? */ +#define SCE_PASS_INDIRECT 8192 #define SCE_PASS_MIST 16384 #define SCE_PASS_RAYHITS 32768 #define SCE_PASS_EMIT 65536 #define SCE_PASS_ENVIRONMENT 131072 -#define SCE_PASS_INDIRECT 262144 /* note, srl->passflag is treestore element 'nr' in outliner, short still... */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_image.c b/source/blender/nodes/intern/CMP_nodes/CMP_image.c index aa3fa9db412..a5063702365 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_image.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_image.c @@ -46,9 +46,11 @@ static bNodeSocketType cmp_node_rlayers_out[]= { { SOCK_RGBA, 0, "AO", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_RGBA, 0, "Reflect", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_RGBA, 0, "Refract", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, - { SOCK_RGBA, 0, "Radio", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { SOCK_RGBA, 0, "Indirect", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_VALUE, 0, "IndexOB", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_VALUE, 0, "Mist", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { SOCK_RGBA, 0, "Emit", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { SOCK_RGBA, 0, "Environment",0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } }; @@ -176,13 +178,16 @@ void outputs_multilayer_get(RenderData *rd, RenderLayer *rl, bNodeStack **out, I out[RRES_OUT_REFLECT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_REFLECT); if(out[RRES_OUT_REFRACT]->hasoutput) out[RRES_OUT_REFRACT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_REFRACT); - if(out[RRES_OUT_RADIO]->hasoutput) - out[RRES_OUT_RADIO]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_RADIO); + if(out[RRES_OUT_INDIRECT]->hasoutput) + out[RRES_OUT_INDIRECT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_INDIRECT); if(out[RRES_OUT_INDEXOB]->hasoutput) out[RRES_OUT_INDEXOB]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_INDEXOB); if(out[RRES_OUT_MIST]->hasoutput) out[RRES_OUT_MIST]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_MIST); - + if(out[RRES_OUT_EMIT]->hasoutput) + out[RRES_OUT_EMIT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_EMIT); + if(out[RRES_OUT_ENV]->hasoutput) + out[RRES_OUT_ENV]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_ENVIRONMENT); }; @@ -334,13 +339,16 @@ void node_composit_rlayers_out(RenderData *rd, RenderLayer *rl, bNodeStack **out out[RRES_OUT_REFLECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_REFLECT); if(out[RRES_OUT_REFRACT]->hasoutput) out[RRES_OUT_REFRACT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_REFRACT); - if(out[RRES_OUT_RADIO]->hasoutput) - out[RRES_OUT_RADIO]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_RADIO); + if(out[RRES_OUT_INDIRECT]->hasoutput) + out[RRES_OUT_INDIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_INDIRECT); if(out[RRES_OUT_INDEXOB]->hasoutput) out[RRES_OUT_INDEXOB]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_INDEXOB); if(out[RRES_OUT_MIST]->hasoutput) out[RRES_OUT_MIST]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_MIST); - + if(out[RRES_OUT_EMIT]->hasoutput) + out[RRES_OUT_EMIT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_EMIT); + if(out[RRES_OUT_ENV]->hasoutput) + out[RRES_OUT_ENV]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_ENVIRONMENT); }; static void node_composit_exec_rlayers(void *data, bNode *node, bNodeStack **in, bNodeStack **out) diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index b049e2484e4..e800ce3acf0 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -368,12 +368,6 @@ static char *get_pass_name(int passtype, int channel) if(channel==1) return "Refract.G"; return "Refract.B"; } - if(passtype == SCE_PASS_RADIO) { - if(channel==-1) return "Radio"; - if(channel==0) return "Radio.R"; - if(channel==1) return "Radio.G"; - return "Radio.B"; - } if(passtype == SCE_PASS_INDEXOB) { if(channel==-1) return "IndexOB"; return "IndexOB.X"; @@ -440,9 +434,6 @@ static int passtype_from_name(char *str) if(strcmp(str, "Refract")==0) return SCE_PASS_REFRACT; - if(strcmp(str, "Radio")==0) - return SCE_PASS_RADIO; - if(strcmp(str, "IndexOB")==0) return SCE_PASS_INDEXOB; @@ -622,8 +613,6 @@ static RenderResult *new_render_result(Render *re, rcti *partrct, int crop, int render_layer_add_pass(rr, rl, 3, SCE_PASS_REFLECT); if(srl->passflag & SCE_PASS_REFRACT) render_layer_add_pass(rr, rl, 3, SCE_PASS_REFRACT); - if(srl->passflag & SCE_PASS_RADIO) - render_layer_add_pass(rr, rl, 3, SCE_PASS_RADIO); if(srl->passflag & SCE_PASS_INDEXOB) render_layer_add_pass(rr, rl, 1, SCE_PASS_INDEXOB); if(srl->passflag & SCE_PASS_MIST) diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 52dee6ba954..85c96d17ac0 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -486,9 +486,6 @@ static void add_filt_passes(RenderLayer *rl, int curmask, int rectx, int offset, case SCE_PASS_REFRACT: col= shr->refr; break; - case SCE_PASS_RADIO: - col= NULL; // removed shr->rad; - break; case SCE_PASS_NORMAL: col= shr->nor; break; @@ -593,9 +590,6 @@ static void add_passes(RenderLayer *rl, int offset, ShadeInput *shi, ShadeResult case SCE_PASS_REFRACT: col= shr->refr; break; - case SCE_PASS_RADIO: - col= NULL; // removed shr->rad; - break; case SCE_PASS_NORMAL: col= shr->nor; break; diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index 60d003f3c21..b80abe1e528 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -176,7 +176,7 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr) } /* copy additional passes */ - if(shi->passflag & (SCE_PASS_VECTOR|SCE_PASS_NORMAL|SCE_PASS_RADIO)) { + if(shi->passflag & (SCE_PASS_VECTOR|SCE_PASS_NORMAL)) { QUATCOPY(shr->winspeed, shi->winspeed); VECCOPY(shr->nor, shi->vn); } diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c index f7e2861f124..c754ed1eab9 100644 --- a/source/blender/render/intern/source/strand.c +++ b/source/blender/render/intern/source/strand.c @@ -240,8 +240,6 @@ void interpolate_shade_result(ShadeResult *shr1, ShadeResult *shr2, float t, Sha interpolate_vec3(shr1->refl, shr2->refl, t, negt, shr->refl); if(addpassflag & SCE_PASS_REFRACT) interpolate_vec3(shr1->refr, shr2->refr, t, negt, shr->refr); - /* removed if(addpassflag & SCE_PASS_RADIO) - interpolate_vec3(shr1->rad, shr2->rad, t, negt, shr->rad);*/ if(addpassflag & SCE_PASS_MIST) interpolate_vec1(&shr1->mist, &shr2->mist, t, negt, &shr->mist); } diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index dc87170842b..93e6f7a234a 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -3539,9 +3539,6 @@ void merge_transp_passes(RenderLayer *rl, ShadeResult *shr) case SCE_PASS_REFLECT: col= shr->refl; break; - case SCE_PASS_RADIO: - col= NULL; // removed shr->rad; - break; case SCE_PASS_REFRACT: col= shr->refr; break; @@ -3650,9 +3647,6 @@ void add_transp_passes(RenderLayer *rl, int offset, ShadeResult *shr, float alph case SCE_PASS_REFRACT: col= shr->refr; break; - case SCE_PASS_RADIO: - col= NULL; // removed shr->rad; - break; case SCE_PASS_NORMAL: col= shr->nor; break; @@ -3900,9 +3894,6 @@ static int addtosamp_shr(ShadeResult *samp_shr, ShadeSample *ssamp, int addpassf if(addpassflag & SCE_PASS_REFRACT) addvecmul(samp_shr->refr, shr->refr, fac); - /* removed if(addpassflag & SCE_PASS_RADIO) - addvecmul(samp_shr->rad, shr->rad, fac);*/ - if(addpassflag & SCE_PASS_MIST) samp_shr->mist= samp_shr->mist+fac*shr->mist; From 4dbf499be3d076cceb5332cacf9407851e41654b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 12 Mar 2010 13:07:25 +0000 Subject: [PATCH 008/153] Fix crash in compositing nodes, due to threading problem. --- source/blender/blenlib/intern/threads.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index 5f5a0720940..02d6ab0b7b5 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -229,8 +229,8 @@ void BLI_remove_thread(ListBase *threadbase, void *callerdata) for(tslot= threadbase->first; tslot; tslot= tslot->next) { if(tslot->callerdata==callerdata) { - tslot->callerdata= NULL; pthread_join(tslot->pthread, NULL); + tslot->callerdata= NULL; tslot->avail= 1; } } @@ -243,8 +243,8 @@ void BLI_remove_thread_index(ListBase *threadbase, int index) for(tslot = threadbase->first; tslot; tslot = tslot->next, counter++) { if (counter == index && tslot->avail == 0) { - tslot->callerdata = NULL; pthread_join(tslot->pthread, NULL); + tslot->callerdata = NULL; tslot->avail = 1; break; } @@ -257,8 +257,8 @@ void BLI_remove_threads(ListBase *threadbase) for(tslot = threadbase->first; tslot; tslot = tslot->next) { if (tslot->avail == 0) { - tslot->callerdata = NULL; pthread_join(tslot->pthread, NULL); + tslot->callerdata = NULL; tslot->avail = 1; } } From 00d1e56f3d7c16838c462ae837a9b74e98ff1abe Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 12 Mar 2010 13:19:32 +0000 Subject: [PATCH 009/153] Fix for warning introduced in passes commit, also removed some more radiosity code. --- source/blender/editors/space_outliner/outliner.c | 6 +++--- source/blender/editors/space_outliner/outliner_intern.h | 3 ++- source/blender/render/intern/source/convertblender.c | 8 +------- source/blender/render/intern/source/shadeoutput.c | 7 ------- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 1142bd96dcd..da2cf2f95c3 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -443,7 +443,7 @@ static void outliner_sort(SpaceOops *soops, ListBase *lb) /* Prototype, see functions below */ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *idv, - TreeElement *parent, short type, short index); + TreeElement *parent, short type, int index); static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, SceneRenderLayer *srl) @@ -564,7 +564,7 @@ static void outliner_add_scene_contents(SpaceOops *soops, ListBase *lb, Scene *s } static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *idv, - TreeElement *parent, short type, short index) + TreeElement *parent, short type, int index) { TreeElement *te; TreeStoreElem *tselem; @@ -1234,7 +1234,7 @@ int need_add_seq_dup(Sequence *seq) return(1); } -void add_seq_dup(SpaceOops *soops, Sequence *seq, TreeElement *te, short index) +void add_seq_dup(SpaceOops *soops, Sequence *seq, TreeElement *te, int index) { TreeElement *ch; Sequence *p; diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index c3a0165f945..b29d693a09b 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -45,7 +45,8 @@ typedef struct TreeElement { ListBase subtree; float xs, ys; // do selection int store_index; // offset in tree store - short flag, index; // flag for non-saved stuff, index for data arrays + short flag; // flag for non-saved stuff + int index; // index for data arrays short idcode; // from TreeStore id short xend; // width of item display, for select char *name; diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 6e098186748..c75e825a0e7 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -4674,8 +4674,7 @@ static int allow_render_dupli_instance(Render *re, DupliObject *dob, Object *obd /* don't allow lamp, animated duplis, or radio render */ return (render_object_type(obd->type) && - (!(dob->type == OB_DUPLIGROUP) || !dob->animated) && - !(re->r.mode & R_RADIO)); + (!(dob->type == OB_DUPLIGROUP) || !dob->animated)); } static void dupli_render_particle_set(Render *re, Object *ob, int timeoffset, int level, int enable) @@ -5027,11 +5026,6 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view) /* yafray: 'direct' radiosity, environment maps and raytree init not needed for yafray render */ /* although radio mode could be useful at some point, later */ if (re->r.renderer==R_INTERN) { -#if 0 /* RADIO was removed */ - /* RADIO (uses no R anymore) */ - if(!re->test_break(re->tbh)) - if(re->r.mode & R_RADIO) do_radio_render(re); -#endif /* raytree */ if(!re->test_break(re->tbh)) { if(re->r.mode & R_RAYTRACE) { diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 7ba6a889ffc..43dab16d3fb 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -1773,13 +1773,6 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) shr->combined[0]+= shi->ambr; shr->combined[1]+= shi->ambg; shr->combined[2]+= shi->ambb; - - /* removed - if(shi->combinedflag & SCE_PASS_RADIO) { - shr->combined[0]+= shi->r*shi->amb*shi->rad[0]; - shr->combined[1]+= shi->g*shi->amb*shi->rad[1]; - shr->combined[2]+= shi->b*shi->amb*shi->rad[2]; - }*/ if(ma->mode & MA_RAMP_COL) ramp_diffuse_result(shr->combined, shi); } From 9395efc02f796b0be33bb256321a3ef09a068e33 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 12 Mar 2010 13:45:25 +0000 Subject: [PATCH 010/153] Revert part of my last commit and leave emit/environment out of outliner, there's a problem here with overflowing shorts that I'll need to fix later. --- source/blender/editors/space_outliner/outliner.c | 10 ++++++---- .../blender/editors/space_outliner/outliner_intern.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index da2cf2f95c3..38691a62d35 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -443,7 +443,7 @@ static void outliner_sort(SpaceOops *soops, ListBase *lb) /* Prototype, see functions below */ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *idv, - TreeElement *parent, short type, int index); + TreeElement *parent, short type, short index); static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, SceneRenderLayer *srl) @@ -515,13 +515,15 @@ static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, Sc te->name= "Indirect"; te->directdata= &srl->passflag; + /* TODO SCE_PASS_ENVIRONMENT/EMIT overflow short.. + te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_ENVIRONMENT); te->name= "Environment"; te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_EMIT); te->name= "Emit"; - te->directdata= &srl->passflag; + te->directdata= &srl->passflag;*/ } @@ -564,7 +566,7 @@ static void outliner_add_scene_contents(SpaceOops *soops, ListBase *lb, Scene *s } static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *idv, - TreeElement *parent, short type, int index) + TreeElement *parent, short type, short index) { TreeElement *te; TreeStoreElem *tselem; @@ -1234,7 +1236,7 @@ int need_add_seq_dup(Sequence *seq) return(1); } -void add_seq_dup(SpaceOops *soops, Sequence *seq, TreeElement *te, int index) +void add_seq_dup(SpaceOops *soops, Sequence *seq, TreeElement *te, short index) { TreeElement *ch; Sequence *p; diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index b29d693a09b..44b435af3bd 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -46,7 +46,7 @@ typedef struct TreeElement { float xs, ys; // do selection int store_index; // offset in tree store short flag; // flag for non-saved stuff - int index; // index for data arrays + short index; // index for data arrays short idcode; // from TreeStore id short xend; // width of item display, for select char *name; From 812be2053a95bc3dec63f24fd7a27640693516e1 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 12 Mar 2010 14:18:14 +0000 Subject: [PATCH 011/153] Fix #21122: color sliders behaving weirdly. --- source/blender/editors/interface/interface.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index ea7e89f5102..c1d47f2ec7c 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -648,10 +648,6 @@ void uiEndBlock(const bContext *C, uiBlock *block) CTX_store_set((bContext*)C, NULL); } - /* only update soft range while not editing */ - if(but->rnaprop && !(but->editval || but->editstr || but->editvec)) - ui_set_but_soft_range(but, ui_get_but_val(but)); - ui_but_anim_flag(but, (scene)? scene->r.cfra: 0.0f); } @@ -1940,6 +1936,10 @@ void ui_check_but(uiBut *but) // if(but->type==TEX || but->type==IDPOIN) transopts= 0; + /* only update soft range while not editing */ + if(but->rnaprop && !(but->editval || but->editstr || but->editvec)) + ui_set_but_soft_range(but, ui_get_but_val(but)); + /* test for min and max, icon sliders, etc */ switch( but->type ) { case NUM: From 8252fa5a16b9e09662ad3d2a20f78bc4e324afa6 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 12 Mar 2010 14:42:03 +0000 Subject: [PATCH 012/153] Fix smoke looking black in the viewport when compiling with -ffast-math. (memset works on byte level and bytes -1,-1,-1,-1 = NaN). --- source/blender/blenkernel/intern/smoke.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 2196e2ccd04..69209699a69 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -1398,11 +1398,12 @@ static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int static void smoke_calc_transparency(float *result, float *input, float *p0, float *p1, int res[3], float dx, float *light, bresenham_callback cb, float correct) { - int z; float bv[6]; - int slabsize=res[0]*res[1]; + int a, z, slabsize=res[0]*res[1], size= res[0]*res[1]*res[2]; + + for(a=0; a Date: Fri, 12 Mar 2010 16:02:05 +0000 Subject: [PATCH 013/153] Patch #21027: 3d view background seams fix, by Anthony Edlin, thanks! This fixes a bug where the texture coordinates were wrong, and also makes filtering now work even at the borders of the tiles into which the image is split. Also see bug #20933. --- source/blender/editors/screen/glutil.c | 75 +++++++++++++++++++------- 1 file changed, 55 insertions(+), 20 deletions(-) diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 2b55fc2ca6d..4223a401b0e 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -428,10 +428,9 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format, int ltexid= glaGetOneInteger(GL_TEXTURE_2D); int lrowlength= glaGetOneInteger(GL_UNPACK_ROW_LENGTH); int subpart_x, subpart_y, tex_w, tex_h; + int seamless, offset_x, offset_y, nsubparts_x, nsubparts_y; int texid= get_cached_work_texture(&tex_w, &tex_h); - int nsubparts_x= (img_w+(tex_w-1))/tex_w; - int nsubparts_y= (img_h+(tex_h-1))/tex_h; - + /* Specify the color outside this function, and tex will modulate it. * This is useful for changing alpha without using glPixelTransferf() */ @@ -448,31 +447,67 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format, glPixelZoom(1.f, 1.f); #endif + /* setup seamless 2=on, 0=off */ + seamless= ((tex_w2 && tex_h>2)? 2: 0; + + offset_x= tex_w - seamless; + offset_y= tex_h - seamless; + + nsubparts_x= (img_w + (offset_x - 1))/(offset_x); + nsubparts_y= (img_h + (offset_y - 1))/(offset_y); + for (subpart_y=0; subpart_ytex_w)? 1: 0; + int offset_top= (seamless && remainder_y>tex_h)? 1: 0; + float rast_x= x+subpart_x*offset_x*xzoom; + float rast_y= y+subpart_y*offset_y*yzoom; - if(format==GL_FLOAT) - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, subpart_w, subpart_h, GL_RGBA, GL_FLOAT, &f_rect[(subpart_y*tex_w)*img_w*4 + (subpart_x*tex_w)*4]); - else - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, subpart_w, subpart_h, GL_RGBA, GL_UNSIGNED_BYTE, &uc_rect[(subpart_y*tex_w)*img_w*4 + (subpart_x*tex_w)*4]); - + /* check if we already got these because we always get 2 more when doing seamless*/ + if(subpart_w<=seamless || subpart_h<=seamless) + continue; + + if(format==GL_FLOAT) { + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, subpart_w, subpart_h, GL_RGBA, GL_FLOAT, &f_rect[subpart_y*offset_y*img_w*4 + subpart_x*offset_x*4]); + + /* add an extra border of pixels so linear looks ok at edges of full image. */ + if(subpart_w Date: Fri, 12 Mar 2010 16:21:39 +0000 Subject: [PATCH 014/153] Fix #21066: particle hair X mirror doesn't work. --- source/blender/editors/physics/particle_edit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 9fc9131ffb2..744ef285179 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -831,9 +831,12 @@ static void PE_apply_mirror(Object *ob, ParticleSystem *psys) edit= psys->edit; psmd= psys_get_modifier(ob, psys); - if(!edit->mirror_cache || !psmd->dm) + if(!psmd->dm) return; + if(!edit->mirror_cache) + PE_update_mirror_cache(ob, psys); + /* we delay settings the PARS_EDIT_RECALC for mirrored particles * to avoid doing mirror twice */ LOOP_POINTS { From a19e542db2d5d65aae9720d22e10e578d2b5bd9e Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 12 Mar 2010 16:32:18 +0000 Subject: [PATCH 015/153] Bug #20410: collada doesn't compile with mingw but is enabled by default. Since no one seems to be fixing this I've just disabled it by default now. --- config/win32-mingw-config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/win32-mingw-config.py b/config/win32-mingw-config.py index 9088db5a5d8..b29ea74c152 100644 --- a/config/win32-mingw-config.py +++ b/config/win32-mingw-config.py @@ -142,7 +142,7 @@ BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a' '${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a', '${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ] -WITH_BF_COLLADA = True +WITH_BF_COLLADA = False BF_COLLADA = '#source/blender/collada' BF_COLLADA_INC = '${BF_COLLADA}' BF_COLLADA_LIB = 'bf_collada' From 4a8849b030acf3ce4768501bbbf85e6c531a86a1 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 12 Mar 2010 16:43:04 +0000 Subject: [PATCH 016/153] - Hhighlight active nurb in edit mode - Replaced hardcoded nurbcol array with theme colors - Send notification in duplicate curve operator (this operator could reset/change active nurb) - Edge seam color added to the user preferences dialog --- release/scripts/ui/space_userpref.py | 14 ++ source/blender/editors/curve/editcurve.c | 1 + source/blender/editors/include/UI_resources.h | 16 ++ source/blender/editors/interface/resources.c | 44 ++++- .../blender/editors/space_graph/graph_draw.c | 29 +-- .../blender/editors/space_view3d/drawobject.c | 165 +++++++++++++++--- source/blender/makesdna/DNA_userdef_types.h | 4 + source/blender/makesrna/intern/rna_userdef.c | 84 +++++++++ 8 files changed, 323 insertions(+), 34 deletions(-) diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 6e8fa8d1a28..35bda77c1d8 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -658,6 +658,19 @@ class USERPREF_PT_theme(bpy.types.Panel): col.prop(v3d, "object_grouped") col.prop(v3d, "object_grouped_active") col.prop(v3d, "transform") + col.prop(v3d, "nurb_uline") + col.prop(v3d, "nurb_vline") + col.prop(v3d, "nurb_sel_uline") + col.prop(v3d, "nurb_sel_vline") + col.prop(v3d, "handle_free") + col.prop(v3d, "handle_auto") + col.prop(v3d, "handle_vect") + col.prop(v3d, "handle_align") + col.prop(v3d, "handle_sel_free") + col.prop(v3d, "handle_sel_auto") + col.prop(v3d, "handle_sel_vect") + col.prop(v3d, "handle_sel_align") + col.prop(v3d, "act_spline") col = split.column() col.prop(v3d, "vertex") @@ -666,6 +679,7 @@ class USERPREF_PT_theme(bpy.types.Panel): col.prop(v3d, "vertex_normal") col.prop(v3d, "bone_solid") col.prop(v3d, "bone_pose") + col.prop(v3d, "edge_seam") #col.prop(v3d, "edge") Doesn't seem to work elif theme.theme_area == 'GRAPH_EDITOR': diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 8534e250885..de4f426eb65 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -4255,6 +4255,7 @@ static int duplicate_exec(bContext *C, wmOperator *op) Object *obedit= CTX_data_edit_object(C); adduplicateflagNurb(obedit, 1); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index 2f908559c6c..46c8a446a03 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -164,6 +164,22 @@ enum { TH_FACE_DOT, TH_FACEDOT_SIZE, TH_CFRAME, + TH_NURB_ULINE, + TH_NURB_VLINE, + TH_NURB_SEL_ULINE, + TH_NURB_SEL_VLINE, + + /* this eight colors should be in one block */ + TH_HANDLE_FREE, + TH_HANDLE_AUTO, + TH_HANDLE_VECT, + TH_HANDLE_ALIGN, + TH_HANDLE_SEL_FREE, + TH_HANDLE_SEL_AUTO, + TH_HANDLE_SEL_VECT, + TH_HANDLE_SEL_ALIGN, + + TH_ACTIVE_SPLINE, TH_SYNTAX_B, TH_SYNTAX_V, diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index f86ffe657cc..fb44685ceff 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -305,7 +305,33 @@ char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid) cp= ts->strip_select; break; case TH_CFRAME: cp= ts->cframe; break; - + case TH_NURB_ULINE: + cp= ts->nurb_uline; break; + case TH_NURB_VLINE: + cp= ts->nurb_vline; break; + case TH_NURB_SEL_ULINE: + cp= ts->nurb_sel_uline; break; + case TH_NURB_SEL_VLINE: + cp= ts->nurb_sel_vline; break; + case TH_ACTIVE_SPLINE: + cp= ts->act_spline; break; + case TH_HANDLE_FREE: + cp= ts->handle_free; break; + case TH_HANDLE_AUTO: + cp= ts->handle_auto; break; + case TH_HANDLE_VECT: + cp= ts->handle_vect; break; + case TH_HANDLE_ALIGN: + cp= ts->handle_align; break; + case TH_HANDLE_SEL_FREE: + cp= ts->handle_sel_free; break; + case TH_HANDLE_SEL_AUTO: + cp= ts->handle_sel_auto; break; + case TH_HANDLE_SEL_VECT: + cp= ts->handle_sel_vect; break; + case TH_HANDLE_SEL_ALIGN: + cp= ts->handle_sel_align; break; + case TH_SYNTAX_B: cp= ts->syntaxb; break; case TH_SYNTAX_V: @@ -495,6 +521,22 @@ void ui_theme_init_userdef(void) btheme->tv3d.facedot_size= 4; SETCOL(btheme->tv3d.cframe, 0x60, 0xc0, 0x40, 255); + SETCOL(btheme->tv3d.nurb_uline, 0x90, 0x90, 0x00, 255); + SETCOL(btheme->tv3d.nurb_vline, 0x80, 0x30, 0x60, 255); + SETCOL(btheme->tv3d.nurb_sel_uline, 0xf0, 0xff, 0x40, 255); + SETCOL(btheme->tv3d.nurb_sel_vline, 0xf0, 0x90, 0xa0, 255); + + SETCOL(btheme->tv3d.handle_free, 0, 0, 0, 255); + SETCOL(btheme->tv3d.handle_auto, 0x90, 0x90, 0x00, 255); + SETCOL(btheme->tv3d.handle_vect, 0x40, 0x90, 0x30, 255); + SETCOL(btheme->tv3d.handle_align, 0x80, 0x30, 0x60, 255); + SETCOL(btheme->tv3d.handle_sel_free, 0, 0, 0, 255); + SETCOL(btheme->tv3d.handle_sel_auto, 0xf0, 0xff, 0x40, 255); + SETCOL(btheme->tv3d.handle_sel_vect, 0x40, 0xc0, 0x30, 255); + SETCOL(btheme->tv3d.handle_sel_align, 0xf0, 0x90, 0xa0, 255); + + SETCOL(btheme->tv3d.act_spline, 0xdb, 0x25, 0x12, 255); + SETCOL(btheme->tv3d.bone_solid, 200, 200, 200, 255); SETCOL(btheme->tv3d.bone_pose, 80, 200, 255, 80); // alpha 80 is not meant editable, used for wire+action draw diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 19288bae2a2..8315ee740cd 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -357,7 +357,6 @@ static int draw_fcurve_handles_check(SpaceIpo *sipo, FCurve *fcu) * note: draw_fcurve_handles_check must be checked before running this. */ static void draw_fcurve_handles (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, FCurve *fcu) { - extern unsigned int nurbcol[]; int sel, b; /* a single call to GL_LINES here around these calls should be sufficient to still @@ -371,8 +370,9 @@ static void draw_fcurve_handles (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, */ for (sel= 0; sel < 2; sel++) { BezTriple *bezt=fcu->bezt, *prevbezt=NULL; - unsigned int *col= (sel)? (nurbcol+4) : (nurbcol); + int basecol= (sel)? TH_HANDLE_SEL_FREE : TH_HANDLE_FREE; float *fp; + char col[4]; /* if only selected keyframes have handles shown, skip the first round */ if ((sel == 0) && (sipo->flag & SIPO_SELVHANDLESONLY)) @@ -390,19 +390,24 @@ static void draw_fcurve_handles (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, /* draw handle with appropriate set of colors if selection is ok */ if ((bezt->f2 & SELECT)==sel) { fp= bezt->vec[0]; - + /* only draw first handle if previous segment had handles */ if ( (!prevbezt && (bezt->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ)) ) { - cpackA(col[(unsigned char)bezt->h1], drawFCurveFade(fcu)); + UI_GetThemeColor3ubv(basecol + bezt->h1, col); + col[3]= drawFCurveFade(fcu) * 255; + glColor4ubv((GLubyte *)col); glVertex2fv(fp); glVertex2fv(fp+3); } - + /* only draw second handle if this segment is bezier */ if (bezt->ipo == BEZT_IPO_BEZ) { - cpackA(col[(unsigned char)bezt->h2], drawFCurveFade(fcu)); + UI_GetThemeColor3ubv(basecol + bezt->h2, col); + col[3]= drawFCurveFade(fcu) * 255; + glColor4ubv((GLubyte *)col); + glVertex2fv(fp+3); glVertex2fv(fp+6); } } @@ -412,8 +417,10 @@ static void draw_fcurve_handles (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, ( (!prevbezt && (bezt->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ)) ) ) { fp= bezt->vec[0]; - cpackA(col[(unsigned char)bezt->h1], drawFCurveFade(fcu)); - + UI_GetThemeColor3ubv(basecol + bezt->h1, col); + col[3]= drawFCurveFade(fcu) * 255; + glColor4ubv((GLubyte *)col); + glVertex2fv(fp); glVertex2fv(fp+3); } @@ -422,8 +429,10 @@ static void draw_fcurve_handles (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, (bezt->ipo == BEZT_IPO_BEZ) ) { fp= bezt->vec[1]; - cpackA(col[(unsigned char)bezt->h2], drawFCurveFade(fcu)); - + UI_GetThemeColor3ubv(basecol + bezt->h2, col); + col[3]= drawFCurveFade(fcu) * 255; + glColor4ubv((GLubyte *)col); + glVertex2fv(fp); glVertex2fv(fp+3); } } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 09cbdd0c221..ea56cf25660 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2854,8 +2854,7 @@ static void drawDispListsolid(ListBase *lb, Object *ob, int glsl) case DL_POLY: if(ob->type==OB_SURF) { int nr; - - UI_ThemeColor(TH_WIRE); + glDisable(GL_LIGHTING); /* for some reason glDrawArrays crashes here in half of the platforms (not osx) */ @@ -4254,23 +4253,21 @@ static void ob_draw_RE_motion(float com[3],float rotscale[3][3],float itw,float } /*place to add drawers */ -unsigned int nurbcol[8]= { - 0, 0x9090, 0x409030, 0x603080, 0, 0x40fff0, 0x40c033, 0xA090F0 }; static void tekenhandlesN(Nurb *nu, short sel, short hide_handles) { BezTriple *bezt; float *fp; - unsigned int *col; + int basecol; int a; if(nu->hide || hide_handles) return; - + glBegin(GL_LINES); if(nu->type == CU_BEZIER) { - if(sel) col= nurbcol+4; - else col= nurbcol; + if(sel) basecol= TH_HANDLE_SEL_FREE; + else basecol= TH_HANDLE_FREE; bezt= nu->bezt; a= nu->pntsu; @@ -4278,26 +4275,26 @@ static void tekenhandlesN(Nurb *nu, short sel, short hide_handles) if(bezt->hide==0) { if( (bezt->f2 & SELECT)==sel) { fp= bezt->vec[0]; - - cpack(col[(int)bezt->h1]); + + UI_ThemeColor(basecol + bezt->h1); glVertex3fv(fp); glVertex3fv(fp+3); - cpack(col[(int)bezt->h2]); + UI_ThemeColor(basecol + bezt->h2); glVertex3fv(fp+3); glVertex3fv(fp+6); } else if( (bezt->f1 & SELECT)==sel) { fp= bezt->vec[0]; - - cpack(col[(int)bezt->h1]); + + UI_ThemeColor(basecol + bezt->h1); glVertex3fv(fp); glVertex3fv(fp+3); } else if( (bezt->f3 & SELECT)==sel) { fp= bezt->vec[1]; - - cpack(col[(int)bezt->h2]); + + UI_ThemeColor(basecol + bezt->h2); glVertex3fv(fp); glVertex3fv(fp+3); } @@ -4308,6 +4305,41 @@ static void tekenhandlesN(Nurb *nu, short sel, short hide_handles) glEnd(); } +static void tekenhandlesN_active(Nurb *nu) +{ + BezTriple *bezt; + float *fp; + int a; + + if(nu->hide) return; + + UI_ThemeColor(TH_ACTIVE_SPLINE); + glLineWidth(2); + + glBegin(GL_LINES); + + if(nu->type == CU_BEZIER) { + bezt= nu->bezt; + a= nu->pntsu; + while(a--) { + if(bezt->hide==0) { + fp= bezt->vec[0]; + + glVertex3fv(fp); + glVertex3fv(fp+3); + + glVertex3fv(fp+3); + glVertex3fv(fp+6); + } + bezt++; + } + } + glEnd(); + + glColor3ub(0,0,0); + glLineWidth(1); +} + static void tekenvertsN(Nurb *nu, short sel, short hide_handles) { BezTriple *bezt; @@ -4357,18 +4389,94 @@ static void tekenvertsN(Nurb *nu, short sel, short hide_handles) glPointSize(1.0); } +static void editnurb_draw_active_poly(Nurb *nu) +{ + BPoint *bp; + int a, b; + + UI_ThemeColor(TH_ACTIVE_SPLINE); + glLineWidth(2); + + bp= nu->bp; + for(b=0; bpntsv; b++) { + if(nu->flagu & 1) glBegin(GL_LINE_LOOP); + else glBegin(GL_LINE_STRIP); + + for(a=0; apntsu; a++, bp++) { + glVertex3fv(bp->vec); + } + + glEnd(); + } + + glColor3ub(0,0,0); + glLineWidth(1); +} + +static void editnurb_draw_active_nurbs(Nurb *nu) +{ + BPoint *bp, *bp1; + int a, b, ofs; + + UI_ThemeColor(TH_ACTIVE_SPLINE); + glLineWidth(2); + + glBegin(GL_LINES); + bp= nu->bp; + for(b=0; bpntsv; b++) { + bp1= bp; + bp++; + + for(a=nu->pntsu-1; a>0; a--, bp++) { + if(bp->hide==0 && bp1->hide==0) { + glVertex3fv(bp->vec); + glVertex3fv(bp1->vec); + } + bp1= bp; + } + } + + if(nu->pntsv > 1) { /* surface */ + + ofs= nu->pntsu; + for(b=0; bpntsu; b++) { + bp1= nu->bp+b; + bp= bp1+ofs; + for(a=nu->pntsv-1; a>0; a--, bp+=ofs) { + if(bp->hide==0 && bp1->hide==0) { + glVertex3fv(bp->vec); + glVertex3fv(bp1->vec); + } + bp1= bp; + } + } + } + + glEnd(); + + glColor3ub(0,0,0); + glLineWidth(1); +} + static void draw_editnurb(Object *ob, Nurb *nurb, int sel) { Nurb *nu; BPoint *bp, *bp1; - int a, b, ofs; - + int a, b, ofs, index; + Curve *cu= (Curve*)ob->data; + + index= 0; nu= nurb; while(nu) { if(nu->hide==0) { switch(nu->type) { case CU_POLY: - cpack(nurbcol[3]); + if (!sel && index== cu->actnu) { + /* we should draw active spline highlight below everything */ + editnurb_draw_active_poly(nu); + } + + UI_ThemeColor(TH_NURB_ULINE); bp= nu->bp; for(b=0; bpntsv; b++) { if(nu->flagu & 1) glBegin(GL_LINE_LOOP); @@ -4382,6 +4490,10 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel) } break; case CU_NURBS: + if (!sel && index== cu->actnu) { + /* we should draw active spline highlight below everything */ + editnurb_draw_active_nurbs(nu); + } bp= nu->bp; for(b=0; bpntsv; b++) { @@ -4391,7 +4503,7 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel) if(bp->hide==0 && bp1->hide==0) { if(sel) { if( (bp->f1 & SELECT) && ( bp1->f1 & SELECT ) ) { - cpack(nurbcol[5]); + UI_ThemeColor(TH_NURB_SEL_ULINE); glBegin(GL_LINE_STRIP); glVertex3fv(bp->vec); @@ -4402,7 +4514,7 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel) else { if( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) ); else { - cpack(nurbcol[1]); + UI_ThemeColor(TH_NURB_ULINE); glBegin(GL_LINE_STRIP); glVertex3fv(bp->vec); @@ -4424,7 +4536,7 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel) if(bp->hide==0 && bp1->hide==0) { if(sel) { if( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) ) { - cpack(nurbcol[7]); + UI_ThemeColor(TH_NURB_SEL_VLINE); glBegin(GL_LINE_STRIP); glVertex3fv(bp->vec); @@ -4435,7 +4547,7 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel) else { if( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) ); else { - cpack(nurbcol[3]); + UI_ThemeColor(TH_NURB_VLINE); glBegin(GL_LINE_STRIP); glVertex3fv(bp->vec); @@ -4452,6 +4564,8 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel) break; } } + + ++index; nu= nu->next; } } @@ -4464,6 +4578,7 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, Nurb *nu; BevList *bl; short hide_handles = (cu->drawflag & CU_HIDE_HANDLES); + int index; // XXX retopo_matrix_update(v3d); @@ -4473,11 +4588,15 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, if(v3d->zbuf) glDisable(GL_DEPTH_TEST); - /* first non-selected handles */ + /* first non-selected and active handles */ + index= 0; for(nu=nurb; nu; nu=nu->next) { if(nu->type == CU_BEZIER) { + if (index == cu->actnu && !hide_handles) + tekenhandlesN_active(nu); tekenhandlesN(nu, 0, hide_handles); } + ++index; } draw_editnurb(ob, nurb, 0); draw_editnurb(ob, nurb, 1); diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 24d7837b6ed..8f155019e57 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -200,6 +200,10 @@ typedef struct ThemeSpace { char bone_solid[4], bone_pose[4]; char strip[4], strip_select[4]; char cframe[4]; + char nurb_uline[4], nurb_vline[4]; + char act_spline[4], nurb_sel_uline[4], nurb_sel_vline[4]; + char handle_free[4], handle_auto[4], handle_vect[4], handle_align[4]; + char handle_sel_free[4], handle_sel_auto[4], handle_sel_vect[4], handle_sel_align[4]; char ds_channel[4], ds_subchannel[4]; // dopesheet char console_output[4], console_input[4], console_info[4], console_error[4]; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 7fd15e0e136..39619e42e7e 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -715,6 +715,89 @@ static void rna_def_userdef_theme_spaces_face(StructRNA *srna) RNA_def_property_update(prop, 0, "rna_userdef_update"); } +static void rna_def_userdef_theme_spaces_curves(StructRNA *srna) +{ + PropertyRNA *prop; + + prop= RNA_def_property(srna, "nurb_uline", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "nurb_uline"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Nurb U-lines", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "nurb_vline", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "nurb_vline"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Nurb V-lines", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "nurb_sel_uline", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "nurb_sel_uline"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Nurb active U-lines", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "nurb_sel_vline", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "nurb_sel_vline"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Nurb active V-lines", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "act_spline", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "act_spline"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Active spline", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "handle_free", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "handle_free"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Free handle color", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "handle_auto", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "handle_auto"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Auto handle color", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "handle_vect", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "handle_vect"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Vector handle color", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "handle_align", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "handle_align"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Align handle color", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "handle_sel_free", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "handle_sel_free"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Free handle selected color", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "handle_sel_auto", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "handle_sel_auto"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Auto handle selected color", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "handle_sel_vect", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "handle_sel_vect"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Vector handle selected color", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "handle_sel_align", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "handle_sel_align"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Align handle selected color", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); +} + static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) { StructRNA *srna; @@ -780,6 +863,7 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) rna_def_userdef_theme_spaces_vertex(srna); rna_def_userdef_theme_spaces_edge(srna); rna_def_userdef_theme_spaces_face(srna); + rna_def_userdef_theme_spaces_curves(srna); prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); From a44f9a6df45ee0c363a0110b0de9b7c3ef437ae0 Mon Sep 17 00:00:00 2001 From: Arystanbek Dyussenov Date: Fri, 12 Mar 2010 16:50:52 +0000 Subject: [PATCH 017/153] Fix #21224, "FBX export has object translation issues". Reversed the order of all matrix multiplications to confirm to API change. --- release/scripts/io/export_fbx.py | 60 ++++++++++++++++---------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/release/scripts/io/export_fbx.py b/release/scripts/io/export_fbx.py index 9f91b66c216..bc1a0b82d85 100644 --- a/release/scripts/io/export_fbx.py +++ b/release/scripts/io/export_fbx.py @@ -545,10 +545,10 @@ def write(filename, batch_objects = None, \ #arm_mat = self.fbxArm.parRelMatrix() if not self.parent: #return mtx4_z90 * (self.getPoseMatrix(frame) * arm_mat) # dont apply arm matrix anymore - return mtx4_z90 * self.getPoseMatrix(frame) + return self.getPoseMatrix(frame) * mtx4_z90 else: #return (mtx4_z90 * ((self.getPoseMatrix(frame) * arm_mat))) * (mtx4_z90 * (self.parent.getPoseMatrix(frame) * arm_mat)).invert() - return (mtx4_z90 * (self.getPoseMatrix(frame))) * (mtx4_z90 * self.parent.getPoseMatrix(frame)).invert() + return (self.parent.getPoseMatrix(frame) * mtx4_z90).invert() * ((self.getPoseMatrix(frame)) * mtx4_z90) # we need thes because cameras and lights modified rotations def getAnimParRelMatrixRot(self, frame): @@ -565,14 +565,14 @@ def write(filename, batch_objects = None, \ self.blenObject = ob self.fbxGroupNames = [] self.fbxParent = None # set later on IF the parent is in the selection. - if matrixWorld: self.matrixWorld = matrixWorld * GLOBAL_MATRIX - else: self.matrixWorld = ob.matrix * GLOBAL_MATRIX + if matrixWorld: self.matrixWorld = GLOBAL_MATRIX * matrixWorld + else: self.matrixWorld = GLOBAL_MATRIX * ob.matrix # else: self.matrixWorld = ob.matrixWorld * GLOBAL_MATRIX self.__anim_poselist = {} # we should only access this def parRelMatrix(self): if self.fbxParent: - return self.matrixWorld * self.fbxParent.matrixWorld.copy().invert() + return self.fbxParent.matrixWorld.copy().invert() * self.matrixWorld else: return self.matrixWorld @@ -583,24 +583,24 @@ def write(filename, batch_objects = None, \ def getAnimParRelMatrix(self, frame): if self.fbxParent: #return (self.__anim_poselist[frame] * self.fbxParent.__anim_poselist[frame].copy().invert() ) * GLOBAL_MATRIX - return (self.__anim_poselist[frame] * GLOBAL_MATRIX) * (self.fbxParent.__anim_poselist[frame] * GLOBAL_MATRIX).invert() + return (GLOBAL_MATRIX * self.fbxParent.__anim_poselist[frame]).invert() * (GLOBAL_MATRIX * self.__anim_poselist[frame]) else: - return self.__anim_poselist[frame] * GLOBAL_MATRIX + return GLOBAL_MATRIX * self.__anim_poselist[frame] def getAnimParRelMatrixRot(self, frame): type = self.blenObject.type if self.fbxParent: - matrix_rot = (((self.__anim_poselist[frame] * GLOBAL_MATRIX) * (self.fbxParent.__anim_poselist[frame] * GLOBAL_MATRIX).invert())).rotation_part() + matrix_rot = ((GLOBAL_MATRIX * self.fbxParent.__anim_poselist[frame]).invert() * (GLOBAL_MATRIX * self.__anim_poselist[frame])).rotation_part() else: - matrix_rot = (self.__anim_poselist[frame] * GLOBAL_MATRIX).rotation_part() + matrix_rot = (GLOBAL_MATRIX * self.__anim_poselist[frame]).rotation_part() # Lamps need to be rotated if type =='LAMP': - matrix_rot = mtx_x90 * matrix_rot + matrix_rot = matrix_rot * mtx_x90 elif type =='CAMERA': # elif ob and type =='Camera': - y = Mathutils.Vector(0,1,0) * matrix_rot - matrix_rot = matrix_rot * Mathutils.RotationMatrix(math.pi/2, 3, y) + y = matrix_rot * Mathutils.Vector(0,1,0) + matrix_rot = Mathutils.RotationMatrix(math.pi/2, 3, y) * matrix_rot return matrix_rot @@ -666,15 +666,15 @@ def write(filename, batch_objects = None, \ # we know we have a matrix # matrix = mtx4_z90 * (ob.matrix['ARMATURESPACE'] * matrix_mod) - matrix = mtx4_z90 * ob.matrix_local # dont apply armature matrix anymore + matrix = ob.matrix_local * mtx4_z90 # dont apply armature matrix anymore # matrix = mtx4_z90 * ob.matrix['ARMATURESPACE'] # dont apply armature matrix anymore parent = ob.parent if parent: #par_matrix = mtx4_z90 * (parent.matrix['ARMATURESPACE'] * matrix_mod) - par_matrix = mtx4_z90 * parent.matrix_local # dont apply armature matrix anymore + par_matrix = parent.matrix_local * mtx4_z90 # dont apply armature matrix anymore # par_matrix = mtx4_z90 * parent.matrix['ARMATURESPACE'] # dont apply armature matrix anymore - matrix = matrix * par_matrix.copy().invert() + matrix = par_matrix.copy().invert() * matrix matrix_rot = matrix.rotation_part() @@ -698,11 +698,11 @@ def write(filename, batch_objects = None, \ matrix_rot = matrix.rotation_part() # Lamps need to be rotated if ob and ob.type =='Lamp': - matrix_rot = mtx_x90 * matrix_rot + matrix_rot = matrix_rot * mtx_x90 rot = tuple(matrix_rot.to_euler()) elif ob and ob.type =='Camera': - y = Mathutils.Vector(0,1,0) * matrix_rot - matrix_rot = matrix_rot * Mathutils.RotationMatrix(math.pi/2, 3, y) + y = matrix_rot * Mathutils.Vector(0,1,0) + matrix_rot = Mathutils.RotationMatrix(math.pi/2, 3, y) * matrix_rot rot = tuple(matrix_rot.to_euler()) else: rot = tuple(matrix_rot.to_euler()) @@ -1087,8 +1087,8 @@ def write(filename, batch_objects = None, \ file.write('\n\t\tTypeFlags: "Camera"') file.write('\n\t\tGeometryVersion: 124') file.write('\n\t\tPosition: %.6f,%.6f,%.6f' % loc) - file.write('\n\t\tUp: %.6f,%.6f,%.6f' % tuple(Mathutils.Vector(0,1,0) * matrix_rot) ) - file.write('\n\t\tLookAt: %.6f,%.6f,%.6f' % tuple(Mathutils.Vector(0,0,-1)*matrix_rot) ) + file.write('\n\t\tUp: %.6f,%.6f,%.6f' % tuple(matrix_rot * Mathutils.Vector(0,1,0)) ) + file.write('\n\t\tLookAt: %.6f,%.6f,%.6f' % tuple(matrix_rot * Mathutils.Vector(0,0,-1)) ) #file.write('\n\t\tUp: 0,0,0' ) #file.write('\n\t\tLookAt: 0,0,0' ) @@ -1485,10 +1485,10 @@ def write(filename, batch_objects = None, \ if my_mesh.fbxParent: # TODO FIXME, this case is broken in some cases. skinned meshes just shouldnt have parents where possible! - m = mtx4_z90 * (my_bone.restMatrix * my_bone.fbxArm.matrixWorld.copy() * my_mesh.matrixWorld.copy().invert() ) + m = (my_mesh.matrixWorld.copy().invert() * my_bone.fbxArm.matrixWorld.copy() * my_bone.restMatrix) * mtx4_z90 else: # Yes! this is it... - but dosnt work when the mesh is a. - m = mtx4_z90 * (my_bone.restMatrix * my_bone.fbxArm.matrixWorld.copy() * my_mesh.matrixWorld.copy().invert() ) + m = (my_mesh.matrixWorld.copy().invert() * my_bone.fbxArm.matrixWorld.copy() * my_bone.restMatrix) * mtx4_z90 #m = mtx4_z90 * my_bone.restMatrix matstr = mat4x4str(m) @@ -2812,7 +2812,7 @@ Takes: {''') # Set the action active for my_bone in ob_arms: if blenAction in my_bone.blenActionList: - ob.action = blenAction + ob.animation_data.action = blenAction # print '\t\tSetting Action!', blenAction # scene.update(1) @@ -2969,7 +2969,7 @@ Takes: {''') # end action loop. set original actions # do this after every loop incase actions effect eachother. for my_bone in ob_arms: - my_bone.blenObject.action = my_bone.blenAction + my_bone.blenObject.animation_data.action = my_bone.blenAction file.write('\n}') @@ -3150,9 +3150,9 @@ def fbx_ui_write(filename, context): # Make the matrix GLOBAL_MATRIX = mtx4_identity GLOBAL_MATRIX[0][0] = GLOBAL_MATRIX[1][1] = GLOBAL_MATRIX[2][2] = GLOBALS['_SCALE'].val - if GLOBALS['_XROT90'].val: GLOBAL_MATRIX = GLOBAL_MATRIX * mtx4_x90n - if GLOBALS['_YROT90'].val: GLOBAL_MATRIX = GLOBAL_MATRIX * mtx4_y90n - if GLOBALS['_ZROT90'].val: GLOBAL_MATRIX = GLOBAL_MATRIX * mtx4_z90n + if GLOBALS['_XROT90'].val: GLOBAL_MATRIX = mtx4_x90n * GLOBAL_MATRIX + if GLOBALS['_YROT90'].val: GLOBAL_MATRIX = mtx4_y90n * GLOBAL_MATRIX + if GLOBALS['_ZROT90'].val: GLOBAL_MATRIX = mtx4_z90n * GLOBAL_MATRIX ret = write(\ filename, None,\ @@ -3403,9 +3403,9 @@ class ExportFBX(bpy.types.Operator): GLOBAL_MATRIX = mtx4_identity GLOBAL_MATRIX[0][0] = GLOBAL_MATRIX[1][1] = GLOBAL_MATRIX[2][2] = self.properties.TX_SCALE - if self.properties.TX_XROT90: GLOBAL_MATRIX = GLOBAL_MATRIX * mtx4_x90n - if self.properties.TX_YROT90: GLOBAL_MATRIX = GLOBAL_MATRIX * mtx4_y90n - if self.properties.TX_ZROT90: GLOBAL_MATRIX = GLOBAL_MATRIX * mtx4_z90n + if self.properties.TX_XROT90: GLOBAL_MATRIX = mtx4_x90n * GLOBAL_MATRIX + if self.properties.TX_YROT90: GLOBAL_MATRIX = mtx4_y90n * GLOBAL_MATRIX + if self.properties.TX_ZROT90: GLOBAL_MATRIX = mtx4_z90n * GLOBAL_MATRIX write(self.properties.path, None, # XXX From 8c9577e2ee357df4eeb5bcc5e4e362ff57c9fc00 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 12 Mar 2010 16:51:12 +0000 Subject: [PATCH 018/153] Fix #20551: sculpt mode, render and then sculpt crash. --- source/blender/editors/sculpt_paint/sculpt.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index b20394ae938..d2c4e386fe7 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -193,12 +193,18 @@ static void projectf(bglMats *mats, const float v[3], float p[2]) int sculpt_get_redraw_rect(ARegion *ar, RegionView3D *rv3d, Object *ob, rcti *rect) { + /* can't use ob->sculpt->tree, only valid during sculpt */ + DerivedMesh *dm= ob->derivedFinal; + PBVH *tree= (dm)? dm->getPBVH(ob, dm): NULL; float bb_min[3], bb_max[3], pmat[4][4]; int i, j, k; view3d_get_object_project_mat(rv3d, ob, pmat); - BLI_pbvh_redraw_BB(ob->sculpt->tree, bb_min, bb_max); + if(!tree) + return 0; + + BLI_pbvh_redraw_BB(tree, bb_min, bb_max); rect->xmin = rect->ymin = INT_MAX; rect->xmax = rect->ymax = INT_MIN; @@ -228,6 +234,8 @@ int sculpt_get_redraw_rect(ARegion *ar, RegionView3D *rv3d, void sculpt_get_redraw_planes(float planes[4][4], ARegion *ar, RegionView3D *rv3d, Object *ob) { + DerivedMesh *dm= ob->derivedFinal; + PBVH *tree= (dm)? dm->getPBVH(ob, dm): NULL; BoundBox *bb = MEM_callocN(sizeof(BoundBox), "sculpt boundbox"); bglMats mats; rcti rect; @@ -256,7 +264,8 @@ void sculpt_get_redraw_planes(float planes[4][4], ARegion *ar, MEM_freeN(bb); /* clear redraw flag from nodes */ - BLI_pbvh_update(ob->sculpt->tree, PBVH_UpdateRedraw, NULL); + if(tree) + BLI_pbvh_update(tree, PBVH_UpdateRedraw, NULL); } /************************** Undo *************************/ From 0249d26ca790b9b5a44c83313b0d2afb42931f3f Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 12 Mar 2010 17:12:04 +0000 Subject: [PATCH 019/153] Fix #21042: sculpt not working from orthographic camera view. --- source/blender/editors/space_view3d/view3d_view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index be974cf0050..38a7163d35f 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -540,7 +540,7 @@ void viewline(ARegion *ar, View3D *v3d, float mval[2], float ray_start[3], float float vec[4]; int a; - if(rv3d->persp != RV3D_ORTHO){ + if(!get_view3d_ortho(v3d, rv3d)) { vec[0]= 2.0f * mval[0] / ar->winx - 1; vec[1]= 2.0f * mval[1] / ar->winy - 1; vec[2]= -1.0f; From 85066b5e05c0a770db357b67682431f357c05ad4 Mon Sep 17 00:00:00 2001 From: Robert Holcomb Date: Fri, 12 Mar 2010 18:47:35 +0000 Subject: [PATCH 020/153] updated despill node to incorperate changes from Xavier Thomas's patch #18012 --- source/blender/editors/space_node/drawnode.c | 22 ++- source/blender/makesdna/DNA_node_types.h | 8 +- source/blender/makesrna/intern/rna_nodetree.c | 62 +++++- .../nodes/intern/CMP_nodes/CMP_colorSpill.c | 180 +++++++++++++++--- 4 files changed, 230 insertions(+), 42 deletions(-) diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index a110e7a5c4b..16bf52db80f 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -803,10 +803,26 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *C, Pointe { uiLayout *row, *col; - col =uiLayoutColumn(layout, 0); - uiItemR(col, NULL, 0, ptr, "factor", 0); - row= uiLayoutRow(col, 0); + uiItemL(layout, "Despill Channel:", 0); + row =uiLayoutRow(layout,0); uiItemR(row, NULL, 0, ptr, "channel", UI_ITEM_R_EXPAND); + + col= uiLayoutColumn(layout, 0); + uiItemR(col, NULL, 0, ptr, "algorithm", 0); + + if(RNA_enum_get(ptr, "algorithm")==0) { + uiItemL(col, "Limiting Channel:", 0); + row=uiLayoutRow(col,0); + uiItemR(row, NULL, 0, ptr, "limit_channel", UI_ITEM_R_EXPAND); + } + + uiItemR(col, NULL, 0, ptr, "ratio", UI_ITEM_R_SLIDER); + uiItemR(col, NULL, 0, ptr, "unspill", 0); + if (RNA_enum_get(ptr, "unspill")== 1) { + uiItemR(col, NULL, 0, ptr, "unspill_red", UI_ITEM_R_SLIDER); + uiItemR(col, NULL, 0, ptr, "unspill_green", UI_ITEM_R_SLIDER); + uiItemR(col, NULL, 0, ptr, "unspill_blue", UI_ITEM_R_SLIDER); + } } static void node_composit_buts_chroma_matte(uiLayout *layout, bContext *C, PointerRNA *ptr) diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 4dd089949e9..c178176048a 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -22,7 +22,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Bob Holcomb, Xavier Thomas * * ***** END GPL LICENSE BLOCK ***** */ @@ -312,6 +312,12 @@ typedef struct NodeColorBalance { float gain[3]; } NodeColorBalance; +typedef struct NodeColorspill { + short limchan, unspill; + float limscale; + float uspillr, uspillg, uspillb; +}NodeColorspill; + /* TEX_output */ typedef struct TexNodeOutput { char name[32]; diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index d8c5c796fa3..c8b78b38b9a 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * Contributor(s): Blender Foundation (2008), Nathan Letwory, Robin Allen + * Contributor(s): Blender Foundation (2008), Nathan Letwory, Robin Allen, Bob Holcomb * * ***** END GPL LICENSE BLOCK ***** */ @@ -1287,12 +1287,23 @@ static void def_cmp_distance_matte(StructRNA *srna) static void def_cmp_color_spill(StructRNA *srna) { PropertyRNA *prop; - + static EnumPropertyItem channel_items[] = { {1, "R", 0, "R", "Red Spill Suppression"}, {2, "G", 0, "G", "Green Spill Suppression"}, {3, "B", 0, "B", "Blue Spill Suppression"}, {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem limit_channel_items[] = { + {1, "R", 0, "R", "Limit by Red"}, + {2, "G", 0, "G", "Limit by Green"}, + {3, "B", 0, "B", "Limit by Blue"}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem algorithm_items[] = { + {0, "SIMPLE", 0, "Simple", "Simple Limit Algorithm"}, + {1, "AVERAGE", 0, "Average", "Average Limit Algorithm"}, + {0, NULL, 0, NULL, NULL}}; prop = RNA_def_property(srna, "channel", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); @@ -1300,12 +1311,47 @@ static void def_cmp_color_spill(StructRNA *srna) RNA_def_property_ui_text(prop, "Channel", ""); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - RNA_def_struct_sdna_from(srna, "NodeChroma", "storage"); - - prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "t1"); - RNA_def_property_range(prop, 0.0f, 0.5f); - RNA_def_property_ui_text(prop, "Amount", "How much the selected channel is affected by"); + prop = RNA_def_property(srna, "algorithm", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom2"); + RNA_def_property_enum_items(prop, algorithm_items); + RNA_def_property_ui_text(prop, "Algorithm", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + RNA_def_struct_sdna_from(srna, "NodeColorspill", "storage"); + + prop = RNA_def_property(srna, "limit_channel", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "limchan"); + RNA_def_property_enum_items(prop, limit_channel_items); + RNA_def_property_ui_text(prop, "Limit Channel", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "ratio", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "limscale"); + RNA_def_property_range(prop, 0.5f, 1.5f); + RNA_def_property_ui_text(prop, "Ratio", "Scale limit by value"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "unspill", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "unspill", 0); + RNA_def_property_ui_text(prop, "Unspill", "Compensate all channels (diffenrently) by hand"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "unspill_red", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "uspillr"); + RNA_def_property_range(prop, 0.0f, 1.5f); + RNA_def_property_ui_text(prop, "R", "Red spillmap scale"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "unspill_green", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "uspillg"); + RNA_def_property_range(prop, 0.0f, 1.5f); + RNA_def_property_ui_text(prop, "G", "Green spillmap scale"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "unspill_blue", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "uspillb"); + RNA_def_property_range(prop, 0.0f, 1.5f); + RNA_def_property_ui_text(prop, "B", "Blue spillmap scale"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); } diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c b/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c index 5fcbcd0b854..23a5b719e5b 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c @@ -22,7 +22,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Bob Holcomb, Xavier Thomas * * ***** END GPL LICENSE BLOCK ***** */ @@ -30,6 +30,7 @@ #include "../CMP_util.h" +#define avg(a,b) ((a+b)/2) /* ******************* Color Spill Supression ********************************* */ static bNodeSocketType cmp_node_color_spill_in[]={ @@ -42,33 +43,93 @@ static bNodeSocketType cmp_node_color_spill_out[]={ {-1,0,""} }; -static void do_reduce_red(bNode *node, float* out, float *in) +static void do_simple_spillmap_red(bNode *node, float* out, float *in) { - NodeChroma *c; - c=node->storage; - - if(in[0] > in[1] && in[0] > in[2]) { - out[0]=((in[1]+in[2])/2)*(1-c->t1); + NodeColorspill *ncs; + ncs=node->storage; + out[0]=in[0]-( ncs->limscale * in[ncs->limchan] ); +} + +static void do_simple_spillmap_green(bNode *node, float* out, float *in) +{ + NodeColorspill *ncs; + ncs=node->storage; + out[0]=in[1]-( ncs->limscale * in[ncs->limchan] ); +} + +static void do_simple_spillmap_blue(bNode *node, float* out, float *in) +{ + NodeColorspill *ncs; + ncs=node->storage; + out[0]=in[2]-( ncs->limscale * in[ncs->limchan] ); +} + +static void do_average_spillmap_red(bNode *node, float* out, float *in) +{ + NodeColorspill *ncs; + ncs=node->storage; + out[0]=in[0]-(ncs->limscale * avg(in[1], in[2]) ); +} + +static void do_average_spillmap_green(bNode *node, float* out, float *in) +{ + NodeColorspill *ncs; + ncs=node->storage; + out[0]=in[1]-(ncs->limscale * avg(in[0], in[2]) ); +} + +static void do_average_spillmap_blue(bNode *node, float* out, float *in) +{ + NodeColorspill *ncs; + ncs=node->storage; + out[0]=in[2]-(ncs->limscale * avg(in[0], in[1]) ); +} + +static void do_apply_spillmap_red(bNode *node, float* out, float *in, float *map) +{ + NodeColorspill *ncs; + ncs=node->storage; + if(map[0]>0) { + out[0]=in[0]-(ncs->uspillr*map[0]); + out[1]=in[1]+(ncs->uspillg*map[0]); + out[2]=in[2]+(ncs->uspillb*map[0]); + } + else { + out[0]=in[0]; + out[1]=in[1]; + out[2]=in[2]; } } -static void do_reduce_green(bNode *node, float* out, float *in) +static void do_apply_spillmap_green(bNode *node, float* out, float *in, float *map) { - NodeChroma *c; - c=node->storage; - - if(in[1] > in[0] && in[1] > in[2]) { - out[1]=((in[0]+in[2])/2)*(1-c->t1); + NodeColorspill *ncs; + ncs=node->storage; + if(map[0]>0) { + out[0]=in[0]+(ncs->uspillr*map[0]); + out[1]=in[1]-(ncs->uspillg*map[0]); + out[2]=in[2]+(ncs->uspillb*map[0]); + } + else { + out[0]=in[0]; + out[1]=in[1]; + out[2]=in[2]; } } -static void do_reduce_blue(bNode *node, float* out, float *in) +static void do_apply_spillmap_blue(bNode *node, float* out, float *in, float *map) { - NodeChroma *c; - c=node->storage; - - if(in[2] > in[1] && in[2] > in[1]) { - out[2]=((in[1]+in[0])/2)*(1-c->t1); + NodeColorspill *ncs; + ncs=node->storage; + if(map[0]>0) { + out[0]=in[0]+(ncs->uspillr*map[0]); + out[1]=in[1]+(ncs->uspillg*map[0]); + out[2]=in[2]-(ncs->uspillb*map[0]); + } + else { + out[0]=in[0]; + out[1]=in[1]; + out[2]=in[2]; } } @@ -79,28 +140,86 @@ static void node_composit_exec_color_spill(void *data, bNode *node, bNodeStack * discussions from vfxtalk.com.*/ CompBuf *cbuf; CompBuf *rgbbuf; + CompBuf *spillmap; + NodeColorspill *ncs; + ncs=node->storage; if(out[0]->hasoutput==0 || in[0]->hasinput==0) return; if(in[0]->data==NULL) return; cbuf=typecheck_compbuf(in[0]->data, CB_RGBA); + spillmap=alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); rgbbuf=dupalloc_compbuf(cbuf); switch(node->custom1) { case 1: /*red spill*/ { - composit1_pixel_processor(node, rgbbuf, cbuf, in[1]->vec, do_reduce_red, CB_RGBA); + switch(node->custom2) + { + case 0: /* simple limit */ + { + composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_simple_spillmap_red, CB_RGBA); + break; + } + case 1: /* average limit */ + { + composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_average_spillmap_red, CB_RGBA); + break; + } + } + if(ncs->unspill==0) { + ncs->uspillr=1.0f; + ncs->uspillg=0.0f; + ncs->uspillb=0.0f; + } + composit2_pixel_processor(node, rgbbuf, cbuf, in[0]->vec, spillmap, NULL, do_apply_spillmap_red, CB_RGBA, CB_VAL); break; } case 2: /*green spill*/ { - composit1_pixel_processor(node, rgbbuf, cbuf, in[1]->vec, do_reduce_green, CB_RGBA); + switch(node->custom2) + { + case 0: /* simple limit */ + { + composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_simple_spillmap_green, CB_RGBA); + break; + } + case 1: /* average limit */ + { + composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_average_spillmap_green, CB_RGBA); + break; + } + } + if(ncs->unspill==0) { + ncs->uspillr=0.0f; + ncs->uspillg=1.0f; + ncs->uspillb=0.0f; + } + composit2_pixel_processor(node, rgbbuf, cbuf, in[0]->vec, spillmap, NULL, do_apply_spillmap_green, CB_RGBA, CB_VAL); break; } case 3: /*blue spill*/ { - composit1_pixel_processor(node, rgbbuf, cbuf, in[1]->vec, do_reduce_blue, CB_RGBA); + switch(node->custom2) + { + case 0: /* simple limit */ + { + composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_simple_spillmap_blue, CB_RGBA); + break; + } + case 1: /* average limit */ + { + composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_average_spillmap_blue, CB_RGBA); + break; + } + } + if(ncs->unspill==0) { + ncs->uspillr=0.0f; + ncs->uspillg=0.0f; + ncs->uspillb=1.0f; + } + composit2_pixel_processor(node, rgbbuf, cbuf, in[0]->vec, spillmap, NULL, do_apply_spillmap_blue, CB_RGBA, CB_VAL); break; } default: @@ -111,18 +230,19 @@ static void node_composit_exec_color_spill(void *data, bNode *node, bNodeStack * if(cbuf!=in[0]->data) free_compbuf(cbuf); + + free_compbuf(spillmap); } static void node_composit_init_color_spill(bNode *node) { - NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma"); - node->storage=c; - c->t1= 0.0f; - c->t2= 0.0f; - c->t3= 0.0f; - c->fsize= 0.0f; - c->fstrength= 0.0f; + NodeColorspill *ncs= MEM_callocN(sizeof(NodeColorspill), "node colorspill"); + node->storage=ncs; node->custom1= 2; /* green channel */ + node->custom2= 0; /* simple limit algo*/ + ncs->limchan= 0; /* limit by red */ + ncs->limscale= 1.0f; /* limit scaling factor */ + ncs->unspill=0; /* do not use unspill */ } bNodeType cmp_node_color_spill={ @@ -133,7 +253,7 @@ bNodeType cmp_node_color_spill={ /* class+opts */ NODE_CLASS_MATTE, NODE_OPTIONS, /* input sock */ cmp_node_color_spill_in, /* output sock */ cmp_node_color_spill_out, - /* storage */ "NodeChroma", + /* storage */ "NodeColorspill", /* execfunc */ node_composit_exec_color_spill, /* butfunc */ NULL, /* initfunc */ node_composit_init_color_spill, From 843a932b4a56c67a40b98a347d13caa6cbe8cb12 Mon Sep 17 00:00:00 2001 From: Tom Musgrove Date: Fri, 12 Mar 2010 20:08:13 +0000 Subject: [PATCH 021/153] confirmed with multiple people that Collada builds fine with mingw win32 on scons. So setting it back to true by default. --- config/win32-mingw-config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/win32-mingw-config.py b/config/win32-mingw-config.py index b29ea74c152..9088db5a5d8 100644 --- a/config/win32-mingw-config.py +++ b/config/win32-mingw-config.py @@ -142,7 +142,7 @@ BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a' '${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a', '${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ] -WITH_BF_COLLADA = False +WITH_BF_COLLADA = True BF_COLLADA = '#source/blender/collada' BF_COLLADA_INC = '${BF_COLLADA}' BF_COLLADA_LIB = 'bf_collada' From a4de5e06af1de4d06400a3ef97627b1eb60f8dc5 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sat, 13 Mar 2010 00:14:36 +0000 Subject: [PATCH 022/153] Patch [#21539] Improved organization of add-ons panel by Bart Crouch (crouch), with some UI code cleanup by myself. This patch adds following features: - Filter Add-ons by a category. - Search Add-ons by Name and Author. - Possibility to expand an Add-on, displaying more information like author, version, description, etc. - Warns when a user wants to enable a script that was written for a newer version of blender --- release/scripts/ui/space_userpref.py | 229 +++++++++++++++++++++++++-- 1 file changed, 219 insertions(+), 10 deletions(-) diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 35bda77c1d8..9717169386a 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -1398,24 +1398,177 @@ class USERPREF_PT_addons(bpy.types.Panel): # del sys.path[0] return modules + + def _attributes(self, mod): + # collect, check and process all attributes of the add-on + module_name = mod.__name__ + if not hasattr(mod, 'expanded'): + mod.expanded = False + + script = hasattr(mod, '__script__') + author = hasattr(mod, '__author__') + version = hasattr(mod, '__version__') + blender = hasattr(mod, '__blender__') + category = hasattr(mod, '__category__') + url = hasattr(mod, '__url__') + email = hasattr(mod, '__email__') + bpydoc = hasattr(mod, '__bpydoc__') + + if script: + script = str(mod.__script__) + else: + script = module_name + if version: + version = str(mod.__version__) + if author: + if type(mod.__author__).__name__ == 'list': + if len(mod.__author__) == 0: + author = False + else: + author = "" + for i in mod.__author__: + author += str(i) + ", " + author = author[:-2] + else: + author = str(mod.__author__) + if blender: + blender = str(mod.__blender__) + if category: + if type(mod.__category__).__name__ != 'list': + category = str(mod.__category__) + else: + category = str(mod.__category__[0]) + links = [] + if url: + if type(mod.__url__).__name__ != 'list': + mod.__url__ = [str(mod.__url__)] + for i in mod.__url__: + link = str(i).rsplit(',', 1) + if len(link)>1: + link_desc = link[0].strip() + link = link[1].strip() + else: + link_desc = False + link = link[0].strip() + if link.lower() == 'blender': + link = 'http://www.blender.org/forum/viewforum.php?f=9' + if link.lower() == 'blenderartists': + link = 'http://blenderartists.org/forum/forumdisplay.php?f=11' + links.append([link, link_desc]) + emails = [] + if email: + if type(mod.__email__).__name__ != 'list': + mod.__email__ = [str(mod.__email__)] + for i in mod.__email__: + mail = str(i).rsplit(',', 1) + if len(mail)>1: + mail_desc = mail[0].strip() + mail = mail[1].strip() + else: + mail_desc = False + mail = mail[0].strip() + if mail.lower() == 'python': + mail = 'bf-python:blender*org' + mail = 'mailto:'+mail.replace(':','@').replace('*','.')+"?subject="+script + emails.append([mail, mail_desc]) + if bpydoc: + bpydoc = str(mod.__bpydoc__).splitlines() + return module_name, script, author, version, blender, category, url, email, bpydoc, links, emails def draw(self, context): layout = self.layout userpref = context.user_preferences used_ext = {ext.module for ext in userpref.addons} - - col = layout.column() - + + # collect the categories that can be filtered on + cats = [] for mod in self._addon_list(): - box = col.box() - row = box.row() - text = mod.__doc__ - if not text: - text = mod.__name__ - row.label(text=text) - module_name = mod.__name__ + try: + if mod.__category__[0] not in cats: + cats.append(mod.__category__[0]) + except: + pass + cats.sort() + cats = ['All', 'Disabled', 'Enabled']+cats + bpy.types.Scene.EnumProperty(items=[(cats[i],cats[i],str(i)) for i in range(len(cats))], + name="Category", attr="addon_filter", description="Filter add-ons by category") + bpy.types.Scene.StringProperty(name="Search", attr="addon_search", + description="Search within the selected filter") + + row = layout.row() + row.prop(context.scene, "addon_filter", text="Filter") + row.prop(context.scene, "addon_search", text="Search", icon='VIEWZOOM') + layout.separator() + + filter = context.scene.addon_filter + search = context.scene.addon_search + for mod in self._addon_list(): + module_name, script, author, version, blender, category, url, email, bpydoc, links, emails = \ + self._attributes(mod) + + # check if add-on should be visible with current filters + if filter!='All' and filter!=category and not (module_name in used_ext and filter=='Enabled')\ + and not (module_name not in used_ext and filter=='Disabled'): + continue + if search and script.lower().find(search.lower())<0: + if author: + if author.lower().find(search.lower())<0: + continue + else: + continue + + # Addon UI Code + box = layout.column().box() + column = box.column(align=True) + row = column.row() + + # Arrow # + # If there are Infos or UI is expanded + if mod.expanded: + row.operator("wm.addon_expand", icon="TRIA_DOWN").module = module_name + elif author or version or url or email: + row.operator("wm.addon_expand", icon="TRIA_RIGHT").module = module_name + else: + # Else, block UI + arrow = row.column() + arrow.enabled = False + arrow.operator("wm.addon_expand", icon="TRIA_RIGHT").module = module_name + + row.label(text=script) row.operator("wm.addon_disable" if module_name in used_ext else "wm.addon_enable").module = module_name + + # Expanded UI (only if additional infos are available) + if mod.expanded: + if author: + split = column.row().split(percentage=0.15) + split.label(text='Author:') + split.label(text=author) + if version: + split = column.row().split(percentage=0.15) + split.label(text='Version:') + split.label(text=version) + if url: + split = column.row().split(percentage=0.15) + split.label(text="Links:") + for i in range(len(links)): + if links[i][1]: + split.operator("wm.addon_links", text=links[i][1]).link = links[i][0] + else: + split.operator("wm.addon_links", text="Link "+str(i+1)).link = links[i][0] + if email: + split = column.row().split(percentage=0.15) + split.label(text="Email:") + for i in range(len(emails)): + if emails[i][1]: + split.operator("wm.addon_links", text=emails[i][1]).link = emails[i][0] + else: + split.operator("wm.addon_links", text="Email "+str(i+1)).link = emails[i][0] + if bpydoc: + column = box.column(align=True) + column.label(text='Description: '+bpydoc[0]) + for line in bpydoc[1:]: + column.label(text=line) from bpy.props import * @@ -1439,6 +1592,23 @@ class WM_OT_addon_enable(bpy.types.Operator): mod.register() except: traceback.print_exc() + + # check if add-on is written for current blender version, or raise a warning + version = hasattr(mod, '__blender__') + if version: + version = str(mod.__blender__).split('.',2) + for i in range(len(version)): + try: + version[i] = int(version[i]) + except: + break + if version[i]>bpy.app.version[i]: + self.report('WARNING','This script was written for a newer version of Blender \ +and might not function (correctly).\nThe script is enabled though.') + elif version[i]==bpy.app.version[i]: + continue + else: + break return {'FINISHED'} @@ -1535,6 +1705,43 @@ class WM_OT_addon_install(bpy.types.Operator): return {'RUNNING_MODAL'} +class WM_OT_addon_expand(bpy.types.Operator): + "Display more information on this add-on" + bl_idname = "wm.addon_expand" + bl_label = "" + + module = StringProperty(name="Module", description="Module name of the addon to expand") + + def execute(self, context): + import traceback + module_name = self.properties.module + + try: + mod = __import__(module_name) + except: + traceback.print_exc() + + if mod.expanded: + mod.expanded = False + else: + mod.expanded = True + + return {'FINISHED'} + + +class WM_OT_addon_links(bpy.types.Operator): + "Open in webbrowser" + bl_idname = "wm.addon_links" + bl_label = "" + + link = StringProperty(name="Link", description="Link to open") + + def execute(self, context): + import webbrowser + webbrowser.open(self.properties.link) + return {'FINISHED'} + + class WM_OT_keyconfig_test(bpy.types.Operator): "Test keyconfig for conflicts" bl_idname = "wm.keyconfig_test" @@ -1928,6 +2135,8 @@ classes = [ WM_OT_addon_enable, WM_OT_addon_disable, WM_OT_addon_install, + WM_OT_addon_expand, + WM_OT_addon_links, WM_OT_keyconfig_export, WM_OT_keyconfig_import, From 25a14bad610604040a66ec6f8938069ab77b642d Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sat, 13 Mar 2010 00:17:52 +0000 Subject: [PATCH 023/153] Fix [#21351] PROPERTIES: Resolution changes based solely on changing encoding format Bypassed existing hardcoded ffmpeg presets that executed when changing format, replaced with bpy presets. Leaving old code there for now, haven't got python/rna access to the ffmpeg id properties.. Anyone know how to do this? Code snippets here: http://www.pasteall.org/11657/c --- release/scripts/presets/ffmpeg/DV.py | 9 +++++++++ release/scripts/presets/ffmpeg/DVD.py | 18 ++++++++++++++++++ release/scripts/presets/ffmpeg/SVCD.py | 18 ++++++++++++++++++ release/scripts/presets/ffmpeg/VCD.py | 18 ++++++++++++++++++ release/scripts/presets/ffmpeg/h264.py | 16 ++++++++++++++++ release/scripts/presets/ffmpeg/theora.py | 16 ++++++++++++++++ release/scripts/presets/ffmpeg/xvid.py | 16 ++++++++++++++++ release/scripts/ui/properties_render.py | 10 ++++++++++ source/blender/blenkernel/intern/writeffmpeg.c | 3 ++- source/blender/makesrna/intern/rna_scene.c | 2 +- 10 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 release/scripts/presets/ffmpeg/DV.py create mode 100644 release/scripts/presets/ffmpeg/DVD.py create mode 100644 release/scripts/presets/ffmpeg/SVCD.py create mode 100644 release/scripts/presets/ffmpeg/VCD.py create mode 100644 release/scripts/presets/ffmpeg/h264.py create mode 100644 release/scripts/presets/ffmpeg/theora.py create mode 100644 release/scripts/presets/ffmpeg/xvid.py diff --git a/release/scripts/presets/ffmpeg/DV.py b/release/scripts/presets/ffmpeg/DV.py new file mode 100644 index 00000000000..db1bc0fac92 --- /dev/null +++ b/release/scripts/presets/ffmpeg/DV.py @@ -0,0 +1,9 @@ +is_ntsc = (bpy.context.scene.render.fps != 25) + +bpy.context.scene.render.ffmpeg_format = "DV" +bpy.context.scene.render.resolution_x = 720 + +if is_ntsc: + bpy.context.scene.render.resolution_y = 480 +else: + bpy.context.scene.render.resolution_y = 576 diff --git a/release/scripts/presets/ffmpeg/DVD.py b/release/scripts/presets/ffmpeg/DVD.py new file mode 100644 index 00000000000..6ac6c3c5ff7 --- /dev/null +++ b/release/scripts/presets/ffmpeg/DVD.py @@ -0,0 +1,18 @@ +is_ntsc = (bpy.context.scene.render.fps != 25) + +bpy.context.scene.render.ffmpeg_format = "MPEG2" +bpy.context.scene.render.resolution_x = 720 + +if is_ntsc: + bpy.context.scene.render.resolution_y = 480 + bpy.context.scene.render.ffmpeg_gopsize = 18 +else: + bpy.context.scene.render.resolution_y = 576 + bpy.context.scene.render.ffmpeg_gopsize = 15 + +bpy.context.scene.render.ffmpeg_video_bitrate = 6000 +bpy.context.scene.render.ffmpeg_maxrate = 9000 +bpy.context.scene.render.ffmpeg_minrate = 0 +bpy.context.scene.render.ffmpeg_buffersize = 224*8 +bpy.context.scene.render.ffmpeg_packetsize = 2048 +bpy.context.scene.render.ffmpeg_muxrate = 10080000 \ No newline at end of file diff --git a/release/scripts/presets/ffmpeg/SVCD.py b/release/scripts/presets/ffmpeg/SVCD.py new file mode 100644 index 00000000000..1d8752f02d9 --- /dev/null +++ b/release/scripts/presets/ffmpeg/SVCD.py @@ -0,0 +1,18 @@ +is_ntsc = (bpy.context.scene.render.fps != 25) + +bpy.context.scene.render.ffmpeg_format = "MPEG2" +bpy.context.scene.render.resolution_x = 480 + +if is_ntsc: + bpy.context.scene.render.resolution_y = 480 + bpy.context.scene.render.ffmpeg_gopsize = 18 +else: + bpy.context.scene.render.resolution_y = 576 + bpy.context.scene.render.ffmpeg_gopsize = 15 + +bpy.context.scene.render.ffmpeg_video_bitrate = 2040 +bpy.context.scene.render.ffmpeg_maxrate = 2516 +bpy.context.scene.render.ffmpeg_minrate = 0 +bpy.context.scene.render.ffmpeg_buffersize = 224*8 +bpy.context.scene.render.ffmpeg_packetsize = 2324 +bpy.context.scene.render.ffmpeg_muxrate = 0 \ No newline at end of file diff --git a/release/scripts/presets/ffmpeg/VCD.py b/release/scripts/presets/ffmpeg/VCD.py new file mode 100644 index 00000000000..303fd85eefb --- /dev/null +++ b/release/scripts/presets/ffmpeg/VCD.py @@ -0,0 +1,18 @@ +is_ntsc = (bpy.context.scene.render.fps != 25) + +bpy.context.scene.render.ffmpeg_format = "MPEG1" +bpy.context.scene.render.resolution_x = 352 + +if is_ntsc: + bpy.context.scene.render.resolution_y = 240 + bpy.context.scene.render.ffmpeg_gopsize = 18 +else: + bpy.context.scene.render.resolution_y = 288 + bpy.context.scene.render.ffmpeg_gopsize = 15 + +bpy.context.scene.render.ffmpeg_video_bitrate = 1150 +bpy.context.scene.render.ffmpeg_maxrate = 1150 +bpy.context.scene.render.ffmpeg_minrate = 1150 +bpy.context.scene.render.ffmpeg_buffersize = 40*8 +bpy.context.scene.render.ffmpeg_packetsize = 2324 +bpy.context.scene.render.ffmpeg_muxrate = 2352 * 75 * 8 \ No newline at end of file diff --git a/release/scripts/presets/ffmpeg/h264.py b/release/scripts/presets/ffmpeg/h264.py new file mode 100644 index 00000000000..e46dcd46176 --- /dev/null +++ b/release/scripts/presets/ffmpeg/h264.py @@ -0,0 +1,16 @@ +is_ntsc = (bpy.context.scene.render.fps != 25) + +bpy.context.scene.render.ffmpeg_format = "H264" +bpy.context.scene.render.ffmpeg_codec = "H264" + +if is_ntsc: + bpy.context.scene.render.ffmpeg_gopsize = 18 +else: + bpy.context.scene.render.ffmpeg_gopsize = 15 + +bpy.context.scene.render.ffmpeg_video_bitrate = 6000 +bpy.context.scene.render.ffmpeg_maxrate = 9000 +bpy.context.scene.render.ffmpeg_minrate = 0 +bpy.context.scene.render.ffmpeg_buffersize = 224*8 +bpy.context.scene.render.ffmpeg_packetsize = 2048 +bpy.context.scene.render.ffmpeg_muxrate = 10080000 \ No newline at end of file diff --git a/release/scripts/presets/ffmpeg/theora.py b/release/scripts/presets/ffmpeg/theora.py new file mode 100644 index 00000000000..bb84d977da3 --- /dev/null +++ b/release/scripts/presets/ffmpeg/theora.py @@ -0,0 +1,16 @@ +is_ntsc = (bpy.context.scene.render.fps != 25) + +bpy.context.scene.render.ffmpeg_format = "OGG" +bpy.context.scene.render.ffmpeg_codec = "THEORA" + +if is_ntsc: + bpy.context.scene.render.ffmpeg_gopsize = 18 +else: + bpy.context.scene.render.ffmpeg_gopsize = 15 + +bpy.context.scene.render.ffmpeg_video_bitrate = 6000 +bpy.context.scene.render.ffmpeg_maxrate = 9000 +bpy.context.scene.render.ffmpeg_minrate = 0 +bpy.context.scene.render.ffmpeg_buffersize = 224*8 +bpy.context.scene.render.ffmpeg_packetsize = 2048 +bpy.context.scene.render.ffmpeg_muxrate = 10080000 \ No newline at end of file diff --git a/release/scripts/presets/ffmpeg/xvid.py b/release/scripts/presets/ffmpeg/xvid.py new file mode 100644 index 00000000000..c0f5a3adb10 --- /dev/null +++ b/release/scripts/presets/ffmpeg/xvid.py @@ -0,0 +1,16 @@ +is_ntsc = (bpy.context.scene.render.fps != 25) + +bpy.context.scene.render.ffmpeg_format = "AVI" +bpy.context.scene.render.ffmpeg_codec = "XVID" + +if is_ntsc: + bpy.context.scene.render.ffmpeg_gopsize = 18 +else: + bpy.context.scene.render.ffmpeg_gopsize = 15 + +bpy.context.scene.render.ffmpeg_video_bitrate = 6000 +bpy.context.scene.render.ffmpeg_maxrate = 9000 +bpy.context.scene.render.ffmpeg_minrate = 0 +bpy.context.scene.render.ffmpeg_buffersize = 224*8 +bpy.context.scene.render.ffmpeg_packetsize = 2048 +bpy.context.scene.render.ffmpeg_muxrate = 10080000 \ No newline at end of file diff --git a/release/scripts/ui/properties_render.py b/release/scripts/ui/properties_render.py index a0992251f76..23dc434ae38 100644 --- a/release/scripts/ui/properties_render.py +++ b/release/scripts/ui/properties_render.py @@ -29,6 +29,13 @@ class RENDER_MT_presets(bpy.types.Menu): draw = bpy.types.Menu.draw_preset +class RENDER_MT_ffmpeg_presets(bpy.types.Menu): + bl_label = "FFMPEG Presets" + preset_subdir = "ffmpeg" + preset_operator = "script.python_file_run" + draw = bpy.types.Menu.draw_preset + + class RenderButtonsPanel(bpy.types.Panel): bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' @@ -379,6 +386,8 @@ class RENDER_PT_encoding(RenderButtonsPanel): rd = context.scene.render wide_ui = context.region.width > narrowui + layout.menu("RENDER_MT_ffmpeg_presets", text="Presets") + split = layout.split() col = split.column() @@ -627,6 +636,7 @@ class RENDER_PT_bake(RenderButtonsPanel): classes = [ RENDER_MT_presets, + RENDER_MT_ffmpeg_presets, RENDER_PT_render, RENDER_PT_layers, RENDER_PT_dimensions, diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 8aa9282937c..ccef6832be8 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -1242,7 +1242,8 @@ void ffmpeg_verify_image_type(RenderData *rd) rd->ffcodecdata.video_bitrate <= 1) { rd->ffcodecdata.codec = CODEC_ID_MPEG2VIDEO; - ffmpeg_set_preset(rd, FFMPEG_PRESET_DVD); + /* Don't set preset, disturbs render resolution. + * ffmpeg_set_preset(rd, FFMPEG_PRESET_DVD); */ } audio= 1; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 9872d6e1801..5139a06aba5 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -132,7 +132,7 @@ EnumPropertyItem image_type_items[] = { {R_H264, "H264", ICON_FILE_MOVIE, "H.264", ""}, {R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", ""}, {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", ""}, - {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "FFMpeg", ""}, + {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", ""}, #endif {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", ""}, {0, NULL, 0, NULL, NULL}}; From d8d844091ad91dfa8442fd52aa96912e2a7fe0b5 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sat, 13 Mar 2010 00:44:09 +0000 Subject: [PATCH 024/153] Add-Ons: *Added location value (for infos like "View3D > Properties > Measure") --- release/scripts/ui/space_userpref.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 9717169386a..24c5063f6b9 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -1406,6 +1406,7 @@ class USERPREF_PT_addons(bpy.types.Panel): mod.expanded = False script = hasattr(mod, '__script__') + location = hasattr(mod, '__location__') author = hasattr(mod, '__author__') version = hasattr(mod, '__version__') blender = hasattr(mod, '__blender__') @@ -1418,6 +1419,8 @@ class USERPREF_PT_addons(bpy.types.Panel): script = str(mod.__script__) else: script = module_name + if location: + location = str(mod.__location__) if version: version = str(mod.__version__) if author: @@ -1473,7 +1476,7 @@ class USERPREF_PT_addons(bpy.types.Panel): emails.append([mail, mail_desc]) if bpydoc: bpydoc = str(mod.__bpydoc__).splitlines() - return module_name, script, author, version, blender, category, url, email, bpydoc, links, emails + return module_name, script, author, version, blender, location, category, url, email, bpydoc, links, emails def draw(self, context): layout = self.layout @@ -1504,7 +1507,7 @@ class USERPREF_PT_addons(bpy.types.Panel): filter = context.scene.addon_filter search = context.scene.addon_search for mod in self._addon_list(): - module_name, script, author, version, blender, category, url, email, bpydoc, links, emails = \ + module_name, script, author, version, blender, location, category, url, email, bpydoc, links, emails = \ self._attributes(mod) # check if add-on should be visible with current filters @@ -1548,6 +1551,10 @@ class USERPREF_PT_addons(bpy.types.Panel): split = column.row().split(percentage=0.15) split.label(text='Version:') split.label(text=version) + if location: + split = column.row().split(percentage=0.15) + split.label(text='Location:') + split.label(text=location) if url: split = column.row().split(percentage=0.15) split.label(text="Links:") From ee356777293c45a7598b2758d8210ebda1f52e51 Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Sat, 13 Mar 2010 02:35:32 +0000 Subject: [PATCH 025/153] Respect "divisible by 8" padding. --- source/blender/makesdna/DNA_userdef_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 8f155019e57..7ed30b3e876 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -210,7 +210,7 @@ typedef struct ThemeSpace { char console_cursor[4]; char vertex_size, facedot_size; - char bpad[2]; + char bpad[6]; char syntaxl[4], syntaxn[4], syntaxb[4]; // syntax for textwindow and nodes char syntaxv[4], syntaxc[4]; From 9439c0b1cbc1b238a7bca5bf07f4381864fbce23 Mon Sep 17 00:00:00 2001 From: Jens Ole Wund Date: Sat, 13 Mar 2010 02:43:25 +0000 Subject: [PATCH 026/153] getting close to 2.5 'everything can be animated paradigm' well meshes do .. I've not been looking a the tail yet. softbody.c --- source/blender/blenkernel/intern/softbody.c | 94 ++++++++++++--------- 1 file changed, 54 insertions(+), 40 deletions(-) diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 09f7f32bc12..d804f87daff 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -212,6 +212,41 @@ static float sb_time_scale(Object *ob) } /*--- frame based timing ---*/ +/* helper functions for everything is animateble jow_go_for2_5 +++++++*/ +/* introducing them here, because i know: steps in properties ( at frame timing ) + will cause unwanted responses of the softbody system (which does inter frame calculations ) + so first 'cure' would be: interpolate linear in time .. + Q: why do i write this? + A: because it happend once, that some eger coder 'streamlined' code to fail. + We DO linear interpolation for goals .. and i think we should do on animated properties as well +*/ +static float _goalfac(SoftBody *sb)/*jow_go_for2_5 */ +{ + if (sb){ + return ABS(sb->maxgoal - sb->mingoal); + } + printf("_goalfac failed! sb==NULL \n" ); + return -9999.99f; /*using crude but spot able values some times helps debuggin */ +} + + +static float _final_goal(Object *ob,BodyPoint *bp)/*jow_go_for2_5 */ +{ + float f = -1999.99f; + if (ob){ + SoftBody *sb= ob->soft; /* is supposed to be there */ + if(!(ob->softflag & OB_SB_GOAL)) return (0.0f); + if (sb&&bp){ + if (bp->goal < 0.0f) return (0.0f); + f = pow(_goalfac(sb), 4.0f); + return (bp->goal *f); + } + } + printf("_final_goal failed! sb or bp ==NULL \n" ); + return f; /*using crude but spot able values some times helps debuggin */ +} +/* helper functions for everything is animateble jow_go_for2_5 ------*/ + /*+++ collider caching and dicing +++*/ /******************** @@ -2219,7 +2254,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo } /* naive ball self collision done */ - if(bp->goal < SOFTGOALSNAP){ /* ommit this bp when it snaps */ + if(_final_goal(ob,bp) < SOFTGOALSNAP){ /* ommit this bp when it snaps */ float auxvect[3]; float velgoal[3]; @@ -2228,7 +2263,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo /* true elastic goal */ float ks,kd; sub_v3_v3v3(auxvect,bp->pos,bp->origT); - ks = 1.0f/(1.0f- bp->goal*sb->goalspring)-1.0f ; + ks = 1.0f/(1.0f- _final_goal(ob,bp)*sb->goalspring)-1.0f ; bp->force[0]+= -ks*(auxvect[0]); bp->force[1]+= -ks*(auxvect[1]); bp->force[2]+= -ks*(auxvect[2]); @@ -2616,7 +2651,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa } /* naive ball self collision done */ - if(bp->goal < SOFTGOALSNAP){ /* ommit this bp when it snaps */ + if(_final_goal(ob,bp) < SOFTGOALSNAP){ /* ommit this bp when it snaps */ float auxvect[3]; float velgoal[3]; @@ -2624,7 +2659,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa if(ob->softflag & OB_SB_GOAL) { /* true elastic goal */ sub_v3_v3v3(auxvect,bp->pos,bp->origT); - ks = 1.0f/(1.0f- bp->goal*sb->goalspring)-1.0f ; + ks = 1.0f/(1.0f- _final_goal(ob,bp)*sb->goalspring)-1.0f ; bp->force[0]+= -ks*(auxvect[0]); bp->force[1]+= -ks*(auxvect[1]); bp->force[2]+= -ks*(auxvect[2]); @@ -2888,7 +2923,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * else timeovermass = forcetime/0.009999f; - if(bp->goal < SOFTGOALSNAP){ + if(_final_goal(ob,bp) < SOFTGOALSNAP){ /* this makes t~ = t */ if(mid_flags & MID_PRESERVE) VECCOPY(dx,bp->vec); @@ -3092,7 +3127,7 @@ static void softbody_apply_goalsnap(Object *ob) int a; for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - if (bp->goal >= SOFTGOALSNAP){ + if (_final_goal(ob,bp) >= SOFTGOALSNAP){ VECCOPY(bp->prevpos,bp->pos); VECCOPY(bp->pos,bp->origT); } @@ -3137,7 +3172,7 @@ static void interpolate_exciter(Object *ob, int timescale, int time) bp->origT[0] = bp->origS[0] + f*(bp->origE[0] - bp->origS[0]); bp->origT[1] = bp->origS[1] + f*(bp->origE[1] - bp->origS[1]); bp->origT[2] = bp->origS[2] + f*(bp->origE[2] - bp->origS[2]); - if (bp->goal >= SOFTGOALSNAP){ + if (_final_goal(ob,bp) >= SOFTGOALSNAP){ bp->vec[0] = bp->origE[0] - bp->origS[0]; bp->vec[1] = bp->origE[1] - bp->origS[1]; bp->vec[2] = bp->origE[2] - bp->origS[2]; @@ -3224,37 +3259,6 @@ static void springs_from_mesh(Object *ob) -/* helper functions for everything is animateble jow_go_for2_5 +++++++*/ -/* introducing them here, because i know: steps in properties ( at frame timing ) - will cause unwanted responses of the softbody system (which does inter frame calculations ) - so first 'cure' would be: interpolate linear in time .. - Q: why do i write this? - A: because it happend once, that some eger coder 'streamlined' code to fail. - We DO linear interpolation for goals .. and i think we should do on animated properties as well -*/ -static float _goalfac(SoftBody *sb)/*jow_go_for2_5 */ -{ - if (sb){ - return ABS(sb->maxgoal - sb->mingoal); - } - printf("_goalfac failed! sb==NULL \n" ); - return -9999.99f; /*using crude but spot able values some times helps debuggin */ -} - - -static float _final_goal(SoftBody *sb,BodyPoint *bp)/*jow_go_for2_5 */ -{ - float f = -1999.99f; - if (sb && bp){ - if (bp->goal < 0.0f) return (0.0f); - f = pow(_goalfac(sb), 4.0f); - return (bp->goal *f); - } - printf("_final_goal failed! sb or bp ==NULL \n" ); - return f; /*using crude but spot able values some times helps debuggin */ -} -/* helper functions for everything is animateble jow_go_for2_5 ------*/ - /* makes totally fresh start situation */ static void mesh_to_softbody(Scene *scene, Object *ob) @@ -3293,10 +3297,18 @@ static void mesh_to_softbody(Scene *scene, Object *ob) /* this is where '2.5 every thing is animateable' goes wrong in the first place jow_go_for2_5 */ /* 1st coding action to take : move this to frame level */ /* reads: leave the bp->goal as it was read from vertex group / or default .. we will need it at per frame call */ - bp->goal= sb->mingoal + bp->goal*goalfac; /* do not do here jow_go_for2_5 */ + /* should be fixed for meshes */ + // bp->goal= sb->mingoal + bp->goal*goalfac; /* do not do here jow_go_for2_5 */ } + else{ + /* in consequence if no group was set .. but we want to animate it laters */ + /* logically attach to goal at first */ + if(ob->softflag & OB_SB_GOAL){bp->goal =1.0f;} + } + /* a little ad hoc changing the goal control to be less *sharp* */ - bp->goal = (float)pow(bp->goal, 4.0f);/* do not do here jow_go_for2_5 */ + /* should be fixed for meshes */ + // bp->goal = (float)pow(bp->goal, 4.0f);/* do not do here jow_go_for2_5 */ /* to proove the concept this would enable per vertex *mass painting* @@ -3530,6 +3542,8 @@ static void lattice_to_softbody(Scene *scene, Object *ob) if(ob->softflag & OB_SB_GOAL){ BodyPoint *bp= sb->bpoint; BPoint *bpnt= lt->def; + /* goes wrong with jow_go_for2_5 */ + /* for now this is a built in bug .. by design */ float goalfac= ABS(sb->maxgoal - sb->mingoal); int a; From 8cae1622455f6479a13fabd096cd9d9d3d0abd47 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Sat, 13 Mar 2010 04:51:24 +0000 Subject: [PATCH 027/153] [#21580] -- argument tries to load as a blend file Stop processing arguments on -- --- source/blender/blenlib/intern/BLI_args.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c index cd876023830..abf9dbcd9c5 100644 --- a/source/blender/blenlib/intern/BLI_args.c +++ b/source/blender/blenlib/intern/BLI_args.c @@ -177,6 +177,10 @@ void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void * int i = 0; for( i = 1; i < ba->argc; i++) { /* skip argv[0] */ + /* stop on -- */ + if (BLI_streq(ba->argv[i], "--")) + break; + if (ba->passes[i] == 0) { /* -1 signal what side of the comparison it is */ bArgument *a = lookUp(ba, ba->argv[i], pass, -1); From 975cf38d6a78b60b0db899abd5a7dc950df133c5 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sat, 13 Mar 2010 11:22:39 +0000 Subject: [PATCH 028/153] Fix #21282: Segfault when using "Text on curve" option Ignore textoncurve property if it's type isn't OB_CURVE, since only curves could have a path. --- source/blender/blenkernel/intern/font.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 36bb031744e..efd93aa362d 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -960,7 +960,8 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) } /* TEXT ON CURVE */ - if(cu->textoncurve) { + /* Note: Only OB_CURVE objects could have a path */ + if(cu->textoncurve && cu->textoncurve->type==OB_CURVE) { Curve *cucu= cu->textoncurve->data; int oldflag= cucu->flag; From dfb59dbaa52d413068197176654f76cc84fceab8 Mon Sep 17 00:00:00 2001 From: Robert Holcomb Date: Sat, 13 Mar 2010 14:47:26 +0000 Subject: [PATCH 029/153] added method to change algorithm used in channel matte node. Limit a channel by another channel or limit by max of remaining channels. --- source/blender/editors/space_node/drawnode.c | 15 +++- source/blender/makesdna/DNA_node_types.h | 1 + source/blender/makesrna/intern/rna_nodetree.c | 21 ++++- .../nodes/intern/CMP_nodes/CMP_channelMatte.c | 85 ++++++++++--------- 4 files changed, 80 insertions(+), 42 deletions(-) diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 16bf52db80f..9f7b01b1cd0 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -853,13 +853,24 @@ static void node_composit_buts_channel_matte(uiLayout *layout, bContext *C, Poin { uiLayout *col, *row; + uiItemL(layout, "Color Space:", 0); row= uiLayoutRow(layout, 0); uiItemR(row, NULL, 0, ptr, "color_space", UI_ITEM_R_EXPAND); - row= uiLayoutRow(layout, 0); + col=uiLayoutColumn(layout, 0); + uiItemL(col, "Key Channel:", 0); + row= uiLayoutRow(col, 0); uiItemR(row, NULL, 0, ptr, "channel", UI_ITEM_R_EXPAND); - col =uiLayoutColumn(layout, 1); + col =uiLayoutColumn(layout, 0); + + uiItemR(col, NULL, 0, ptr, "algorithm", 0); + if(RNA_enum_get(ptr, "algorithm")==0) { + uiItemL(col, "Limiting Channel:", 0); + row=uiLayoutRow(col,0); + uiItemR(row, NULL, 0, ptr, "limit_channel", UI_ITEM_R_EXPAND); + } + uiItemR(col, NULL, 0, ptr, "high", UI_ITEM_R_SLIDER); uiItemR(col, NULL, 0, ptr, "low", UI_ITEM_R_SLIDER); } diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index c178176048a..c587b2106ff 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -250,6 +250,7 @@ typedef struct NodeChroma { float t1,t2,t3; float fsize,fstrength,falpha; float key[4]; + short algorithm, channel; } NodeChroma; typedef struct NodeTwoXYs { diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index c8b78b38b9a..ba805bd0a4f 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -1425,6 +1425,11 @@ static void def_cmp_channel_matte(StructRNA *srna) {CMP_NODE_CHANNEL_MATTE_CS_YUV, "YUV", 0, "YUV", "YUV Color Space"}, {CMP_NODE_CHANNEL_MATTE_CS_YCC, "YCC", 0, "YCbCr", "YCbCr Color Space"}, {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem algorithm_items[] = { + {0, "SINGLE", 0, "Single", "Limit by single channel"}, + {1, "MAX", 0, "Max", "Limit by max of other channels "}, + {0, NULL, 0, NULL, NULL}}; prop = RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); @@ -1432,15 +1437,27 @@ static void def_cmp_channel_matte(StructRNA *srna) RNA_def_property_ui_text(prop, "Color Space", ""); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - prop= RNA_def_property(srna, "channel", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom2"); RNA_def_property_enum_items(prop, prop_tri_channel_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_channel_itemf"); RNA_def_property_ui_text(prop, "Channel", "Channel used to determine matte"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - + RNA_def_struct_sdna_from(srna, "NodeChroma", "storage"); + + prop = RNA_def_property(srna, "algorithm", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "algorithm"); + RNA_def_property_enum_items(prop, algorithm_items); + RNA_def_property_ui_text(prop, "Algorithm", "Algorithm to use to limit channel"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "limit_channel", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "channel"); + RNA_def_property_enum_items(prop, prop_tri_channel_items); + RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_channel_itemf"); + RNA_def_property_ui_text(prop, "Limit Channel", "Limit by this channels value"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "high", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t1"); diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c index cda6cf06681..72990ed8fd2 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c @@ -66,30 +66,36 @@ static void do_normalized_ycca_to_rgba2(bNode *node, float *out, float *in) static void do_channel_matte(bNode *node, float *out, float *in) { NodeChroma *c=(NodeChroma *)node->storage; - float alpha=0.0; - - /* Alpha=G-MAX(R, B) */ - - switch(node->custom2) - { - case 1: - { - alpha=in[0]-MAX2(in[1],in[2]); - break; - } - case 2: - { - alpha=in[1]-MAX2(in[0],in[2]); - break; - } - case 3: - { - alpha=in[2]-MAX2(in[0],in[1]); - break; - } - default: - break; - } + float alpha=0.0; + + switch(c->algorithm) { + case 0: { /* Alpha=key_channel-limit channel */ + int key_channel=node->custom2-1; + int limit_channel=c->channel-1; + alpha=in[key_channel]-in[limit_channel]; + break; + } + case 1: { /* Alpha=G-MAX(R, B) */ + switch(node->custom2) { + case 1: { + alpha=in[0]-MAX2(in[1],in[2]); + break; + } + case 2: { + alpha=in[1]-MAX2(in[0],in[2]); + break; + } + case 3: { + alpha=in[2]-MAX2(in[0],in[1]); + break; + } + default: + break; + } + } + default: + break; + } /*flip because 0.0 is transparent, not 1.0*/ alpha=1-alpha; @@ -120,6 +126,7 @@ static void node_composit_exec_channel_matte(void *data, bNode *node, bNodeStack { CompBuf *cbuf; CompBuf *outbuf; + NodeChroma *c=(NodeChroma *)node->storage; if(in[0]->hasinput==0) return; if(in[0]->data==NULL) return; @@ -131,24 +138,24 @@ static void node_composit_exec_channel_matte(void *data, bNode *node, bNodeStack /*convert to colorspace*/ switch(node->custom1) { - case CMP_NODE_CHANNEL_MATTE_CS_RGB: - break; - case CMP_NODE_CHANNEL_MATTE_CS_HSV: /*HSV*/ - composit1_pixel_processor(node, outbuf, cbuf, in[1]->vec, do_rgba_to_hsva, CB_RGBA); - break; - case CMP_NODE_CHANNEL_MATTE_CS_YUV: /*YUV*/ - composit1_pixel_processor(node, outbuf, cbuf, in[1]->vec, do_rgba_to_yuva, CB_RGBA); - break; - case CMP_NODE_CHANNEL_MATTE_CS_YCC: /*YCC*/ - composit1_pixel_processor(node, outbuf, cbuf, in[1]->vec, do_normalized_rgba_to_ycca2, CB_RGBA); - break; - default: - break; + case CMP_NODE_CHANNEL_MATTE_CS_RGB: + break; + case CMP_NODE_CHANNEL_MATTE_CS_HSV: /*HSV*/ + composit1_pixel_processor(node, outbuf, cbuf, in[1]->vec, do_rgba_to_hsva, CB_RGBA); + break; + case CMP_NODE_CHANNEL_MATTE_CS_YUV: /*YUV*/ + composit1_pixel_processor(node, outbuf, cbuf, in[1]->vec, do_rgba_to_yuva, CB_RGBA); + break; + case CMP_NODE_CHANNEL_MATTE_CS_YCC: /*YCC*/ + composit1_pixel_processor(node, outbuf, cbuf, in[1]->vec, do_normalized_rgba_to_ycca2, CB_RGBA); + break; + default: + break; } /*use the selected channel information to do the key */ composit1_pixel_processor(node, outbuf, outbuf, in[1]->vec, do_channel_matte, CB_RGBA); - + /*convert back to RGB colorspace in place*/ switch(node->custom1) { case CMP_NODE_CHANNEL_MATTE_CS_RGB: /*RGB*/ @@ -185,6 +192,8 @@ static void node_composit_init_channel_matte(bNode *node) c->t3= 0.0f; c->fsize= 0.0f; c->fstrength= 0.0f; + c->algorithm=1; /*max channel limiting */ + c->channel=1; /* limit by red */ node->custom1= 1; /* RGB channel */ node->custom2= 2; /* Green Channel */ } From eea945347063cb44ea99c00a490ffc06e0a714be Mon Sep 17 00:00:00 2001 From: Jens Ole Wund Date: Sat, 13 Mar 2010 19:12:54 +0000 Subject: [PATCH 030/153] softbody properties mingoal maxgoal are 'hot' now for meshes lattices and curves changes work immediately in the running simulation --- source/blender/blenkernel/intern/softbody.c | 50 +++++++-------------- 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index d804f87daff..8c44737adb6 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -212,7 +212,7 @@ static float sb_time_scale(Object *ob) } /*--- frame based timing ---*/ -/* helper functions for everything is animateble jow_go_for2_5 +++++++*/ +/* helper functions for everything is animatable jow_go_for2_5 +++++++*/ /* introducing them here, because i know: steps in properties ( at frame timing ) will cause unwanted responses of the softbody system (which does inter frame calculations ) so first 'cure' would be: interpolate linear in time .. @@ -220,16 +220,8 @@ static float sb_time_scale(Object *ob) A: because it happend once, that some eger coder 'streamlined' code to fail. We DO linear interpolation for goals .. and i think we should do on animated properties as well */ -static float _goalfac(SoftBody *sb)/*jow_go_for2_5 */ -{ - if (sb){ - return ABS(sb->maxgoal - sb->mingoal); - } - printf("_goalfac failed! sb==NULL \n" ); - return -9999.99f; /*using crude but spot able values some times helps debuggin */ -} - +/* animate sb->maxgoal,sb->mingoal */ static float _final_goal(Object *ob,BodyPoint *bp)/*jow_go_for2_5 */ { float f = -1999.99f; @@ -238,8 +230,9 @@ static float _final_goal(Object *ob,BodyPoint *bp)/*jow_go_for2_5 */ if(!(ob->softflag & OB_SB_GOAL)) return (0.0f); if (sb&&bp){ if (bp->goal < 0.0f) return (0.0f); - f = pow(_goalfac(sb), 4.0f); - return (bp->goal *f); + f = sb->mingoal + bp->goal*ABS(sb->maxgoal - sb->mingoal); + f = pow(f, 4.0f); + return (f); } } printf("_final_goal failed! sb or bp ==NULL \n" ); @@ -881,6 +874,10 @@ static void renew_softbody(Scene *scene, Object *ob, int totpoint, int totspring for (i=0; ibpoint[i]; + + /* hum as far as i see this is overridden by _final_goal() now jow_go_for2_5 */ + /* sadly breaks compatibility with older versions */ + /* but makes goals behave the same for meshes, lattices and curves */ if(softflag & OB_SB_GOAL) { bp->goal= sb->defgoal; } @@ -3268,7 +3265,6 @@ static void mesh_to_softbody(Scene *scene, Object *ob) MEdge *medge= me->medge; BodyPoint *bp; BodySpring *bs; - float goalfac; int a, totedge; if (ob->softflag & OB_SB_EDGES) totedge= me->totedge; else totedge= 0; @@ -3279,8 +3275,6 @@ static void mesh_to_softbody(Scene *scene, Object *ob) /* we always make body points */ sb= ob->soft; bp= sb->bpoint; - /*pick it from _goalfac jow_go_for2_5*/ - goalfac= _goalfac(sb); for(a=0; atotvert; a++, bp++) { /* get scalar values needed *per vertex* from vertex group functions, @@ -3302,13 +3296,9 @@ static void mesh_to_softbody(Scene *scene, Object *ob) } else{ /* in consequence if no group was set .. but we want to animate it laters */ - /* logically attach to goal at first */ - if(ob->softflag & OB_SB_GOAL){bp->goal =1.0f;} + /* logically attach to goal with default first */ + if(ob->softflag & OB_SB_GOAL){bp->goal =sb->defgoal;} } - - /* a little ad hoc changing the goal control to be less *sharp* */ - /* should be fixed for meshes */ - // bp->goal = (float)pow(bp->goal, 4.0f);/* do not do here jow_go_for2_5 */ /* to proove the concept this would enable per vertex *mass painting* @@ -3542,15 +3532,11 @@ static void lattice_to_softbody(Scene *scene, Object *ob) if(ob->softflag & OB_SB_GOAL){ BodyPoint *bp= sb->bpoint; BPoint *bpnt= lt->def; - /* goes wrong with jow_go_for2_5 */ - /* for now this is a built in bug .. by design */ - float goalfac= ABS(sb->maxgoal - sb->mingoal); + /* jow_go_for2_5 */ int a; for(a=0; agoal= sb->mingoal + bpnt->weight*goalfac; - /* a little ad hoc changing the goal control to be less *sharp* */ - bp->goal = (float)pow(bp->goal, 4.0f); + bp->goal= bpnt->weight; } } @@ -3571,7 +3557,6 @@ static void curve_surf_to_softbody(Scene *scene, Object *ob) Nurb *nu; BezTriple *bezt; BPoint *bpnt; - float goalfac; int a, curindex=0; int totvert, totspring = 0, setgoal=0; @@ -3588,7 +3573,6 @@ static void curve_surf_to_softbody(Scene *scene, Object *ob) sb= ob->soft; /* can be created in renew_softbody() */ /* set vars now */ - goalfac= ABS(sb->maxgoal - sb->mingoal); bp= sb->bpoint; bs= sb->bspring; @@ -3602,9 +3586,7 @@ static void curve_surf_to_softbody(Scene *scene, Object *ob) if(nu->bezt) { for(bezt=nu->bezt, a=0; apntsu; a++, bezt++, bp+=3, curindex+=3) { if(setgoal) { - bp->goal= sb->mingoal + bezt->weight*goalfac; - /* a little ad hoc changing the goal control to be less *sharp* */ - bp->goal = (float)pow(bp->goal, 4.0f); + bp->goal= bezt->weight; /* all three triples */ (bp+1)->goal= bp->goal; @@ -3636,9 +3618,7 @@ static void curve_surf_to_softbody(Scene *scene, Object *ob) else { for(bpnt=nu->bp, a=0; apntsu*nu->pntsv; a++, bpnt++, bp++, curindex++) { if(setgoal) { - bp->goal= sb->mingoal + bpnt->weight*goalfac; - /* a little ad hoc changing the goal control to be less *sharp* */ - bp->goal = (float)pow(bp->goal, 4.0f); + bp->goal= bpnt->weight; } if(totspring && a>0) { bs->v1= curindex-1; From c56f04d349d0d09a62a850ab4c042e9bafa047c6 Mon Sep 17 00:00:00 2001 From: Jens Ole Wund Date: Sat, 13 Mar 2010 21:22:56 +0000 Subject: [PATCH 031/153] soft body property nodemass became 'hot' for meshes could not test for lattices and curves since parts of the UI is missing will try to fix this next .. hurms not knowing what i am doing there --- source/blender/blenkernel/intern/softbody.c | 34 +++++++++++++-------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 8c44737adb6..a67cf98865f 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -238,6 +238,18 @@ static float _final_goal(Object *ob,BodyPoint *bp)/*jow_go_for2_5 */ printf("_final_goal failed! sb or bp ==NULL \n" ); return f; /*using crude but spot able values some times helps debuggin */ } + +static float _final_mass(Object *ob,BodyPoint *bp) +{ + if (ob){ + SoftBody *sb= ob->soft; /* is supposed to be there */ + if (sb&&bp){ + return(bp->mass*sb->nodemass); + } + } + printf("_final_mass failed! sb or bp ==NULL \n" ); + return 1.0f; +} /* helper functions for everything is animateble jow_go_for2_5 ------*/ /*+++ collider caching and dicing +++*/ @@ -894,7 +906,7 @@ static void renew_softbody(Scene *scene, Object *ob, int totpoint, int totspring bp->colball = 0.0f; bp->flag = 0; bp->springweight = 1.0f; - bp->mass = sb->nodemass; + bp->mass = 1.0f; } } } @@ -2234,14 +2246,14 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo mid_v3_v3v3(velcenter, bp->vec, obp->vec); sub_v3_v3v3(dvel,velcenter,bp->vec); - mul_v3_fl(dvel,bp->mass); + mul_v3_fl(dvel,_final_mass(ob,bp)); Vec3PlusStVec(bp->force,f*(1.0f-sb->balldamp),def); Vec3PlusStVec(bp->force,sb->balldamp,dvel); /* exploit force(a,b) == -force(b,a) part2/2 */ sub_v3_v3v3(dvel,velcenter,obp->vec); - mul_v3_fl(dvel,bp->mass); + mul_v3_fl(dvel,_final_mass(ob,bp)); Vec3PlusStVec(obp->force,sb->balldamp,dvel); Vec3PlusStVec(obp->force,-f*(1.0f-sb->balldamp),def); @@ -2287,7 +2299,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo if (sb && scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY){ float gravity[3]; VECCOPY(gravity, scene->physics_settings.gravity); - mul_v3_fl(gravity, sb_grav_force_scale(ob)*bp->mass*sb->effector_weights->global_gravity); /* individual mass of node here */ + mul_v3_fl(gravity, sb_grav_force_scale(ob)*_final_mass(ob,bp)*sb->effector_weights->global_gravity); /* individual mass of node here */ add_v3_v3v3(bp->force, bp->force, gravity); } @@ -2605,7 +2617,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa mid_v3_v3v3(velcenter, bp->vec, obp->vec); sub_v3_v3v3(dvel,velcenter,bp->vec); - mul_v3_fl(dvel,bp->mass); + mul_v3_fl(dvel,_final_mass(ob,bp)); Vec3PlusStVec(bp->force,f*(1.0f-sb->balldamp),def); Vec3PlusStVec(bp->force,sb->balldamp,dvel); @@ -2636,7 +2648,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa /* exploit force(a,b) == -force(b,a) part2/2 */ sub_v3_v3v3(dvel,velcenter,obp->vec); - mul_v3_fl(dvel,(bp->mass+obp->mass)/2.0f); + mul_v3_fl(dvel,(_final_mass(ob,bp)+_final_mass(ob,obp))/2.0f); Vec3PlusStVec(obp->force,sb->balldamp,dvel); Vec3PlusStVec(obp->force,-f*(1.0f-sb->balldamp),def); @@ -2696,7 +2708,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa /* gravitation */ - VECADDFAC(bp->force, bp->force, gravity, bp->mass); /* individual mass of node here */ + VECADDFAC(bp->force, bp->force, gravity, _final_mass(ob,bp)); /* individual mass of node here */ /* particle field & vortex */ @@ -2916,7 +2928,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { /* now we have individual masses */ /* claim a minimum mass for vertex */ - if (bp->mass > 0.009999f) timeovermass = forcetime/bp->mass; + if (_final_mass(ob,bp) > 0.009999f) timeovermass = forcetime/_final_mass(ob,bp); else timeovermass = forcetime/0.009999f; @@ -3301,10 +3313,8 @@ static void mesh_to_softbody(Scene *scene, Object *ob) } /* to proove the concept - this would enable per vertex *mass painting* + this enables per vertex *mass painting* */ - /* first set the default */ - bp->mass = sb->nodemass; if (sb->namedVG_Mass[0]) { @@ -3312,7 +3322,7 @@ static void mesh_to_softbody(Scene *scene, Object *ob) /* printf("VGN %s %d \n",sb->namedVG_Mass,grp); */ if(grp > -1){ get_scalar_from_vertexgroup(ob, a,(short) (grp), &bp->mass); - bp->mass = bp->mass * sb->nodemass; + /* 2.5 bp->mass = bp->mass * sb->nodemass; */ /* printf("bp->mass %f \n",bp->mass); */ } From ed930c48186d72b79ce6f1139f7db65759a40f42 Mon Sep 17 00:00:00 2001 From: Jens Ole Wund Date: Sat, 13 Mar 2010 22:53:03 +0000 Subject: [PATCH 032/153] enable basic soft body object options for soft body aware objects as there are lattices and curves since this is foreign terrain for me .. please check --- release/scripts/ui/properties_physics_softbody.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/release/scripts/ui/properties_physics_softbody.py b/release/scripts/ui/properties_physics_softbody.py index 8a59e087dc3..ed4c24b29b3 100644 --- a/release/scripts/ui/properties_physics_softbody.py +++ b/release/scripts/ui/properties_physics_softbody.py @@ -38,7 +38,10 @@ class PhysicButtonsPanel(bpy.types.Panel): def poll(self, context): ob = context.object rd = context.scene.render - return (ob and ob.type == 'MESH') and (not rd.use_game_engine) +# return (ob and ob.type == 'MESH') and (not rd.use_game_engine) +# i really hate touching things i do not understand completely .. but i think this should read (bjornmose) + return (ob and (ob.type == 'MESH' or ob.type == 'LATTICE'or ob.type == 'CURVE')) and (not rd.use_game_engine) + class PHYSICS_PT_softbody(PhysicButtonsPanel): From 5cf623934fcb7581327ea1fc239e3e677dcac705 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 14 Mar 2010 03:05:30 +0000 Subject: [PATCH 033/153] Bugfix #21565: Scale keys from DopeSheet transform menu causes crash The operators in this menu were using the wrong operators! --- release/scripts/ui/space_dopesheet.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/release/scripts/ui/space_dopesheet.py b/release/scripts/ui/space_dopesheet.py index 6d5619613ea..a98f142cc3a 100644 --- a/release/scripts/ui/space_dopesheet.py +++ b/release/scripts/ui/space_dopesheet.py @@ -187,9 +187,10 @@ class DOPESHEET_MT_key_transform(bpy.types.Menu): layout = self.layout layout.column() - layout.operator("transform.translate", text="Grab/Move") + layout.operator("transform.transform", text="Grab/Move").mode = 'TIME_TRANSLATE' layout.operator("transform.transform", text="Extend").mode = 'TIME_EXTEND' - layout.operator("transform.resize", text="Scale") + layout.operator("transform.transform", text="Slide").mode = 'TIME_SLIDE' + layout.operator("transform.transform", text="Scale").mode = 'TIME_SCALE' classes = [ From 7da0c4c699f939c182cab4d22d692043ef2cb3c5 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sun, 14 Mar 2010 08:15:20 +0000 Subject: [PATCH 034/153] Fix #21599: Duplicating an object with solidify doesnt copy the flags correctly Someone forgot to copy solidify modifier's flag. --- source/blender/blenkernel/intern/modifier.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index c5a420b85a8..68087cb553c 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -5697,6 +5697,7 @@ static void solidifyModifier_copyData(ModifierData *md, ModifierData *target) tsmd->crease_inner = smd->crease_inner; tsmd->crease_outer = smd->crease_outer; tsmd->crease_rim = smd->crease_rim; + tsmd->flag = smd->flag; strcpy(tsmd->defgrp_name, smd->defgrp_name); } From 15f0907563bcf357c92c34f8f0d2d2a1af8343e3 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 14 Mar 2010 11:44:24 +0000 Subject: [PATCH 035/153] PyAPI Bugfix - Fix for crash on struct.path_to_id() --- source/blender/python/intern/bpy_rna.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 552b187d097..90de107d990 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1859,7 +1859,7 @@ static PyObject *pyrna_struct_path_to_id(BPy_StructRNA *self, PyObject *args) if(path==NULL) { if(name) PyErr_Format(PyExc_TypeError, "%.200s.path_to_id(\"%s\") found but does not support path creation", RNA_struct_identifier(self->ptr.type), name); - else PyErr_Format(PyExc_TypeError, "%.200s.path_to_id() does not support path creation for this type", name); + else PyErr_Format(PyExc_TypeError, "%.200s.path_to_id() does not support path creation for this type", RNA_struct_identifier(self->ptr.type)); return NULL; } From 94d06bf3d4648d101d6c0d5f8f16c2d99f848d87 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sun, 14 Mar 2010 12:12:21 +0000 Subject: [PATCH 036/153] Fix #21594: converting bevel objects to mesh stops displaying them in spacial cases Mesh's boundbox should be re-calculated after curve->mesh conversion. To avoid troubles with displaying texture space i've used tex_space_mesh() for this. --- source/blender/blenkernel/intern/mesh.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index b7efc0c626b..8d2dfcd1989 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -987,6 +987,9 @@ void nurbs_to_mesh(Object *ob) me->totcol= cu->totcol; me->mat= cu->mat; + + tex_space_mesh(me); + cu->mat= 0; cu->totcol= 0; From bd34be86bf8a352138cc54564a9ab5b32c8d6f1e Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 14 Mar 2010 12:12:48 +0000 Subject: [PATCH 037/153] Bugfix for [#21560] space bar in edit mode of bezier curves doesnt work The wrong flag was used, OB_CURVE instead of OB_FONT. --- source/blender/windowmanager/intern/wm_operators.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index f45d3dfb6cb..4d8e48f1e8e 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1236,7 +1236,7 @@ static int wm_search_menu_poll(bContext *C) if(CTX_wm_window(C)==NULL) return 0; if(CTX_wm_area(C) && CTX_wm_area(C)->spacetype==SPACE_CONSOLE) return 0; // XXX - so we can use the shortcut in the console if(CTX_wm_area(C) && CTX_wm_area(C)->spacetype==SPACE_TEXT) return 0; // XXX - so we can use the spacebar in the text editor - if(CTX_data_edit_object(C) && CTX_data_edit_object(C)->type==OB_CURVE) return 0; // XXX - so we can use the spacebar for entering text + if(CTX_data_edit_object(C) && CTX_data_edit_object(C)->type==OB_FONT) return 0; // XXX - so we can use the spacebar for entering text return 1; } From 827938d08508da412691ae918e47cd39e8195e3d Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 14 Mar 2010 12:35:15 +0000 Subject: [PATCH 038/153] Bugfix for [#21602] "C" Hotkey conflict when editing curve. Remapped "Cyclic Toggle" to ALT+C. --- source/blender/editors/curve/curve_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index e672e7148b8..45fa7f0c192 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -203,7 +203,7 @@ void ED_keymap_curve(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "CURVE_OT_extrude", EKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "CURVE_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "CURVE_OT_make_segment", FKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "CURVE_OT_cyclic_toggle", CKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "CURVE_OT_cyclic_toggle", CKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "CURVE_OT_delete", XKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "CURVE_OT_delete", DELKEY, KM_PRESS, 0, 0); From 004925c0f163249b6de184346fe131c5a92e9e07 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 14 Mar 2010 12:49:55 +0000 Subject: [PATCH 039/153] Fix #21572: command line render start frame can't be < 1. I've set it to use MINFRAME now which is 0, negative frames are not supported for this yet. --- source/creator/creator.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/creator/creator.c b/source/creator/creator.c index 61079057c8f..9e910b7cad2 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -718,7 +718,7 @@ static int set_start_frame(int argc, char **argv, void *data) Scene *scene= CTX_data_scene(C); if (argc > 1) { int frame = atoi(argv[1]); - (scene->r.sfra) = MIN2(MAXFRAME, MAX2(1, frame)); + (scene->r.sfra) = CLAMPIS(frame, MINFRAME, MAXFRAME); return 1; } else { printf("\nError: frame number must follow '-s'.\n"); @@ -737,7 +737,7 @@ static int set_end_frame(int argc, char **argv, void *data) Scene *scene= CTX_data_scene(C); if (argc > 1) { int frame = atoi(argv[1]); - (scene->r.efra) = MIN2(MAXFRAME, MAX2(1, frame)); + (scene->r.efra) = CLAMPIS(frame, MINFRAME, MAXFRAME); return 1; } else { printf("\nError: frame number must follow '-e'.\n"); @@ -756,10 +756,10 @@ static int set_skip_frame(int argc, char **argv, void *data) Scene *scene= CTX_data_scene(C); if (argc > 1) { int frame = atoi(argv[1]); - (scene->r.frame_step) = MIN2(MAXFRAME, MAX2(1, frame)); + (scene->r.frame_step) = CLAMPIS(frame, 1, MAXFRAME); return 1; } else { - printf("\nError: number of frames must follow '-j'.\n"); + printf("\nError: number of frames to step must follow '-j'.\n"); return 0; } } else { From ac76568e67ed224c57279ab2603817910cb8a42e Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sun, 14 Mar 2010 13:05:42 +0000 Subject: [PATCH 040/153] Fixed incorrect calculation of constructive modifiers when rendering. DerivedMesh was crating from object's disp instead of specified one. --- source/blender/blenkernel/intern/displist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index ee746a4dacd..b9588f4520c 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1391,7 +1391,7 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba CDDM_calc_normals(dm); } } else { - dm= CDDM_from_curve(ob); + dm= CDDM_from_curve_customDB(ob, dispbase); if(dmDeformedVerts) { CDDM_apply_vert_coords(dm, dmDeformedVerts); From b89428ec4d045ca7aecd4908e49cdc1b96fe0275 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 14 Mar 2010 13:07:13 +0000 Subject: [PATCH 041/153] Fixing a part of [#21516]. Curve preset menu doesn't appear to be a menu. Converted to Operator Buttons. Fits well into the toolbar, lets hope, we won't get more presets. ;) --- release/scripts/ui/space_view3d_toolbar.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py index b8cde368e0b..d702c801b92 100644 --- a/release/scripts/ui/space_view3d_toolbar.py +++ b/release/scripts/ui/space_view3d_toolbar.py @@ -745,7 +745,11 @@ class VIEW3D_PT_tools_brush_curve(PaintPanel): brush = settings.brush layout.template_curve_mapping(brush, "curve", brush=True) - layout.operator_menu_enum("brush.curve_preset", property="shape") + + row = layout.row(align=True) + row.operator("brush.curve_preset", text="Sharp").shape = 'SHARP' + row.operator("brush.curve_preset", text="Smooth").shape = 'SMOOTH' + row.operator("brush.curve_preset", text="Max").shape = 'MAX' class VIEW3D_PT_sculpt_options(PaintPanel): From b2fba2eebe84386e78d8c925d0b14d3dd5746b81 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 14 Mar 2010 14:26:46 +0000 Subject: [PATCH 042/153] Fix #21171: ztransp render aliasing problem. --- source/blender/render/intern/source/zbuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 93e6f7a234a..1a4b469cc6f 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -3273,8 +3273,8 @@ static int zbuffer_abuf(Render *re, RenderPart *pa, APixstr *APixbuf, ListBase * zspan->mask= 1<zofsx= -pa->disprect.xmin + jit[zsample][0]; - zspan->zofsy= -pa->disprect.ymin + jit[zsample][1]; + zspan->zofsx= -pa->disprect.xmin - jit[zsample][0]; + zspan->zofsy= -pa->disprect.ymin - jit[zsample][1]; } else { zspan->zofsx= -pa->disprect.xmin; From 431db9d478dc48bcabe9859efd320f8210b5eeda Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Mar 2010 16:06:43 +0000 Subject: [PATCH 043/153] remove unused includes --- source/blender/python/generic/Geometry.c | 5 ----- source/blender/python/generic/IDProp.c | 5 ----- source/blender/python/generic/Mathutils.c | 2 -- .../python/generic/bpy_internal_import.c | 1 - source/blender/python/generic/euler.c | 3 --- source/blender/python/generic/quat.c | 1 - source/blender/python/intern/bpy.c | 2 -- source/blender/python/intern/bpy_app.c | 3 --- source/blender/python/intern/bpy_array.c | 7 ------- source/blender/python/intern/bpy_driver.c | 1 - source/blender/python/intern/bpy_interface.c | 20 +------------------ source/blender/python/intern/bpy_operator.c | 1 - .../blender/python/intern/bpy_operator_wrap.c | 3 --- source/blender/python/intern/bpy_props.c | 3 --- source/blender/python/intern/bpy_rna.c | 4 ---- .../blender/python/intern/bpy_rna_callback.c | 2 -- source/blender/python/intern/bpy_util.c | 2 -- 17 files changed, 1 insertion(+), 64 deletions(-) diff --git a/source/blender/python/generic/Geometry.c b/source/blender/python/generic/Geometry.c index fecad5904d2..f204fa62904 100644 --- a/source/blender/python/generic/Geometry.c +++ b/source/blender/python/generic/Geometry.c @@ -29,11 +29,6 @@ #include "Geometry.h" -/* - Not needed for now though other geometry functions will probably need them -#include "BLI_math.h" -#include "BKE_utildefines.h" -*/ - /* Used for PolyFill */ #include "BKE_displist.h" #include "MEM_guardedalloc.h" diff --git a/source/blender/python/generic/IDProp.c b/source/blender/python/generic/IDProp.c index decc28198ff..eb883be5a56 100644 --- a/source/blender/python/generic/IDProp.c +++ b/source/blender/python/generic/IDProp.c @@ -23,14 +23,9 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include "DNA_ID.h" - #include "BKE_idprop.h" #include "IDProp.h" -// #include "gen_utils.h" - -#include "MEM_guardedalloc.h" #define BSTR_EQ(a, b) (*(a) == *(b) && !strcmp(a, b)) diff --git a/source/blender/python/generic/Mathutils.c b/source/blender/python/generic/Mathutils.c index fc21c26dd74..1cf4d2254ea 100644 --- a/source/blender/python/generic/Mathutils.c +++ b/source/blender/python/generic/Mathutils.c @@ -50,8 +50,6 @@ #include "Mathutils.h" #include "BLI_math.h" -#include "PIL_time.h" -#include "BKE_utildefines.h" //-------------------------DOC STRINGS --------------------------- static char M_Mathutils_doc[] = diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index 873398e7763..fc0cd3fc18b 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -28,7 +28,6 @@ #include "bpy_internal_import.h" #include "DNA_text_types.h" -#include "DNA_ID.h" #include "MEM_guardedalloc.h" #include "BKE_text.h" /* txt_to_buf */ diff --git a/source/blender/python/generic/euler.c b/source/blender/python/generic/euler.c index 84360a76e61..3c018333b39 100644 --- a/source/blender/python/generic/euler.c +++ b/source/blender/python/generic/euler.c @@ -30,9 +30,6 @@ #include "BLI_math.h" #include "BKE_utildefines.h" -#include "BLI_blenlib.h" - -#include "BLO_sys_types.h" //----------------------------------Mathutils.Euler() ------------------- //makes a new euler for you to play with diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c index 3a9617c05c4..b08383cb508 100644 --- a/source/blender/python/generic/quat.c +++ b/source/blender/python/generic/quat.c @@ -30,7 +30,6 @@ #include "BLI_math.h" #include "BKE_utildefines.h" -#include "BLI_blenlib.h" //-----------------------------METHODS------------------------------ static char Quaternion_ToEuler_doc[] = diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 222e41c3bb8..0e105e03184 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -25,7 +25,6 @@ /* This file defines the '_bpy' module which is used by python's 'bpy' package. * a script writer should never directly access this module */ -#include #include "bpy_util.h" #include "bpy_rna.h" @@ -36,7 +35,6 @@ #include "BLI_path_util.h" /* external util modules */ -#include "../generic/Mathutils.h" #include "../generic/Geometry.h" #include "../generic/bgl.h" #include "../generic/blf.h" diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index 59c1c0bf7c2..be0406ce7c7 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -23,9 +23,6 @@ */ #include "bpy_app.h" -#include "bpy_util.h" - -#include "BLI_path_util.h" #include "BKE_blender.h" #include "BKE_global.h" diff --git a/source/blender/python/intern/bpy_array.c b/source/blender/python/intern/bpy_array.c index bb1826d231d..a20a7f54e22 100644 --- a/source/blender/python/intern/bpy_array.c +++ b/source/blender/python/intern/bpy_array.c @@ -22,14 +22,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include "Python.h" - #include "bpy_rna.h" - -#include "RNA_access.h" - -#include "BLI_string.h" - #include "BKE_global.h" #define MAX_ARRAY_DIMENSION 10 diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index f628e7e8569..de2f1837226 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -28,7 +28,6 @@ #include "BLI_listbase.h" -#include "BPY_extern.h" #include "BKE_fcurve.h" #include "BKE_global.h" diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 4160d56ba25..a4acaba8611 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -23,10 +23,6 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include -#include -#include -#include /* grr, python redefines */ @@ -34,33 +30,19 @@ #undef _POSIX_C_SOURCE #endif -#include -#include "compile.h" /* for the PyCodeObject */ -#include "eval.h" /* for PyEval_EvalCode */ #include "bpy.h" #include "bpy_rna.h" #include "bpy_util.h" -#ifndef WIN32 -#include -#else -#include "BLI_winstuff.h" -#endif - #include "DNA_space_types.h" #include "DNA_text_types.h" #include "MEM_guardedalloc.h" - -#include "BLI_storage.h" -#include "BLI_fileops.h" -#include "BLI_string.h" #include "BLI_path_util.h" #include "BKE_context.h" #include "BKE_text.h" -#include "BKE_context.h" #include "BKE_main.h" #include "BKE_global.h" /* only for script checking */ @@ -547,7 +529,7 @@ int BPY_run_python_script_space(const char *modulename, const char *func) // #define TIME_REGISTRATION #ifdef TIME_REGISTRATION -#include "PIL_time.h" +//(INCLUDE_LINT)#include "PIL_time.h" #endif diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index b2a8f5be097..0e54f158ac4 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -39,7 +39,6 @@ #include "MEM_guardedalloc.h" #include "BKE_report.h" -#include "BKE_utildefines.h" static PyObject *pyop_call( PyObject * self, PyObject * args) diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index 21ba815d95f..56d49fcc889 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -24,15 +24,12 @@ */ #include "bpy_operator_wrap.h" -#include "BKE_context.h" #include "WM_api.h" #include "WM_types.h" #include "RNA_define.h" #include "bpy_rna.h" -#include "bpy_props.h" -#include "bpy_util.h" static void operator_properties_init(wmOperatorType *ot) { diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 154f20e57c7..5bddd52dadf 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -26,14 +26,11 @@ #include "bpy_rna.h" #include "bpy_util.h" -#include "RNA_access.h" #include "RNA_define.h" /* for defining our own rna */ #include "RNA_enum_types.h" #include "MEM_guardedalloc.h" -#include "float.h" /* FLT_MIN/MAX */ - EnumPropertyItem property_flag_items[] = { {PROP_HIDDEN, "HIDDEN", 0, "Hidden", ""}, {PROP_ANIMATABLE, "ANIMATABLE", 0, "Animateable", ""}, diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 90de107d990..0c6709dff24 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -30,11 +30,8 @@ //#include "blendef.h" #include "BLI_dynstr.h" #include "BLI_listbase.h" -#include "BLI_string.h" #include "float.h" /* FLT_MIN/MAX */ -#include "RNA_access.h" -#include "RNA_define.h" /* for defining our own rna */ #include "RNA_enum_types.h" #include "MEM_guardedalloc.h" @@ -57,7 +54,6 @@ #include "../generic/Mathutils.h" /* so we can have mathutils callbacks */ #include "../generic/IDProp.h" /* for IDprop lookups */ -#include static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyRNA *self, PointerRNA *ptr, PropertyRNA *prop, int start, int stop, int length); static Py_ssize_t pyrna_prop_array_length(BPy_PropertyRNA *self); diff --git a/source/blender/python/intern/bpy_rna_callback.c b/source/blender/python/intern/bpy_rna_callback.c index c71429a76af..a49a534c61f 100644 --- a/source/blender/python/intern/bpy_rna_callback.c +++ b/source/blender/python/intern/bpy_rna_callback.c @@ -22,12 +22,10 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include "Python.h" #include "bpy_rna.h" #include "bpy_util.h" -#include "BLI_path_util.h" #include "DNA_screen_types.h" #include "BKE_context.h" #include "ED_space_api.h" diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index bd80b89cdc1..a2bcfa63c31 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -22,8 +22,6 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include "DNA_listBase.h" -#include "RNA_access.h" #include "bpy_util.h" #include "BLI_dynstr.h" #include "MEM_guardedalloc.h" From 6cac9188b31f7baec479fc694dd6a23d4c63ea4e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Mar 2010 16:27:07 +0000 Subject: [PATCH 044/153] remove unused includes --- .../editors/animation/anim_channels_defines.c | 26 +------------- .../editors/animation/anim_channels_edit.c | 31 ----------------- source/blender/editors/animation/anim_deps.c | 11 ------ source/blender/editors/animation/anim_draw.c | 25 -------------- .../blender/editors/animation/anim_filter.c | 24 ------------- .../editors/animation/anim_ipo_utils.c | 15 -------- .../blender/editors/animation/anim_markers.c | 10 ------ source/blender/editors/animation/anim_ops.c | 13 ------- source/blender/editors/animation/drivers.c | 28 --------------- .../blender/editors/animation/fmodifier_ui.c | 34 ------------------- .../editors/animation/keyframes_draw.c | 3 -- 11 files changed, 1 insertion(+), 219 deletions(-) diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 3e711ccc2c1..1ce66ecf602 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -25,10 +25,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include -#include -#include -#include + #ifdef HAVE_CONFIG_H #include @@ -39,54 +36,33 @@ #include "BLI_blenlib.h" #include "BLI_math.h" -#include "DNA_listBase.h" #include "DNA_anim_types.h" -#include "DNA_action_types.h" #include "DNA_armature_types.h" #include "DNA_camera_types.h" -#include "DNA_curve_types.h" #include "DNA_object_types.h" #include "DNA_particle_types.h" #include "DNA_screen_types.h" #include "DNA_scene_types.h" #include "DNA_space_types.h" -#include "DNA_constraint_types.h" #include "DNA_key_types.h" #include "DNA_lamp_types.h" #include "DNA_mesh_types.h" #include "DNA_material_types.h" -#include "DNA_texture_types.h" #include "DNA_meta_types.h" #include "DNA_node_types.h" -#include "DNA_userdef_types.h" -#include "DNA_gpencil_types.h" -#include "DNA_windowmanager_types.h" #include "DNA_world_types.h" #include "RNA_access.h" -#include "RNA_define.h" - -#include "BKE_animsys.h" -#include "BKE_action.h" #include "BKE_curve.h" -#include "BKE_depsgraph.h" -#include "BKE_fcurve.h" #include "BKE_key.h" -#include "BKE_material.h" -#include "BKE_object.h" #include "BKE_context.h" -#include "BKE_utildefines.h" #include "UI_interface.h" #include "UI_interface_icons.h" #include "UI_resources.h" -#include "UI_view2d.h" #include "ED_anim_api.h" #include "ED_keyframing.h" -#include "ED_keyframes_edit.h" // XXX move the select modes out of there! -#include "ED_screen.h" -#include "ED_space_api.h" #include "BIF_gl.h" diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 26dd0285a2f..4f8e09d3df9 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -25,11 +25,6 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include -#include -#include -#include - #ifdef HAVE_CONFIG_H #include #endif @@ -37,51 +32,25 @@ #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" -#include "BLI_math.h" -#include "DNA_listBase.h" #include "DNA_anim_types.h" -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_camera_types.h" -#include "DNA_curve_types.h" #include "DNA_object_types.h" -#include "DNA_particle_types.h" -#include "DNA_screen_types.h" #include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_constraint_types.h" #include "DNA_key_types.h" -#include "DNA_lamp_types.h" -#include "DNA_material_types.h" -#include "DNA_meta_types.h" -#include "DNA_userdef_types.h" -#include "DNA_gpencil_types.h" -#include "DNA_windowmanager_types.h" -#include "DNA_world_types.h" #include "RNA_access.h" #include "RNA_define.h" -#include "BKE_animsys.h" #include "BKE_action.h" -#include "BKE_depsgraph.h" #include "BKE_fcurve.h" -#include "BKE_key.h" -#include "BKE_material.h" -#include "BKE_object.h" #include "BKE_context.h" #include "BKE_global.h" -#include "BKE_utildefines.h" -#include "UI_interface.h" -#include "UI_resources.h" #include "UI_view2d.h" #include "ED_anim_api.h" #include "ED_keyframes_edit.h" // XXX move the select modes out of there! #include "ED_screen.h" -#include "ED_space_api.h" #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index 3f461889485..b332da34c73 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -26,14 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include #include -#include #include "MEM_guardedalloc.h" #include "DNA_anim_types.h" -#include "DNA_action_types.h" #include "DNA_armature_types.h" #include "DNA_object_types.h" #include "DNA_node_types.h" @@ -47,21 +44,13 @@ #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_global.h" -#include "BKE_main.h" #include "BKE_node.h" -#include "BKE_scene.h" #include "BKE_sequencer.h" -#include "BKE_screen.h" #include "BKE_utildefines.h" #include "RNA_access.h" -#include "RNA_define.h" #include "ED_anim_api.h" -#include "ED_screen.h" - -#include "WM_api.h" -#include "WM_types.h" /* **************************** depsgraph tagging ******************************** */ diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 9d723c1b8f5..8ac64a78d18 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -25,47 +25,22 @@ * * ***** END GPL LICENSE BLOCK ***** */ - -#include -#include #include "DNA_anim_types.h" -#include "DNA_action_types.h" -#include "DNA_curve_types.h" #include "DNA_object_types.h" -#include "DNA_space_types.h" #include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_windowmanager_types.h" - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" #include "BLI_math.h" -#include "BKE_animsys.h" -#include "BKE_action.h" #include "BKE_context.h" -#include "BKE_global.h" -#include "BKE_fcurve.h" -#include "BKE_main.h" #include "BKE_nla.h" #include "BKE_object.h" -#include "BKE_screen.h" -#include "BKE_utildefines.h" #include "ED_anim_api.h" #include "ED_keyframes_edit.h" -#include "ED_types.h" -#include "ED_util.h" - -#include "WM_api.h" -#include "WM_types.h" #include "RNA_access.h" #include "BIF_gl.h" -#include "BIF_glutil.h" #include "UI_interface.h" #include "UI_resources.h" diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 2bd4ab34fa5..15c899c6d8d 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -46,18 +46,11 @@ */ #include -#include -#include "DNA_listBase.h" -#include "DNA_ID.h" #include "DNA_anim_types.h" -#include "DNA_action_types.h" #include "DNA_armature_types.h" #include "DNA_constraint_types.h" #include "DNA_camera_types.h" -#include "DNA_curve_types.h" -#include "DNA_gpencil_types.h" -#include "DNA_group_types.h" #include "DNA_lamp_types.h" #include "DNA_lattice_types.h" #include "DNA_key_types.h" @@ -65,14 +58,11 @@ #include "DNA_mesh_types.h" #include "DNA_meta_types.h" #include "DNA_node_types.h" -#include "DNA_object_types.h" #include "DNA_particle_types.h" #include "DNA_space_types.h" #include "DNA_sequence_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" -#include "DNA_texture_types.h" -#include "DNA_windowmanager_types.h" #include "DNA_world_types.h" #include "MEM_guardedalloc.h" @@ -86,26 +76,12 @@ #include "BKE_global.h" #include "BKE_group.h" #include "BKE_key.h" -#include "BKE_object.h" #include "BKE_material.h" #include "BKE_node.h" #include "BKE_sequencer.h" -#include "BKE_screen.h" #include "BKE_utildefines.h" #include "ED_anim_api.h" -#include "ED_types.h" -#include "ED_util.h" - -#include "WM_api.h" -#include "WM_types.h" - -#include "BIF_gl.h" -#include "BIF_glutil.h" - -#include "UI_interface.h" -#include "UI_resources.h" -#include "UI_view2d.h" /* ************************************************************ */ /* Blender Context <-> Animation Context mapping */ diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 0f29c274535..2167be2a16a 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -33,31 +33,16 @@ */ -#include -#include -#include - #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" #include "BLI_math.h" #include "DNA_anim_types.h" -#include "DNA_key_types.h" -#include "DNA_object_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_view3d_types.h" -#include "BKE_animsys.h" -#include "BKE_key.h" #include "BKE_utildefines.h" -#include "UI_resources.h" -#include "ED_anim_api.h" - #include "RNA_access.h" -#include "RNA_types.h" /* ----------------------- Getter functions ----------------------- */ diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 2888a95f704..310fa127dcd 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -26,18 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include #include #include "MEM_guardedalloc.h" -#include "DNA_action_types.h" #include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_view2d_types.h" -#include "DNA_userdef_types.h" -#include "DNA_windowmanager_types.h" #include "DNA_object_types.h" #include "RNA_access.h" @@ -47,9 +40,7 @@ #include "BLI_blenlib.h" #include "BKE_context.h" -#include "BKE_global.h" #include "BKE_fcurve.h" -#include "BKE_utildefines.h" #include "BKE_main.h" #include "BKE_report.h" #include "BKE_scene.h" @@ -67,7 +58,6 @@ #include "ED_markers.h" #include "ED_screen.h" -#include "ED_types.h" #include "ED_util.h" #include "ED_numinput.h" #include "ED_object.h" diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 4e310e27c5f..670a92e664b 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -29,22 +29,12 @@ #include #include -#include "MEM_guardedalloc.h" - #include "DNA_anim_types.h" -#include "DNA_action_types.h" #include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_windowmanager_types.h" - -#include "BLI_blenlib.h" #include "BKE_context.h" -#include "BKE_utildefines.h" #include "BKE_sound.h" -#include "UI_interface.h" #include "UI_view2d.h" #include "RNA_access.h" @@ -53,9 +43,6 @@ #include "WM_api.h" #include "WM_types.h" -#include "ED_anim_api.h" -#include "ED_keyframing.h" -#include "ED_markers.h" #include "ED_screen.h" #include "anim_intern.h" diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index ababa25917a..5024ca39970 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -27,45 +27,18 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include -#include #include -#include -#include #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" -#include "BLI_math.h" -#include "BLI_dynstr.h" #include "DNA_anim_types.h" -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_constraint_types.h" -#include "DNA_key_types.h" -#include "DNA_object_types.h" -#include "DNA_material_types.h" -#include "DNA_scene_types.h" -#include "DNA_userdef_types.h" -#include "DNA_windowmanager_types.h" #include "BKE_animsys.h" -#include "BKE_action.h" -#include "BKE_constraint.h" #include "BKE_depsgraph.h" #include "BKE_fcurve.h" -#include "BKE_utildefines.h" #include "BKE_context.h" -#include "BKE_report.h" -#include "BKE_key.h" -#include "BKE_material.h" - -#include "ED_anim_api.h" -#include "ED_keyframing.h" -#include "ED_keyframes_edit.h" -#include "ED_screen.h" -#include "ED_util.h" #include "UI_interface.h" @@ -74,7 +47,6 @@ #include "RNA_access.h" #include "RNA_define.h" -#include "RNA_types.h" /* ************************************************** */ /* Animation Data Validation */ diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 651ce34a2f2..9d0fe99976b 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -33,56 +33,22 @@ */ #include -#include -#include -#include #include "DNA_anim_types.h" -#include "DNA_action_types.h" -#include "DNA_object_types.h" -#include "DNA_space_types.h" #include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_userdef_types.h" #include "MEM_guardedalloc.h" -#include "BLI_math.h" -#include "BLI_blenlib.h" -#include "BLI_editVert.h" -#include "BLI_rand.h" - -#include "BKE_animsys.h" -#include "BKE_action.h" #include "BKE_context.h" -#include "BKE_curve.h" -#include "BKE_customdata.h" -#include "BKE_depsgraph.h" #include "BKE_fcurve.h" -#include "BKE_object.h" -#include "BKE_global.h" -#include "BKE_nla.h" -#include "BKE_scene.h" -#include "BKE_screen.h" -#include "BKE_utildefines.h" - -#include "BIF_gl.h" #include "WM_api.h" #include "WM_types.h" #include "RNA_access.h" -#include "RNA_define.h" - -#include "ED_anim_api.h" -#include "ED_keyframing.h" -#include "ED_screen.h" -#include "ED_types.h" -#include "ED_util.h" #include "UI_interface.h" #include "UI_resources.h" -#include "UI_view2d.h" // XXX! -------------------------------- /* temporary definition for limits of float number buttons (FLT_MAX tends to infinity with old system) */ diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 011422eb65c..69f9583ed33 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -86,10 +86,7 @@ #include "UI_view2d.h" #include "ED_anim_api.h" -#include "ED_keyframing.h" #include "ED_keyframes_draw.h" -#include "ED_screen.h" -#include "ED_space_api.h" /* *************************** Keyframe Processing *************************** */ From 128ecc7e822cdc989175a348edcc20f6858d6805 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 14 Mar 2010 16:36:41 +0000 Subject: [PATCH 045/153] == Sequencer == This fixes [#21087] Opacity of 0 turns off effect rather than affecting transparency and makes the whole early_out-business in strip stack a lot more readable. The actual fix is just using the composited result in layer fall through case (se1->ibuf_comp instead of se1->ibuf). --- source/blender/blenkernel/intern/sequencer.c | 78 +++++++++++++------- 1 file changed, 53 insertions(+), 25 deletions(-) diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 341d0a542e6..d43747cf3f3 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -2452,6 +2452,42 @@ static TStripElem* do_build_seq_recursively(Scene *scene, Sequence * seq, int cf return se; } +static int seq_must_swap_input_in_blend_mode(Sequence * seq) +{ + int swap_input = FALSE; + + /* bad hack, to fix crazy input ordering of + those two effects */ + + if (seq->blend_mode == SEQ_ALPHAOVER || + seq->blend_mode == SEQ_ALPHAUNDER || + seq->blend_mode == SEQ_OVERDROP) { + swap_input = TRUE; + } + + return swap_input; +} + +static int seq_get_early_out_for_blend_mode(Sequence * seq) +{ + struct SeqEffectHandle sh = get_sequence_blend(seq); + float facf = seq->blend_opacity / 100.0; + int early_out = sh.early_out(seq, facf, facf); + + if (early_out < 1) { + return early_out; + } + + if (seq_must_swap_input_in_blend_mode(seq)) { + if (early_out == 2) { + return 1; + } else if (early_out == 1) { + return 2; + } + } + return early_out; +} + static TStripElem* do_build_seq_array_recursively(Scene *scene, ListBase *seqbasep, int cfra, int chanshown, int render_size) { @@ -2460,7 +2496,8 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene, int i; TStripElem* se = 0; - count = get_shown_sequences(seqbasep, cfra, chanshown, (Sequence **)&seq_arr); + count = get_shown_sequences(seqbasep, cfra, chanshown, + (Sequence **)&seq_arr); if (!count) { return 0; @@ -2483,7 +2520,8 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene, if(count == 1) { - se = do_build_seq_recursively(scene, seq_arr[0], cfra, render_size); + se = do_build_seq_recursively(scene, seq_arr[0], + cfra, render_size); if (se->ibuf) { se->ibuf_comp = se->ibuf; IMB_refImBuf(se->ibuf_comp); @@ -2495,8 +2533,6 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene, for (i = count - 1; i >= 0; i--) { int early_out; Sequence * seq = seq_arr[i]; - struct SeqEffectHandle sh; - float facf; se = give_tstripelem(seq, cfra); @@ -2506,7 +2542,9 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene, break; } if (seq->blend_mode == SEQ_BLEND_REPLACE) { - do_build_seq_recursively(scene, seq, cfra, render_size); + do_build_seq_recursively( + scene, seq, cfra, render_size); + if (se->ibuf) { se->ibuf_comp = se->ibuf; IMB_refImBuf(se->ibuf); @@ -2521,16 +2559,14 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene, break; } - sh = get_sequence_blend(seq); - - facf = seq->blend_opacity / 100.0; - - early_out = sh.early_out(seq, facf, facf); + early_out = seq_get_early_out_for_blend_mode(seq); switch (early_out) { case -1: case 2: - do_build_seq_recursively(scene, seq, cfra, render_size); + do_build_seq_recursively( + scene, seq, cfra, render_size); + if (se->ibuf) { se->ibuf_comp = se->ibuf; IMB_refImBuf(se->ibuf_comp); @@ -2554,7 +2590,9 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene, } break; case 0: - do_build_seq_recursively(scene, seq, cfra, render_size); + do_build_seq_recursively( + scene, seq, cfra, render_size); + if (!se->ibuf) { se->ibuf = IMB_allocImBuf( (short)seqrectx, (short)seqrecty, @@ -2584,14 +2622,13 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene, TStripElem* se2 = give_tstripelem(seq_arr[i], cfra); float facf = seq->blend_opacity / 100.0; - - int early_out = sh.early_out(seq, facf, facf); + int swap_input = seq_must_swap_input_in_blend_mode(seq); + int early_out = seq_get_early_out_for_blend_mode(seq); switch (early_out) { case 0: { int x= se2->ibuf->x; int y= se2->ibuf->y; - int swap_input = FALSE; if(se1->ibuf_comp == NULL) continue; @@ -2626,15 +2663,6 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene, IMB_rect_from_float(se2->ibuf); } - /* bad hack, to fix crazy input ordering of - those two effects */ - - if (seq->blend_mode == SEQ_ALPHAOVER || - seq->blend_mode == SEQ_ALPHAUNDER || - seq->blend_mode == SEQ_OVERDROP) { - swap_input = TRUE; - } - if (swap_input) { sh.execute(scene, seq, cfra, facf, facf, x, y, @@ -2657,7 +2685,7 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene, break; } case 1: { - se2->ibuf_comp = se1->ibuf; + se2->ibuf_comp = se1->ibuf_comp; if(se2->ibuf_comp) IMB_refImBuf(se2->ibuf_comp); From e3c746659e378d5e739f97a9256cbfe1fdec6fee Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Mar 2010 17:18:36 +0000 Subject: [PATCH 046/153] strip quites off buildinfo at startup (was doing this for splash screen and python api) --- source/blender/python/intern/bpy_app.c | 37 ++++++------------- source/blender/python/intern/bpy_interface.c | 6 --- .../windowmanager/intern/wm_operators.c | 12 +----- source/creator/buildinfo.c | 10 ++--- source/creator/creator.c | 32 +++++++++++++--- 5 files changed, 44 insertions(+), 53 deletions(-) diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index be0406ce7c7..ce5eea728a8 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -24,16 +24,18 @@ #include "bpy_app.h" +#include "BLI_path_util.h" + #include "BKE_blender.h" #include "BKE_global.h" #include "structseq.h" #ifdef BUILD_DATE -extern const char * build_date; -extern const char * build_time; -extern const char * build_rev; -extern const char * build_platform; -extern const char * build_type; +extern char build_date[]; +extern char build_time[]; +extern char build_rev[]; +extern char build_platform[]; +extern char build_type[]; #endif static PyTypeObject BlenderAppType; @@ -61,24 +63,9 @@ static PyStructSequence_Desc app_info_desc = { 10 }; -static char *strip_quotes(char *buf, const char *input) -{ - int i; - strcpy(buf, input); - if(buf[0]=='\0') return buf; - while(buf[1] && (buf[0]=='"' || buf[0]=='\'')) buf++; - if(buf[0]=='\0') return buf; - i= strlen(buf) - 1; - while(i>=0 && (buf[i]=='"' || buf[i]=='\'')) i--; - buf[i+1]= '\0'; - - return buf; -} - static PyObject *make_app_info(void) { extern char bprogname[]; /* argv[0] from creator.c */ - char buf[256]; PyObject *app_info; int pos = 0; @@ -103,11 +90,11 @@ static PyObject *make_app_info(void) /* build info */ #ifdef BUILD_DATE - SetStrItem(strip_quotes(buf, build_date)); - SetStrItem(strip_quotes(buf, build_time)); - SetStrItem(strip_quotes(buf, build_rev)); - SetStrItem(strip_quotes(buf, build_platform)); - SetStrItem(strip_quotes(buf, build_type)); + SetStrItem(build_date); + SetStrItem(build_time); + SetStrItem(build_rev); + SetStrItem(build_platform); + SetStrItem(build_type); #else SetStrItem(strip_quotes(buf, "Unknown")); SetStrItem(strip_quotes(buf, "Unknown")); diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index a4acaba8611..8e93751a490 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -526,12 +526,6 @@ int BPY_run_python_script_space(const char *modulename, const char *func) } #endif -// #define TIME_REGISTRATION - -#ifdef TIME_REGISTRATION -//(INCLUDE_LINT)#include "PIL_time.h" -#endif - int BPY_button_eval(bContext *C, char *expr, double *value) { diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 4d8e48f1e8e..7d16fba404c 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1060,7 +1060,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse char *revision_str = NULL; char version_buf[128]; char revision_buf[128]; - extern char * build_rev; + extern char build_rev[]; char *cp; version_str = &version_buf[0]; @@ -1069,16 +1069,6 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse sprintf(version_str, "%d.%02d.%d", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION); sprintf(revision_str, "r%s", build_rev); - /* here on my system I get ugly double quotes around the revision number. - * if so, clip it off: */ - cp = strchr(revision_str, '"'); - if (cp) { - memmove(cp, cp+1, strlen(cp+1)); - cp = strchr(revision_str, '"'); - if (cp) - *cp = 0; - } - BLF_size(style->widgetlabel.points, U.dpi); ver_width = BLF_width(version_str)+5; rev_width = BLF_width(revision_str)+5; diff --git a/source/creator/buildinfo.c b/source/creator/buildinfo.c index d50a99e8850..8b02dde1a5f 100644 --- a/source/creator/buildinfo.c +++ b/source/creator/buildinfo.c @@ -35,9 +35,9 @@ #define XSTRINGIFY(x) #x #ifdef BUILD_DATE -const char * build_date=STRINGIFY(BUILD_DATE); -const char * build_time=STRINGIFY(BUILD_TIME); -const char * build_rev=STRINGIFY(BUILD_REV); -const char * build_platform=STRINGIFY(BUILD_PLATFORM); -const char * build_type=STRINGIFY(BUILD_TYPE); +char build_date[]= STRINGIFY(BUILD_DATE); +char build_time[]= STRINGIFY(BUILD_TIME); +char build_rev[]= STRINGIFY(BUILD_REV); +char build_platform[]= STRINGIFY(BUILD_PLATFORM); +char build_type[]= STRINGIFY(BUILD_TYPE); #endif diff --git a/source/creator/creator.c b/source/creator/creator.c index 9e910b7cad2..91b4ed09b40 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -107,11 +107,11 @@ // from buildinfo.c #ifdef BUILD_DATE -extern const char * build_date; -extern const char * build_time; -extern const char * build_rev; -extern const char * build_platform; -extern const char * build_type; +extern char build_date[]; +extern char build_time[]; +extern char build_rev[]; +extern char build_platform[]; +extern char build_type[]; #endif /* Local Function prototypes */ @@ -161,6 +161,18 @@ static void blender_esc(int sig) } } +/* buildinfo can have quotes */ +static void strip_quotes(char *str) +{ + if(str[0] == '"') { + int len= strlen(str) - 1; + memmove(str, str+1, len); + if(str[len-1] == '"') { + str[len-1]= '\0'; + } + } +} + static int print_version(int argc, char **argv, void *data) { #ifdef BUILD_DATE @@ -936,7 +948,15 @@ int main(int argc, char **argv) if(blender_path_env) BLI_strncpy(blender_path, blender_path_env, sizeof(blender_path)); } - + +#ifdef BUILD_DATE + strip_quotes(build_date); + strip_quotes(build_time); + strip_quotes(build_rev); + strip_quotes(build_platform); + strip_quotes(build_type); +#endif + RNA_init(); RE_engines_init(); From 891301c3a2f753a383a5adc843a544bb41ecd677 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 14 Mar 2010 17:32:35 +0000 Subject: [PATCH 047/153] Addons: Some code changes: * Every Add-On now needs a dictionary with several infos, which are then displayed in the Blender UI and/or are used internally. Example: bl_addon_info = {'name': 'Measure panel', 'author': 'Buerbaum Martin (Pontiac)', 'version': '0.6.3', 'blender': '2.5.2', 'location': 'View3D > Properties > Measure', 'url': 'http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/Panel_Measure', 'category' : 'UI'} Unfinished/Not working yet * The 'blender' tag is compared with the internal version number, it raises an error if the add-on was written for a newer Blender version. * The 'category' tag will be added to the filter, so the add-ons can be searched/filtered. --- release/scripts/ui/space_userpref.py | 132 ++++++--------------------- 1 file changed, 30 insertions(+), 102 deletions(-) diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 24c5063f6b9..c8cb6d9dcca 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -1404,79 +1404,18 @@ class USERPREF_PT_addons(bpy.types.Panel): module_name = mod.__name__ if not hasattr(mod, 'expanded'): mod.expanded = False + + info = getattr(mod, "bl_addon_info", {}) - script = hasattr(mod, '__script__') - location = hasattr(mod, '__location__') - author = hasattr(mod, '__author__') - version = hasattr(mod, '__version__') - blender = hasattr(mod, '__blender__') - category = hasattr(mod, '__category__') - url = hasattr(mod, '__url__') - email = hasattr(mod, '__email__') - bpydoc = hasattr(mod, '__bpydoc__') + name = info.get("name", "") + author = info.get("author", "") + version = info.get("version", "") + blender = info.get("blender", "") + location = info.get("location", "") + url = info.get("url", "") + category = info.get("category", "") - if script: - script = str(mod.__script__) - else: - script = module_name - if location: - location = str(mod.__location__) - if version: - version = str(mod.__version__) - if author: - if type(mod.__author__).__name__ == 'list': - if len(mod.__author__) == 0: - author = False - else: - author = "" - for i in mod.__author__: - author += str(i) + ", " - author = author[:-2] - else: - author = str(mod.__author__) - if blender: - blender = str(mod.__blender__) - if category: - if type(mod.__category__).__name__ != 'list': - category = str(mod.__category__) - else: - category = str(mod.__category__[0]) - links = [] - if url: - if type(mod.__url__).__name__ != 'list': - mod.__url__ = [str(mod.__url__)] - for i in mod.__url__: - link = str(i).rsplit(',', 1) - if len(link)>1: - link_desc = link[0].strip() - link = link[1].strip() - else: - link_desc = False - link = link[0].strip() - if link.lower() == 'blender': - link = 'http://www.blender.org/forum/viewforum.php?f=9' - if link.lower() == 'blenderartists': - link = 'http://blenderartists.org/forum/forumdisplay.php?f=11' - links.append([link, link_desc]) - emails = [] - if email: - if type(mod.__email__).__name__ != 'list': - mod.__email__ = [str(mod.__email__)] - for i in mod.__email__: - mail = str(i).rsplit(',', 1) - if len(mail)>1: - mail_desc = mail[0].strip() - mail = mail[1].strip() - else: - mail_desc = False - mail = mail[0].strip() - if mail.lower() == 'python': - mail = 'bf-python:blender*org' - mail = 'mailto:'+mail.replace(':','@').replace('*','.')+"?subject="+script - emails.append([mail, mail_desc]) - if bpydoc: - bpydoc = str(mod.__bpydoc__).splitlines() - return module_name, script, author, version, blender, location, category, url, email, bpydoc, links, emails + return module_name, name, author, version, blender, location, url, category def draw(self, context): layout = self.layout @@ -1488,12 +1427,14 @@ class USERPREF_PT_addons(bpy.types.Panel): cats = [] for mod in self._addon_list(): try: - if mod.__category__[0] not in cats: - cats.append(mod.__category__[0]) + if category not in cats: + cats.append(category) except: pass + cats.sort() cats = ['All', 'Disabled', 'Enabled']+cats + bpy.types.Scene.EnumProperty(items=[(cats[i],cats[i],str(i)) for i in range(len(cats))], name="Category", attr="addon_filter", description="Filter add-ons by category") bpy.types.Scene.StringProperty(name="Search", attr="addon_search", @@ -1507,14 +1448,14 @@ class USERPREF_PT_addons(bpy.types.Panel): filter = context.scene.addon_filter search = context.scene.addon_search for mod in self._addon_list(): - module_name, script, author, version, blender, location, category, url, email, bpydoc, links, emails = \ + module_name, name, author, version, blender, location, url, category = \ self._attributes(mod) # check if add-on should be visible with current filters if filter!='All' and filter!=category and not (module_name in used_ext and filter=='Enabled')\ and not (module_name not in used_ext and filter=='Disabled'): continue - if search and script.lower().find(search.lower())<0: + if search and name.lower().find(search.lower())<0: if author: if author.lower().find(search.lower())<0: continue @@ -1523,22 +1464,25 @@ class USERPREF_PT_addons(bpy.types.Panel): # Addon UI Code box = layout.column().box() - column = box.column(align=True) + column = box.column() row = column.row() # Arrow # # If there are Infos or UI is expanded if mod.expanded: row.operator("wm.addon_expand", icon="TRIA_DOWN").module = module_name - elif author or version or url or email: + elif author or version or url or location: row.operator("wm.addon_expand", icon="TRIA_RIGHT").module = module_name else: # Else, block UI arrow = row.column() arrow.enabled = False arrow.operator("wm.addon_expand", icon="TRIA_RIGHT").module = module_name - - row.label(text=script) + + if name: + row.label(text=name) + else: #For now, can be removed when all addons, have a proper dict + row.label(text=module_name) row.operator("wm.addon_disable" if module_name in used_ext else "wm.addon_enable").module = module_name # Expanded UI (only if additional infos are available) @@ -1557,26 +1501,10 @@ class USERPREF_PT_addons(bpy.types.Panel): split.label(text=location) if url: split = column.row().split(percentage=0.15) - split.label(text="Links:") - for i in range(len(links)): - if links[i][1]: - split.operator("wm.addon_links", text=links[i][1]).link = links[i][0] - else: - split.operator("wm.addon_links", text="Link "+str(i+1)).link = links[i][0] - if email: - split = column.row().split(percentage=0.15) - split.label(text="Email:") - for i in range(len(emails)): - if emails[i][1]: - split.operator("wm.addon_links", text=emails[i][1]).link = emails[i][0] - else: - split.operator("wm.addon_links", text="Email "+str(i+1)).link = emails[i][0] - if bpydoc: - column = box.column(align=True) - column.label(text='Description: '+bpydoc[0]) - for line in bpydoc[1:]: - column.label(text=line) - + split.label(text="Internet:") + split.operator("wm.addon_links", text="Link to the Wiki").link = url + split.separator() + split.separator() from bpy.props import * @@ -1601,9 +1529,9 @@ class WM_OT_addon_enable(bpy.types.Operator): traceback.print_exc() # check if add-on is written for current blender version, or raise a warning - version = hasattr(mod, '__blender__') + version = hasattr(mod, 'blender') if version: - version = str(mod.__blender__).split('.',2) + version = (mod.blender).split('.',2) for i in range(len(version)): try: version[i] = int(version[i]) @@ -1737,7 +1665,7 @@ class WM_OT_addon_expand(bpy.types.Operator): class WM_OT_addon_links(bpy.types.Operator): - "Open in webbrowser" + "Open the Blender Wiki in the Webbrowser" bl_idname = "wm.addon_links" bl_label = "" From 07d4307af28aa4df4227ae44326831846f81da9e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Mar 2010 17:54:08 +0000 Subject: [PATCH 048/153] attempt to fix build error on msvc --- source/blender/python/generic/euler.c | 4 ++++ source/blender/python/intern/bpy_app.c | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/source/blender/python/generic/euler.c b/source/blender/python/generic/euler.c index 3c018333b39..3c20d341c7b 100644 --- a/source/blender/python/generic/euler.c +++ b/source/blender/python/generic/euler.c @@ -31,6 +31,10 @@ #include "BLI_math.h" #include "BKE_utildefines.h" +#ifndef int32_t +#include "BLO_sys_types.h" +#endif + //----------------------------------Mathutils.Euler() ------------------- //makes a new euler for you to play with static PyObject *Euler_new(PyTypeObject * type, PyObject * args, PyObject * kwargs) diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index ce5eea728a8..e90b58d9fac 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -96,11 +96,11 @@ static PyObject *make_app_info(void) SetStrItem(build_platform); SetStrItem(build_type); #else - SetStrItem(strip_quotes(buf, "Unknown")); - SetStrItem(strip_quotes(buf, "Unknown")); - SetStrItem(strip_quotes(buf, "Unknown")); - SetStrItem(strip_quotes(buf, "Unknown")); - SetStrItem(strip_quotes(buf, "Unknown")); + SetStrItem("Unknown"); + SetStrItem("Unknown"); + SetStrItem("Unknown"); + SetStrItem("Unknown"); + SetStrItem("Unknown"); #endif #undef SetIntItem From a892bd6976be9e73796a320a36246171ddc59da0 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Sun, 14 Mar 2010 18:02:18 +0000 Subject: [PATCH 049/153] fix for bugreport: #21506 'sort by' while in append/link file browser causes files to disappear - issue was that the objects were still filtered - temporary fix until refactoring of the append/link integration --- source/blender/editors/space_file/filesel.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 868e28207c5..758740e676a 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -55,6 +55,8 @@ #include "BLI_storage_types.h" #include "BLI_dynstr.h" +#include "BLO_readfile.h" + #include "BKE_context.h" #include "BKE_screen.h" #include "BKE_global.h" @@ -404,7 +406,16 @@ void file_change_dir(bContext *C, int checkdir) /* could return but just refresh the current dir */ } filelist_setdir(sfile->files, sfile->params->dir); - + /* XXX special case handling + behaviour of filebrowser changes when + browsing into .blend file */ + if (sfile->params->type == FILE_LOADLIB) { + char group[GROUP_MAX]; + char dir[FILE_MAX]; + if (filelist_islibrary(sfile->files, dir, group)) { + sfile->params->flag &= ~FILE_FILTER; + } + } if(folderlist_clear_next(sfile)) folderlist_free(sfile->folders_next); From d8d92b5d93e3553150fe9f28f1efbc4c3534c395 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Mar 2010 18:08:12 +0000 Subject: [PATCH 050/153] user preference to disable the splash screen --- release/scripts/ui/space_userpref.py | 4 ++++ source/blender/makesdna/DNA_userdef_types.h | 1 + source/blender/makesrna/intern/rna_userdef.c | 4 ++++ source/blender/windowmanager/intern/wm_init_exit.c | 14 ++++++++------ source/creator/creator.c | 2 +- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index c8cb6d9dcca..61c514135bd 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -279,6 +279,10 @@ class USERPREF_PT_interface(bpy.types.Panel): col.label(text="Menu Open Delay:") col.prop(view, "open_toplevel_delay", text="Top Level") col.prop(view, "open_sublevel_delay", text="Sub Level") + + col.separator() + + col.prop(view, "show_splash") class USERPREF_PT_edit(bpy.types.Panel): diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 7ed30b3e876..4ebc2594c8f 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -454,6 +454,7 @@ extern UserDef U; /* from blenkernel blender.c */ #define USER_CONTINUOUS_MOUSE (1 << 24) #define USER_ZOOM_INVERT (1 << 25) #define USER_ZOOM_DOLLY_HORIZ (1 << 26) +#define USER_SPLASH_DISABLE (1 << 27) /* Auto-Keying mode */ /* AUTOKEY_ON is a bitflag */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 39619e42e7e..8a1b37c2ecf 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -1895,6 +1895,10 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_VIEWPORTNAME); RNA_def_property_ui_text(prop, "Show View Name", "Show the name of the view's direction in each 3D View"); RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop= RNA_def_property(srna, "show_splash", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_SPLASH_DISABLE); + RNA_def_property_ui_text(prop, "Show Splash", "Display splash screen on startup"); prop= RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_FPS); diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index f825bb28547..8e3c9312edd 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -173,13 +173,15 @@ void WM_init(bContext *C, int argc, char **argv) void WM_init_splash(bContext *C) { - wmWindowManager *wm= CTX_wm_manager(C); - wmWindow *prevwin= CTX_wm_window(C); + if((U.uiflag & USER_SPLASH_DISABLE) == 0) { + wmWindowManager *wm= CTX_wm_manager(C); + wmWindow *prevwin= CTX_wm_window(C); - if(wm->windows.first) { - CTX_wm_window_set(C, wm->windows.first); - WM_operator_name_call(C, "WM_OT_splash", WM_OP_INVOKE_DEFAULT, NULL); - CTX_wm_window_set(C, prevwin); + if(wm->windows.first) { + CTX_wm_window_set(C, wm->windows.first); + WM_operator_name_call(C, "WM_OT_splash", WM_OP_INVOKE_DEFAULT, NULL); + CTX_wm_window_set(C, prevwin); + } } } diff --git a/source/creator/creator.c b/source/creator/creator.c index 91b4ed09b40..bf45a89fa5b 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -196,7 +196,7 @@ static int print_help(int argc, char **argv, void *data) printf ("Blender %d.%02d (sub %d) Build\n", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION); printf ("Usage: blender [args ...] [file] [args ...]\n"); printf ("\nRender options:\n"); - printf (" -b \tRender in background (doesn't load the user defaults .B.blend file)\n"); + printf (" -b \tLoad in background (often used for background rendering)\n"); printf (" -a render frames from start to end (inclusive), only works when used after -b\n"); printf (" -S \tSet scene \n"); printf (" -f \tRender frame and save it\n"); From 7ecba90f652ae2b1f9ea5256ab3a418845c20213 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 14 Mar 2010 18:22:04 +0000 Subject: [PATCH 051/153] Remove SAT texture filter. It's not working, thought it was but that's because the mipmap was not being refreshed. Also this will be problematic to support when I add tile/mipmap cache, so would not rather not try to. Can be added back afterwards if someone wants to make it work. --- .../editors/space_view3d/view3d_draw.c | 2 +- source/blender/imbuf/IMB_imbuf.h | 2 +- source/blender/imbuf/intern/filter.c | 109 +---------- source/blender/imbuf/intern/tiff.c | 28 +-- source/blender/makesdna/DNA_texture_types.h | 2 - source/blender/makesrna/intern/rna_texture.c | 22 +-- .../render/intern/source/imagetexture.c | 179 +++--------------- 7 files changed, 54 insertions(+), 290 deletions(-) diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index c5e0f096c04..ac66dfa621c 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1362,7 +1362,7 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d) int mip= 0; if(ibuf->mipmap[0]==NULL) - IMB_makemipmap(ibuf, 0, 0); + IMB_makemipmap(ibuf, 0); while(tzoom < 1.0f && mip<8 && ibuf->mipmap[mip]) { tzoom*= 2.0f; diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index a77ef54b0b6..14c58496352 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -317,7 +317,7 @@ void IMB_antialias(struct ImBuf * ibuf); void IMB_filter(struct ImBuf *ibuf); void IMB_filterN(struct ImBuf *out, struct ImBuf *in); void IMB_filter_extend(struct ImBuf *ibuf, char *mask); -void IMB_makemipmap(struct ImBuf *ibuf, int use_filter, int SAT); +void IMB_makemipmap(struct ImBuf *ibuf, int use_filter); /** * diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/intern/filter.c index 76ed0e2c61f..5692686a9bc 100644 --- a/source/blender/imbuf/intern/filter.c +++ b/source/blender/imbuf/intern/filter.c @@ -371,114 +371,21 @@ void IMB_filter_extend(struct ImBuf *ibuf, char *mask) } } -#if 0 void IMB_makemipmap(ImBuf *ibuf, int use_filter) { - ImBuf *hbuf= ibuf; - int minsize, curmap=0; - - minsize= ibuf->xy?ibuf->x:ibuf->y; - - while(minsize>10 && curmapx, hbuf->y, 32, IB_rect, 0); IMB_filterN(nbuf, hbuf); - ibuf->mipmap[curmap]= IMB_onehalf(nbuf); + ibuf->mipmap[curmap] = IMB_onehalf(nbuf); IMB_freeImBuf(nbuf); } - else { - ibuf->mipmap[curmap]= IMB_onehalf(hbuf); - } - hbuf= ibuf->mipmap[curmap]; - + else ibuf->mipmap[curmap] = IMB_onehalf(hbuf); + hbuf = ibuf->mipmap[curmap]; + if (hbuf->x == 1 && hbuf->y == 1) break; curmap++; - minsize= hbuf->xy?hbuf->x:hbuf->y; } } -#endif -void IMB_makemipmap(ImBuf *ibuf, int use_filter, int SAT) -{ - if (SAT) { - // to maximize precision subtract image average, use intermediate double SAT, - // only convert to float at the end - const double dv = 1.0/255.0; - double avg[4] = {0, 0, 0, 0}; - const int x4 = ibuf->x << 2; - int x, y, i; - ImBuf* sbuf = IMB_allocImBuf(ibuf->x, ibuf->y, 32, IB_rectfloat, 0); - double *satp, *satbuf = MEM_callocN(sizeof(double)*ibuf->x*ibuf->y*4, "tmp SAT buf"); - const double mf = ibuf->x*ibuf->y; - float* fp; - ibuf->mipmap[0] = sbuf; - if (ibuf->rect_float) { - fp = ibuf->rect_float; - for (y=0; yy; ++y) - for (x=0; xx; ++x) { - avg[0] += *fp++; - avg[1] += *fp++; - avg[2] += *fp++; - avg[3] += *fp++; - } - } - else { - char* cp = (char*)ibuf->rect; - for (y=0; yy; ++y) - for (x=0; xx; ++x) { - avg[0] += *cp++ * dv; - avg[1] += *cp++ * dv; - avg[2] += *cp++ * dv; - avg[3] += *cp++ * dv; - } - } - avg[0] /= mf; - avg[1] /= mf; - avg[2] /= mf; - avg[3] /= mf; - for (y=0; yy; ++y) - for (x=0; xx; ++x) { - const unsigned int p = (x + y*ibuf->x) << 2; - char* cp = (char*)ibuf->rect + p; - fp = ibuf->rect_float + p; - satp = satbuf + p; - for (i=0; i<4; ++i, ++cp, ++fp, ++satp) { - double sv = (ibuf->rect_float ? (double)*fp : (double)(*cp)*dv) - avg[i]; - if (x > 0) sv += satp[-4]; - if (y > 0) sv += satp[-x4]; - if (x > 0 && y > 0) sv -= satp[-x4 - 4]; - *satp = sv; - } - } - fp = sbuf->rect_float; - satp = satbuf; - for (y=0; yy; ++y) - for (x=0; xx; ++x) { - *fp++ = (float)*satp++; - *fp++ = (float)*satp++; - *fp++ = (float)*satp++; - *fp++ = (float)*satp++; - } - MEM_freeN(satbuf); - fp = &sbuf->rect_float[(sbuf->x - 1 + (sbuf->y - 1)*sbuf->x) << 2]; - fp[0] = avg[0]; - fp[1] = avg[1]; - fp[2] = avg[2]; - fp[3] = avg[3]; - } - else { - ImBuf *hbuf = ibuf; - int curmap = 0; - while (curmap < IB_MIPMAP_LEVELS) { - if (use_filter) { - ImBuf *nbuf= IMB_allocImBuf(hbuf->x, hbuf->y, 32, IB_rect, 0); - IMB_filterN(nbuf, hbuf); - ibuf->mipmap[curmap] = IMB_onehalf(nbuf); - IMB_freeImBuf(nbuf); - } - else ibuf->mipmap[curmap] = IMB_onehalf(hbuf); - hbuf = ibuf->mipmap[curmap]; - if (hbuf->x == 1 && hbuf->y == 1) break; - curmap++; - } - } -} diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index 7ee31ff7d9a..5a31a705591 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -62,13 +62,13 @@ * Local declarations. * ***********************/ /* Reading and writing of an in-memory TIFF file. */ -tsize_t imb_tiff_ReadProc(thandle_t handle, tdata_t data, tsize_t n); -tsize_t imb_tiff_WriteProc(thandle_t handle, tdata_t data, tsize_t n); -toff_t imb_tiff_SeekProc(thandle_t handle, toff_t ofs, int whence); -int imb_tiff_CloseProc(thandle_t handle); -toff_t imb_tiff_SizeProc(thandle_t handle); -int imb_tiff_DummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize); -void imb_tiff_DummyUnmapProc(thandle_t fd, tdata_t base, toff_t size); +static tsize_t imb_tiff_ReadProc(thandle_t handle, tdata_t data, tsize_t n); +static tsize_t imb_tiff_WriteProc(thandle_t handle, tdata_t data, tsize_t n); +static toff_t imb_tiff_SeekProc(thandle_t handle, toff_t ofs, int whence); +static int imb_tiff_CloseProc(thandle_t handle); +static toff_t imb_tiff_SizeProc(thandle_t handle); +static int imb_tiff_DummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize); +static void imb_tiff_DummyUnmapProc(thandle_t fd, tdata_t base, toff_t size); /* Structure for in-memory TIFF file. */ @@ -86,11 +86,11 @@ struct ImbTIFFMemFile { *****************************/ -void imb_tiff_DummyUnmapProc(thandle_t fd, tdata_t base, toff_t size) +static void imb_tiff_DummyUnmapProc(thandle_t fd, tdata_t base, toff_t size) { } -int imb_tiff_DummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) +static int imb_tiff_DummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) { return (0); } @@ -105,7 +105,7 @@ int imb_tiff_DummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) * @return: Number of bytes actually read. * 0 = EOF. */ -tsize_t imb_tiff_ReadProc(thandle_t handle, tdata_t data, tsize_t n) +static tsize_t imb_tiff_ReadProc(thandle_t handle, tdata_t data, tsize_t n) { tsize_t nRemaining, nCopy; struct ImbTIFFMemFile* mfile; @@ -147,7 +147,7 @@ tsize_t imb_tiff_ReadProc(thandle_t handle, tdata_t data, tsize_t n) * NOTE: The current Blender implementation should not need this function. It * is simply a stub. */ -tsize_t imb_tiff_WriteProc(thandle_t handle, tdata_t data, tsize_t n) +static tsize_t imb_tiff_WriteProc(thandle_t handle, tdata_t data, tsize_t n) { printf("imb_tiff_WriteProc: this function should not be called.\n"); return (-1); @@ -169,7 +169,7 @@ tsize_t imb_tiff_WriteProc(thandle_t handle, tdata_t data, tsize_t n) * @return: Resulting offset location within the file, measured in bytes from * the beginning of the file. (-1) indicates an error. */ -toff_t imb_tiff_SeekProc(thandle_t handle, toff_t ofs, int whence) +static toff_t imb_tiff_SeekProc(thandle_t handle, toff_t ofs, int whence) { struct ImbTIFFMemFile *mfile; toff_t new_offset; @@ -216,7 +216,7 @@ toff_t imb_tiff_SeekProc(thandle_t handle, toff_t ofs, int whence) * * @return: 0 */ -int imb_tiff_CloseProc(thandle_t handle) +static int imb_tiff_CloseProc(thandle_t handle) { struct ImbTIFFMemFile *mfile; @@ -242,7 +242,7 @@ int imb_tiff_CloseProc(thandle_t handle) * * @return: Size of file (in bytes). */ -toff_t imb_tiff_SizeProc(thandle_t handle) +static toff_t imb_tiff_SizeProc(thandle_t handle) { struct ImbTIFFMemFile* mfile; diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index 3212ff7b534..5d80936d2cc 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -335,8 +335,6 @@ typedef struct TexMapping { #define TXF_EWA 1 #define TXF_FELINE 2 #define TXF_AREA 3 -// TXF_SAT only available when mipmaps disabled -#define TXF_SAT 4 /* imaflag unused, only for version check */ #define TEX_FIELDS_ 8 diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index b5a4ac5db8c..8a432002d2b 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -48,7 +48,6 @@ static EnumPropertyItem texture_filter_items[] = { {TXF_EWA, "EWA", 0, "EWA", ""}, {TXF_FELINE, "FELINE", 0, "FELINE", ""}, {TXF_AREA, "AREA", 0, "Area", ""}, - {TXF_SAT, "SAT", 0, "SAT (4x mem)", ""}, {0, NULL, 0, NULL, NULL}}; EnumPropertyItem texture_type_items[] = { @@ -327,26 +326,8 @@ static void rna_ImageTexture_mipmap_set(PointerRNA *ptr, int value) if(value) tex->imaflag |= TEX_MIPMAP; else tex->imaflag &= ~TEX_MIPMAP; - if((tex->imaflag & TEX_MIPMAP) && tex->texfilter == TXF_SAT) - tex->texfilter = TXF_EWA; -} - -static EnumPropertyItem *rna_ImageTexture_filter_itemf(bContext *C, PointerRNA *ptr, int *free) -{ - Tex *tex= (Tex*)ptr->data; - EnumPropertyItem *item= NULL; - int totitem= 0; - - RNA_enum_items_add_value(&item, &totitem, texture_filter_items, TXF_BOX); - RNA_enum_items_add_value(&item, &totitem, texture_filter_items, TXF_EWA); - RNA_enum_items_add_value(&item, &totitem, texture_filter_items, TXF_FELINE); - RNA_enum_items_add_value(&item, &totitem, texture_filter_items, TXF_AREA); if(tex->imaflag & TEX_MIPMAP) - RNA_enum_items_add_value(&item, &totitem, texture_filter_items, TXF_SAT); - - *free= 1; - - return item; + tex->texfilter = TXF_EWA; } static void rna_Envmap_source_update(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -695,7 +676,6 @@ static void rna_def_filter_common(StructRNA *srna) prop= RNA_def_property(srna, "filter", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "texfilter"); RNA_def_property_enum_items(prop, texture_filter_items); - RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ImageTexture_filter_itemf"); RNA_def_property_ui_text(prop, "Filter", "Texture filter to use for sampling image"); RNA_def_property_update(prop, 0, "rna_Texture_update"); diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index cf0a01576d8..8abde533028 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -417,107 +417,6 @@ static float clipy_rctf(rctf *rf, float y1, float y2) } -// used in SAT_get_color_bilerp() below -static void SAT_getcol(float* col, ImBuf* ibuf, int x, int y) -{ - if ((x == (ibuf->x - 1)) && (y == (ibuf->y - 1))) { // avg val pos - col[0] = col[1] = col[2] = col[3] = 0.f; - return; - } - ibuf_get_color(col, ibuf, x, y); -} - -// used in boxsampleclip_SAT() below -static void SAT_get_color_bilerp(float *col, ImBuf *ibuf, float u, float v) -{ - float c00[4], c01[4], c10[4], c11[4]; - const float ufl = floorf(u -= 0.5f), vfl = floorf(v -= 0.5f); - const float uf = u - ufl, vf = v - vfl; - const float w00=(1.f-uf)*(1.f-vf), w10=uf*(1.f-vf), w01=(1.f-uf)*vf, w11=uf*vf; - int x1 = (int)ufl, y1 = (int)vfl, x2 = x1 + 1, y2 = y1 + 1; - x1 = (x1 < 0) ? 0 : (x1 >= ibuf->x ? ibuf->x - 1 : x1); - x2 = (x2 < 0) ? 0 : (x2 >= ibuf->x ? ibuf->x - 1 : x2); - y1 = (y1 < 0) ? 0 : (y1 >= ibuf->y ? ibuf->y - 1 : y1); - y2 = (y2 < 0) ? 0 : (y2 >= ibuf->y ? ibuf->y - 1 : y2); - SAT_getcol(c00, ibuf, x1, y1); - SAT_getcol(c10, ibuf, x2, y1); - SAT_getcol(c01, ibuf, x1, y2); - SAT_getcol(c11, ibuf, x2, y2); - col[0] = w00*c00[0] + w10*c10[0] + w01*c01[0] + w11*c11[0]; - col[1] = w00*c00[1] + w10*c10[1] + w01*c01[1] + w11*c11[1]; - col[2] = w00*c00[2] + w10*c10[2] + w01*c01[2] + w11*c11[2]; - col[3] = w00*c00[3] + w10*c10[3] + w01*c01[3] + w11*c11[3]; -} - -static void boxsampleclip_SAT(ImBuf *ibuf, rctf *rf, TexResult *texres, int intpol) -{ - float div, col[4]; - if (intpol) { - div = 1.f/((rf->xmax - rf->xmin + 1.f)*(rf->ymax - rf->ymin + 1.f)); - SAT_get_color_bilerp(&texres->tr, ibuf, rf->xmax, rf->ymax); - if (rf->ymin >= 1.f) { - SAT_get_color_bilerp(col, ibuf, rf->xmax, rf->ymin - 1.f); - texres->tr -= col[0]; - texres->tg -= col[1]; - texres->tb -= col[2]; - texres->ta -= col[3]; - } - if (rf->xmin >= 1.f) { - SAT_get_color_bilerp(col, ibuf, rf->xmin - 1.f, rf->ymax); - texres->tr -= col[0]; - texres->tg -= col[1]; - texres->tb -= col[2]; - texres->ta -= col[3]; - } - if (rf->xmin >= 1.f && rf->ymin >= 1.f) { - SAT_get_color_bilerp(col, ibuf, rf->xmin - 1.f, rf->ymin - 1.f); - texres->tr += col[0]; - texres->tg += col[1]; - texres->tb += col[2]; - texres->ta += col[3]; - } - } - else { - int startx = (int)floorf(rf->xmin); - int endx = (int)floorf(rf->xmax); - int starty = (int)floorf(rf->ymin); - int endy = (int)floorf(rf->ymax); - if (startx < 0) startx = 0; - if (starty < 0) starty = 0; - if (endx >= ibuf->x) endx = ibuf->x - 1; - if (endy >= ibuf->y) endy = ibuf->y - 1; - div = 1.f/((endx - startx + 1)*(endy - starty + 1)); - SAT_getcol(&texres->tr, ibuf, endx, endy); - if (starty >= 1) { - SAT_getcol(col, ibuf, endx, starty - 1); - texres->tr -= col[0]; - texres->tg -= col[1]; - texres->tb -= col[2]; - texres->ta -= col[3]; - } - if (startx >= 1) { - SAT_getcol(col, ibuf, startx - 1, endy); - texres->tr -= col[0]; - texres->tg -= col[1]; - texres->tb -= col[2]; - texres->ta -= col[3]; - } - if (startx >=1 && starty >= 1) { - SAT_getcol(col, ibuf, startx - 1, starty - 1); - texres->tr += col[0]; - texres->tg += col[1]; - texres->tb += col[2]; - texres->ta += col[3]; - } - } - // avg - ibuf_get_color(col, ibuf, ibuf->x - 1, ibuf->y - 1); - texres->tr = texres->tr*div + col[0]; - texres->tg = texres->tg*div + col[1]; - texres->tb = texres->tb*div + col[2]; - texres->ta = texres->ta*div + col[3]; -} - static void boxsampleclip(struct ImBuf *ibuf, rctf *rf, TexResult *texres) { /* sample box, is clipped already, and minx etc. have been set at ibuf size. @@ -601,7 +500,7 @@ static void boxsampleclip(struct ImBuf *ibuf, rctf *rf, TexResult *texres) } } -static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float maxy, TexResult *texres, int imaprepeat, int imapextend, int SAT, int intpol) +static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float maxy, TexResult *texres, int imaprepeat, int imapextend, int intpol) { /* Sample box, performs clip. minx etc are in range 0.0 - 1.0 . * Enlarge with antialiased edges of pixels. @@ -655,10 +554,7 @@ static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float max if(count>1) { tot= texres->tr= texres->tb= texres->tg= texres->ta= 0.0; while(count--) { - if (SAT) - boxsampleclip_SAT(ibuf, rf, &texr, intpol); - else - boxsampleclip(ibuf, rf, &texr); + boxsampleclip(ibuf, rf, &texr); opp= square_rctf(rf); tot+= opp; @@ -676,12 +572,8 @@ static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float max if(texres->talpha) texres->ta/= tot; } } - else { - if (SAT) - boxsampleclip_SAT(ibuf, rf, texres, intpol); - else - boxsampleclip(ibuf, rf, texres); - } + else + boxsampleclip(ibuf, rf, texres); if(texres->talpha==0) texres->ta= 1.0; @@ -707,7 +599,7 @@ void image_sample(Image *ima, float fx, float fy, float dx, float dy, float *res if( (R.flag & R_SEC_FIELD) && (ibuf->flags & IB_fields) ) ibuf->rect+= (ibuf->x*ibuf->y); - boxsample(ibuf, fx, fy, fx+dx, fy+dy, &texres, 0, 1, 0, 0); + boxsample(ibuf, fx, fy, fx+dx, fy+dy, &texres, 0, 1, 0); result[0]= texres.tr; result[1]= texres.tg; result[2]= texres.tb; @@ -726,7 +618,7 @@ void ibuf_sample(ImBuf *ibuf, float fx, float fy, float dx, float dy, float *res } memset(&texres, 0, sizeof(texres)); - boxsample(ibuf, fx, fy, fx+dx, fy+dy, &texres, 0, 1, 0, 0); + boxsample(ibuf, fx, fy, fx+dx, fy+dy, &texres, 0, 1, 0); result[0]= texres.tr; result[1]= texres.tg; result[2]= texres.tb; @@ -1148,7 +1040,7 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, if (tex->imaflag & TEX_MIPMAP) { if (((ibuf->flags & IB_fields) == 0) && (ibuf->mipmap[0] == NULL)) { BLI_lock_thread(LOCK_IMAGE); - if (ibuf->mipmap[0] == NULL) IMB_makemipmap(ibuf, tex->imaflag & TEX_GAUSS_MIP, 0); + if (ibuf->mipmap[0] == NULL) IMB_makemipmap(ibuf, tex->imaflag & TEX_GAUSS_MIP); BLI_unlock_thread(LOCK_IMAGE); } } @@ -1505,7 +1397,7 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f TexResult texr; float fx, fy, minx, maxx, miny, maxy, dx, dy, dxt[3], dyt[3]; float maxd, pixsize, val1, val2, val3; - int curmap, retval, imaprepeat, imapextend, SAT = (tex->texfilter == TXF_SAT); + int curmap, retval, imaprepeat, imapextend; // TXF: since dxt/dyt might be modified here and since they might be needed after imagewraposa() call, // make a local copy here so that original vecs remain untouched @@ -1513,7 +1405,7 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f VECCOPY(dyt, DYT); // anisotropic filtering - if (!SAT && (tex->texfilter != TXF_BOX)) + if (tex->texfilter != TXF_BOX) return imagewraposa_aniso(tex, ima, ibuf, texvec, dxt, dyt, texres); texres->tin= texres->ta= texres->tr= texres->tg= texres->tb= 0.0f; @@ -1536,13 +1428,13 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f return retval; /* mipmap test */ - if (SAT || tex->imaflag & TEX_MIPMAP) { + if (tex->imaflag & TEX_MIPMAP) { if(ibuf->flags & IB_fields); else if(ibuf->mipmap[0]==NULL) { BLI_lock_thread(LOCK_IMAGE); if(ibuf->mipmap[0]==NULL) - IMB_makemipmap(ibuf, tex->imaflag & TEX_GAUSS_MIP, SAT); + IMB_makemipmap(ibuf, tex->imaflag & TEX_GAUSS_MIP); BLI_unlock_thread(LOCK_IMAGE); } @@ -1754,11 +1646,11 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f //minx*= 1.35f; //miny*= 1.35f; - boxsample(curibuf, fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend, 0, 0); + boxsample(curibuf, fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend, 0); val1= texres->tr+texres->tg+texres->tb; - boxsample(curibuf, fx-minx+dxt[0], fy-miny+dxt[1], fx+minx+dxt[0], fy+miny+dxt[1], &texr, imaprepeat, imapextend, 0, 0); + boxsample(curibuf, fx-minx+dxt[0], fy-miny+dxt[1], fx+minx+dxt[0], fy+miny+dxt[1], &texr, imaprepeat, imapextend, 0); val2= texr.tr + texr.tg + texr.tb; - boxsample(curibuf, fx-minx+dyt[0], fy-miny+dyt[1], fx+minx+dyt[0], fy+miny+dyt[1], &texr, imaprepeat, imapextend, 0, 0); + boxsample(curibuf, fx-minx+dyt[0], fy-miny+dyt[1], fx+minx+dyt[0], fy+miny+dyt[1], &texr, imaprepeat, imapextend, 0); val3= texr.tr + texr.tg + texr.tb; /* don't switch x or y! */ @@ -1767,7 +1659,7 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f if(previbuf!=curibuf) { /* interpolate */ - boxsample(previbuf, fx-minx, fy-miny, fx+minx, fy+miny, &texr, imaprepeat, imapextend, 0, 0); + boxsample(previbuf, fx-minx, fy-miny, fx+minx, fy+miny, &texr, imaprepeat, imapextend, 0); /* calc rgb */ dx= 2.0f*(pixsize-maxd)/pixsize; @@ -1784,9 +1676,9 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f } val1= dy*val1+ dx*(texr.tr + texr.tg + texr.tb); - boxsample(previbuf, fx-minx+dxt[0], fy-miny+dxt[1], fx+minx+dxt[0], fy+miny+dxt[1], &texr, imaprepeat, imapextend, 0, 0); + boxsample(previbuf, fx-minx+dxt[0], fy-miny+dxt[1], fx+minx+dxt[0], fy+miny+dxt[1], &texr, imaprepeat, imapextend, 0); val2= dy*val2+ dx*(texr.tr + texr.tg + texr.tb); - boxsample(previbuf, fx-minx+dyt[0], fy-miny+dyt[1], fx+minx+dyt[0], fy+miny+dyt[1], &texr, imaprepeat, imapextend, 0, 0); + boxsample(previbuf, fx-minx+dyt[0], fy-miny+dyt[1], fx+minx+dyt[0], fy+miny+dyt[1], &texr, imaprepeat, imapextend, 0); val3= dy*val3+ dx*(texr.tr + texr.tg + texr.tb); texres->nor[0]= (val1-val2); /* vals have been interpolated above! */ @@ -1809,10 +1701,10 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f maxy= fy+miny; miny= fy-miny; - boxsample(curibuf, minx, miny, maxx, maxy, texres, imaprepeat, imapextend, 0, 0); + boxsample(curibuf, minx, miny, maxx, maxy, texres, imaprepeat, imapextend, 0); if(previbuf!=curibuf) { /* interpolate */ - boxsample(previbuf, minx, miny, maxx, maxy, &texr, imaprepeat, imapextend, 0, 0); + boxsample(previbuf, minx, miny, maxx, maxy, &texr, imaprepeat, imapextend, 0); fx= 2.0f*(pixsize-maxd)/pixsize; @@ -1831,39 +1723,26 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f } else { const int intpol = tex->imaflag & TEX_INTERPOL; - if (intpol && !SAT) { + if (intpol) { /* sample 1 pixel minimum */ if (minx < 0.5f / ibuf->x) minx = 0.5f / ibuf->x; if (miny < 0.5f / ibuf->y) miny = 0.5f / ibuf->y; } if(texres->nor && (tex->imaflag & TEX_NORMALMAP)==0) { - if (SAT) { - boxsample(ibuf->mipmap[0], fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend, 1, intpol); - val1 = texres->tr + texres->tg + texres->tb; - boxsample(ibuf->mipmap[0], fx-minx+dxt[0], fy-miny+dxt[1], fx+minx+dxt[0], fy+miny+dxt[1], &texr, imaprepeat, imapextend, 1, intpol); - val2 = texr.tr + texr.tg + texr.tb; - boxsample(ibuf->mipmap[0], fx-minx+dyt[0], fy-miny+dyt[1], fx+minx+dyt[0], fy+miny+dyt[1], &texr, imaprepeat, imapextend, 1, intpol); - val3 = texr.tr + texr.tg + texr.tb; - } - else { - boxsample(ibuf, fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend, 0, 0); - val1= texres->tr+texres->tg+texres->tb; - boxsample(ibuf, fx-minx+dxt[0], fy-miny+dxt[1], fx+minx+dxt[0], fy+miny+dxt[1], &texr, imaprepeat, imapextend, 0, 0); - val2= texr.tr + texr.tg + texr.tb; - boxsample(ibuf, fx-minx+dyt[0], fy-miny+dyt[1], fx+minx+dyt[0], fy+miny+dyt[1], &texr, imaprepeat, imapextend, 0, 0); - val3= texr.tr + texr.tg + texr.tb; - } + boxsample(ibuf, fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend, 0); + val1= texres->tr+texres->tg+texres->tb; + boxsample(ibuf, fx-minx+dxt[0], fy-miny+dxt[1], fx+minx+dxt[0], fy+miny+dxt[1], &texr, imaprepeat, imapextend, 0); + val2= texr.tr + texr.tg + texr.tb; + boxsample(ibuf, fx-minx+dyt[0], fy-miny+dyt[1], fx+minx+dyt[0], fy+miny+dyt[1], &texr, imaprepeat, imapextend, 0); + val3= texr.tr + texr.tg + texr.tb; + /* don't switch x or y! */ texres->nor[0]= (val1-val2); texres->nor[1]= (val1-val3); } - else { - if (SAT) - boxsample(ibuf->mipmap[0], fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend, 1, intpol); - else - boxsample(ibuf, fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend, 0, 0); - } + else + boxsample(ibuf, fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend, 0); } BRICONTRGB; From 9b660f3425d073b780361b56938b3385f6f6d7ce Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Sun, 14 Mar 2010 18:58:14 +0000 Subject: [PATCH 052/153] [#21523] Drag Immediately only working when "Select With" is set to LMB Partial fix. Check lauch event if left or right mouse. Also added a bug fix for manipulator (sometimes, type = 0) --- source/blender/editors/transform/transform.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index b3944614e2f..7d8ee677130 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1046,7 +1046,7 @@ int transformEvent(TransInfo *t, wmEvent *event) /* confirm transform if launch key is released after mouse move */ /* XXX Keyrepeat bug in Xorg fucks this up, will test when fixed */ - if (event->type == LEFTMOUSE /*t->launch_event*/ && t->state != TRANS_STARTING) + if (event->type == t->launch_event && (t->launch_event == LEFTMOUSE || t->launch_event == RIGHTMOUSE) && t->state != TRANS_STARTING) { t->state = TRANS_CONFIRM; } @@ -1456,6 +1456,22 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int t->launch_event = event ? event->type : -1; + if (t->launch_event == EVT_TWEAK_R) + { + t->launch_event = RIGHTMOUSE; + } + else if (t->launch_event == EVT_TWEAK_L) + { + t->launch_event = LEFTMOUSE; + } + // XXX Remove this when wm_operator_call_internal doesn't use window->eventstate (which can have type = 0) + // For manipulator only, so assume LEFTMOUSE + else if (t->launch_event == 0) + { + t->launch_event = LEFTMOUSE; + } + + if (!initTransInfo(C, t, op, event)) // internal data, mouse, vectors { return 0; From cbe776655a3f5c402dc03b87fb815ed8be0a8af1 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Sun, 14 Mar 2010 19:38:36 +0000 Subject: [PATCH 053/153] transform: Ctrl-Click on manipulators uses increments correctly. --- source/blender/editors/transform/transform.c | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 7d8ee677130..01aa41b0499 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1502,6 +1502,27 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int return 0; } + /* Stupid code to have Ctrl-Click on manipulator work ok */ + { + wmKeyMap *keymap = WM_keymap_active(CTX_wm_manager(C), op->type->modalkeymap); + wmKeyMapItem *kmi; + + for (kmi = keymap->items.first; kmi; kmi = kmi->next) + { + if (kmi->propvalue == TFM_MODAL_SNAP_INV_ON && kmi->val == KM_PRESS) + { + if ((ELEM(kmi->type, LEFTCTRLKEY, RIGHTCTRLKEY) && event->ctrl) || + (ELEM(kmi->type, LEFTSHIFTKEY, RIGHTSHIFTKEY) && event->shift) || + (ELEM(kmi->type, LEFTALTKEY, RIGHTALTKEY) && event->alt) || + (kmi->type == COMMANDKEY && event->oskey)) { + t->modifiers |= MOD_SNAP_INVERT; + } + break; + } + } + + } + initSnapping(t, op); // Initialize snapping data AFTER mode flags /* EVIL! posemode code can switch translation to rotate when 1 bone is selected. will be removed (ton) */ From 149fe90a08d32b764875fb01a00b685df73b1ec7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Mar 2010 20:07:15 +0000 Subject: [PATCH 054/153] cleanup for addon python internals, fix filtering bug. --- release/scripts/op/wm.py | 15 ++++++ release/scripts/ui/space_userpref.py | 81 +++++++++++++--------------- 2 files changed, 53 insertions(+), 43 deletions(-) diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py index a2c05562c65..07a7afe026e 100644 --- a/release/scripts/op/wm.py +++ b/release/scripts/op/wm.py @@ -418,6 +418,19 @@ class WM_OT_context_modal_mouse(bpy.types.Operator): return {'RUNNING_MODAL'} +class WM_OT_url_open(bpy.types.Operator): + "Open the Blender Wiki in the Webbrowser" + bl_idname = "wm.url_open" + bl_label = "" + + url = StringProperty(name="URL", description="URL to open") + + def execute(self, context): + import webbrowser + webbrowser.open(self.properties.url) + return {'FINISHED'} + + class WM_OT_doc_view(bpy.types.Operator): '''Load online reference docs''' bl_idname = "wm.doc_view" @@ -556,6 +569,8 @@ classes = [ WM_OT_context_cycle_enum, WM_OT_context_cycle_int, WM_OT_context_modal_mouse, + + WM_OT_url_open, WM_OT_doc_view, WM_OT_doc_edit, diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 61c514135bd..426b23355d0 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -1385,6 +1385,8 @@ class USERPREF_PT_addons(bpy.types.Panel): bl_label = "Addons" bl_region_type = 'WINDOW' bl_show_header = False + + _addon_blank = {"name": "", "author": "", "version": "", "blender": "", "location": "", "url": "", "category": ""} def poll(self, context): userpref = context.user_preferences @@ -1405,21 +1407,16 @@ class USERPREF_PT_addons(bpy.types.Panel): def _attributes(self, mod): # collect, check and process all attributes of the add-on - module_name = mod.__name__ if not hasattr(mod, 'expanded'): mod.expanded = False - - info = getattr(mod, "bl_addon_info", {}) - - name = info.get("name", "") - author = info.get("author", "") - version = info.get("version", "") - blender = info.get("blender", "") - location = info.get("location", "") - url = info.get("url", "") - category = info.get("category", "") - return module_name, name, author, version, blender, location, url, category + info = self._addon_blank.copy() + info.update(getattr(mod, "bl_addon_info", {})) + + if not info["name"]: + info["name"] = mod.__name__ + + return info def draw(self, context): layout = self.layout @@ -1428,16 +1425,13 @@ class USERPREF_PT_addons(bpy.types.Panel): used_ext = {ext.module for ext in userpref.addons} # collect the categories that can be filtered on - cats = [] - for mod in self._addon_list(): - try: - if category not in cats: - cats.append(category) - except: - pass + addons = [(mod, self._attributes(mod)) for mod in self._addon_list()] - cats.sort() - cats = ['All', 'Disabled', 'Enabled']+cats + cats = {info["category"] for mod, info in addons} + cats.add("") + cats.remove("") + + cats = ['All', 'Disabled', 'Enabled'] + sorted(cats) bpy.types.Scene.EnumProperty(items=[(cats[i],cats[i],str(i)) for i in range(len(cats))], name="Category", attr="addon_filter", description="Filter add-ons by category") @@ -1450,18 +1444,22 @@ class USERPREF_PT_addons(bpy.types.Panel): layout.separator() filter = context.scene.addon_filter - search = context.scene.addon_search + search = context.scene.addon_search.lower() + for mod in self._addon_list(): - module_name, name, author, version, blender, location, url, category = \ - self._attributes(mod) + module_name = mod.__name__ + info = self._attributes(mod) # check if add-on should be visible with current filters - if filter!='All' and filter!=category and not (module_name in used_ext and filter=='Enabled')\ - and not (module_name not in used_ext and filter=='Disabled'): + if filter != "All" and \ + filter != info["category"] and \ + not (module_name not in used_ext and filter == "Disabled"): + continue - if search and name.lower().find(search.lower())<0: - if author: - if author.lower().find(search.lower())<0: + + if search and search not in info["name"].lower(): + if info["author"]: + if search not in info["author"].lower(): continue else: continue @@ -1475,38 +1473,35 @@ class USERPREF_PT_addons(bpy.types.Panel): # If there are Infos or UI is expanded if mod.expanded: row.operator("wm.addon_expand", icon="TRIA_DOWN").module = module_name - elif author or version or url or location: + elif info["author"] or info["version"] or info["url"] or info["location"]: row.operator("wm.addon_expand", icon="TRIA_RIGHT").module = module_name else: # Else, block UI arrow = row.column() arrow.enabled = False arrow.operator("wm.addon_expand", icon="TRIA_RIGHT").module = module_name - - if name: - row.label(text=name) - else: #For now, can be removed when all addons, have a proper dict - row.label(text=module_name) + + row.label(text=info["name"]) row.operator("wm.addon_disable" if module_name in used_ext else "wm.addon_enable").module = module_name # Expanded UI (only if additional infos are available) if mod.expanded: - if author: + if info["author"]: split = column.row().split(percentage=0.15) split.label(text='Author:') - split.label(text=author) - if version: + split.label(text=info["author"]) + if info["version"]: split = column.row().split(percentage=0.15) split.label(text='Version:') - split.label(text=version) - if location: + split.label(text=info["version"]) + if info["location"]: split = column.row().split(percentage=0.15) split.label(text='Location:') - split.label(text=location) - if url: + split.label(text=info["location"]) + if info["url"]: split = column.row().split(percentage=0.15) split.label(text="Internet:") - split.operator("wm.addon_links", text="Link to the Wiki").link = url + split.operator("wm.addon_links", text="Link to the Wiki").link = info["url"] split.separator() split.separator() From 114f437837a4b1711c85f0a3e229df04f2d0420d Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 14 Mar 2010 20:18:15 +0000 Subject: [PATCH 055/153] Fix crash reading files with animated particle properties. --- source/blender/blenloader/intern/readfile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 2bb03f35edd..3fe6a6f9914 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3029,6 +3029,7 @@ static void direct_link_particlesettings(FileData *fd, ParticleSettings *part) part->pd= newdataadr(fd, part->pd); part->pd2= newdataadr(fd, part->pd2); + direct_link_animdata(fd, part->adt); direct_link_partdeflect(part->pd); direct_link_partdeflect(part->pd2); From ed076d74ef3f0593971108511dc25e63cab7e829 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 14 Mar 2010 20:24:11 +0000 Subject: [PATCH 056/153] Rendering from 3d view in local view or with unlocked layer was not working yet, now layer is passed along to render engine, changes quite a few files because simple swapping trick no longer works with threading. --- source/blender/blenkernel/intern/sequencer.c | 2 +- source/blender/editors/object/object_bake.c | 4 +- .../blender/editors/render/render_internal.c | 13 +++++-- .../blender/editors/render/render_preview.c | 9 ++--- .../render/extern/include/RE_pipeline.h | 8 ++-- .../render/intern/include/render_types.h | 1 + .../render/intern/include/renderdatabase.h | 2 +- .../render/intern/source/convertblender.c | 38 +++++++++---------- source/blender/render/intern/source/envmap.c | 3 +- .../blender/render/intern/source/occlusion.c | 2 +- .../blender/render/intern/source/pipeline.c | 32 ++++++++-------- .../blender/render/intern/source/rendercore.c | 2 +- .../render/intern/source/volume_precache.c | 2 +- source/creator/creator.c | 4 +- 14 files changed, 65 insertions(+), 57 deletions(-) diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index d43747cf3f3..a4a0a533545 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -2181,7 +2181,7 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int else re= RE_NewRender(sce->id.name, RE_SLOT_VIEW); - RE_BlenderFrame(re, sce, NULL, frame); + RE_BlenderFrame(re, sce, sce->lay, NULL, frame); RE_AcquireResultImage(re, &rres); diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index a4f419cf996..9458614293f 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -203,7 +203,7 @@ static void bake_startjob(void *bkv, short *stop, short *do_update) RE_test_break_cb(bkr->re, NULL, thread_break); G.afbreek= 0; /* blender_test_break uses this global */ - RE_Database_Baking(bkr->re, scene, scene->r.bake_mode, bkr->actob); + RE_Database_Baking(bkr->re, scene, scene->r.bake_mode, bkr->actob, scene->lay); /* baking itself is threaded, cannot use test_break in threads. we also update optional imagewindow */ bkr->tot= RE_bake_shade_all_selected(bkr->re, scene->r.bake_mode, bkr->actob, bkr->do_update); @@ -301,7 +301,7 @@ static int bake_image_exec(bContext *C, wmOperator *op) RE_test_break_cb(bkr.re, NULL, thread_break); G.afbreek= 0; /* blender_test_break uses this global */ - RE_Database_Baking(bkr.re, scene, scene->r.bake_mode, (scene->r.bake_flag & R_BAKE_TO_ACTIVE)? OBACT: NULL); + RE_Database_Baking(bkr.re, scene, scene->r.bake_mode, (scene->r.bake_flag & R_BAKE_TO_ACTIVE)? OBACT: NULL, scene->lay); /* baking itself is threaded, cannot use test_break in threads */ BLI_init_threads(&threads, do_bake_render, 1); diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 22c4f9e729c..af58f3b4ee1 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -405,6 +405,8 @@ static int screen_render_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Render *re= RE_GetRender(scene->id.name, RE_SLOT_VIEW); + View3D *v3d= CTX_wm_view3d(C); + int lay= (v3d)? v3d->lay|scene->lay: scene->lay; if(re==NULL) { re= RE_NewRender(scene->id.name, RE_SLOT_VIEW); @@ -412,9 +414,9 @@ static int screen_render_exec(bContext *C, wmOperator *op) RE_test_break_cb(re, NULL, (int (*)(void *)) blender_test_break); if(RNA_boolean_get(op->ptr, "animation")) - RE_BlenderAnim(re, scene, scene->r.sfra, scene->r.efra, scene->r.frame_step, op->reports); + RE_BlenderAnim(re, scene, lay, scene->r.sfra, scene->r.efra, scene->r.frame_step, op->reports); else - RE_BlenderFrame(re, scene, NULL, scene->r.cfra); + RE_BlenderFrame(re, scene, NULL, lay, scene->r.cfra); // no redraw needed, we leave state as we entered it ED_update_for_newframe(C, 1); @@ -429,6 +431,7 @@ typedef struct RenderJob { Render *re; wmWindow *win; SceneRenderLayer *srl; + int lay; int anim; Image *image; ImageUser iuser; @@ -531,9 +534,9 @@ static void render_startjob(void *rjv, short *stop, short *do_update) rj->do_update= do_update; if(rj->anim) - RE_BlenderAnim(rj->re, rj->scene, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->r.frame_step, rj->reports); + RE_BlenderAnim(rj->re, rj->scene, rj->lay, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->r.frame_step, rj->reports); else - RE_BlenderFrame(rj->re, rj->scene, rj->srl, rj->scene->r.cfra); + RE_BlenderFrame(rj->re, rj->scene, rj->srl, rj->lay, rj->scene->r.cfra); // if(mainp) // free_main(mainp); @@ -573,6 +576,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) /* new render clears all callbacks */ Scene *scene= CTX_data_scene(C); SceneRenderLayer *srl=NULL; + View3D *v3d= CTX_wm_view3d(C); Render *re; wmJob *steve; RenderJob *rj; @@ -624,6 +628,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) rj->scene= scene; rj->win= CTX_wm_window(C); rj->srl = srl; + rj->lay = (v3d)? v3d->lay|scene->lay: scene->lay; rj->anim= RNA_boolean_get(op->ptr, "animation"); rj->iuser.scene= scene; rj->iuser.ok= 1; diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 44ca80867e4..1eac01a1fa1 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -752,11 +752,10 @@ void BIF_view3d_previewrender(Scene *scene, ScrArea *sa) /* allow localview render for objects with lights in normal layers */ if(v3d->lay & 0xFF000000) - scene->lay |= v3d->lay; - else scene->lay= v3d->lay; + lay |= v3d->lay; + else lay= v3d->lay; - RE_Database_FromScene(re, scene, 0); // 0= dont use camera view - scene->lay= lay; + RE_Database_FromScene(re, scene, lay, 0); // 0= dont use camera view rstats= RE_GetStats(re); if(rstats->convertdone) @@ -934,7 +933,7 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs /* entire cycle for render engine */ RE_SetCamera(re, sce->camera); - RE_Database_FromScene(re, sce, 1); + RE_Database_FromScene(re, sce, sce->lay, 1); RE_TileProcessor(re, 0, 1); // actual render engine RE_Database_Free(re); diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index f9c4e9690a1..19f6dcfbaa8 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -198,7 +198,7 @@ void RE_SetPixelSize(struct Render *re, float pixsize); void RE_SetView (struct Render *re, float mat[][4]); /* make or free the dbase */ -void RE_Database_FromScene(struct Render *re, struct Scene *scene, int use_camera_view); +void RE_Database_FromScene(struct Render *re, struct Scene *scene, unsigned int lay, int use_camera_view); void RE_Database_Free (struct Render *re); /* project dbase again, when viewplane/perspective changed */ @@ -214,8 +214,8 @@ void RE_init_threadcount(Render *re); void RE_TileProcessor(struct Render *re, int firsttile, int threaded); /* only RE_NewRender() needed, main Blender render calls */ -void RE_BlenderFrame(struct Render *re, struct Scene *scene, struct SceneRenderLayer *srl, int frame); -void RE_BlenderAnim(struct Render *re, struct Scene *scene, int sfra, int efra, int tfra, struct ReportList *reports); +void RE_BlenderFrame(struct Render *re, struct Scene *scene, struct SceneRenderLayer *srl, unsigned int lay, int frame); +void RE_BlenderAnim(struct Render *re, struct Scene *scene, unsigned int lay, int sfra, int efra, int tfra, struct ReportList *reports); void RE_ReadRenderResult(struct Scene *scene, struct Scene *scenode); void RE_WriteRenderResult(RenderResult *rr, char *filename, int compress); @@ -251,7 +251,7 @@ void RE_zbuf_accumulate_vecblur(struct NodeBlurData *nbd, int xsize, int ysize, #define RE_BAKE_DISPLACEMENT 5 #define RE_BAKE_SHADOW 6 -void RE_Database_Baking(struct Render *re, struct Scene *scene, int type, struct Object *actob); +void RE_Database_Baking(struct Render *re, struct Scene *scene, unsigned int lay, int type, struct Object *actob); void RE_DataBase_GetView(struct Render *re, float mat[][4]); void RE_GetCameraWindow(struct Render *re, struct Object *camera, int frame, float mat[][4]); diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index e093c1a6c99..0b0ea075d79 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -174,6 +174,7 @@ struct Render Scene *scene; RenderData r; World wrld; + unsigned int lay; ListBase parts; diff --git a/source/blender/render/intern/include/renderdatabase.h b/source/blender/render/intern/include/renderdatabase.h index 9ed12a8fe60..2a0086b436c 100644 --- a/source/blender/render/intern/include/renderdatabase.h +++ b/source/blender/render/intern/include/renderdatabase.h @@ -137,7 +137,7 @@ void RE_set_customdata_names(struct ObjectRen *obr, struct CustomData *data); /* convertblender.c */ void init_render_world(Render *re); -void RE_Database_FromScene_Vectors(Render *re, struct Scene *sce); +void RE_Database_FromScene_Vectors(Render *re, struct Scene *sce, unsigned int lay); #endif /* RENDERDATABASE_H */ diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index c75e825a0e7..5a363b9cdfe 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -3859,7 +3859,7 @@ static void add_lightgroup(Render *re, Group *group, int exclusive) for(go= group->gobject.first; go; go= go->next) { go->lampren= NULL; - if(go->ob->lay & re->scene->lay) { + if(go->ob->lay & re->lay) { if(go->ob && go->ob->type==OB_LAMP) { for(gol= re->lights.first; gol; gol= gol->next) { if(gol->ob==go->ob) { @@ -4721,7 +4721,7 @@ static void dupli_render_particle_set(Render *re, Object *ob, int timeoffset, in static int get_vector_renderlayers(Scene *sce) { SceneRenderLayer *srl; - int lay= 0; + unsigned int lay= 0; for(srl= sce->r.layers.first; srl; srl= srl->next) if(srl->passflag & SCE_PASS_VECTOR) @@ -4805,7 +4805,7 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp } } } - else if((base->lay & lay) || (ob->type==OB_LAMP && (base->lay & re->scene->lay)) ) { + else if((base->lay & lay) || (ob->type==OB_LAMP && (base->lay & re->lay)) ) { if((ob->transflag & OB_DUPLI) && (ob->type!=OB_MBALL)) { DupliObject *dob; ListBase *lb; @@ -4932,15 +4932,15 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp } /* used to be 'rotate scene' */ -void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view) +void RE_Database_FromScene(Render *re, Scene *scene, unsigned int lay, int use_camera_view) { extern int slurph_opt; /* key.c */ Scene *sce; float mat[4][4]; float amb[3]; - unsigned int lay; re->scene= scene; + re->lay= lay; /* per second, per object, stats print this */ re->i.infostr= "Preparing Scene data"; @@ -4958,8 +4958,8 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view) re->i.partsdone= 0; /* signal now in use for previewrender */ /* in localview, lamps are using normal layers, objects only local bits */ - if(re->scene->lay & 0xFF000000) lay= re->scene->lay & 0xFF000000; - else lay= re->scene->lay; + if(re->lay & 0xFF000000) + lay &= 0xFF000000; /* applies changes fully */ if((re->r.scemode & R_PREVIEWBUTS)==0) @@ -5089,13 +5089,13 @@ void RE_DataBase_GetView(Render *re, float mat[][4]) /* Speed Vectors */ /* ------------------------------------------------------------------------- */ -static void database_fromscene_vectors(Render *re, Scene *scene, int timeoffset) +static void database_fromscene_vectors(Render *re, Scene *scene, unsigned int lay, int timeoffset) { extern int slurph_opt; /* key.c */ float mat[4][4]; - unsigned int lay; re->scene= scene; + re->lay= lay; /* XXX add test if dbase was filled already? */ @@ -5107,8 +5107,8 @@ static void database_fromscene_vectors(Render *re, Scene *scene, int timeoffset) slurph_opt= 0; /* in localview, lamps are using normal layers, objects only local bits */ - if(re->scene->lay & 0xFF000000) lay= re->scene->lay & 0xFF000000; - else lay= re->scene->lay; + if(re->lay & 0xFF000000) + lay &= 0xFF000000; /* applies changes fully */ scene->r.cfra += timeoffset; @@ -5471,7 +5471,7 @@ static void free_dbase_object_vectors(ListBase *lb) BLI_freelistN(lb); } -void RE_Database_FromScene_Vectors(Render *re, Scene *sce) +void RE_Database_FromScene_Vectors(Render *re, Scene *sce, unsigned int lay) { ObjectInstanceRen *obi, *oldobi; StrandSurface *mesh; @@ -5486,7 +5486,7 @@ void RE_Database_FromScene_Vectors(Render *re, Scene *sce) speedvector_project(re, NULL, NULL, NULL); /* initializes projection code */ /* creates entire dbase */ - database_fromscene_vectors(re, sce, -1); + database_fromscene_vectors(re, sce, lay, -1); /* copy away vertex info */ copy_dbase_object_vectors(re, &oldtable); @@ -5501,7 +5501,7 @@ void RE_Database_FromScene_Vectors(Render *re, Scene *sce) /* creates entire dbase */ re->i.infostr= "Calculating next frame vectors"; - database_fromscene_vectors(re, sce, +1); + database_fromscene_vectors(re, sce, lay, +1); } /* copy away vertex info */ copy_dbase_object_vectors(re, &newtable); @@ -5513,7 +5513,7 @@ void RE_Database_FromScene_Vectors(Render *re, Scene *sce) re->strandsurface= strandsurface; if(!re->test_break(re->tbh)) - RE_Database_FromScene(re, sce, 1); + RE_Database_FromScene(re, sce, lay, 1); if(!re->test_break(re->tbh)) { for(step= 0; step<2; step++) { @@ -5602,14 +5602,14 @@ void RE_Database_FromScene_Vectors(Render *re, Scene *sce) RE_BAKE_DISPLACEMENT:for baking, no lamps, only selected objects RE_BAKE_SHADOW: for baking, only shadows, but all objects */ -void RE_Database_Baking(Render *re, Scene *scene, int type, Object *actob) +void RE_Database_Baking(Render *re, Scene *scene, unsigned int lay, int type, Object *actob) { float mat[4][4]; float amb[3]; - unsigned int lay; int onlyselected, nolamps; re->scene= scene; + re->lay= lay; /* renderdata setup and exceptions */ re->r= scene->r; @@ -5642,8 +5642,8 @@ void RE_Database_Baking(Render *re, Scene *scene, int type, Object *actob) re->lampren.first= re->lampren.last= NULL; /* in localview, lamps are using normal layers, objects only local bits */ - if(re->scene->lay & 0xFF000000) lay= re->scene->lay & 0xFF000000; - else lay= re->scene->lay; + if(re->lay & 0xFF000000) + lay &= 0xFF000000; /* if no camera, set unit */ if(re->scene->camera) { diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index 7daf3e07105..73c9aaf6642 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -143,6 +143,7 @@ static Render *envmap_render_copy(Render *re, EnvMap *env) RE_InitState(envre, NULL, &envre->r, NULL, cuberes, cuberes, NULL); envre->scene= re->scene; /* unsure about this... */ + envre->lay= re->lay; /* view stuff in env render */ envre->lens= 16.0f; @@ -513,7 +514,7 @@ void make_envmaps(Render *re) if(tex->env && tex->env->object) { EnvMap *env= tex->env; - if(env->object->lay & re->scene->lay) { + if(env->object->lay & re->lay) { if(env->stype==ENV_LOAD) { float orthmat[4][4], mat[4][4], tmat[4][4]; diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index 7c52857a94b..39faf22fb31 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -213,7 +213,7 @@ static void occ_build_shade(Render *re, OcclusionTree *tree) /* setup shade sample with correct passes */ memset(&ssamp, 0, sizeof(ShadeSample)); - ssamp.shi[0].lay= re->scene->lay; + ssamp.shi[0].lay= re->lay; ssamp.shi[0].passflag= SCE_PASS_DIFFUSE|SCE_PASS_RGBA; ssamp.shi[0].combinedflag= ~(SCE_PASS_SPEC); ssamp.tot= 1; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index e800ce3acf0..ec250a7136b 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1849,9 +1849,9 @@ static void do_render_3d(Render *re) /* make render verts/faces/halos/lamps */ if(render_scene_needs_vector(re)) - RE_Database_FromScene_Vectors(re, re->scene); + RE_Database_FromScene_Vectors(re, re->scene, re->lay); else - RE_Database_FromScene(re, re->scene, 1); + RE_Database_FromScene(re, re->scene, re->lay, 1); threaded_tile_processor(re); @@ -2468,7 +2468,7 @@ static void do_render_composite_fields_blur_3d(Render *re) R.stats_draw= re->stats_draw; if (update_newframe) - scene_update_for_newframe(re->scene, re->scene->lay); + scene_update_for_newframe(re->scene, re->lay); if(re->r.scemode & R_FULL_SAMPLE) do_merge_fullsample(re, ntree); @@ -2729,7 +2729,7 @@ static void update_physics_cache(Render *re, Scene *scene, int anim_init) BKE_ptcache_make_cache(&baker); } /* evaluating scene options for general Blender render */ -static int render_initialize_from_scene(Render *re, Scene *scene, SceneRenderLayer *srl, int anim, int anim_init) +static int render_initialize_from_scene(Render *re, Scene *scene, SceneRenderLayer *srl, unsigned int lay, int anim, int anim_init) { int winx, winy; rcti disprect; @@ -2756,6 +2756,7 @@ static int render_initialize_from_scene(Render *re, Scene *scene, SceneRenderLay } re->scene= scene; + re->lay= lay; /* not too nice, but it survives anim-border render */ if(anim) { @@ -2796,7 +2797,7 @@ static int render_initialize_from_scene(Render *re, Scene *scene, SceneRenderLay } /* general Blender frame render call */ -void RE_BlenderFrame(Render *re, Scene *scene, SceneRenderLayer *srl, int frame) +void RE_BlenderFrame(Render *re, Scene *scene, SceneRenderLayer *srl, unsigned int lay, int frame) { /* ugly global still... is to prevent preview events and signal subsurfs etc to make full resol */ RenderGlobal.renderingslot= re->slot; @@ -2805,7 +2806,7 @@ void RE_BlenderFrame(Render *re, Scene *scene, SceneRenderLayer *srl, int frame) scene->r.cfra= frame; - if(render_initialize_from_scene(re, scene, srl, 0, 0)) { + if(render_initialize_from_scene(re, scene, srl, lay, 0, 0)) { do_render_all_options(re); } @@ -2902,15 +2903,14 @@ static int do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh, R } /* saves images to disk */ -void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra, int tfra, ReportList *reports) +void RE_BlenderAnim(Render *re, Scene *scene, unsigned int lay, int sfra, int efra, int tfra, ReportList *reports) { bMovieHandle *mh= BKE_get_movie_handle(scene->r.imtype); - unsigned int lay; int cfrao= scene->r.cfra; int nfra; /* do not fully call for each frame, it initializes & pops output window */ - if(!render_initialize_from_scene(re, scene, NULL, 0, 1)) + if(!render_initialize_from_scene(re, scene, NULL, lay, 0, 1)) return; /* ugly global still... is to prevent renderwin events and signal subsurfs etc to make full resol */ @@ -2945,7 +2945,7 @@ void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra, int tfra, Repo char name[FILE_MAX]; /* only border now, todo: camera lens. (ton) */ - render_initialize_from_scene(re, scene, NULL, 1, 0); + render_initialize_from_scene(re, scene, NULL, lay, 1, 0); if(nfra!=scene->r.cfra) { /* @@ -2953,12 +2953,14 @@ void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra, int tfra, Repo * From convertblender.c: * in localview, lamps are using normal layers, objects only local bits. */ - if(scene->lay & 0xFF000000) - lay= scene->lay & 0xFF000000; - else - lay= scene->lay; + unsigned int updatelay; - scene_update_for_newframe(scene, lay); + if(re->lay & 0xFF000000) + updatelay= re->lay & 0xFF000000; + else + updatelay= re->lay; + + scene_update_for_newframe(scene, updatelay); continue; } else diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 85c96d17ac0..d0a334f039e 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -2652,7 +2652,7 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_up /* get the threads running */ for(a=0; ar.threads; a++) { /* set defaults in handles */ - handles[a].ssamp.shi[0].lay= re->scene->lay; + handles[a].ssamp.shi[0].lay= re->lay; if (type==RE_BAKE_SHADOW) { handles[a].ssamp.shi[0].passflag= SCE_PASS_SHADOW; diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index 75ad292c003..0af05c3cdee 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -494,7 +494,7 @@ static void precache_setup_shadeinput(Render *re, ObjectInstanceRen *obi, Materi shi->har= shi->mat->har; shi->obi= obi; shi->obr= obi->obr; - shi->lay = re->scene->lay; + shi->lay = re->lay; } static void precache_init_parts(Render *re, RayObject *tree, ShadeInput *shi, ObjectInstanceRen *obi, int totthread, int *parts) diff --git a/source/creator/creator.c b/source/creator/creator.c index bf45a89fa5b..3eb2cad1f65 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -685,7 +685,7 @@ static int render_frame(int argc, char **argv, void *data) frame = MIN2(MAXFRAME, MAX2(MINAFRAME, frame)); - RE_BlenderAnim(re, scene, frame, frame, scene->r.frame_step, &reports); + RE_BlenderAnim(re, scene, scene->lay, frame, frame, scene->r.frame_step, &reports); return 1; } else { printf("\nError: frame number must follow '-f'.\n"); @@ -705,7 +705,7 @@ static int render_animation(int argc, char **argv, void *data) Render *re= RE_NewRender(scene->id.name, RE_SLOT_DEFAULT); ReportList reports; BKE_reports_init(&reports, RPT_PRINT); - RE_BlenderAnim(re, scene, scene->r.sfra, scene->r.efra, scene->r.frame_step, &reports); + RE_BlenderAnim(re, scene, scene->lay, scene->r.sfra, scene->r.efra, scene->r.frame_step, &reports); } else { printf("\nError: no blend loaded. cannot use '-a'.\n"); } From 5576b3aabf5c8561417510b8dd950dad7646c4fc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Mar 2010 21:04:02 +0000 Subject: [PATCH 057/153] disallow 'nan' for button input and pydriver's --- source/blender/python/intern/bpy_driver.c | 25 ++++++++++++-------- source/blender/python/intern/bpy_interface.c | 3 +++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index de2f1837226..58932192b3c 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -152,7 +152,7 @@ float BPY_pydriver_eval (ChannelDriver *driver) PyGILState_STATE gilstate; DriverVar *dvar; - float result = 0.0f; /* default return */ + double result = 0.0; /* default return */ char *expr = NULL; short targets_ok= 1; int i; @@ -163,11 +163,11 @@ float BPY_pydriver_eval (ChannelDriver *driver) /* get the py expression to be evaluated */ expr = driver->expression; if ((expr == NULL) || (expr[0]=='\0')) - return result; + return 0.0f; if(!(G.f & G_SCRIPT_AUTOEXEC)) { printf("skipping driver '%s', automatic scripts are disabled\n", driver->expression); - return result; + return 0.0f; } gilstate = PyGILState_Ensure(); @@ -177,7 +177,7 @@ float BPY_pydriver_eval (ChannelDriver *driver) if (bpy_pydriver_create_dict() != 0) { fprintf(stderr, "Pydriver error: couldn't create Python dictionary"); PyGILState_Release(gilstate); - return result; + return 0.0f; } } @@ -238,7 +238,7 @@ float BPY_pydriver_eval (ChannelDriver *driver) targets_ok= 0; } - fprintf(stderr, "\tBPY_pydriver_eval() - couldn't add variable '%s' to namespace \n", dvar->name); + fprintf(stderr, "\tBPY_pydriver_eval() - couldn't add variable '%s' to namespace\n", dvar->name); // BPy_errors_to_report(NULL); // TODO - reports PyErr_Print(); PyErr_Clear(); @@ -260,12 +260,10 @@ float BPY_pydriver_eval (ChannelDriver *driver) /* process the result */ if (retval == NULL) { pydriver_error(driver); - result = 0.0f; - } else if((result= (float)PyFloat_AsDouble(retval)) == -1.0f && PyErr_Occurred()) { + } else if((result= PyFloat_AsDouble(retval)) == -1.0 && PyErr_Occurred()) { pydriver_error(driver); Py_DECREF(retval); - result = 0.0f; - + result = 0.0; } else { /* all fine, make sure the "invalid expression" flag is cleared */ @@ -274,5 +272,12 @@ float BPY_pydriver_eval (ChannelDriver *driver) } PyGILState_Release(gilstate); - return result; + + if(finite(result)) { + return (float)result; + } + else { + fprintf(stderr, "\tBPY_pydriver_eval() - driver '%s' evaluates to '%f'\n", dvar->name, result); + return 0.0f; + } } diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 8e93751a490..342a8c44d09 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -580,6 +580,9 @@ int BPY_button_eval(bContext *C, char *expr, double *value) if(val==-1 && PyErr_Occurred()) { error_ret= -1; } + else if (!finite(val)) { + *value= 0.0; + } else { *value= val; } From 9385c465814c2f14d9ec478bddf87100da903b40 Mon Sep 17 00:00:00 2001 From: Jens Ole Wund Date: Sun, 14 Mar 2010 21:15:22 +0000 Subject: [PATCH 058/153] soft bodies kind of bug fixing: After watching 2.5 from a distance, i did review the soft body module to match in 2.5 every thing can be animated rule. Until now i did not realize, that, by default, every property is 'fcurve'-able unless told to be not. I really like it that way. However SB code did assume some things not to be changing after birth of the SB object. After spending some hours with softbody.c /* as may be read in its history */ I think most of the SB properties are ready to go. For those that do not, some of them never will, i did reset the flag in the RNA definitions. There is one not completely resolved: bending stiffness which will work if the initial value was non zero, because only in this case the secondary set of springs needed is built at all. Duh, and there a zillions of cases to test .. please do so. --- source/blender/blenkernel/intern/softbody.c | 2 +- source/blender/makesrna/intern/rna_object_force.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index a67cf98865f..1ebf613dea8 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -3412,7 +3412,7 @@ static void reference_to_scratch(Object *ob) for(a=0; atotpoint; a++, rp++, bp++) { VECCOPY(rp->pos,bp->pos); VECADD(accu_pos,accu_pos,bp->pos); - accu_mass += bp-> mass; + accu_mass += _final_mass(ob,bp); } mul_v3_fl(accu_pos,1.0f/accu_mass); VECCOPY(sb->scratch->Ref.com,accu_pos); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index aa41878a0c5..9fb17c82fa3 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -1414,7 +1414,7 @@ static void rna_def_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "nodemass"); RNA_def_property_range(prop, 0.0f, 50000.0f); - RNA_def_property_ui_text(prop, "Mass", ""); + RNA_def_property_ui_text(prop, "Mass", "General Mass value"); RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "mass_vertex_group", PROP_STRING, PROP_NONE); @@ -1423,6 +1423,7 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SoftBodySettings_mass_vgroup_set"); RNA_def_property_update(prop, 0, "rna_softbody_update"); + /* no longer used */ prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION); RNA_def_property_float_sdna(prop, NULL, "grav"); RNA_def_property_range(prop, -10.0f, 10.0f); @@ -1439,23 +1440,25 @@ static void rna_def_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "goal_vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "vertgroup"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not impossible .. but not supported yet */ RNA_def_property_string_funcs(prop, "rna_SoftBodySettings_goal_vgroup_get", "rna_SoftBodySettings_goal_vgroup_length", "rna_SoftBodySettings_goal_vgroup_set"); RNA_def_property_ui_text(prop, "Goal Vertex Group", "Control point weight values"); prop= RNA_def_property(srna, "goal_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "mingoal"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Goal Minimum", "Goal minimum, vertex group weights are scaled to match this range"); + RNA_def_property_ui_text(prop, "Goal Minimum", "Goal minimum, vertex weights are scaled to match this range"); RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "goal_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxgoal"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Goal Maximum", "Goal maximum, vertex group weights are scaled to match this range"); + RNA_def_property_ui_text(prop, "Goal Maximum", "Goal maximum, vertex weights are scaled to match this range"); RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "goal_default", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "defgoal"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Default", "Default Goal (vertex target position) value, when no Vertex Group used"); RNA_def_property_update(prop, 0, "rna_softbody_update"); @@ -1532,11 +1535,13 @@ static void rna_def_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "collision_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "sbc_mode"); RNA_def_property_enum_items(prop, collision_type_items); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Collision Type", "Choose Collision Type"); RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "ball_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colball"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* code is not ready for that yet */ RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_ui_text(prop, "Ball Size", "Absolute ball size or factor if not manual adjusted"); RNA_def_property_update(prop, 0, "rna_softbody_update"); @@ -1625,16 +1630,19 @@ static void rna_def_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "use_goal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_use_goal_get", "rna_SoftBodySettings_use_goal_set"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Use Goal", "Define forces for vertices to stick to animated position"); RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "use_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_use_edges_get", "rna_SoftBodySettings_use_edges_set"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Use Edges", "Use Edges as springs"); RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "stiff_quads", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_stiff_quads_get", "rna_SoftBodySettings_stiff_quads_set"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Stiff Quads", "Adds diagonal springs on 4-gons"); RNA_def_property_update(prop, 0, "rna_softbody_update"); @@ -1655,6 +1663,7 @@ static void rna_def_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "self_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_self_collision_get", "rna_SoftBodySettings_self_collision_set"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Self Collision", "Enable naive vertex ball self collision"); RNA_def_property_update(prop, 0, "rna_softbody_update"); From 14c2fc3c12f2f5b43a8689f2a54c249a4325118c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 14 Mar 2010 21:25:01 +0000 Subject: [PATCH 059/153] Various warning fixes. --- source/blender/blenkernel/intern/sequencer.c | 2 +- source/blender/editors/object/object_bake.c | 4 ++-- source/blender/makesrna/intern/rna_actuator.c | 4 ++-- source/blender/makesrna/intern/rna_sequencer.c | 4 ++-- source/blender/makesrna/intern/rna_texture.c | 2 +- source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c | 1 - 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index a4a0a533545..5e3ab5f5f84 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -2181,7 +2181,7 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int else re= RE_NewRender(sce->id.name, RE_SLOT_VIEW); - RE_BlenderFrame(re, sce, sce->lay, NULL, frame); + RE_BlenderFrame(re, sce, NULL, sce->lay, frame); RE_AcquireResultImage(re, &rres); diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 9458614293f..c71e6ebcbea 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -203,7 +203,7 @@ static void bake_startjob(void *bkv, short *stop, short *do_update) RE_test_break_cb(bkr->re, NULL, thread_break); G.afbreek= 0; /* blender_test_break uses this global */ - RE_Database_Baking(bkr->re, scene, scene->r.bake_mode, bkr->actob, scene->lay); + RE_Database_Baking(bkr->re, scene, scene->lay, scene->r.bake_mode, bkr->actob); /* baking itself is threaded, cannot use test_break in threads. we also update optional imagewindow */ bkr->tot= RE_bake_shade_all_selected(bkr->re, scene->r.bake_mode, bkr->actob, bkr->do_update); @@ -301,7 +301,7 @@ static int bake_image_exec(bContext *C, wmOperator *op) RE_test_break_cb(bkr.re, NULL, thread_break); G.afbreek= 0; /* blender_test_break uses this global */ - RE_Database_Baking(bkr.re, scene, scene->r.bake_mode, (scene->r.bake_flag & R_BAKE_TO_ACTIVE)? OBACT: NULL, scene->lay); + RE_Database_Baking(bkr.re, scene, scene->lay, scene->r.bake_mode, (scene->r.bake_flag & R_BAKE_TO_ACTIVE)? OBACT: NULL); /* baking itself is threaded, cannot use test_break in threads */ BLI_init_threads(&threads, do_bake_render, 1); diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index 0cb8ff39a89..c24b6b99c59 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -542,7 +542,7 @@ static void rna_def_property_actuator(BlenderRNA *brna) static void rna_def_constraint_actuator(BlenderRNA *brna) { StructRNA *srna; - PropertyRNA *prop; + /*PropertyRNA *prop; static EnumPropertyItem prop_type_items[] ={ {ACT_CONST_TYPE_LOC, "LOC", 0, "Location Constraint", ""}, @@ -550,7 +550,7 @@ static void rna_def_constraint_actuator(BlenderRNA *brna) {ACT_CONST_TYPE_ORI, "ORI", 0, "Orientation Constraint", ""}, {ACT_CONST_TYPE_FH, "FH", 0, "Force Field Constraint", ""}, {0, NULL, 0, NULL, NULL} - }; + };*/ srna= RNA_def_struct(brna, "ConstraintActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Constraint Actuator", "Actuator to .."); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 83295331d9a..7d34caf0853 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -342,7 +342,7 @@ static int rna_Sequence_filepath_length(PointerRNA *ptr) return strlen(path)+1; } -static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value) +/*static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value) { Sequence *seq= (Sequence*)(ptr->data); char dir[FILE_MAX], name[FILE_MAX]; @@ -359,7 +359,7 @@ static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value) BLI_split_dirfile(value, NULL, name); BLI_strncpy(elem->name, name, sizeof(elem->name)); -} +}*/ static void rna_Sequence_update(Main *bmain, Scene *scene, PointerRNA *ptr) { diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 8a432002d2b..86018c996de 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -43,7 +43,7 @@ #include "BKE_node.h" -static EnumPropertyItem texture_filter_items[] = { +EnumPropertyItem texture_filter_items[] = { {TXF_BOX, "BOX", 0, "Box", ""}, {TXF_EWA, "EWA", 0, "EWA", ""}, {TXF_FELINE, "FELINE", 0, "FELINE", ""}, diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c index 72990ed8fd2..701fe688f5f 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c @@ -126,7 +126,6 @@ static void node_composit_exec_channel_matte(void *data, bNode *node, bNodeStack { CompBuf *cbuf; CompBuf *outbuf; - NodeChroma *c=(NodeChroma *)node->storage; if(in[0]->hasinput==0) return; if(in[0]->data==NULL) return; From 64078786cc2df63d9d8f1d10c48a5bda24639bcb Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 14 Mar 2010 22:30:57 +0000 Subject: [PATCH 060/153] Fix #20486: blender hangs upon import attempt of an .obj with >40k polys. Added automatic generation of lookup_int callbacks for collections, for quicker lookup by index instead of looping over the whole thing. Import is still quite slow, though now it only takes a few seconds. The next bottleneck seems to be running update (depsgraph, notifiers, ..) on setting every property. I fixed part of that by avoiding a notifier to be added each time, now it checks for duplicates. --- source/blender/makesrna/intern/makesrna.c | 94 +++++++++++++++++++ source/blender/makesrna/intern/rna_access.c | 14 +++ source/blender/makesrna/intern/rna_internal.h | 2 + .../windowmanager/intern/wm_event_system.c | 13 ++- 4 files changed, 122 insertions(+), 1 deletion(-) diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 15d5658160d..6d3d78907f1 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -846,6 +846,98 @@ static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA * return func; } +static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, char *manualfunc, char *nextfunc) +{ + char *func; + + if(prop->flag & PROP_IDPROPERTY) + return NULL; + + if(!manualfunc) { + if(!dp->dnastructname || !dp->dnaname) + return NULL; + + /* only supported in case of standard next functions */ + if(strcmp(nextfunc, "rna_iterator_array_next") == 0); + else if(strcmp(nextfunc, "rna_iterator_listbase_next") == 0); + else return NULL; + } + + func= rna_alloc_function_name(srna->identifier, prop->identifier, "lookup_int"); + + fprintf(f, "PointerRNA %s(PointerRNA *ptr, int index)\n", func); + fprintf(f, "{\n"); + + if(manualfunc) { + fprintf(f, "\n return %s(ptr, index);\n", manualfunc); + fprintf(f, "}\n\n"); + return func; + } + + fprintf(f, " PointerRNA r_ptr;\n"); + fprintf(f, " CollectionPropertyIterator iter;\n\n"); + + fprintf(f, " %s_%s_begin(&iter, ptr);\n\n", srna->identifier, prop->identifier); + fprintf(f, " {\n"); + + if(strcmp(nextfunc, "rna_iterator_array_next") == 0) { + fprintf(f, " ArrayIterator *internal= iter.internal;\n"); + fprintf(f, " if(internal->skip) {\n"); + fprintf(f, " while(index-- > 0) {\n"); + fprintf(f, " do {\n"); + fprintf(f, " internal->ptr += internal->itemsize;\n"); + fprintf(f, " } while(internal->skip(&iter, internal->ptr));\n"); + fprintf(f, " }\n"); + fprintf(f, " }\n"); + fprintf(f, " else {\n"); + fprintf(f, " internal->ptr += internal->itemsize*index;\n"); + fprintf(f, " }\n"); + } + else if(strcmp(nextfunc, "rna_iterator_listbase_next") == 0) { + fprintf(f, " ListBaseIterator *internal= iter.internal;\n"); + fprintf(f, " if(internal->skip) {\n"); + fprintf(f, " while(index-- > 0) {\n"); + fprintf(f, " do {\n"); + fprintf(f, " internal->link= internal->link->next;\n"); + fprintf(f, " } while(internal->skip(&iter, internal->link));\n"); + fprintf(f, " }\n"); + fprintf(f, " }\n"); + fprintf(f, " else {\n"); + fprintf(f, " while(index-- > 0)\n"); + fprintf(f, " internal->link= internal->link->next;\n"); + fprintf(f, " }\n"); + } + + fprintf(f, " }\n\n"); + + fprintf(f, " r_ptr = %s_%s_get(&iter);\n", srna->identifier, prop->identifier); + fprintf(f, " %s_%s_end(&iter);\n\n", srna->identifier, prop->identifier); + + fprintf(f, " return r_ptr;\n"); + +#if 0 + rna_print_data_get(f, dp); + item_type= (cprop->item_type)? (char*)cprop->item_type: "UnknownType"; + + if(dp->dnalengthname || dp->dnalengthfixed) { + if(dp->dnalengthname) + fprintf(f, "\n rna_array_lookup_int(ptr, &RNA_%s, data->%s, sizeof(data->%s[0]), data->%s, index);\n", item_type, dp->dnaname, dp->dnaname, dp->dnalengthname); + else + fprintf(f, "\n rna_array_lookup_int(ptr, &RNA_%s, data->%s, sizeof(data->%s[0]), %d, index);\n", item_type, dp->dnaname, dp->dnaname, dp->dnalengthfixed); + } + else { + if(dp->dnapointerlevel == 0) + fprintf(f, "\n return rna_listbase_lookup_int(ptr, &RNA_%s, &data->%s, index);\n", item_type, dp->dnaname); + else + fprintf(f, "\n return rna_listbase_lookup_int(ptr, &RNA_%s, data->%s, index);\n", item_type, dp->dnaname); + } +#endif + + fprintf(f, "}\n\n"); + + return func; +} + static char *rna_def_property_next_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, char *manualfunc) { char *func, *getfunc; @@ -1015,6 +1107,7 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) } case PROP_COLLECTION: { CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; + char *nextfunc= (char*)cprop->next; if(dp->dnatype && strcmp(dp->dnatype, "ListBase")==0); else if(dp->dnalengthname || dp->dnalengthfixed) @@ -1031,6 +1124,7 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) cprop->begin= (void*)rna_def_property_begin_func(f, srna, prop, dp, (char*)cprop->begin); cprop->next= (void*)rna_def_property_next_func(f, srna, prop, dp, (char*)cprop->next); cprop->end= (void*)rna_def_property_end_func(f, srna, prop, dp, (char*)cprop->end); + cprop->lookupint= (void*)rna_def_property_lookup_int_func(f, srna, prop, dp, (char*)cprop->lookupint, nextfunc); if(!(prop->flag & PROP_IDPROPERTY)) { if(!cprop->begin) { diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 6bd99793933..672ca5d7b90 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -2736,6 +2736,12 @@ void rna_iterator_listbase_end(CollectionPropertyIterator *iter) iter->internal= NULL; } +PointerRNA rna_listbase_lookup_int(PointerRNA *ptr, StructRNA *type, struct ListBase *lb, int index) +{ + void *data= BLI_findlink(lb, index); + return rna_pointer_inherit_refine(ptr, type, data); +} + void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, int free_ptr, IteratorSkipFunc skip) { ArrayIterator *internal; @@ -2800,6 +2806,14 @@ void rna_iterator_array_end(CollectionPropertyIterator *iter) iter->internal= NULL; } +PointerRNA rna_array_lookup_int(PointerRNA *ptr, StructRNA *type, void *data, int itemsize, int length, int index) +{ + if(index < 0 || index >= length) + return PointerRNA_NULL; + + return rna_pointer_inherit_refine(ptr, type, ((char*)data) + index*itemsize); +} + /* RNA Path - Experiment */ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int bracket) diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 06e0a96deed..68a7ca29a1f 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -297,6 +297,7 @@ void rna_iterator_listbase_begin(struct CollectionPropertyIterator *iter, struct void rna_iterator_listbase_next(struct CollectionPropertyIterator *iter); void *rna_iterator_listbase_get(struct CollectionPropertyIterator *iter); void rna_iterator_listbase_end(struct CollectionPropertyIterator *iter); +PointerRNA rna_listbase_lookup_int(PointerRNA *ptr, StructRNA *type, struct ListBase *lb, int index); typedef struct ArrayIterator { char *ptr; @@ -311,6 +312,7 @@ void rna_iterator_array_next(struct CollectionPropertyIterator *iter); void *rna_iterator_array_get(struct CollectionPropertyIterator *iter); void *rna_iterator_array_dereference_get(struct CollectionPropertyIterator *iter); void rna_iterator_array_end(struct CollectionPropertyIterator *iter); +PointerRNA rna_array_lookup_int(PointerRNA *ptr, StructRNA *type, void *data, int itemsize, int length, int index); /* Duplicated code since we can't link in blenlib */ diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 9ef94b5e1ff..8cfd45662ac 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -108,6 +108,17 @@ void wm_event_free_all(wmWindow *win) /* ********************* notifiers, listeners *************** */ +static int wm_test_duplicate_notifier(wmWindowManager *wm, unsigned int type, void *reference) +{ + wmNotifier *note; + + for(note=wm->queue.first; note; note=note->next) + if((note->category|note->data|note->subtype|note->action) == type && note->reference == reference) + return 1; + + return 0; +} + /* XXX: in future, which notifiers to send to other windows? */ void WM_event_add_notifier(const bContext *C, unsigned int type, void *reference) { @@ -134,7 +145,7 @@ void WM_main_add_notifier(unsigned int type, void *reference) Main *bmain= G.main; wmWindowManager *wm= bmain->wm.first; - if(wm) { + if(wm && !wm_test_duplicate_notifier(wm, type, reference)) { wmNotifier *note= MEM_callocN(sizeof(wmNotifier), "notifier"); note->wm= wm; From 0c110358545db400718fc563dd42a2eb19fa756f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Mar 2010 22:43:44 +0000 Subject: [PATCH 061/153] [#21504] Projection Clone Paint broken own error when adding re-project, broke cloning between 2 UV layers --- .../editors/sculpt_paint/paint_image.c | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index bcfb2fedb12..6137d83e77e 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -2871,6 +2871,7 @@ static void project_paint_begin(ProjPaintState *ps) if (ps->dm_mtface_clone==NULL || ps->dm_mtface_clone==ps->dm_mtface) { ps->do_layer_clone = 0; ps->dm_mtface_clone= NULL; + printf("ACK!\n"); } } @@ -4567,7 +4568,16 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps) { Scene *scene= CTX_data_scene(C); ToolSettings *settings= scene->toolsettings; - Brush *brush; + Brush *brush= paint_brush(&settings->imapaint.paint); + + /* brush */ + ps->brush = brush; + ps->tool = brush->imagepaint_tool; + ps->blend = brush->blend; + + ps->is_airbrush = (brush->flag & BRUSH_AIRBRUSH) ? 1 : 0; + ps->is_texbrush = (brush->mtex.tex) ? 1 : 0; + /* these can be NULL */ ps->v3d= CTX_wm_view3d(C); @@ -4607,16 +4617,6 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps) if(ps->normal_angle_range <= 0.0f) ps->do_mask_normal = 0; /* no need to do blending */ - - - /* brush */ - brush= paint_brush(&settings->imapaint.paint); - ps->brush = brush; - ps->tool = brush->imagepaint_tool; - ps->blend = brush->blend; - - ps->is_airbrush = (brush->flag & BRUSH_AIRBRUSH) ? 1 : 0; - ps->is_texbrush = (brush->mtex.tex) ? 1 : 0; } static int texture_paint_init(bContext *C, wmOperator *op) From f3001c98a06a4d249d6de507b98c272774d5c0d9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Mar 2010 23:19:44 +0000 Subject: [PATCH 062/153] more addon UI cleanup --- release/scripts/ui/space_userpref.py | 89 +++++++++++++++------------- 1 file changed, 49 insertions(+), 40 deletions(-) diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 426b23355d0..9dc539aa4c6 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -1385,8 +1385,6 @@ class USERPREF_PT_addons(bpy.types.Panel): bl_label = "Addons" bl_region_type = 'WINDOW' bl_show_header = False - - _addon_blank = {"name": "", "author": "", "version": "", "blender": "", "location": "", "url": "", "category": ""} def poll(self, context): userpref = context.user_preferences @@ -1404,19 +1402,6 @@ class USERPREF_PT_addons(bpy.types.Panel): # del sys.path[0] return modules - - def _attributes(self, mod): - # collect, check and process all attributes of the add-on - if not hasattr(mod, 'expanded'): - mod.expanded = False - - info = self._addon_blank.copy() - info.update(getattr(mod, "bl_addon_info", {})) - - if not info["name"]: - info["name"] = mod.__name__ - - return info def draw(self, context): layout = self.layout @@ -1425,7 +1410,7 @@ class USERPREF_PT_addons(bpy.types.Panel): used_ext = {ext.module for ext in userpref.addons} # collect the categories that can be filtered on - addons = [(mod, self._attributes(mod)) for mod in self._addon_list()] + addons = [(mod, addon_info_get(mod)) for mod in self._addon_list()] cats = {info["category"] for mod, info in addons} cats.add("") @@ -1433,7 +1418,7 @@ class USERPREF_PT_addons(bpy.types.Panel): cats = ['All', 'Disabled', 'Enabled'] + sorted(cats) - bpy.types.Scene.EnumProperty(items=[(cats[i],cats[i],str(i)) for i in range(len(cats))], + bpy.types.Scene.EnumProperty(items=[(cats[i], cats[i], str(i)) for i in range(len(cats))], name="Category", attr="addon_filter", description="Filter add-ons by category") bpy.types.Scene.StringProperty(name="Search", attr="addon_search", description="Search within the selected filter") @@ -1446,10 +1431,9 @@ class USERPREF_PT_addons(bpy.types.Panel): filter = context.scene.addon_filter search = context.scene.addon_search.lower() - for mod in self._addon_list(): + for mod, info in addons: module_name = mod.__name__ - info = self._attributes(mod) - + # check if add-on should be visible with current filters if filter != "All" and \ filter != info["category"] and \ @@ -1471,7 +1455,7 @@ class USERPREF_PT_addons(bpy.types.Panel): # Arrow # # If there are Infos or UI is expanded - if mod.expanded: + if info["expanded"]: row.operator("wm.addon_expand", icon="TRIA_DOWN").module = module_name elif info["author"] or info["version"] or info["url"] or info["location"]: row.operator("wm.addon_expand", icon="TRIA_RIGHT").module = module_name @@ -1483,9 +1467,9 @@ class USERPREF_PT_addons(bpy.types.Panel): row.label(text=info["name"]) row.operator("wm.addon_disable" if module_name in used_ext else "wm.addon_enable").module = module_name - + # Expanded UI (only if additional infos are available) - if mod.expanded: + if info["expanded"]: if info["author"]: split = column.row().split(percentage=0.15) split.label(text='Author:') @@ -1505,9 +1489,30 @@ class USERPREF_PT_addons(bpy.types.Panel): split.separator() split.separator() + from bpy.props import * +def addon_info_get(mod, info_basis={"name": "", "author": "", "version": "", "blender": "", "location": "", "url": "", "category": "", "expanded": False}): + addon_info = getattr(mod, "bl_addon_info", {}) + + # avoid re-initializing + if "_init" in addon_info: + return addon_info + + if not addon_info: + mod.bl_addon_info = addon_info + + for key, value in info_basis.items(): + addon_info.setdefault(key, value) + + if not addon_info["name"]: + addon_info["name"] = mod.__name__ + + addon_info["_init"] = None + return addon_info + + class WM_OT_addon_enable(bpy.types.Operator): "Enable an addon" bl_idname = "wm.addon_enable" @@ -1516,30 +1521,34 @@ class WM_OT_addon_enable(bpy.types.Operator): module = StringProperty(name="Module", description="Module name of the addon to enable") def execute(self, context): - import traceback - ext = context.user_preferences.addons.new() module_name = self.properties.module - ext.module = module_name try: mod = __import__(module_name) mod.register() except: + import traceback traceback.print_exc() - + return {'CANCELLED'} + + ext = context.user_preferences.addons.new() + ext.module = module_name + # check if add-on is written for current blender version, or raise a warning - version = hasattr(mod, 'blender') - if version: - version = (mod.blender).split('.',2) + info = addon_info_get(mod) + + if info["blender"]: + version = info["blender"].split(".", 2) for i in range(len(version)): try: version[i] = int(version[i]) except: break - if version[i]>bpy.app.version[i]: - self.report('WARNING','This script was written for a newer version of Blender \ -and might not function (correctly).\nThe script is enabled though.') - elif version[i]==bpy.app.version[i]: + + if version[i] > bpy.app.version[i]: + self.report("WARNING','This script was written for a newer version of Blender \ +and might not function (correctly).\nThe script is enabled though.") + elif version[i] == bpy.app.version[i]: continue else: break @@ -1647,19 +1656,19 @@ class WM_OT_addon_expand(bpy.types.Operator): module = StringProperty(name="Module", description="Module name of the addon to expand") def execute(self, context): - import traceback module_name = self.properties.module + # unlikely to fail, module should have alredy been imported try: mod = __import__(module_name) except: + import traceback traceback.print_exc() + return {'CANCELLED'} - if mod.expanded: - mod.expanded = False - else: - mod.expanded = True - + info = addon_info_get(mod) + info["expanded"] = not info["expanded"] + print(info["expanded"]) return {'FINISHED'} From f8a4683b72b086d9fe63c2c438b370e67623c195 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Mar 2010 23:26:17 +0000 Subject: [PATCH 063/153] pep8 warnings --- release/scripts/modules/bpy/__init__.py | 2 +- release/scripts/op/image.py | 20 ++++----- release/scripts/op/wm.py | 2 +- release/scripts/ui/properties_data_lamp.py | 2 + .../scripts/ui/properties_physics_softbody.py | 3 +- release/scripts/ui/properties_texture.py | 42 +++++++++---------- release/scripts/ui/space_userpref.py | 14 +++---- release/scripts/ui/space_view3d_toolbar.py | 8 ++-- 8 files changed, 47 insertions(+), 46 deletions(-) diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py index 234d7993789..8f6bada6561 100644 --- a/release/scripts/modules/bpy/__init__.py +++ b/release/scripts/modules/bpy/__init__.py @@ -46,7 +46,7 @@ def _main(): # a bit nasty but this prevents help() and input() from locking blender # Ideally we could have some way for the console to replace sys.stdin but # python would lock blender while waiting for a return value, not easy :| - + if not app.debug: _sys.stdin = None diff --git a/release/scripts/op/image.py b/release/scripts/op/image.py index b2433481b84..0d20a9639b9 100644 --- a/release/scripts/op/image.py +++ b/release/scripts/op/image.py @@ -65,7 +65,7 @@ class ProjectEdit(bpy.types.Operator): bl_idname = "image.project_edit" bl_label = "Project Edit" bl_options = {'REGISTER'} - + _proj_hack = [""] def execute(self, context): @@ -79,17 +79,17 @@ class ProjectEdit(bpy.types.Operator): image.tag = True bpy.ops.paint.image_from_view() - + image_new = None for image in bpy.data.images: if not image.tag: image_new = image break - + if not image_new: self.report({'ERROR'}, "Could not make new image") return {'CANCELLED'} - + filename = os.path.basename(bpy.data.filename) filename = os.path.splitext(filename)[0] # filename = bpy.utils.clean_name(filename) # fixes rubbish, needs checking @@ -98,28 +98,28 @@ class ProjectEdit(bpy.types.Operator): filename = os.path.join(os.path.dirname(bpy.data.filename), filename) else: filename = "//" + filename - + obj = context.object if obj: filename += "_" + bpy.utils.clean_name(obj.name) - + filename_final = filename + "." + EXT i = 0 while os.path.exists(bpy.utils.expandpath(filename_final)): filename_final = filename + ("%.3d.%s" % (i, EXT)) i += 1 - + image_new.name = os.path.basename(filename_final) ProjectEdit._proj_hack[0] = image_new.name - + image_new.filename_raw = filename_final # TODO, filename raw is crummy image_new.file_format = 'PNG' image_new.save() - + subprocess.Popen([image_editor, bpy.utils.expandpath(filename_final)]) - + return {'FINISHED'} diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py index 07a7afe026e..0a333db421b 100644 --- a/release/scripts/op/wm.py +++ b/release/scripts/op/wm.py @@ -569,7 +569,7 @@ classes = [ WM_OT_context_cycle_enum, WM_OT_context_cycle_int, WM_OT_context_modal_mouse, - + WM_OT_url_open, WM_OT_doc_view, diff --git a/release/scripts/ui/properties_data_lamp.py b/release/scripts/ui/properties_data_lamp.py index e72cfa80012..ceafb121c09 100644 --- a/release/scripts/ui/properties_data_lamp.py +++ b/release/scripts/ui/properties_data_lamp.py @@ -40,6 +40,7 @@ class DataButtonsPanel(bpy.types.Panel): engine = context.scene.render.engine return context.lamp and (engine in self.COMPAT_ENGINES) + class DATA_PT_preview(DataButtonsPanel): bl_label = "Preview" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} @@ -47,6 +48,7 @@ class DATA_PT_preview(DataButtonsPanel): def draw(self, context): self.layout.template_preview(context.lamp) + class DATA_PT_context_lamp(DataButtonsPanel): bl_label = "" bl_show_header = False diff --git a/release/scripts/ui/properties_physics_softbody.py b/release/scripts/ui/properties_physics_softbody.py index ed4c24b29b3..a582bfa520b 100644 --- a/release/scripts/ui/properties_physics_softbody.py +++ b/release/scripts/ui/properties_physics_softbody.py @@ -39,11 +39,10 @@ class PhysicButtonsPanel(bpy.types.Panel): ob = context.object rd = context.scene.render # return (ob and ob.type == 'MESH') and (not rd.use_game_engine) -# i really hate touching things i do not understand completely .. but i think this should read (bjornmose) +# i really hate touching things i do not understand completely .. but i think this should read (bjornmose) return (ob and (ob.type == 'MESH' or ob.type == 'LATTICE'or ob.type == 'CURVE')) and (not rd.use_game_engine) - class PHYSICS_PT_softbody(PhysicButtonsPanel): bl_label = "Soft Body" diff --git a/release/scripts/ui/properties_texture.py b/release/scripts/ui/properties_texture.py index 4cdd404a405..4616fc5f8ab 100644 --- a/release/scripts/ui/properties_texture.py +++ b/release/scripts/ui/properties_texture.py @@ -598,19 +598,19 @@ class TEXTURE_PT_image(TextureTypePanel): layout.template_image(tex, "image", tex.image_user) -def texture_filter_common(tex, layout): - layout.label(text="Filter:") - layout.prop(tex, "filter", text="") - if tex.mipmap and tex.filter in ('AREA', 'EWA', 'FELINE'): - if tex.filter == 'FELINE': - layout.prop(tex, "filter_probes", text="Probes") - else: - layout.prop(tex, "filter_eccentricity", text="Eccentricity") - - layout.prop(tex, "filter_size") - layout.prop(tex, "filter_size_minimum") - +def texture_filter_common(tex, layout): + layout.label(text="Filter:") + layout.prop(tex, "filter", text="") + if tex.mipmap and tex.filter in ('AREA', 'EWA', 'FELINE'): + if tex.filter == 'FELINE': + layout.prop(tex, "filter_probes", text="Probes") + else: + layout.prop(tex, "filter_eccentricity", text="Eccentricity") + + layout.prop(tex, "filter_size") + layout.prop(tex, "filter_size_minimum") + class TEXTURE_PT_image_sampling(TextureTypePanel): bl_label = "Image Sampling" @@ -650,7 +650,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel): col.prop(tex, "interpolation") texture_filter_common(tex, col) - + class TEXTURE_PT_image_mapping(TextureTypePanel): bl_label = "Image Mapping" @@ -731,13 +731,13 @@ class TEXTURE_PT_envmap(TextureTypePanel): tex = context.texture env = tex.environment_map - + wide_ui = context.region.width > narrowui - + row = layout.row() row.prop(env, "source", expand=True) row.menu("TEXTURE_MT_envmap_specials", icon='DOWNARROW_HLT', text="") - + if env.source == 'IMAGE_FILE': layout.template_ID(tex, "image", open="image.open") layout.template_image(tex, "image", tex.image_user, compact=True) @@ -746,9 +746,9 @@ class TEXTURE_PT_envmap(TextureTypePanel): if env.mapping == 'PLANE': layout.prop(env, "zoom") layout.prop(env, "viewpoint_object") - + split = layout.split() - + col = split.column() col.prop(env, "ignore_layers") col.prop(env, "resolution") @@ -756,7 +756,7 @@ class TEXTURE_PT_envmap(TextureTypePanel): if wide_ui: col = split.column(align=True) - + col.label(text="Clipping:") col.prop(env, "clip_start", text="Start") col.prop(env, "clip_end", text="End") @@ -771,9 +771,9 @@ class TEXTURE_PT_envmap_sampling(TextureTypePanel): layout = self.layout tex = context.texture - + texture_filter_common(tex, layout) - + class TEXTURE_PT_musgrave(TextureTypePanel): bl_label = "Musgrave" diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 9dc539aa4c6..64b79614a6f 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -279,9 +279,9 @@ class USERPREF_PT_interface(bpy.types.Panel): col.label(text="Menu Open Delay:") col.prop(view, "open_toplevel_delay", text="Top Level") col.prop(view, "open_sublevel_delay", text="Sub Level") - + col.separator() - + col.prop(view, "show_splash") @@ -1408,7 +1408,7 @@ class USERPREF_PT_addons(bpy.types.Panel): userpref = context.user_preferences used_ext = {ext.module for ext in userpref.addons} - + # collect the categories that can be filtered on addons = [(mod, addon_info_get(mod)) for mod in self._addon_list()] @@ -1417,7 +1417,7 @@ class USERPREF_PT_addons(bpy.types.Panel): cats.remove("") cats = ['All', 'Disabled', 'Enabled'] + sorted(cats) - + bpy.types.Scene.EnumProperty(items=[(cats[i], cats[i], str(i)) for i in range(len(cats))], name="Category", attr="addon_filter", description="Filter add-ons by category") bpy.types.Scene.StringProperty(name="Search", attr="addon_search", @@ -1447,12 +1447,12 @@ class USERPREF_PT_addons(bpy.types.Panel): continue else: continue - + # Addon UI Code box = layout.column().box() column = box.column() row = column.row() - + # Arrow # # If there are Infos or UI is expanded if info["expanded"]: @@ -1499,7 +1499,7 @@ def addon_info_get(mod, info_basis={"name": "", "author": "", "version": "", "bl # avoid re-initializing if "_init" in addon_info: return addon_info - + if not addon_info: mod.bl_addon_info = addon_info diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py index d702c801b92..c52c93e2189 100644 --- a/release/scripts/ui/space_view3d_toolbar.py +++ b/release/scripts/ui/space_view3d_toolbar.py @@ -745,7 +745,7 @@ class VIEW3D_PT_tools_brush_curve(PaintPanel): brush = settings.brush layout.template_curve_mapping(brush, "curve", brush=True) - + row = layout.row(align=True) row.operator("brush.curve_preset", text="Sharp").shape = 'SHARP' row.operator("brush.curve_preset", text="Smooth").shape = 'SMOOTH' @@ -910,16 +910,16 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel): sub = col.column() sub.prop(ipaint, "seam_bleed") - + row = col.row(align=True) row.operator("image.project_edit", text="View Edit") row.operator("image.project_apply", text="Apply") col.prop(ipaint, "screen_grab_size", text="") - + sub = col.column() sub.operator("paint.project_image") - + sub.operator("image.save_dirty", text="Save Edited") From c63648abc576585f4cdae4dc5b92bf84edeacba8 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 15 Mar 2010 00:34:02 +0000 Subject: [PATCH 064/153] Added curve Radius to properties panel in edit mode. Related to bug [#21606] setting a Curve Radius doesn't take in account already set Values --- .../editors/space_view3d/view3d_buttons.c | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index f1668190ea8..21026de2439 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -146,7 +146,7 @@ typedef struct { float ob_scale[3]; // need temp space due to linked values float ob_dims[3]; short link_scale; - float ve_median[5]; + float ve_median[6]; int curdef; float *defweightp; } TransformProperties; @@ -158,12 +158,12 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d uiBlock *block= (layout)? uiLayoutAbsoluteBlock(layout): NULL; MDeformVert *dvert=NULL; TransformProperties *tfp= v3d->properties_storage; - float median[5], ve_median[5]; - int tot, totw, totweight, totedge; + float median[6], ve_median[6]; + int tot, totw, totweight, totedge, totradius; char defstr[320]; - median[0]= median[1]= median[2]= median[3]= median[4]= 0.0; - tot= totw= totweight= totedge= 0; + median[0]= median[1]= median[2]= median[3]= median[4]= median[5]= 0.0; + tot= totw= totweight= totedge= totradius= 0; defstr[0]= 0; if(ob->type==OB_MESH) { @@ -237,6 +237,8 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d tot++; median[4]+= bezt->weight; totweight++; + median[5]+= bezt->radius; + totradius++; } else { if(bezt->f1 & SELECT) { @@ -262,6 +264,8 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d tot++; median[4]+= bp->weight; totweight++; + median[5]+= bp->radius; + totradius++; } bp++; } @@ -295,6 +299,7 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d if(totedge) median[3] /= (float)totedge; else if(totw) median[3] /= (float)totw; if(totweight) median[4] /= (float)totweight; + if(totradius) median[5] /= (float)totradius; if(v3d->flag & V3D_GLOBAL_STATS) mul_m4_v3(ob->obmat, median); @@ -324,6 +329,8 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d uiBlockEndAlign(block); if(totweight) uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 0, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, ""); + if(totradius) + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 0, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs"); } else { uiBlockBeginAlign(block); @@ -332,6 +339,8 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d uiBlockEndAlign(block); if(totweight) uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 20, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, ""); + if(totradius) + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs"); } } else { @@ -349,6 +358,8 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d uiBlockEndAlign(block); if(totweight) uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 0, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, "Weight is used for SoftBody Goal"); + if(totradius) + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 0, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs"); uiBlockEndAlign(block); } else { @@ -358,6 +369,8 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d uiBlockEndAlign(block); if(totweight) uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 20, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, "Weight is used for SoftBody Goal"); + if(totradius) + uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 0, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs"); uiBlockEndAlign(block); } } @@ -379,6 +392,7 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d sub_v3_v3v3(median, ve_median, median); median[3]= ve_median[3]-median[3]; median[4]= ve_median[4]-median[4]; + median[5]= ve_median[5]-median[5]; if(ob->type==OB_MESH) { Mesh *me= ob->data; @@ -428,6 +442,7 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d add_v3_v3v3(bezt->vec[1], bezt->vec[1], median); add_v3_v3v3(bezt->vec[2], bezt->vec[2], median); bezt->weight+= median[4]; + bezt->radius+= median[5]; } else { if(bezt->f1 & SELECT) { @@ -448,6 +463,7 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d add_v3_v3v3(bp->vec, bp->vec, median); bp->vec[3]+= median[3]; bp->weight+= median[4]; + bp->radius+= median[5]; } bp++; } From 352754d355590c7e513ca00b5b0aa8cb1800e57c Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 15 Mar 2010 01:12:41 +0000 Subject: [PATCH 065/153] Fix [#21603] Mip-mapping setting not saved in User preferences --- source/blender/windowmanager/intern/wm_init_exit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 8e3c9312edd..5302cb1eaaf 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -151,6 +151,7 @@ void WM_init(bContext *C, int argc, char **argv) if (!G.background) { GPU_extensions_init(); + GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP)); UI_init(); } @@ -159,9 +160,7 @@ void WM_init(bContext *C, int argc, char **argv) clear_mat_mtex_copybuf(); // glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - -// init_node_butfuncs(); - + ED_preview_init_dbase(); G.ndofdevice = -1; /* XXX bad initializer, needs set otherwise buttons show! */ From 72cc38e05d5ab11c4b14161df451e6266725b025 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 15 Mar 2010 02:30:53 +0000 Subject: [PATCH 066/153] Make Hex field in colour picker work in gamma corrected space - means that copying Hex values to and from other apps like Photoshop works as expected. --- .../editors/interface/interface_regions.c | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index bc03be84b65..e29a6703bb8 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1568,9 +1568,19 @@ void ui_update_block_buts_rgb(uiBlock *block, float *rgb) } else if(strcmp(bt->str, "Hex: ")==0) { + float rgb_gamma[3]; char col[16]; - sprintf(col, "%02X%02X%02X", (unsigned int)(rgb[0]*255.0), (unsigned int)(rgb[1]*255.0), (unsigned int)(rgb[2]*255.0)); + /* Hex code is assumed to be in sRGB space (coming from other applications, web, etc) */ + + if (block->color_profile == BLI_PR_NONE) { + copy_v3_v3(rgb_gamma, rgb); + } else { + /* make an sRGB version, for Hex code */ + linearrgb_to_srgb_v3_v3(rgb_gamma, rgb); + } + + sprintf(col, "%02X%02X%02X", (unsigned int)(rgb_gamma[0]*255.0), (unsigned int)(rgb_gamma[1]*255.0), (unsigned int)(rgb_gamma[2]*255.0)); strcpy(bt->poin, col); } @@ -1640,6 +1650,12 @@ static void do_hex_rna_cb(bContext *C, void *bt1, void *hexcl) hex_to_rgb(hexcol, rgb, rgb+1, rgb+2); + /* Hex code is assumed to be in sRGB space (coming from other applications, web, etc) */ + if (but->block->color_profile != BLI_PR_NONE) { + /* so we need to linearise it for Blender */ + srgb_to_linearrgb_v3_v3(rgb, rgb); + } + ui_update_block_buts_rgb(but->block, rgb); if(popup) @@ -1662,6 +1678,13 @@ static void picker_new_hide_reveal(uiBlock *block, short colormode) /* tag buttons */ for(bt= block->buttons.first; bt; bt= bt->next) { + if (bt->type == LABEL) { + if( bt->str[1]=='G') { + if(colormode==2) bt->flag &= ~UI_HIDDEN; + else bt->flag |= UI_HIDDEN; + } + } + if(bt->type==NUMSLI || bt->type==TEX) { if( bt->str[1]=='e') { if(colormode==2) bt->flag &= ~UI_HIDDEN; @@ -1735,16 +1758,21 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR static char tip[50]; static float hsv[3]; static char hexcol[128]; + float rgb_gamma[3]; const char *propname = RNA_property_identifier(prop); width= PICKER_TOTAL_W; butwidth = width - UI_UNIT_X - 10; /* existence of profile means storage is in linear colour space, with display correction */ - if (block->color_profile == BLI_PR_NONE) + if (block->color_profile == BLI_PR_NONE) { sprintf(tip, "Value in Display Color Space"); - else + copy_v3_v3(rgb_gamma, rgb); + } else { sprintf(tip, "Value in Linear RGB Color Space"); + /* make an sRGB version, for Hex code */ + linearrgb_to_srgb_v3_v3(rgb_gamma, rgb); + } RNA_property_float_get_array(ptr, prop, rgb); rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); @@ -1799,10 +1827,12 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR uiBlockEndAlign(block); rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); - sprintf(hexcol, "%02X%02X%02X", (unsigned int)(rgb[0]*255.0), (unsigned int)(rgb[1]*255.0), (unsigned int)(rgb[2]*255.0)); + + sprintf(hexcol, "%02X%02X%02X", (unsigned int)(rgb_gamma[0]*255.0), (unsigned int)(rgb_gamma[1]*255.0), (unsigned int)(rgb_gamma[2]*255.0)); bt= uiDefBut(block, TEX, 0, "Hex: ", 0, -60, butwidth, UI_UNIT_Y, hexcol, 0, 8, 0, 0, "Hex triplet for color (#RRGGBB)"); uiButSetFunc(bt, do_hex_rna_cb, bt, hexcol); + uiDefBut(block, LABEL, 0, "(Gamma Corrected)", 0, -80, butwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); picker_new_hide_reveal(block, colormode); } From e38139552243865f77f2da1e78ad3b8f2291926d Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 15 Mar 2010 04:54:31 +0000 Subject: [PATCH 067/153] Fix [#21288] Colour Ramp doesn't update output Moved color ramp RNA to rna_color.c, was very texture-centric before. --- source/blender/editors/include/ED_node.h | 1 + source/blender/editors/space_node/node_draw.c | 35 +++ source/blender/makesrna/intern/rna_color.c | 214 ++++++++++++++++++ source/blender/makesrna/intern/rna_nodetree.c | 32 +-- source/blender/makesrna/intern/rna_texture.c | 150 ------------ 5 files changed, 251 insertions(+), 181 deletions(-) diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h index b7dc9bf73b5..2abac1d502c 100644 --- a/source/blender/editors/include/ED_node.h +++ b/source/blender/editors/include/ED_node.h @@ -40,6 +40,7 @@ void ED_init_node_butfuncs(void); /* node_draw.c */ void ED_node_changed_update(struct ID *id, struct bNode *node); +void ED_node_generic_update(struct Main *bmain, struct Scene *scene, struct bNodeTree *ntree, struct bNode *node); /* node_edit.c */ void ED_node_shader_default(struct Material *ma); diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 5928e5cf20e..3f53b80bd22 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -121,6 +121,41 @@ void ED_node_changed_update(ID *id, bNode *node) } } +static int has_nodetree(bNodeTree *ntree, bNodeTree *lookup) +{ + bNode *node; + + if(ntree == lookup) + return 1; + + for(node=ntree->nodes.first; node; node=node->next) + if(node->type == NODE_GROUP && node->id) + if(has_nodetree((bNodeTree*)node->id, lookup)) + return 1; + + return 0; +} + +void ED_node_generic_update(Main *bmain, Scene *scene, bNodeTree *ntree, bNode *node) +{ + Material *ma; + Tex *tex; + Scene *sce; + + /* look through all datablocks, to support groups */ + for(ma=bmain->mat.first; ma; ma=ma->id.next) + if(ma->nodetree && ma->use_nodes && has_nodetree(ma->nodetree, ntree)) + ED_node_changed_update(&ma->id, node); + + for(tex=bmain->tex.first; tex; tex=tex->id.next) + if(tex->nodetree && tex->use_nodes && has_nodetree(tex->nodetree, ntree)) + ED_node_changed_update(&tex->id, node); + + for(sce=bmain->scene.first; sce; sce=sce->id.next) + if(sce->nodetree && sce->use_nodes && has_nodetree(sce->nodetree, ntree)) + ED_node_changed_update(&sce->id, node); +} + static void do_node_internal_buttons(bContext *C, void *node_v, int event) { if(event==B_NODE_EXEC) { diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index ee19bce6435..dc395e6ccc3 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -32,7 +32,21 @@ #ifdef RNA_RUNTIME +#include "RNA_access.h" + +#include "DNA_material_types.h" +#include "DNA_node_types.h" + +#include "MEM_guardedalloc.h" + #include "BKE_colortools.h" +#include "BKE_depsgraph.h" +#include "BKE_node.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "ED_node.h" static int rna_CurveMapping_curves_length(PointerRNA *ptr) { @@ -113,6 +127,150 @@ static void rna_CurveMapping_clipmaxy_range(PointerRNA *ptr, float *min, float * *max= 100.0f; } + +static char *rna_ColorRamp_path(PointerRNA *ptr) +{ + /* handle the cases where a single datablock may have 2 ramp types */ + if (ptr->id.data) { + ID *id= ptr->id.data; + + switch (GS(id->name)) { + case ID_MA: /* material has 2 cases - diffuse and specular */ + { + Material *ma= (Material*)id; + + if (ptr->data == ma->ramp_col) + return BLI_strdup("diffuse_ramp"); + else if (ptr->data == ma->ramp_spec) + return BLI_strdup("specular_ramp"); + } + break; + } + } + + /* everything else just uses 'color_ramp' */ + return BLI_strdup("color_ramp"); +} + +static char *rna_ColorRampElement_path(PointerRNA *ptr) +{ + PointerRNA ramp_ptr; + PropertyRNA *prop; + char *path = NULL; + int index; + + /* helper macro for use here to try and get the path + * - this calls the standard code for getting a path to a texture... + */ +#define COLRAMP_GETPATH \ +{ \ +prop= RNA_struct_find_property(&ramp_ptr, "elements"); \ +if (prop) { \ +index= RNA_property_collection_lookup_index(&ramp_ptr, prop, ptr); \ +if (index >= 0) { \ +char *texture_path= rna_ColorRamp_path(&ramp_ptr); \ +path= BLI_sprintfN("%s.elements[%d]", texture_path, index); \ +MEM_freeN(texture_path); \ +} \ +} \ +} + + /* determine the path from the ID-block to the ramp */ + // FIXME: this is a very slow way to do it, but it will have to suffice... + if (ptr->id.data) { + ID *id= ptr->id.data; + + switch (GS(id->name)) { + case ID_MA: /* 2 cases for material - diffuse and spec */ + { + Material *ma= (Material *)id; + + /* try diffuse first */ + if (ma->ramp_col) { + RNA_pointer_create(id, &RNA_ColorRamp, ma->ramp_col, &ramp_ptr); + COLRAMP_GETPATH; + } + /* try specular if not diffuse */ + if (!path && ma->ramp_spec) { + RNA_pointer_create(id, &RNA_ColorRamp, ma->ramp_spec, &ramp_ptr); + COLRAMP_GETPATH; + } + } + break; + + // TODO: node trees need special attention + case ID_NT: + { + bNodeTree *ntree = (bNodeTree *)id; + bNode *node; + + for(node=ntree->nodes.first; node; node=node->next) { + if (ELEM3(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) { + RNA_pointer_create(id, &RNA_ColorRamp, node->storage, &ramp_ptr); + COLRAMP_GETPATH; + } + } + } + break; + + default: /* everything else should have a "color_ramp" property */ + { + /* create pointer to the ID block, and try to resolve "color_ramp" pointer */ + RNA_id_pointer_create(id, &ramp_ptr); + if (RNA_path_resolve(&ramp_ptr, "color_ramp", &ramp_ptr, &prop)) { + COLRAMP_GETPATH; + } + } + } + } + + /* cleanup the macro we defined */ +#undef COLRAMP_GETPATH + + return path; +} + +static void rna_ColorRamp_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + if (ptr->id.data) { + ID *id= ptr->id.data; + + switch (GS(id->name)) { + case ID_MA: + { + Material *ma= ptr->id.data; + + DAG_id_flush_update(&ma->id, 0); + WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, ma); + } + break; + case ID_NT: + { + bNodeTree *ntree = (bNodeTree *)id; + bNode *node; + + for(node=ntree->nodes.first; node; node=node->next) { + if (ELEM3(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) { + ED_node_generic_update(bmain, scene, ntree, node); + } + } + } + break; + case ID_TE: + { + Tex *tex= ptr->id.data; + + DAG_id_flush_update(&tex->id, 0); + WM_main_add_notifier(NC_TEXTURE, tex); + } + break; + default: + break; + } + } +} + + #else static void rna_def_curvemappoint(BlenderRNA *brna) @@ -229,6 +387,60 @@ static void rna_def_curvemapping(BlenderRNA *brna) RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_white_level_set", NULL); } +static void rna_def_color_ramp_element(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "ColorRampElement", NULL); + RNA_def_struct_sdna(srna, "CBData"); + RNA_def_struct_path_func(srna, "rna_ColorRampElement_path"); + RNA_def_struct_ui_text(srna, "Color Ramp Element", "Element defining a color at a position in the color ramp"); + + prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "r"); + RNA_def_property_array(prop, 4); + RNA_def_property_ui_text(prop, "Color", ""); + RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); + + prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "pos"); + RNA_def_property_range(prop, 0, 1); + RNA_def_property_ui_text(prop, "Position", ""); + RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); +} + +static void rna_def_color_ramp(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem prop_interpolation_items[] = { + {1, "EASE", 0, "Ease", ""}, + {3, "CARDINAL", 0, "Cardinal", ""}, + {0, "LINEAR", 0, "Linear", ""}, + {2, "B_SPLINE", 0, "B-Spline", ""}, + {4, "CONSTANT", 0, "Constant", ""}, + {0, NULL, 0, NULL, NULL}}; + + srna= RNA_def_struct(brna, "ColorRamp", NULL); + RNA_def_struct_sdna(srna, "ColorBand"); + RNA_def_struct_path_func(srna, "rna_ColorRamp_path"); + RNA_def_struct_ui_text(srna, "Color Ramp", "Color ramp mapping a scalar value to a color"); + + prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_COLOR); + RNA_def_property_collection_sdna(prop, NULL, "data", "tot"); + RNA_def_property_struct_type(prop, "ColorRampElement"); + RNA_def_property_ui_text(prop, "Elements", ""); + RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); + + prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "ipotype"); + RNA_def_property_enum_items(prop, prop_interpolation_items); + RNA_def_property_ui_text(prop, "Interpolation", ""); + RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); +} + static void rna_def_histogram(BlenderRNA *brna) { StructRNA *srna; @@ -243,6 +455,8 @@ void RNA_def_color(BlenderRNA *brna) rna_def_curvemappoint(brna); rna_def_curvemap(brna); rna_def_curvemapping(brna); + rna_def_color_ramp_element(brna); + rna_def_color_ramp(brna); rna_def_histogram(brna); } diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index ba805bd0a4f..5a05e588ece 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -118,21 +118,6 @@ static char *rna_NodeSocket_path(PointerRNA *ptr) return NULL; } -static int has_nodetree(bNodeTree *ntree, bNodeTree *lookup) -{ - bNode *node; - - if(ntree == lookup) - return 1; - - for(node=ntree->nodes.first; node; node=node->next) - if(node->type == NODE_GROUP && node->id) - if(has_nodetree((bNodeTree*)node->id, lookup)) - return 1; - - return 0; -} - /* Button Set Funcs for Matte Nodes */ static void rna_Matte_t1_set(PointerRNA *ptr, float value) { @@ -158,22 +143,7 @@ static void rna_Matte_t2_set(PointerRNA *ptr, float value) static void node_update(Main *bmain, Scene *scene, bNodeTree *ntree, bNode *node) { - Material *ma; - Tex *tex; - Scene *sce; - - /* look through all datablocks, to support groups */ - for(ma=bmain->mat.first; ma; ma=ma->id.next) - if(ma->nodetree && ma->use_nodes && has_nodetree(ma->nodetree, ntree)) - ED_node_changed_update(&ma->id, node); - - for(tex=bmain->tex.first; tex; tex=tex->id.next) - if(tex->nodetree && tex->use_nodes && has_nodetree(tex->nodetree, ntree)) - ED_node_changed_update(&tex->id, node); - - for(sce=bmain->scene.first; sce; sce=sce->id.next) - if(sce->nodetree && sce->use_nodes && has_nodetree(sce->nodetree, ntree)) - ED_node_changed_update(&sce->id, node); + ED_node_generic_update(bmain, scene, ntree, node); } static void rna_Node_update(Main *bmain, Scene *scene, PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 86018c996de..bdd1b710db5 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -363,156 +363,8 @@ static void rna_PointDensity_psys_set(PointerRNA *ptr, PointerRNA value) pd->psys= BLI_findindex(&ob->particlesystem, value.data) + 1; } -static char *rna_ColorRamp_path(PointerRNA *ptr) -{ - /* handle the cases where a single datablock may have 2 ramp types */ - if (ptr->id.data) { - ID *id= ptr->id.data; - - switch (GS(id->name)) { - case ID_MA: /* material has 2 cases - diffuse and specular */ - { - Material *ma= (Material*)id; - - if (ptr->data == ma->ramp_col) - return BLI_strdup("diffuse_ramp"); - else if (ptr->data == ma->ramp_spec) - return BLI_strdup("specular_ramp"); - } - break; - } - } - - /* everything else just uses 'color_ramp' */ - return BLI_strdup("color_ramp"); -} - -static char *rna_ColorRampElement_path(PointerRNA *ptr) -{ - PointerRNA ramp_ptr; - PropertyRNA *prop; - char *path = NULL; - int index; - - /* helper macro for use here to try and get the path - * - this calls the standard code for getting a path to a texture... - */ -#define COLRAMP_GETPATH \ - { \ - prop= RNA_struct_find_property(&ramp_ptr, "elements"); \ - if (prop) { \ - index= RNA_property_collection_lookup_index(&ramp_ptr, prop, ptr); \ - if (index >= 0) { \ - char *texture_path= rna_ColorRamp_path(&ramp_ptr); \ - path= BLI_sprintfN("%s.elements[%d]", texture_path, index); \ - MEM_freeN(texture_path); \ - } \ - } \ - } - - /* determine the path from the ID-block to the ramp */ - // FIXME: this is a very slow way to do it, but it will have to suffice... - if (ptr->id.data) { - ID *id= ptr->id.data; - - switch (GS(id->name)) { - case ID_MA: /* 2 cases for material - diffuse and spec */ - { - Material *ma= (Material *)id; - - /* try diffuse first */ - if (ma->ramp_col) { - RNA_pointer_create(id, &RNA_ColorRamp, ma->ramp_col, &ramp_ptr); - COLRAMP_GETPATH; - } - /* try specular if not diffuse */ - if (!path && ma->ramp_spec) { - RNA_pointer_create(id, &RNA_ColorRamp, ma->ramp_spec, &ramp_ptr); - COLRAMP_GETPATH; - } - } - break; - - // TODO: node trees need special attention - case ID_NT: - { - // FIXME: we'll probably have to loop over nodes until we find one that uses the color ramp - } - break; - - default: /* everything else should have a "color_ramp" property */ - { - /* create pointer to the ID block, and try to resolve "color_ramp" pointer */ - RNA_id_pointer_create(id, &ramp_ptr); - if (RNA_path_resolve(&ramp_ptr, "color_ramp", &ramp_ptr, &prop)) { - COLRAMP_GETPATH; - } - } - } - } - - /* cleanup the macro we defined */ -#undef COLRAMP_GETPATH - - return path; -} - #else -static void rna_def_color_ramp_element(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna= RNA_def_struct(brna, "ColorRampElement", NULL); - RNA_def_struct_sdna(srna, "CBData"); - RNA_def_struct_path_func(srna, "rna_ColorRampElement_path"); - RNA_def_struct_ui_text(srna, "Color Ramp Element", "Element defining a color at a position in the color ramp"); - - prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); - RNA_def_property_float_sdna(prop, NULL, "r"); - RNA_def_property_array(prop, 4); - RNA_def_property_ui_text(prop, "Color", ""); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_COLOR); - RNA_def_property_float_sdna(prop, NULL, "pos"); - RNA_def_property_range(prop, 0, 1); - RNA_def_property_ui_text(prop, "Position", ""); - RNA_def_property_update(prop, 0, "rna_Texture_update"); -} - -static void rna_def_color_ramp(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static EnumPropertyItem prop_interpolation_items[] = { - {1, "EASE", 0, "Ease", ""}, - {3, "CARDINAL", 0, "Cardinal", ""}, - {0, "LINEAR", 0, "Linear", ""}, - {2, "B_SPLINE", 0, "B-Spline", ""}, - {4, "CONSTANT", 0, "Constant", ""}, - {0, NULL, 0, NULL, NULL}}; - - srna= RNA_def_struct(brna, "ColorRamp", NULL); - RNA_def_struct_sdna(srna, "ColorBand"); - RNA_def_struct_path_func(srna, "rna_ColorRamp_path"); - RNA_def_struct_ui_text(srna, "Color Ramp", "Color ramp mapping a scalar value to a color"); - - prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_COLOR); - RNA_def_property_collection_sdna(prop, NULL, "data", "tot"); - RNA_def_property_struct_type(prop, "ColorRampElement"); - RNA_def_property_ui_text(prop, "Elements", ""); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "ipotype"); - RNA_def_property_enum_items(prop, prop_interpolation_items); - RNA_def_property_ui_text(prop, "Interpolation", ""); - RNA_def_property_update(prop, 0, "rna_Texture_update"); -} - static void rna_def_texmapping(BlenderRNA *brna) { StructRNA *srna; @@ -1912,8 +1764,6 @@ void RNA_def_texture(BlenderRNA *brna) rna_def_texture(brna); rna_def_mtex(brna); rna_def_environment_map(brna); - rna_def_color_ramp(brna); - rna_def_color_ramp_element(brna); rna_def_texmapping(brna); } From 1ded5b37b74897d33e68c21278ebeac1a1710e16 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 15 Mar 2010 10:25:07 +0000 Subject: [PATCH 068/153] Patch #21569 to fix bug #21530: on X11, middle mouse button drag cancelled when moving wheel (with horizontal scrolling), was sending middle mouse event in cases where it should not. Patch by Anthony Edlin, thanks! --- intern/ghost/intern/GHOST_SystemX11.cpp | 55 ++++++++++++++----------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index cbf775045fd..1b7589fc432 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -536,38 +536,43 @@ GHOST_SystemX11::processEvent(XEvent *xe) } case ButtonPress: - { - /* process wheel mouse events and break */ - if (xe->xbutton.button == 4) { - g_event = new GHOST_EventWheel(getMilliSeconds(), window, 1); - break; - } - if (xe->xbutton.button == 5) { - g_event = new GHOST_EventWheel(getMilliSeconds(), window, -1); - break; - } - } case ButtonRelease: { - XButtonEvent & xbe = xe->xbutton; GHOST_TButtonMask gbmask = GHOST_kButtonMaskLeft; - switch (xbe.button) { - case Button1 : gbmask = GHOST_kButtonMaskLeft; break; - case Button3 : gbmask = GHOST_kButtonMaskRight; break; - /* It seems events 6 and 7 are for horizontal scrolling. - * you can re-order button mapping like this... (swaps 6,7 with 8,9) - * xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7" - */ - case 8 : gbmask = GHOST_kButtonMaskButton4; break; /* Button4 is the wheel */ - case 9 : gbmask = GHOST_kButtonMaskButton5; break; /* Button5 is a wheel too */ - default: - case Button2 : gbmask = GHOST_kButtonMaskMiddle; break; - } - GHOST_TEventType type = (xbe.type == ButtonPress) ? GHOST_kEventButtonDown : GHOST_kEventButtonUp; + + /* process wheel mouse events and break, only pass on press events */ + if(xbe.button == Button4) { + if(xbe.type == ButtonPress) + g_event = new GHOST_EventWheel(getMilliSeconds(), window, 1); + break; + } + else if(xbe.button == Button5) { + if(xbe.type == ButtonPress) + g_event = new GHOST_EventWheel(getMilliSeconds(), window, -1); + break; + } + /* process rest of normal mouse buttons */ + if(xbe.button == Button1) + gbmask = GHOST_kButtonMaskLeft; + else if(xbe.button == Button2) + gbmask = GHOST_kButtonMaskMiddle; + else if(xbe.button == Button3) + gbmask = GHOST_kButtonMaskRight; + /* It seems events 6 and 7 are for horizontal scrolling. + * you can re-order button mapping like this... (swaps 6,7 with 8,9) + * xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7" + */ + else if(xbe.button == 8) + gbmask = GHOST_kButtonMaskButton4; + else if(xbe.button == 9) + gbmask = GHOST_kButtonMaskButton5; + else + break; + g_event = new GHOST_EventButton( getMilliSeconds(), From 3f8628ac74d427e4f03d0466330a27fd805d7573 Mon Sep 17 00:00:00 2001 From: Tom Musgrove Date: Mon, 15 Mar 2010 15:36:16 +0000 Subject: [PATCH 069/153] fixing bad level call --- source/blenderplayer/bad_level_call_stubs/stubs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index dfdfec217aa..0e2b91e647f 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -189,6 +189,7 @@ void WM_event_add_fileselect(struct bContext *C, struct wmOperator *op){} void WM_cursor_wait (int val) {} void ED_node_texture_default(struct Tex *tx){} void ED_node_changed_update(struct bContext *C, struct bNode *node){} +void ED_node_generic_update(struct Main *bmain, struct Scene *scene, struct bNodeTree *ntree, struct bNode *node){} void ED_view3d_scene_layers_update(struct Main *bmain, struct Scene *scene){} int ED_view3d_scene_layer_set(int lay, const int *values){return 0;} void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar){} From e7fad67fab0b3145f4f83e0f93ac8e31e54ed65a Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Mon, 15 Mar 2010 18:52:22 +0000 Subject: [PATCH 070/153] Compile fix for MSVC - missing #define for finite and isnan --- source/blender/python/intern/bpy_driver.c | 1 + source/blender/python/intern/bpy_interface.c | 1 + 2 files changed, 2 insertions(+) diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index 58932192b3c..39b2bbf8536 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -27,6 +27,7 @@ #include "DNA_anim_types.h" #include "BLI_listbase.h" +#include "BLI_math_base.h" #include "BKE_fcurve.h" #include "BKE_global.h" diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 342a8c44d09..93f387408e8 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -40,6 +40,7 @@ #include "MEM_guardedalloc.h" #include "BLI_path_util.h" +#include "BLI_math_base.h" #include "BKE_context.h" #include "BKE_text.h" From ae6ee27d37f94a5c26cdf6060d71c5b6bc209a0e Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 15 Mar 2010 20:22:05 +0000 Subject: [PATCH 071/153] Fix #21619 and #21613: edge loop delete crashes, after recent transform manipulator ctrl+click increment fix. --- source/blender/editors/transform/transform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 01aa41b0499..9cd3ee3ba99 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1503,6 +1503,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int } /* Stupid code to have Ctrl-Click on manipulator work ok */ + if(event) { wmKeyMap *keymap = WM_keymap_active(CTX_wm_manager(C), op->type->modalkeymap); wmKeyMapItem *kmi; From 8fdb4d45063f01be975cf3c6351607115a0b8d4e Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Mon, 15 Mar 2010 20:28:13 +0000 Subject: [PATCH 072/153] Fix [#21618] Wrong Icon For BLEND file on File/Append While the folder icon was originally planned when in append/link mode, it's easier to distinguish with a blender icon, so the folder icon is now replaced. Also fixed issue introduced in rev. 27491 where filter settings were incorrectly set when moving out of .blend file again. --- source/blender/editors/space_file/file_draw.c | 3 +++ source/blender/editors/space_file/filelist.c | 20 +++++++++++-------- source/blender/editors/space_file/filesel.c | 5 ++++- .../blender/editors/space_file/space_file.c | 4 ++-- source/blender/makesdna/DNA_space_types.h | 6 ++++-- source/blender/makesrna/intern/rna_space.c | 12 +++++++++-- 6 files changed, 35 insertions(+), 15 deletions(-) diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index a2b4dcbac60..63729f03e58 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -298,6 +298,9 @@ static int get_file_icon(struct direntry *file) if ( strcmp(file->relname, "..") == 0) { return ICON_FILE_PARENT; } + if(file->flags & BLENDERFILE) { + return ICON_FILE_BLEND; + } return ICON_FILE_FOLDER; } else if (file->flags & BLENDERFILE) diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index b90bb47e6ce..c11260d7179 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -627,13 +627,13 @@ struct ImBuf * filelist_geticon(struct FileList* filelist, int index) fidx = filelist->fidx[index]; file = &filelist->filelist[fidx]; if (file->type & S_IFDIR) { - if ( strcmp(filelist->filelist[fidx].relname, "..") == 0) { - ibuf = gSpecialFileImages[SPECIAL_IMG_PARENT]; - } else if ( strcmp(filelist->filelist[fidx].relname, ".") == 0) { - ibuf = gSpecialFileImages[SPECIAL_IMG_REFRESH]; - } else { - ibuf = gSpecialFileImages[SPECIAL_IMG_FOLDER]; - } + if ( strcmp(filelist->filelist[fidx].relname, "..") == 0) { + ibuf = gSpecialFileImages[SPECIAL_IMG_PARENT]; + } else if ( strcmp(filelist->filelist[fidx].relname, ".") == 0) { + ibuf = gSpecialFileImages[SPECIAL_IMG_REFRESH]; + } else { + ibuf = gSpecialFileImages[SPECIAL_IMG_FOLDER]; + } } else { ibuf = gSpecialFileImages[SPECIAL_IMG_UNKNOWNFILE]; } @@ -788,8 +788,12 @@ void filelist_setfiletypes(struct FileList* filelist, short has_quicktime) file->type= file->s.st_mode; /* restore the mess below */ /* Don't check extensions for directories */ - if (file->type & S_IFDIR) + if (file->type & S_IFDIR) { + if(BLO_has_bfile_extension(file->relname)) { + file->flags |= BLENDERFILE; + } continue; + } if(BLO_has_bfile_extension(file->relname)) { file->flags |= BLENDERFILE; diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 758740e676a..6945e8c959a 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -194,7 +194,7 @@ short ED_fileselect_set_params(SpaceFile *sfile) params->filter = 0; params->sort = FILE_SORT_ALPHA; } - + params->oldflag = params->flag; return 1; } @@ -414,6 +414,9 @@ void file_change_dir(bContext *C, int checkdir) char dir[FILE_MAX]; if (filelist_islibrary(sfile->files, dir, group)) { sfile->params->flag &= ~FILE_FILTER; + } else { + /* reset the old flag */ + sfile->params->flag = sfile->params->oldflag; } } if(folderlist_clear_next(sfile)) diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 105ece8e95f..141d4f63f1c 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -140,8 +140,6 @@ static void file_free(SpaceLink *sl) } if (sfile->params) { - if(sfile->params->pupmenu) - MEM_freeN(sfile->params->pupmenu); MEM_freeN(sfile->params); sfile->params= NULL; } @@ -208,6 +206,8 @@ static void file_refresh(const bContext *C, ScrArea *sa) filelist_readdir(sfile->files); thumbnails_start(sfile->files, C); BLI_strncpy(params->dir, filelist_dir(sfile->files), FILE_MAX); + } else { + filelist_filter(sfile->files); } if(params->sort!=FILE_SORT_NONE) filelist_sort(sfile->files, params->sort); diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 293eac3c5a5..8e460b80585 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -162,21 +162,23 @@ typedef struct FileSelectParams { short type; /* XXXXX for now store type here, should be moved to the operator */ short flag; /* settings for filter, hiding dots files,... */ + short oldflag; /* temp storage of original flag settings */ short sort; /* sort order */ short display; /* display mode flag */ short filter; /* filter when (flags & FILE_FILTER) is true */ /* XXX - temporary, better move to filelist */ short active_bookmark; + short pad; int active_file; int selstate; /* short */ /* XXX --- still unused -- */ short f_fp; /* show font preview */ - short menu; /* currently selected option in pupmenu */ + short pad2; char fp_str[8]; /* string to use for font preview */ - char *pupmenu; /* allows menu for save options - result stored in menup */ + /* XXX --- end unused -- */ } FileSelectParams; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 9b7e6b5bc05..ddbeb8a85fe 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -567,6 +567,14 @@ static void rna_Sequencer_display_mode_update(bContext *C, PointerRNA *ptr) ED_sequencer_update_view(C, view); } +static void rna_FileSelectParams_flag_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + FileSelectParams* params = (FileSelectParams*)ptr->data; + if (params) { + params->oldflag = params->flag; + } +} + #else static void rna_def_space(BlenderRNA *brna) @@ -1838,12 +1846,12 @@ static void rna_def_fileselect_params(BlenderRNA *brna) prop= RNA_def_property(srna, "do_filter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER); RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, "rna_FileSelectParams_flag_update"); prop= RNA_def_property(srna, "hide_dot", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_HIDE_DOT); RNA_def_property_ui_text(prop, "Hide Dot Files", "Hide hidden dot files"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST , NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST , "rna_FileSelectParams_flag_update"); prop= RNA_def_property(srna, "sort", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "sort"); From c12cfa37753e440aa585c2044dc433a46e494e59 Mon Sep 17 00:00:00 2001 From: Damien Plisson Date: Mon, 15 Mar 2010 20:38:04 +0000 Subject: [PATCH 073/153] Fix [#20419] OSX Cocoa physical punctuation keys retrieval fix Cocoa charactersIgnoringModifiers API still takes the Shift key into account. Fix is to use Apple new 10.5 Carbon(!) API that is 64bit compatible to take into account the international keyboard layout when retrieving the physical key pressed/released. Needed to use an even older API for 10.4 builds. --- intern/ghost/intern/GHOST_SystemCocoa.mm | 95 ++++++++++++++++++------ 1 file changed, 71 insertions(+), 24 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 5289920cccb..bcbc59a34a9 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -29,6 +29,9 @@ #import +/*For the currently not ported to Cocoa keyboard layout functions (64bit & 10.6 compatible)*/ +#include + #include #include #include @@ -53,9 +56,8 @@ #include "AssertMacros.h" #pragma mark KeyMap, mouse converters - - -/* Keycodes from Carbon include file */ +#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 +/* Keycodes not defined in Tiger */ /* * Summary: * Virtual keycodes @@ -203,7 +205,7 @@ enum { kVK_JIS_Eisu = 0x66, kVK_JIS_Kana = 0x68 }; - +#endif static GHOST_TButtonMask convertButton(int button) { @@ -230,7 +232,7 @@ static GHOST_TButtonMask convertButton(int button) * @param recvChar the character ignoring modifiers (except for shift) * @return Ghost key code */ -static GHOST_TKey convertKey(int rawCode, unichar recvChar) +static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction) { //printf("\nrecvchar %c 0x%x",recvChar,recvChar); @@ -350,26 +352,68 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar) return GHOST_kKeyUnknown; default: - /*Then detect on character value for "remappable" keys in int'l keyboards*/ + /* alphanumerical or punctuation key that is remappable in int'l keyboards */ if ((recvChar >= 'A') && (recvChar <= 'Z')) { return (GHOST_TKey) (recvChar - 'A' + GHOST_kKeyA); } else if ((recvChar >= 'a') && (recvChar <= 'z')) { return (GHOST_TKey) (recvChar - 'a' + GHOST_kKeyA); - } else - switch (recvChar) { - case '-': return GHOST_kKeyMinus; - case '=': return GHOST_kKeyEqual; - case ',': return GHOST_kKeyComma; - case '.': return GHOST_kKeyPeriod; - case '/': return GHOST_kKeySlash; - case ';': return GHOST_kKeySemicolon; - case '\'': return GHOST_kKeyQuote; - case '\\': return GHOST_kKeyBackslash; - case '[': return GHOST_kKeyLeftBracket; - case ']': return GHOST_kKeyRightBracket; - case '`': return GHOST_kKeyAccentGrave; - default: - return GHOST_kKeyUnknown; + } else { +#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 + KeyboardLayoutRef keyLayout; + UCKeyboardLayout *uchrData; + + KLGetCurrentKeyboardLayout(&keyLayout); + KLGetKeyboardLayoutProperty(keyLayout, kKLuchrData, (const void **) + &uchrData); + /*get actual character value of the "remappable" keys in int'l keyboards, + if keyboard layout is not correctly reported (e.g. some non Apple keyboards in Tiger), + then fallback on using the received charactersIgnoringModifiers */ + if (uchrData) + { + UInt32 deadKeyState=0; + UniCharCount actualStrLength=0; + + UCKeyTranslate(uchrData, rawCode, keyAction, 0, + LMGetKbdType(), kUCKeyTranslateNoDeadKeysBit, &deadKeyState, 1, &actualStrLength, &recvChar); + + } +#else + /* Leopard and Snow Leopard 64bit compatible API*/ + CFDataRef uchrHandle; /*the keyboard layout*/ + TISInputSourceRef kbdTISHandle; + + kbdTISHandle = TISCopyCurrentKeyboardLayoutInputSource(); + uchrHandle = (CFDataRef)TISGetInputSourceProperty(kbdTISHandle,kTISPropertyUnicodeKeyLayoutData); + CFRelease(kbdTISHandle); + + /*get actual character value of the "remappable" keys in int'l keyboards, + if keyboard layout is not correctly reported (e.g. some non Apple keyboards in Tiger), + then fallback on using the received charactersIgnoringModifiers */ + if (uchrHandle) + { + UInt32 deadKeyState=0; + UniCharCount actualStrLength=0; + + UCKeyTranslate((UCKeyboardLayout*)CFDataGetBytePtr(uchrHandle), rawCode, keyAction, 0, + LMGetKbdType(), kUCKeyTranslateNoDeadKeysBit, &deadKeyState, 1, &actualStrLength, &recvChar); + + } +#endif + switch (recvChar) { + case '-': return GHOST_kKeyMinus; + case '=': return GHOST_kKeyEqual; + case ',': return GHOST_kKeyComma; + case '.': return GHOST_kKeyPeriod; + case '/': return GHOST_kKeySlash; + case ';': return GHOST_kKeySemicolon; + case '\'': return GHOST_kKeyQuote; + case '\\': return GHOST_kKeyBackslash; + case '[': return GHOST_kKeyLeftBracket; + case ']': return GHOST_kKeyRightBracket; + case '`': return GHOST_kKeyAccentGrave; + default: + return GHOST_kKeyUnknown; + } } } return GHOST_kKeyUnknown; @@ -1573,9 +1617,11 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr) charsIgnoringModifiers = [event charactersIgnoringModifiers]; if ([charsIgnoringModifiers length]>0) keyCode = convertKey([event keyCode], - [charsIgnoringModifiers characterAtIndex:0]); + [charsIgnoringModifiers characterAtIndex:0], + [event type] == NSKeyDown?kUCKeyActionDown:kUCKeyActionUp); else - keyCode = convertKey([event keyCode],0); + keyCode = convertKey([event keyCode],0, + [event type] == NSKeyDown?kUCKeyActionDown:kUCKeyActionUp); characters = [event characters]; @@ -1595,9 +1641,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr) if ([event type] == NSKeyDown) { pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyDown, window, keyCode, ascii) ); - //printf("\nKey pressed keyCode=%u ascii=%i %c",keyCode,ascii,ascii); + //printf("\nKey down rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii); } else { pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyUp, window, keyCode, ascii) ); + //printf("\nKey up rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii); } break; From ebd63787e6ad1889319442558e8f7329ca7a768d Mon Sep 17 00:00:00 2001 From: Robert Holcomb Date: Mon, 15 Mar 2010 22:36:39 +0000 Subject: [PATCH 074/153] added different sampling methods in rotate node fixed bug in difference matte node that prevented using a solid color for second input -also clairified some variable names to be more meaningful --- source/blender/editors/space_node/drawnode.c | 8 ++ source/blender/makesrna/intern/rna_nodetree.c | 17 +++ .../makesrna/intern/rna_nodetree_types.h | 2 +- .../nodes/intern/CMP_nodes/CMP_diffMatte.c | 37 ++++--- .../nodes/intern/CMP_nodes/CMP_rotate.c | 103 ++++++++---------- 5 files changed, 90 insertions(+), 77 deletions(-) diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 9f7b01b1cd0..88cb9f6e81a 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -921,6 +921,11 @@ static void node_composit_buts_scale(uiLayout *layout, bContext *C, PointerRNA * uiItemR(layout, "", 0, ptr, "space", 0); } +static void node_composit_buts_rotate(uiLayout *layout, bContext *C, PointerRNA *ptr) +{ + uiItemR(layout, "", 0, ptr, "filter", 0); +} + static void node_composit_buts_invert(uiLayout *layout, bContext *C, PointerRNA *ptr) { uiLayout *col; @@ -1098,6 +1103,9 @@ static void node_composit_set_butfunc(bNodeType *ntype) case CMP_NODE_SCALE: ntype->uifunc= node_composit_buts_scale; break; + case CMP_NODE_ROTATE: + ntype->uifunc=node_composit_buts_rotate; + break; case CMP_NODE_CHANNEL_MATTE: ntype->uifunc= node_composit_buts_channel_matte; break; diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 5a05e588ece..81579293402 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -1187,6 +1187,23 @@ static void def_cmp_scale(StructRNA *srna) RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); } +static void def_cmp_rotate(StructRNA *srna) +{ + PropertyRNA *prop; + + static EnumPropertyItem rotate_items[] = { + {0, "NEAREST", 0, "Nearest", ""}, + {1, "BILINEAR", 0, "Bilinear", ""}, + {2, "BICUBIC", 0, "Bicubic", ""}, + {0, NULL, 0, NULL, NULL}}; + + prop = RNA_def_property(srna, "filter", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom1"); + RNA_def_property_enum_items(prop, rotate_items); + RNA_def_property_ui_text(prop, "Filter", "Method to use to filter rotation"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); +} + static void def_cmp_diff_matte(StructRNA *srna) { PropertyRNA *prop; diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h index b31751a8ce7..f824f6f20ce 100644 --- a/source/blender/makesrna/intern/rna_nodetree_types.h +++ b/source/blender/makesrna/intern/rna_nodetree_types.h @@ -74,7 +74,7 @@ DefNode( CompositorNode, CMP_NODE_TRANSLATE, 0, "TRANS DefNode( CompositorNode, CMP_NODE_ZCOMBINE, 0, "ZCOMBINE", Zcombine, "Z Combine", "" ) DefNode( CompositorNode, CMP_NODE_COMBRGBA, 0, "COMBRGBA", CombRGBA, "Combine RGBA", "" ) DefNode( CompositorNode, CMP_NODE_DILATEERODE, def_cmp_dilate_erode, "DILATEERODE", DilateErode, "Dilate/Erode", "" ) -DefNode( CompositorNode, CMP_NODE_ROTATE, 0, "ROTATE", Rotate, "Rotate", "" ) +DefNode( CompositorNode, CMP_NODE_ROTATE, def_cmp_rotate, "ROTATE", Rotate, "Rotate", "" ) DefNode( CompositorNode, CMP_NODE_SCALE, def_cmp_scale, "SCALE", Scale, "Scale", "" ) DefNode( CompositorNode, CMP_NODE_SEPYCCA, 0, "SEPYCCA", SepYCCA, "Separate YCCA", "" ) DefNode( CompositorNode, CMP_NODE_COMBYCCA, 0, "COMBYCCA", CombYCCA, "Combine YCCA", "" ) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c index f1b39587e2a..aa282a78af1 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c @@ -42,9 +42,7 @@ static bNodeSocketType cmp_node_diff_matte_out[]={ {-1,0,""} }; -/* note, keyvals is passed on from caller as stack array */ -/* might have been nicer as temp struct though... */ -static void do_diff_matte(bNode *node, float *colorbuf, float *imbuf1, float *imbuf2) +static void do_diff_matte(bNode *node, float *outColor, float *inColor1, float *inColor2) { NodeChroma *c= (NodeChroma *)node->storage; float tolerence=c->t1; @@ -52,52 +50,57 @@ static void do_diff_matte(bNode *node, float *colorbuf, float *imbuf1, float *im float difference; float alpha; - difference=fabs(imbuf2[0]-imbuf1[0])+ - fabs(imbuf2[1]-imbuf1[1])+ - fabs(imbuf2[2]-imbuf1[2]); + difference=fabs(inColor2[0]-inColor1[0])+ + fabs(inColor2[1]-inColor1[1])+ + fabs(inColor2[2]-inColor1[2]); /*average together the distances*/ difference=difference/3.0; - VECCOPY(colorbuf, imbuf1); + VECCOPY(outColor, inColor1); /*make 100% transparent*/ if(difference < tolerence){ - colorbuf[3]=0.0; + outColor[3]=0.0; } /*in the falloff region, make partially transparent */ else if(difference < falloff+tolerence){ difference=difference-tolerence; alpha=difference/falloff; /*only change if more transparent than before */ - if(alpha < imbuf1[3]) { - colorbuf[3]=alpha; + if(alpha < inColor1[3]) { + outColor[3]=alpha; } else { /* leave as before */ - colorbuf[3]=imbuf1[3]; + outColor[3]=inColor1[3]; } } else { /*foreground object*/ - colorbuf[3]= imbuf1[3]; + outColor[3]= inColor1[3]; } } static void node_composit_exec_diff_matte(void *data, bNode *node, bNodeStack **in, bNodeStack **out) { - CompBuf *outbuf; - CompBuf *imbuf1; - CompBuf *imbuf2; + CompBuf *outbuf=0; + CompBuf *imbuf1=0; + CompBuf *imbuf2=0; NodeChroma *c; /*is anything connected?*/ if(out[0]->hasoutput==0 && out[1]->hasoutput==0) return; + /*must have an image imput*/ if(in[0]->data==NULL) return; - if(in[1]->data==NULL) return; + imbuf1=typecheck_compbuf(in[0]->data, CB_RGBA); - imbuf2=typecheck_compbuf(in[1]->data, CB_RGBA); + + /* if there's an image, use that, if not use the color */ + if(in[1]->data) { + imbuf2=typecheck_compbuf(in[1]->data, CB_RGBA); + } c=node->storage; outbuf=dupalloc_compbuf(imbuf1); diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c b/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c index 0a2fe906eb6..4da0b20c6f8 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c @@ -41,46 +41,6 @@ static bNodeSocketType cmp_node_rotate_out[]= { { -1, 0, "" } }; -/* function assumes out to be zero'ed, only does RGBA */ -static void bilinear_interpolation_rotate(CompBuf *in, float *out, float u, float v) -{ - float *row1, *row2, *row3, *row4, a, b; - float a_b, ma_b, a_mb, ma_mb; - float empty[4]= {0.0f, 0.0f, 0.0f, 0.0f}; - int y1, y2, x1, x2; - - x1= (int)floor(u); - x2= (int)ceil(u); - y1= (int)floor(v); - y2= (int)ceil(v); - - /* sample area entirely outside image? */ - if(x2<0 || x1>in->x-1 || y2<0 || y1>in->y-1) - return; - - /* sample including outside of edges of image */ - if(x1<0 || y1<0) row1= empty; - else row1= in->rect + in->x * y1 * in->type + in->type*x1; - - if(x1<0 || y2>in->y-1) row2= empty; - else row2= in->rect + in->x * y2 * in->type + in->type*x1; - - if(x2>in->x-1 || y1<0) row3= empty; - else row3= in->rect + in->x * y1 * in->type + in->type*x2; - - if(x2>in->x-1 || y2>in->y-1) row4= empty; - else row4= in->rect + in->x * y2 * in->type + in->type*x2; - - a= u-floor(u); - b= v-floor(v); - a_b= a*b; ma_b= (1.0f-a)*b; a_mb= a*(1.0f-b); ma_mb= (1.0f-a)*(1.0f-b); - - out[0]= ma_mb*row1[0] + a_mb*row3[0] + ma_b*row2[0]+ a_b*row4[0]; - out[1]= ma_mb*row1[1] + a_mb*row3[1] + ma_b*row2[1]+ a_b*row4[1]; - out[2]= ma_mb*row1[2] + a_mb*row3[2] + ma_b*row2[2]+ a_b*row4[2]; - out[3]= ma_mb*row1[3] + a_mb*row3[3] + ma_b*row2[3]+ a_b*row4[3]; -} - /* only supports RGBA nodes now */ static void node_composit_exec_rotate(void *data, bNode *node, bNodeStack **in, bNodeStack **out) { @@ -91,8 +51,9 @@ static void node_composit_exec_rotate(void *data, bNode *node, bNodeStack **in, if(in[0]->data) { CompBuf *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA); CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* note, this returns zero'd image */ - float *ofp, rad, u, v, s, c, centx, centy, miny, maxy, minx, maxx; - int x, y, yo; + float rad, u, v, s, c, centx, centy, miny, maxy, minx, maxx; + int x, y, yo, xo; + ImBuf *ibuf, *obuf; rad= (M_PI*in[1]->vec[0])/180.0f; @@ -106,32 +67,56 @@ static void node_composit_exec_rotate(void *data, bNode *node, bNodeStack **in, miny= -centy; maxy= -centy + (float)cbuf->y; - for(y=miny; yrect + 4*yo*stackbuf->x; - - for(x=minx; xx, cbuf->y, 32, 0, 0); + obuf=IMB_allocImBuf(stackbuf->x, stackbuf->y, 32, 0, 0); + + if(ibuf){ + ibuf->rect_float=cbuf->rect; + obuf->rect_float=stackbuf->rect; + + for(y=miny; ycustom1) { + case 0: + neareast_interpolation(ibuf, obuf, u, v, xo, yo); + break ; + case 1: + bilinear_interpolation(ibuf, obuf, u, v, xo, yo); + break; + case 2: + bicubic_interpolation(ibuf, obuf, u, v, xo, yo); + } + + } } + + /* rotate offset vector too, but why negative rad, ehh?? Has to be replaced with [3][3] matrix once (ton) */ + s= sin(-rad); + c= cos(-rad); + centx= (float)cbuf->xof; centy= (float)cbuf->yof; + stackbuf->xof= (int)( c*centx + s*centy); + stackbuf->yof= (int)(-s*centx + c*centy); } - /* rotate offset vector too, but why negative rad, ehh?? Has to be replaced with [3][3] matrix once (ton) */ - s= sin(-rad); - c= cos(-rad); - centx= (float)cbuf->xof; centy= (float)cbuf->yof; - stackbuf->xof= (int)( c*centx + s*centy); - stackbuf->yof= (int)(-s*centx + c*centy); /* pass on output and free */ out[0]->data= stackbuf; if(cbuf!=in[0]->data) free_compbuf(cbuf); - } } +static void node_composit_init_rotate(bNode *node) +{ + node->custom1= 1; /* Bilinear Filter*/ +} + bNodeType cmp_node_rotate= { /* *next,*prev */ NULL, NULL, /* type code */ CMP_NODE_ROTATE, @@ -143,7 +128,7 @@ bNodeType cmp_node_rotate= { /* storage */ "", /* execfunc */ node_composit_exec_rotate, /* butfunc */ NULL, - /* initfunc */ NULL, + /* initfunc */ node_composit_init_rotate, /* freestoragefunc */ NULL, /* copystoragefunc */ NULL, /* id */ NULL From 604a2b1a1879c1e0ad1f637f5edc1ab12f61c31d Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 16 Mar 2010 05:04:56 +0000 Subject: [PATCH 075/153] Play Back Rendered Animation operator was left out of Screen->Render operator name change --- release/scripts/op/screen_play_rendered_anim.py | 2 +- source/blender/editors/screen/screen_ops.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/release/scripts/op/screen_play_rendered_anim.py b/release/scripts/op/screen_play_rendered_anim.py index 3fdb0b8e084..e809251de7c 100644 --- a/release/scripts/op/screen_play_rendered_anim.py +++ b/release/scripts/op/screen_play_rendered_anim.py @@ -66,7 +66,7 @@ def guess_player_path(preset): class PlayRenderedAnim(bpy.types.Operator): '''Plays back rendered frames/movies using an external player.''' - bl_idname = "screen.play_rendered_anim" + bl_idname = "render.play_rendered_anim" bl_label = "Play Rendered Animation" bl_options = {'REGISTER'} diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 1c4631837df..ff6e63f911b 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3021,7 +3021,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf) RNA_boolean_set(WM_keymap_add_item(keymap, "RENDER_OT_render", F12KEY, KM_PRESS, KM_CTRL, 0)->ptr, "animation", 1); WM_keymap_add_item(keymap, "RENDER_OT_view_cancel", ESCKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "RENDER_OT_view_show", F11KEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "SCREEN_OT_play_rendered_anim", F11KEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "RENDER_OT_play_rendered_anim", F11KEY, KM_PRESS, KM_CTRL, 0); /* user prefs */ #ifdef __APPLE__ From ea4a987fd424de77465f1a2cd95a655ccf42fd31 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 16 Mar 2010 06:18:49 +0000 Subject: [PATCH 076/153] == Massive Keying Sets Recode == After a few days of wrong turns and learning the finer points of RNA-type-subclassing the hard way, this commit finally presents a refactored version of the Keying Sets system (now version 2) based on some requirements from Cessen. For a more thorough discussion of this commit, see http://sites.google.com/site/aligorith/keyingsets_2.pdf?attredirects=0&d=1 ------ The main highlight of this refactor is that relative Keying Sets have now been recoded so that Python callbacks are run to generate the Keying Set's list of paths everytime the Keying Set is used (to insert or delete keyframes), allowing complex heuristics to be used to determine whether a property gets keyframed based on the current context. These checks may include checking on selection status of related entities, or transform locks. Built-In KeyingSets have also been recoded, and moved from C and out into Python. These are now coded as Relative Keying Sets, and can to some extent serve as basis for adding new relative Keying Sets. However, these have mostly been coded in a slightly 'modular' way which may be confusing for those not so familiar with Python in general. A usable template will be added soon for more general usage. Keyframing settings (i.e. 'visual', 'needed') can now be specified on a per-path basis now, which is especially useful for Absolute Keying Sets, where control over this is often beneficial. Most of the places where Auto-Keyframing is performed have been tidied up for consistency. I'm sure quite a few issues still exist there, but these I'll clean up over the next few days. --- .../scripts/keyingsets/keyingsets_builtins.py | 236 ++++ .../scripts/keyingsets/keyingsets_utils.py | 170 +++ release/scripts/modules/bpy/utils.py | 4 +- source/blender/blenkernel/BKE_animsys.h | 5 +- source/blender/blenkernel/intern/anim_sys.c | 67 +- .../blender/editors/animation/anim_intern.h | 6 - source/blender/editors/animation/keyframing.c | 58 +- source/blender/editors/animation/keyingsets.c | 1159 ++++------------- .../blender/editors/armature/editarmature.c | 72 +- source/blender/editors/armature/poseUtils.c | 25 +- source/blender/editors/armature/poselib.c | 61 +- source/blender/editors/armature/poseobject.c | 129 +- .../blender/editors/include/ED_keyframing.h | 86 +- .../blender/editors/object/object_transform.c | 84 +- .../editors/space_view3d/view3d_view.c | 20 +- .../editors/transform/transform_conversions.c | 90 +- source/blender/makesdna/DNA_anim_types.h | 10 +- source/blender/makesrna/RNA_access.h | 1 + .../blender/makesrna/intern/rna_animation.c | 270 +++- .../makesrna/intern/rna_animation_api.c | 39 +- .../windowmanager/intern/wm_init_exit.c | 6 +- 21 files changed, 1277 insertions(+), 1321 deletions(-) create mode 100644 release/scripts/keyingsets/keyingsets_builtins.py create mode 100644 release/scripts/keyingsets/keyingsets_utils.py diff --git a/release/scripts/keyingsets/keyingsets_builtins.py b/release/scripts/keyingsets/keyingsets_builtins.py new file mode 100644 index 00000000000..c5417ba3d66 --- /dev/null +++ b/release/scripts/keyingsets/keyingsets_builtins.py @@ -0,0 +1,236 @@ +# Built-In Keying Sets +# None of these Keying Sets should be removed, as these +# are needed by various parts of Blender in order for them +# to work correctly. + +import bpy +from keyingsets_utils import * + +############################### +# Built-In KeyingSets + +# Location +class BUILTIN_KSI_Location(bpy.types.KeyingSetInfo): + bl_idname = "Location" + bl_builtin = True + + # poll - use predefined callback for selected bones/objects + poll = RKS_POLL_selected_items + + # iterator - use callback for selected bones/objects + iterator = RKS_ITER_selected_item + + # generator - use callback for location + generate = RKS_GEN_location + +# Rotation +class BUILTIN_KSI_Rotation(bpy.types.KeyingSetInfo): + bl_idname = "Rotation" + bl_builtin = True + + # poll - use predefined callback for selected bones/objects + poll = RKS_POLL_selected_items + + # iterator - use callback for selected bones/objects + iterator = RKS_ITER_selected_item + + # generator - use callback for location + generate = RKS_GEN_rotation + +# Scale +class BUILTIN_KSI_Scaling(bpy.types.KeyingSetInfo): + bl_idname = "Scaling" + bl_builtin = True + + # poll - use predefined callback for selected bones/objects + poll = RKS_POLL_selected_items + + # iterator - use callback for selected bones/objects + iterator = RKS_ITER_selected_item + + # generator - use callback for location + generate = RKS_GEN_scaling + +# ------------ + +# LocRot +class BUILTIN_KSI_LocRot(bpy.types.KeyingSetInfo): + bl_idname = "LocRot" + bl_builtin = True + + # poll - use predefined callback for selected bones/objects + poll = RKS_POLL_selected_items + + # iterator - use callback for selected bones/objects + iterator = RKS_ITER_selected_item + + # generator - use callback for location + def generate(self, context, ks, data): + # location + RKS_GEN_location(self, context, ks, data) + # rotation + RKS_GEN_rotation(self, context, ks, data) + +# LocScale +class BUILTIN_KSI_LocScale(bpy.types.KeyingSetInfo): + bl_idname = "LocScale" + bl_builtin = True + + # poll - use predefined callback for selected bones/objects + poll = RKS_POLL_selected_items + + # iterator - use callback for selected bones/objects + iterator = RKS_ITER_selected_item + + # generator - use callback for location + def generate(self, context, ks, data): + # location + RKS_GEN_location(self, context, ks, data) + # scale + RKS_GEN_scaling(self, context, ks, data) + +# LocRotScale +class BUILTIN_KSI_LocRotScale(bpy.types.KeyingSetInfo): + bl_idname = "LocRotScale" + bl_builtin = True + + # poll - use predefined callback for selected bones/objects + poll = RKS_POLL_selected_items + + # iterator - use callback for selected bones/objects + iterator = RKS_ITER_selected_item + + # generator - use callback for location + def generate(self, context, ks, data): + # location + RKS_GEN_location(self, context, ks, data) + # rotation + RKS_GEN_rotation(self, context, ks, data) + # scale + RKS_GEN_scaling(self, context, ks, data) + +# RotScale +class BUILTIN_KSI_RotScale(bpy.types.KeyingSetInfo): + bl_idname = "RotScale" + bl_builtin = True + + # poll - use predefined callback for selected bones/objects + poll = RKS_POLL_selected_items + + # iterator - use callback for selected bones/objects + iterator = RKS_ITER_selected_item + + # generator - use callback for location + def generate(self, context, ks, data): + # rotation + RKS_GEN_rotation(self, context, ks, data) + # scaling + RKS_GEN_scaling(self, context, ks, data) + +# ------------ + +# Location +class BUILTIN_KSI_VisualLoc(bpy.types.KeyingSetInfo): + bl_idname = "Visual Location" + bl_builtin = True + + insertkey_visual = True + + # poll - use predefined callback for selected bones/objects + poll = RKS_POLL_selected_items + + # iterator - use callback for selected bones/objects + iterator = RKS_ITER_selected_item + + # generator - use callback for location + generate = RKS_GEN_location + +# Rotation +class BUILTIN_KSI_VisualRot(bpy.types.KeyingSetInfo): + bl_idname = "Visual Rotation" + bl_builtin = True + + insertkey_visual = True + + # poll - use predefined callback for selected bones/objects + poll = RKS_POLL_selected_items + + # iterator - use callback for selected bones/objects + iterator = RKS_ITER_selected_item + + # generator - use callback for location + generate = RKS_GEN_rotation + +# VisualLocRot +class BUILTIN_KSI_VisualLocRot(bpy.types.KeyingSetInfo): + bl_idname = "Visual LocRot" + bl_builtin = True + + insertkey_visual = True + + # poll - use predefined callback for selected bones/objects + poll = RKS_POLL_selected_items + + # iterator - use callback for selected bones/objects + iterator = RKS_ITER_selected_item + + # generator - use callback for location + def generate(self, context, ks, data): + # location + RKS_GEN_location(self, context, ks, data) + # rotation + RKS_GEN_rotation(self, context, ks, data) + +# ------------ + +# Available +class BUILTIN_KSI_Available(bpy.types.KeyingSetInfo): + bl_idname = "Available" + bl_builtin = True + + # poll - use predefined callback for selected objects + # TODO: this should really check whether the selected object (or datablock) + # has any animation data defined yet + poll = RKS_POLL_selected_objects + + # iterator - use callback for selected bones/objects + iterator = RKS_ITER_selected_item + + # generator - use callback for location + generate = RKS_GEN_available + +############################### + +classes = [ + BUILTIN_KSI_Location, + BUILTIN_KSI_Rotation, + BUILTIN_KSI_Scaling, + + BUILTIN_KSI_LocRot, + BUILTIN_KSI_LocScale, + BUILTIN_KSI_LocRotScale, + BUILTIN_KSI_RotScale, + + BUILTIN_KSI_VisualLoc, + BUILTIN_KSI_VisualRot, + BUILTIN_KSI_VisualLocRot, + + BUILTIN_KSI_Available, +] + + +def register(): + register = bpy.types.register + for cls in classes: + register(cls) + + +def unregister(): + unregister = bpy.types.unregister + for cls in classes: + unregister(cls) + +if __name__ == "__main__": + register() + +############################### diff --git a/release/scripts/keyingsets/keyingsets_utils.py b/release/scripts/keyingsets/keyingsets_utils.py new file mode 100644 index 00000000000..78e170c88f9 --- /dev/null +++ b/release/scripts/keyingsets/keyingsets_utils.py @@ -0,0 +1,170 @@ +# This file defines a set of methods that are useful for various +# Relative Keying Set (RKS) related operations, such as: callbacks +# for polling, iterator callbacks, and also generate callbacks. +# All of these can be used in conjunction with the others. + +import bpy + +########################### +# General Utilities + +# Append the specified property name on the the existing path +def path_add_property(path, prop): + if len(path): + return path + "." + prop; + else: + return prop; + +########################### +# Poll Callbacks + +# selected objects +def RKS_POLL_selected_objects(ksi, context): + return context.active_object or len(context.selected_objects); + +# selected bones +def RKS_POLL_selected_bones(ksi, context): + # we must be in Pose Mode, and there must be some bones selected + if (context.active_object) and (context.active_object.mode == 'POSE'): + if context.active_pose_bone or len(context.select_pose_bones): + return True; + + # nothing selected + return False; + + +# selected bones or objects +def RKS_POLL_selected_items(ksi, context): + return RKS_POLL_selected_bones(ksi, context) or RKS_POLL_selected_objects(ksi, context); + +########################### +# Iterator Callbacks + +# all selected objects or pose bones, depending on which we've got +def RKS_ITER_selected_item(ksi, context, ks): + if (context.active_object) and (context.active_object.mode == 'POSE'): + for bone in context.selected_pose_bones: + ksi.generate(context, ks, bone) + else: + for ob in context.selected_objects: + ksi.generate(context, ks, ob) + +########################### +# Generate Callbacks + +# 'Available' F-Curves +def RKS_GEN_available(ksi, context, ks, data): + # try to get the animation data associated with the closest + # ID-block to the data (neither of which may exist/be easy to find) + id_block = data.id_data + try: + adt = id_block.animation_data + except: + # there isn't any animation data available + return; + + # there must also be an active action... + if adt.action is None: + return; + + # for each F-Curve, include an path to key it + # NOTE: we don't need to set the group settings here + for fcu in adt.action.fcurves: + ks.add_path(id_block, fcu.rna_path, array_index=fcu.array_index, entire_array=False) + +# ------ + +# get ID block and based ID path for transform generators +def get_transform_generators_base_info(data): + # ID-block for the data + id_block = data.id_data + + # get base path and grouping method/name + if isinstance(data, bpy.types.ID): + # no path in this case + path = "" + + # data on ID-blocks directly should get grouped by the KeyingSet + grouping = None; + else: + # get the path to the ID-block + path = data.path_to_id() + + try: + # try to use the name of the data element to group the F-Curve + grouping = data.name + except: + # fallback on the KeyingSet name + grouping = None; + + # return the ID-block and the path + return id_block, path, grouping + +# Location +def RKS_GEN_location(ksi, context, ks, data): + # get id-block and path info + id_block, base_path, grouping= get_transform_generators_base_info(data) + + # add the property name to the base path + path = path_add_property(base_path, "location") + + # add Keying Set entry for this... + if grouping: + ks.add_path(id_block, path, grouping_method='NAMED', group_name=grouping) + else: + ks.add_path(id_block, path) + +# Rotation +def RKS_GEN_rotation(ksi, context, ks, data): + # get id-block and path info + id_block, base_path, grouping= get_transform_generators_base_info(data) + + # add the property name to the base path + # rotation mode affects the property used + if data.rotation_mode == 'QUATERNION': + path = path_add_property(base_path, "rotation_quaternion") + elif data.rotation_mode == 'AXISANGLE': + path = path_add_property(base_path, "rotation_axis_angle") + else: + path = path_add_property(base_path, "rotation_euler") + + # add Keying Set entry for this... + if grouping: + ks.add_path(id_block, path, grouping_method='NAMED', group_name=grouping) + else: + ks.add_path(id_block, path) + +# Scaling +def RKS_GEN_scaling(ksi, context, ks, data): + # get id-block and path info + id_block, base_path, grouping= get_transform_generators_base_info(data) + + # add the property name to the base path + path = path_add_property(base_path, "scale") + + # add Keying Set entry for this... + if grouping: + ks.add_path(id_block, path, grouping_method='NAMED', group_name=grouping) + else: + ks.add_path(id_block, path) + +########################### +# Un-needed stuff which is here to just shut up the warnings... + +classes = [] + +def register(): + register = bpy.types.register + for cls in classes: + register(cls) + + +def unregister(): + unregister = bpy.types.unregister + for cls in classes: + unregister(cls) + +if __name__ == "__main__": + register() + +########################### diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py index 7787d9ee5fe..5b0599fe25f 100644 --- a/release/scripts/modules/bpy/utils.py +++ b/release/scripts/modules/bpy/utils.py @@ -169,7 +169,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False): _loaded[:] = [] for base_path in script_paths(user=False): - for path_subdir in ("ui", "op", "io", "cfg"): + for path_subdir in ("ui", "op", "io", "cfg", "keyingsets"): path = _os.path.join(base_path, path_subdir) if _os.path.isdir(path): sys_path_ensure(path) @@ -179,7 +179,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False): user_path = user_script_path() if user_path: - for path_subdir in ("", "ui", "op", "io", "cfg"): + for path_subdir in ("", "ui", "op", "io", "cfg", "keyingsets"): path = _os.path.join(user_path, path_subdir) if _os.path.isdir(path): sys_path_ensure(path) diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h index f6950ba07b8..8644074d4e9 100644 --- a/source/blender/blenkernel/BKE_animsys.h +++ b/source/blender/blenkernel/BKE_animsys.h @@ -71,7 +71,7 @@ void BKE_animdata_make_local(struct AnimData *adt); struct KeyingSet *BKE_keyingset_add(struct ListBase *list, const char name[], short flag, short keyingflag); /* Add a path to a KeyingSet */ -void BKE_keyingset_add_path(struct KeyingSet *ks, struct ID *id, const char group_name[], const char rna_path[], int array_index, short flag, short groupmode); +struct KS_Path *BKE_keyingset_add_path(struct KeyingSet *ks, struct ID *id, const char group_name[], const char rna_path[], int array_index, short flag, short groupmode); /* Find the destination matching the criteria given */ struct KS_Path *BKE_keyingset_find_path(struct KeyingSet *ks, struct ID *id, const char group_name[], const char rna_path[], int array_index, int group_mode); @@ -79,6 +79,9 @@ struct KS_Path *BKE_keyingset_find_path(struct KeyingSet *ks, struct ID *id, con /* Copy all KeyingSets in the given list */ void BKE_keyingsets_copy(struct ListBase *newlist, struct ListBase *list); +/* Free the given Keying Set path */ +void BKE_keyingset_free_path(struct KeyingSet *ks, struct KS_Path *ksp); + /* Free data for KeyingSet but not set itself */ void BKE_keyingset_free(struct KeyingSet *ks); diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index a880417a111..8ec8f24d5fe 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -621,53 +621,48 @@ KeyingSet *BKE_keyingset_add (ListBase *list, const char name[], short flag, sho return ks; } -/* Add a destination to a KeyingSet. Nothing is returned for now... +/* Add a path to a KeyingSet. Nothing is returned for now... * Checks are performed to ensure that destination is appropriate for the KeyingSet in question */ -void BKE_keyingset_add_path (KeyingSet *ks, ID *id, const char group_name[], const char rna_path[], int array_index, short flag, short groupmode) +KS_Path *BKE_keyingset_add_path (KeyingSet *ks, ID *id, const char group_name[], const char rna_path[], int array_index, short flag, short groupmode) { KS_Path *ksp; /* sanity checks */ if ELEM(NULL, ks, rna_path) { - printf("ERROR: no Keying Set and/or RNA Path to add destination with \n"); - return; + printf("ERROR: no Keying Set and/or RNA Path to add path with \n"); + return NULL; } - /* ID is optional for relative KeyingSets, but is necessary for absolute KeyingSets */ + /* ID is required for all types of KeyingSets */ if (id == NULL) { - if (ks->flag & KEYINGSET_ABSOLUTE) { - printf("ERROR: No ID provided for absolute destination. \n"); - return; - } + printf("ERROR: No ID provided for Keying Set Path. \n"); + return NULL; } /* don't add if there is already a matching KS_Path in the KeyingSet */ if (BKE_keyingset_find_path(ks, id, group_name, rna_path, array_index, groupmode)) { if (G.f & G_DEBUG) printf("ERROR: destination already exists in Keying Set \n"); - return; + return NULL; } /* allocate a new KeyingSet Path */ ksp= MEM_callocN(sizeof(KS_Path), "KeyingSet Path"); /* just store absolute info */ - if (ks->flag & KEYINGSET_ABSOLUTE) { - ksp->id= id; - if (group_name) - BLI_snprintf(ksp->group, 64, group_name); - else - strcpy(ksp->group, ""); - } + ksp->id= id; + if (group_name) + BLI_snprintf(ksp->group, 64, group_name); + else + strcpy(ksp->group, ""); /* store additional info for relative paths (just in case user makes the set relative) */ if (id) ksp->idtype= GS(id->name); /* just copy path info */ - // XXX no checks are performed for templates yet - // should array index be checked too? + // TODO: should array index be checked too? ksp->rna_path= BLI_strdupn(rna_path, strlen(rna_path)); ksp->array_index= array_index; @@ -677,20 +672,37 @@ void BKE_keyingset_add_path (KeyingSet *ks, ID *id, const char group_name[], con /* add KeyingSet path to KeyingSet */ BLI_addtail(&ks->paths, ksp); + + /* return this path */ + return ksp; } +/* Free the given Keying Set path */ +void BKE_keyingset_free_path (KeyingSet *ks, KS_Path *ksp) +{ + /* sanity check */ + if ELEM(NULL, ks, ksp) + return; + + /* free RNA-path info */ + MEM_freeN(ksp->rna_path); + + /* free path itself */ + BLI_freelinkN(&ks->paths, ksp); +} + /* Copy all KeyingSets in the given list */ -void BKE_keyingsets_copy(ListBase *newlist, ListBase *list) +void BKE_keyingsets_copy (ListBase *newlist, ListBase *list) { KeyingSet *ksn; KS_Path *kspn; - + BLI_duplicatelist(newlist, list); - for(ksn=newlist->first; ksn; ksn=ksn->next) { + for (ksn=newlist->first; ksn; ksn=ksn->next) { BLI_duplicatelist(&ksn->paths, &ksn->paths); - - for(kspn=ksn->paths.first; kspn; kspn=kspn->next) + + for (kspn=ksn->paths.first; kspn; kspn=kspn->next) kspn->rna_path= MEM_dupallocN(kspn->rna_path); } } @@ -709,12 +721,7 @@ void BKE_keyingset_free (KeyingSet *ks) /* free each path as we go to avoid looping twice */ for (ksp= ks->paths.first; ksp; ksp= kspn) { kspn= ksp->next; - - /* free RNA-path info */ - MEM_freeN(ksp->rna_path); - - /* free path itself */ - BLI_freelinkN(&ks->paths, ksp); + BKE_keyingset_free_path(ks, ksp); } } diff --git a/source/blender/editors/animation/anim_intern.h b/source/blender/editors/animation/anim_intern.h index 5602bff77ce..379b8c27de5 100644 --- a/source/blender/editors/animation/anim_intern.h +++ b/source/blender/editors/animation/anim_intern.h @@ -33,12 +33,6 @@ /* list of builtin KeyingSets (defined in keyingsets.c) */ extern ListBase builtin_keyingsets; -/* for builtin keyingsets - context poll */ -short keyingset_context_ok_poll(bContext *C, KeyingSet *ks); - -/* Main KeyingSet operations API call */ -short modifykey_get_context_data (bContext *C, ListBase *dsources, KeyingSet *ks); - /* Operator Define Prototypes ------------------- */ /* Main Keyframe Management operators: diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index d0675dc42ba..eaebab2efab 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1073,7 +1073,6 @@ static int modify_key_op_poll(bContext *C) static int insert_key_exec (bContext *C, wmOperator *op) { - ListBase dsources = {NULL, NULL}; Scene *scene= CTX_data_scene(C); KeyingSet *ks= NULL; int type= RNA_int_get(op->ptr, "type"); @@ -1098,22 +1097,17 @@ static int insert_key_exec (bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - /* get context info for relative Keying Sets */ - if ((ks->flag & KEYINGSET_ABSOLUTE) == 0) { - /* exit if no suitable data obtained */ - if (modifykey_get_context_data(C, &dsources, ks) == 0) { - BKE_report(op->reports, RPT_ERROR, "No suitable context info for active Keying Set"); - return OPERATOR_CANCELLED; - } - } - /* try to insert keyframes for the channels specified by KeyingSet */ - success= modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); + success= ANIM_apply_keyingset(C, NULL, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); if (G.f & G_DEBUG) BKE_reportf(op->reports, RPT_INFO, "KeyingSet '%s' - Successfully added %d Keyframes \n", ks->name, success); /* report failure or do updates? */ - if (success) { + if (success == MODIFYKEY_INVALID_CONTEXT) { + BKE_report(op->reports, RPT_ERROR, "No suitable context info for active Keying Set"); + return OPERATOR_CANCELLED; + } + else if (success) { /* if the appropriate properties have been set, make a note that we've inserted something */ if (RNA_boolean_get(op->ptr, "confirm_success")) BKE_reportf(op->reports, RPT_INFO, "Successfully added %d Keyframes for KeyingSet '%s'", success, ks->name); @@ -1123,13 +1117,6 @@ static int insert_key_exec (bContext *C, wmOperator *op) } else BKE_report(op->reports, RPT_WARNING, "Keying Set failed to insert any keyframes"); - - - /* free temp context-data if available */ - if (dsources.first) { - /* we assume that there is no extra data that needs to be freed from here... */ - BLI_freelistN(&dsources); - } /* send updates */ DAG_ids_flush_update(0); @@ -1191,8 +1178,10 @@ static void insert_key_menu_prompt (bContext *C) * - these are listed in the order in which they were defined for the active scene */ if (scene->keyingsets.first) { - for (ks= scene->keyingsets.first; ks; ks= ks->next) - uiItemIntO(layout, ks->name, 0, "ANIM_OT_keyframe_insert_menu", "type", i++); + for (ks= scene->keyingsets.first; ks; ks= ks->next) { + if (ANIM_keyingset_context_ok_poll(C, ks)) + uiItemIntO(layout, ks->name, 0, "ANIM_OT_keyframe_insert_menu", "type", i++); + } uiItemS(layout); } @@ -1200,9 +1189,8 @@ static void insert_key_menu_prompt (bContext *C) i= -1; for (ks= builtin_keyingsets.first; ks; ks= ks->next) { /* only show KeyingSet if context is suitable */ - if (keyingset_context_ok_poll(C, ks)) { + if (ANIM_keyingset_context_ok_poll(C, ks)) uiItemIntO(layout, ks->name, 0, "ANIM_OT_keyframe_insert_menu", "type", i--); - } } uiPupMenuEnd(C, pup); @@ -1261,7 +1249,6 @@ void ANIM_OT_keyframe_insert_menu (wmOperatorType *ot) static int delete_key_exec (bContext *C, wmOperator *op) { - ListBase dsources = {NULL, NULL}; Scene *scene= CTX_data_scene(C); KeyingSet *ks= NULL; int type= RNA_int_get(op->ptr, "type"); @@ -1286,22 +1273,17 @@ static int delete_key_exec (bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - /* get context info for relative Keying Sets */ - if ((ks->flag & KEYINGSET_ABSOLUTE) == 0) { - /* exit if no suitable data obtained */ - if (modifykey_get_context_data(C, &dsources, ks) == 0) { - BKE_report(op->reports, RPT_ERROR, "No suitable context info for active Keying Set"); - return OPERATOR_CANCELLED; - } - } - /* try to insert keyframes for the channels specified by KeyingSet */ - success= modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_DELETE, cfra); + success= ANIM_apply_keyingset(C, NULL, NULL, ks, MODIFYKEY_MODE_DELETE, cfra); if (G.f & G_DEBUG) printf("KeyingSet '%s' - Successfully removed %d Keyframes \n", ks->name, success); /* report failure or do updates? */ - if (success) { + if (success == MODIFYKEY_INVALID_CONTEXT) { + BKE_report(op->reports, RPT_ERROR, "No suitable context info for active Keying Set"); + return OPERATOR_CANCELLED; + } + else if (success) { /* if the appropriate properties have been set, make a note that we've inserted something */ if (RNA_boolean_get(op->ptr, "confirm_success")) BKE_reportf(op->reports, RPT_INFO, "Successfully removed %d Keyframes for KeyingSet '%s'", success, ks->name); @@ -1312,12 +1294,6 @@ static int delete_key_exec (bContext *C, wmOperator *op) else BKE_report(op->reports, RPT_WARNING, "Keying Set failed to remove any keyframes"); - /* free temp context-data if available */ - if (dsources.first) { - /* we assume that there is no extra data that needs to be freed from here... */ - BLI_freelistN(&dsources); - } - /* send updates */ DAG_ids_flush_update(0); diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 63323a8519d..1e4180a3ae7 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -256,14 +256,8 @@ static int remove_active_ks_path_exec (bContext *C, wmOperator *op) KS_Path *ksp= BLI_findlink(&ks->paths, ks->active_path-1); if (ksp) { - /* NOTE: sync this code with BKE_keyingset_free() */ - { - /* free RNA-path info */ - MEM_freeN(ksp->rna_path); - - /* free path itself */ - BLI_freelinkN(&ks->paths, ksp); - } + /* remove the active path from the KeyingSet */ + BKE_keyingset_free_path(ks, ksp); /* the active path should now be the previously second-to-last active one */ ks->active_path--; @@ -467,644 +461,42 @@ void ANIM_OT_keyingset_button_remove (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -/* ************************************************** */ -/* KEYING SETS - EDITING API */ - -/* UI API --------------------------------------------- */ - -/* Build menu-string of available keying-sets (allocates memory for string) - * NOTE: mode must not be longer than 64 chars - */ -char *ANIM_build_keyingsets_menu (ListBase *list, short for_edit) -{ - DynStr *pupds= BLI_dynstr_new(); - KeyingSet *ks; - char buf[64]; - char *str; - int i; - - /* add title first */ - BLI_dynstr_append(pupds, "Keying Sets%t|"); - - /* add dummy entries for none-active */ - if (for_edit) { - BLI_dynstr_append(pupds, "Add New%x-1|"); - BLI_dynstr_append(pupds, " %x0|"); - } - else - BLI_dynstr_append(pupds, "No Keying Set%x0|"); - - /* loop through keyingsets, adding them */ - for (ks=list->first, i=1; ks; ks=ks->next, i++) { - if (for_edit == 0) - BLI_dynstr_append(pupds, "KS: "); - - BLI_dynstr_append(pupds, ks->name); - BLI_snprintf( buf, 64, "%%x%d%s", i, ((ks->next)?"|":"") ); - BLI_dynstr_append(pupds, buf); - } - - /* convert to normal MEM_malloc'd string */ - str= BLI_dynstr_get_cstring(pupds); - BLI_dynstr_free(pupds); - - return str; -} - - /* ******************************************* */ -/* KEYING SETS - BUILTIN */ +/* REGISTERED KEYING SETS */ -#if 0 // XXX old keyingsets code based on adrcodes... to be restored in due course +/* Keying Set Type Info declarations */ +ListBase keyingset_type_infos = {NULL, NULL}; -/* ------------- KeyingSet Defines ------------ */ -/* Note: these must all be named with the defks_* prefix, otherwise the template macro will not work! */ - -/* macro for defining keyingset contexts */ -#define KSC_TEMPLATE(ctx_name) {&defks_##ctx_name[0], NULL, sizeof(defks_##ctx_name)/sizeof(bKeyingSet)} - -/* --- */ - -/* check if option not available for deleting keys */ -static short incl_non_del_keys (bKeyingSet *ks, const char mode[]) -{ - /* as optimisation, assume that it is sufficient to check only first letter - * of mode (int comparison should be faster than string!) - */ - //if (strcmp(mode, "Delete")==0) - if (mode && mode[0]=='D') - return 0; - - return 1; -} - -/* Object KeyingSets ------ */ - -/* check if include shapekey entry */ -static short incl_v3d_ob_shapekey (bKeyingSet *ks, const char mode[]) -{ - //Object *ob= (G.obedit)? (G.obedit) : (OBACT); // XXX - Object *ob= NULL; - char *newname= NULL; - - if(ob==NULL) - return 0; - - /* not available for delete mode */ - if (strcmp(mode, "Delete")==0) - return 0; - - /* check if is geom object that can get shapekeys */ - switch (ob->type) { - /* geometry? */ - case OB_MESH: newname= "Mesh"; break; - case OB_CURVE: newname= "Curve"; break; - case OB_SURF: newname= "Surface"; break; - case OB_LATTICE: newname= "Lattice"; break; - - /* not geometry! */ - default: - return 0; - } - - /* if ks is shapekey entry (this could be callled for separator before too!) */ - if (ks->flag == -3) - BLI_strncpy(ks->name, newname, sizeof(ks->name)); - - /* if it gets here, it's ok */ - return 1; -} - -/* array for object keyingset defines */ -bKeyingSet defks_v3d_object[] = -{ - /* include_cb, adrcode-getter, name, blocktype, flag, chan_num, adrcodes */ - {NULL, "Loc", ID_OB, 0, 3, {OB_LOC_X,OB_LOC_Y,OB_LOC_Z}}, - {NULL, "Rot", ID_OB, 0, 3, {OB_ROT_X,OB_ROT_Y,OB_ROT_Z}}, - {NULL, "Scale", ID_OB, 0, 3, {OB_SIZE_X,OB_SIZE_Y,OB_SIZE_Z}}, - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - {NULL, "LocRot", ID_OB, 0, 6, - {OB_LOC_X,OB_LOC_Y,OB_LOC_Z, - OB_ROT_X,OB_ROT_Y,OB_ROT_Z}}, - - {NULL, "LocScale", ID_OB, 0, 6, - {OB_LOC_X,OB_LOC_Y,OB_LOC_Z, - OB_SIZE_X,OB_SIZE_Y,OB_SIZE_Z}}, - - {NULL, "LocRotScale", ID_OB, 0, 9, - {OB_LOC_X,OB_LOC_Y,OB_LOC_Z, - OB_ROT_X,OB_ROT_Y,OB_ROT_Z, - OB_SIZE_X,OB_SIZE_Y,OB_SIZE_Z}}, - - {NULL, "RotScale", ID_OB, 0, 6, - {OB_ROT_X,OB_ROT_Y,OB_ROT_Z, - OB_SIZE_X,OB_SIZE_Y,OB_SIZE_Z}}, - - {incl_non_del_keys, "%l", 0, -1, 0, {0}}, // separator - - {incl_non_del_keys, "VisualLoc", ID_OB, INSERTKEY_MATRIX, 3, {OB_LOC_X,OB_LOC_Y,OB_LOC_Z}}, - {incl_non_del_keys, "VisualRot", ID_OB, INSERTKEY_MATRIX, 3, {OB_ROT_X,OB_ROT_Y,OB_ROT_Z}}, - - {incl_non_del_keys, "VisualLocRot", ID_OB, INSERTKEY_MATRIX, 6, - {OB_LOC_X,OB_LOC_Y,OB_LOC_Z, - OB_ROT_X,OB_ROT_Y,OB_ROT_Z}}, - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - {NULL, "Layer", ID_OB, 0, 1, {OB_LAY}}, // icky option... - {NULL, "Available", ID_OB, -2, 0, {0}}, - - {incl_v3d_ob_shapekey, "%l%l", 0, -1, 0, {0}}, // separator (linked to shapekey entry) - {incl_v3d_ob_shapekey, "", ID_OB, -3, 0, {0}} -}; - -/* PoseChannel KeyingSets ------ */ - -/* array for posechannel keyingset defines */ -bKeyingSet defks_v3d_pchan[] = -{ - /* include_cb, name, blocktype, flag, chan_num, adrcodes */ - {NULL, "Loc", ID_PO, 0, 3, {AC_LOC_X,AC_LOC_Y,AC_LOC_Z}}, - {NULL, "Rot", ID_PO, COMMONKEY_PCHANROT, 1, {KAG_CHAN_EXTEND}}, - {NULL, "Scale", ID_PO, 0, 3, {AC_SIZE_X,AC_SIZE_Y,AC_SIZE_Z}}, - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - {NULL, "LocRot", ID_PO, COMMONKEY_PCHANROT, 4, - {AC_LOC_X,AC_LOC_Y,AC_LOC_Z, - KAG_CHAN_EXTEND}}, - - {NULL, "LocScale", ID_PO, 0, 6, - {AC_LOC_X,AC_LOC_Y,AC_LOC_Z, - AC_SIZE_X,AC_SIZE_Y,AC_SIZE_Z}}, - - {NULL, "LocRotScale", ID_PO, COMMONKEY_PCHANROT, 7, - {AC_LOC_X,AC_LOC_Y,AC_LOC_Z,AC_SIZE_X,AC_SIZE_Y,AC_SIZE_Z, - KAG_CHAN_EXTEND}}, - - {NULL, "RotScale", ID_PO, 0, 4, - {AC_SIZE_X,AC_SIZE_Y,AC_SIZE_Z, - KAG_CHAN_EXTEND}}, - - {incl_non_del_keys, "%l", 0, -1, 0, {0}}, // separator - - {incl_non_del_keys, "VisualLoc", ID_PO, INSERTKEY_MATRIX, 3, {AC_LOC_X,AC_LOC_Y,AC_LOC_Z}}, - {incl_non_del_keys, "VisualRot", ID_PO, INSERTKEY_MATRIX|COMMONKEY_PCHANROT, 1, {KAG_CHAN_EXTEND}}, - - {incl_non_del_keys, "VisualLocRot", ID_PO, INSERTKEY_MATRIX|COMMONKEY_PCHANROT, 4, - {AC_LOC_X,AC_LOC_Y,AC_LOC_Z, KAG_CHAN_EXTEND}}, - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - {NULL, "Available", ID_PO, -2, 0, {0}} -}; - -/* Material KeyingSets ------ */ - -/* array for material keyingset defines */ -bKeyingSet defks_buts_shading_mat[] = -{ - /* include_cb, name, blocktype, flag, chan_num, adrcodes */ - {NULL, "RGB", ID_MA, 0, 3, {MA_COL_R,MA_COL_G,MA_COL_B}}, - {NULL, "Alpha", ID_MA, 0, 1, {MA_ALPHA}}, - {NULL, "Halo Size", ID_MA, 0, 1, {MA_HASIZE}}, - {NULL, "Mode", ID_MA, 0, 1, {MA_MODE}}, // evil bitflags - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - {NULL, "All Color", ID_MA, 0, 18, - {MA_COL_R,MA_COL_G,MA_COL_B, - MA_ALPHA,MA_HASIZE, MA_MODE, - MA_SPEC_R,MA_SPEC_G,MA_SPEC_B, - MA_REF,MA_EMIT,MA_AMB,MA_SPEC,MA_HARD, - MA_MODE,MA_TRANSLU,MA_ADD}}, - - {NULL, "All Mirror", ID_MA, 0, 5, - {MA_RAYM,MA_FRESMIR,MA_FRESMIRI, - MA_FRESTRA,MA_FRESTRAI}}, - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - {NULL, "Ofs", ID_MA, COMMONKEY_ADDMAP, 3, {MAP_OFS_X,MAP_OFS_Y,MAP_OFS_Z}}, - {NULL, "Size", ID_MA, COMMONKEY_ADDMAP, 3, {MAP_SIZE_X,MAP_SIZE_Y,MAP_SIZE_Z}}, - - {NULL, "All Mapping", ID_MA, COMMONKEY_ADDMAP, 14, - {MAP_OFS_X,MAP_OFS_Y,MAP_OFS_Z, - MAP_SIZE_X,MAP_SIZE_Y,MAP_SIZE_Z, - MAP_R,MAP_G,MAP_B,MAP_DVAR, - MAP_COLF,MAP_NORF,MAP_VARF,MAP_DISP}}, - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - {NULL, "Available", ID_MA, -2, 0, {0}} -}; - -/* World KeyingSets ------ */ - -/* array for world keyingset defines */ -bKeyingSet defks_buts_shading_wo[] = -{ - /* include_cb, name, blocktype, flag, chan_num, adrcodes */ - {NULL, "Zenith RGB", ID_WO, 0, 3, {WO_ZEN_R,WO_ZEN_G,WO_ZEN_B}}, - {NULL, "Horizon RGB", ID_WO, 0, 3, {WO_HOR_R,WO_HOR_G,WO_HOR_B}}, - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - {NULL, "Mist", ID_WO, 0, 4, {WO_MISI,WO_MISTDI,WO_MISTSTA,WO_MISTHI}}, - {NULL, "Stars", ID_WO, 0, 5, {WO_STAR_R,WO_STAR_G,WO_STAR_B,WO_STARDIST,WO_STARSIZE}}, - - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - {NULL, "Ofs", ID_WO, COMMONKEY_ADDMAP, 3, {MAP_OFS_X,MAP_OFS_Y,MAP_OFS_Z}}, - {NULL, "Size", ID_WO, COMMONKEY_ADDMAP, 3, {MAP_SIZE_X,MAP_SIZE_Y,MAP_SIZE_Z}}, - - {NULL, "All Mapping", ID_WO, COMMONKEY_ADDMAP, 14, - {MAP_OFS_X,MAP_OFS_Y,MAP_OFS_Z, - MAP_SIZE_X,MAP_SIZE_Y,MAP_SIZE_Z, - MAP_R,MAP_G,MAP_B,MAP_DVAR, - MAP_COLF,MAP_NORF,MAP_VARF,MAP_DISP}}, - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - {NULL, "Available", ID_WO, -2, 0, {0}} -}; - -/* Lamp KeyingSets ------ */ - -/* array for lamp keyingset defines */ -bKeyingSet defks_buts_shading_la[] = -{ - /* include_cb, name, blocktype, flag, chan_num, adrcodes */ - {NULL, "RGB", ID_LA, 0, 3, {LA_COL_R,LA_COL_G,LA_COL_B}}, - {NULL, "Energy", ID_LA, 0, 1, {LA_ENERGY}}, - {NULL, "Spot Size", ID_LA, 0, 1, {LA_SPOTSI}}, - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - {NULL, "Ofs", ID_LA, COMMONKEY_ADDMAP, 3, {MAP_OFS_X,MAP_OFS_Y,MAP_OFS_Z}}, - {NULL, "Size", ID_LA, COMMONKEY_ADDMAP, 3, {MAP_SIZE_X,MAP_SIZE_Y,MAP_SIZE_Z}}, - - {NULL, "All Mapping", ID_LA, COMMONKEY_ADDMAP, 14, - {MAP_OFS_X,MAP_OFS_Y,MAP_OFS_Z, - MAP_SIZE_X,MAP_SIZE_Y,MAP_SIZE_Z, - MAP_R,MAP_G,MAP_B,MAP_DVAR, - MAP_COLF,MAP_NORF,MAP_VARF,MAP_DISP}}, - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - {NULL, "Available", ID_LA, -2, 0, {0}} -}; - -/* Texture KeyingSets ------ */ - -/* array for texture keyingset defines */ -bKeyingSet defks_buts_shading_tex[] = -{ - /* include_cb, name, blocktype, flag, chan_num, adrcodes */ - {NULL, "Clouds", ID_TE, 0, 5, - {TE_NSIZE,TE_NDEPTH,TE_NTYPE, - TE_MG_TYP,TE_N_BAS1}}, - - {NULL, "Marble", ID_TE, 0, 7, - {TE_NSIZE,TE_NDEPTH,TE_NTYPE, - TE_TURB,TE_MG_TYP,TE_N_BAS1,TE_N_BAS2}}, - - {NULL, "Stucci", ID_TE, 0, 5, - {TE_NSIZE,TE_NTYPE,TE_TURB, - TE_MG_TYP,TE_N_BAS1}}, - - {NULL, "Wood", ID_TE, 0, 6, - {TE_NSIZE,TE_NTYPE,TE_TURB, - TE_MG_TYP,TE_N_BAS1,TE_N_BAS2}}, - - {NULL, "Magic", ID_TE, 0, 2, {TE_NDEPTH,TE_TURB}}, - - {NULL, "Blend", ID_TE, 0, 1, {TE_MG_TYP}}, - - {NULL, "Musgrave", ID_TE, 0, 6, - {TE_MG_TYP,TE_MGH,TE_MG_LAC, - TE_MG_OCT,TE_MG_OFF,TE_MG_GAIN}}, - - {NULL, "Voronoi", ID_TE, 0, 9, - {TE_VNW1,TE_VNW2,TE_VNW3,TE_VNW4, - TE_VNMEXP,TE_VN_DISTM,TE_VN_COLT, - TE_ISCA,TE_NSIZE}}, - - {NULL, "Distorted Noise", ID_TE, 0, 4, - {TE_MG_OCT,TE_MG_OFF,TE_MG_GAIN,TE_DISTA}}, - - {NULL, "Color Filter", ID_TE, 0, 5, - {TE_COL_R,TE_COL_G,TE_COL_B,TE_BRIGHT,TE_CONTRA}}, - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - {NULL, "Available", ID_TE, -2, 0, {0}} -}; - -/* Object Buttons KeyingSets ------ */ - -/* check if include particles entry */ -static short incl_buts_ob (bKeyingSet *ks, const char mode[]) -{ - //Object *ob= OBACT; // xxx - Object *ob= NULL; - /* only if object is mesh type */ - - if(ob==NULL) return 0; - return (ob->type == OB_MESH); -} - -/* array for texture keyingset defines */ -bKeyingSet defks_buts_object[] = -{ - /* include_cb, name, blocktype, flag, chan_num, adrcodes */ - {incl_buts_ob, "Surface Damping", ID_OB, 0, 1, {OB_PD_SDAMP}}, - {incl_buts_ob, "Random Damping", ID_OB, 0, 1, {OB_PD_RDAMP}}, - {incl_buts_ob, "Permeability", ID_OB, 0, 1, {OB_PD_PERM}}, - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - {NULL, "Force Strength", ID_OB, 0, 1, {OB_PD_FSTR}}, - {NULL, "Force Falloff", ID_OB, 0, 1, {OB_PD_FFALL}}, - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - {NULL, "Available", ID_OB, -2, 0, {0}} // this will include ob-transforms too! -}; - -/* Camera Buttons KeyingSets ------ */ - -/* check if include internal-renderer entry */ -static short incl_buts_cam1 (bKeyingSet *ks, const char mode[]) -{ - Scene *scene= NULL; // FIXME this will cause a crash, but we need an extra arg first! - /* only if renderer is internal renderer */ - return (scene->r.renderer==R_INTERN); -} - -/* check if include external-renderer entry */ -static short incl_buts_cam2 (bKeyingSet *ks, const char mode[]) -{ - Scene *scene= NULL; // FIXME this will cause a crash, but we need an extra arg first! - /* only if renderer is internal renderer */ - return (scene->r.renderer!=R_INTERN); -} - -/* array for camera keyingset defines */ -bKeyingSet defks_buts_cam[] = -{ - /* include_cb, name, blocktype, flag, chan_num, adrcodes */ - {NULL, "Lens", ID_CA, 0, 1, {CAM_LENS}}, - {NULL, "Clipping", ID_CA, 0, 2, {CAM_STA,CAM_END}}, - {NULL, "Focal Distance", ID_CA, 0, 1, {CAM_YF_FDIST}}, - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - - {incl_buts_cam2, "Aperture", ID_CA, 0, 1, {CAM_YF_APERT}}, - {incl_buts_cam1, "Viewplane Shift", ID_CA, 0, 2, {CAM_SHIFT_X,CAM_SHIFT_Y}}, - - {NULL, "%l", 0, -1, 0, {0}}, // separator - - {NULL, "Available", ID_CA, -2, 0, {0}} -}; - -/* --- */ - -/* Keying Context Defines - Must keep in sync with enumeration (eKS_Contexts) */ -bKeyingContext ks_contexts[] = -{ - KSC_TEMPLATE(v3d_object), - KSC_TEMPLATE(v3d_pchan), - - KSC_TEMPLATE(buts_shading_mat), - KSC_TEMPLATE(buts_shading_wo), - KSC_TEMPLATE(buts_shading_la), - KSC_TEMPLATE(buts_shading_tex), - - KSC_TEMPLATE(buts_object), - KSC_TEMPLATE(buts_cam) -}; - -/* Keying Context Enumeration - Must keep in sync with definitions*/ -typedef enum eKS_Contexts { - KSC_V3D_OBJECT = 0, - KSC_V3D_PCHAN, - - KSC_BUTS_MAT, - KSC_BUTS_WO, - KSC_BUTS_LA, - KSC_BUTS_TEX, - - KSC_BUTS_OB, - KSC_BUTS_CAM, - - /* make sure this last one remains untouched! */ - KSC_TOT_TYPES -} eKS_Contexts; - - -#endif // XXX old keyingsets code based on adrcodes... to be restored in due course - -/* Macros for Declaring KeyingSets ------------------- */ - -/* A note about this system for declaring built-in Keying Sets: - * One may ask, "What is the purpose of all of these macros and static arrays?" and - * "Why not call the KeyingSets API defined in BKE_animsys.h?". The answer is two-fold. - * - * 1) Firstly, we use static arrays of struct definitions instead of function calls, as - * it reduces the start-up overhead and allocated-memory footprint of Blender. If we called - * the KeyingSets API to build these sets, the overhead of checking for unique names, allocating - * memory for each and every path and KeyingSet, scattered around in RAM, all of which would increase - * the startup time (which is totally unacceptable) and could lead to fragmentation+slower access times. - * 2) Since we aren't using function calls, we need a nice way of defining these KeyingSets in a way which - * is easily readable and less prone to breakage from changes to the underlying struct definitions. Further, - * adding additional entries SHOULD NOT require custom code to be written to access these new entries/sets. - * Therefore, here we have a system with nice, human-readable statements via macros, and static arrays which - * are linked together using more special macros + struct definitions, allowing for such a generic + simple - * initialisation function (init_builtin_keyingsets()) compared with that of something like the Nodes system. - * - * -- Joshua Leung, April 2009 - */ - -/* Struct type for declaring builtin KeyingSets in as entries in static arrays*/ -typedef struct bBuiltinKeyingSet { - KeyingSet ks; /* the KeyingSet to build */ - int tot; /* the total number of paths defined */ - KS_Path paths[64]; /* the paths for the KeyingSet to use */ -} bBuiltinKeyingSet; - - /* WARNING: the following macros must be kept in sync with the - * struct definitions in DNA_anim_types.h! - */ - -/* macro for defining a builtin KeyingSet */ -#define BI_KS_DEFINE_BEGIN(name, keyingflag) \ - {{NULL, NULL, {NULL, NULL}, name, KEYINGSET_BUILTIN, keyingflag}, - -/* macro to finish defining a builtin KeyingSet */ -#define BI_KS_DEFINE_END \ - } - -/* macro to start defining paths for a builtin KeyingSet */ -#define BI_KS_PATHS_BEGIN(tot) \ - tot, { - -/* macro to finish defining paths for a builtin KeyingSet */ -#define BI_KS_PATHS_END \ - } - -/* macro for defining a builtin KeyingSet's path */ -#define BI_KSP_DEFINE(id_type, templates, prop_path, array_index, flag, groupflag) \ - {NULL, NULL, NULL, "", id_type, templates, prop_path, array_index, flag, groupflag} - -/* macro for defining a builtin KeyingSet with no paths (use in place of BI_KS_PAHTS_BEGIN/END block) */ -#define BI_KS_PATHS_NONE \ - 0, {0} - -/* ---- */ - -/* Struct type for finding all the arrays of builtin KeyingSets */ -typedef struct bBuiltinKSContext { - bBuiltinKeyingSet *bks; /* array of KeyingSet definitions */ - int tot; /* number of KeyingSets in this array */ -} bBuiltinKSContext; - -/* macro for defining builtin KeyingSet sets - * NOTE: all the arrays of sets must follow this naming convention! - */ -#define BKSC_TEMPLATE(ctx_name) {&def_builtin_keyingsets_##ctx_name[0], sizeof(def_builtin_keyingsets_##ctx_name)/sizeof(bBuiltinKeyingSet)} - - -/* 3D-View Builtin KeyingSets ------------------------ */ - -static bBuiltinKeyingSet def_builtin_keyingsets_v3d[] = -{ - /* Simple Keying Sets ************************************* */ - /* Keying Set - "Location" ---------- */ - BI_KS_DEFINE_BEGIN("Location", 0) - BI_KS_PATHS_BEGIN(1) - BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "location", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM) - BI_KS_PATHS_END - BI_KS_DEFINE_END, - - /* Keying Set - "Rotation" ---------- */ - BI_KS_DEFINE_BEGIN("Rotation", 0) - BI_KS_PATHS_BEGIN(1) - BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN|KSP_TEMPLATE_ROT, "rotation", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM) - BI_KS_PATHS_END - BI_KS_DEFINE_END, - - /* Keying Set - "Scaling" ---------- */ - BI_KS_DEFINE_BEGIN("Scaling", 0) - BI_KS_PATHS_BEGIN(1) - BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "scale", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM) - BI_KS_PATHS_END - BI_KS_DEFINE_END, - - /* Compound Keying Sets *********************************** */ - /* Keying Set - "LocRot" ---------- */ - BI_KS_DEFINE_BEGIN("LocRot", 0) - BI_KS_PATHS_BEGIN(2) - BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "location", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM), - BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN|KSP_TEMPLATE_ROT, "rotation", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM) - BI_KS_PATHS_END - BI_KS_DEFINE_END, - - /* Keying Set - "LocRotScale" ---------- */ - BI_KS_DEFINE_BEGIN("LocRotScale", 0) - BI_KS_PATHS_BEGIN(3) - BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "location", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM), - BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN|KSP_TEMPLATE_ROT, "rotation", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM), - BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "scale", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM) - BI_KS_PATHS_END - BI_KS_DEFINE_END, - - /* Keying Sets with Keying Flags ************************* */ - /* Keying Set - "VisualLoc" ---------- */ - BI_KS_DEFINE_BEGIN("VisualLoc", INSERTKEY_MATRIX) - BI_KS_PATHS_BEGIN(1) - BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "location", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM) - BI_KS_PATHS_END - BI_KS_DEFINE_END, - - /* Keying Set - "Rotation" ---------- */ - BI_KS_DEFINE_BEGIN("VisualRot", INSERTKEY_MATRIX) - BI_KS_PATHS_BEGIN(1) - BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN|KSP_TEMPLATE_ROT, "rotation", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM) - BI_KS_PATHS_END - BI_KS_DEFINE_END, - - /* Keying Set - "VisualLocRot" ---------- */ - BI_KS_DEFINE_BEGIN("VisualLocRot", INSERTKEY_MATRIX) - BI_KS_PATHS_BEGIN(2) - BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "location", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM), - BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN|KSP_TEMPLATE_ROT, "rotation", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM) - BI_KS_PATHS_END - BI_KS_DEFINE_END -}; - -/* All Builtin KeyingSets ------------------------ */ - -/* total number of builtin KeyingSet contexts */ -#define MAX_BKSC_TYPES 1 - -/* array containing all the available builtin KeyingSets definition sets - * - size of this is MAX_BKSC_TYPES+1 so that we don't smash the stack - */ -static bBuiltinKSContext def_builtin_keyingsets[MAX_BKSC_TYPES+1] = -{ - BKSC_TEMPLATE(v3d) - /* add more contexts above this line... */ -}; - - -/* ListBase of these KeyingSets chained up ready for usage - * NOTE: this is exported to keyframing.c for use... - */ +/* Built-In Keying Sets (referencing type infos)*/ ListBase builtin_keyingsets = {NULL, NULL}; -/* Utility API ------------------------ */ +/* --------------- */ -/* Link up all of the builtin Keying Sets when starting up Blender - * This is called from WM_init() in wm_init_exit.c - */ -void init_builtin_keyingsets (void) +/* Find KeyingSet type info given a name */ +KeyingSetInfo *ANIM_keyingset_info_find_named (const char name[]) { - bBuiltinKSContext *bksc; - bBuiltinKeyingSet *bks; - int bksc_i, bks_i; + KeyingSetInfo *ksi; - /* loop over all the sets of KeyingSets, setting them up, and chaining them to the builtins list */ - for (bksc_i= 0, bksc= &def_builtin_keyingsets[0]; bksc_i < MAX_BKSC_TYPES; bksc_i++, bksc++) - { - /* for each set definitions for a builtin KeyingSet, chain the paths to that KeyingSet and add */ - for (bks_i= 0, bks= bksc->bks; bks_i < bksc->tot; bks_i++, bks++) - { - KeyingSet *ks= &bks->ks; - KS_Path *ksp; - int pIndex; - - /* loop over paths, linking them to the KeyingSet and each other */ - for (pIndex= 0, ksp= &bks->paths[0]; pIndex < bks->tot; pIndex++, ksp++) - BLI_addtail(&ks->paths, ksp); - - /* add KeyingSet to builtin sets list */ - BLI_addtail(&builtin_keyingsets, ks); - } + /* sanity checks */ + if ((name == NULL) || (name[0] == 0)) + return NULL; + + /* search by comparing names */ + for (ksi = keyingset_type_infos.first; ksi; ksi = ksi->next) { + if (strcmp(ksi->name, name) == 0) + return ksi; } + + /* no matches found */ + return NULL; } - -/* Get the first builtin KeyingSet with the given name, which occurs after the given one (or start of list if none given) */ -KeyingSet *ANIM_builtin_keyingset_get_named (KeyingSet *prevKS, char name[]) +/* Find builtin KeyingSet by name */ +KeyingSet *ANIM_builtin_keyingset_get_named (KeyingSet *prevKS, const char name[]) { KeyingSet *ks, *first=NULL; - /* sanity checks - any name to check? */ + /* sanity checks any name to check? */ if (name[0] == 0) return NULL; @@ -1124,6 +516,81 @@ KeyingSet *ANIM_builtin_keyingset_get_named (KeyingSet *prevKS, char name[]) return NULL; } +/* --------------- */ + +/* Add the given KeyingSetInfo to the list of type infos, and create an appropriate builtin set too */ +void ANIM_keyingset_info_register (const bContext *C, KeyingSetInfo *ksi) +{ + Scene *scene = CTX_data_scene(C); + ListBase *list = NULL; + KeyingSet *ks; + + /* determine the KeyingSet list to include the new KeyingSet in */ + if (ksi->builtin) + list = &builtin_keyingsets; + else + list = &scene->keyingsets; + + /* create a new KeyingSet + * - inherit name and keyframing settings from the typeinfo + */ + ks = BKE_keyingset_add(list, ksi->name, ksi->builtin, ksi->keyingflag); + + /* link this KeyingSet with its typeinfo */ + memcpy(&ks->typeinfo, ksi->name, sizeof(ks->typeinfo)); + + /* add type-info to the list */ + BLI_addtail(&keyingset_type_infos, ksi); +} + +/* Remove the given KeyingSetInfo from the list of type infos, and also remove the builtin set if appropriate */ +void ANIM_keyingset_info_unregister (const bContext *C, KeyingSetInfo *ksi) +{ + Scene *scene = CTX_data_scene(C); + KeyingSet *ks, *ksn; + + /* find relevant scene KeyingSets which use this, and remove them */ + for (ks= scene->keyingsets.first; ks; ks= ksn) { + ksn = ks->next; + + /* remove if matching typeinfo name */ + if (strcmp(ks->typeinfo, ksi->name) == 0) { + BKE_keyingset_free(ks); + BLI_freelinkN(&scene->keyingsets, ks); + } + } + + /* do the same with builtin sets? */ + // TODO: this isn't done now, since unregister is really only used atm when we + // reload the scripts, which kindof defeats the purpose of "builtin"? + + + /* free the type info */ + BLI_freelinkN(&keyingset_type_infos, ksi); +} + +/* --------------- */ + +void ANIM_keyingset_infos_exit () +{ + KeyingSetInfo *ksi, *next; + + /* free type infos */ + for (ksi=keyingset_type_infos.first; ksi; ksi=next) { + next= ksi->next; + + /* free extra RNA data, and remove from list */ + if (ksi->ext.free) + ksi->ext.free(ksi->ext.data); + BLI_freelinkN(&keyingset_type_infos, ksi); + } + + /* free builtin sets */ + BKE_keyingsets_free(&builtin_keyingsets); +} + +/* ******************************************* */ +/* KEYING SETS API (for UI) */ /* Get the active Keying Set for the Scene provided */ KeyingSet *ANIM_scene_get_active_keyingset (Scene *scene) @@ -1142,127 +609,74 @@ KeyingSet *ANIM_scene_get_active_keyingset (Scene *scene) return NULL; } -/* ******************************************* */ -/* KEYFRAME MODIFICATION */ - -/* KeyingSet Menu Helpers ------------ */ - -/* Extract the maximum set of requirements from the KeyingSet */ -static int keyingset_relative_get_templates (KeyingSet *ks) +/* Check if KeyingSet can be used in the current context */ +short ANIM_keyingset_context_ok_poll (bContext *C, KeyingSet *ks) { - KS_Path *ksp; - int templates= 0; - - /* loop over the paths (could be slow to do for a number of KeyingSets)? */ - for (ksp= ks->paths.first; ksp; ksp= ksp->next) { - /* add the destination's templates to the set of templates required for the set */ - templates |= ksp->templates; + if ((ks->flag & KEYINGSET_ABSOLUTE) == 0) { + KeyingSetInfo *ksi = ANIM_keyingset_info_find_named(ks->typeinfo); + + /* get the associated 'type info' for this KeyingSet */ + if (ksi == NULL) + return 0; + // TODO: check for missing callbacks! + + /* check if it can be used in the current context */ + return (ksi->poll(ksi, C)); } - return templates; -} - -/* Check if context data is suitable for the given Keying Set */ -short keyingset_context_ok_poll (bContext *C, KeyingSet *ks) -{ - // TODO: - // For 'relative' keyingsets (i.e. py-keyingsets), add a call here - // which basically gets a listing of all the paths to be used for this - // set. - - return 1; } -/* KeyingSet Context Operations ------------ */ +/* ******************************************* */ +/* KEYFRAME MODIFICATION */ -/* Get list of data-sources from context (in 3D-View) for inserting keyframes using the given relative Keying Set */ -static short modifykey_get_context_v3d_data (bContext *C, ListBase *dsources, KeyingSet *ks) +/* Special 'Overrides' Iterator for Relative KeyingSets ------ */ + +/* 'Data Sources' for relative Keying Set 'overrides' + * - this is basically a wrapper for PointerRNA's in a linked list + * - do not allow this to be accessed from outside for now + */ +typedef struct tRKS_DSource { + struct tRKS_DSource *next, *prev; + PointerRNA ptr; /* the whole point of this exercise! */ +} tRKS_DSource; + + +/* Iterator used for overriding the behaviour of iterators defined for + * relative Keying Sets, with the main usage of this being operators + * requiring Auto Keyframing. Internal Use Only! + */ +static void RKS_ITER_overrides_list (KeyingSetInfo *ksi, bContext *C, KeyingSet *ks, ListBase *dsources) { - bCommonKeySrc *cks; - Object *obact= CTX_data_active_object(C); - int templates; - short ok= 0; + tRKS_DSource *ds; - /* get the templates in use in this KeyingSet which we should supply data for */ - templates = keyingset_relative_get_templates(ks); - - /* check if the active object is in PoseMode (i.e. only deal with bones) */ - // TODO: check with the templates to see what we really need to store - if ((obact && obact->pose) && (obact->mode & OB_MODE_POSE)) { - /* Pose Mode: Selected bones */ -#if 0 - //set_pose_keys(ob); /* sets pchan->flag to POSE_KEY if bone selected, and clears if not */ - - /* loop through posechannels */ - //for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) { - // if (pchan->flag & POSE_KEY) { - // } - //} -#endif - - CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones) - { - /* add a new keying-source */ - cks= MEM_callocN(sizeof(bCommonKeySrc), "bCommonKeySrc"); - BLI_addtail(dsources, cks); - - /* set necessary info */ - cks->id= &obact->id; - cks->pchan= pchan; - - if (templates & KSP_TEMPLATE_CONSTRAINT) - cks->con= constraints_get_active(&pchan->constraints); - - ok= 1; - } - CTX_DATA_END; + for (ds = dsources->first; ds; ds = ds->next) { + /* run generate callback on this data */ + ksi->generate(ksi, C, ks, &ds->ptr); } - else { - /* Object Mode: Selected objects */ - CTX_DATA_BEGIN(C, Object*, ob, selected_objects) - { - /* add a new keying-source */ - cks= MEM_callocN(sizeof(bCommonKeySrc), "bCommonKeySrc"); - BLI_addtail(dsources, cks); - - /* set necessary info */ - cks->id= &ob->id; - - if (templates & KSP_TEMPLATE_CONSTRAINT) - cks->con= constraints_get_active(&ob->constraints); - - ok= 1; - } - CTX_DATA_END; - } - - /* return whether any data was extracted */ - return ok; } -/* Get list of data-sources from context for inserting keyframes using the given relative Keying Set */ -short modifykey_get_context_data (bContext *C, ListBase *dsources, KeyingSet *ks) +/* Add new data source for relative Keying Sets */ +void ANIM_relative_keyingset_add_source (ListBase *dsources, ID *id, StructRNA *srna, void *data) { - ScrArea *sa= CTX_wm_area(C); + tRKS_DSource *ds; - /* for now, the active area is used to determine what set of contexts apply */ - if (sa == NULL) - return 0; + /* sanity checks + * we must have at least one valid data pointer to use + */ + if (ELEM(NULL, dsources, srna) || ((id == data) && (id == NULL))) + return; -#if 0 - switch (sa->spacetype) { - case SPACE_VIEW3D: /* 3D-View: Selected Objects or Bones */ - return modifykey_get_context_v3d_data(C, dsources, ks); - } + /* allocate new elem, and add to the list */ + ds = MEM_callocN(sizeof(tRKS_DSource), "tRKS_DSource"); + BLI_addtail(dsources, ds); - /* nothing happened */ - return 0; -#endif - - /* looking into this code, it doesnt use the 3D view - Campbell */ - return modifykey_get_context_v3d_data(C, dsources, ks); -} + /* depending on what data we have, create using ID or full pointer call */ + if (srna && data) + RNA_pointer_create(id, srna, data, &ds->ptr); + else + RNA_id_pointer_create(id, &ds->ptr); +} /* KeyingSet Operations (Insert/Delete Keyframes) ------------ */ @@ -1270,8 +684,9 @@ short modifykey_get_context_data (bContext *C, ListBase *dsources, KeyingSet *ks * by the KeyingSet. This takes into account many of the different combinations of using KeyingSets. * Returns the number of channels that keyframes were added to */ -int modify_keyframes (Scene *scene, ListBase *dsources, bAction *act, KeyingSet *ks, short mode, float cfra) +int ANIM_apply_keyingset (bContext *C, ListBase *dsources, bAction *act, KeyingSet *ks, short mode, float cfra) { + Scene *scene= CTX_data_scene(C); KS_Path *ksp; int kflag=0, success= 0; char *groupname= NULL; @@ -1291,201 +706,101 @@ int modify_keyframes (Scene *scene, ListBase *dsources, bAction *act, KeyingSet else if (mode == MODIFYKEY_MODE_DELETE) kflag= 0; - /* check if the KeyingSet is absolute or not (i.e. does it requires sources info) */ - if (ks->flag & KEYINGSET_ABSOLUTE) { - /* Absolute KeyingSets are simpler to use, as all the destination info has already been - * provided by the user, and is stored, ready to use, in the KeyingSet paths. + /* if relative Keying Sets, poll and build up the paths */ + if ((ks->flag & KEYINGSET_ABSOLUTE) == 0) { + KeyingSetInfo *ksi = ANIM_keyingset_info_find_named(ks->typeinfo); + + /* clear all existing paths + * NOTE: BKE_keyingset_free() frees all of the paths for the KeyingSet, but not the set itself */ - for (ksp= ks->paths.first; ksp; ksp= ksp->next) { - int arraylen, i; - - /* get pointer to name of group to add channels to */ - if (ksp->groupmode == KSP_GROUP_NONE) - groupname= NULL; - else if (ksp->groupmode == KSP_GROUP_KSNAME) - groupname= ks->name; + BKE_keyingset_free(ks); + + /* get the associated 'type info' for this KeyingSet */ + if (ksi == NULL) + return MODIFYKEY_MISSING_TYPEINFO; + // TODO: check for missing callbacks! + + /* check if it can be used in the current context */ + if (ksi->poll(ksi, C)) { + /* if a list of data sources are provided, run a special iterator over them, + * otherwise, just continue per normal + */ + if (dsources) + RKS_ITER_overrides_list(ksi, C, ks, dsources); else - groupname= ksp->group; - - /* init arraylen and i - arraylen should be greater than i so that - * normal non-array entries get keyframed correctly - */ - i= ksp->array_index; - arraylen= i; - - /* get length of array if whole array option is enabled */ - if (ksp->flag & KSP_FLAG_WHOLE_ARRAY) { - PointerRNA id_ptr, ptr; - PropertyRNA *prop; + ksi->iter(ksi, C, ks); - RNA_id_pointer_create(ksp->id, &id_ptr); - if (RNA_path_resolve(&id_ptr, ksp->rna_path, &ptr, &prop) && prop) - arraylen= RNA_property_array_length(&ptr, prop); - } - - /* we should do at least one step */ - if (arraylen == i) - arraylen++; - - /* for each possible index, perform operation - * - assume that arraylen is greater than index - */ - for (; i < arraylen; i++) { - /* action to take depends on mode */ - if (mode == MODIFYKEY_MODE_INSERT) - success += insert_keyframe(ksp->id, act, groupname, ksp->rna_path, i, cfra, kflag); - else if (mode == MODIFYKEY_MODE_DELETE) - success += delete_keyframe(ksp->id, act, groupname, ksp->rna_path, i, cfra, kflag); - } - - /* set recalc-flags */ - if (ksp->id) { - switch (GS(ksp->id->name)) { - case ID_OB: /* Object (or Object-Related) Keyframes */ - { - Object *ob= (Object *)ksp->id; - - ob->recalc |= OB_RECALC; - } - break; - } - - /* send notifiers for updates (this doesn't require context to work!) */ - WM_main_add_notifier(NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); - } + /* if we don't have any paths now, then this still qualifies as invalid context */ + if (ks->paths.first == NULL) + return MODIFYKEY_INVALID_CONTEXT; + } + else { + /* poll callback tells us that KeyingSet is useless in current context */ + return MODIFYKEY_INVALID_CONTEXT; } } - else if (dsources && dsources->first) { - /* for each one of the 'sources', resolve the template markers and expand arrays, then insert keyframes */ - bCommonKeySrc *cks; + + /* apply the paths as specified in the KeyingSet now */ + for (ksp= ks->paths.first; ksp; ksp= ksp->next) { + int arraylen, i; + short kflag2; - /* for each 'source' for keyframe data, resolve each of the paths from the KeyingSet */ - for (cks= dsources->first; cks; cks= cks->next) { - /* for each path in KeyingSet, construct a path using the templates */ - for (ksp= ks->paths.first; ksp; ksp= ksp->next) { - DynStr *pathds= BLI_dynstr_new(); - char *path = NULL; - int arraylen, i; - - /* set initial group name */ - if (cks->id == NULL) { - printf("ERROR: Skipping 'Common-Key' Source. No valid ID present.\n"); - continue; - } - else - groupname= cks->id->name+2; - - /* construct the path */ - // FIXME: this currently only works with a few hardcoded cases - if ((ksp->templates & KSP_TEMPLATE_PCHAN) && (cks->pchan)) { - /* add basic pose-channel path access */ - BLI_dynstr_append(pathds, "pose.bones[\""); - BLI_dynstr_append(pathds, cks->pchan->name); - BLI_dynstr_append(pathds, "\"]"); - - /* override default group name */ - groupname= cks->pchan->name; - } - if ((ksp->templates & KSP_TEMPLATE_CONSTRAINT) && (cks->con)) { - /* add basic constraint path access */ - BLI_dynstr_append(pathds, "constraints[\""); - BLI_dynstr_append(pathds, cks->con->name); - BLI_dynstr_append(pathds, "\"]"); - - /* override default group name */ - groupname= cks->con->name; - } + /* since keying settings can be defined on the paths too, extend the path before using it */ + kflag2 = (kflag | ksp->keyingflag); + + /* get pointer to name of group to add channels to */ + if (ksp->groupmode == KSP_GROUP_NONE) + groupname= NULL; + else if (ksp->groupmode == KSP_GROUP_KSNAME) + groupname= ks->name; + else + groupname= ksp->group; + + /* init arraylen and i - arraylen should be greater than i so that + * normal non-array entries get keyframed correctly + */ + i= ksp->array_index; + arraylen= i; + + /* get length of array if whole array option is enabled */ + if (ksp->flag & KSP_FLAG_WHOLE_ARRAY) { + PointerRNA id_ptr, ptr; + PropertyRNA *prop; + + RNA_id_pointer_create(ksp->id, &id_ptr); + if (RNA_path_resolve(&id_ptr, ksp->rna_path, &ptr, &prop) && prop) + arraylen= RNA_property_array_length(&ptr, prop); + } + + /* we should do at least one step */ + if (arraylen == i) + arraylen++; + + /* for each possible index, perform operation + * - assume that arraylen is greater than index + */ + for (; i < arraylen; i++) { + /* action to take depends on mode */ + if (mode == MODIFYKEY_MODE_INSERT) + success += insert_keyframe(ksp->id, act, groupname, ksp->rna_path, i, cfra, kflag2); + else if (mode == MODIFYKEY_MODE_DELETE) + success += delete_keyframe(ksp->id, act, groupname, ksp->rna_path, i, cfra, kflag2); + } + + /* set recalc-flags */ + if (ksp->id) { + switch (GS(ksp->id->name)) { + case ID_OB: /* Object (or Object-Related) Keyframes */ { - /* add property stored in KeyingSet Path */ - if (BLI_dynstr_get_len(pathds)) - BLI_dynstr_append(pathds, "."); - - /* apply some further templates? */ - if (ksp->templates & KSP_TEMPLATE_ROT) { - /* for builtin Keying Sets, this template makes the best fitting path for the - * current rotation mode of the Object / PoseChannel to be used - */ - if (strcmp(ksp->rna_path, "rotation")==0) { - /* get rotation mode */ - short rotmode= (cks->pchan)? (cks->pchan->rotmode) : - (GS(cks->id->name)==ID_OB)? ( ((Object *)cks->id)->rotmode ) : - (0); - - /* determine path to build */ - if (rotmode == ROT_MODE_QUAT) - BLI_dynstr_append(pathds, "rotation_quaternion"); - else if (rotmode == ROT_MODE_AXISANGLE) - BLI_dynstr_append(pathds, "rotation_axis_angle"); - else - BLI_dynstr_append(pathds, "rotation_euler"); - } - } - else { - /* just directly use the path */ - BLI_dynstr_append(pathds, ksp->rna_path); - } + Object *ob= (Object *)ksp->id; - /* convert to C-string */ - path= BLI_dynstr_get_cstring(pathds); - BLI_dynstr_free(pathds); + ob->recalc |= OB_RECALC; } - - /* get pointer to name of group to add channels to - * - KSP_GROUP_TEMPLATE_ITEM is handled above while constructing the paths - */ - if (ksp->groupmode == KSP_GROUP_NONE) - groupname= NULL; - else if (ksp->groupmode == KSP_GROUP_KSNAME) - groupname= ks->name; - else if (ksp->groupmode == KSP_GROUP_NAMED) - groupname= ksp->group; - - /* init arraylen and i - arraylen should be greater than i so that - * normal non-array entries get keyframed correctly - */ - i= ksp->array_index; - arraylen= i+1; - - /* get length of array if whole array option is enabled */ - if (ksp->flag & KSP_FLAG_WHOLE_ARRAY) { - PointerRNA id_ptr, ptr; - PropertyRNA *prop; - - RNA_id_pointer_create(cks->id, &id_ptr); - if (RNA_path_resolve(&id_ptr, path, &ptr, &prop) && prop) - arraylen= RNA_property_array_length(&ptr, prop); - } - - /* for each possible index, perform operation - * - assume that arraylen is greater than index - */ - for (; i < arraylen; i++) { - /* action to take depends on mode */ - if (mode == MODIFYKEY_MODE_INSERT) - success+= insert_keyframe(cks->id, act, groupname, path, i, cfra, kflag); - else if (mode == MODIFYKEY_MODE_DELETE) - success+= delete_keyframe(cks->id, act, groupname, path, i, cfra, kflag); - } - - /* free the path */ - MEM_freeN(path); + break; } - /* set recalc-flags */ - if (cks->id) { - switch (GS(cks->id->name)) { - case ID_OB: /* Object (or Object-Related) Keyframes */ - { - Object *ob= (Object *)cks->id; - - ob->recalc |= OB_RECALC; - } - break; - } - - /* send notifiers for updates (this doesn't require context to work!) */ - WM_main_add_notifier(NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); - } + /* send notifiers for updates (this doesn't require context to work!) */ + WM_main_add_notifier(NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } } diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 4a3ef38daa6..3f26a146c53 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -4867,12 +4867,7 @@ static int pose_clear_scale_exec(bContext *C, wmOperator *op) Object *ob= CTX_data_active_object(C); KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "Scaling"); - bCommonKeySrc cks; - ListBase dsources = {&cks, &cks}; - - /* init common-key-source for use by KeyingSets */ - memset(&cks, 0, sizeof(bCommonKeySrc)); - cks.id= &ob->id; + short autokey = 0; /* only clear those channels that are not locked */ CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones) { @@ -4885,13 +4880,12 @@ static int pose_clear_scale_exec(bContext *C, wmOperator *op) /* do auto-keyframing as appropriate */ if (autokeyframe_cfra_can_key(scene, &ob->id)) { - /* init cks for this PoseChannel, then use the relative KeyingSets to keyframe it */ - cks.pchan= pchan; - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); - /* clear any unkeyed tags */ if (pchan->bone) pchan->bone->flag &= ~BONE_UNKEYED; + + /* tag for autokeying later */ + autokey = 1; } else { /* add unkeyed tags */ @@ -4901,6 +4895,16 @@ static int pose_clear_scale_exec(bContext *C, wmOperator *op) } CTX_DATA_END; + /* perform autokeying on the bones if needed */ + if (autokey) { + /* insert keyframes */ + ANIM_apply_keyingset(C, NULL, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); + + /* now recalculate paths */ + if ((ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS)) + ED_pose_recalculate_paths(C, scene, ob); + } + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* note, notifier might evolve */ @@ -4930,12 +4934,7 @@ static int pose_clear_loc_exec(bContext *C, wmOperator *op) Object *ob= CTX_data_active_object(C); KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "Location"); - bCommonKeySrc cks; - ListBase dsources = {&cks, &cks}; - - /* init common-key-source for use by KeyingSets */ - memset(&cks, 0, sizeof(bCommonKeySrc)); - cks.id= &ob->id; + short autokey = 0; /* only clear those channels that are not locked */ CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones) { @@ -4949,13 +4948,12 @@ static int pose_clear_loc_exec(bContext *C, wmOperator *op) /* do auto-keyframing as appropriate */ if (autokeyframe_cfra_can_key(scene, &ob->id)) { - /* init cks for this PoseChannel, then use the relative KeyingSets to keyframe it */ - cks.pchan= pchan; - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); - /* clear any unkeyed tags */ if (pchan->bone) pchan->bone->flag &= ~BONE_UNKEYED; + + /* tag for autokeying later */ + autokey = 1; } else { /* add unkeyed tags */ @@ -4965,6 +4963,16 @@ static int pose_clear_loc_exec(bContext *C, wmOperator *op) } CTX_DATA_END; + /* perform autokeying on the bones if needed */ + if (autokey) { + /* insert keyframes */ + ANIM_apply_keyingset(C, NULL, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); + + /* now recalculate paths */ + if ((ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS)) + ED_pose_recalculate_paths(C, scene, ob); + } + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* note, notifier might evolve */ @@ -4994,12 +5002,7 @@ static int pose_clear_rot_exec(bContext *C, wmOperator *op) Object *ob= CTX_data_active_object(C); KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "Rotation"); - bCommonKeySrc cks; - ListBase dsources = {&cks, &cks}; - - /* init common-key-source for use by KeyingSets */ - memset(&cks, 0, sizeof(bCommonKeySrc)); - cks.id= &ob->id; + short autokey = 0; /* only clear those channels that are not locked */ CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones) { @@ -5097,13 +5100,12 @@ static int pose_clear_rot_exec(bContext *C, wmOperator *op) /* do auto-keyframing as appropriate */ if (autokeyframe_cfra_can_key(scene, &ob->id)) { - /* init cks for this PoseChannel, then use the relative KeyingSets to keyframe it */ - cks.pchan= pchan; - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); - /* clear any unkeyed tags */ if (pchan->bone) pchan->bone->flag &= ~BONE_UNKEYED; + + /* tag for autokeying later */ + autokey = 1; } else { /* add unkeyed tags */ @@ -5113,6 +5115,16 @@ static int pose_clear_rot_exec(bContext *C, wmOperator *op) } CTX_DATA_END; + /* perform autokeying on the bones if needed */ + if (autokey) { + /* insert keyframes */ + ANIM_apply_keyingset(C, NULL, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); + + /* now recalculate paths */ + if ((ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS)) + ED_pose_recalculate_paths(C, scene, ob); + } + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* note, notifier might evolve */ diff --git a/source/blender/editors/armature/poseUtils.c b/source/blender/editors/armature/poseUtils.c index e2fc2bd4088..ecc84aaf4bb 100644 --- a/source/blender/editors/armature/poseUtils.c +++ b/source/blender/editors/armature/poseUtils.c @@ -229,27 +229,28 @@ void poseAnim_mapping_autoKeyframe (bContext *C, Scene *scene, Object *ob, ListB /* insert keyframes as necessary if autokeyframing */ if (autokeyframe_cfra_can_key(scene, &ob->id)) { - bCommonKeySrc cks; - ListBase dsources = {&cks, &cks}; tPChanFCurveLink *pfl; - /* init common-key-source for use by KeyingSets */ - memset(&cks, 0, sizeof(bCommonKeySrc)); - cks.id= &ob->id; - /* iterate over each pose-channel affected, applying the changes */ for (pfl= pfLinks->first; pfl; pfl= pfl->next) { + ListBase dsources = {NULL, NULL}; bPoseChannel *pchan= pfl->pchan; - /* init cks for this PoseChannel, then use the relative KeyingSets to keyframe it */ - cks.pchan= pchan; - /* insert keyframes */ + /* add datasource override for the PoseChannel so KeyingSet will do right thing */ + ANIM_relative_keyingset_add_source(&dsources, &ob->id, &RNA_PoseBone, pchan); + + /* insert keyframes + * - these keyingsets here use dsources, since we need to specify exactly which keyframes get affected + */ if (pchan->flag & POSE_LOC) - modify_keyframes(scene, &dsources, NULL, ks_loc, MODIFYKEY_MODE_INSERT, cframe); + ANIM_apply_keyingset(C, &dsources, NULL, ks_loc, MODIFYKEY_MODE_INSERT, cframe); if (pchan->flag & POSE_ROT) - modify_keyframes(scene, &dsources, NULL, ks_rot, MODIFYKEY_MODE_INSERT, cframe); + ANIM_apply_keyingset(C, &dsources, NULL, ks_rot, MODIFYKEY_MODE_INSERT, cframe); if (pchan->flag & POSE_SIZE) - modify_keyframes(scene, &dsources, NULL, ks_scale, MODIFYKEY_MODE_INSERT, cframe); + ANIM_apply_keyingset(C, &dsources, NULL, ks_scale, MODIFYKEY_MODE_INSERT, cframe); + + /* free the temp info */ + BLI_freelistN(&dsources); } } } diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index 02194035ee9..8d38d0530ce 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -331,19 +331,14 @@ static int poselib_add_menu_invoke (bContext *C, wmOperator *op, wmEvent *evt) static int poselib_add_exec (bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); bAction *act = poselib_validate(ob); bArmature *arm= (ob) ? ob->data : NULL; bPose *pose= (ob) ? ob->pose : NULL; - bPoseChannel *pchan; TimeMarker *marker; int frame= RNA_int_get(op->ptr, "frame"); char name[64]; - bCommonKeySrc cks; - ListBase dsources = {&cks, &cks}; - /* sanity check (invoke should have checked this anyway) */ if (ELEM3(NULL, ob, arm, pose)) return OPERATOR_CANCELLED; @@ -373,25 +368,12 @@ static int poselib_add_exec (bContext *C, wmOperator *op) /* validate name */ BLI_uniquename(&act->markers, marker, "Pose", '.', offsetof(TimeMarker, name), sizeof(marker->name)); - /* init common-key-source for use by KeyingSets */ - memset(&cks, 0, sizeof(bCommonKeySrc)); - cks.id= &ob->id; - - /* loop through selected posechannels, keying their pose to the action */ - for (pchan= pose->chanbase.first; pchan; pchan= pchan->next) { - /* check if available */ - if ((pchan->bone) && (arm->layer & pchan->bone->layer)) { - if (pchan->bone->flag & BONE_SELECTED || pchan->bone==arm->act_bone) { - /* init cks for this PoseChannel, then use the relative KeyingSets to keyframe it */ - cks.pchan= pchan; - - /* KeyingSet to use depends on rotation mode (but that's handled by the templates code) */ - if (poselib_ks_locrotscale == NULL) - poselib_ks_locrotscale= ANIM_builtin_keyingset_get_named(NULL, "LocRotScale"); - modify_keyframes(scene, &dsources, act, poselib_ks_locrotscale, MODIFYKEY_MODE_INSERT, (float)frame); - } - } - } + /* KeyingSet to use depends on rotation mode (but that's handled by the templates code) */ + if (poselib_ks_locrotscale == NULL) + poselib_ks_locrotscale= ANIM_builtin_keyingset_get_named(NULL, "LocRotScale"); + + /* make the keyingset use context info to determine where to add keyframes */ + ANIM_apply_keyingset(C, NULL, act, poselib_ks_locrotscale, MODIFYKEY_MODE_INSERT, (float)frame); /* store new 'active' pose number */ act->active_marker= BLI_countlist(&act->markers); @@ -784,13 +766,6 @@ static void poselib_keytag_pose (bContext *C, Scene *scene, tPoseLib_PreviewData bAction *act= pld->act; bActionGroup *agrp; - bCommonKeySrc cks; - ListBase dsources = {&cks, &cks}; - - /* init common-key-source for use by KeyingSets */ - memset(&cks, 0, sizeof(bCommonKeySrc)); - cks.id= &pld->ob->id; - /* start tagging/keying */ for (agrp= act->groups.first; agrp; agrp= agrp->next) { /* only for selected action channels */ @@ -798,21 +773,23 @@ static void poselib_keytag_pose (bContext *C, Scene *scene, tPoseLib_PreviewData pchan= get_pose_channel(pose, agrp->name); if (pchan) { - // TODO: use a standard autokeying function in future (to allow autokeying-editkeys to work) - if (IS_AUTOKEY_MODE(scene, NORMAL)) { - /* Set keys on pose - * - KeyingSet to use depends on rotation mode - * (but that's handled by the templates code) - */ + if (autokeyframe_cfra_can_key(scene, &pld->ob->id)) { + ListBase dsources = {NULL, NULL}; + + /* get KeyingSet to use */ // TODO: for getting the KeyingSet used, we should really check which channels were affected + // TODO: this should get modified so that custom props are taken into account too! if (poselib_ks_locrotscale == NULL) poselib_ks_locrotscale= ANIM_builtin_keyingset_get_named(NULL, "LocRotScale"); - /* init cks for this PoseChannel, then use the relative KeyingSets to keyframe it */ - cks.pchan= pchan; - - /* now insert the keyframe */ - modify_keyframes(scene, &dsources, NULL, poselib_ks_locrotscale, MODIFYKEY_MODE_INSERT, (float)CFRA); + /* now insert the keyframe(s) using the Keying Set + * 1) add datasource override for the PoseChannel + * 2) insert keyframes + * 3) free the extra info + */ + ANIM_relative_keyingset_add_source(&dsources, &pld->ob->id, &RNA_PoseBone, pchan); + ANIM_apply_keyingset(C, &dsources, NULL, poselib_ks_locrotscale, MODIFYKEY_MODE_INSERT, (float)CFRA); + BLI_freelistN(&dsources); /* clear any unkeyed tags */ if (pchan->bone) diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index a162c8eb21a..f20c79da17e 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -849,14 +849,14 @@ void free_posebuf(void) { if (g_posebuf) { bPoseChannel *pchan; - + for (pchan= g_posebuf->chanbase.first; pchan; pchan= pchan->next) { if(pchan->prop) { IDP_FreeProperty(pchan->prop); MEM_freeN(pchan->prop); } } - + /* was copied without constraints */ BLI_freelistN(&g_posebuf->chanbase); MEM_freeN(g_posebuf); @@ -908,9 +908,6 @@ void POSE_OT_copy (wmOperatorType *ot) /* Pointers to the builtin KeyingSets that we want to use */ static KeyingSet *posePaste_ks_locrotscale = NULL; /* the only keyingset we'll need */ -/* transform.h */ -extern void autokeyframe_pose_cb_func(struct bContext *C, struct Scene *scene, struct View3D *v3d, struct Object *ob, int tmode, short targetless_ik); - static int pose_paste_exec (bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); @@ -919,13 +916,6 @@ static int pose_paste_exec (bContext *C, wmOperator *op) char name[32]; int flip= RNA_boolean_get(op->ptr, "flipped"); - bCommonKeySrc cks; - ListBase dsources = {&cks, &cks}; - - /* init common-key-source for use by KeyingSets */ - memset(&cks, 0, sizeof(bCommonKeySrc)); - cks.id= &ob->id; - /* sanity checks */ if ELEM(NULL, ob, ob->pose) return OPERATOR_CANCELLED; @@ -974,14 +964,14 @@ static int pose_paste_exec (bContext *C, wmOperator *op) else if (pchan->rotmode == ROT_MODE_AXISANGLE) { /* quat/euler to axis angle */ if (chan->rotmode > 0) - eulO_to_axis_angle( pchan->rotAxis, &pchan->rotAngle,chan->eul, chan->rotmode); + eulO_to_axis_angle(pchan->rotAxis, &pchan->rotAngle, chan->eul, chan->rotmode); else - quat_to_axis_angle( pchan->rotAxis, &pchan->rotAngle,chan->quat); + quat_to_axis_angle(pchan->rotAxis, &pchan->rotAngle, chan->quat); } else { /* euler/axis-angle to quat */ if (chan->rotmode > 0) - eulO_to_quat( pchan->quat,chan->eul, chan->rotmode); + eulO_to_quat(pchan->quat, chan->eul, chan->rotmode); else axis_angle_to_quat(pchan->quat, chan->rotAxis, pchan->rotAngle); } @@ -998,10 +988,10 @@ static int pose_paste_exec (bContext *C, wmOperator *op) else if (pchan->rotmode == ROT_MODE_AXISANGLE) { float eul[3]; - axis_angle_to_eulO( eul, EULER_ORDER_DEFAULT,pchan->rotAxis, pchan->rotAngle); + axis_angle_to_eulO(eul, EULER_ORDER_DEFAULT, pchan->rotAxis, pchan->rotAngle); eul[1]*= -1; eul[2]*= -1; - eulO_to_axis_angle( pchan->rotAxis, &pchan->rotAngle,eul, EULER_ORDER_DEFAULT); + eulO_to_axis_angle(pchan->rotAxis, &pchan->rotAngle, eul, EULER_ORDER_DEFAULT); // experimental method (uncomment to test): #if 0 @@ -1013,62 +1003,55 @@ static int pose_paste_exec (bContext *C, wmOperator *op) else { float eul[3]; - quat_to_eul( eul,pchan->quat); + quat_to_eul(eul, pchan->quat); eul[1]*= -1; eul[2]*= -1; - eul_to_quat( pchan->quat,eul); + eul_to_quat(pchan->quat, eul); } } /* ID property */ - if(pchan->prop) { + if (pchan->prop) { IDP_FreeProperty(pchan->prop); MEM_freeN(pchan->prop); pchan->prop= NULL; } - - if(chan->prop) { + + if (chan->prop) pchan->prop= IDP_CopyProperty(chan->prop); + + /* keyframing tagging */ + if (autokeyframe_cfra_can_key(scene, &ob->id)) { + ListBase dsources = {NULL, NULL}; + + /* get KeyingSet to use */ + // TODO: for getting the KeyingSet used, we should really check which channels were affected + // TODO: this should get modified so that custom props are taken into account too! + if (posePaste_ks_locrotscale == NULL) + posePaste_ks_locrotscale= ANIM_builtin_keyingset_get_named(NULL, "LocRotScale"); + + /* now insert the keyframe(s) using the Keying Set + * 1) add datasource override for the PoseChannel + * 2) insert keyframes + * 3) free the extra info + */ + ANIM_relative_keyingset_add_source(&dsources, &ob->id, &RNA_PoseBone, pchan); + ANIM_apply_keyingset(C, &dsources, NULL, posePaste_ks_locrotscale, MODIFYKEY_MODE_INSERT, (float)CFRA); + BLI_freelistN(&dsources); + + /* clear any unkeyed tags */ + if (chan->bone) + chan->bone->flag &= ~BONE_UNKEYED; } - - /* auto key, TODO, fix up this INSERTAVAIL vs all other cases */ - if (IS_AUTOKEY_FLAG(INSERTAVAIL) == 0) { /* deal with this case later */ - if (autokeyframe_cfra_can_key(scene, &ob->id)) { - - /* Set keys on pose - * - KeyingSet to use depends on rotation mode - * (but that's handled by the templates code) - */ - // TODO: for getting the KeyingSet used, we should really check which channels were affected - if (posePaste_ks_locrotscale == NULL) - posePaste_ks_locrotscale= ANIM_builtin_keyingset_get_named(NULL, "LocRotScale"); - - /* init cks for this PoseChannel, then use the relative KeyingSets to keyframe it */ - cks.pchan= pchan; - - modify_keyframes(scene, &dsources, NULL, posePaste_ks_locrotscale, MODIFYKEY_MODE_INSERT, (float)CFRA); - - /* clear any unkeyed tags */ - if (chan->bone) - chan->bone->flag &= ~BONE_UNKEYED; - } - else { - /* add unkeyed tags */ - if (chan->bone) - chan->bone->flag |= BONE_UNKEYED; - } + else { + /* add unkeyed tags */ + if (chan->bone) + chan->bone->flag |= BONE_UNKEYED; } } } } - - if (IS_AUTOKEY_FLAG(INSERTAVAIL)) { - View3D *v3d= CTX_wm_view3d(C); - autokeyframe_pose_cb_func(C, scene, v3d, ob, TFM_TRANSLATION, 0); - autokeyframe_pose_cb_func(C, scene, v3d, ob, TFM_ROTATION, 0); - autokeyframe_pose_cb_func(C, scene, v3d, ob, TFM_TIME_SCALE, 0); - } - + /* Update event for pose and deformation children */ DAG_id_flush_update(&ob->id, OB_RECALC_DATA); @@ -1077,13 +1060,13 @@ static int pose_paste_exec (bContext *C, wmOperator *op) } else { /* need to trick depgraph, action is not allowed to execute on pose */ + // XXX: this is probably not an issue anymore where_is_pose(scene, ob); ob->recalc= 0; } /* notifiers for updates */ WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob); - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); // XXX not really needed, but here for completeness... return OPERATOR_FINISHED; } @@ -1754,13 +1737,7 @@ static int pose_flip_quats_exec (bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); - - bCommonKeySrc cks; - ListBase dsources = {&cks, &cks}; - - /* init common-key-source for use by KeyingSets */ - memset(&cks, 0, sizeof(bCommonKeySrc)); - cks.id= &ob->id; + KeyingSet *ks = ANIM_builtin_keyingset_get_named(NULL, "LocRotScale"); /* loop through all selected pchans, flipping and keying (as needed) */ CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones) @@ -1773,20 +1750,18 @@ static int pose_flip_quats_exec (bContext *C, wmOperator *op) pchan->quat[2]= -pchan->quat[2]; pchan->quat[3]= -pchan->quat[3]; - /* perform auto-keying - * NOTE: paths don't need recalculation here, since the orientations shouldn't have changed - */ + /* tagging */ if (autokeyframe_cfra_can_key(scene, &ob->id)) { - /* Set keys on pose - * - KeyingSet to use depends on rotation mode - * (but that's handled by the templates code) + ListBase dsources = {NULL, NULL}; + + /* now insert the keyframe(s) using the Keying Set + * 1) add datasource override for the PoseChannel + * 2) insert keyframes + * 3) free the extra info */ - KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "Rotation"); - - /* init cks for this PoseChannel, then use the relative KeyingSets to keyframe it */ - cks.pchan= pchan; - - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); + ANIM_relative_keyingset_add_source(&dsources, &ob->id, &RNA_PoseBone, pchan); + ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); + BLI_freelistN(&dsources); /* clear any unkeyed tags */ if (pchan->bone) diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 2c58d9e3ff5..576069d78e8 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -89,8 +89,6 @@ int insert_vert_fcurve(struct FCurve *fcu, float x, float y, short flag); */ short insert_keyframe_direct(struct PointerRNA ptr, struct PropertyRNA *prop, struct FCurve *fcu, float cfra, short flag); - - /* -------- */ /* Main Keyframing API calls: @@ -106,48 +104,92 @@ short delete_keyframe(struct ID *id, struct bAction *act, const char group[], co /* ************ Keying Sets ********************** */ -/* temporary struct to gather data combos to keyframe - * (is used by modify_keyframes for 'relative' KeyingSets, provided via the dsources arg) - */ -typedef struct bCommonKeySrc { - struct bCommonKeySrc *next, *prev; - - /* general data/destination-source settings */ - struct ID *id; /* id-block this comes from */ +/* forward decl. for this struct which is declared a bit later... */ +struct KeyingSetInfo; + +/* Polling Callback for KeyingSets */ +typedef int (*cbKeyingSet_Poll)(struct KeyingSetInfo *ksi, struct bContext *C); +/* Context Iterator Callback for KeyingSets */ +typedef void (*cbKeyingSet_Iterator)(struct KeyingSetInfo *ksi, struct bContext *C, struct KeyingSet *ks); +/* Property Specifier Callback for KeyingSets (called from iterators) */ +typedef void (*cbKeyingSet_Generate)(struct KeyingSetInfo *ksi, struct bContext *C, struct KeyingSet *ks, struct PointerRNA *ptr); + + +/* Callback info for 'Procedural' KeyingSets to use */ +typedef struct KeyingSetInfo { + struct KeyingSetInfo *next, *prev; - /* specific cases */ - struct bPoseChannel *pchan; - struct bConstraint *con; -} bCommonKeySrc; + /* info */ + /* identifier so that user can hook this up to a KeyingSet */ + char name[64]; + /* keying settings */ + short keyingflag; + /* builtin? */ + short builtin; + + /* polling callbacks */ + /* callback for polling the context for whether the right data is available */ + cbKeyingSet_Poll poll; + + /* generate callbacks */ + /* iterator to use to go through collections of data in context + * - this callback is separate from the 'adding' stage, allowing + * BuiltIn KeyingSets to be manually specified to use + */ + cbKeyingSet_Iterator iter; + /* generator to use to add properties based on the data found by iterator */ + cbKeyingSet_Generate generate; + + /* RNA integration */ + ExtensionRNA ext; +} KeyingSetInfo; /* -------- */ +/* Add another data source for Relative Keying Sets to be evaluated with */ +void ANIM_relative_keyingset_add_source(ListBase *dsources, struct ID *id, struct StructRNA *srna, void *data); + + /* mode for modify_keyframes */ typedef enum eModifyKey_Modes { MODIFYKEY_MODE_INSERT = 0, MODIFYKEY_MODE_DELETE, } eModifyKey_Modes; -/* Keyframing Helper Call - use the provided Keying Set to Add/Remove Keyframes */ -int modify_keyframes(struct Scene *scene, struct ListBase *dsources, struct bAction *act, struct KeyingSet *ks, short mode, float cfra); +/* return codes for errors (with Relative KeyingSets) */ +typedef enum eModifyKey_Returns { + /* context info was invalid for using the Keying Set */ + MODIFYKEY_INVALID_CONTEXT = -1, + /* there isn't any typeinfo for generating paths from context */ + MODIFYKEY_MISSING_TYPEINFO = -2, +} eModifyKey_Returns; + +/* use the specified KeyingSet to add/remove various Keyframes on the specified frame */ +int ANIM_apply_keyingset(struct bContext *C, ListBase *dsources, struct bAction *act, struct KeyingSet *ks, short mode, float cfra); /* -------- */ -/* Generate menu of KeyingSets */ -char *ANIM_build_keyingsets_menu(struct ListBase *list, short for_edit); - /* Get the first builtin KeyingSet with the given name, which occurs after the given one (or start of list if none given) */ -struct KeyingSet *ANIM_builtin_keyingset_get_named(struct KeyingSet *prevKS, char name[]); +struct KeyingSet *ANIM_builtin_keyingset_get_named(struct KeyingSet *prevKS, const char name[]); -/* Initialise builtin KeyingSets on startup */ -void init_builtin_keyingsets(void); +/* Find KeyingSet type info given a name */ +KeyingSetInfo *ANIM_keyingset_info_find_named(const char name[]); +/* for RNA type registrations... */ +void ANIM_keyingset_info_register(const struct bContext *C, KeyingSetInfo *ksi); +void ANIM_keyingset_info_unregister(const struct bContext *C, KeyingSetInfo *ksi); + +/* cleanup on exit */ +void ANIM_keyingset_infos_exit(void); /* -------- */ /* Get the active KeyingSet for the given scene */ struct KeyingSet *ANIM_scene_get_active_keyingset(struct Scene *scene); +/* Check if KeyingSet can be used in the current context */ +short ANIM_keyingset_context_ok_poll(struct bContext *C, struct KeyingSet *ks); + /* ************ Drivers ********************** */ /* Returns whether there is a driver in the copy/paste buffer to paste */ diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 30df347bc60..db15322bbc4 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -75,32 +75,35 @@ static int object_location_clear_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); - + Scene *scene = CTX_data_scene(C); KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "Location"); - bCommonKeySrc cks; - ListBase dsources = {&cks, &cks}; - - /* init common-key-source for use by KeyingSets */ - memset(&cks, 0, sizeof(bCommonKeySrc)); /* clear location of selected objects if not in weight-paint mode */ CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) { - if(!(ob->mode & OB_MODE_WEIGHT_PAINT)) { - if((ob->protectflag & OB_LOCK_LOCX)==0) + if (!(ob->mode & OB_MODE_WEIGHT_PAINT)) { + /* clear location if not locked */ + if ((ob->protectflag & OB_LOCK_LOCX)==0) ob->loc[0]= ob->dloc[0]= 0.0f; - if((ob->protectflag & OB_LOCK_LOCY)==0) + if ((ob->protectflag & OB_LOCK_LOCY)==0) ob->loc[1]= ob->dloc[1]= 0.0f; - if((ob->protectflag & OB_LOCK_LOCZ)==0) + if ((ob->protectflag & OB_LOCK_LOCZ)==0) ob->loc[2]= ob->dloc[2]= 0.0f; - /* do auto-keyframing as appropriate */ + /* auto keyframing */ if (autokeyframe_cfra_can_key(scene, &ob->id)) { - /* init cks for this object, then use the relative KeyingSets to keyframe it */ - cks.id= &ob->id; - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); + ListBase dsources = {NULL, NULL}; + + /* now insert the keyframe(s) using the Keying Set + * 1) add datasource override for the PoseChannel + * 2) insert keyframes + * 3) free the extra info + */ + ANIM_relative_keyingset_add_source(&dsources, &ob->id, NULL, NULL); + ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); + BLI_freelistN(&dsources); } } + ob->recalc |= OB_RECALC_OB; } CTX_DATA_END; @@ -131,17 +134,12 @@ void OBJECT_OT_location_clear(wmOperatorType *ot) static int object_rotation_clear_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); - KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "Rotation"); - bCommonKeySrc cks; - ListBase dsources = {&cks, &cks}; - - /* init common-key-source for use by KeyingSets */ - memset(&cks, 0, sizeof(bCommonKeySrc)); /* clear rotation of selected objects if not in weight-paint mode */ CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) { if(!(ob->mode & OB_MODE_WEIGHT_PAINT)) { + /* clear rotations that aren't locked */ if (ob->protectflag & (OB_LOCK_ROTX|OB_LOCK_ROTY|OB_LOCK_ROTZ|OB_LOCK_ROTW)) { if (ob->protectflag & OB_LOCK_ROT4D) { /* perform clamping on a component by component basis */ @@ -233,13 +231,21 @@ static int object_rotation_clear_exec(bContext *C, wmOperator *op) } } - /* do auto-keyframing as appropriate */ + /* auto keyframing */ if (autokeyframe_cfra_can_key(scene, &ob->id)) { - /* init cks for this object, then use the relative KeyingSets to keyframe it */ - cks.id= &ob->id; - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); + ListBase dsources = {NULL, NULL}; + + /* now insert the keyframe(s) using the Keying Set + * 1) add datasource override for the PoseChannel + * 2) insert keyframes + * 3) free the extra info + */ + ANIM_relative_keyingset_add_source(&dsources, &ob->id, NULL, NULL); + ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); + BLI_freelistN(&dsources); } } + ob->recalc |= OB_RECALC_OB; } CTX_DATA_END; @@ -270,35 +276,37 @@ void OBJECT_OT_rotation_clear(wmOperatorType *ot) static int object_scale_clear_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); - KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "Scaling"); - bCommonKeySrc cks; - ListBase dsources = {&cks, &cks}; - - /* init common-key-source for use by KeyingSets */ - memset(&cks, 0, sizeof(bCommonKeySrc)); /* clear scales of selected objects if not in weight-paint mode */ CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) { if(!(ob->mode & OB_MODE_WEIGHT_PAINT)) { - if((ob->protectflag & OB_LOCK_SCALEX)==0) { + /* clear scale factors which are not locked */ + if ((ob->protectflag & OB_LOCK_SCALEX)==0) { ob->dsize[0]= 0.0f; ob->size[0]= 1.0f; } - if((ob->protectflag & OB_LOCK_SCALEY)==0) { + if ((ob->protectflag & OB_LOCK_SCALEY)==0) { ob->dsize[1]= 0.0f; ob->size[1]= 1.0f; } - if((ob->protectflag & OB_LOCK_SCALEZ)==0) { + if ((ob->protectflag & OB_LOCK_SCALEZ)==0) { ob->dsize[2]= 0.0f; ob->size[2]= 1.0f; } - /* do auto-keyframing as appropriate */ + /* auto keyframing */ if (autokeyframe_cfra_can_key(scene, &ob->id)) { - /* init cks for this object, then use the relative KeyingSets to keyframe it */ - cks.id= &ob->id; - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); + ListBase dsources = {NULL, NULL}; + + /* now insert the keyframe(s) using the Keying Set + * 1) add datasource override for the PoseChannel + * 2) insert keyframes + * 3) free the extra info + */ + ANIM_relative_keyingset_add_source(&dsources, &ob->id, NULL, NULL); + ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); + BLI_freelistN(&dsources); } } ob->recalc |= OB_RECALC_OB; diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 38a7163d35f..828d5368834 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -2323,7 +2323,7 @@ static void flyEvent(FlyInfo *fly, wmEvent *event) } } -static int flyApply(FlyInfo *fly) +static int flyApply(bContext *C, FlyInfo *fly) { /* fly mode - Shift+F @@ -2606,13 +2606,10 @@ static int flyApply(FlyInfo *fly) /* record the motion */ if (autokeyframe_cfra_can_key(scene, id_key)) { - bCommonKeySrc cks; - ListBase dsources = {&cks, &cks}; - int cfra = CFRA; + ListBase dsources = {NULL, NULL}; - /* init common-key-source for use by KeyingSets */ - memset(&cks, 0, sizeof(bCommonKeySrc)); - cks.id= id_key; + /* add datasource override for the camera object */ + ANIM_relative_keyingset_add_source(&dsources, id_key, NULL, NULL); /* insert keyframes * 1) on the first frame @@ -2621,12 +2618,15 @@ static int flyApply(FlyInfo *fly) */ if (fly->xlock || fly->zlock || moffset[0] || moffset[1]) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "Rotation"); - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); + ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); } if (fly->speed) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "Location"); - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); + ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA); } + + /* free temp data */ + BLI_freelistN(&dsources); } } } else @@ -2689,7 +2689,7 @@ static int fly_modal(bContext *C, wmOperator *op, wmEvent *event) flyEvent(fly, event); if(event->type==TIMER && event->customdata == fly->timer) - flyApply(fly); + flyApply(C, fly); if(fly->redraw) { ED_region_tag_redraw(CTX_wm_region(C)); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 372aa42bac3..9c570e10406 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -102,20 +102,7 @@ #include "BKE_report.h" #include "BKE_scene.h" -//#include "BIF_editview.h" -//#include "BIF_editlattice.h" -//#include "BIF_editconstraint.h" -//#include "BIF_editmesh.h" -//#include "BIF_editsima.h" -//#include "BIF_editparticle.h" #include "BIF_gl.h" -//#include "BIF_poseobject.h" -//#include "BIF_meshtools.h" -//#include "BIF_mywindow.h" -//#include "BIF_resources.h" -//#include "BIF_screen.h" -//#include "BIF_space.h" -//#include "BIF_toolbox.h" #include "ED_anim_api.h" #include "ED_armature.h" @@ -132,19 +119,11 @@ #include "UI_view2d.h" -//#include "BSE_edit.h" -//#include "BDR_editobject.h" // reset_slowparents() -//#include "BDR_gpencil.h" - #include "BLI_math.h" #include "BLI_blenlib.h" #include "BLI_editVert.h" -//#include "editmesh.h" -// -//#include "blendef.h" -// -//#include "mydevice.h" +#include "RNA_access.h" extern ListBase editelems; @@ -4484,20 +4463,21 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, // TODO: this should probably be done per channel instead... if (autokeyframe_cfra_can_key(scene, id)) { KeyingSet *active_ks = ANIM_scene_get_active_keyingset(scene); - bCommonKeySrc cks; - ListBase dsources = {&cks, &cks}; + ListBase dsources = {NULL, NULL}; float cfra= (float)CFRA; // xxx this will do for now short flag = 0; - /* init common-key-source for use by KeyingSets */ - memset(&cks, 0, sizeof(bCommonKeySrc)); - cks.id= &ob->id; - + /* get flags used for inserting keyframes */ flag = ANIM_get_keyframing_flags(scene, 1); + /* add datasource override for the camera object */ + ANIM_relative_keyingset_add_source(&dsources, id, NULL, NULL); + if (IS_AUTOKEY_FLAG(ONLYKEYINGSET) && (active_ks)) { - /* only insert into active keyingset */ - modify_keyframes(scene, &dsources, NULL, active_ks, MODIFYKEY_MODE_INSERT, cfra); + /* only insert into active keyingset + * NOTE: we assume here that the active Keying Set does not need to have its iterator overridden spe + */ + ANIM_apply_keyingset(C, NULL, NULL, active_ks, MODIFYKEY_MODE_INSERT, cfra); } else if (IS_AUTOKEY_FLAG(INSERTAVAIL)) { AnimData *adt= ob->adt; @@ -4543,22 +4523,25 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, /* insert keyframes for the affected sets of channels using the builtin KeyingSets found */ if (doLoc) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "Location"); - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); + ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } if (doRot) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "Rotation"); - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); + ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } if (doScale) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "Scale"); - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); + ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } } /* insert keyframe in all (transform) channels */ else { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "LocRotScale"); - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); + ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } + + /* free temp info */ + BLI_freelistN(&dsources); } } @@ -4579,15 +4562,9 @@ void autokeyframe_pose_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *o // TODO: this should probably be done per channel instead... if (autokeyframe_cfra_can_key(scene, id)) { KeyingSet *active_ks = ANIM_scene_get_active_keyingset(scene); - bCommonKeySrc cks; - ListBase dsources = {&cks, &cks}; float cfra= (float)CFRA; short flag= 0; - /* init common-key-source for use by KeyingSets */ - memset(&cks, 0, sizeof(bCommonKeySrc)); - cks.id= &ob->id; - /* flag is initialised from UserPref keyframing settings * - special exception for targetless IK - INSERTKEY_MATRIX keyframes should get * visual keyframes even if flag not set, as it's not that useful otherwise @@ -4600,14 +4577,18 @@ void autokeyframe_pose_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *o for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) { if (pchan->bone->flag & BONE_TRANSFORM) { + ListBase dsources = {NULL, NULL}; + /* clear any 'unkeyed' flag it may have */ pchan->bone->flag &= ~BONE_UNKEYED; + /* add datasource override for the camera object */ + ANIM_relative_keyingset_add_source(&dsources, id, &RNA_PoseBone, pchan); + /* only insert into active keyingset? */ + // TODO: move this first case out of the loop if (IS_AUTOKEY_FLAG(ONLYKEYINGSET) && (active_ks)) { - /* init cks for this PoseChannel, then use the relative KeyingSets to keyframe it */ - cks.pchan= pchan; - modify_keyframes(scene, &dsources, NULL, active_ks, MODIFYKEY_MODE_INSERT, cfra); + ANIM_apply_keyingset(C, NULL, NULL, active_ks, MODIFYKEY_MODE_INSERT, cfra); } /* only insert into available channels? */ else if (IS_AUTOKEY_FLAG(INSERTAVAIL)) { @@ -4656,34 +4637,25 @@ void autokeyframe_pose_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *o if (doLoc) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "Location"); - - /* init cks for this PoseChannel, then use the relative KeyingSets to keyframe it */ - cks.pchan= pchan; - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); + ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } if (doRot) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "Rotation"); - - /* init cks for this PoseChannel, then use the relative KeyingSets to keyframe it */ - cks.pchan= pchan; - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); + ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } if (doScale) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "Scale"); - - /* init cks for this PoseChannel, then use the relative KeyingSets to keyframe it */ - cks.pchan= pchan; - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); + ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } } /* insert keyframe in all (transform) channels */ else { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, "LocRotScale"); - - /* init cks for this PoseChannel, then use the relative KeyingSets to keyframe it */ - cks.pchan= pchan; - modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); + ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } + + /* free temp info */ + BLI_freelistN(&dsources); } } diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index d2755f71fa3..8e46cfefba5 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -663,20 +663,19 @@ typedef enum eNlaTrack_Flag { typedef struct KS_Path { struct KS_Path *next, *prev; - /* absolute paths only */ ID *id; /* ID block that keyframes are for */ char group[64]; /* name of the group to add to */ - /* relative paths only */ int idtype; /* ID-type that path can be used on */ - int templates; /* Templates that will be encountered in the path (as set of bitflags) */ - /* all paths */ + short groupmode; /* group naming (eKSP_Grouping) */ + short pad; + char *rna_path; /* dynamically (or statically in the case of predefined sets) path */ int array_index; /* index that path affects */ short flag; /* various settings, etc. */ - short groupmode; /* group naming (eKSP_Grouping) */ + short keyingflag; /* settings to supply insertkey() with */ } KS_Path; /* KS_Path->flag */ @@ -734,6 +733,7 @@ typedef struct KeyingSet { ListBase paths; /* (KS_Path) paths to keyframe to */ char name[64]; /* user-viewable name for KeyingSet (for menus, etc.) */ + char typeinfo[64]; /* name of the typeinfo data used for the relative paths */ short flag; /* settings for KeyingSet */ short keyingflag; /* settings to supply insertkey() with */ diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index ae431beb1fe..e50b1b7ad58 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -257,6 +257,7 @@ extern StructRNA RNA_KeyConfig; extern StructRNA RNA_Keyframe; extern StructRNA RNA_KeyingSet; extern StructRNA RNA_KeyingSetPath; +extern StructRNA RNA_KeyingSetInfo; extern StructRNA RNA_KeyMap; extern StructRNA RNA_KeyMapItem; extern StructRNA RNA_KinematicConstraint; diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 453d9b9a844..e048a79daf8 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -37,12 +37,13 @@ #include "MEM_guardedalloc.h" +#include "ED_keyframing.h" + /* exported for use in API */ EnumPropertyItem keyingset_path_grouping_items[] = { {KSP_GROUP_NAMED, "NAMED", 0, "Named Group", ""}, {KSP_GROUP_NONE, "NONE", 0, "None", ""}, {KSP_GROUP_KSNAME, "KEYINGSET", 0, "Keying Set Name", ""}, - {KSP_GROUP_TEMPLATE_ITEM, "TEMPLATE", 0, "Innermost Context-Item Name", ""}, {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME @@ -66,6 +67,152 @@ static void rna_AnimData_action_set(PointerRNA *ptr, PointerRNA value) /* ****************************** */ +/* wrapper for poll callback */ +static int RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C) +{ + PointerRNA ptr; + ParameterList list; + FunctionRNA *func; + void *ret; + int ok; + + RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr); + func= RNA_struct_find_function(&ptr, "poll"); + + RNA_parameter_list_create(&list, &ptr, func); + /* hook up arguments */ + RNA_parameter_set_lookup(&list, "ksi", &ksi); + RNA_parameter_set_lookup(&list, "context", &C); + + /* execute the function */ + ksi->ext.call(&ptr, func, &list); + + /* read the result */ + RNA_parameter_get_lookup(&list, "ok", &ret); + ok= *(int*)ret; + RNA_parameter_list_free(&list); + + return ok; +} + +/* wrapper for iterator callback */ +static void RKS_ITER_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks) +{ + PointerRNA ptr; + ParameterList list; + FunctionRNA *func; + + RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr); + func= RNA_struct_find_function(&ptr, "iterator"); + + RNA_parameter_list_create(&list, &ptr, func); + /* hook up arguments */ + RNA_parameter_set_lookup(&list, "ksi", &ksi); + RNA_parameter_set_lookup(&list, "context", &C); + RNA_parameter_set_lookup(&list, "ks", &ks); + + /* execute the function */ + ksi->ext.call(&ptr, func, &list); + RNA_parameter_list_free(&list); +} + +/* wrapper for generator callback */ +static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks, PointerRNA *data) +{ + PointerRNA ptr; + ParameterList list; + FunctionRNA *func; + + RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr); + func= RNA_struct_find_function(&ptr, "iterator"); + + RNA_parameter_list_create(&list, &ptr, func); + /* hook up arguments */ + RNA_parameter_set_lookup(&list, "ksi", &ksi); + RNA_parameter_set_lookup(&list, "context", &C); + RNA_parameter_set_lookup(&list, "ks", &ks); + RNA_parameter_set_lookup(&list, "data", &data); + + /* execute the function */ + ksi->ext.call(&ptr, func, &list); + RNA_parameter_list_free(&list); +} + +/* ------ */ + +// XXX: the exact purpose of this is not too clear... maybe we want to revise this at some point? +static StructRNA *rna_KeyingSetInfo_refine(PointerRNA *ptr) +{ + KeyingSetInfo *ksi= (KeyingSetInfo *)ptr->data; + return (ksi->ext.srna)? ksi->ext.srna: &RNA_KeyingSetInfo; +} + +static void rna_KeyingSetInfo_unregister(const bContext *C, StructRNA *type) +{ + KeyingSetInfo *ksi= RNA_struct_blender_type_get(type); + + if (ksi == NULL) + return; + + /* free RNA data referencing this */ + RNA_struct_free_extension(type, &ksi->ext); + RNA_struct_free(&BLENDER_RNA, type); + + /* unlink Blender-side data */ + ANIM_keyingset_info_unregister(C, ksi); +} + +static StructRNA *rna_KeyingSetInfo_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +{ + KeyingSetInfo dummyksi = {0}; + KeyingSetInfo *ksi; + PointerRNA dummyptr; + int have_function[3]; + + /* setup dummy type info to store static properties in */ + // TODO: perhaps we want to get users to register as if they're using 'KeyingSet' directly instead? + RNA_pointer_create(NULL, &RNA_KeyingSetInfo, &dummyksi, &dummyptr); + + /* validate the python class */ + if (validate(&dummyptr, data, have_function) != 0) + return NULL; + + if (strlen(identifier) >= sizeof(dummyksi.name)) { + BKE_reportf(reports, RPT_ERROR, "registering keying set info class: '%s' is too long, maximum length is %d.", identifier, sizeof(dummyksi.name)); + return NULL; + } + + /* check if we have registered this info before, and remove it */ + ksi = ANIM_keyingset_info_find_named(dummyksi.name); + if (ksi && ksi->ext.srna) + rna_KeyingSetInfo_unregister(C, ksi->ext.srna); + + /* create a new KeyingSetInfo type */ + ksi= MEM_callocN(sizeof(KeyingSetInfo), "python keying set info"); + memcpy(ksi, &dummyksi, sizeof(KeyingSetInfo)); + + /* set RNA-extensions info */ + ksi->ext.srna= RNA_def_struct(&BLENDER_RNA, ksi->name, "KeyingSetInfo"); + ksi->ext.data= data; + ksi->ext.call= call; + ksi->ext.free= free; + RNA_struct_blender_type_set(ksi->ext.srna, ksi); + + /* set callbacks */ + // NOTE: we really should have all of these... + ksi->poll= (have_function[0])? RKS_POLL_rna_internal: NULL; + ksi->iter= (have_function[1])? RKS_ITER_rna_internal: NULL; + ksi->generate= (have_function[2])? RKS_GEN_rna_internal: NULL; + + /* add and register with other info as needed */ + ANIM_keyingset_info_register(C, ksi); + + /* return the struct-rna added */ + return ksi->ext.srna; +} + +/* ****************************** */ + static StructRNA *rna_ksPath_id_typef(PointerRNA *ptr) { KS_Path *ksp= (KS_Path*)ptr->data; @@ -123,6 +270,14 @@ static void rna_ksPath_RnaPath_set(PointerRNA *ptr, const char *value) /* ****************************** */ +static int rna_KeyingSet_typeinfo_name_editable(PointerRNA *ptr) +{ + KeyingSet *ks= (KeyingSet *)ptr->data; + + /* only editable if we're using relative paths */ + return ((ks->flag & KEYINGSET_ABSOLUTE)==0); +} + static int rna_KeyingSet_active_ksPath_editable(PointerRNA *ptr) { KeyingSet *ks= (KeyingSet *)ptr->data; @@ -167,6 +322,91 @@ static void rna_KeyingSet_active_ksPath_index_range(PointerRNA *ptr, int *min, i #else +/* helper function for Keying Set -> keying settings */ +static void rna_def_common_keying_flags(StructRNA *srna, short reg) +{ + PropertyRNA *prop; + + prop= RNA_def_property(srna, "insertkey_needed", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_NEEDED); + RNA_def_property_ui_text(prop, "Insert Keyframes - Only Needed", "Only insert keyframes where they're needed in the relevant F-Curves"); + if (reg) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); + + prop= RNA_def_property(srna, "insertkey_visual", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_MATRIX); + RNA_def_property_ui_text(prop, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'"); + if (reg) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); + + prop= RNA_def_property(srna, "insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_XYZ2RGB); + RNA_def_property_ui_text(prop, "F-Curve Colors - XYZ to RGB", "Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis"); + if (reg) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); +} + +/* --- */ + +static void rna_def_keyingset_info(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + FunctionRNA *func; + PropertyRNA *parm; + + srna= RNA_def_struct(brna, "KeyingSetInfo", NULL); + RNA_def_struct_sdna(srna, "KeyingSetInfo"); + RNA_def_struct_ui_text(srna, "Keying Set Info", "Callback function defines for relative Keying Sets"); + RNA_def_struct_refine_func(srna, "rna_KeyingSetInfo_refine"); + RNA_def_struct_register_funcs(srna, "rna_KeyingSetInfo_register", "rna_KeyingSetInfo_unregister"); + + /* Properties --------------------- */ + + RNA_define_verify_sdna(0); // not in sdna + + /* Name */ + prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "name"); + RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_struct_name_property(srna, prop); + RNA_def_property_flag(prop, PROP_REGISTER); + + prop= RNA_def_property(srna, "bl_builtin", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "builtin", 1); + RNA_def_property_ui_text(prop, "BuiltIn", "Keying Set type is required internally."); + RNA_def_property_flag(prop, PROP_REGISTER); + + rna_def_common_keying_flags(srna, 1); /* '1' arg here is to indicate that we need these to be set on registering */ + + RNA_define_verify_sdna(1); + + /* Function Callbacks ------------- */ + /* poll */ + func= RNA_def_function(srna, "poll", NULL); + RNA_def_function_ui_description(func, "Test if Keying Set can be used or not"); + RNA_def_function_flag(func, FUNC_REGISTER); + RNA_def_function_return(func, RNA_def_boolean(func, "ok", 1, "", "")); + parm= RNA_def_pointer(func, "context", "Context", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + + /* iterator */ + func= RNA_def_function(srna, "iterator", NULL); + RNA_def_function_ui_description(func, "Call generate() on the structs which have properties to be keyframed"); + RNA_def_function_flag(func, FUNC_REGISTER); + parm= RNA_def_pointer(func, "context", "Context", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "ks", "KeyingSet", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + + /* generate */ + func= RNA_def_function(srna, "generate", NULL); + RNA_def_function_ui_description(func, "Add Paths to the Keying Set to keyframe the properties of the given data"); + RNA_def_function_flag(func, FUNC_REGISTER); + parm= RNA_def_pointer(func, "context", "Context", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "ks", "KeyingSet", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "data", NULL, "", ""); // "AnyType"... + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); +} static void rna_def_keyingset_path(BlenderRNA *brna) { @@ -215,6 +455,9 @@ static void rna_def_keyingset_path(BlenderRNA *brna) prop= RNA_def_property(srna, "entire_array", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", KSP_FLAG_WHOLE_ARRAY); RNA_def_property_ui_text(prop, "Entire Array", "When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), entire array is to be used"); + + /* Keyframing Settings */ + rna_def_common_keying_flags(srna, 0); } static void rna_def_keyingset(BlenderRNA *brna) @@ -230,6 +473,13 @@ static void rna_def_keyingset(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Name", ""); RNA_def_struct_name_property(srna, prop); + /* TypeInfo associated with Relative KeyingSet (only) */ + prop= RNA_def_property(srna, "typeinfo_name", PROP_STRING, PROP_NONE); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_string_sdna(prop, NULL, "typeinfo"); + RNA_def_property_editable_func(prop, "rna_KeyingSet_typeinfo_name_editable"); + RNA_def_property_ui_text(prop, "TypeInfo Name", ""); + /* Paths */ prop= RNA_def_property(srna, "paths", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "paths", NULL); @@ -249,28 +499,13 @@ static void rna_def_keyingset(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Active Path Index", "Current Keying Set index"); /* Flags */ - // XXX: depreceated - prop= RNA_def_property(srna, "builtin", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYINGSET_BUILTIN); - RNA_def_property_ui_text(prop, "Built-In", "Keying Set is a built-in to Blender"); - prop= RNA_def_property(srna, "absolute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYINGSET_ABSOLUTE); RNA_def_property_ui_text(prop, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)"); /* Keyframing Flags */ - prop= RNA_def_property(srna, "insertkey_needed", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_NEEDED); - RNA_def_property_ui_text(prop, "Insert Keyframes - Only Needed", "Only insert keyframes where they're needed in the relevant F-Curves"); + rna_def_common_keying_flags(srna, 0); - prop= RNA_def_property(srna, "insertkey_visual", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_MATRIX); - RNA_def_property_ui_text(prop, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'"); - - prop= RNA_def_property(srna, "insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_XYZ2RGB); - RNA_def_property_ui_text(prop, "F-Curve Colors - XYZ to RGB", "Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis"); /* Keying Set API */ RNA_api_keyingset(srna); @@ -347,6 +582,7 @@ void RNA_def_animation(BlenderRNA *brna) rna_def_keyingset(brna); rna_def_keyingset_path(brna); + rna_def_keyingset_info(brna); } #endif diff --git a/source/blender/makesrna/intern/rna_animation_api.c b/source/blender/makesrna/intern/rna_animation_api.c index b07f147ac96..46ecc8679e7 100644 --- a/source/blender/makesrna/intern/rna_animation_api.c +++ b/source/blender/makesrna/intern/rna_animation_api.c @@ -41,10 +41,11 @@ #include "BKE_animsys.h" -static void rna_KeyingSet_add_path(KeyingSet *keyingset, ReportList *reports, +static KS_Path *rna_KeyingSet_add_path(KeyingSet *keyingset, ReportList *reports, ID *id, char rna_path[], int array_index, int entire_array, int grouping_method, char group_name[]) { + KS_Path *ksp = NULL; short flag = 0; /* validate flags */ @@ -53,12 +54,31 @@ static void rna_KeyingSet_add_path(KeyingSet *keyingset, ReportList *reports, /* if data is valid, call the API function for this */ if (keyingset) { - BKE_keyingset_add_path(keyingset, id, group_name, rna_path, array_index, flag, grouping_method); + ksp= BKE_keyingset_add_path(keyingset, id, group_name, rna_path, array_index, flag, grouping_method); keyingset->active_path= BLI_countlist(&keyingset->paths); } else { BKE_report(reports, RPT_ERROR, "Keying Set Path could not be added."); } + + /* return added path */ + return ksp; +} + +static void rna_KeyingSet_remove_path(KeyingSet *keyingset, ReportList *reports, KS_Path *ksp) +{ + /* if data is valid, call the API function for this */ + if (keyingset && ksp) { + /* remove the active path from the KeyingSet */ + BKE_keyingset_free_path(keyingset, ksp); + + /* the active path number will most likely have changed */ + // TODO: we should get more fancy and actually check if it was removed, but this will do for now + keyingset->active_path = 0; + } + else { + BKE_report(reports, RPT_ERROR, "Keying Set Path could not be removed."); + } } #else @@ -68,10 +88,13 @@ void RNA_api_keyingset(StructRNA *srna) FunctionRNA *func; PropertyRNA *parm; - /* Add Destination */ + /* Add Path */ func= RNA_def_function(srna, "add_path", "rna_KeyingSet_add_path"); - RNA_def_function_ui_description(func, "Add a new destination for the Keying Set."); + RNA_def_function_ui_description(func, "Add a new path for the Keying Set."); RNA_def_function_flag(func, FUNC_USE_REPORTS); + /* return arg */ + parm= RNA_def_pointer(func, "ksp", "KeyingSetPath", "New Path", "Path created and added to the Keying Set"); + RNA_def_function_return(func, parm); /* ID-block for target */ parm= RNA_def_pointer(func, "target_id", "ID", "Target ID", "ID-Datablock for the destination."); RNA_def_property_flag(parm, PROP_REQUIRED); @@ -84,6 +107,14 @@ void RNA_api_keyingset(StructRNA *srna) /* grouping */ parm=RNA_def_enum(func, "grouping_method", keyingset_path_grouping_items, KSP_GROUP_KSNAME, "Grouping Method", "Method used to define which Group-name to use."); parm=RNA_def_string(func, "group_name", "", 64, "Group Name", "Name of Action Group to assign destination to (only if grouping mode is to use this name)."); + + /* Remove Path */ + func= RNA_def_function(srna, "remove_path", "rna_KeyingSet_remove_path"); + RNA_def_function_ui_description(func, "Remove the given path from the Keying Set."); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + /* path to remove */ + parm= RNA_def_pointer(func, "path", "KeyingSetPath", "Path", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); } #endif diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 5302cb1eaaf..ae310a7f59d 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -128,8 +128,6 @@ void WM_init(bContext *C, int argc, char **argv) BLF_init(11, U.dpi); BLF_lang_init(); - init_builtin_keyingsets(); /* editors/animation/keyframing.c */ - /* get the default database, plus a wm */ WM_read_homefile(C, NULL); @@ -281,7 +279,9 @@ void WM_exit(bContext *C) // fsmenu_free(); BLF_exit(); - + + ANIM_keyingset_infos_exit(); + RE_FreeAllRender(); RE_engines_exit(); From dc5945e7f0f5d7e85f9ff1dfbb5f762f45cf3509 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 16 Mar 2010 07:44:57 +0000 Subject: [PATCH 077/153] Fix [#21165] Moved textures don't move the animation curves --- source/blender/blenkernel/BKE_animsys.h | 2 +- source/blender/blenkernel/intern/anim_sys.c | 47 ++++++++++--------- .../blender/editors/armature/editarmature.c | 2 +- .../blender/editors/render/render_shading.c | 13 ++++- 4 files changed, 39 insertions(+), 25 deletions(-) diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h index 8644074d4e9..af5e31b1efa 100644 --- a/source/blender/blenkernel/BKE_animsys.h +++ b/source/blender/blenkernel/BKE_animsys.h @@ -92,7 +92,7 @@ void BKE_keyingsets_free(struct ListBase *list); /* Path Fixing API */ /* Fix all the paths for the given ID+AnimData */ -void BKE_animdata_fix_paths_rename(struct ID *owner_id, struct AnimData *adt, char *prefix, char *oldName, char *newName); +void BKE_animdata_fix_paths_rename(struct ID *owner_id, struct AnimData *adt, char *prefix, char *oldName, char *newName, int oldSubscript, int newSubscript, int verify_paths); /* Fix all the paths for the entire database... */ void BKE_all_animdata_fix_paths_rename(char *prefix, char *oldName, char *newName); diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 8ec8f24d5fe..307ed1bfcd4 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -274,7 +274,7 @@ static short check_rna_path_is_valid (ID *owner_id, char *path) /* Check if some given RNA Path needs fixing - free the given path and set a new one as appropriate * NOTE: we assume that oldName and newName have [" "] padding around them */ -static char *rna_path_rename_fix (ID *owner_id, char *prefix, char *oldName, char *newName, char *oldpath) +static char *rna_path_rename_fix (ID *owner_id, char *prefix, char *oldName, char *newName, char *oldpath, int verify_paths) { char *prefixPtr= strstr(oldpath, prefix); char *oldNamePtr= strstr(oldpath, oldName); @@ -286,7 +286,7 @@ static char *rna_path_rename_fix (ID *owner_id, char *prefix, char *oldName, cha */ if ( (prefixPtr && oldNamePtr) && (prefixPtr+prefixLen == oldNamePtr) ) { /* if we haven't aren't able to resolve the path now, try again after fixing it */ - if (check_rna_path_is_valid(owner_id, oldpath) == 0) { + if (!verify_paths || check_rna_path_is_valid(owner_id, oldpath) == 0) { DynStr *ds= BLI_dynstr_new(); char *postfixPtr= oldNamePtr+oldNameLen; char *newPath = NULL; @@ -315,7 +315,7 @@ static char *rna_path_rename_fix (ID *owner_id, char *prefix, char *oldName, cha /* check if the new path will solve our problems */ // TODO: will need to check whether this step really helps in practice - if (check_rna_path_is_valid(owner_id, newPath)) { + if (!verify_paths || check_rna_path_is_valid(owner_id, newPath)) { /* free the old path, and return the new one, since we've solved the issues */ MEM_freeN(oldpath); return newPath; @@ -332,7 +332,7 @@ static char *rna_path_rename_fix (ID *owner_id, char *prefix, char *oldName, cha } /* Check RNA-Paths for a list of F-Curves */ -static void fcurves_path_rename_fix (ID *owner_id, char *prefix, char *oldName, char *newName, ListBase *curves) +static void fcurves_path_rename_fix (ID *owner_id, char *prefix, char *oldName, char *newName, ListBase *curves, int verify_paths) { FCurve *fcu; @@ -340,7 +340,7 @@ static void fcurves_path_rename_fix (ID *owner_id, char *prefix, char *oldName, for (fcu= curves->first; fcu; fcu= fcu->next) { /* firstly, handle the F-Curve's own path */ if (fcu->rna_path) - fcu->rna_path= rna_path_rename_fix(owner_id, prefix, oldName, newName, fcu->rna_path); + fcu->rna_path= rna_path_rename_fix(owner_id, prefix, oldName, newName, fcu->rna_path, verify_paths); /* driver? */ if (fcu->driver) { @@ -354,7 +354,7 @@ static void fcurves_path_rename_fix (ID *owner_id, char *prefix, char *oldName, { /* rename RNA path */ if (dtar->rna_path) - dtar->rna_path= rna_path_rename_fix(dtar->id, prefix, oldName, newName, dtar->rna_path); + dtar->rna_path= rna_path_rename_fix(dtar->id, prefix, oldName, newName, dtar->rna_path, verify_paths); /* also fix the bone-name (if applicable) */ // XXX this has been disabled because the old/new names have padding which means this check will fail @@ -371,7 +371,7 @@ static void fcurves_path_rename_fix (ID *owner_id, char *prefix, char *oldName, } /* Fix all RNA-Paths for Actions linked to NLA Strips */ -static void nlastrips_path_rename_fix (ID *owner_id, char *prefix, char *oldName, char *newName, ListBase *strips) +static void nlastrips_path_rename_fix (ID *owner_id, char *prefix, char *oldName, char *newName, ListBase *strips, int verify_paths) { NlaStrip *strip; @@ -379,11 +379,11 @@ static void nlastrips_path_rename_fix (ID *owner_id, char *prefix, char *oldName for (strip= strips->first; strip; strip= strip->next) { /* fix strip's action */ if (strip->act) - fcurves_path_rename_fix(owner_id, prefix, oldName, newName, &strip->act->curves); + fcurves_path_rename_fix(owner_id, prefix, oldName, newName, &strip->act->curves, verify_paths); /* ignore own F-Curves, since those are local... */ /* check sub-strips (if metas) */ - nlastrips_path_rename_fix(owner_id, prefix, oldName, newName, &strip->strips); + nlastrips_path_rename_fix(owner_id, prefix, oldName, newName, &strip->strips, verify_paths); } } @@ -391,31 +391,36 @@ static void nlastrips_path_rename_fix (ID *owner_id, char *prefix, char *oldName * NOTE: it is assumed that the structure we're replacing is <["><"]> * i.e. pose.bones["Bone"] */ -void BKE_animdata_fix_paths_rename (ID *owner_id, AnimData *adt, char *prefix, char *oldName, char *newName) +void BKE_animdata_fix_paths_rename (ID *owner_id, AnimData *adt, char *prefix, char *oldName, char *newName, int oldSubscript, int newSubscript, int verify_paths) { NlaTrack *nlt; char *oldN, *newN; /* if no AnimData, no need to proceed */ - if (ELEM4(NULL, owner_id, adt, oldName, newName)) + if (ELEM(NULL, owner_id, adt)) return; - /* pad the names with [" "] so that only exact matches are made */ - oldN= BLI_sprintfN("[\"%s\"]", oldName); - newN= BLI_sprintfN("[\"%s\"]", newName); + if (oldName != NULL && newName != NULL) { + /* pad the names with [" "] so that only exact matches are made */ + oldN= BLI_sprintfN("[\"%s\"]", oldName); + newN= BLI_sprintfN("[\"%s\"]", newName); + } else { + oldN= BLI_sprintfN("[%d]", oldSubscript); + newN= BLI_sprintfN("[%d]", newSubscript); + } /* Active action and temp action */ if (adt->action) - fcurves_path_rename_fix(owner_id, prefix, oldN, newN, &adt->action->curves); + fcurves_path_rename_fix(owner_id, prefix, oldN, newN, &adt->action->curves, verify_paths); if (adt->tmpact) - fcurves_path_rename_fix(owner_id, prefix, oldN, newN, &adt->tmpact->curves); + fcurves_path_rename_fix(owner_id, prefix, oldN, newN, &adt->tmpact->curves, verify_paths); /* Drivers - Drivers are really F-Curves */ - fcurves_path_rename_fix(owner_id, prefix, oldN, newN, &adt->drivers); + fcurves_path_rename_fix(owner_id, prefix, oldN, newN, &adt->drivers, verify_paths); /* NLA Data - Animation Data for Strips */ for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) - nlastrips_path_rename_fix(owner_id, prefix, oldN, newN, &nlt->strips); + nlastrips_path_rename_fix(owner_id, prefix, oldN, newN, &nlt->strips, verify_paths); /* free the temp names */ MEM_freeN(oldN); @@ -482,7 +487,7 @@ void BKE_all_animdata_fix_paths_rename (char *prefix, char *oldName, char *newNa #define RENAMEFIX_ANIM_IDS(first) \ for (id= first; id; id= id->next) { \ AnimData *adt= BKE_animdata_from_id(id); \ - BKE_animdata_fix_paths_rename(id, adt, prefix, oldName, newName);\ + BKE_animdata_fix_paths_rename(id, adt, prefix, oldName, newName, 0, 0, 1);\ } /* nodes */ @@ -532,11 +537,11 @@ void BKE_all_animdata_fix_paths_rename (char *prefix, char *oldName, char *newNa /* do compositing nodes first (since these aren't included in main tree) */ if (scene->nodetree) { AnimData *adt2= BKE_animdata_from_id((ID *)scene->nodetree); - BKE_animdata_fix_paths_rename((ID *)scene->nodetree, adt2, prefix, oldName, newName); + BKE_animdata_fix_paths_rename((ID *)scene->nodetree, adt2, prefix, oldName, newName, 0, 0, 1); } /* now fix scene animation data as per normal */ - BKE_animdata_fix_paths_rename((ID *)id, adt, prefix, oldName, newName); + BKE_animdata_fix_paths_rename((ID *)id, adt, prefix, oldName, newName, 0, 0, 1); } } diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 3f26a146c53..b4666923a03 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -5540,7 +5540,7 @@ void ED_armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep) // TODO: should we be using the database wide version instead (since drivers may break) if (ob->adt) { /* posechannels only... */ - BKE_animdata_fix_paths_rename(&ob->id, ob->adt, "pose.bones", oldname, newname); + BKE_animdata_fix_paths_rename(&ob->id, ob->adt, "pose.bones", oldname, newname, 0, 0, 1); } } } diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 91655855a61..d7f3436713c 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -697,6 +697,7 @@ void SCENE_OT_render_layer_remove(wmOperatorType *ot) static int texture_slot_move(bContext *C, wmOperator *op) { ID *id= CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data; + Material *ma = (Material *)id; if(id) { MTex **mtex_ar, *mtexswap; @@ -710,6 +711,10 @@ static int texture_slot_move(bContext *C, wmOperator *op) mtexswap = mtex_ar[act]; mtex_ar[act] = mtex_ar[act-1]; mtex_ar[act-1] = mtexswap; + + BKE_animdata_fix_paths_rename(id, ma->adt, "texture_slots", NULL, NULL, act-1, -1, 0); + BKE_animdata_fix_paths_rename(id, ma->adt, "texture_slots", NULL, NULL, act, act-1, 0); + BKE_animdata_fix_paths_rename(id, ma->adt, "texture_slots", NULL, NULL, -1, act, 0); if(GS(id->name)==ID_MA) { Material *ma= (Material *)id; @@ -719,7 +724,7 @@ static int texture_slot_move(bContext *C, wmOperator *op) ma->septex &= ~(1<<(act-1)); ma->septex |= mtexuse >> 1; } - + set_active_mtex(id, act-1); } } @@ -728,6 +733,10 @@ static int texture_slot_move(bContext *C, wmOperator *op) mtexswap = mtex_ar[act]; mtex_ar[act] = mtex_ar[act+1]; mtex_ar[act+1] = mtexswap; + + BKE_animdata_fix_paths_rename(id, ma->adt, "texture_slots", NULL, NULL, act+1, -1, 0); + BKE_animdata_fix_paths_rename(id, ma->adt, "texture_slots", NULL, NULL, act, act+1, 0); + BKE_animdata_fix_paths_rename(id, ma->adt, "texture_slots", NULL, NULL, -1, act, 0); if(GS(id->name)==ID_MA) { Material *ma= (Material *)id; @@ -737,7 +746,7 @@ static int texture_slot_move(bContext *C, wmOperator *op) ma->septex &= ~(1<<(act+1)); ma->septex |= mtexuse << 1; } - + set_active_mtex(id, act+1); } } From ca8f5cef7903c721c1c767ed6f2f85e593e8256f Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 16 Mar 2010 08:06:50 +0000 Subject: [PATCH 078/153] Fix [#21250] Auto Refresh Movies on UV/Image editor doesn't work --- source/blender/editors/space_image/space_image.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index e0ff29986ac..0510bc7e4cb 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -560,6 +560,9 @@ static void image_refresh(const bContext *C, ScrArea *sa) ima= ED_space_image(sima); + if(sima->iuser.flag & IMA_ANIM_ALWAYS) + BKE_image_user_calc_frame(&sima->iuser, CTX_data_scene(C)->r.cfra, 0); + /* check if we have to set the image from the editmesh */ if(ima && (ima->source==IMA_SRC_VIEWER || sima->pin)); else if(obedit && obedit->type == OB_MESH) { @@ -593,13 +596,14 @@ static void image_listener(ScrArea *sa, wmNotifier *wmn) switch(wmn->category) { case NC_SCENE: switch(wmn->data) { + case ND_FRAME: case ND_MODE: case ND_RENDER_RESULT: case ND_COMPO_RESULT: if (ED_space_image_show_render(sima)) image_histogram_tag_refresh(sa); ED_area_tag_refresh(sa); - ED_area_tag_redraw(sa); + ED_area_tag_redraw(sa); break; } break; From f1c049137ef89d0597f79cb0d909c7ac2821b14c Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 16 Mar 2010 08:07:43 +0000 Subject: [PATCH 079/153] Fixing compiler errors for those people who compile those c++ modules... bleh! --- source/blender/editors/include/ED_keyframing.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 576069d78e8..dc0fb597c22 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -106,6 +106,7 @@ short delete_keyframe(struct ID *id, struct bAction *act, const char group[], co /* forward decl. for this struct which is declared a bit later... */ struct KeyingSetInfo; +struct ExtensionRNA; /* Polling Callback for KeyingSets */ typedef int (*cbKeyingSet_Poll)(struct KeyingSetInfo *ksi, struct bContext *C); @@ -141,7 +142,7 @@ typedef struct KeyingSetInfo { cbKeyingSet_Generate generate; /* RNA integration */ - ExtensionRNA ext; + struct ExtensionRNA ext; } KeyingSetInfo; /* -------- */ From 1cf95d2494ab82af61153abc3c45fa1a4fd3a4ed Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 16 Mar 2010 10:18:19 +0000 Subject: [PATCH 080/153] Keying Set Fixes: * 'Export Keying Set' operator works again - a change in the previous commit broke the created code * Relative Keying Sets don't get their paths shown * Keying Set paths show options for inserting keyframes too now --- Another attempt at fixing compile troubles, and removed some commented out + obsolete stuff. --- release/scripts/ui/properties_scene.py | 9 +++++++-- source/blender/python/intern/bpy_driver.c | 3 --- source/gameengine/Converter/KX_BlenderSceneConverter.cpp | 5 +---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/release/scripts/ui/properties_scene.py b/release/scripts/ui/properties_scene.py index 0209140ef4e..7cdb42b832b 100644 --- a/release/scripts/ui/properties_scene.py +++ b/release/scripts/ui/properties_scene.py @@ -120,7 +120,7 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel): bl_label = "Active Keying Set" def poll(self, context): - return (context.scene.active_keying_set is not None) + return (context.scene.active_keying_set and context.scene.active_keying_set.absolute); def draw(self, context): layout = self.layout @@ -163,6 +163,11 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel): col.prop(ksp, "grouping") if ksp.grouping == 'NAMED': col.prop(ksp, "group") + + col.label(text="Keyframing Settings:") + col.prop(ksp, "insertkey_needed", text="Needed") + col.prop(ksp, "insertkey_visual", text="Visual") + col.prop(ksp, "insertkey_xyz_to_rgb", text="XYZ to RGB") class SCENE_PT_physics(SceneButtonsPanel): @@ -295,7 +300,7 @@ class ANIM_OT_keying_set_export(bpy.types.Operator): # write paths f.write("# Path Definitions\n") for ksp in ks.paths: - f.write("ksp = ks.add_destination(") + f.write("ksp = ks.add_path(") # id-block + RNA-path if ksp.id: diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index 39b2bbf8536..b9d42f053c9 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -158,9 +158,6 @@ float BPY_pydriver_eval (ChannelDriver *driver) short targets_ok= 1; int i; - /* sanity checks - should driver be executed? */ - /*if (G.f & G_SCRIPT_AUTOEXEC)==0) return result; */ - /* get the py expression to be evaluated */ expr = driver->expression; if ((expr == NULL) || (expr[0]=='\0')) diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 3ee4248343c..3a5bb92b4fa 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -80,17 +80,14 @@ extern "C" #include "DNA_material_types.h" #include "BLI_blenlib.h" #include "MEM_guardedalloc.h" -//XXX #include "BSE_editipo.h" -//XXX #include "BSE_editipo_types.h" -// #include "DNA_ipo_types.h" #include "BKE_global.h" #include "BKE_animsys.h" #include "BKE_library.h" -#include "BKE_ipo.h" // eval_icu #include "BKE_material.h" // copy_material #include "BKE_mesh.h" // copy_mesh #include "DNA_space_types.h" #include "DNA_anim_types.h" +#include "RNA_define.h" #include "../../blender/editors/include/ED_keyframing.h" } From d617294c49912b1b0473bbbe58f62a3549641482 Mon Sep 17 00:00:00 2001 From: Roland Hess Date: Tue, 16 Mar 2010 12:55:56 +0000 Subject: [PATCH 081/153] New "Maintain Volume" constraint. When attached to a bone, you specify a "free" axis. Upon scaling, this free axis scales normally, but the constraint forces the other two axes to adjust themselves appropriately so that overall bone volume is maintained. So, setting "Y" as the free axis (the default) creates a bone that automatically squashes and stretches when scaling. Thanks to Aligorith, Fweeb, Cessen and others for the feedback. --- .../ui/properties_object_constraint.py | 11 ++++ source/blender/blenkernel/intern/constraint.c | 59 +++++++++++++++++++ .../blender/makesdna/DNA_constraint_types.h | 14 +++++ .../blender/makesrna/intern/rna_constraint.c | 32 ++++++++++ 4 files changed, 116 insertions(+) diff --git a/release/scripts/ui/properties_object_constraint.py b/release/scripts/ui/properties_object_constraint.py index 30f2b1ef49f..47306dd92ac 100644 --- a/release/scripts/ui/properties_object_constraint.py +++ b/release/scripts/ui/properties_object_constraint.py @@ -461,6 +461,17 @@ class ConstraintButtonsPanel(bpy.types.Panel): self.space_template(layout, con, wide_ui) + def MAINTAIN_VOLUME(self, context, layout, con, wide_ui): + + row = layout.row() + if wide_ui: + row.label(text="Free:") + row.prop(con, "axis", expand=True) + + layout.prop(con, "volume") + + self.space_template(layout, con, wide_ui) + def COPY_TRANSFORMS(self, context, layout, con, wide_ui): self.target_template(layout, con, wide_ui) diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 91bf4b8d8b2..08ac5e6acce 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -1859,6 +1859,64 @@ static bConstraintTypeInfo CTI_TRANSLIKE = { translike_evaluate /* evaluate */ }; +/* ---------- Maintain Volume ---------- */ + +static void samevolume_new_data (void *cdata) +{ + bSameVolumeConstraint *data= (bSameVolumeConstraint *)cdata; + + data->flag = SAMEVOL_Y; + data->volume = 1.0f; +} + +static void samevolume_evaluate (bConstraint *con, bConstraintOb *cob) +{ + bSameVolumeConstraint *data= con->data; + + float obsize[3]; + float volume=data->volume; + + mat4_to_size(obsize, cob->matrix); + + switch (data->flag) { + case SAMEVOL_X: + if (obsize[0]!=0) { + mul_v3_fl(cob->matrix[1], sqrt(volume/obsize[0])/obsize[0]); + mul_v3_fl(cob->matrix[2], sqrt(volume/obsize[0])/obsize[0]); + } + break; + case SAMEVOL_Y: + if (obsize[1]!=0) { + mul_v3_fl(cob->matrix[0], sqrt(volume/obsize[1])/obsize[1]); + mul_v3_fl(cob->matrix[2], sqrt(volume/obsize[1])/obsize[1]); + } + break; + case SAMEVOL_Z: + if (obsize[2]!=0) { + mul_v3_fl(cob->matrix[0], sqrt(volume/obsize[2])/obsize[2]); + mul_v3_fl(cob->matrix[1], sqrt(volume/obsize[2])/obsize[2]); + } + break; + } + +} + +static bConstraintTypeInfo CTI_SAMEVOL = { + CONSTRAINT_TYPE_SAMEVOL, /* type */ + sizeof(bSameVolumeConstraint), /* size */ + "Maintain Volume", /* name */ + "bSameVolumeConstraint", /* struct name */ + NULL, /* free data */ + NULL, /* relink data */ + NULL, /* id looper */ + NULL, /* copy data */ + samevolume_new_data, /* new data */ + NULL, /* get constraint targets */ + NULL, /* flush constraint targets */ + NULL, /* get target matrix */ + samevolume_evaluate /* evaluate */ +}; + /* ----------- Python Constraint -------------- */ static void pycon_free (bConstraint *con) @@ -3805,6 +3863,7 @@ static void constraints_init_typeinfo () { constraintsTypeInfo[21]= &CTI_DAMPTRACK; /* Damped TrackTo Constraint */ constraintsTypeInfo[22]= &CTI_SPLINEIK; /* Spline IK Constraint */ constraintsTypeInfo[23]= &CTI_TRANSLIKE; /* Copy Transforms Constraint */ + constraintsTypeInfo[24]= &CTI_SAMEVOL; /* Maintain Volume Constraint */ } /* This function should be used for getting the appropriate type-info when only diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index 6e837588f0c..358cbb6e34c 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -208,6 +208,12 @@ typedef struct bSizeLikeConstraint { char subtarget[32]; } bSizeLikeConstraint; +/* Maintain Volume Constraint */ +typedef struct bSameVolumeConstraint { + int flag; + float volume; +} bSameVolumeConstraint; + /* Copy Transform Constraint */ typedef struct bTransLikeConstraint { Object *tar; @@ -412,6 +418,7 @@ typedef enum eBConstraint_Types { CONSTRAINT_TYPE_DAMPTRACK, /* New Tracking constraint that minimises twisting */ CONSTRAINT_TYPE_SPLINEIK, /* Spline-IK - Align 'n' bones to a curve */ CONSTRAINT_TYPE_TRANSLIKE, /* Copy transform matrix */ + CONSTRAINT_TYPE_SAMEVOL, /* Maintain volume during scaling */ /* NOTE: no constraints are allowed to be added after this */ NUM_CONSTRAINT_TYPES @@ -499,6 +506,13 @@ typedef enum eCopyScale_Flags { SIZELIKE_OFFSET = (1<<3), } eCopyScale_Flags; +/* bSameVolumeConstraint.flag */ +typedef enum eSameVolume_Modes { + SAMEVOL_X = 0, + SAMEVOL_Y, + SAMEVOL_Z, +} eSameVolume_Modes; + /* Locked-Axis Values (Locked Track) */ typedef enum eLockAxis_Modes { LOCK_X = 0, diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 65114804a3f..68a29fe9c83 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -50,6 +50,7 @@ EnumPropertyItem constraint_type_items[] ={ {CONSTRAINT_TYPE_LOCLIMIT, "LIMIT_LOCATION", ICON_CONSTRAINT_DATA, "Limit Location", ""}, {CONSTRAINT_TYPE_ROTLIMIT, "LIMIT_ROTATION", ICON_CONSTRAINT_DATA, "Limit Rotation", ""}, {CONSTRAINT_TYPE_SIZELIMIT, "LIMIT_SCALE", ICON_CONSTRAINT_DATA, "Limit Scale", ""}, + {CONSTRAINT_TYPE_SAMEVOL, "MAINTAIN_VOLUME", ICON_CONSTRAINT_DATA, "Maintain Volume", ""}, {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", ICON_CONSTRAINT_DATA, "Transformation", ""}, {0, "", 0, "Tracking", ""}, {CONSTRAINT_TYPE_CLAMPTO, "CLAMP_TO", ICON_CONSTRAINT_DATA, "Clamp To", ""}, @@ -124,6 +125,8 @@ static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr) return &RNA_CopyLocationConstraint; case CONSTRAINT_TYPE_SIZELIKE: return &RNA_CopyScaleConstraint; + case CONSTRAINT_TYPE_SAMEVOL: + return &RNA_MaintainVolumeConstraint; case CONSTRAINT_TYPE_PYTHON: return &RNA_PythonConstraint; case CONSTRAINT_TYPE_ACTION: @@ -813,6 +816,34 @@ static void rna_def_constraint_size_like(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); } +static void rna_def_constraint_same_volume(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem volume_items[] = { + {SAMEVOL_X, "SAMEVOL_X", 0, "X", ""}, + {SAMEVOL_Y, "SAMEVOL_Y", 0, "Y", ""}, + {SAMEVOL_Z, "SAMEVOL_Z", 0, "Z", ""}, + {0, NULL, 0, NULL, NULL}}; + + srna= RNA_def_struct(brna, "MaintainVolumeConstraint", "Constraint"); + RNA_def_struct_ui_text(srna, "Maintain Volume Constraint", "Maintains a constant volume along a single scaling axis"); + RNA_def_struct_sdna_from(srna, "bSameVolumeConstraint", "data"); + + prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, volume_items); + RNA_def_property_ui_text(prop, "Free Axis", "The free scaling axis of the object"); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + + prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_DISTANCE); + RNA_def_property_range(prop, 0.001, 100.f); + RNA_def_property_ui_text(prop, "Volume", "Volume of the bone at rest"); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + +} + static void rna_def_constraint_transform_like(BlenderRNA *brna) { StructRNA *srna; @@ -1897,6 +1928,7 @@ void RNA_def_constraint(BlenderRNA *brna) rna_def_constraint_locked_track(brna); rna_def_constraint_action(brna); rna_def_constraint_size_like(brna); + rna_def_constraint_same_volume(brna); rna_def_constraint_locate_like(brna); rna_def_constraint_rotate_like(brna); rna_def_constraint_transform_like(brna); From 735b444d74d41bf2cec1ab81e781283e79d9c3d6 Mon Sep 17 00:00:00 2001 From: Arystanbek Dyussenov Date: Tue, 16 Mar 2010 16:15:30 +0000 Subject: [PATCH 082/153] Fix this error when building with collada: http://www.pasteall.org/11757 --- source/blender/editors/include/ED_keyframing.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index dc0fb597c22..c0821b3ff55 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -47,6 +47,8 @@ struct wmOperatorType; struct PointerRNA; struct PropertyRNA; +#include "RNA_types.h" + /* ************ Keyframing Management **************** */ /* Get the active settings for keyframing settings from context (specifically the given scene) From f17dcf58c86274661a10cf4f95939deb63a02fa7 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 16:58:45 +0000 Subject: [PATCH 083/153] Fixes for thread related render / compositing crashes: * Viewer node could free image while it is being redrawn, viewer image buffers now need acquire/release to be accessed as was already the case for render results. * The Composite node could free the image buffers outside of a lock, also causing simultaneous redraw to crash. * Especially on Windows, re-rendering could crash when drawing an image that was freed. When RE_RenderInProgress was true it would access the image buffer and simply return it while it could still contain a pointer to a render result buffer that was already freed. I don't understand why this case was there in the first place, so I've removed it. Possibly fixes bugs #20174, #21418, #21391, #21394. --- source/blender/blenkernel/intern/image.c | 195 +++++++++--------- source/blender/blenlib/BLI_threads.h | 3 +- source/blender/blenlib/intern/threads.c | 5 + .../nodes/intern/CMP_nodes/CMP_composite.c | 4 +- .../nodes/intern/CMP_nodes/CMP_viewer.c | 6 +- .../blender/render/intern/source/pipeline.c | 11 +- 6 files changed, 108 insertions(+), 116 deletions(-) diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index ee3d685938b..f870fc1083b 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1932,113 +1932,93 @@ static ImBuf *image_get_ibuf_multilayer(Image *ima, ImageUser *iuser) /* always returns a single ibuf, also during render progress */ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_r) { - Render *re= NULL; - RenderResult *rr= NULL; - + Render *re; + RenderResult rres; + float *rectf, *rectz; + unsigned int *rect; + float dither; + int channels, layer, pass; + ImBuf *ibuf; + + if(!(iuser && iuser->scene)) + return NULL; + /* if we the caller is not going to release the lock, don't give the image */ if(!lock_r) return NULL; - if(iuser && iuser->scene) { - re= RE_GetRender(iuser->scene->id.name, RE_SLOT_VIEW); - rr= RE_AcquireResultRead(re); + re= RE_GetRender(iuser->scene->id.name, RE_SLOT_VIEW); - /* release is done in BKE_image_release_ibuf using lock_r */ - *lock_r= re; - } - - if(rr==NULL) - return NULL; + channels= 4; + layer= (iuser)? iuser->layer: 0; + pass= (iuser)? iuser->pass: 0; - if(RE_RenderInProgress(re)) { - ImBuf *ibuf= image_get_ibuf(ima, IMA_NO_INDEX, 0); - - /* make ibuf if needed, and initialize it */ - /* this only gets called when mutex locked */ - if(ibuf==NULL) { - ibuf= IMB_allocImBuf(rr->rectx, rr->recty, 32, IB_rect, 0); - image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0); - } + /* this gives active layer, composite or seqence result */ + RE_AcquireResultImage(re, &rres); + rect= (unsigned int *)rres.rect32; + rectf= rres.rectf; + rectz= rres.rectz; + dither= iuser->scene->r.dither_intensity; - return ibuf; + /* get compo/seq result by default */ + if(rres.rectf && layer==0); + else if(rres.layers.first) { + RenderLayer *rl= BLI_findlink(&rres.layers, layer-(rres.rectf?1:0)); + if(rl) { + RenderPass *rpass; + + /* there's no combined pass, is in renderlayer itself */ + if(pass==0) { + rectf= rl->rectf; + } + else { + rpass= BLI_findlink(&rl->passes, pass-1); + if(rpass) { + channels= rpass->channels; + rectf= rpass->rect; + dither= 0.0f; /* don't dither passes */ + } + } + + for(rpass= rl->passes.first; rpass; rpass= rpass->next) + if(rpass->passtype == SCE_PASS_Z) + rectz= rpass->rect; + } } - else { - RenderResult rres; - float *rectf, *rectz; - unsigned int *rect; - float dither; - int channels, layer, pass; - - channels= 4; - layer= (iuser)? iuser->layer: 0; - pass= (iuser)? iuser->pass: 0; - - /* this gives active layer, composite or seqence result */ - RE_AcquireResultImage(RE_GetRender(iuser->scene->id.name, RE_SLOT_VIEW), &rres); - rect= (unsigned int *)rres.rect32; - rectf= rres.rectf; - rectz= rres.rectz; - dither= iuser->scene->r.dither_intensity; - - /* get compo/seq result by default */ - if(rr->rectf && layer==0); - else if(rr->layers.first) { - RenderLayer *rl= BLI_findlink(&rr->layers, layer-(rr->rectf?1:0)); - if(rl) { - RenderPass *rpass; - - /* there's no combined pass, is in renderlayer itself */ - if(pass==0) { - rectf= rl->rectf; - } - else { - rpass= BLI_findlink(&rl->passes, pass-1); - if(rpass) { - channels= rpass->channels; - rectf= rpass->rect; - dither= 0.0f; /* don't dither passes */ - } - } - - for(rpass= rl->passes.first; rpass; rpass= rpass->next) - if(rpass->passtype == SCE_PASS_Z) - rectz= rpass->rect; - } - } - - if(rectf || rect) { - ImBuf *ibuf= image_get_ibuf(ima, IMA_NO_INDEX, 0); - - /* make ibuf if needed, and initialize it */ - if(ibuf==NULL) { - ibuf= IMB_allocImBuf(rr->rectx, rr->recty, 32, 0, 0); - image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0); - } - ibuf->x= rr->rectx; - ibuf->y= rr->recty; - - if(ibuf->rect_float!=rectf || rect) /* ensure correct redraw */ - imb_freerectImBuf(ibuf); - if(rect) - ibuf->rect= rect; - - ibuf->rect_float= rectf; - ibuf->flags |= IB_rectfloat; - ibuf->channels= channels; - ibuf->zbuf_float= rectz; - ibuf->flags |= IB_zbuffloat; - ibuf->dither= dither; - - RE_ReleaseResultImage(re); - - ima->ok= IMA_OK_LOADED; - return ibuf; - } - + + if(!(rectf || rect)) { RE_ReleaseResultImage(re); + return NULL; } + + ibuf= image_get_ibuf(ima, IMA_NO_INDEX, 0); + + /* make ibuf if needed, and initialize it */ + if(ibuf==NULL) { + ibuf= IMB_allocImBuf(rres.rectx, rres.recty, 32, 0, 0); + image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0); + } + ibuf->x= rres.rectx; + ibuf->y= rres.recty; - return NULL; + if(ibuf->rect_float!=rectf || rect) /* ensure correct redraw */ + imb_freerectImBuf(ibuf); + if(rect) + ibuf->rect= rect; + + ibuf->rect_float= rectf; + ibuf->flags |= IB_rectfloat; + ibuf->channels= channels; + ibuf->zbuf_float= rectz; + ibuf->flags |= IB_zbuffloat; + ibuf->dither= dither; + + ima->ok= IMA_OK_LOADED; + + /* release is done in BKE_image_release_ibuf using lock_r */ + *lock_r= re; + + return ibuf; } static ImBuf *image_get_ibuf_threadsafe(Image *ima, ImageUser *iuser, int *frame_r, int *index_r) @@ -2199,10 +2179,17 @@ ImBuf *BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **lock_r) ibuf= image_get_render_result(ima, iuser, lock_r); } else if(ima->type==IMA_TYPE_COMPOSITE) { - /* Composite Viewer, all handled in compositor */ - /* fake ibuf, will be filled in compositor */ - ibuf= IMB_allocImBuf(256, 256, 32, IB_rect, 0); - image_assign_ibuf(ima, ibuf, 0, frame); + /* requires lock/unlock, otherwise don't return image */ + if(lock_r) { + /* unlock in BKE_image_release_ibuf */ + BLI_lock_thread(LOCK_VIEWER); + *lock_r= ima; + + /* Composite Viewer, all handled in compositor */ + /* fake ibuf, will be filled in compositor */ + ibuf= IMB_allocImBuf(256, 256, 32, IB_rect, 0); + image_assign_ibuf(ima, ibuf, 0, frame); + } } } } @@ -2220,9 +2207,11 @@ ImBuf *BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **lock_r) void BKE_image_release_ibuf(Image *ima, void *lock) { - /* for getting image during threaded render, need to release */ - if(lock) - RE_ReleaseResult(lock); + /* for getting image during threaded render / compositing, need to release */ + if(lock == ima) + BLI_unlock_thread(LOCK_VIEWER); /* viewer image */ + else if(lock) + RE_ReleaseResultImage(lock); /* render result */ } ImBuf *BKE_image_get_ibuf(Image *ima, ImageUser *iuser) diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h index 25ecea919e7..08e24d677f5 100644 --- a/source/blender/blenlib/BLI_threads.h +++ b/source/blender/blenlib/BLI_threads.h @@ -59,7 +59,8 @@ int BLI_system_thread_count(void); /* gets the number of threads the system can #define LOCK_IMAGE 0 #define LOCK_PREVIEW 1 -#define LOCK_CUSTOM1 2 +#define LOCK_VIEWER 2 +#define LOCK_CUSTOM1 3 void BLI_lock_thread(int type); void BLI_unlock_thread(int type); diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index 02d6ab0b7b5..be016456fc4 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -109,6 +109,7 @@ A sample loop can look like this (pseudo c); static pthread_mutex_t _malloc_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t _image_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t _preview_lock = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t _viewer_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t _custom1_lock = PTHREAD_MUTEX_INITIALIZER; static int thread_levels= 0; /* threads can be invoked inside threads */ @@ -327,6 +328,8 @@ void BLI_lock_thread(int type) pthread_mutex_lock(&_image_lock); else if (type==LOCK_PREVIEW) pthread_mutex_lock(&_preview_lock); + else if (type==LOCK_VIEWER) + pthread_mutex_lock(&_viewer_lock); else if (type==LOCK_CUSTOM1) pthread_mutex_lock(&_custom1_lock); } @@ -337,6 +340,8 @@ void BLI_unlock_thread(int type) pthread_mutex_unlock(&_image_lock); else if (type==LOCK_PREVIEW) pthread_mutex_unlock(&_preview_lock); + else if (type==LOCK_VIEWER) + pthread_mutex_unlock(&_viewer_lock); else if(type==LOCK_CUSTOM1) pthread_mutex_unlock(&_custom1_lock); } diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_composite.c b/source/blender/nodes/intern/CMP_nodes/CMP_composite.c index 76a78e46e3a..9a302527a61 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_composite.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_composite.c @@ -80,10 +80,10 @@ static void node_composit_exec_composite(void *data, bNode *node, bNodeStack **i outbuf->malloc= 0; free_compbuf(outbuf); - RE_ReleaseResult(re); - /* signal for imageviewer to refresh (it converts to byte rects...) */ BKE_image_signal(BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result"), NULL, IMA_SIGNAL_FREE); + + RE_ReleaseResult(re); return; } else diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_viewer.c b/source/blender/nodes/intern/CMP_nodes/CMP_viewer.c index e62a7462702..80200ad9ce6 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_viewer.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_viewer.c @@ -50,13 +50,15 @@ static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in, ImBuf *ibuf; CompBuf *cbuf, *tbuf; int rectx, recty; + void *lock; BKE_image_user_calc_frame(node->storage, rd->cfra, 0); /* always returns for viewer image, but we check nevertheless */ - ibuf= BKE_image_get_ibuf(ima, node->storage); + ibuf= BKE_image_acquire_ibuf(ima, node->storage, &lock); if(ibuf==NULL) { printf("node_composit_exec_viewer error\n"); + BKE_image_release_ibuf(ima, lock); return; } @@ -106,6 +108,8 @@ static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in, free_compbuf(zbuf); } + BKE_image_release_ibuf(ima, lock); + generate_preview(data, node, cbuf); free_compbuf(cbuf); diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index ec250a7136b..b995e686c58 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -138,11 +138,6 @@ static void int_nothing(void *unused, int val) {} static void print_error(void *unused, char *str) {printf("ERROR: %s\n", str);} static int default_break(void *unused) {return G.afbreek == 1;} -int RE_RenderInProgress(Render *re) -{ - return re->result_ok==0; -} - static void stats_background(void *unused, RenderStats *rs) { uintptr_t mem_in_use= MEM_get_memory_in_use(); @@ -1091,6 +1086,8 @@ void RE_AcquireResultImage(Render *re, RenderResult *rr) if(rr->rectz==NULL) rr->rectz= RE_RenderLayerGetPass(rl, SCE_PASS_Z); } + + rr->layers= re->result->layers; } } } @@ -2801,7 +2798,6 @@ void RE_BlenderFrame(Render *re, Scene *scene, SceneRenderLayer *srl, unsigned i { /* ugly global still... is to prevent preview events and signal subsurfs etc to make full resol */ RenderGlobal.renderingslot= re->slot; - re->result_ok= 0; G.rendering= 1; scene->r.cfra= frame; @@ -2811,7 +2807,6 @@ void RE_BlenderFrame(Render *re, Scene *scene, SceneRenderLayer *srl, unsigned i } /* UGLY WARNING */ - re->result_ok= 1; G.rendering= 0; RenderGlobal.renderingslot= RenderGlobal.viewslot; } @@ -2917,7 +2912,6 @@ void RE_BlenderAnim(Render *re, Scene *scene, unsigned int lay, int sfra, int ef /* is also set by caller renderwin.c */ G.rendering= 1; RenderGlobal.renderingslot= re->slot; - re->result_ok= 0; if(BKE_imtype_is_movie(scene->r.imtype)) if(!mh->start_movie(scene, &re->r, re->rectx, re->recty, reports)) @@ -3014,7 +3008,6 @@ void RE_BlenderAnim(Render *re, Scene *scene, unsigned int lay, int sfra, int ef /* UGLY WARNING */ G.rendering= 0; - re->result_ok= 1; RenderGlobal.renderingslot= RenderGlobal.viewslot; } From 46ed51ce26ee78e82b8dfbc12040edbdbd39c6ad Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 17:19:42 +0000 Subject: [PATCH 084/153] made argument conversion for much more verbose, wasnt giving enough info with bad operator args. (commit 27432 by Campbell from render25 branch) --- source/blender/python/intern/bpy_rna.c | 45 ++++++++++++++++--------- source/blender/python/intern/bpy_util.c | 4 +-- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 0c6709dff24..b995fbb8800 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -768,7 +768,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, v } else /* continue... */ #endif if (!PySequence_Check(value)) { - PyErr_Format(PyExc_TypeError, "%.200s RNA array assignment expected a sequence instead of %.200s instance.", error_prefix, Py_TYPE(value)->tp_name); + PyErr_Format(PyExc_TypeError, "%.200s RNA array assignment to %.200s.%.200s expected a sequence instead of %.200s instance.", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), Py_TYPE(value)->tp_name); return -1; } /* done getting the length */ @@ -796,7 +796,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, v param = PyLong_AsSsize_t( value ); if( param < 0 || param > 1) { - PyErr_Format(PyExc_TypeError, "%.200s expected True/False or 0/1", error_prefix); + PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected True/False or 0/1", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop)); return -1; } else { if(data) *((int*)data)= param; @@ -808,7 +808,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, v { int param = PyLong_AsSsize_t(value); if (param==-1 && PyErr_Occurred()) { - PyErr_Format(PyExc_TypeError, "%.200s expected an int type", error_prefix); + PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected an int type", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop)); return -1; } else { RNA_property_int_clamp(ptr, prop, ¶m); @@ -821,7 +821,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, v { float param = PyFloat_AsDouble(value); if (PyErr_Occurred()) { - PyErr_Format(PyExc_TypeError, "%.200s expected a float type", error_prefix); + PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected a float type", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop)); return -1; } else { RNA_property_float_clamp(ptr, prop, (float *)¶m); @@ -835,7 +835,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, v char *param = _PyUnicode_AsString(value); if (param==NULL) { - PyErr_Format(PyExc_TypeError, "%.200s expected a string type", error_prefix); + PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected a string type", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop)); return -1; } else { if(data) *((char**)data)= param; @@ -864,7 +864,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, v } else { char *enum_str= pyrna_enum_as_string(ptr, prop); - PyErr_Format(PyExc_TypeError, "%.200s expected a string enum or a set of strings in (%.200s)", error_prefix, enum_str); + PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected a string enum or a set of strings in (%.2000s)", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), enum_str); MEM_freeN(enum_str); return -1; } @@ -886,13 +886,13 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, v } if(!BPy_StructRNA_Check(value) && value != Py_None) { - PyErr_Format(PyExc_TypeError, "%.200s expected a %.200s type", error_prefix, RNA_struct_identifier(ptype)); + PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected a %.200s type", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), RNA_struct_identifier(ptype)); return -1; } else if((flag & PROP_NEVER_NULL) && value == Py_None) { - PyErr_Format(PyExc_TypeError, "%.200s does not support a 'None' assignment %.200s type", error_prefix, RNA_struct_identifier(ptype)); + PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s does not support a 'None' assignment %.200s type", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), RNA_struct_identifier(ptype)); return -1; } else if(value != Py_None && ((flag & PROP_ID_SELF_CHECK) && ptr->id.data == ((BPy_StructRNA*)value)->ptr.id.data)) { - PyErr_Format(PyExc_TypeError, "%.200s ID type does not support assignment to its self", error_prefix); + PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s ID type does not support assignment to its self", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop)); return -1; } else { BPy_StructRNA *param= (BPy_StructRNA*)value; @@ -928,7 +928,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, v else { PointerRNA tmp; RNA_pointer_create(NULL, ptype, NULL, &tmp); - PyErr_Format(PyExc_TypeError, "%.200s expected a %.200s type", error_prefix, RNA_struct_identifier(tmp.type)); + PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected a %.200s type", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), RNA_struct_identifier(tmp.type)); return -1; } } @@ -936,7 +936,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, v if(raise_error) { PointerRNA tmp; RNA_pointer_create(NULL, ptype, NULL, &tmp); - PyErr_Format(PyExc_TypeError, "%.200s expected a %.200s type", error_prefix, RNA_struct_identifier(tmp.type)); + PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected a %.200s type", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), RNA_struct_identifier(tmp.type)); return -1; } } @@ -954,15 +954,22 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, v /* convert a sequence of dict's into a collection */ if(!PySequence_Check(value)) { - PyErr_Format(PyExc_TypeError, "%.200s expected a sequence of dicts for an RNA collection", error_prefix); + PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected a sequence for an RNA collection, found a '%.200s' instead", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), Py_TYPE(value)->tp_name); return -1; } - + seq_len = PySequence_Length(value); for(i=0; itype), RNA_property_identifier(prop), i); + Py_XDECREF(item); + return -1; + } + + if(PyDict_Check(item)==0) { + PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected a each sequence member to be a dict for an RNA collection, found a '%.200s' instead", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), Py_TYPE(item)->tp_name); Py_XDECREF(item); return -1; } @@ -976,7 +983,13 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, v RNA_property_collection_add(ptr, prop, &itemptr); if(pyrna_pydict_to_props(&itemptr, item, 1, "Converting a python list to an RNA collection")==-1) { + PyObject *msg= BPY_exception_buffer(); + char *msg_char= _PyUnicode_AsString(msg); + + PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s error converting a member of a collection from a dicts into an RNA collection, failed with: %s", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), msg_char); + Py_DECREF(item); + Py_DECREF(msg); return -1; } Py_DECREF(item); @@ -985,7 +998,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, v break; } default: - PyErr_Format(PyExc_AttributeError, "%.200s unknown property type (pyrna_py_to_prop)", error_prefix); + PyErr_Format(PyExc_AttributeError, "%.200s %.200s.%.200s unknown property type (pyrna_py_to_prop)", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop)); return -1; break; } diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index a2bcfa63c31..38462d1b176 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -243,8 +243,8 @@ PyObject *BPY_exception_buffer(void) PyErr_Clear(); - /* import StringIO / io - * string_io = StringIO.StringIO() + /* import io + * string_io = io.StringIO() */ if(! (string_io_mod= PyImport_ImportModule("io")) ) { From 9a986d194c85187fcbcbe84d2355763012661992 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 17:20:15 +0000 Subject: [PATCH 085/153] fix for nasty bug where registering properties would register them in the parent classes SRNA, made for confusing rigify args turning up in add sequencer adding collection. (commit 27433 by Campbell from render25 branch) --- .../ui/properties_data_armature_rigify.py | 44 +++++++-------- .../blender/python/intern/bpy_operator_wrap.c | 2 +- source/blender/python/intern/bpy_props.c | 36 +++++++------ source/blender/python/intern/bpy_rna.c | 53 +++++++------------ source/blender/python/intern/bpy_rna.h | 4 +- 5 files changed, 64 insertions(+), 75 deletions(-) diff --git a/release/scripts/ui/properties_data_armature_rigify.py b/release/scripts/ui/properties_data_armature_rigify.py index 99df79ed970..ba012368def 100644 --- a/release/scripts/ui/properties_data_armature_rigify.py +++ b/release/scripts/ui/properties_data_armature_rigify.py @@ -29,28 +29,6 @@ class PoseTemplateSettings(bpy.types.IDPropertyGroup): class PoseTemplate(bpy.types.IDPropertyGroup): pass -PoseTemplate.StringProperty(attr="name", - name="Name of the slave", - description="", - maxlen=64, - default="") - - -PoseTemplateSettings.CollectionProperty(attr="templates", type=PoseTemplate, name="Templates", description="") -PoseTemplateSettings.IntProperty(attr="active_template_index", - name="Index of the active slave", - description="", - default=-1, - min=-1, - max=65535) - -PoseTemplateSettings.BoolProperty(attr="generate_def_rig", - name="Create Deform Rig", - description="Create a copy of the metarig, constrainted by the generated rig", - default=False) - -bpy.types.Scene.PointerProperty(attr="pose_templates", type=PoseTemplateSettings, name="Pose Templates", description="Pose Template Settings") - def metarig_templates(): import rigify @@ -356,6 +334,28 @@ def register(): for cls in classes: register(cls) + PoseTemplate.StringProperty(attr="name", + name="Name of the slave", + description="", + maxlen=64, + default="") + + + PoseTemplateSettings.CollectionProperty(attr="templates", type=PoseTemplate, name="Templates", description="") + PoseTemplateSettings.IntProperty(attr="active_template_index", + name="Index of the active slave", + description="", + default=-1, + min=-1, + max=65535) + + PoseTemplateSettings.BoolProperty(attr="generate_def_rig", + name="Create Deform Rig", + description="Create a copy of the metarig, constrainted by the generated rig", + default=False) + + bpy.types.Scene.PointerProperty(attr="pose_templates", type=PoseTemplateSettings, name="Pose Templates", description="Pose Template Settings") + space_info.INFO_MT_armature_add.append(menu_func) diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index 56d49fcc889..0c1eafb4948 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -111,7 +111,7 @@ PyObject *PYOP_wrap_macro_define(PyObject *self, PyObject *args) } /* identifiers */ - srna= srna_from_self(macro); + srna= srna_from_self(macro, "Macro Define:"); macroname = RNA_struct_identifier(srna); ot = WM_operatortype_exists(macroname); diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 5bddd52dadf..c23ff2f2951 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -115,7 +115,7 @@ PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - srna= srna_from_self(self); + srna= srna_from_self(self, "BoolProperty(...):"); if(srna==NULL && PyErr_Occurred()) { return NULL; /* self's type was compatible but error getting the srna */ } @@ -181,7 +181,7 @@ PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - srna= srna_from_self(self); + srna= srna_from_self(self, "BoolVectorProperty(...):"); if(srna==NULL && PyErr_Occurred()) { return NULL; /* self's type was compatible but error getting the srna */ } @@ -258,7 +258,7 @@ PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - srna= srna_from_self(self); + srna= srna_from_self(self, "IntProperty(...):"); if(srna==NULL && PyErr_Occurred()) { return NULL; /* self's type was compatible but error getting the srna */ } @@ -325,7 +325,7 @@ PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - srna= srna_from_self(self); + srna= srna_from_self(self, "IntVectorProperty(...):"); if(srna==NULL && PyErr_Occurred()) { return NULL; /* self's type was compatible but error getting the srna */ } @@ -406,7 +406,7 @@ PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - srna= srna_from_self(self); + srna= srna_from_self(self, "FloatProperty(...):"); if(srna==NULL && PyErr_Occurred()) { return NULL; /* self's type was compatible but error getting the srna */ } @@ -481,7 +481,7 @@ PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - srna= srna_from_self(self); + srna= srna_from_self(self, "FloatVectorProperty(...):"); if(srna==NULL && PyErr_Occurred()) { return NULL; /* self's type was compatible but error getting the srna */ } @@ -559,7 +559,7 @@ PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - srna= srna_from_self(self); + srna= srna_from_self(self, "StringProperty(...):"); if(srna==NULL && PyErr_Occurred()) { return NULL; /* self's type was compatible but error getting the srna */ } @@ -671,7 +671,7 @@ PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - srna= srna_from_self(self); + srna= srna_from_self(self, "EnumProperty(...):"); if(srna==NULL && PyErr_Occurred()) { return NULL; /* self's type was compatible but error getting the srna */ } @@ -716,18 +716,22 @@ PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) } } -static StructRNA *pointer_type_from_py(PyObject *value) +static StructRNA *pointer_type_from_py(PyObject *value, const char *error_prefix) { StructRNA *srna; - srna= srna_from_self(value); + srna= srna_from_self(value, "BoolProperty(...):"); if(!srna) { - PyErr_SetString(PyExc_SystemError, "expected an RNA type derived from IDPropertyGroup"); + + PyObject *msg= BPY_exception_buffer(); + char *msg_char= _PyUnicode_AsString(msg); + PyErr_Format(PyExc_TypeError, "%.200s expected an RNA type derived from IDPropertyGroup, failed with: %s", error_prefix, msg_char); + Py_DECREF(msg); return NULL; } if(!RNA_struct_is_a(srna, &RNA_IDPropertyGroup)) { - PyErr_SetString(PyExc_SystemError, "expected an RNA type derived from IDPropertyGroup"); + PyErr_Format(PyExc_SystemError, "%.200s expected an RNA type derived from IDPropertyGroup", error_prefix); return NULL; } @@ -752,7 +756,7 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - srna= srna_from_self(self); + srna= srna_from_self(self, "PointerProperty(...):"); if(srna==NULL && PyErr_Occurred()) { return NULL; /* self's type was compatible but error getting the srna */ } @@ -777,7 +781,7 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw) if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "PointerProperty(options={...}):")) return NULL; - ptype= pointer_type_from_py(type); + ptype= pointer_type_from_py(type, "PointerProperty(...):"); if(!ptype) return NULL; @@ -813,7 +817,7 @@ PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - srna= srna_from_self(self); + srna= srna_from_self(self, "CollectionProperty(...):"); if(srna==NULL && PyErr_Occurred()) { return NULL; /* self's type was compatible but error getting the srna */ } @@ -838,7 +842,7 @@ PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw) if(pyopts && pyrna_set_to_enum_bitfield(property_flag_items, pyopts, &opts, "CollectionProperty(options={...}):")) return NULL; - ptype= pointer_type_from_py(type); + ptype= pointer_type_from_py(type, "CollectionProperty(...):"); if(!ptype) return NULL; diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index b995fbb8800..c9906bb1599 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -3537,26 +3537,6 @@ static void pyrna_subtype_set_rna(PyObject *newclass, StructRNA *srna) } } -/* -static StructRNA *srna_from_self(PyObject *self); -PyObject *BPy_GetStructRNA(PyObject *self) -{ - StructRNA *srna= pyrna_struct_as_srna(self); - PointerRNA ptr; - PyObject *ret; - - RNA_pointer_create(NULL, &RNA_Struct, srna, &ptr); - ret= pyrna_struct_CreatePyObject(&ptr); - - if(ret) { - return ret; - } - else { - Py_RETURN_NONE; - } -} -*/ - static PyObject* pyrna_srna_Subtype(StructRNA *srna); /* return a borrowed reference */ @@ -3897,7 +3877,7 @@ PyObject *BPY_rna_types(void) return (PyObject *)self; } -StructRNA *pyrna_struct_as_srna(PyObject *self) +StructRNA *pyrna_struct_as_srna(PyObject *self, int parent, const char *error_prefix) { BPy_StructRNA *py_srna = NULL; StructRNA *srna; @@ -3907,23 +3887,27 @@ StructRNA *pyrna_struct_as_srna(PyObject *self) py_srna = (BPy_StructRNA *)PyDict_GetItemString(((PyTypeObject *)self)->tp_dict, "bl_rna"); Py_XINCREF(py_srna); } - - if(py_srna==NULL) - py_srna = (BPy_StructRNA*)PyObject_GetAttrString(self, "bl_rna"); + + if(parent) { + /* be very careful with this since it will return a parent classes srna. + * modifying this will do confusing stuff! */ + if(py_srna==NULL) + py_srna = (BPy_StructRNA*)PyObject_GetAttrString(self, "bl_rna"); + } if(py_srna==NULL) { - PyErr_SetString(PyExc_SystemError, "internal error, self had no bl_rna attribute, should never happen."); + PyErr_Format(PyExc_SystemError, "%.200s internal error, self of type '%.200s' had no bl_rna attribute, should never happen", error_prefix, Py_TYPE(self)->tp_name); return NULL; } if(!BPy_StructRNA_Check(py_srna)) { - PyErr_Format(PyExc_SystemError, "internal error, bl_rna was of type %.200s, instead of %.200s instance.", Py_TYPE(py_srna)->tp_name, pyrna_struct_Type.tp_name); + PyErr_Format(PyExc_SystemError, "%.200s internal error, bl_rna was of type '%.200s', instead of %.200s instance", error_prefix, Py_TYPE(py_srna)->tp_name, pyrna_struct_Type.tp_name); Py_DECREF(py_srna); return NULL; } if(py_srna->ptr.type != &RNA_Struct) { - PyErr_SetString(PyExc_SystemError, "internal error, bl_rna was not a RNA_Struct type of rna struct."); + PyErr_Format(PyExc_SystemError, "%.200s internal error, bl_rna was not a RNA_Struct type of rna struct", error_prefix); Py_DECREF(py_srna); return NULL; } @@ -3937,7 +3921,7 @@ StructRNA *pyrna_struct_as_srna(PyObject *self) /* Orphan functions, not sure where they should go */ /* get the srna for methods attached to types */ /* */ -StructRNA *srna_from_self(PyObject *self) +StructRNA *srna_from_self(PyObject *self, const char *error_prefix) { /* a bit sloppy but would cause a very confusing bug if * an error happened to be set here */ @@ -3955,7 +3939,7 @@ StructRNA *srna_from_self(PyObject *self) /* These cases above not errors, they just mean the type was not compatible * After this any errors will be raised in the script */ - return pyrna_struct_as_srna(self); + return pyrna_struct_as_srna(self, 0, error_prefix); } static int deferred_register_prop(StructRNA *srna, PyObject *item, PyObject *key, PyObject *dummy_args) @@ -4451,11 +4435,12 @@ PyObject *pyrna_basetype_register(PyObject *self, PyObject *py_class) const char *identifier= ""; if(PyDict_GetItemString(((PyTypeObject*)py_class)->tp_dict, "bl_rna")) { - PyErr_SetString(PyExc_AttributeError, "bpy.types.register(): already registered as a subclass."); + PyErr_SetString(PyExc_AttributeError, "bpy.types.register(...): already registered as a subclass."); return NULL; } - srna= pyrna_struct_as_srna(py_class); + /* warning: gets parent classes srna, only for the register function */ + srna= pyrna_struct_as_srna(py_class, 1, "bpy.types.register(...):"); if(srna==NULL) return NULL; @@ -4463,7 +4448,7 @@ PyObject *pyrna_basetype_register(PyObject *self, PyObject *py_class) reg= RNA_struct_register(srna); if(!reg) { - PyErr_SetString(PyExc_ValueError, "bpy.types.register(): expected a Type subclassed from a registerable rna type (no register supported)."); + PyErr_SetString(PyExc_ValueError, "bpy.types.register(...): expected a Type subclassed from a registerable rna type (no register supported)."); return NULL; } @@ -4526,7 +4511,7 @@ PyObject *pyrna_basetype_unregister(PyObject *self, PyObject *py_class) return NULL; }*/ - srna= pyrna_struct_as_srna(py_class); + srna= pyrna_struct_as_srna(py_class, 0, "bpy.types.unregister(...):"); if(srna==NULL) return NULL; @@ -4534,7 +4519,7 @@ PyObject *pyrna_basetype_unregister(PyObject *self, PyObject *py_class) unreg= RNA_struct_unregister(srna); if(!unreg) { - PyErr_SetString(PyExc_ValueError, "bpy.types.unregister(): expected a Type subclassed from a registerable rna type (no unregister supported)."); + PyErr_SetString(PyExc_ValueError, "bpy.types.unregister(...): expected a Type subclassed from a registerable rna type (no unregister supported)."); return NULL; } diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index 770e88e1a1d..9892ed6989b 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -64,8 +64,8 @@ typedef struct { /* cheap trick */ #define BPy_BaseTypeRNA BPy_PropertyRNA -StructRNA *srna_from_self(PyObject *self); -StructRNA *pyrna_struct_as_srna(PyObject *self); +StructRNA *srna_from_self(PyObject *self, const char *error_prefix); +StructRNA *pyrna_struct_as_srna(PyObject *self, int parent, const char *error_prefix); void BPY_rna_init( void ); PyObject *BPY_rna_module( void ); From 63a368ceaa747271d417c98c607a61374e3cfb68 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 17:23:20 +0000 Subject: [PATCH 086/153] - menu for selecting add scenes for the sequencer. - update internal 'btempdir' from userprefs on changing and initializing the temp dir. - add sequence strip operators nolonger require the sequence view to be active (better for automation). (commit 27434 by Campbell from render25 branch) --- release/scripts/ui/space_sequencer.py | 2 +- .../editors/space_sequencer/sequencer_add.c | 44 +++++++++++++++---- source/blender/makesrna/intern/rna_userdef.c | 8 +++- .../blender/windowmanager/intern/wm_files.c | 4 ++ source/creator/creator.c | 2 +- 5 files changed, 48 insertions(+), 12 deletions(-) diff --git a/release/scripts/ui/space_sequencer.py b/release/scripts/ui/space_sequencer.py index 8badf741fac..0bf86642b25 100644 --- a/release/scripts/ui/space_sequencer.py +++ b/release/scripts/ui/space_sequencer.py @@ -185,7 +185,7 @@ class SEQUENCER_MT_add(bpy.types.Menu): layout.operator_context = 'INVOKE_REGION_WIN' layout.column() - layout.operator("sequencer.scene_strip_add", text="Scene") + layout.operator_menu_enum("sequencer.scene_strip_add", "scene", text="Scene...") layout.operator("sequencer.movie_strip_add", text="Movie") layout.operator("sequencer.image_strip_add", text="Image") layout.operator("sequencer.sound_strip_add", text="Sound") diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 7a809f7b668..241ab2e854d 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -191,7 +191,7 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) start_frame= RNA_int_get(op->ptr, "start_frame"); channel= RNA_int_get(op->ptr, "channel"); - sce_seq= BLI_findlink(&CTX_data_main(C)->scene, RNA_enum_get(op->ptr, "type")); + sce_seq= BLI_findlink(&CTX_data_main(C)->scene, RNA_enum_get(op->ptr, "scene")); if (sce_seq==NULL) { BKE_report(op->reports, RPT_ERROR, "Scene not found"); @@ -232,6 +232,11 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) { + if(ED_operator_sequencer_active(C)) { + BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); + return OPERATOR_CANCELLED; + } + sequencer_generic_invoke_xy__internal(C, op, event, 0); return sequencer_add_scene_strip_exec(C, op); // needs a menu @@ -252,14 +257,15 @@ void SEQUENCER_OT_scene_strip_add(struct wmOperatorType *ot) ot->invoke= sequencer_add_scene_strip_invoke; ot->exec= sequencer_add_scene_strip_exec; - ot->poll= ED_operator_sequencer_active; + ot->poll= ED_operator_scene_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME); - prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, 0, "Type", ""); + prop= RNA_def_enum(ot->srna, "scene", DummyRNA_NULL_items, 0, "Scene", ""); RNA_def_enum_funcs(prop, RNA_scene_itemf); + ot->prop= prop; } static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoadFunc seq_load_func) @@ -318,7 +324,12 @@ static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op) static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) -{ +{ + if(ED_operator_sequencer_active(C)) { + BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); + return OPERATOR_CANCELLED; + } + sequencer_generic_invoke_xy__internal(C, op, event, 0); return WM_operator_filesel(C, op, event); //return sequencer_add_movie_strip_exec(C, op); @@ -337,7 +348,7 @@ void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot) ot->invoke= sequencer_add_movie_strip_invoke; ot->exec= sequencer_add_movie_strip_exec; - ot->poll= ED_operator_sequencer_active; + ot->poll= ED_operator_scene_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -355,7 +366,12 @@ static int sequencer_add_sound_strip_exec(bContext *C, wmOperator *op) } static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) -{ +{ + if(ED_operator_sequencer_active(C)) { + BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); + return OPERATOR_CANCELLED; + } + sequencer_generic_invoke_xy__internal(C, op, event, 0); return WM_operator_filesel(C, op, event); //return sequencer_add_sound_strip_exec(C, op); @@ -374,7 +390,7 @@ void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot) ot->invoke= sequencer_add_sound_strip_invoke; ot->exec= sequencer_add_sound_strip_exec; - ot->poll= ED_operator_sequencer_active; + ot->poll= ED_operator_scene_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -442,6 +458,11 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) static int sequencer_add_image_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) { + if(ED_operator_sequencer_active(C)) { + BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); + return OPERATOR_CANCELLED; + } + sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_ENDFRAME); return WM_operator_filesel(C, op, event); //return sequencer_add_image_strip_exec(C, op); @@ -460,7 +481,7 @@ void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot) ot->invoke= sequencer_add_image_strip_invoke; ot->exec= sequencer_add_image_strip_exec; - ot->poll= ED_operator_sequencer_active; + ot->poll= ED_operator_scene_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -581,6 +602,11 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) /* add color */ static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) { + if(ED_operator_sequencer_active(C)) { + BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); + return OPERATOR_CANCELLED; + } + sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_ENDFRAME); if (RNA_property_is_set(op->ptr, "type") && RNA_enum_get(op->ptr, "type")==SEQ_PLUGIN) { @@ -603,7 +629,7 @@ void SEQUENCER_OT_effect_strip_add(struct wmOperatorType *ot) ot->invoke= sequencer_add_effect_strip_invoke; ot->exec= sequencer_add_effect_strip_exec; - ot->poll= ED_operator_sequencer_active; + ot->poll= ED_operator_scene_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 8a1b37c2ecf..2e1352eaa8e 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -228,7 +228,12 @@ static void rna_userdef_addon_remove(bAddon *bext) BLI_freelinkN(&U.addons, bext); } - +static void rna_userdef_temp_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + extern char btempdir[]; + UserDef *userdef = (UserDef*)ptr->data; + strncpy(btempdir, userdef->tempdir, FILE_MAXDIR+FILE_MAXFILE); +} #else @@ -2709,6 +2714,7 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) prop= RNA_def_property(srna, "temporary_directory", PROP_STRING, PROP_DIRPATH); RNA_def_property_string_sdna(prop, NULL, "tempdir"); RNA_def_property_ui_text(prop, "Temporary Directory", "The directory for storing temporary save files"); + RNA_def_property_update(prop, 0, "rna_userdef_temp_update"); prop= RNA_def_property(srna, "image_editor", PROP_STRING, PROP_DIRPATH); RNA_def_property_string_sdna(prop, NULL, "image_editor"); diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 2a8091c1aa2..d535d8f5ea1 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -238,6 +238,8 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist) /* in case UserDef was read, we re-initialize all, and do versioning */ static void wm_init_userdef(bContext *C) { + extern char btempdir[]; + UI_init_userdef(); MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024); sound_init(CTX_data_main(C)); @@ -245,6 +247,8 @@ static void wm_init_userdef(bContext *C) /* set the python auto-execute setting from user prefs */ if (U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) G.f &= ~G_SCRIPT_AUTOEXEC; else G.f |= G_SCRIPT_AUTOEXEC; + + if(U.tempdir[0]) strncpy(btempdir, U.tempdir, FILE_MAXDIR+FILE_MAXFILE); } void WM_read_file(bContext *C, char *name, ReportList *reports) diff --git a/source/creator/creator.c b/source/creator/creator.c index 3eb2cad1f65..a3a43a4629d 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -1000,7 +1000,7 @@ int main(int argc, char **argv) WM_init(C, argc, argv); - // XXX BRECHT SOLVE + /* this is properly initialized with user defs, but this is default */ BLI_where_is_temp( btempdir, 1 ); /* call after loading the .B.blend so we can read U.tempdir */ #ifndef DISABLE_SDL From 74fc6a07c028fbe7c3863fcddb6683e94470a445 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 17:23:51 +0000 Subject: [PATCH 087/153] library data selector, respect hide dot data, unless the user enters a '.' (commit 27435 by Campbell from render25 branch) --- source/blender/editors/interface/interface_templates.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index efd741a12f6..b7761da76c0 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -31,6 +31,7 @@ #include "DNA_color_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" +#include "DNA_userdef_types.h" #include "BLI_string.h" @@ -164,9 +165,15 @@ static void id_search_cb(const bContext *C, void *arg_template, char *str, uiSea /* ID listbase */ for(id= lb->first; id; id= id->next) { if(!((flag & PROP_ID_SELF_CHECK) && id == id_from)) { + + /* hide dot-datablocks */ + if(U.uiflag & USER_HIDE_DOT) + if ((id->name[2]=='.') && (str[0] != '.')) + continue; + if(BLI_strcasestr(id->name+2, str)) { iconid= ui_id_icon_get((bContext*)C, id, 0); - + if(!uiSearchItemAdd(items, id->name+2, id, iconid)) break; } From f12ef1202143a9722d806c49e172c782babdbd78 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 17:24:13 +0000 Subject: [PATCH 088/153] error in recent commit. (commit 27437 by Campbell from render25 branch) --- source/blender/editors/space_sequencer/sequencer_add.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 241ab2e854d..a138866956a 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -232,7 +232,7 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) { - if(ED_operator_sequencer_active(C)) { + if(!ED_operator_sequencer_active(C)) { BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); return OPERATOR_CANCELLED; } @@ -325,7 +325,7 @@ static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op) static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) { - if(ED_operator_sequencer_active(C)) { + if(!ED_operator_sequencer_active(C)) { BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); return OPERATOR_CANCELLED; } @@ -367,7 +367,7 @@ static int sequencer_add_sound_strip_exec(bContext *C, wmOperator *op) static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) { - if(ED_operator_sequencer_active(C)) { + if(!ED_operator_sequencer_active(C)) { BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); return OPERATOR_CANCELLED; } @@ -458,7 +458,7 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) static int sequencer_add_image_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) { - if(ED_operator_sequencer_active(C)) { + if(!ED_operator_sequencer_active(C)) { BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); return OPERATOR_CANCELLED; } @@ -602,7 +602,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) /* add color */ static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) { - if(ED_operator_sequencer_active(C)) { + if(!ED_operator_sequencer_active(C)) { BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); return OPERATOR_CANCELLED; } From 5c9c50e13bf9a9ce9f5f2f642ea692c8ce4aa331 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 17:37:34 +0000 Subject: [PATCH 089/153] change the scene opengl sequence rendering to be a global option with rendering and scrubbing settings. still need to do a do_versions for this to work right without changing settings. (commit 27442 by Campbell from render25 branch) --- release/scripts/ui/space_sequencer.py | 25 +++++++++++++++++-- source/blender/blenkernel/BKE_sequencer.h | 2 +- source/blender/blenkernel/intern/scene.c | 6 ++++- source/blender/blenkernel/intern/sequencer.c | 7 ++++-- source/blender/editors/include/ED_view3d.h | 2 +- .../editors/space_view3d/view3d_draw.c | 4 +-- source/blender/makesdna/DNA_scene_types.h | 13 ++++++++++ source/blender/makesdna/DNA_sequence_types.h | 2 -- source/blender/makesrna/RNA_enum_types.h | 2 ++ source/blender/makesrna/intern/rna_scene.c | 22 ++++++++++++++++ .../blender/makesrna/intern/rna_sequencer.c | 5 ---- source/blender/makesrna/intern/rna_space.c | 16 ++++++------ source/creator/creator.c | 2 +- 13 files changed, 83 insertions(+), 25 deletions(-) diff --git a/release/scripts/ui/space_sequencer.py b/release/scripts/ui/space_sequencer.py index 0bf86642b25..2eb889d2c1d 100644 --- a/release/scripts/ui/space_sequencer.py +++ b/release/scripts/ui/space_sequencer.py @@ -361,6 +361,28 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel): col.prop(strip, "end_still", text="End") +class SEQUENCER_PT_preview(bpy.types.Panel): + bl_label = "Scene Preview/Render" + bl_space_type = 'SEQUENCE_EDITOR' + bl_region_type = 'UI' + + def draw(self, context): + layout = self.layout + render = context.scene.render + + col = layout.column() + col.prop(render, "use_sequencer_gl_preview", text="Open GL Preview") + col = layout.column() + col.active = render.use_sequencer_gl_preview + col.prop(render, "sequencer_gl_preview", text="") + + col = layout.column() + col.prop(render, "use_sequencer_gl_render", text="Open GL Render") + col = layout.column() + col.active = render.use_sequencer_gl_render + col.prop(render, "sequencer_gl_render", text="") + + class SEQUENCER_PT_effect(SequencerButtonsPanel): bl_label = "Effect Strip" @@ -621,8 +643,6 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel): layout.label(text="Camera Override") layout.template_ID(strip, "scene_camera") - layout.prop(strip, "use_opengl") - class SEQUENCER_PT_filter(SequencerButtonsPanel): bl_label = "Filter" @@ -731,6 +751,7 @@ classes = [ SEQUENCER_MT_strip, SEQUENCER_PT_edit, # sequencer panels + SEQUENCER_PT_preview, SEQUENCER_PT_effect, SEQUENCER_PT_input_movie, SEQUENCER_PT_input_image, diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 21cd2f694ca..40168882dcb 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -234,7 +234,7 @@ struct Sequence *sequencer_add_sound_strip(struct bContext *C, ListBase *seqbase struct Sequence *sequencer_add_movie_strip(struct bContext *C, ListBase *seqbasep, struct SeqLoadInfo *seq_load); /* view3d draw callback, run when not in background view */ -typedef struct ImBuf *(*SequencerDrawView)(struct Scene *, int, int); +typedef struct ImBuf *(*SequencerDrawView)(struct Scene *, int, int, int); extern SequencerDrawView sequencer_view3d_cb; /* copy/paste */ diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 3f0ef5f5bff..82aa5576a78 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -365,7 +365,11 @@ Scene *add_scene(char *name) sce->r.scemode= R_DOCOMP|R_DOSEQ|R_EXTENSION; sce->r.stamp= R_STAMP_TIME|R_STAMP_FRAME|R_STAMP_DATE|R_STAMP_SCENE|R_STAMP_CAMERA|R_STAMP_RENDERTIME; sce->r.stamp_font_id= 12; - + + sce->r.seq_prev_type= OB_SOLID; + sce->r.seq_rend_type= OB_SOLID; + sce->r.seq_flag= R_SEQ_GL_PREV; + sce->r.threads= 1; sce->r.simplify_subsurf= 6; diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 5e3ab5f5f84..5b4278c21fb 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -2152,6 +2152,9 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int int rendering = 1; int doseq; + int doseq_gl= G.rendering ? (scene->r.seq_flag & R_SEQ_GL_REND) : (scene->r.seq_flag & R_SEQ_GL_PREV); + + printf("%d\n", G.rendering); /* prevent eternal loop */ doseq= scene->r.scemode & R_DOSEQ; @@ -2167,10 +2170,10 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int seq->scene->markers.first= seq->scene->markers.last= NULL; #endif - if(sequencer_view3d_cb && (seq->flag & SEQ_USE_SCENE_OPENGL) && (seq->scene == scene || have_seq==0)) { + if(sequencer_view3d_cb && doseq_gl && (seq->scene == scene || have_seq==0)) { /* opengl offscreen render */ scene_update_for_newframe(seq->scene, seq->scene->lay); - se->ibuf= sequencer_view3d_cb(seq->scene, seqrectx, seqrecty); + se->ibuf= sequencer_view3d_cb(seq->scene, seqrectx, seqrecty, scene->r.seq_prev_type); } else { Render *re; diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index dfae3e6dda6..24c47c4e549 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -161,7 +161,7 @@ void ED_view3d_draw_offscreen(struct Scene *scene, struct View3D *v3d, struct AR int winx, int winy, float viewmat[][4], float winmat[][4]); struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey); -struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height); +struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height, int drawtype); void view3d_clipping_local(struct RegionView3D *rv3d, float mat[][4]); diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index ac66dfa621c..16a8b1d0e8b 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2078,7 +2078,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in } /* creates own 3d views, used by the sequencer */ -ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height) +ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height, int drawtype) { View3D v3d; ARegion ar; @@ -2095,7 +2095,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height v3d.camera= scene->camera; v3d.lay= scene->lay; - v3d.drawtype = OB_SOLID; /* should be able to configure */ + v3d.drawtype = drawtype; rv3d.persp= RV3D_CAMOB; diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 283408ba853..a5273e06afb 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -360,6 +360,12 @@ typedef struct RenderData { float fg_stamp[4]; float bg_stamp[4]; + /* sequencer options */ + char seq_prev_type; + char seq_rend_type; + char seq_flag; /* flag use for sequence render/draw */ + char pad5[5]; + /* render simplify */ int simplify_flag; short simplify_subsurf; @@ -838,6 +844,10 @@ typedef struct Scene { #define R_TOUCH 0x800000 /* touch files before rendering */ #define R_SIMPLIFY 0x1000000 +/* seq_flag */ +#define R_SEQ_GL_PREV 1 +#define R_SEQ_GL_REND 2 + /* displaymode */ #define R_OUTPUT_SCREEN 0 @@ -979,6 +989,9 @@ typedef struct Scene { /* simplify_flag */ #define R_SIMPLE_NO_TRIANGULATE 1 +/* sequencer seq_prev_type seq_rend_type */ + + /* **************** SCENE ********************* */ /* for general use */ diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index 56d949e9d34..1a73588d6eb 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -275,8 +275,6 @@ typedef struct SpeedControlVars { #define SEQ_USE_PROXY_CUSTOM_FILE 2097152 #define SEQ_USE_EFFECT_DEFAULT_FADE 4194304 -#define SEQ_USE_SCENE_OPENGL 8388608 - /* deprecated, dont use a flag anymore*/ /*#define SEQ_ACTIVE 1048576*/ diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index 231ab766d6c..9ccab8394e9 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -84,6 +84,8 @@ extern EnumPropertyItem wm_report_items[]; extern EnumPropertyItem property_type_items[]; extern EnumPropertyItem property_unit_items[]; +extern EnumPropertyItem viewport_shading_items[]; + struct bContext; struct PointerRNA; EnumPropertyItem *rna_TransformOrientation_itemf(struct bContext *C, struct PointerRNA *ptr, int *free); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 5139a06aba5..643e6f64a6e 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -26,6 +26,7 @@ #include "RNA_define.h" #include "RNA_types.h" +#include "RNA_enum_types.h" #include "rna_internal.h" @@ -2504,6 +2505,27 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + /* sequencer draw options */ + + prop= RNA_def_property(srna, "use_sequencer_gl_preview", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_PREV); + RNA_def_property_ui_text(prop, "Sequencer OpenGL", ""); + + prop= RNA_def_property(srna, "use_sequencer_gl_render", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_REND); + RNA_def_property_ui_text(prop, "Sequencer OpenGL", ""); + + + prop= RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "seq_prev_type"); + RNA_def_property_enum_items(prop, viewport_shading_items); + RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view"); + + prop= RNA_def_property(srna, "sequencer_gl_render", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "seq_rend_type"); + RNA_def_property_enum_items(prop, viewport_shading_items); + RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view"); + /* layers */ prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 7d34caf0853..bdba1778d6b 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -926,11 +926,6 @@ static void rna_def_scene(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Camera Override", "Override the scenes active camera"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); - prop= RNA_def_property(srna, "use_opengl", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_SCENE_OPENGL); - RNA_def_property_ui_text(prop, "Use OpenGL", "Use OpenGL preview rather then rendering the scene"); - RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); - rna_def_filter_video(srna); rna_def_proxy(srna); rna_def_input(srna); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index ddbeb8a85fe..19dc132c834 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -90,6 +90,14 @@ EnumPropertyItem autosnap_items[] = { {SACTSNAP_MARKER, "MARKER", 0, "Nearest Marker", "Snap to nearest marker"}, {0, NULL, 0, NULL, NULL}}; +EnumPropertyItem viewport_shading_items[] = { + {OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"}, + {OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"}, + {OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"}, + //{OB_SHADED, "SHADED", ICON_SMOOTH, "Shaded", "Display the object solid, with preview shading interpolated at vertices"}, + {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Textured", "Display the object solid, with face-assigned textures"}, + {0, NULL, 0, NULL, NULL}}; + #ifdef RNA_RUNTIME #include "DNA_anim_types.h" @@ -814,14 +822,6 @@ static void rna_def_space_3dview(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; int matrix_dimsize[]= {4, 4}; - - static EnumPropertyItem viewport_shading_items[] = { - {OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"}, - {OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"}, - {OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"}, - //{OB_SHADED, "SHADED", ICON_SMOOTH, "Shaded", "Display the object solid, with preview shading interpolated at vertices"}, - {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Textured", "Display the object solid, with face-assigned textures"}, - {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem pivot_items[] = { {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""}, diff --git a/source/creator/creator.c b/source/creator/creator.c index a3a43a4629d..703ed09c976 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -1028,7 +1028,7 @@ int main(int argc, char **argv) * Update: now this function also inits the bpymenus, which also depend * on U.pythondir. */ - + // TODO - U.pythondir #endif From 056972a97fec313e53fad24afcf718f013d77a4b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 17:42:58 +0000 Subject: [PATCH 090/153] minor changes to rna names for consistancy (commit 27445 by Campbell from render25 branch) --- release/scripts/io/netrender/utils.py | 2 +- release/scripts/ui/properties_render.py | 6 +++--- source/blender/blenkernel/intern/sequencer.c | 2 -- source/blender/makesrna/intern/rna_scene.c | 12 ++++++------ 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/release/scripts/io/netrender/utils.py b/release/scripts/io/netrender/utils.py index fdf788daceb..37787732f09 100644 --- a/release/scripts/io/netrender/utils.py +++ b/release/scripts/io/netrender/utils.py @@ -199,7 +199,7 @@ def thumbnail(filename): if bpy: scene = bpy.data.scenes[0] # FIXME, this is dodgy! scene.render.file_format = "JPEG" - scene.render.quality = 90 + scene.render.file_quality = 90 bpy.ops.image.open(path = filename) img = bpy.data.images[imagename] img.save_render(thumbname, scene=scene) diff --git a/release/scripts/ui/properties_render.py b/release/scripts/ui/properties_render.py index 23dc434ae38..959deba7927 100644 --- a/release/scripts/ui/properties_render.py +++ b/release/scripts/ui/properties_render.py @@ -312,11 +312,11 @@ class RENDER_PT_output(RenderButtonsPanel): col.prop(rd, "use_overwrite") col.prop(rd, "use_placeholder") - if rd.file_format in ('AVIJPEG', 'JPEG'): + if rd.file_format in ('AVI_JPEG', 'JPEG'): split = layout.split() - split.prop(rd, "quality", slider=True) + split.prop(rd, "file_quality", slider=True) - elif rd.file_format == 'OPENEXR': + elif rd.file_format == 'OPEN_EXR': split = layout.split() col = split.column() diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 5b4278c21fb..42586ce18d7 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -2154,8 +2154,6 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int int doseq; int doseq_gl= G.rendering ? (scene->r.seq_flag & R_SEQ_GL_REND) : (scene->r.seq_flag & R_SEQ_GL_PREV); - printf("%d\n", G.rendering); - /* prevent eternal loop */ doseq= scene->r.scemode & R_DOSEQ; scene->r.scemode &= ~R_DOSEQ; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 643e6f64a6e..f4f05168920 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -100,22 +100,22 @@ EnumPropertyItem image_type_items[] = { #endif {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", ""}, {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", ""}, - {R_RAWTGA, "RAWTARGA", ICON_FILE_IMAGE, "Targa Raw", ""}, + {R_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", ""}, //{R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", ""}, // XXX not yet implemented {R_HAMX, "HAMX", ICON_FILE_IMAGE, "HamX", ""}, {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", ""}, {0, "", 0, " ", NULL}, #ifdef WITH_OPENEXR - {R_OPENEXR, "OPENEXR", ICON_FILE_IMAGE, "OpenEXR", ""}, + {R_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", ""}, {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", ""}, #endif {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", ""}, // XXX only with G.have_libtiff - {R_RADHDR, "RADHDR", ICON_FILE_IMAGE, "Radiance HDR", ""}, + {R_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", ""}, {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", ""}, {R_DPX, "DPX", ICON_FILE_IMAGE, "DPX", ""}, {0, "", 0, "Movie", NULL}, - {R_AVIRAW, "AVIRAW", ICON_FILE_MOVIE, "AVI Raw", ""}, - {R_AVIJPEG, "AVIJPEG", ICON_FILE_MOVIE, "AVI JPEG", ""}, + {R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", ""}, + {R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", ""}, #ifdef _WIN32 {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", ""}, #endif @@ -1899,7 +1899,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) /* JPEG and AVI JPEG */ - prop= RNA_def_property(srna, "quality", PROP_INT, PROP_PERCENTAGE); + prop= RNA_def_property(srna, "file_quality", PROP_INT, PROP_PERCENTAGE); RNA_def_property_int_sdna(prop, NULL, "quality"); RNA_def_property_range(prop, 1, 100); RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies"); From ecb35d463b7bad409142f02d37068459b98654bc Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 17:45:01 +0000 Subject: [PATCH 091/153] made re-project UI less confusing (commit 27457 by Campbell from render25 branch) --- release/scripts/ui/space_view3d_toolbar.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py index c52c93e2189..a4b908bf1d1 100644 --- a/release/scripts/ui/space_view3d_toolbar.py +++ b/release/scripts/ui/space_view3d_toolbar.py @@ -911,16 +911,17 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel): sub = col.column() sub.prop(ipaint, "seam_bleed") - row = col.row(align=True) - row.operator("image.project_edit", text="View Edit") + col.label(text="External Editing") + row = col.split(align=True, percentage=0.55) + row.operator("image.project_edit", text="Quick Edit") row.operator("image.project_apply", text="Apply") - - col.prop(ipaint, "screen_grab_size", text="") + row = col.row(align=True) + row.prop(ipaint, "screen_grab_size", text="") sub = col.column() - sub.operator("paint.project_image") + sub.operator("paint.project_image", text="Apply Camera Image") - sub.operator("image.save_dirty", text="Save Edited") + sub.operator("image.save_dirty", text="Save All Edited") class VIEW3D_MT_tools_projectpaint_clone(bpy.types.Menu): From d0c10cd0606a2832cdcec1fd9d3f888db06bd397 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 17:49:31 +0000 Subject: [PATCH 092/153] draw option to only display what is rendered, used for sequencer, opengl drawing by default. since we use preview renders a lot the empties & armatures can get in the way also. (commit 27511 by Campbell from render25 branch) --- release/scripts/ui/space_view3d.py | 20 ++- source/blender/blenkernel/BKE_global.h | 2 +- .../editors/space_view3d/drawarmature.c | 2 +- .../blender/editors/space_view3d/drawobject.c | 138 +++++++++--------- .../editors/space_view3d/view3d_draw.c | 77 +++++----- source/blender/makesdna/DNA_view3d_types.h | 1 + source/blender/makesrna/intern/rna_space.c | 5 + 7 files changed, 137 insertions(+), 108 deletions(-) diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py index 9e547763e97..3c0d6940da8 100644 --- a/release/scripts/ui/space_view3d.py +++ b/release/scripts/ui/space_view3d.py @@ -1899,9 +1899,11 @@ class VIEW3D_PT_3dview_display(bpy.types.Panel): ob = context.object col = layout.column() - col.prop(view, "display_x_axis", text="X Axis") - col.prop(view, "display_y_axis", text="Y Axis") - col.prop(view, "display_z_axis", text="Z Axis") + col.prop(view, "display_render_override") + + col = layout.column() + display_all = not view.display_render_override + col.active = display_all col.prop(view, "outline_selected") col.prop(view, "all_object_origins") col.prop(view, "relationship_lines") @@ -1910,9 +1912,17 @@ class VIEW3D_PT_3dview_display(bpy.types.Panel): col.prop(mesh, "all_edges") col = layout.column() - col.prop(view, "display_floor", text="Grid Floor") + col.active = display_all + split = col.split(percentage=0.55) + split.prop(view, "display_floor", text="Grid Floor") + + row = split.row(align=True) + row.prop(view, "display_x_axis", text="X", toggle=True) + row.prop(view, "display_y_axis", text="Y", toggle=True) + row.prop(view, "display_z_axis", text="Z", toggle=True) + sub = col.column(align=True) - sub.active = view.display_floor + sub.active = (display_all and view.display_floor) sub.prop(view, "grid_lines", text="Lines") sub.prop(view, "grid_spacing", text="Spacing") sub.prop(view, "grid_subdivisions", text="Subdivisions") diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 6084b0cfb73..291deb5ea70 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -106,7 +106,7 @@ typedef struct Global { #define G_RENDER_OGL (1 << 0) #define G_SWAP_EXCHANGE (1 << 1) /* also uses G_FILE_AUTOPLAY */ -#define G_RENDER_SHADOW (1 << 3) +/* #define G_RENDER_SHADOW (1 << 3) */ /* temp flag, removed */ #define G_BACKBUFSEL (1 << 4) #define G_PICKSEL (1 << 5) diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index b9522b89394..3ed8fdc3eab 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -2406,7 +2406,7 @@ int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, in bArmature *arm= ob->data; int retval= 0; - if(G.f & G_RENDER_SHADOW) + if(v3d->flag2 & V3D_RENDER_OVERRIDE) return 1; if(dt>OB_WIRE && arm->drawtype!=ARM_LINE) { diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index ea56cf25660..8fedc56df67 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -339,9 +339,6 @@ void drawaxes(float size, int flag, char drawtype) float v1[3]= {0.0, 0.0, 0.0}; float v2[3]= {0.0, 0.0, 0.0}; float v3[3]= {0.0, 0.0, 0.0}; - - if(G.f & G_RENDER_SHADOW) - return; switch(drawtype) { @@ -864,9 +861,6 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, float imat[4][4], curcol[4]; char col[4]; int drawcone= (dt>OB_WIRE && !(G.f & G_PICKSEL) && la->type == LA_SPOT && (la->mode & LA_SHOW_CONE)); - - if(G.f & G_RENDER_SHADOW) - return; if(drawcone && !v3d->transp) { /* in this case we need to draw delayed */ @@ -1164,9 +1158,6 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob float nobmat[4][4], vec[8][4], fac, facx, facy, depth; int i; - if(G.f & G_RENDER_SHADOW) - return; - cam= ob->data; glDisable(GL_LIGHTING); @@ -2004,7 +1995,8 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E float area, col[3]; /* area of the face, color of the text to draw */ float grid= unit->system ? unit->scale_length : v3d->grid; int do_split= unit->flag & USER_UNIT_OPT_SPLIT; - if(G.f & (G_RENDER_OGL|G_RENDER_SHADOW)) + + if(v3d->flag2 & V3D_RENDER_OVERRIDE) return; /* make the precision of the pronted value proportionate to the gridsize */ @@ -2425,8 +2417,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D CHECK_OB_DRAWTEXTURE(v3d, dt)) { int faceselect= (ob==OBACT && paint_facesel_test(ob)); - - if ((v3d->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !(G.f&G_PICKSEL || paint_facesel_test(ob)) && !draw_wire) { + if ((v3d->flag&V3D_SELECT_OUTLINE) && ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) && (base->flag&SELECT) && !(G.f&G_PICKSEL || paint_facesel_test(ob)) && !draw_wire) { draw_mesh_object_outline(v3d, ob, dm); } @@ -2481,7 +2472,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D else { Paint *p; - if((v3d->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !draw_wire && !ob->sculpt) + if((v3d->flag&V3D_SELECT_OUTLINE) && ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) && (base->flag&SELECT) && !draw_wire && !ob->sculpt) draw_mesh_object_outline(v3d, ob, dm); glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED ); @@ -2565,7 +2556,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D dm= mesh_get_derived_final(scene, ob, v3d->customdata_mask); } - if ((v3d->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !draw_wire) { + if ((v3d->flag&V3D_SELECT_OUTLINE) && ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) && (base->flag&SELECT) && !draw_wire) { draw_mesh_object_outline(v3d, ob, dm); } @@ -3734,7 +3725,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv setlinestyle(0); } - if((part->draw & PART_DRAW_NUM || part->draw & PART_DRAW_HEALTH) && !(G.f & G_RENDER_SHADOW)){ + + if((part->draw & PART_DRAW_NUM || part->draw & PART_DRAW_HEALTH) && (v3d->flag2 & V3D_RENDER_OVERRIDE)==0){ float vec_txt[3]; char *val_pos= val; val[0]= '\0'; @@ -4945,9 +4937,6 @@ static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d) int curcol; float size; - if(G.f & G_RENDER_SHADOW) - return; - /* XXX why? */ if(ob!=scene->obedit && (ob->flag & SELECT)) { if(ob==OBACT) curcol= TH_ACTIVE; @@ -5375,9 +5364,6 @@ void drawRBpivot(bRigidBodyJointConstraint *data) float eu[3]= {radsPerDeg*data->axX, radsPerDeg*data->axY, radsPerDeg*data->axZ}; float mat[4][4]; - if(G.f & G_RENDER_SHADOW) - return; - eul_to_mat4(mat,eu); glLineWidth (4.0f); setlinestyle(2); @@ -5643,7 +5629,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } /* draw outline for selected solid objects, mesh does itself */ - if((v3d->flag & V3D_SELECT_OUTLINE) && ob->type!=OB_MESH) { + if((v3d->flag & V3D_SELECT_OUTLINE) && ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) && ob->type!=OB_MESH) { if(dt>OB_WIRE && dtmode & OB_MODE_EDIT)==0 && (flag & DRAW_SCENESET)==0) { if (!(ob->dtx&OB_DRAWWIRE) && (ob->flag&SELECT) && !(flag&DRAW_PICKING)) { @@ -5777,44 +5763,60 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) break; } case OB_EMPTY: - drawaxes(ob->empty_drawsize, flag, ob->empty_drawtype); + if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) + drawaxes(ob->empty_drawsize, flag, ob->empty_drawtype); break; case OB_LAMP: - drawlamp(scene, v3d, rv3d, base, dt, flag); - if(dtx || (base->flag & SELECT)) glMultMatrixf(ob->obmat); + if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { + drawlamp(scene, v3d, rv3d, base, dt, flag); + if(dtx || (base->flag & SELECT)) glMultMatrixf(ob->obmat); + } break; case OB_CAMERA: - drawcamera(scene, v3d, rv3d, ob, flag); + if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) + drawcamera(scene, v3d, rv3d, ob, flag); break; case OB_LATTICE: - drawlattice(scene, v3d, ob); + if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { + drawlattice(scene, v3d, ob); + } break; case OB_ARMATURE: - if(dt>OB_WIRE) GPU_enable_material(0, NULL); // we use default material - empty_object= draw_armature(scene, v3d, ar, base, dt, flag); - if(dt>OB_WIRE) GPU_disable_material(); + if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { + if(dt>OB_WIRE) GPU_enable_material(0, NULL); // we use default material + empty_object= draw_armature(scene, v3d, ar, base, dt, flag); + if(dt>OB_WIRE) GPU_disable_material(); + } break; default: - drawaxes(1.0, flag, OB_ARROWS); + if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { + drawaxes(1.0, flag, OB_ARROWS); + } } - if(ob->soft /*&& flag & OB_SBMOTION*/){ - float mrt[3][3],msc[3][3],mtr[3][3]; - SoftBody *sb = 0; - float tipw = 0.5f, tiph = 0.5f,drawsize = 4.0f; - if ((sb= ob->soft)){ - if(sb->solverflags & SBSO_ESTIMATEIPO){ - glLoadMatrixf(rv3d->viewmat); - copy_m3_m3(msc,sb->lscale); - copy_m3_m3(mrt,sb->lrot); - mul_m3_m3m3(mtr,mrt,msc); - ob_draw_RE_motion(sb->lcom,mtr,tipw,tiph,drawsize); - glMultMatrixf(ob->obmat); + if((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) { + + if(ob->soft /*&& flag & OB_SBMOTION*/){ + float mrt[3][3],msc[3][3],mtr[3][3]; + SoftBody *sb = 0; + float tipw = 0.5f, tiph = 0.5f,drawsize = 4.0f; + if ((sb= ob->soft)){ + if(sb->solverflags & SBSO_ESTIMATEIPO){ + + glLoadMatrixf(rv3d->viewmat); + copy_m3_m3(msc,sb->lscale); + copy_m3_m3(mrt,sb->lrot); + mul_m3_m3m3(mtr,mrt,msc); + ob_draw_RE_motion(sb->lcom,mtr,tipw,tiph,drawsize); + glMultMatrixf(ob->obmat); + } } } - } - if(ob->pd && ob->pd->forcefield) draw_forcefield(scene, ob, rv3d); + if(ob->pd && ob->pd->forcefield) { + draw_forcefield(scene, ob, rv3d); + } + } /* code for new particle system */ if( (warning_recursive==0) && @@ -5971,7 +5973,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } } - { + if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { + bConstraint *con; for(con=ob->constraints.first; con; con= con->next) { @@ -5982,24 +5985,25 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) drawRBpivot(data); } } - } - /* draw extra: after normal draw because of makeDispList */ - if(dtx && !(G.f & (G_RENDER_OGL|G_RENDER_SHADOW))) { - if(dtx & OB_AXIS) { - drawaxes(1.0f, flag, OB_ARROWS); - } - if(dtx & OB_BOUNDBOX) draw_bounding_volume(scene, ob); - if(dtx & OB_TEXSPACE) drawtexspace(ob); - if(dtx & OB_DRAWNAME) { - /* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */ - /* but, we also dont draw names for sets or duplicators */ - if(flag == 0) { - view3d_cached_text_draw_add(0.0f, 0.0f, 0.0f, ob->id.name+2, 10, 0); - } - } - /*if(dtx & OB_DRAWIMAGE) drawDispListwire(&ob->disp);*/ - if((dtx & OB_DRAWWIRE) && dt>=OB_SOLID) drawWireExtra(scene, rv3d, ob); + /* draw extra: after normal draw because of makeDispList */ + if(dtx && (G.f & G_RENDER_OGL)==0) { + + if(dtx & OB_AXIS) { + drawaxes(1.0f, flag, OB_ARROWS); + } + if(dtx & OB_BOUNDBOX) draw_bounding_volume(scene, ob); + if(dtx & OB_TEXSPACE) drawtexspace(ob); + if(dtx & OB_DRAWNAME) { + /* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */ + /* but, we also dont draw names for sets or duplicators */ + if(flag == 0) { + view3d_cached_text_draw_add(0.0f, 0.0f, 0.0f, ob->id.name+2, 10, 0); + } + } + /*if(dtx & OB_DRAWIMAGE) drawDispListwire(&ob->disp);*/ + if((dtx & OB_DRAWWIRE) && dt>=OB_SOLID) drawWireExtra(scene, rv3d, ob); + } } if(dtflag & OB_FROMDUPLI) return; - if(G.f & G_RENDER_SHADOW) return; + if(v3d->flag2 & V3D_RENDER_OVERRIDE) return; /* object centers, need to be drawn in viewmat space for speed, but OK for picking select */ if(ob!=OBACT || !(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) { int do_draw_center= -1; /* defines below are zero or positive... */ - if((scene->basact)==base) + if(v3d->flag2 & V3D_RENDER_OVERRIDE) { + /* dont draw */ + } else if((scene->basact)==base) do_draw_center= ACTIVE; else if(base->flag & SELECT) do_draw_center= SELECT; @@ -6056,7 +6062,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } /* not for sets, duplicators or picking */ - if(flag==0 && (!(v3d->flag & V3D_HIDE_HELPLINES))) { + if(flag==0 && (v3d->flag & V3D_HIDE_HELPLINES)== 0 && (v3d->flag2 & V3D_RENDER_OVERRIDE)== 0) { ListBase *list; /* draw hook center and offset line */ diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 16a8b1d0e8b..b1f5e959388 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2096,6 +2096,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height v3d.camera= scene->camera; v3d.lay= scene->lay; v3d.drawtype = drawtype; + v3d.flag2 = V3D_RENDER_OVERRIDE; rv3d.persp= RV3D_CAMOB; @@ -2223,29 +2224,32 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) // needs to be done always, gridview is adjusted in drawgrid() now rv3d->gridview= v3d->grid; - if(rv3d->view==0 || rv3d->persp!=0) { - drawfloor(scene, v3d); - if(rv3d->persp==2) { - if(scene->world) { - if(scene->world->mode & WO_STARS) { - RE_make_stars(NULL, scene, star_stuff_init_func, star_stuff_vertex_func, - star_stuff_term_func); + if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { + + if(rv3d->view==0 || rv3d->persp != RV3D_ORTHO) { + drawfloor(scene, v3d); + if(rv3d->persp==RV3D_CAMOB) { + if(scene->world) { + if(scene->world->mode & WO_STARS) { + RE_make_stars(NULL, scene, star_stuff_init_func, star_stuff_vertex_func, + star_stuff_term_func); + } } + if(v3d->flag & V3D_DISPBGPICS) draw_bgpic(scene, ar, v3d); } - if(v3d->flag & V3D_DISPBGPICS) draw_bgpic(scene, ar, v3d); } - } - else { - ED_region_pixelspace(ar); - drawgrid(&scene->unit, ar, v3d, &grid_unit); - /* XXX make function? replaces persp(1) */ - glMatrixMode(GL_PROJECTION); - glLoadMatrixf(rv3d->winmat); - glMatrixMode(GL_MODELVIEW); - glLoadMatrixf(rv3d->viewmat); - - if(v3d->flag & V3D_DISPBGPICS) { - draw_bgpic(scene, ar, v3d); + else { + ED_region_pixelspace(ar); + drawgrid(&scene->unit, ar, v3d, &grid_unit); + /* XXX make function? replaces persp(1) */ + glMatrixMode(GL_PROJECTION); + glLoadMatrixf(rv3d->winmat); + glMatrixMode(GL_MODELVIEW); + glLoadMatrixf(rv3d->viewmat); + + if(v3d->flag & V3D_DISPBGPICS) { + draw_bgpic(scene, ar, v3d); + } } } @@ -2333,12 +2337,14 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) glDisable(GL_DEPTH_TEST); } - /* draw grease-pencil stuff (3d-space strokes) */ - //if (v3d->flag2 & V3D_DISPGP) - draw_gpencil_3dview((bContext *)C, 1); - - BDR_drawSketch(C); - + if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { + /* draw grease-pencil stuff (3d-space strokes) */ + //if (v3d->flag2 & V3D_DISPGP) + draw_gpencil_3dview((bContext *)C, 1); + + BDR_drawSketch(C); + } + ED_region_pixelspace(ar); // retopo_paint_view_update(v3d); @@ -2346,14 +2352,17 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) /* Draw particle edit brush XXX (removed) */ - if(rv3d->persp>1) drawviewborder(scene, ar, v3d); - if(rv3d->rflag & RV3D_FLYMODE) drawviewborder_flymode(ar); - - /* draw grease-pencil stuff - needed to get paint-buffer shown too (since it's 2D) */ -// if (v3d->flag2 & V3D_DISPGP) - draw_gpencil_3dview((bContext *)C, 0); + if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { - drawcursor(scene, ar, v3d); + if(rv3d->persp==RV3D_CAMOB) drawviewborder(scene, ar, v3d); + if(rv3d->rflag & RV3D_FLYMODE) drawviewborder_flymode(ar); + + /* draw grease-pencil stuff - needed to get paint-buffer shown too (since it's 2D) */ + // if (v3d->flag2 & V3D_DISPGP) + draw_gpencil_3dview((bContext *)C, 0); + + drawcursor(scene, ar, v3d); + } if(U.uiflag & USER_SHOW_ROTVIEWICON) draw_view_axis(rv3d); @@ -2381,5 +2390,3 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) v3d->flag |= V3D_INVALID_BACKBUF; } - - diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 12849d02d97..60aba105ff4 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -247,6 +247,7 @@ typedef struct View3D { #define RV3D_VIEW_CAMERA 8 /* View3d->flag2 (short) */ +#define V3D_RENDER_OVERRIDE 4 #define V3D_SOLID_TEX 8 #define V3D_DISPGP 16 diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 19dc132c834..3e8c4250c1c 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -937,6 +937,11 @@ static void rna_def_space_3dview(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_TEX); RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + + prop= RNA_def_property(srna, "display_render_override", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_RENDER_OVERRIDE); + RNA_def_property_ui_text(prop, "Only Render", "Display only objects which will be rendered"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "occlude_geometry", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ZBUF_SELECT); From 243314ac190f38b582990c9a25573e07e3e07bb1 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 17:58:13 +0000 Subject: [PATCH 093/153] implify skipping quad->tri was being done even when the main simplify option was disabled. (commit 27512 by Campbell from render25 branch) --- source/blender/editors/space_file/space_file.c | 2 +- source/blender/render/intern/source/convertblender.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 141d4f63f1c..640fce39b16 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -227,7 +227,7 @@ static void file_refresh(const bContext *C, ScrArea *sa) static void file_listener(ScrArea *sa, wmNotifier *wmn) { - SpaceFile* sfile = (SpaceFile*)sa->spacedata.first; + /* SpaceFile* sfile = (SpaceFile*)sa->spacedata.first; */ /* context changes */ switch(wmn->category) { diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 5a363b9cdfe..c756a135048 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -4226,7 +4226,7 @@ static void finalize_render_object(Render *re, ObjectRen *obr, int timeoffset) /* Baking lets us define a quad split order */ split_quads(obr, re->r.bake_quad_split); } else { - if((re->r.simplify_flag & R_SIMPLE_NO_TRIANGULATE) == 0) + if((re->r.mode & R_SIMPLIFY && re->r.simplify_flag & R_SIMPLE_NO_TRIANGULATE) == 0) check_non_flat_quads(obr); } From 7c49cf2be97f670fb3b88c7b007b3535b334bbce Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 17:58:44 +0000 Subject: [PATCH 094/153] Wkey in uv editor brings up weld/align menu rather then welding. (commit 27513 by Campbell from render25 branch) --- source/blender/editors/uvedit/uvedit_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 8998b59b353..bc63d412046 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -3223,7 +3223,7 @@ void ED_keymap_uvedit(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "UV_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "UV_OT_select_pinned", PKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "UV_OT_weld", WKEY, KM_PRESS, 0, 0); + WM_keymap_add_menu(keymap, "IMAGE_MT_uvs_weldalign", WKEY, KM_PRESS, 0, 0); /* uv operations */ WM_keymap_add_item(keymap, "UV_OT_stitch", VKEY, KM_PRESS, 0, 0); From 93915e9438e642fc98fe26cef217059e51d299ec Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 17:59:11 +0000 Subject: [PATCH 095/153] adding faces was setting the wrong flag, smooth rather then selected. (commit 27533 by Campbell from render25 branch) --- source/blender/editors/mesh/mesh_data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index b18f19885be..2db229e8325 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -697,7 +697,7 @@ static void mesh_add_faces(Mesh *mesh, int len) /* set default flags */ mface= &mesh->mface[mesh->totface]; for(i=0; iflag= SELECT; + mface->flag= ME_FACE_SEL; mesh->totface= totface; } From 47a0967a30e0ad83a415fd52d377c05ad82c2cf3 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 17:59:39 +0000 Subject: [PATCH 096/153] no need to set flat shading for faces manually (commit 27534 by Campbell from render25 branch) --- release/scripts/op/add_mesh_torus.py | 1 - 1 file changed, 1 deletion(-) diff --git a/release/scripts/op/add_mesh_torus.py b/release/scripts/op/add_mesh_torus.py index e7c7ac86ee6..825b23c49e1 100644 --- a/release/scripts/op/add_mesh_torus.py +++ b/release/scripts/op/add_mesh_torus.py @@ -120,7 +120,6 @@ class AddTorus(bpy.types.Operator): mesh.add_geometry(int(len(verts_loc) / 3), 0, int(len(faces) / 4)) mesh.verts.foreach_set("co", verts_loc) mesh.faces.foreach_set("verts_raw", faces) - mesh.faces.foreach_set("smooth", [False] * len(mesh.faces)) scene = context.scene From 2b34078fb2682e454042d2a69f436c448b2746f0 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 18:00:45 +0000 Subject: [PATCH 097/153] the string 'Environment' is too long for a pass name, was causing crashes in FSA. use Env instead. (commit 27536 by Campbell from render25 branch) --- source/blender/render/intern/source/pipeline.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index b995e686c58..75c8d806b9e 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -340,10 +340,10 @@ static char *get_pass_name(int passtype, int channel) return "AO.B"; } if(passtype == SCE_PASS_ENVIRONMENT) { - if(channel==-1) return "Environment"; - if(channel==0) return "Environment.R"; - if(channel==1) return "Environment.G"; - return "Environment.B"; + if(channel==-1) return "Env"; + if(channel==0) return "Env.R"; + if(channel==1) return "Env.G"; + return "Env.B"; } if(passtype == SCE_PASS_INDIRECT) { if(channel==-1) return "Indirect"; @@ -417,7 +417,7 @@ static int passtype_from_name(char *str) if(strcmp(str, "AO")==0) return SCE_PASS_AO; - if(strcmp(str, "Environment")==0) + if(strcmp(str, "Env")==0) return SCE_PASS_ENVIRONMENT; if(strcmp(str, "Indirect")==0) From abb7a25426a630f5a5209987a78530f70c0dfa94 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 18:01:22 +0000 Subject: [PATCH 098/153] transform marker sync for extend and grab is back. (commit 27537 by Campbell from render25 branch) --- release/scripts/ui/space_sequencer.py | 2 ++ .../editors/transform/transform_conversions.c | 20 +++++++++++++++++++ source/blender/makesrna/intern/rna_space.c | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/release/scripts/ui/space_sequencer.py b/release/scripts/ui/space_sequencer.py index 2eb889d2c1d..6398344e2f7 100644 --- a/release/scripts/ui/space_sequencer.py +++ b/release/scripts/ui/space_sequencer.py @@ -136,6 +136,8 @@ class SEQUENCER_MT_view(bpy.types.Menu): layout.prop(st, "separate_color_preview") layout.separator() + layout.prop(st, "use_marker_sync") + layout.separator() layout.operator("screen.area_dupli") layout.operator("screen.screen_full_area") diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 9c570e10406..4e4fd0c24ae 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -3847,6 +3847,8 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count } } else { + t->frame_side= 'B'; + /* *** Normal Transform *** */ if (seq->depth == 0) { @@ -4708,6 +4710,24 @@ void special_aftertrans_update(bContext *C, TransInfo *t) if (t->spacetype == SPACE_SEQ) { /* freeSeqData in transform_conversions.c does this * keep here so the else at the end wont run... */ + + SpaceSeq *sseq= (SpaceSeq *)t->sa->spacedata.first; + + /* marker transform, not especially nice but we may want to move markers + * at the same time as keyframes in the dope sheet. */ + if ((sseq->flag & SEQ_MARKER_TRANS) && (cancelled == 0)) { + /* cant use , TFM_TIME_EXTEND + * for some reason EXTEND is changed into TRANSLATE, so use frame_side instead */ + + if(t->mode == TFM_SEQ_SLIDE) { + if(t->frame_side == 'B') + scene_marker_tfm_translate(t->scene, floor(t->values[0] + 0.5f), SELECT); + } + else if (ELEM(t->frame_side, 'L', 'R')) { + scene_marker_tfm_extend(t->scene, floor(t->vec[0] + 0.5f), SELECT, t->scene->r.cfra, t->frame_side); + } + } + } else if (t->spacetype == SPACE_NODE) { /* pass */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 3e8c4250c1c..fb59cc77611 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1276,7 +1276,7 @@ static void rna_def_space_sequencer(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather then seconds"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); - prop= RNA_def_property(srna, "transform_markers", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS); RNA_def_property_ui_text(prop, "Transform Markers", "Transform markers as well as strips"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); From 391526c20e7ba0e818241f4dedb3f40aa51fd47a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 18:05:53 +0000 Subject: [PATCH 099/153] option to lock alpha while projection painting. (commit 27538 by Campbell from render25 branch) --- release/scripts/ui/space_view3d_toolbar.py | 5 +++++ source/blender/editors/sculpt_paint/paint_image.c | 7 +++++++ source/blender/makesdna/DNA_brush_types.h | 1 + source/blender/makesrna/intern/rna_brush.c | 6 ++++++ 4 files changed, 19 insertions(+) diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py index a4b908bf1d1..10718883c3c 100644 --- a/release/scripts/ui/space_view3d_toolbar.py +++ b/release/scripts/ui/space_view3d_toolbar.py @@ -592,6 +592,11 @@ class VIEW3D_PT_tools_brush(PaintPanel): col.prop(brush, "blend", text="Blend") + col = layout.column() + col.active = (brush.blend not in ('ERASE_ALPHA', 'ADD_ALPHA')) + col.prop(brush, "use_alpha") + + # Weight Paint Mode # elif context.weight_paint_object and brush: diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 6137d83e77e..9fc858a191f 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -3705,6 +3705,7 @@ static void *do_projectpaint_thread(void *ph_v) float mask = 1.0f; /* airbrush wont use mask */ unsigned short mask_short; float size_half = ((float)ps->brush->size) * 0.5f; + short lock_alpha= ELEM(ps->brush->blend, IMB_BLEND_ERASE_ALPHA, IMB_BLEND_ADD_ALPHA) ? 0 : ps->brush->flag & BRUSH_LOCK_ALPHA; LinkNode *smearPixels = NULL; LinkNode *smearPixels_f = NULL; @@ -3833,6 +3834,12 @@ static void *do_projectpaint_thread(void *ph_v) break; } } + + if(lock_alpha) { + if (is_floatbuf) projPixel->pixel.f_pt[3]= projPixel->origColor.f[3]; + else projPixel->pixel.ch_pt[3]= projPixel->origColor.ch[3]; + } + /* done painting */ } } diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 163c8122fb7..14930f85e63 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -86,6 +86,7 @@ typedef struct Brush { #define BRUSH_SMOOTH_STROKE 2048 #define BRUSH_PERSISTENT 4096 #define BRUSH_ACCUMULATE 8192 +#define BRUSH_LOCK_ALPHA 16384 /* Brush.sculpt_tool */ #define SCULPT_TOOL_DRAW 1 diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 2d81a9d66c1..df08dc7b861 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -279,6 +279,12 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FIXED_TEX); RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position"); RNA_def_property_update(prop, 0, "rna_Brush_update"); */ + + /* only for projection paint, TODO, other paint modes */ + prop= RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BRUSH_LOCK_ALPHA); + RNA_def_property_ui_text(prop, "Alpha", "When this is disabled, lock alpha while painting"); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); From 4a2efe0822876d703ba05cd03153ab3759f6c7ee Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Mar 2010 18:22:55 +0000 Subject: [PATCH 100/153] no need to include the setting names in enum items (commit 27539 by Campbell from render25 branch) --- release/scripts/io/engine_render_pov.py | 2 +- release/scripts/io/netrender/ui.py | 2 +- release/scripts/ui/properties_render.py | 2 +- source/blender/makesrna/intern/rna_render.c | 2 +- source/blender/makesrna/intern/rna_scene.c | 37 +++++++++------------ 5 files changed, 19 insertions(+), 26 deletions(-) diff --git a/release/scripts/io/engine_render_pov.py b/release/scripts/io/engine_render_pov.py index 28e4692fe8c..e64e3bf05fb 100644 --- a/release/scripts/io/engine_render_pov.py +++ b/release/scripts/io/engine_render_pov.py @@ -630,7 +630,7 @@ def write_pov_ini(filename_ini, filename_pov, filename_image): file.write('Output_Alpha=1\n') if render.antialiasing: - aa_mapping = {'OVERSAMPLE_5': 2, 'OVERSAMPLE_8': 3, 'OVERSAMPLE_11': 4, 'OVERSAMPLE_16': 5} # method 1 assumed + aa_mapping = {'5': 2, '8': 3, '11': 4, '16': 5} # method 1 assumed file.write('Antialias=1\n') file.write('Antialias_Depth=%d\n' % aa_mapping[render.antialiasing_samples]) else: diff --git a/release/scripts/io/netrender/ui.py b/release/scripts/io/netrender/ui.py index 30553787ec3..f8b29fdd326 100644 --- a/release/scripts/io/netrender/ui.py +++ b/release/scripts/io/netrender/ui.py @@ -144,7 +144,7 @@ class RENDER_PT_network_slave_settings(RenderButtonsPanel): layout.label(text="Threads:") layout.prop(rd, "threads_mode", expand=True) sub = layout.column() - sub.enabled = rd.threads_mode == 'THREADS_FIXED' + sub.enabled = rd.threads_mode == 'FIXED' sub.prop(rd, "threads") @rnaType class RENDER_PT_network_master_settings(RenderButtonsPanel): diff --git a/release/scripts/ui/properties_render.py b/release/scripts/ui/properties_render.py index 959deba7927..c9795d62f71 100644 --- a/release/scripts/ui/properties_render.py +++ b/release/scripts/ui/properties_render.py @@ -218,7 +218,7 @@ class RENDER_PT_performance(RenderButtonsPanel): col.label(text="Threads:") col.row().prop(rd, "threads_mode", expand=True) sub = col.column() - sub.enabled = rd.threads_mode == 'THREADS_FIXED' + sub.enabled = rd.threads_mode == 'FIXED' sub.prop(rd, "threads") sub = col.column(align=True) sub.label(text="Tiles:") diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index c52d60f5d41..b10df075121 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -364,7 +364,7 @@ static void rna_def_render_pass(BlenderRNA *brna) {SCE_PASS_AO, "AO", 0, "AO", ""}, {SCE_PASS_REFLECT, "REFLECTION", 0, "Reflection", ""}, {SCE_PASS_NORMAL, "NORMAL", 0, "Normal", ""}, - {SCE_PASS_VECTOR, "VECTOR", 0, "Vecotr", ""}, + {SCE_PASS_VECTOR, "VECTOR", 0, "Vector", ""}, {SCE_PASS_REFRACT, "REFRACTION", 0, "Refraction", ""}, {SCE_PASS_INDEXOB, "OBJECT_INDEX", 0, "Object Index", ""}, {SCE_PASS_UV, "UV", 0, "UV", ""}, diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index f4f05168920..b0bfbc43294 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1716,22 +1716,15 @@ static void rna_def_scene_render_data(BlenderRNA *brna) static EnumPropertyItem bake_qyad_split_items[] ={ {0, "AUTO", 0, "Automatic", "Split quads to give the least distortion while baking"}, - {1, "FIXED", 0, "Fixed", "Split quads pradictably (0,1,2) (0,2,3)"}, - {2, "FIXED_ALT", 0, "Fixed Alternate", "Split quads pradictably (1,2,3) (1,3,0)"}, - {0, NULL, 0, NULL, NULL}}; - - static EnumPropertyItem bake_aa_items[] ={ - {5, "AA_5", 0, "5", ""}, - {8, "AA_8", 0, "8", ""}, - {11, "AA_11", 0, "11", ""}, - {16, "AA_16", 0, "16", ""}, + {1, "FIXED", 0, "Fixed", "Split quads predictably (0,1,2) (0,2,3)"}, + {2, "FIXED_ALT", 0, "Fixed Alternate", "Split quads predictably (1,2,3) (1,3,0)"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem octree_resolution_items[] = { - {64, "OCTREE_RES_64", 0, "64", ""}, - {128, "OCTREE_RES_128", 0, "128", ""}, - {256, "OCTREE_RES_256", 0, "256", ""}, - {512, "OCTREE_RES_512", 0, "512", ""}, + {64, "64", 0, "64", ""}, + {128, "128", 0, "128", ""}, + {256, "256", 0, "256", ""}, + {512, "512", 0, "512", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem raytrace_structure_items[] = { @@ -1745,20 +1738,20 @@ static void rna_def_scene_render_data(BlenderRNA *brna) }; static EnumPropertyItem fixed_oversample_items[] = { - {5, "OVERSAMPLE_5", 0, "5", ""}, - {8, "OVERSAMPLE_8", 0, "8", ""}, - {11, "OVERSAMPLE_11", 0, "11", ""}, - {16, "OVERSAMPLE_16", 0, "16", ""}, + {5, "5", 0, "5", ""}, + {8, "8", 0, "8", ""}, + {11, "11", 0, "11", ""}, + {16, "16", 0, "16", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem field_order_items[] = { - {0, "FIELDS_EVENFIRST", 0, "Upper First", "Upper field first"}, - {R_ODDFIELD, "FIELDS_ODDFIRST", 0, "Lower First", "Lower field first"}, + {0, "EVEN_FIRST", 0, "Upper First", "Upper field first"}, + {R_ODDFIELD, "ODD_FIRST", 0, "Lower First", "Lower field first"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem threads_mode_items[] = { - {0, "THREADS_AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"}, - {R_FIXED_THREADS, "THREADS_FIXED", 0, "Fixed", "Manually determine the number of threads"}, + {0, "AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"}, + {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"}, {0, NULL, 0, NULL, NULL}}; #ifdef WITH_OPENEXR @@ -2389,7 +2382,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa"); - RNA_def_property_enum_items(prop, bake_aa_items); + RNA_def_property_enum_items(prop, fixed_oversample_items); RNA_def_property_ui_text(prop, "Anti-Aliasing Level", ""); prop= RNA_def_property(srna, "bake_active", PROP_BOOLEAN, PROP_NONE); From bcca4e6843df452c820fa48845adc3872e3331ad Mon Sep 17 00:00:00 2001 From: Roland Hess Date: Tue, 16 Mar 2010 18:34:30 +0000 Subject: [PATCH 101/153] Daniel Lara pointed out that adding a Maintain Volume constraint via 3D view hotkey automatically added an Empty for Target. This should not have been. --- source/blender/editors/object/object_constraint.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 96ba419704a..045ff3d5620 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -864,6 +864,7 @@ static short get_new_constraint_target(bContext *C, int con_type, Object **tar_o case CONSTRAINT_TYPE_LOCLIMIT: case CONSTRAINT_TYPE_ROTLIMIT: case CONSTRAINT_TYPE_SIZELIMIT: + case CONSTRAINT_TYPE_SAMEVOL: return 0; /* restricted target-type constraints -------------- */ From 8ac0359852f1eb8597bfc847c5a4891d61adae20 Mon Sep 17 00:00:00 2001 From: Damien Plisson Date: Tue, 16 Mar 2010 20:42:12 +0000 Subject: [PATCH 102/153] Fix [#21634] GHOST_WindowCocoa: activeWindow null pointer check --- intern/ghost/intern/GHOST_SystemCocoa.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index bcbc59a34a9..20d5cc7165a 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -774,15 +774,17 @@ GHOST_IWindow* GHOST_SystemCocoa::createWindow( GHOST_TSuccess GHOST_SystemCocoa::beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window, const bool stereoVisual) { GHOST_IWindow* currentWindow = m_windowManager->getActiveWindow(); - *window = currentWindow; + if(!currentWindow) return GHOST_kFailure; + return currentWindow->setState(GHOST_kWindowStateFullScreen); } GHOST_TSuccess GHOST_SystemCocoa::endFullScreen(void) { GHOST_IWindow* currentWindow = m_windowManager->getActiveWindow(); + if(!currentWindow) return GHOST_kFailure; return currentWindow->setState(GHOST_kWindowStateNormal); } @@ -809,6 +811,8 @@ GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 { float xf=(float)x, yf=(float)y; GHOST_WindowCocoa* window = (GHOST_WindowCocoa*)m_windowManager->getActiveWindow(); + if (!window) return GHOST_kFailure; + NSScreen *windowScreen = window->getScreen(); NSRect screenRect = [windowScreen frame]; From 14e29a62dc33abb0339020c284e564aa8d0b088f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 16 Mar 2010 21:09:53 +0000 Subject: [PATCH 103/153] "Fill deformed" option for 2D curves Add new option named "Fill deformed". If this option is switched on. 2D curve will be first deformed by modifiers and only then be filled with faces. --- release/scripts/ui/properties_data_curve.py | 1 + source/blender/blenkernel/intern/displist.c | 12 +++++++++++- source/blender/editors/object/object_add.c | 5 ++++- source/blender/makesdna/DNA_curve_types.h | 1 + source/blender/makesrna/intern/rna_curve.c | 4 ++++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/release/scripts/ui/properties_data_curve.py b/release/scripts/ui/properties_data_curve.py index 9848e423665..ff78791fa0b 100644 --- a/release/scripts/ui/properties_data_curve.py +++ b/release/scripts/ui/properties_data_curve.py @@ -124,6 +124,7 @@ class DATA_PT_shape_curve(DataButtonsPanel): sub.label(text="Caps:") sub.prop(curve, "front") sub.prop(curve, "back") + sub.prop(curve, "use_deform_fill") col.label(text="Textures:") # col.prop(curve, "uv_orco") diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index b9588f4520c..56eabc0f5ef 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1391,6 +1391,10 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba CDDM_calc_normals(dm); } } else { + if (ELEM(ob->type, OB_CURVE, OB_FONT) && (cu->flag & CU_DEFORM_FILL)) { + curve_to_filledpoly(cu, nurb, &cu->disp); + } + dm= CDDM_from_curve_customDB(ob, dispbase); if(dmDeformedVerts) { @@ -1801,7 +1805,9 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba freedisplist(&dlbev); } - curve_to_filledpoly(cu, nubase, dispbase); + if (!(cu->flag & CU_DEFORM_FILL)) { + curve_to_filledpoly(cu, nubase, dispbase); + } if(cu->flag & CU_PATH) calc_curvepath(ob); @@ -1810,6 +1816,10 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba } if(!forOrco) curve_calc_modifiers_post(scene, ob, dispbase, derivedFinal, forRender, originalVerts, deformedVerts); + + if (cu->flag & CU_DEFORM_FILL && !ob->derivedFinal) { + curve_to_filledpoly(cu, nubase, dispbase); + } } } diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 2a0d6e6c046..4f6a188304a 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -503,11 +503,14 @@ static int object_add_curve_exec(bContext *C, wmOperator *op) ED_object_add_generic_get_opts(op, loc, rot, &enter_editmode, &layer); if(obedit==NULL || obedit->type!=OB_CURVE) { + Curve *cu; obedit= ED_object_add_type(C, OB_CURVE, loc, rot, TRUE, layer); newob = 1; + cu= (Curve*)obedit->data; + cu->flag |= CU_DEFORM_FILL; if(type & CU_PRIM_PATH) - ((Curve*)obedit->data)->flag |= CU_PATH|CU_3D; + cu->flag |= CU_PATH|CU_3D; } else DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index cd002894c5d..1e2cc2745a4 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -243,6 +243,7 @@ typedef struct Curve { #define CU_RETOPO 1024 #define CU_DS_EXPAND 2048 #define CU_PATH_RADIUS 4096 /* make use of the path radius if this is enabled (default for new curves) */ +#define CU_DEFORM_FILL 8192 /* fill 2d curve after deformation */ /* twist mode */ #define CU_TWIST_Z_UP 0 diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 499423276ab..24701ed866d 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -880,6 +880,10 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Twist Smooth", "Smoothing iteration for tangents"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + prop= RNA_def_property(srna, "use_deform_fill", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_DEFORM_FILL); + RNA_def_property_ui_text(prop, "Fill deformed", "Fill curve after applying deformation"); + RNA_def_property_update(prop, 0, "rna_Curve_update_data"); } static void rna_def_curve_nurb(BlenderRNA *brna) From b3e48fed5d02176b7b393ed47b0483696b5db389 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 16 Mar 2010 22:19:43 +0000 Subject: [PATCH 104/153] Fix: Incorrect alpha values were displayed when sampling a float image in the image editor, reported in IRC by kahr-alpha --- source/blender/editors/space_image/image_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 488cb7885b3..3aa766c32d0 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1521,7 +1521,7 @@ static void sample_apply(bContext *C, wmOperator *op, wmEvent *event) info->colf[0]= fp[0]; info->colf[1]= fp[1]; info->colf[2]= fp[2]; - info->colf[3]= fp[4]; + info->colf[3]= fp[3]; info->colfp= info->colf; } From 724418f33afc62006c31f6ed8c175849b0400dba Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 17 Mar 2010 00:05:40 +0000 Subject: [PATCH 105/153] Fix [#21114] Graphical cursor displayed in wrong position when switching to local ortho. --- release/scripts/ui/space_view3d.py | 2 +- source/blender/editors/object/object_add.c | 10 ++----- source/blender/makesrna/intern/rna_space.c | 31 +++++++++++++++++++++- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py index 3c0d6940da8..6311626b975 100644 --- a/release/scripts/ui/space_view3d.py +++ b/release/scripts/ui/space_view3d.py @@ -1854,7 +1854,7 @@ class VIEW3D_PT_3dview_properties(bpy.types.Panel): col.prop(view, "clip_start", text="Start") col.prop(view, "clip_end", text="End") - layout.column().prop(scene, "cursor_location", text="3D Cursor:") + layout.column().prop(view, "cursor_location") class VIEW3D_PT_3dview_name(bpy.types.Panel): diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 4f6a188304a..d852d66fb6d 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -92,6 +92,7 @@ #include "ED_render.h" #include "ED_screen.h" #include "ED_transform.h" +#include "ED_view3d.h" #include "UI_interface.h" #include "UI_resources.h" @@ -105,14 +106,7 @@ void ED_object_location_from_view(bContext *C, float *loc) View3D *v3d= CTX_wm_view3d(C); Scene *scene= CTX_data_scene(C); - if (v3d) { - if (v3d->localvd) - copy_v3_v3(loc, v3d->cursor); - else - copy_v3_v3(loc, scene->cursor); - } else { - copy_v3_v3(loc, scene->cursor); - } + loc = give_cursor(scene, v3d); } void ED_object_rotation_from_view(bContext *C, float *rot) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index fb59cc77611..37496f08dce 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -104,6 +104,8 @@ EnumPropertyItem viewport_shading_items[] = { #include "DNA_scene_types.h" #include "DNA_screen_types.h" +#include "BLI_math.h" + #include "BKE_animsys.h" #include "BKE_brush.h" #include "BKE_colortools.h" @@ -278,6 +280,26 @@ static void rna_Space3DView_lock_camera_and_layers_set(PointerRNA *ptr, int valu } } +static void rna_View3D_CursorLocation_get(PointerRNA *ptr, float *values) +{ + View3D *v3d= (View3D*)(ptr->data); + bScreen *sc= (bScreen*)ptr->id.data; + Scene *scene= (Scene *)sc->scene; + float *loc = give_cursor(scene, v3d); + + copy_v3_v3(values, loc); +} + +static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values) +{ + View3D *v3d= (View3D*)(ptr->data); + bScreen *sc= (bScreen*)ptr->id.data; + Scene *scene= (Scene *)sc->scene; + float *cursor = give_cursor(scene, v3d); + + copy_v3_v3(cursor, values); +} + static void rna_Space3DView_layer_set(PointerRNA *ptr, const int *values) { View3D *v3d= (View3D*)(ptr->data); @@ -861,7 +883,14 @@ static void rna_def_space_3dview(BlenderRNA *brna) prop= RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "localvd"); RNA_def_property_ui_text(prop, "Local View", "Display an isolated sub-set of objects, apart from the scene visibility"); - + + prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ|PROP_UNIT_LENGTH); + RNA_def_property_array(prop, 3); + RNA_def_property_float_funcs(prop, "rna_View3D_CursorLocation_get", "rna_View3D_CursorLocation_set", NULL); + RNA_def_property_ui_text(prop, "3D Cursor Location", "3D cursor location for this view (dependent on local view setting)"); + RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "lens"); RNA_def_property_ui_text(prop, "Lens", "Lens angle (mm) in perspective view"); From 3c09e763c15f3ff68a3e4d2789d9812184e45224 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 17 Mar 2010 00:54:34 +0000 Subject: [PATCH 106/153] Fix [#21329] Extrude of single vertex constrained --- release/scripts/ui/space_view3d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py index 6311626b975..a2782bc879b 100644 --- a/release/scripts/ui/space_view3d.py +++ b/release/scripts/ui/space_view3d.py @@ -1369,7 +1369,7 @@ class VIEW3D_OT_edit_mesh_extrude_move(bpy.types.Operator): totedge = mesh.total_edge_sel totvert = mesh.total_vert_sel - if totface >= 1 or totvert == 1: + if totface >= 1: return bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": "NORMAL", "constraint_axis": [False, False, True]}) elif totedge == 1: return bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": "NORMAL", "constraint_axis": [True, True, False]}) From 504a7e9d3fb202ac5353cf596f978288c84af754 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 17 Mar 2010 01:56:41 +0000 Subject: [PATCH 107/153] Fix [#21285] Assigning an Edge Rotate (clockwise) shortcut also deletes affected faces when used --- source/blender/editors/mesh/editmesh_tools.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 304bf0da577..047a8fe2ca4 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -3734,7 +3734,6 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir) free_editface(em, face[1]); } -// XXX ton please check /* only accepts 1 selected edge, or 2 selected faces */ static int edge_rotate_selected(bContext *C, wmOperator *op) { @@ -3742,7 +3741,7 @@ static int edge_rotate_selected(bContext *C, wmOperator *op) EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); EditEdge *eed; EditFace *efa; - int dir = RNA_int_get(op->ptr, "direction"); // dir == 2 when clockwise and ==1 for counter CW. + int dir = RNA_enum_get(op->ptr, "direction"); // dir == 2 when clockwise and ==1 for counter CW. short edgeCount = 0; /*clear new flag for new edges, count selected edges */ @@ -3822,7 +3821,7 @@ void MESH_OT_edge_rotate(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "direction", "direction to rotate edge around."); + RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate the edge around."); } From 1d4b93214520045e67eb535393d6056f41feaa54 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 17 Mar 2010 03:07:37 +0000 Subject: [PATCH 108/153] Fix [#21553] Re-Projection just opening the image editor but not the image. Campbell please check/beautify if you like, but it works properly on OS X, either opening Preview with the 'open' command or Photoshop, when the path is set in user preferences. --- release/scripts/op/image.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/release/scripts/op/image.py b/release/scripts/op/image.py index 0d20a9639b9..02d8fcc3219 100644 --- a/release/scripts/op/image.py +++ b/release/scripts/op/image.py @@ -22,19 +22,25 @@ import bpy def image_editor_guess(context): + import platform + system = platform.system() + image_editor = context.user_preferences.filepaths.image_editor # use image editor in the preferences when available. if not image_editor: - import platform - system = platform.system() - if system == 'Windows': - image_editor = "start" # not tested! + image_editor = ["start"] # not tested! elif system == 'Darwin': - image_editor = "open" + image_editor = ["open"] else: - image_editor = "gimp" + image_editor = ["gimp"] + else: + if system == 'Darwin': + # blender file selector treats .app as a folder + # and will include a trailing backslash, so we strip it. + image_editor.rstrip('\\') + image_editor = ["open", "-a", image_editor] return image_editor @@ -118,7 +124,11 @@ class ProjectEdit(bpy.types.Operator): image_new.file_format = 'PNG' image_new.save() - subprocess.Popen([image_editor, bpy.utils.expandpath(filename_final)]) + cmd = [] + cmd.extend(image_editor) + cmd.append(bpy.utils.expandpath(filename_final)) + + subprocess.Popen(cmd) return {'FINISHED'} From be3d5f9d5df90737c01338266efd72b3367b9e6c Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 17 Mar 2010 11:34:27 +0000 Subject: [PATCH 109/153] PyKeyingSet Bugfixes: * With multiple objects selected, only one of the objects got keyframed. The code which was checking for duplicate paths was wrongly assuming to ignore the ID-block used still. * Not registering a Keying Set as 'builtin' would crash on startup. I've made all Keying Sets fallback to adding as if they were local for now, but a better solution is coming soon. * Fixed a typo in RNA function wrappers for the generator callback, since it was looking for the iterator only. This doesn't seem to have caused any problems (thankfully). --- source/blender/blenkernel/intern/anim_sys.c | 10 ++-------- source/blender/editors/animation/keyingsets.c | 6 +++--- source/blender/makesrna/intern/rna_animation.c | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 307ed1bfcd4..31743a6bd1a 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -557,15 +557,9 @@ KS_Path *BKE_keyingset_find_path (KeyingSet *ks, ID *id, const char group_name[] KS_Path *ksp; /* sanity checks */ - if ELEM(NULL, ks, rna_path) + if ELEM3(NULL, ks, rna_path, id) return NULL; - /* ID is optional for relative KeyingSets, but is necessary for absolute KeyingSets */ - if (id == NULL) { - if (ks->flag & KEYINGSET_ABSOLUTE) - return NULL; - } - /* loop over paths in the current KeyingSet, finding the first one where all settings match * (i.e. the first one where none of the checks fail and equal 0) */ @@ -573,7 +567,7 @@ KS_Path *BKE_keyingset_find_path (KeyingSet *ks, ID *id, const char group_name[] short eq_id=1, eq_path=1, eq_index=1, eq_group=1; /* id */ - if ((ks->flag & KEYINGSET_ABSOLUTE) && (id != ksp->id)) + if (id != ksp->id) eq_id= 0; /* path */ diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 1e4180a3ae7..b1f1cbbea1e 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -526,10 +526,10 @@ void ANIM_keyingset_info_register (const bContext *C, KeyingSetInfo *ksi) KeyingSet *ks; /* determine the KeyingSet list to include the new KeyingSet in */ - if (ksi->builtin) - list = &builtin_keyingsets; - else + if (ksi->builtin==0 && scene) list = &scene->keyingsets; + else + list = &builtin_keyingsets; /* create a new KeyingSet * - inherit name and keyframing settings from the typeinfo diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index e048a79daf8..27f0dc5eafb 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -124,7 +124,7 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks, FunctionRNA *func; RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr); - func= RNA_struct_find_function(&ptr, "iterator"); + func= RNA_struct_find_function(&ptr, "generate"); RNA_parameter_list_create(&list, &ptr, func); /* hook up arguments */ From 29a83cbfa71ae2a5935528c280115131b7205d37 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 17 Mar 2010 21:33:28 +0000 Subject: [PATCH 110/153] Fix render info text not showing up in image editor while building render database, due to threading fix. --- source/blender/editors/space_image/image_draw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index cb942472b9e..797bb20ddf9 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -653,7 +653,7 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene) draw_image_paint_helpers(sima, ar, scene, zoomx, zoomy); /* render info */ - if(ibuf && ima && show_render) + if(ima && show_render) draw_render_info(ima, ar); /* XXX integrate this code */ From 634b750cbbeab549c0b083a382e694c9412ea491 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 17 Mar 2010 21:38:53 +0000 Subject: [PATCH 111/153] Sound bugfixes: * sound file path was not displayed in sequencer panel. * sound strip with relative paths would stop working after undo. (commit 27575 by Brecht from render25 branch) --- release/scripts/ui/space_sequencer.py | 2 +- source/blender/blenloader/intern/readblenentry.c | 2 +- source/blender/blenloader/intern/readfile.c | 4 ++-- source/blender/blenloader/intern/readfile.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/release/scripts/ui/space_sequencer.py b/release/scripts/ui/space_sequencer.py index 6398344e2f7..9d7ac872c75 100644 --- a/release/scripts/ui/space_sequencer.py +++ b/release/scripts/ui/space_sequencer.py @@ -609,7 +609,7 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel): layout.template_ID(strip, "sound", open="sound.open") layout.separator() - layout.prop(strip.sound, "filepath", text="") + layout.prop(strip, "filepath", text="") row = layout.row() if strip.sound.packed_file: diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index 083b57cf2b6..013544acffb 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -377,7 +377,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil /* makes lookup of existing images in old main */ blo_make_image_pointer_map(fd, oldmain); - bfd= blo_read_file_internal(fd, ""); + bfd= blo_read_file_internal(fd, filename); /* ensures relinked images are not freed */ blo_end_image_pointer_map(fd, oldmain); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 3fe6a6f9914..cc8686c89ba 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10736,7 +10736,7 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead) return bhead; } -BlendFileData *blo_read_file_internal(FileData *fd, char *file) +BlendFileData *blo_read_file_internal(FileData *fd, const char *filename) { BHead *bhead= blo_firstbhead(fd); BlendFileData *bfd; @@ -10748,7 +10748,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, char *file) bfd->main->versionfile= fd->fileversion; bfd->type= BLENFILETYPE_BLEND; - strncpy(bfd->main->name, file, sizeof(bfd->main->name)-1); + strncpy(bfd->main->name, filename, sizeof(bfd->main->name)-1); while(bhead) { switch(bhead->code) { diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h index cc3643c0364..8e391fa438e 100644 --- a/source/blender/blenloader/intern/readfile.h +++ b/source/blender/blenloader/intern/readfile.h @@ -108,7 +108,7 @@ struct Main; void blo_join_main(ListBase *mainlist); void blo_split_main(ListBase *mainlist, struct Main *main); -BlendFileData *blo_read_file_internal(FileData *fd, char *file); +BlendFileData *blo_read_file_internal(FileData *fd, const char *filename); FileData *blo_openblenderfile(char *name, struct ReportList *reports); FileData *blo_openblendermemory(void *buffer, int buffersize, struct ReportList *reports); From 045d33dae056d4ede4a2dc5d62b1306b01425842 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 17 Mar 2010 22:54:55 +0000 Subject: [PATCH 112/153] Fixed a crash switching to brush texture nodes Also removed some python code to check for node materials within the material and texture properties. It seems to go fine without it, and this should be handled by context instead. --- release/scripts/ui/properties_material.py | 56 ++++++++----------- release/scripts/ui/properties_texture.py | 13 +---- release/scripts/ui/space_node.py | 5 +- source/blender/editors/space_node/node_edit.c | 11 ++-- 4 files changed, 34 insertions(+), 51 deletions(-) diff --git a/release/scripts/ui/properties_material.py b/release/scripts/ui/properties_material.py index 13bfd7a7f5d..d178df7d79e 100644 --- a/release/scripts/ui/properties_material.py +++ b/release/scripts/ui/properties_material.py @@ -23,18 +23,6 @@ from rna_prop_ui import PropertyPanel narrowui = 180 -def active_node_mat(mat): - # TODO, 2.4x has a pipeline section, for 2.5 we need to communicate - # which settings from node-materials are used - if mat: - mat_node = mat.active_node_material - if mat_node: - return mat_node - else: - return mat - - return None - class MATERIAL_MT_sss_presets(bpy.types.Menu): bl_label = "SSS Presets" @@ -148,14 +136,14 @@ class MATERIAL_PT_shading(MaterialButtonsPanel): COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} def poll(self, context): - mat = active_node_mat(context.material) + mat = context.material engine = context.scene.render.engine return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout - mat = active_node_mat(context.material) + mat = context.material wide_ui = context.region.width > narrowui if mat.type in ('SURFACE', 'WIRE'): @@ -259,14 +247,14 @@ class MATERIAL_PT_options(MaterialButtonsPanel): COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} def poll(self, context): - mat = active_node_mat(context.material) + mat = context.material engine = context.scene.render.engine return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout - mat = active_node_mat(context.material) + mat = context.material wide_ui = context.region.width > narrowui split = layout.split() @@ -305,14 +293,14 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel): COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} def poll(self, context): - mat = active_node_mat(context.material) + mat = context.material engine = context.scene.render.engine return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout - mat = active_node_mat(context.material) + mat = context.material wide_ui = context.region.width > narrowui split = layout.split() @@ -342,14 +330,14 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel): COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} def poll(self, context): - mat = active_node_mat(context.material) + mat = context.material engine = context.scene.render.engine return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout - mat = active_node_mat(context.material) + mat = context.material wide_ui = context.region.width > narrowui split = layout.split() @@ -413,14 +401,14 @@ class MATERIAL_PT_specular(MaterialButtonsPanel): COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} def poll(self, context): - mat = active_node_mat(context.material) + mat = context.material engine = context.scene.render.engine return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout - mat = active_node_mat(context.material) + mat = context.material wide_ui = context.region.width > narrowui layout.active = (not mat.shadeless) @@ -483,12 +471,12 @@ class MATERIAL_PT_sss(MaterialButtonsPanel): COMPAT_ENGINES = {'BLENDER_RENDER'} def poll(self, context): - mat = active_node_mat(context.material) + mat = context.material engine = context.scene.render.engine return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) def draw_header(self, context): - mat = active_node_mat(context.material) + mat = context.material sss = mat.subsurface_scattering self.layout.active = (not mat.shadeless) @@ -497,7 +485,7 @@ class MATERIAL_PT_sss(MaterialButtonsPanel): def draw(self, context): layout = self.layout - mat = active_node_mat(context.material) + mat = context.material sss = mat.subsurface_scattering wide_ui = context.region.width > narrowui @@ -535,19 +523,19 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel): COMPAT_ENGINES = {'BLENDER_RENDER'} def poll(self, context): - mat = active_node_mat(context.material) + mat = context.material engine = context.scene.render.engine return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) def draw_header(self, context): - raym = active_node_mat(context.material).raytrace_mirror + raym = context.material.raytrace_mirror self.layout.prop(raym, "enabled", text="") def draw(self, context): layout = self.layout - mat = active_node_mat(context.material) + mat = context.material raym = mat.raytrace_mirror wide_ui = context.region.width > narrowui @@ -594,19 +582,19 @@ class MATERIAL_PT_transp(MaterialButtonsPanel): COMPAT_ENGINES = {'BLENDER_RENDER'} def poll(self, context): - mat = active_node_mat(context.material) + mat = context.material engine = context.scene.render.engine return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) def draw_header(self, context): - mat = active_node_mat(context.material) + mat = context.material self.layout.prop(mat, "transparency", text="") def draw(self, context): layout = self.layout - mat = active_node_mat(context.material) + mat = context.material rayt = mat.raytrace_transparency wide_ui = context.region.width > narrowui @@ -661,19 +649,19 @@ class MATERIAL_PT_transp_game(MaterialButtonsPanel): COMPAT_ENGINES = {'BLENDER_GAME'} def poll(self, context): - mat = active_node_mat(context.material) + mat = context.material engine = context.scene.render.engine return mat and (engine in self.COMPAT_ENGINES) def draw_header(self, context): - mat = active_node_mat(context.material) + mat = context.material self.layout.prop(mat, "transparency", text="") def draw(self, context): layout = self.layout - mat = active_node_mat(context.material) + mat = context.material rayt = mat.raytrace_transparency wide_ui = context.region.width > narrowui diff --git a/release/scripts/ui/properties_texture.py b/release/scripts/ui/properties_texture.py index 4616fc5f8ab..2894761e7ac 100644 --- a/release/scripts/ui/properties_texture.py +++ b/release/scripts/ui/properties_texture.py @@ -44,19 +44,8 @@ class TEXTURE_MT_envmap_specials(bpy.types.Menu): layout.operator("texture.envmap_clear_all", icon='FILE_REFRESH') -def active_node_mat(mat): - if mat: - mat_node = mat.active_node_material - if mat_node: - return mat_node - else: - return mat - - return None - - def context_tex_datablock(context): - idblock = active_node_mat(context.material) + idblock = context.material if idblock: return idblock diff --git a/release/scripts/ui/space_node.py b/release/scripts/ui/space_node.py index f510235a39d..9f6b127347b 100644 --- a/release/scripts/ui/space_node.py +++ b/release/scripts/ui/space_node.py @@ -55,7 +55,10 @@ class NODE_HT_header(bpy.types.Header): snode_id = snode.id id_from = snode.id_from if id_from: - layout.template_ID(id_from, "active_texture", new="texture.new") + if snode.texture_type == 'BRUSH': + layout.template_ID(id_from, "texture", new="texture.new") + else: + layout.template_ID(id_from, "active_texture", new="texture.new") if snode_id: layout.prop(snode_id, "use_nodes") diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 473f706f6f8..7a5757e99d2 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -401,11 +401,13 @@ void snode_set_context(SpaceNode *snode, Scene *scene) snode->from= (ID*)give_current_material(ob, ob->actcol); /* from is not set fully for material nodes, should be ID + Node then */ + snode->id= &tx->id; } } else if(snode->texfrom==SNODE_TEX_WORLD) { tx= give_current_world_texture(scene->world); snode->from= (ID *)scene->world; + snode->id= &tx->id; } else { Brush *brush= NULL; @@ -415,11 +417,12 @@ void snode_set_context(SpaceNode *snode, Scene *scene) else brush= paint_brush(&scene->toolsettings->imapaint.paint); - snode->from= (ID *)brush; - tx= give_current_brush_texture(brush); + if (brush) { + snode->from= (ID *)brush; + tx= give_current_brush_texture(brush); + snode->id= &tx->id; + } } - - snode->id= &tx->id; } if(snode->id) From ab739dd456915bb7f2b1c5e36e77e36f3e955170 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 18 Mar 2010 00:36:20 +0000 Subject: [PATCH 113/153] BGE: blenderplayer building again. *side note: Quadbuffer seems to be partially working in Blender 2.5 (it's 100% in 2.49). I'll try to take a look at that later. --- source/blenderplayer/bad_level_call_stubs/stubs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 0e2b91e647f..fc6433b95b9 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -121,6 +121,7 @@ struct Render *RE_NewRender(const char *name){return (struct Render*) NULL;} void RE_BlenderFrame(struct Render *re, struct Scene *scene, int frame){} /* rna */ +float *give_cursor(struct Scene *scene, struct View3D *v3d){return NULL;} void WM_menutype_free(void){} void WM_menutype_freelink(struct MenuType* mt){} int WM_menutype_add(struct MenuType *mt) {return 0;} @@ -178,6 +179,9 @@ int WM_keymap_item_compare(struct wmKeyMapItem *k1, struct wmKeyMapItem *k2){ret /* rna editors */ +struct KeyingSetInfo *ANIM_keyingset_info_find_named (const char name[]){return NULL;} +void ANIM_keyingset_info_register (const struct bContext *C, struct KeyingSetInfo *ksi){} +void ANIM_keyingset_info_unregister (const struct bContext *C, struct KeyingSetInfo *ksi){} short ANIM_add_driver(struct ID *id, const char rna_path[], int array_index, short flag, int type){return 0;} void ED_space_image_release_buffer(struct SpaceImage *sima, void *lock){} struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **lock_r){return (struct ImBuf *) NULL;} From 25ea2fafdd4494b1d3d462201442060c5be8111b Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 18 Mar 2010 01:26:56 +0000 Subject: [PATCH 114/153] Fix [#21651] After Fix # 21114 Adding mesh in local at cursor position doesn't work Silly bug from yesterday.. --- source/blender/editors/object/object_add.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index d852d66fb6d..b1405d1d12e 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -105,8 +105,11 @@ void ED_object_location_from_view(bContext *C, float *loc) { View3D *v3d= CTX_wm_view3d(C); Scene *scene= CTX_data_scene(C); + float *cursor; - loc = give_cursor(scene, v3d); + cursor = give_cursor(scene, v3d); + + copy_v3_v3(loc, cursor); } void ED_object_rotation_from_view(bContext *C, float *rot) From 35a5be71e7589e64bb5579748cbb2566f04a2c9c Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 18 Mar 2010 04:09:59 +0000 Subject: [PATCH 115/153] Fix [#20908] Box Select On File/Append Selects Too Many Files --- source/blender/editors/include/ED_fileselect.h | 2 +- source/blender/editors/space_file/file_draw.c | 2 +- source/blender/editors/space_file/file_ops.c | 17 +++++++---------- source/blender/editors/space_file/filesel.c | 13 +++++++++---- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h index 52d6fe479fa..8d7184902eb 100644 --- a/source/blender/editors/include/ED_fileselect.h +++ b/source/blender/editors/include/ED_fileselect.h @@ -83,7 +83,7 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar); FileLayout* ED_fileselect_get_layout(struct SpaceFile *sfile, struct ARegion *ar); int ED_fileselect_layout_numfiles(FileLayout* layout, struct ARegion *ar); -int ED_fileselect_layout_offset(FileLayout* layout, int x, int y); +int ED_fileselect_layout_offset(FileLayout* layout, int clamp_bounds, int x, int y); void ED_fileselect_layout_tilepos(FileLayout* layout, int tile, int *x, int *y); diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 63729f03e58..6259199d317 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -518,7 +518,7 @@ void file_draw_list(const bContext *C, ARegion *ar) draw_dividers(layout, v2d); } - offset = ED_fileselect_layout_offset(layout, ar->v2d.cur.xmin, -ar->v2d.cur.ymax); + offset = ED_fileselect_layout_offset(layout, 0, ar->v2d.cur.xmin, -ar->v2d.cur.ymax); if (offset<0) offset=0; numfiles_layout = ED_fileselect_layout_numfiles(layout, ar); diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index ab259f1e1cb..baf7e42bb63 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -69,7 +69,7 @@ /* ---------- FILE SELECTION ------------ */ -static int find_file_mouse(SpaceFile *sfile, struct ARegion* ar, int x, int y) +static int find_file_mouse(SpaceFile *sfile, struct ARegion* ar, int clamp_bounds, int x, int y) { float fx,fy; int active_file = -1; @@ -77,7 +77,7 @@ static int find_file_mouse(SpaceFile *sfile, struct ARegion* ar, int x, int y) UI_view2d_region_to_view(v2d, x, y, &fx, &fy); - active_file = ED_fileselect_layout_offset(sfile->layout, v2d->tot.xmin + fx, v2d->tot.ymax - fy); + active_file = ED_fileselect_layout_offset(sfile->layout, clamp_bounds, v2d->tot.xmin + fx, v2d->tot.ymax - fy); return active_file; } @@ -138,10 +138,10 @@ static FileSelect file_select(bContext* C, const rcti* rect, short selecting, sh // FileLayout *layout = ED_fileselect_get_layout(sfile, ar); int numfiles = filelist_numfiles(sfile->files); - + params->selstate = NOTACTIVE; - first_file = find_file_mouse(sfile, ar, rect->xmin, rect->ymax); - last_file = find_file_mouse(sfile, ar, rect->xmax, rect->ymin); + first_file = find_file_mouse(sfile, ar, 1, rect->xmin, rect->ymax); + last_file = find_file_mouse(sfile, ar, 1, rect->xmax, rect->ymin); clamp_to_filelist(numfiles, &first_file, &last_file); @@ -206,10 +206,9 @@ static FileSelect file_select(bContext* C, const rcti* rect, short selecting, sh static int file_border_select_exec(bContext *C, wmOperator *op) { ARegion *ar= CTX_wm_region(C); - SpaceFile *sfile= CTX_wm_space_file(C); short selecting; rcti rect; - + selecting= (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT); rect.xmin= RNA_int_get(op->ptr, "xmin"); rect.ymin= RNA_int_get(op->ptr, "ymin"); @@ -452,7 +451,7 @@ int file_hilight_set(SpaceFile *sfile, ARegion *ar, int mx, int my) my -= ar->winrct.ymin; if(BLI_in_rcti(&ar->v2d.mask, mx, my)) { - actfile = find_file_mouse(sfile, ar, mx , my); + actfile = find_file_mouse(sfile, ar, 0, mx , my); if((actfile >= 0) && (actfile < numfiles)) params->active_file=actfile; @@ -662,8 +661,6 @@ void FILE_OT_parent(struct wmOperatorType *ot) int file_refresh_exec(bContext *C, wmOperator *unused) { - SpaceFile *sfile= CTX_wm_space_file(C); - file_change_dir(C, 1); WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 6945e8c959a..da8dc4b654c 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -220,7 +220,7 @@ int ED_fileselect_layout_numfiles(FileLayout* layout, struct ARegion *ar) } } -int ED_fileselect_layout_offset(FileLayout* layout, int x, int y) +int ED_fileselect_layout_offset(FileLayout* layout, int clamp_bounds, int x, int y) { int offsetx, offsety; int active_file; @@ -231,9 +231,14 @@ int ED_fileselect_layout_offset(FileLayout* layout, int x, int y) offsetx = (x)/(layout->tile_w + 2*layout->tile_border_x); offsety = (y)/(layout->tile_h + 2*layout->tile_border_y); - if (offsetx > layout->columns-1) return -1 ; - if (offsety > layout->rows-1) return -1 ; - + if (clamp_bounds) { + CLAMP(offsetx, 0, layout->columns-1); + CLAMP(offsety, 0, layout->rows-1); + } else { + if (offsetx > layout->columns-1) return -1 ; + if (offsety > layout->rows-1) return -1 ; + } + if (layout->flag & FILE_LAYOUT_HOR) active_file = layout->rows*offsetx + offsety; else From 6c6825b536fcbbcf7dabffa195d365e51cceb8ed Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 18 Mar 2010 04:46:27 +0000 Subject: [PATCH 116/153] Fix [#21568] Scene Linking --- source/blender/makesrna/intern/rna_scene.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index b0bfbc43294..1686f3e69db 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2690,8 +2690,8 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Scene"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL); - RNA_def_property_ui_text(prop, "Set Scene", "Background set scene"); - RNA_def_property_update(prop, NC_SCENE, NULL); + RNA_def_property_ui_text(prop, "Background Scene", "Background set scene"); + RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL); prop= RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); From d96bf316ac7a1b86ee347551b05da7488e7ac65e Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 18 Mar 2010 06:03:41 +0000 Subject: [PATCH 117/153] Fix [#21657] Blender crashes after importing .obj and selecting a material Creating an object via some pre-existing obdata via the py api wasn't properly initialising the object/mesh material link data. --- source/blender/makesrna/intern/rna_main_api.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 56c0819680d..5f007c63b9e 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -156,6 +156,8 @@ Object *rna_Main_objects_new(Main *bmain, ReportList *reports, char* name, ID *d ob->id.us--; ob->data= data; + test_object_materials(ob->data); + return ob; } From 3566400dc53bcb2d07b760775d607330e3ea5d54 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 18 Mar 2010 07:05:20 +0000 Subject: [PATCH 118/153] Removed the 'recover temp' option from the splash screen - the way the temp saving currently works, it's mostly non-functional there (i.e. when you've just started the application). It would be nice if blender could name the temp files in a special way so that it could actually search through the temp folder and find the most recently saved temp file, but for now, I'll just remove the option. --- source/blender/windowmanager/intern/wm_operators.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 7d16fba404c..3a251ecd491 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1110,10 +1110,8 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse else display_name= recent->filename; uiItemStringO(col, display_name, ICON_FILE_BLEND, "WM_OT_open_mainfile", "path", recent->filename); } - uiItemL(col, "Recovery", 0); - uiItemO(col, NULL, ICON_FILE_BLEND, "WM_OT_recover_last_session"); - uiItemO(col, NULL, ICON_FILE_BLEND, "WM_OT_recover_auto_save"); - + uiItemS(col); + uiItemO(col, NULL, ICON_HELP, "WM_OT_recover_last_session"); uiItemL(col, "", 0); uiCenteredBoundsBlock(block, 0.0f); From 9ebde542ece4ce13c4f8375e879a6c497b4da3f7 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 18 Mar 2010 07:53:46 +0000 Subject: [PATCH 119/153] Bugfix: Autokeying was non-functional after the Keying Sets refactor - The RNA wrapping for the generate callback was still wrong, with the primary effect being that C-code calling this had unexpected consequences that were hard to debug. - Fixed some defective checks that meant that when specifying the RNA-pointers for the Keying Set to use (rather than using the Keying Set's own iterator callback) would never add any info. --- source/blender/editors/animation/keyingsets.c | 9 ++++++--- source/blender/makesrna/intern/rna_animation.c | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index b1f1cbbea1e..a93220aeb67 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -662,11 +662,14 @@ void ANIM_relative_keyingset_add_source (ListBase *dsources, ID *id, StructRNA * tRKS_DSource *ds; /* sanity checks - * we must have at least one valid data pointer to use + * - we must have somewhere to output the data + * - we must have both srna+data (and with id too optionally), or id by itself only */ - if (ELEM(NULL, dsources, srna) || ((id == data) && (id == NULL))) + if (dsources == NULL) return; - + if (ELEM(NULL, srna, data) && (id == NULL)) + return; + /* allocate new elem, and add to the list */ ds = MEM_callocN(sizeof(tRKS_DSource), "tRKS_DSource"); BLI_addtail(dsources, ds); diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 27f0dc5eafb..ebb251c32ca 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -131,7 +131,7 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks, RNA_parameter_set_lookup(&list, "ksi", &ksi); RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "ks", &ks); - RNA_parameter_set_lookup(&list, "data", &data); + RNA_parameter_set_lookup(&list, "data", data); /* execute the function */ ksi->ext.call(&ptr, func, &list); @@ -404,7 +404,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna) RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_pointer(func, "ks", "KeyingSet", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "data", NULL, "", ""); // "AnyType"... + parm= RNA_def_pointer(func, "data", "AnyType", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); } From 148985edf03814b26f99bf4ae883c83db216ccf3 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 18 Mar 2010 10:16:04 +0000 Subject: [PATCH 120/153] CMake: FFMPEG directory and libraries are now configurable. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35730af3f4f..279f4d65947 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,9 +193,9 @@ IF(UNIX AND NOT APPLE) ) SET(OPENEXR_LIB Half IlmImf Iex Imath) - SET(FFMPEG /usr) + SET(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory") SET(FFMPEG_INC ${FFMPEG}/include) - SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale) + SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries") SET(FFMPEG_LIBPATH ${FFMPEG}/lib) IF(WITH_FFTW3) From 618b459e8b3630eea747523febec666889a364f7 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 18 Mar 2010 13:04:46 +0000 Subject: [PATCH 121/153] F-Modifier Goodies (as requested by @ndy): * Copy/Paste operators for F-Modifiers Available in Graph and NLA Editors. Use the Copy/Paste buttons beside the 'Add Modifier' buttons. Copy copies all the modifiers of the ACTIVE F-Curve or Strip depending on the editor. Paste pastes modifiers from the buffer to all the selected F-Curves or Strips, adding the new modifiers to the ends of each list. * 'Stepped Interpolation' F-Modifier This modifier holds each interpolated value from the F-Curve for several frames without changing the timing. This allows to preview motions 'on-twos' for example without altering the timing, or having to go through setting heaps of keyframes. In this case, Andy wanted to use this for CG <-> StopMo. --- source/blender/blenkernel/BKE_fcurve.h | 1 + source/blender/blenkernel/intern/fmodifier.c | 69 ++++++++++ .../blender/editors/animation/fmodifier_ui.c | 108 ++++++++++++++- source/blender/editors/include/ED_anim_api.h | 19 +++ .../editors/space_graph/graph_buttons.c | 7 +- .../blender/editors/space_graph/graph_edit.c | 117 ++++++++++++++++- .../editors/space_graph/graph_intern.h | 2 + .../blender/editors/space_graph/graph_ops.c | 3 +- .../blender/editors/space_nla/nla_buttons.c | 5 + source/blender/editors/space_nla/nla_edit.c | 124 +++++++++++++++++- source/blender/editors/space_nla/nla_intern.h | 2 + source/blender/editors/space_nla/nla_ops.c | 2 + source/blender/makesdna/DNA_anim_types.h | 9 ++ source/blender/makesrna/RNA_access.h | 1 + source/blender/makesrna/intern/rna_fcurve.c | 26 ++++ .../windowmanager/intern/wm_init_exit.c | 2 + 16 files changed, 490 insertions(+), 7 deletions(-) diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index 9df6bfdbe7c..c4d74f86284 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -158,6 +158,7 @@ FModifierTypeInfo *get_fmodifier_typeinfo(int type); /* ---------------------- */ struct FModifier *add_fmodifier(ListBase *modifiers, int type); +struct FModifier *copy_fmodifier(struct FModifier *src); void copy_fmodifiers(ListBase *dst, ListBase *src); int remove_fmodifier(ListBase *modifiers, struct FModifier *fcm); int remove_fmodifier_index(ListBase *modifiers, int index); diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index bbef3227490..02f35bb78f8 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -871,6 +871,49 @@ static FModifierTypeInfo FMI_LIMITS = { fcm_limits_evaluate /* evaluate */ }; +/* Stepped F-Curve Modifier --------------------------- */ + +static void fcm_stepped_new_data (void *mdata) +{ + FMod_Stepped *data= (FMod_Stepped *)mdata; + + /* just need to set the step-size to 2-frames by default */ + // XXX: or would 5 be more normal? + data->step_size = 2.0f; +} + +static float fcm_stepped_time (FCurve *fcu, FModifier *fcm, float cvalue, float evaltime) +{ + FMod_Stepped *data= (FMod_Stepped *)fcm->data; + int snapblock; + + /* we snap to the start of the previous closest block of 'step_size' frames + * after the start offset has been discarded + * - i.e. round down + */ + snapblock = (int)((evaltime - data->start) / data->step_size); + + /* reapply the offset, and multiple the snapblock by the size of the steps to get + * the new time to evaluate at + */ + return ((float)snapblock * data->step_size) + data->start; +} + +static FModifierTypeInfo FMI_STEPPED = { + FMODIFIER_TYPE_STEPPED, /* type */ + sizeof(FMod_Limits), /* size */ + FMI_TYPE_GENERATE_CURVE, /* action type */ /* XXX... err... */ + FMI_REQUIRES_RUNTIME_CHECK, /* requirements */ + "Stepped", /* name */ + "FMod_Stepped", /* struct name */ + NULL, /* free data */ + NULL, /* copy data */ + fcm_stepped_new_data, /* new data */ + NULL, /* verify */ + fcm_stepped_time, /* evaluate time */ + NULL /* evaluate */ +}; + /* F-Curve Modifier API --------------------------- */ /* All of the F-Curve Modifier api functions use FModifierTypeInfo structs to carry out * and operations that involve F-Curve modifier specific code. @@ -892,6 +935,7 @@ static void fmods_init_typeinfo () fmodifiersTypeInfo[6]= NULL/*&FMI_FILTER*/; /* Filter F-Curve Modifier */ // XXX unimplemented fmodifiersTypeInfo[7]= &FMI_PYTHON; /* Custom Python F-Curve Modifier */ fmodifiersTypeInfo[8]= &FMI_LIMITS; /* Limits F-Curve Modifier */ + fmodifiersTypeInfo[9]= &FMI_STEPPED; /* Stepped F-Curve Modifier */ } /* This function should be used for getting the appropriate type-info when only @@ -968,6 +1012,31 @@ FModifier *add_fmodifier (ListBase *modifiers, int type) return fcm; } +/* Make a copy of the specified F-Modifier */ +FModifier *copy_fmodifier (FModifier *src) +{ + FModifierTypeInfo *fmi= fmodifier_get_typeinfo(src); + FModifier *dst; + + /* sanity check */ + if (src == NULL) + return NULL; + + /* copy the base data, clearing the links */ + dst = MEM_dupallocN(src); + dst->next = dst->prev = NULL; + + /* make a new copy of the F-Modifier's data */ + dst->data = MEM_dupallocN(src->data); + + /* only do specific constraints if required */ + if (fmi && fmi->copy_data) + fmi->copy_data(dst, src); + + /* return the new modifier */ + return dst; +} + /* Duplicate all of the F-Modifiers in the Modifier stacks */ void copy_fmodifiers (ListBase *dst, ListBase *src) { diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 9d0fe99976b..22bb5317383 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -30,6 +30,9 @@ * This file defines the (C-Coded) templates + editing callbacks needed * by the interface stuff or F-Modifiers, as used by F-Curves in the Graph Editor, * and NLA-Strips in the NLA Editor. + * + * Copy/Paste Buffer for F-Modifiers: + * For now, this is also defined in this file so that it can be shared between the */ #include @@ -47,15 +50,18 @@ #include "RNA_access.h" +#include "ED_anim_api.h" + #include "UI_interface.h" #include "UI_resources.h" +/* ********************************************** */ +/* UI STUFF */ + // XXX! -------------------------------- /* temporary definition for limits of float number buttons (FLT_MAX tends to infinity with old system) */ #define UI_FLT_MAX 10000.0f -/* ********************************************** */ - #define B_REDR 1 #define B_FMODIFIER_REDRAW 20 @@ -549,6 +555,22 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor /* --------------- */ +/* draw settings for stepped interpolation modifier */ +static void draw_modifier__stepped(uiLayout *layout, ID *id, FModifier *fcm, short width) +{ + uiLayout *col; + PointerRNA ptr; + + /* init the RNA-pointer */ + RNA_pointer_create(id, &RNA_FModifierStepped, fcm, &ptr); + + col= uiLayoutColumn(layout, 0); + + uiItemR(col, NULL, 0, &ptr, "step_size", 0); + uiItemR(col, NULL, 0, &ptr, "start_offset", 0); +} + +/* --------------- */ void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifiers, FModifier *fcm) { @@ -635,6 +657,10 @@ void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifie case FMODIFIER_TYPE_NOISE: /* Noise */ draw_modifier__noise(box, id, fcm, width); break; + + case FMODIFIER_TYPE_STEPPED: /* Stepped */ + draw_modifier__stepped(box, id, fcm, width); + break; default: /* unknown type */ break; @@ -643,3 +669,81 @@ void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifie } /* ********************************************** */ +/* COPY/PASTE BUFFER STUFF */ + +/* Copy/Paste Buffer itself (list of FModifier 's) */ +static ListBase fmodifier_copypaste_buf = {NULL, NULL}; + +/* ---------- */ + +/* free the copy/paste buffer */ +void free_fmodifiers_copybuf (void) +{ + /* just free the whole buffer */ + free_fmodifiers(&fmodifier_copypaste_buf); +} + +/* copy the given F-Modifiers to the buffer, returning whether anything was copied or not + * assuming that the buffer has been cleared already with free_fmodifiers_copybuf() + * - active: only copy the active modifier + */ +short ANIM_fmodifiers_copy_to_buf (ListBase *modifiers, short active) +{ + short ok = 1; + + /* sanity checks */ + if ELEM(NULL, modifiers, modifiers->first) + return 0; + + /* copy the whole list, or just the active one? */ + if (active) { + FModifier *fcm = find_active_fmodifier(modifiers); + + if (fcm) { + FModifier *fcmN = copy_fmodifier(fcm); + BLI_addtail(&fmodifier_copypaste_buf, fcmN); + } + else + ok = 0; + } + else + copy_fmodifiers(&fmodifier_copypaste_buf, modifiers); + + /* did we succeed? */ + return ok; +} + +/* 'Paste' the F-Modifier(s) from the buffer to the specified list + * - replace: free all the existing modifiers to leave only the pasted ones + */ +short ANIM_fmodifiers_paste_from_buf (ListBase *modifiers, short replace) +{ + FModifier *fcm; + short ok = 0; + + /* sanity checks */ + if (modifiers == NULL) + return 0; + + /* if replacing the list, free the existing modifiers */ + if (replace) + free_fmodifiers(modifiers); + + /* now copy over all the modifiers in the buffer to the end of the list */ + for (fcm= fmodifier_copypaste_buf.first; fcm; fcm= fcm->next) { + /* make a copy of it */ + FModifier *fcmN = copy_fmodifier(fcm); + + /* make sure the new one isn't active, otherwise the list may get several actives */ + fcmN->flag &= ~FMODIFIER_FLAG_ACTIVE; + + /* now add it to the end of the list */ + BLI_addtail(modifiers, fcmN); + ok = 1; + } + + /* did we succeed? */ + return ok; +} + +/* ********************************************** */ diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 2f089a41a3f..3892770c1f4 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -452,9 +452,28 @@ void ANIM_draw_previewrange(const struct bContext *C, struct View2D *v2d); /* ************************************************* */ /* F-MODIFIER TOOLS */ +/* ------------- UI Panel Drawing -------------- */ + /* draw a given F-Modifier for some layout/UI-Block */ void ANIM_uiTemplate_fmodifier_draw(struct uiLayout *layout, struct ID *id, ListBase *modifiers, struct FModifier *fcm); +/* ------------- Copy/Paste Buffer -------------- */ + + +/* free the copy/paste buffer */ +void free_fmodifiers_copybuf(void); + +/* copy the given F-Modifiers to the buffer, returning whether anything was copied or not + * assuming that the buffer has been cleared already with free_fmodifiers_copybuf() + * - active: only copy the active modifier + */ +short ANIM_fmodifiers_copy_to_buf(ListBase *modifiers, short active); + +/* 'Paste' the F-Modifier(s) from the buffer to the specified list + * - replace: free all the existing modifiers to leave only the pasted ones + */ +short ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, short replace); + /* ************************************************* */ /* ASSORTED TOOLS */ diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 3975c88fe5c..78fd2e06683 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -610,8 +610,13 @@ static void graph_panel_modifiers(const bContext *C, Panel *pa) row= uiLayoutRow(pa->layout, 0); block= uiLayoutGetBlock(row); - // XXX for now, this will be a operator button which calls a temporary 'add modifier' operator + // XXX for now, this will be a operator button which calls a 'add modifier' operator uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, "Add Modifier", 10, 0, 150, 20, "Adds a new F-Curve Modifier for the active F-Curve"); + + /* copy/paste (as sub-row)*/ + row= uiLayoutRow(row, 1); + uiItemO(row, "", ICON_COPYDOWN, "GRAPH_OT_fmodifier_copy"); + uiItemO(row, "", ICON_PASTEDOWN, "GRAPH_OT_fmodifier_paste"); } /* draw each modifier */ diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 485c9ab8bf4..d23bafbc001 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1971,7 +1971,7 @@ static int graph_fmodifier_add_exec(bContext *C, wmOperator *op) filter |= (ANIMFILTER_SEL|ANIMFILTER_CURVEVISIBLE); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - /* smooth keyframes */ + /* add f-modifier to each curve */ for (ale= anim_data.first; ale; ale= ale->next) { FCurve *fcu= (FCurve *)ale->data; FModifier *fcm; @@ -2017,4 +2017,119 @@ void GRAPH_OT_fmodifier_add (wmOperatorType *ot) RNA_def_boolean(ot->srna, "only_active", 1, "Only Active", "Only add F-Modifier to active F-Curve."); } +/* ******************** Copy F-Modifiers Operator *********************** */ + +static int graph_fmodifier_copy_exec(bContext *C, wmOperator *op) +{ + bAnimContext ac; + bAnimListElem *ale; + short ok = 0; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* clear buffer first */ + free_fmodifiers_copybuf(); + + /* get the active F-Curve */ + ale= get_active_fcurve_channel(&ac); + + /* if this exists, call the copy F-Modifiers API function */ + if (ale && ale->data) { + FCurve *fcu= (FCurve *)ale->data; + + // TODO: when 'active' vs 'all' boolean is added, change last param! + ok= ANIM_fmodifiers_copy_to_buf(&fcu->modifiers, 0); + + /* free temp data now */ + MEM_freeN(ale); + } + + /* successful or not? */ + if (ok == 0) { + BKE_report(op->reports, RPT_ERROR, "No F-Modifiers available to be copied"); + return OPERATOR_CANCELLED; + } + else + return OPERATOR_FINISHED; +} + +void GRAPH_OT_fmodifier_copy (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Copy F-Modifiers"; + ot->idname= "GRAPH_OT_fmodifier_copy"; + ot->description= "Copy the F-Modifier(s) of the active F-Curve."; + + /* api callbacks */ + ot->exec= graph_fmodifier_copy_exec; + ot->poll= graphop_active_fcurve_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* id-props */ + //ot->prop = RNA_def_boolean(ot->srna, "all", 1, "All F-Modifiers", "Copy all the F-Modifiers, instead of just the active one"); +} + +/* ******************** Paste F-Modifiers Operator *********************** */ + +static int graph_fmodifier_paste_exec(bContext *C, wmOperator *op) +{ + bAnimContext ac; + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter, ok=0; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* filter data */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* paste modifiers */ + for (ale = anim_data.first; ale; ale = ale->next) { + FCurve *fcu= (FCurve *)ale->data; + + // TODO: do we want to replace existing modifiers? add user pref for that! + ok += ANIM_fmodifiers_paste_from_buf(&fcu->modifiers, 0); + } + + /* clean up */ + BLI_freelistN(&anim_data); + + /* successful or not? */ + if (ok) { + /* validate keyframes after editing */ + ANIM_editkeyframes_refresh(&ac); + + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + + return OPERATOR_FINISHED; + } + else { + BKE_report(op->reports, RPT_ERROR, "No F-Modifiers to paste"); + return OPERATOR_CANCELLED; + } +} + +void GRAPH_OT_fmodifier_paste (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Paste F-Modifiers"; + ot->idname= "GRAPH_OT_fmodifier_paste"; + ot->description= "Add copied F-Modifiers to the selected F-Curves"; + + /* api callbacks */ + ot->exec= graph_fmodifier_paste_exec; + ot->poll= graphop_editable_keyframes_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /* ************************************************************************** */ diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h index 696d31e22e1..356cd05b509 100644 --- a/source/blender/editors/space_graph/graph_intern.h +++ b/source/blender/editors/space_graph/graph_intern.h @@ -139,6 +139,8 @@ enum { /* ----------- */ void GRAPH_OT_fmodifier_add(struct wmOperatorType *ot); +void GRAPH_OT_fmodifier_copy(struct wmOperatorType *ot); +void GRAPH_OT_fmodifier_paste(struct wmOperatorType *ot); /* ----------- */ diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index 7c1ac14027a..63c877e7402 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -262,8 +262,9 @@ void graphedit_operatortypes(void) WM_operatortype_append(GRAPH_OT_click_insert); /* F-Curve Modifiers */ - // XXX temporary? WM_operatortype_append(GRAPH_OT_fmodifier_add); + WM_operatortype_append(GRAPH_OT_fmodifier_copy); + WM_operatortype_append(GRAPH_OT_fmodifier_paste); } /* ************************** registration - keymaps **********************************/ diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 4f944d1b855..944a93a713f 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -430,6 +430,11 @@ static void nla_panel_modifiers(const bContext *C, Panel *pa) // XXX for now, this will be a operator button which calls a temporary 'add modifier' operator // FIXME: we need to set the only-active property so that this will only add modifiers for the active strip (not all selected) uiDefButO(block, BUT, "NLA_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, "Add Modifier", 10, 0, 150, 20, "Adds a new F-Modifier for the active NLA Strip"); + + /* copy/paste (as sub-row)*/ + row= uiLayoutRow(row, 1); + uiItemO(row, "", ICON_COPYDOWN, "NLA_OT_fmodifier_copy"); + uiItemO(row, "", ICON_PASTEDOWN, "NLA_OT_fmodifier_paste"); } /* draw each modifier */ diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 543fa1dfed7..bc99ded4db6 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -1633,8 +1633,7 @@ static int nla_fmodifier_add_exec(bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set notifier that things have changed */ - // FIXME: this doesn't really do it justice... - WM_event_add_notifier(C, NC_ANIMATION, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); /* done */ return OPERATOR_FINISHED; @@ -1659,4 +1658,125 @@ void NLA_OT_fmodifier_add (wmOperatorType *ot) RNA_def_boolean(ot->srna, "only_active", 0, "Only Active", "Only add F-Modifier of the specified type to the active strip."); } +/* ******************** Copy F-Modifiers Operator *********************** */ + +static int nla_fmodifier_copy_exec(bContext *C, wmOperator *op) +{ + bAnimContext ac; + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter, ok=0; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* clear buffer first */ + free_fmodifiers_copybuf(); + + /* get a list of the editable tracks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* for each NLA-Track, add the specified modifier to all selected strips */ + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip; + + for (strip= nlt->strips.first; strip; strip=strip->next) { + /* only add F-Modifier if on active strip? */ + if ((strip->flag & NLASTRIP_FLAG_ACTIVE)==0) + continue; + + // TODO: when 'active' vs 'all' boolean is added, change last param! + ok += ANIM_fmodifiers_copy_to_buf(&strip->modifiers, 0); + } + } + + /* successful or not? */ + if (ok == 0) { + BKE_report(op->reports, RPT_ERROR, "No F-Modifiers available to be copied"); + return OPERATOR_CANCELLED; + } + else + return OPERATOR_FINISHED; +} + +void NLA_OT_fmodifier_copy (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Copy F-Modifiers"; + ot->idname= "NLA_OT_fmodifier_copy"; + ot->description= "Copy the F-Modifier(s) of the active NLA-Strip."; + + /* api callbacks */ + ot->exec= nla_fmodifier_copy_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* id-props */ + //ot->prop = RNA_def_boolean(ot->srna, "all", 1, "All F-Modifiers", "Copy all the F-Modifiers, instead of just the active one"); +} + +/* ******************** Paste F-Modifiers Operator *********************** */ + +static int nla_fmodifier_paste_exec(bContext *C, wmOperator *op) +{ + bAnimContext ac; + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter, ok=0; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the editable tracks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_SEL | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* for each NLA-Track, add the specified modifier to all selected strips */ + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip; + + for (strip= nlt->strips.first; strip; strip=strip->next) { + // TODO: do we want to replace existing modifiers? add user pref for that! + ok += ANIM_fmodifiers_paste_from_buf(&strip->modifiers, 0); + } + } + + /* clean up */ + BLI_freelistN(&anim_data); + + /* successful or not? */ + if (ok) { + /* set notifier that things have changed */ + /* set notifier that things have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); + return OPERATOR_FINISHED; + } + else { + BKE_report(op->reports, RPT_ERROR, "No F-Modifiers to paste"); + return OPERATOR_CANCELLED; + } +} + +void NLA_OT_fmodifier_paste (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Paste F-Modifiers"; + ot->idname= "NLA_OT_fmodifier_paste"; + ot->description= "Add copied F-Modifiers to the selected NLA-Strips"; + + /* api callbacks */ + ot->exec= nla_fmodifier_paste_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /* *********************************************** */ diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 1af2d2a1635..18ef91220f9 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -111,6 +111,8 @@ void NLA_OT_clear_scale(wmOperatorType *ot); void NLA_OT_snap(wmOperatorType *ot); void NLA_OT_fmodifier_add(wmOperatorType *ot); +void NLA_OT_fmodifier_copy(wmOperatorType *ot); +void NLA_OT_fmodifier_paste(wmOperatorType *ot); /* **************************************** */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 10ff10f46fd..249256a47f9 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -165,6 +165,8 @@ void nla_operatortypes(void) WM_operatortype_append(NLA_OT_snap); WM_operatortype_append(NLA_OT_fmodifier_add); + WM_operatortype_append(NLA_OT_fmodifier_copy); + WM_operatortype_append(NLA_OT_fmodifier_paste); } /* ************************** registration - keymaps **********************************/ diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index 8e46cfefba5..44727218f4f 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -73,6 +73,7 @@ typedef enum eFModifier_Types { FMODIFIER_TYPE_FILTER, /* unimplemented - for applying: fft, high/low pass filters, etc. */ FMODIFIER_TYPE_PYTHON, FMODIFIER_TYPE_LIMITS, + FMODIFIER_TYPE_STEPPED, /* NOTE: all new modifiers must be added above this line */ FMODIFIER_NUM_TYPES @@ -211,6 +212,7 @@ typedef enum eFMod_Limit_Flags { FCM_LIMIT_YMAX = (1<<3), } eFMod_Limit_Flags; + /* noise modifier data */ typedef struct FMod_Noise { float size; @@ -230,6 +232,13 @@ typedef enum eFMod_Noise_Modifications { FCM_NOISE_MODIF_MULTIPLY, /* Multiply the curve by noise */ } eFMod_Noise_Modifications; + +/* stepped modifier data */ +typedef struct FMod_Stepped { + float step_size; /* Number of frames each interpolated value should be held */ + float start; /* Reference frame number that stepping starts from */ +} FMod_Stepped; + /* Drivers -------------------------------------- */ /* Driver Target (dtar) diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index e50b1b7ad58..2671f480d3b 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -217,6 +217,7 @@ extern StructRNA RNA_FModifierGenerator; extern StructRNA RNA_FModifierLimits; extern StructRNA RNA_FModifierNoise; extern StructRNA RNA_FModifierPython; +extern StructRNA RNA_FModifierStepped; extern StructRNA RNA_FollowPathConstraint; extern StructRNA RNA_Function; extern StructRNA RNA_GameBooleanProperty; diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index d5d28ac83ae..3ab4673212d 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -51,6 +51,7 @@ EnumPropertyItem fmodifier_type_items[] = { {FMODIFIER_TYPE_FILTER, "FILTER", 0, "Filter", ""}, {FMODIFIER_TYPE_PYTHON, "PYTHON", 0, "Python", ""}, {FMODIFIER_TYPE_LIMITS, "LIMITS", 0, "Limits", ""}, + {FMODIFIER_TYPE_STEPPED, "STEPPED", 0, "Stepped Interpolation", ""}, {0, NULL, 0, NULL, NULL}}; EnumPropertyItem beztriple_keyframe_type_items[] = { @@ -84,6 +85,8 @@ static StructRNA *rna_FModifierType_refine(struct PointerRNA *ptr) return &RNA_FModifierPython; case FMODIFIER_TYPE_LIMITS: return &RNA_FModifierLimits; + case FMODIFIER_TYPE_STEPPED: + return &RNA_FModifierStepped; default: return &RNA_UnknownType; } @@ -712,9 +715,31 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna) } +/* --------- */ + +static void rna_def_fmodifier_stepped(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "FModifierStepped", "FModifier"); + RNA_def_struct_ui_text(srna, "Stepped Interpolation F-Modifier", "Holds each interpolated value from the F-Curve for several frames without changing the timing"); + RNA_def_struct_sdna_from(srna, "FMod_Stepped", "data"); + + /* properties */ + prop= RNA_def_property(srna, "step_size", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Step Size", "Number of frames to hold each value"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + + prop= RNA_def_property(srna, "start_offset", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "start"); + RNA_def_property_ui_text(prop, "Start Offset", "Reference number of frames before frames get held. Use to get hold for '1-3' vs '5-7' holding patterns"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); +} /* --------- */ + static void rna_def_fmodifier(BlenderRNA *brna) { StructRNA *srna; @@ -1209,6 +1234,7 @@ void RNA_def_fcurve(BlenderRNA *brna) rna_def_fmodifier_python(brna); rna_def_fmodifier_limits(brna); rna_def_fmodifier_noise(brna); + rna_def_fmodifier_stepped(brna); } diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index ae310a7f59d..e5b5e0db1b4 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -217,6 +217,7 @@ extern wchar_t *copybufinfo; // XXX copy/paste buffer stuff... extern void free_anim_copybuf(); extern void free_anim_drivers_copybuf(); +extern void free_fmodifiers_copybuf(); extern void free_posebuf(); /* called in creator.c even... tsk, split this! */ @@ -272,6 +273,7 @@ void WM_exit(bContext *C) // free_matcopybuf(); free_anim_copybuf(); free_anim_drivers_copybuf(); + free_fmodifiers_copybuf(); free_posebuf(); // free_vertexpaint(); // free_imagepaint(); From cd9e6253c3023d23de331b00b23e3dd2054113f2 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 18 Mar 2010 13:05:42 +0000 Subject: [PATCH 122/153] Missed a file - stepped F-Modifier should have its handles visible+editable to be useful --- source/blender/editors/space_graph/graph_utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/editors/space_graph/graph_utils.c b/source/blender/editors/space_graph/graph_utils.c index 3d1f0b49826..1d7ffdd1308 100644 --- a/source/blender/editors/space_graph/graph_utils.c +++ b/source/blender/editors/space_graph/graph_utils.c @@ -141,6 +141,8 @@ short fcurve_needs_draw_fmodifier_controls (FCurve *fcu, FModifier *fcm) /* clearly harmless */ case FMODIFIER_TYPE_CYCLES: return 0; + case FMODIFIER_TYPE_STEPPED: + return 0; /* borderline... */ case FMODIFIER_TYPE_NOISE: From 5e7b1bde8d35676bbb5a88f62821ed6689d0761b Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Fri, 19 Mar 2010 03:26:31 +0000 Subject: [PATCH 123/153] Hack to make people stop bugging me. Working around a problem in a work around for holes in the operator API and event system. --- source/blender/editors/transform/transform.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 9cd3ee3ba99..8ac7d2aeab3 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1456,17 +1456,21 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int t->launch_event = event ? event->type : -1; - if (t->launch_event == EVT_TWEAK_R) + if (U.flag & USER_DRAGIMMEDIATE) { - t->launch_event = RIGHTMOUSE; - } - else if (t->launch_event == EVT_TWEAK_L) - { - t->launch_event = LEFTMOUSE; + if (t->launch_event == EVT_TWEAK_R) + { + t->launch_event = RIGHTMOUSE; + } + else if (t->launch_event == EVT_TWEAK_L) + { + t->launch_event = LEFTMOUSE; + } } + // XXX Remove this when wm_operator_call_internal doesn't use window->eventstate (which can have type = 0) // For manipulator only, so assume LEFTMOUSE - else if (t->launch_event == 0) + if (t->launch_event == 0) { t->launch_event = LEFTMOUSE; } From d89a8c34f3dc1a2923b6853c260de4f1deab9466 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 19 Mar 2010 03:38:14 +0000 Subject: [PATCH 124/153] More F-Modifier Tweaks: This commit started out aiming to make the "Stepped" F-Modifier (committed last night) even more useful, but ended up fixing a few other finer-points of how F-Modifiers work. Firstly, the new stuff: I've addded options to the Stepped F-Modifier to not affect frames before and/or after specified values, and renamed the 'start offset' to 'offset' for clarity. The main objective of this is to allow Stepped F-Modifiers to only affect certain time ranges, so that by layering/using multiple instances of the F-Modifier, it can be possible to have multiple stepping-sizes. This allows for effects like: http://www.pasteall.org/blend/2230 or in words, it provides a convenient mechanism for animators to specify whether sections of the animation is shown "on twos", "fours", or even "forty-second-ths plus a smidgen", as can be easily done with 2D. Assorted changes to support this: * Properly fixed up how F-Modifiers that work with time, evaluate the time to evaluate the curve at. Now layered time effects like this should be possible in a much nicer way. * Added proper value range validation/clamping to many properties. There are still a lot more that need checking, but at least more properties now do "the right thing". --- source/blender/blenkernel/intern/fmodifier.c | 31 +++++-- .../blender/editors/animation/fmodifier_ui.c | 64 +++++++++----- source/blender/makesdna/DNA_anim_types.h | 13 ++- source/blender/makesrna/intern/rna_fcurve.c | 85 ++++++++++++++++++- 4 files changed, 158 insertions(+), 35 deletions(-) diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index 02f35bb78f8..969a4208cd3 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -887,16 +887,26 @@ static float fcm_stepped_time (FCurve *fcu, FModifier *fcm, float cvalue, float FMod_Stepped *data= (FMod_Stepped *)fcm->data; int snapblock; + /* check range clamping to see if we should alter the timing to achieve the desired results */ + if (data->flag & FCM_STEPPED_NO_BEFORE) { + if (evaltime < data->start_frame) + return evaltime; + } + if (data->flag & FCM_STEPPED_NO_AFTER) { + if (evaltime > data->end_frame) + return evaltime; + } + /* we snap to the start of the previous closest block of 'step_size' frames * after the start offset has been discarded * - i.e. round down */ - snapblock = (int)((evaltime - data->start) / data->step_size); + snapblock = (int)((evaltime - data->offset) / data->step_size); /* reapply the offset, and multiple the snapblock by the size of the steps to get * the new time to evaluate at */ - return ((float)snapblock * data->step_size) + data->start; + return ((float)snapblock * data->step_size) + data->offset; } static FModifierTypeInfo FMI_STEPPED = { @@ -1201,14 +1211,20 @@ short list_has_suitable_fmodifier (ListBase *modifiers, int mtype, short acttype float evaluate_time_fmodifiers (ListBase *modifiers, FCurve *fcu, float cvalue, float evaltime) { FModifier *fcm; - float m_evaltime= evaltime; /* sanity checks */ if ELEM(NULL, modifiers, modifiers->last) return evaltime; - /* find the first modifier from end of stack that modifies time, and calculate the time the modifier - * would calculate time at + /* Starting from the end of the stack, calculate the time effects of various stacked modifiers + * on the time the F-Curve should be evaluated at. + * + * This is done in reverse order to standard evaluation, as when this is done in standard + * order, each modifier would cause jumps to other points in the curve, forcing all + * previous ones to be evaluated again for them to be correct. However, if we did in the + * reverse order as we have here, we can consider them a macro to micro type of waterfall + * effect, which should get us the desired effects when using layered time manipulations + * (such as multiple 'stepped' modifiers in sequence, causing different stepping rates) */ for (fcm= modifiers->last; fcm; fcm= fcm->prev) { FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); @@ -1217,13 +1233,12 @@ float evaluate_time_fmodifiers (ListBase *modifiers, FCurve *fcu, float cvalue, // TODO: implement the 'influence' control feature... if (fmi && fmi->evaluate_modifier_time) { if ((fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) == 0) - m_evaltime= fmi->evaluate_modifier_time(fcu, fcm, cvalue, evaltime); - break; + evaltime= fmi->evaluate_modifier_time(fcu, fcm, cvalue, evaltime); } } /* return the modified evaltime */ - return m_evaltime; + return evaltime; } /* Evalautes the given set of F-Curve Modifiers using the given data diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 22bb5317383..06a4a2f980b 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -42,6 +42,8 @@ #include "MEM_guardedalloc.h" +#include "BLI_blenlib.h" + #include "BKE_context.h" #include "BKE_fcurve.h" @@ -252,15 +254,15 @@ static void draw_modifier__cycles(uiLayout *layout, ID *id, FModifier *fcm, shor /* before range */ col= uiLayoutColumn(split, 1); - uiItemL(col, "Before:", 0); - uiItemR(col, "", 0, &ptr, "before_mode", 0); - uiItemR(col, NULL, 0, &ptr, "before_cycles", 0); + uiItemL(col, "Before:", 0); + uiItemR(col, "", 0, &ptr, "before_mode", 0); + uiItemR(col, NULL, 0, &ptr, "before_cycles", 0); /* after range */ col= uiLayoutColumn(split, 1); - uiItemL(col, "After:", 0); - uiItemR(col, "", 0, &ptr, "after_mode", 0); - uiItemR(col, NULL, 0, &ptr, "after_cycles", 0); + uiItemL(col, "After:", 0); + uiItemR(col, "", 0, &ptr, "after_mode", 0); + uiItemR(col, NULL, 0, &ptr, "after_cycles", 0); } /* --------------- */ @@ -282,13 +284,13 @@ static void draw_modifier__noise(uiLayout *layout, ID *id, FModifier *fcm, short /* col 1 */ col= uiLayoutColumn(split, 0); - uiItemR(col, NULL, 0, &ptr, "size", 0); - uiItemR(col, NULL, 0, &ptr, "strength", 0); + uiItemR(col, NULL, 0, &ptr, "size", 0); + uiItemR(col, NULL, 0, &ptr, "strength", 0); /* col 2 */ col= uiLayoutColumn(split, 0); - uiItemR(col, NULL, 0, &ptr, "phase", 0); - uiItemR(col, NULL, 0, &ptr, "depth", 0); + uiItemR(col, NULL, 0, &ptr, "phase", 0); + uiItemR(col, NULL, 0, &ptr, "depth", 0); } /* --------------- */ @@ -525,16 +527,16 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor /* x-minimum */ col= uiLayoutColumn(split, 1); - uiItemR(col, NULL, 0, &ptr, "use_minimum_x", 0); - uiItemR(col, NULL, 0, &ptr, "minimum_x", 0); + uiItemR(col, NULL, 0, &ptr, "use_minimum_x", 0); + uiItemR(col, NULL, 0, &ptr, "minimum_x", 0); /* y-minimum*/ col= uiLayoutColumn(split, 1); - uiItemR(col, NULL, 0, &ptr, "use_minimum_y", 0); - uiItemR(col, NULL, 0, &ptr, "minimum_y", 0); + uiItemR(col, NULL, 0, &ptr, "use_minimum_y", 0); + uiItemR(col, NULL, 0, &ptr, "minimum_y", 0); } - /* row 2: minimum */ + /* row 2: maximum */ { row= uiLayoutRow(layout, 0); @@ -543,13 +545,13 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor /* x-minimum */ col= uiLayoutColumn(split, 1); - uiItemR(col, NULL, 0, &ptr, "use_maximum_x", 0); - uiItemR(col, NULL, 0, &ptr, "maximum_x", 0); + uiItemR(col, NULL, 0, &ptr, "use_maximum_x", 0); + uiItemR(col, NULL, 0, &ptr, "maximum_x", 0); /* y-minimum*/ col= uiLayoutColumn(split, 1); - uiItemR(col, NULL, 0, &ptr, "use_maximum_y", 0); - uiItemR(col, NULL, 0, &ptr, "maximum_y", 0); + uiItemR(col, NULL, 0, &ptr, "use_maximum_y", 0); + uiItemR(col, NULL, 0, &ptr, "maximum_y", 0); } } @@ -558,16 +560,32 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor /* draw settings for stepped interpolation modifier */ static void draw_modifier__stepped(uiLayout *layout, ID *id, FModifier *fcm, short width) { - uiLayout *col; + uiLayout *col, *subcol; PointerRNA ptr; /* init the RNA-pointer */ RNA_pointer_create(id, &RNA_FModifierStepped, fcm, &ptr); + /* block 1: "stepping" settings */ col= uiLayoutColumn(layout, 0); - - uiItemR(col, NULL, 0, &ptr, "step_size", 0); - uiItemR(col, NULL, 0, &ptr, "start_offset", 0); + uiItemR(col, NULL, 0, &ptr, "step_size", 0); + uiItemR(col, NULL, 0, &ptr, "offset", 0); + + /* block 2: start range settings */ + col= uiLayoutColumn(layout, 1); + uiItemR(col, NULL, 0, &ptr, "use_start_frame", 0); + + subcol = uiLayoutColumn(col, 1); + uiLayoutSetActive(subcol, RNA_boolean_get(&ptr, "use_start_frame")); + uiItemR(subcol, NULL, 0, &ptr, "start_frame", 0); + + /* block 3: end range settings */ + col= uiLayoutColumn(layout, 1); + uiItemR(col, NULL, 0, &ptr, "use_end_frame", 0); + + subcol = uiLayoutColumn(col, 1); + uiLayoutSetActive(subcol, RNA_boolean_get(&ptr, "use_end_frame")); + uiItemR(subcol, NULL, 0, &ptr, "end_frame", 0); } /* --------------- */ diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index 44727218f4f..83f68758da9 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -236,9 +236,20 @@ typedef enum eFMod_Noise_Modifications { /* stepped modifier data */ typedef struct FMod_Stepped { float step_size; /* Number of frames each interpolated value should be held */ - float start; /* Reference frame number that stepping starts from */ + float offset; /* Reference frame number that stepping starts from */ + + float start_frame; /* start frame of the frame range that modifier works in */ + float end_frame; /* end frame of the frame range that modifier works in */ + + int flag; /* various settings */ } FMod_Stepped; +/* stepped modifier range flags */ +typedef enum eFMod_Stepped_Flags { + FCM_STEPPED_NO_BEFORE = (1<<0), /* don't affect frames before the start frame */ + FCM_STEPPED_NO_AFTER = (1<<1), /* don't affect frames after the end frame */ +} eFMod_Stepped_Flags; + /* Drivers -------------------------------------- */ /* Driver Target (dtar) diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 3ab4673212d..fcd5bb858c7 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -406,6 +406,61 @@ static void rna_FModifierGenerator_coefficients_set(PointerRNA *ptr, const float memcpy(gen->coefficients, values, gen->arraysize * sizeof(float)); } +static void rna_FModifierLimits_minx_range(PointerRNA *ptr, float *min, float *max) +{ + FModifier *fcm= (FModifier*)ptr->data; + FMod_Limits *data= fcm->data; + + *min= MINAFRAMEF; + *max= (data->flag & FCM_LIMIT_XMAX)? data->rect.xmax : MAXFRAMEF; +} + +static void rna_FModifierLimits_maxx_range(PointerRNA *ptr, float *min, float *max) +{ + FModifier *fcm= (FModifier*)ptr->data; + FMod_Limits *data= fcm->data; + + *min= (data->flag & FCM_LIMIT_XMIN)? data->rect.xmin : MINAFRAMEF; + *max= MAXFRAMEF; +} + +static void rna_FModifierLimits_miny_range(PointerRNA *ptr, float *min, float *max) +{ + FModifier *fcm= (FModifier*)ptr->data; + FMod_Limits *data= fcm->data; + + *min= -FLT_MAX; + *max= (data->flag & FCM_LIMIT_YMAX)? data->rect.ymax : FLT_MAX; +} + +static void rna_FModifierLimits_maxy_range(PointerRNA *ptr, float *min, float *max) +{ + FModifier *fcm= (FModifier*)ptr->data; + FMod_Limits *data= fcm->data; + + *min= (data->flag & FCM_LIMIT_YMIN)? data->rect.ymin : -FLT_MAX; + *max= FLT_MAX; +} + + +static void rna_FModifierStepped_start_frame_range(PointerRNA *ptr, float *min, float *max) +{ + FModifier *fcm= (FModifier*)ptr->data; + FMod_Stepped *data= fcm->data; + + *min= MINAFRAMEF; + *max= (data->flag & FCM_STEPPED_NO_AFTER)? data->end_frame : MAXFRAMEF; +} + +static void rna_FModifierStepped_end_frame_range(PointerRNA *ptr, float *min, float *max) +{ + FModifier *fcm= (FModifier*)ptr->data; + FMod_Stepped *data= fcm->data; + + *min= (data->flag & FCM_STEPPED_NO_BEFORE)? data->start_frame : MINAFRAMEF; + *max= MAXFRAMEF; +} + #else static void rna_def_fmodifier_generator(BlenderRNA *brna) @@ -651,21 +706,25 @@ static void rna_def_fmodifier_limits(BlenderRNA *brna) prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.xmin"); + RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_minx_range"); RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.ymin"); + RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_miny_range"); RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.xmax"); + RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_maxx_range"); RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.ymax"); + RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_maxy_range"); RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } @@ -731,9 +790,29 @@ static void rna_def_fmodifier_stepped(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Step Size", "Number of frames to hold each value"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); - prop= RNA_def_property(srna, "start_offset", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "start"); - RNA_def_property_ui_text(prop, "Start Offset", "Reference number of frames before frames get held. Use to get hold for '1-3' vs '5-7' holding patterns"); + prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "offset"); + RNA_def_property_ui_text(prop, "Offset", "Reference number of frames before frames get held. Use to get hold for '1-3' vs '5-7' holding patterns"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + + prop= RNA_def_property(srna, "use_start_frame", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_STEPPED_NO_BEFORE); + RNA_def_property_ui_text(prop, "Use Start Frame", "Restrict modifier to only act after its 'start' frame"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + + prop= RNA_def_property(srna, "use_end_frame", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_STEPPED_NO_AFTER); + RNA_def_property_ui_text(prop, "Use End Frame", "Restrict modifier to only act before its 'end' frame"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + + prop= RNA_def_property(srna, "start_frame", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierStepped_start_frame_range"); + RNA_def_property_ui_text(prop, "Start Frame", "Frame that modifier's influence starts (if applicable)"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + + prop= RNA_def_property(srna, "end_frame", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierStepped_end_frame_range"); + RNA_def_property_ui_text(prop, "End Frame", "Frame that modifier's influence ends (if applicable)"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } From d50876f8d5f3d857779f53e559f724cb126d6bd3 Mon Sep 17 00:00:00 2001 From: Daniel Salazar Date: Fri, 19 Mar 2010 06:57:55 +0000 Subject: [PATCH 125/153] Adding Non Manifold to select menu in edit mode for vertex and/or edge select mode --- release/scripts/ui/space_view3d.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py index a2782bc879b..d8d91f41bf7 100644 --- a/release/scripts/ui/space_view3d.py +++ b/release/scripts/ui/space_view3d.py @@ -482,6 +482,8 @@ class VIEW3D_MT_select_edit_mesh(bpy.types.Menu): layout.operator("mesh.select_by_number_vertices", text="Triangles").type = 'TRIANGLES' layout.operator("mesh.select_by_number_vertices", text="Quads").type = 'QUADS' + if context.scene.tool_settings.mesh_selection_mode[2] == False: + layout.operator("mesh.select_non_manifold", text="Non Manifold") layout.operator("mesh.select_by_number_vertices", text="Loose Verts/Edges").type = 'OTHER' layout.operator("mesh.select_similar", text="Similar...") From 15bd165ca0effa4d0900499eec6f3058c2f18b18 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Sat, 20 Mar 2010 00:11:25 +0000 Subject: [PATCH 126/153] BGE: bindId property in VideoTexture.Texture (to get the openGL id of the texture) Now if you have a VideoTexture.Texture you can use its id and draw it with bgl The Id is only going to be valid if the obj you are getting the VideoTexture.Texture from has a valid texture. In the examples you will see them as planes, that become invisible at load time, but are needed to validate the texture id. This is a simple example file: http://blenderecia.orgfree.com/blender/bind_id_simple.blend And a (much) more advanced one: http://blenderecia.orgfree.com/blender/bind_id.blend (get also this image and save it to the same folder of your blend file - http://blenderecia.orgfree.com/blender/mask.png ) Benoit, I couldn't decide on better names so for now I'm glad with this one. --- source/gameengine/VideoTexture/Texture.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/gameengine/VideoTexture/Texture.cpp b/source/gameengine/VideoTexture/Texture.cpp index b8ed38c435d..f97ceb1fa67 100644 --- a/source/gameengine/VideoTexture/Texture.cpp +++ b/source/gameengine/VideoTexture/Texture.cpp @@ -357,6 +357,12 @@ PyObject * Texture_refresh (Texture * self, PyObject * args) Py_RETURN_NONE; } +// get OpenGL Bind Id +PyObject * Texture_getBindId (Texture * self, void * closure) +{ + unsigned int id = self->m_actTex; + return Py_BuildValue("h", id); +} // get mipmap value PyObject * Texture_getMipmap (Texture * self, void * closure) @@ -430,6 +436,7 @@ static PyGetSetDef textureGetSets[] = { {(char*)"source", (getter)Texture_getSource, (setter)Texture_setSource, (char*)"source of texture", NULL}, {(char*)"mipmap", (getter)Texture_getMipmap, (setter)Texture_setMipmap, (char*)"mipmap texture", NULL}, + {(char*)"bindId", (getter)Texture_getBindId, NULL, (char*)"OpenGL Bind Name", NULL}, {NULL} }; From 504745c39922b2a8da840789e30cf9ed58356e08 Mon Sep 17 00:00:00 2001 From: Daniel Salazar Date: Sat, 20 Mar 2010 05:14:22 +0000 Subject: [PATCH 127/153] Operator name improvements in select menu --- release/scripts/ui/space_view3d.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py index d8d91f41bf7..2e10470c5f7 100644 --- a/release/scripts/ui/space_view3d.py +++ b/release/scripts/ui/space_view3d.py @@ -471,8 +471,8 @@ class VIEW3D_MT_select_edit_mesh(bpy.types.Menu): layout.separator() - layout.operator("mesh.select_random", text="Random...") - layout.operator("mesh.select_nth", text="Select Nth...") + layout.operator("mesh.select_random", text="Random") + layout.operator("mesh.select_nth", text="Every N Number of Verts") layout.operator("mesh.edges_select_sharp", text="Sharp Edges") layout.operator("mesh.faces_select_linked_flat", text="Linked Flat Faces") layout.operator("mesh.faces_select_interior", text="Interior Faces") @@ -485,7 +485,7 @@ class VIEW3D_MT_select_edit_mesh(bpy.types.Menu): if context.scene.tool_settings.mesh_selection_mode[2] == False: layout.operator("mesh.select_non_manifold", text="Non Manifold") layout.operator("mesh.select_by_number_vertices", text="Loose Verts/Edges").type = 'OTHER' - layout.operator("mesh.select_similar", text="Similar...") + layout.operator("mesh.select_similar", text="Similar") layout.separator() From 3dde2e224ad1b31d918fcffbac5e66bd5ffb629a Mon Sep 17 00:00:00 2001 From: Damien Plisson Date: Sat, 20 Mar 2010 10:14:59 +0000 Subject: [PATCH 128/153] Cocoa: fix some mem leaks appearing on 10.4 builds --- intern/ghost/intern/GHOST_WindowCocoa.mm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 0b10a02849f..7520375c10e 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -593,6 +593,7 @@ void GHOST_WindowCocoa::getClientBounds(GHOST_Rect& bounds) const GHOST_TSuccess GHOST_WindowCocoa::setClientWidth(GHOST_TUns32 width) { GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setClientWidth(): window invalid") + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; GHOST_Rect cBnds, wBnds; getClientBounds(cBnds); if (((GHOST_TUns32)cBnds.getWidth()) != width) { @@ -601,6 +602,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setClientWidth(GHOST_TUns32 width) size.height=cBnds.getHeight(); [m_window setContentSize:size]; } + [pool drain]; return GHOST_kSuccess; } @@ -608,6 +610,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setClientWidth(GHOST_TUns32 width) GHOST_TSuccess GHOST_WindowCocoa::setClientHeight(GHOST_TUns32 height) { GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setClientHeight(): window invalid") + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; GHOST_Rect cBnds, wBnds; getClientBounds(cBnds); if (((GHOST_TUns32)cBnds.getHeight()) != height) { @@ -616,6 +619,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setClientHeight(GHOST_TUns32 height) size.height=height; [m_window setContentSize:size]; } + [pool drain]; return GHOST_kSuccess; } @@ -623,6 +627,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setClientHeight(GHOST_TUns32 height) GHOST_TSuccess GHOST_WindowCocoa::setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) { GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setClientSize(): window invalid") + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; GHOST_Rect cBnds, wBnds; getClientBounds(cBnds); if ((((GHOST_TUns32)cBnds.getWidth()) != width) || @@ -632,6 +637,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setClientSize(GHOST_TUns32 width, GHOST_TUns32 size.height=height; [m_window setContentSize:size]; } + [pool drain]; return GHOST_kSuccess; } @@ -1020,8 +1026,6 @@ void GHOST_WindowCocoa::loadCursor(bool visible, GHOST_TStandardCursor cursor) c { static bool systemCursorVisible = true; - NSAutoreleasePool *pool =[[NSAutoreleasePool alloc] init]; - NSCursor *tmpCursor =nil; if (visible != systemCursorVisible) { @@ -1085,17 +1089,19 @@ void GHOST_WindowCocoa::loadCursor(bool visible, GHOST_TStandardCursor cursor) c }; } [tmpCursor set]; - [pool drain]; } GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorVisibility(bool visible) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init]; + if ([m_window isVisible]) { loadCursor(visible, getCursorShape()); } + [pool drain]; return GHOST_kSuccess; } @@ -1146,6 +1152,8 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorGrab(GHOST_TGrabCursorMode mode GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorShape(GHOST_TStandardCursor shape) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + if (m_customCursor) { [m_customCursor release]; m_customCursor = nil; @@ -1155,6 +1163,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorShape(GHOST_TStandardCursor sha loadCursor(getCursorVisibility(), shape); } + [pool drain]; return GHOST_kSuccess; } From 1e2be7a8c6e32589be706da407f75cddf879c077 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sat, 20 Mar 2010 11:15:16 +0000 Subject: [PATCH 129/153] "Fix" aka implementation of [#21548] Audio doesn't work when adding scenes with audio to another scene. --- source/blender/blenkernel/BKE_sound.h | 2 ++ source/blender/blenkernel/intern/sequencer.c | 2 +- source/blender/blenkernel/intern/sound.c | 5 +++++ source/blender/blenloader/intern/readfile.c | 5 ++++- source/blender/editors/space_sequencer/sequencer_add.c | 2 ++ source/blender/editors/space_sequencer/sequencer_edit.c | 2 ++ 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index fa035d62d62..b89767d2586 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -72,6 +72,8 @@ void sound_create_scene(struct Scene *scene); void sound_destroy_scene(struct Scene *scene); +void* sound_scene_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip); + void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip); void sound_remove_scene_sound(struct Scene *scene, void* handle); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 42586ce18d7..424ca162bb4 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -3698,7 +3698,7 @@ static void seq_update_muting_recursive(Scene *scene, ListBase *seqbasep, Sequen seq_update_muting_recursive(scene, &seq->seqbase, metaseq, seqmute); } - else if(seq->type == SEQ_SOUND) { + else if((seq->type == SEQ_SOUND) || (seq->type == SEQ_SCENE)) { if(seq->scene_sound) { sound_mute_scene_sound(scene, seq->scene_sound, seqmute); } diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 9d189237ba0..2f0cb318ca0 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -349,6 +349,11 @@ void sound_destroy_scene(struct Scene *scene) AUD_destroySequencer(scene->sound_scene); } +void* sound_scene_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip) +{ + return AUD_addSequencer(scene->sound_scene, &(sequence->scene->sound_scene), startframe / FPS, endframe / FPS, frameskip / FPS, sequence); +} + void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip) { return AUD_addSequencer(scene->sound_scene, &(sequence->sound->playback_handle), startframe / FPS, endframe / FPS, frameskip / FPS, sequence); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index cc8686c89ba..747920e68ce 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4143,7 +4143,10 @@ static void lib_link_scene(FileData *fd, Main *main) SEQ_BEGIN(sce->ed, seq) { if(seq->ipo) seq->ipo= newlibadr_us(fd, sce->id.lib, seq->ipo); - if(seq->scene) seq->scene= newlibadr(fd, sce->id.lib, seq->scene); + if(seq->scene) { + seq->scene= newlibadr(fd, sce->id.lib, seq->scene); + seq->scene_sound = sound_scene_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs); + } if(seq->scene_camera) seq->scene_camera= newlibadr(fd, sce->id.lib, seq->scene_camera); if(seq->sound) { seq->scene_sound = NULL; diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index a138866956a..439fd6c13d1 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -215,6 +215,8 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) else strcpy(seq->name+2, sce_seq->id.name+2); + seq->scene_sound = sound_scene_add_scene_sound(scene, seq, start_frame, start_frame + strip->len, 0); + calc_sequence_disp(scene, seq); sort_seq(scene); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 1cc2a935a32..dfc78eedf2a 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -828,6 +828,8 @@ static Sequence *dupli_seq(struct Scene *scene, Sequence *seq) /* - recurs_dupli_seq(&seq->seqbase,&seqn->seqbase);*/ } else if(seq->type == SEQ_SCENE) { seqn->strip->stripdata = 0; + if(seq->scene_sound) + seqn->scene_sound = sound_scene_add_scene_sound(scene, seqn, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs); } else if(seq->type == SEQ_MOVIE) { seqn->strip->stripdata = MEM_dupallocN(seq->strip->stripdata); From ca3736c123aff2bb01f3231687a807952cdca4af Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sat, 20 Mar 2010 11:50:27 +0000 Subject: [PATCH 130/153] Fix for [#21639] Playback with AV-sync and None sound system. --- intern/audaspace/intern/AUD_NULLDevice.cpp | 4 +++- source/blender/editors/screen/screen_ops.c | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/intern/audaspace/intern/AUD_NULLDevice.cpp b/intern/audaspace/intern/AUD_NULLDevice.cpp index 3936695c28f..83d908afa43 100644 --- a/intern/audaspace/intern/AUD_NULLDevice.cpp +++ b/intern/audaspace/intern/AUD_NULLDevice.cpp @@ -23,6 +23,8 @@ * ***** END LGPL LICENSE BLOCK ***** */ +#include + #include "AUD_NULLDevice.h" #include "AUD_IReader.h" #include "AUD_IFactory.h" @@ -76,7 +78,7 @@ bool AUD_NULLDevice::seek(AUD_Handle* handle, float position) float AUD_NULLDevice::getPosition(AUD_Handle* handle) { - return 0.0f; + return NAN; } AUD_Status AUD_NULLDevice::getStatus(AUD_Handle* handle) diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index ff6e63f911b..969b88efc35 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2401,16 +2401,18 @@ static int screen_animation_step(bContext *C, wmOperator *op, wmEvent *event) ScreenAnimData *sad= wt->customdata; ScrArea *sa; int sync; - + float time = NAN; + /* sync, don't sync, or follow scene setting */ if(sad->flag & ANIMPLAY_FLAG_SYNC) sync= 1; else if(sad->flag & ANIMPLAY_FLAG_NO_SYNC) sync= 0; else sync= (scene->flag & SCE_FRAME_DROP); if((scene->audio.flag & AUDIO_SYNC) && !(sad->flag & ANIMPLAY_FLAG_REVERSE)) - { - scene->r.cfra = floor(sound_sync_scene(scene) * FPS); - } + time = sound_sync_scene(scene); + + if(isfinite(time)) + scene->r.cfra = floor(time * FPS); else { if(sync) { From 08164794b2dad21e2ffaf2fa61d60fa77d86d2c8 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Sat, 20 Mar 2010 14:23:56 +0000 Subject: [PATCH 131/153] Fix [#21658] file browser "hide invisible" doesn't hide anything - moved global hide_dot to filelist. - hiding dot files is now included in the filtering of files, which means that for this directory also doesn't have to be read anymore. - reverted changes of rev. 27491 and related changes in rev. 27523 in favor of a more general abstraction for the different 'file browser modes' with respect to filtering. --- source/blender/blenlib/BLI_storage.h | 2 +- source/blender/blenlib/intern/storage.c | 25 +--- source/blender/editors/space_file/filelist.c | 113 ++++++++++++------- source/blender/editors/space_file/filesel.c | 15 +-- source/blender/makesdna/DNA_space_types.h | 5 +- source/blender/makesrna/intern/rna_space.c | 12 +- 6 files changed, 84 insertions(+), 88 deletions(-) diff --git a/source/blender/blenlib/BLI_storage.h b/source/blender/blenlib/BLI_storage.h index 7791c596229..61f175cb772 100644 --- a/source/blender/blenlib/BLI_storage.h +++ b/source/blender/blenlib/BLI_storage.h @@ -50,7 +50,7 @@ int BLI_filesize(int file); int BLI_filepathsize(const char *path); double BLI_diskfree(char *dir); char *BLI_getwdN(char *dir); -void BLI_hide_dot_files(int set); + unsigned int BLI_getdir(char *dirname, struct direntry **filelist); /** * @attention Do not confuse with BLI_exists diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index f21e5ef5575..139bb551926 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -204,14 +204,6 @@ double BLI_diskfree(char *dir) #endif } -static int hide_dot= 0; - -void BLI_hide_dot_files(int set) -{ - if(set) hide_dot= 1; - else hide_dot= 0; -} - void BLI_builddir(char *dirname, char *relname) { struct dirent *fname; @@ -237,17 +229,12 @@ void BLI_builddir(char *dirname, char *relname) while ((fname = (struct dirent*) readdir(dir)) != NULL) { len= strlen(fname->d_name); - if(hide_dot && fname->d_name[0]=='.' && fname->d_name[1]!='.' && fname->d_name[1]!=0); /* ignore .file */ - else if(hide_dot && len && fname->d_name[len-1]=='~'); /* ignore file~ */ - else if (((fname->d_name[0] == '.') && (fname->d_name[1] == 0) )); /* ignore . */ - else { - dlink = (struct dirlink *)malloc(sizeof(struct dirlink)); - if (dlink){ - strcpy(buf+rellen,fname->d_name); - dlink->name = BLI_strdup(buf); - BLI_addhead(dirbase,dlink); - newnum++; - } + dlink = (struct dirlink *)malloc(sizeof(struct dirlink)); + if (dlink){ + strcpy(buf+rellen,fname->d_name); + dlink->name = BLI_strdup(buf); + BLI_addhead(dirbase,dlink); + newnum++; } } diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index c11260d7179..226cd50669a 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -135,7 +135,8 @@ typedef struct FileList struct BlendHandle *libfiledata; short hide_parent; - void (*read)(struct FileList *); + void (*readf)(struct FileList *); + int (*filterf)(struct FileList *, struct direntry* file, unsigned int filter, short hide_dot); } FileList; @@ -292,63 +293,91 @@ static int compare_extension(const void *a1, const void *a2) { return (BLI_strcasecmp(sufix1, sufix2)); } +static int is_hidden_file(const char* filename, short hide_dot) +{ + int is_hidden=0; + + if (hide_dot) { + if(filename[0]=='.' && filename[1]!='.' && filename[1]!=0) { + is_hidden=1; /* ignore .file */ + } else if (((filename[0] == '.') && (filename[1] == 0) )) { + is_hidden=1; /* ignore . */ + } else { + int len=strlen(filename); + if( (len>0) && (filename[len-1]=='~') ) { + is_hidden=1; /* ignore file~ */ + } + } + } else { + if (((filename[0] == '.') && (filename[1] == 0) )) { + is_hidden=1; /* ignore . */ + } + } + return is_hidden; +} + +static int is_filtered_file(struct direntry* file, const char* dir, unsigned int filter, short hide_dot) +{ + int is_filtered=0; + if (filter) { + if (file->flags & filter) { + is_filtered=1; + } else if (file->type & S_IFDIR) { + if (filter & FOLDERFILE) { + is_filtered = 1; + } + } + } else { + is_filtered = 1; + } + return is_filtered && !is_hidden_file(file->relname, hide_dot); +} + +static int is_filtered_lib(struct direntry* file, const char* dir, unsigned int filter, short hide_dot) +{ + int is_filtered=0; + char tdir[FILE_MAX], tgroup[GROUP_MAX]; + if (BLO_is_a_library(dir, tdir, tgroup)) { + is_filtered = !is_hidden_file(file->relname, hide_dot); + } else { + is_filtered = is_filtered_file(file, dir, filter, hide_dot); + } + return is_filtered; +} + +static int is_filtered_main(struct direntry* file, const char* dir, unsigned int filter, short hide_dot) +{ + return !is_hidden_file(file->relname, hide_dot); +} + void filelist_filter(FileList* filelist) { - /* char dir[FILE_MAX], group[GROUP_MAX]; XXXXX */ int num_filtered = 0; int i, j; if (!filelist->filelist) return; - - /* XXXXX TODO: check if the filter can be handled outside the filelist - if ( ( (filelist->type == FILE_LOADLIB) && BIF_filelist_islibrary(filelist, dir, group)) - || (filelist->type == FILE_MAIN) ) { - filelist->filter = 0; - } - */ - - if (!filelist->filter) { - if (filelist->fidx) { - MEM_freeN(filelist->fidx); - filelist->fidx = NULL; - } - filelist->fidx = (int *)MEM_callocN(filelist->numfiles*sizeof(int), "filteridx"); - for (i = 0; i < filelist->numfiles; ++i) { - filelist->fidx[i] = i; - } - filelist->numfiltered = filelist->numfiles; - return; - } // How many files are left after filter ? for (i = 0; i < filelist->numfiles; ++i) { - if (filelist->filelist[i].flags & filelist->filter) { + struct direntry *file = &filelist->filelist[i]; + if ( filelist->filterf(file, filelist->dir, filelist->filter, filelist->hide_dot) ) { num_filtered++; } - else if (filelist->filelist[i].type & S_IFDIR) { - if (filelist->filter & FOLDERFILE) { - num_filtered++; - } - } } if (filelist->fidx) { - MEM_freeN(filelist->fidx); - filelist->fidx = NULL; + MEM_freeN(filelist->fidx); + filelist->fidx = NULL; } filelist->fidx = (int *)MEM_callocN(num_filtered*sizeof(int), "filteridx"); filelist->numfiltered = num_filtered; for (i = 0, j=0; i < filelist->numfiles; ++i) { - if (filelist->filelist[i].flags & filelist->filter) { + struct direntry *file = &filelist->filelist[i]; + if ( filelist->filterf(file, filelist->dir, filelist->filter, filelist->hide_dot) ) { filelist->fidx[j++] = i; } - else if (filelist->filelist[i].type & S_IFDIR) { - if (filelist->filter & FOLDERFILE) { - filelist->fidx[j++] = i; - } - } } } @@ -491,13 +520,16 @@ struct FileList* filelist_new(short type) FileList* p = MEM_callocN( sizeof(FileList), "filelist" ); switch(type) { case FILE_MAIN: - p->read = filelist_read_main; + p->readf = filelist_read_main; + p->filterf = is_filtered_main; break; case FILE_LOADLIB: - p->read = filelist_read_library; + p->readf = filelist_read_library; + p->filterf = is_filtered_lib; break; default: - p->read = filelist_read_dir; + p->readf = filelist_read_dir; + p->filterf = is_filtered_file; } return p; @@ -716,7 +748,6 @@ static void filelist_read_dir(struct FileList* filelist) BLI_getwdN(wdir); BLI_cleanup_dir(G.sce, filelist->dir); - BLI_hide_dot_files(filelist->hide_dot); filelist->numfiles = BLI_getdir(filelist->dir, &(filelist->filelist)); if(!chdir(wdir)) /* fix warning about not checking return value */; @@ -761,7 +792,7 @@ static void filelist_read_library(struct FileList* filelist) void filelist_readdir(struct FileList* filelist) { - filelist->read(filelist); + filelist->readf(filelist); } int filelist_empty(struct FileList* filelist) diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index da8dc4b654c..cce821f3f21 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -194,7 +194,6 @@ short ED_fileselect_set_params(SpaceFile *sfile) params->filter = 0; params->sort = FILE_SORT_ALPHA; } - params->oldflag = params->flag; return 1; } @@ -411,19 +410,7 @@ void file_change_dir(bContext *C, int checkdir) /* could return but just refresh the current dir */ } filelist_setdir(sfile->files, sfile->params->dir); - /* XXX special case handling - behaviour of filebrowser changes when - browsing into .blend file */ - if (sfile->params->type == FILE_LOADLIB) { - char group[GROUP_MAX]; - char dir[FILE_MAX]; - if (filelist_islibrary(sfile->files, dir, group)) { - sfile->params->flag &= ~FILE_FILTER; - } else { - /* reset the old flag */ - sfile->params->flag = sfile->params->oldflag; - } - } + if(folderlist_clear_next(sfile)) folderlist_free(sfile->folders_next); diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 8e460b80585..0ea64765198 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -162,21 +162,20 @@ typedef struct FileSelectParams { short type; /* XXXXX for now store type here, should be moved to the operator */ short flag; /* settings for filter, hiding dots files,... */ - short oldflag; /* temp storage of original flag settings */ short sort; /* sort order */ short display; /* display mode flag */ short filter; /* filter when (flags & FILE_FILTER) is true */ /* XXX - temporary, better move to filelist */ short active_bookmark; - short pad; + int active_file; int selstate; /* short */ /* XXX --- still unused -- */ short f_fp; /* show font preview */ - short pad2; + short pad; char fp_str[8]; /* string to use for font preview */ /* XXX --- end unused -- */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 37496f08dce..2c9bc945618 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -597,14 +597,6 @@ static void rna_Sequencer_display_mode_update(bContext *C, PointerRNA *ptr) ED_sequencer_update_view(C, view); } -static void rna_FileSelectParams_flag_update(Main *bmain, Scene *scene, PointerRNA *ptr) -{ - FileSelectParams* params = (FileSelectParams*)ptr->data; - if (params) { - params->oldflag = params->flag; - } -} - #else static void rna_def_space(BlenderRNA *brna) @@ -1880,12 +1872,12 @@ static void rna_def_fileselect_params(BlenderRNA *brna) prop= RNA_def_property(srna, "do_filter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER); RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, "rna_FileSelectParams_flag_update"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); prop= RNA_def_property(srna, "hide_dot", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_HIDE_DOT); RNA_def_property_ui_text(prop, "Hide Dot Files", "Hide hidden dot files"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST , "rna_FileSelectParams_flag_update"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS , NULL); prop= RNA_def_property(srna, "sort", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "sort"); From 7178f10b81006082937de8fa8be90076f478da64 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sat, 20 Mar 2010 16:28:51 +0000 Subject: [PATCH 132/153] Replacing NAN with C++ limits version, hope that works for MSVC... --- intern/audaspace/intern/AUD_NULLDevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intern/audaspace/intern/AUD_NULLDevice.cpp b/intern/audaspace/intern/AUD_NULLDevice.cpp index 83d908afa43..c9dfadd1839 100644 --- a/intern/audaspace/intern/AUD_NULLDevice.cpp +++ b/intern/audaspace/intern/AUD_NULLDevice.cpp @@ -23,7 +23,7 @@ * ***** END LGPL LICENSE BLOCK ***** */ -#include +#include #include "AUD_NULLDevice.h" #include "AUD_IReader.h" @@ -78,7 +78,7 @@ bool AUD_NULLDevice::seek(AUD_Handle* handle, float position) float AUD_NULLDevice::getPosition(AUD_Handle* handle) { - return NAN; + return std::numeric_limits::quiet_NaN(); } AUD_Status AUD_NULLDevice::getStatus(AUD_Handle* handle) From 391cc2d004c5fc231ac546d89f64ae4ba5c062c0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 20 Mar 2010 16:41:01 +0000 Subject: [PATCH 133/153] merge own commits into render branch into trunk since 27560 27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623 --- CMakeLists.txt | 3 +- release/scripts/io/import_scene_obj.py | 2 +- release/scripts/op/image.py | 79 +++-- release/scripts/ui/properties_data_curve.py | 4 +- release/scripts/ui/space_image.py | 2 + release/scripts/ui/space_userpref.py | 39 +-- source/blender/blenkernel/BKE_curve.h | 11 +- source/blender/blenkernel/intern/anim_sys.c | 26 +- source/blender/blenkernel/intern/curve.c | 102 +++++-- source/blender/blenkernel/intern/displist.c | 18 +- source/blender/blenkernel/intern/font.c | 2 +- source/blender/blenkernel/intern/mesh.c | 2 +- source/blender/blenlib/BLI_listbase.h | 1 + source/blender/blenlib/intern/freetypefont.c | 2 +- source/blender/blenlib/intern/listbase.c | 11 + .../blender/editors/armature/editarmature.c | 2 +- source/blender/editors/curve/editcurve.c | 70 ++--- source/blender/editors/gpencil/gpencil_edit.c | 2 +- source/blender/editors/include/ED_object.h | 1 - .../editors/interface/interface_regions.c | 9 + source/blender/editors/object/object_add.c | 2 +- source/blender/editors/object/object_edit.c | 28 -- .../blender/editors/object/object_relations.c | 6 +- .../blender/editors/object/object_transform.c | 2 +- .../blender/editors/render/render_shading.c | 1 + .../blender/editors/space_nla/nla_buttons.c | 11 +- .../blender/editors/space_view3d/drawobject.c | 2 +- .../editors/space_view3d/view3d_draw.c | 8 +- .../editors/space_view3d/view3d_edit.c | 5 +- .../editors/space_view3d/view3d_view.c | 4 +- source/blender/makesdna/DNA_anim_types.h | 1 + source/blender/makesdna/DNA_curve_types.h | 4 +- source/blender/makesrna/RNA_types.h | 1 + source/blender/makesrna/intern/rna_curve.c | 269 +++++++++++++++--- source/blender/makesrna/intern/rna_main_api.c | 65 ++++- source/blender/makesrna/intern/rna_nla.c | 5 + source/blender/makesrna/intern/rna_object.c | 2 +- source/blender/makesrna/intern/rna_scene.c | 10 +- source/blender/python/doc/sphinx_doc_gen.py | 2 + source/blender/python/doc/sphinx_doc_gen.sh | 25 ++ source/blender/python/generic/IDProp.c | 4 +- source/blender/python/intern/bpy_rna.c | 11 +- .../bad_level_call_stubs/stubs.c | 1 - source/creator/creator.c | 2 + 44 files changed, 619 insertions(+), 240 deletions(-) create mode 100644 source/blender/python/doc/sphinx_doc_gen.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 279f4d65947..8b690cdd81a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,11 +181,12 @@ IF(UNIX AND NOT APPLE) ENDIF(NOT SDL_FOUND) ENDIF(WITH_SDL) + SET(OPENEXR /usr CACHE FILEPATH "OPENEXR Directory") FIND_PATH(OPENEXR_INC ImfXdr.h PATHS + ${OPENEXR}/include/OpenEXR /usr/local/include/OpenEXR - /usr/include/OpenEXR /sw/include/OpenEXR /opt/local/include/OpenEXR /opt/csw/include/OpenEXR diff --git a/release/scripts/io/import_scene_obj.py b/release/scripts/io/import_scene_obj.py index 25919c5d6aa..e12d0c8eaac 100644 --- a/release/scripts/io/import_scene_obj.py +++ b/release/scripts/io/import_scene_obj.py @@ -316,7 +316,7 @@ def line_value(line_split): def load_image(imagepath, dirname): if os.path.exists(imagepath): - return bpy.data.add_image(imagepath) + return bpy.data.images.load(imagepath) variants = [os.path.join(dirname, imagepath), os.path.join(dirname, os.path.basename(imagepath))] diff --git a/release/scripts/op/image.py b/release/scripts/op/image.py index 02d8fcc3219..e0e75a1f17a 100644 --- a/release/scripts/op/image.py +++ b/release/scripts/op/image.py @@ -19,30 +19,63 @@ # import bpy +from bpy.props import StringProperty +class EditExternally(bpy.types.Operator): + '''Edit image in an external application''' + bl_idname = "image.external_edit" + bl_label = "Image Edit Externally" + bl_options = {'REGISTER'} -def image_editor_guess(context): - import platform - system = platform.system() - - image_editor = context.user_preferences.filepaths.image_editor + path = StringProperty(name="File Path", description="Path to an image file", maxlen= 1024, default= "") - # use image editor in the preferences when available. - if not image_editor: - if system == 'Windows': - image_editor = ["start"] # not tested! - elif system == 'Darwin': - image_editor = ["open"] + def _editor_guess(self, context): + import platform + system = platform.system() + + image_editor = context.user_preferences.filepaths.image_editor + + # use image editor in the preferences when available. + if not image_editor: + if system == 'Windows': + image_editor = ["start"] # not tested! + elif system == 'Darwin': + image_editor = ["open"] + else: + image_editor = ["gimp"] else: - image_editor = ["gimp"] - else: - if system == 'Darwin': - # blender file selector treats .app as a folder - # and will include a trailing backslash, so we strip it. - image_editor.rstrip('\\') - image_editor = ["open", "-a", image_editor] + if system == 'Darwin': + # blender file selector treats .app as a folder + # and will include a trailing backslash, so we strip it. + image_editor.rstrip('\\') + image_editor = ["open", "-a", image_editor] - return image_editor + return image_editor + + def execute(self, context): + import subprocess + path = self.properties.path + image_editor = self._editor_guess(context) + + cmd = [] + cmd.extend(image_editor) + cmd.append(bpy.utils.expandpath(path)) + + subprocess.Popen(cmd) + + return {'FINISHED'} + + def invoke(self, context, event): + try: + path = context.space_data.image.filename + except: + self.report({'ERROR'}, "Image not found on disk") + return {'CANCELLED'} + + self.properties.path = path + self.execute(context) + + return {'FINISHED'} class SaveDirty(bpy.types.Operator): @@ -79,7 +112,6 @@ class ProjectEdit(bpy.types.Operator): import subprocess EXT = "png" # could be made an option but for now ok - image_editor = image_editor_guess(context) for image in bpy.data.images: image.tag = True @@ -124,11 +156,7 @@ class ProjectEdit(bpy.types.Operator): image_new.file_format = 'PNG' image_new.save() - cmd = [] - cmd.extend(image_editor) - cmd.append(bpy.utils.expandpath(filename_final)) - - subprocess.Popen(cmd) + bpy.ops.image.external_edit(path=filename_final) return {'FINISHED'} @@ -155,6 +183,7 @@ class ProjectApply(bpy.types.Operator): classes = [ + EditExternally, SaveDirty, ProjectEdit, ProjectApply] diff --git a/release/scripts/ui/properties_data_curve.py b/release/scripts/ui/properties_data_curve.py index ff78791fa0b..8e381986f23 100644 --- a/release/scripts/ui/properties_data_curve.py +++ b/release/scripts/ui/properties_data_curve.py @@ -44,7 +44,7 @@ class DataButtonsPanelActive(DataButtonsPanel): def poll(self, context): curve = context.curve - return (curve and curve.active_spline) + return (curve and curve.splines.active) class DATA_PT_context_curve(DataButtonsPanel): @@ -205,7 +205,7 @@ class DATA_PT_active_spline(DataButtonsPanelActive): ob = context.object curve = context.curve - act_spline = curve.active_spline + act_spline = curve.splines.active is_surf = (ob.type == 'SURFACE') is_poly = (act_spline.type == 'POLY') diff --git a/release/scripts/ui/space_image.py b/release/scripts/ui/space_image.py index 3fd7025a4f7..1e37cb16f81 100644 --- a/release/scripts/ui/space_image.py +++ b/release/scripts/ui/space_image.py @@ -115,6 +115,8 @@ class IMAGE_MT_image(bpy.types.Menu): if ima.source == 'SEQUENCE': layout.operator("image.save_sequence") + layout.operator("image.external_edit", "Edit Externally") + if not show_render: layout.separator() diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 64b79614a6f..9f86c27ca25 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -1413,8 +1413,7 @@ class USERPREF_PT_addons(bpy.types.Panel): addons = [(mod, addon_info_get(mod)) for mod in self._addon_list()] cats = {info["category"] for mod, info in addons} - cats.add("") - cats.remove("") + cats.discard("") cats = ['All', 'Disabled', 'Enabled'] + sorted(cats) @@ -1489,6 +1488,24 @@ class USERPREF_PT_addons(bpy.types.Panel): split.separator() split.separator() + # Append missing scripts + # First collect scripts that are used but have no script file. + module_names = {mod.__name__ for mod, info in addons} + missing_modules = {ext for ext in used_ext if ext not in module_names} + + if missing_modules and filter in ("All", "Enabled"): + layout.column().separator() + layout.column().label(text="Missing script files") + + module_names = {mod.__name__ for mod, info in addons} + for ext in sorted(missing_modules): + # Addon UI Code + box = layout.column().box() + column = box.column() + row = column.row() + + row.label(text=ext, icon="ERROR") + row.operator("wm.addon_disable").module = ext from bpy.props import * @@ -1537,21 +1554,8 @@ class WM_OT_addon_enable(bpy.types.Operator): # check if add-on is written for current blender version, or raise a warning info = addon_info_get(mod) - if info["blender"]: - version = info["blender"].split(".", 2) - for i in range(len(version)): - try: - version[i] = int(version[i]) - except: - break - - if version[i] > bpy.app.version[i]: - self.report("WARNING','This script was written for a newer version of Blender \ -and might not function (correctly).\nThe script is enabled though.") - elif version[i] == bpy.app.version[i]: - continue - else: - break + if info.get("blender", (0, 0, 0)) > bpy.app.version: + self.report("WARNING','This script was written for a newer version of Blender and might not function (correctly).\nThe script is enabled though.") return {'FINISHED'} @@ -1668,7 +1672,6 @@ class WM_OT_addon_expand(bpy.types.Operator): info = addon_info_get(mod) info["expanded"] = not info["expanded"] - print(info["expanded"]) return {'FINISHED'} diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h index 5fb44c52307..7119a725630 100644 --- a/source/blender/blenkernel/BKE_curve.h +++ b/source/blender/blenkernel/BKE_curve.h @@ -40,12 +40,12 @@ struct ListBase; struct BezTriple; struct BevList; -#define KNOTSU(nu) ( (nu)->orderu+ (nu)->pntsu+ (((nu)->flagu & CU_CYCLIC) ? (nu->orderu-1) : 0) ) -#define KNOTSV(nu) ( (nu)->orderv+ (nu)->pntsv+ (((nu)->flagv & CU_CYCLIC) ? (nu->orderv-1) : 0) ) +#define KNOTSU(nu) ( (nu)->orderu+ (nu)->pntsu+ (((nu)->flagu & CU_NURB_CYCLIC) ? (nu->orderu-1) : 0) ) +#define KNOTSV(nu) ( (nu)->orderv+ (nu)->pntsv+ (((nu)->flagv & CU_NURB_CYCLIC) ? (nu->orderv-1) : 0) ) /* Non cyclic nurbs have 1 less segment */ -#define SEGMENTSU(nu) ( ((nu)->flagu & CU_CYCLIC) ? (nu)->pntsu : (nu)->pntsu-1 ) -#define SEGMENTSV(nu) ( ((nu)->flagv & CU_CYCLIC) ? (nu)->pntsv : (nu)->pntsv-1 ) +#define SEGMENTSU(nu) ( ((nu)->flagu & CU_NURB_CYCLIC) ? (nu)->pntsu : (nu)->pntsu-1 ) +#define SEGMENTSV(nu) ( ((nu)->flagv & CU_NURB_CYCLIC) ? (nu)->pntsv : (nu)->pntsv-1 ) #define CU_DO_TILT(cu, nu) (((nu->flag & CU_2D) && (cu->flag & CU_3D)==0) ? 0 : 1) #define CU_DO_RADIUS(cu, nu) ((CU_DO_TILT(cu, nu) || cu->bevobj || cu->ext1!=0.0 || cu->ext2!=0.0) ? 1:0) @@ -89,6 +89,9 @@ void sethandlesNurb(ListBase *editnurb, short code); void switchdirectionNurb( struct Nurb *nu); +void addNurbPoints(struct Nurb *nu, int number); +void addNurbPointsBezier(struct Nurb *nu, int number); + float (*curve_getVertexCos(struct Curve *cu, struct ListBase *lb, int *numVerts_r))[3]; void curve_applyVertexCos(struct Curve *cu, struct ListBase *lb, float (*vertexCos)[3]); diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 31743a6bd1a..1e9103fb951 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -771,6 +771,8 @@ static short animsys_remap_path (AnimMapper *remap, char *path, char **dst) /* Write the given value to a setting using RNA, and return success */ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_index, float value) { + // printf("%p %s %i %f\n", ptr, path, array_index, value); + PropertyRNA *prop; PointerRNA new_ptr; @@ -780,22 +782,35 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i /* set value - only for animatable numerical values */ if (RNA_property_animateable(&new_ptr, prop)) { + int array_len= RNA_property_array_length(&new_ptr, prop); + + if(array_len && array_index >= array_len) + { + if (G.f & G_DEBUG) { + printf("Animato: Invalid array index. ID = '%s', '%s[%d]', array length is %d \n", + (ptr && ptr->id.data) ? (((ID *)ptr->id.data)->name+2) : "", + path, array_index, array_len-1); + } + + return 0; + } + switch (RNA_property_type(prop)) { case PROP_BOOLEAN: - if (RNA_property_array_length(&new_ptr, prop)) + if (array_len) RNA_property_boolean_set_index(&new_ptr, prop, array_index, (int)value); else RNA_property_boolean_set(&new_ptr, prop, (int)value); break; case PROP_INT: - if (RNA_property_array_length(&new_ptr, prop)) + if (array_len) RNA_property_int_set_index(&new_ptr, prop, array_index, (int)value); else RNA_property_int_set(&new_ptr, prop, (int)value); break; case PROP_FLOAT: - if (RNA_property_array_length(&new_ptr, prop)) + if (array_len) RNA_property_float_set_index(&new_ptr, prop, array_index, value); else RNA_property_float_set(&new_ptr, prop, value); @@ -817,7 +832,7 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i // XXX don't tag as failed yet though, as there are some legit situations (Action Constraint) // where some channels will not exist, but shouldn't lock up Action if (G.f & G_DEBUG) { - printf("Animato: Invalid path. ID = '%s', '%s [%d]' \n", + printf("Animato: Invalid path. ID = '%s', '%s[%d]' \n", (ptr && ptr->id.data) ? (((ID *)ptr->id.data)->name+2) : "", path, array_index); } @@ -989,6 +1004,9 @@ static void nlastrip_evaluate_controls (NlaStrip *strip, float ctime) /* execute these settings as per normal */ animsys_evaluate_fcurves(&strip_ptr, &strip->fcurves, NULL, ctime); } + + if (strip->flag & NLASTRIP_FLAG_USR_TIME && strip->flag & NLASTRIP_FLAG_USR_TIME_CYCLIC) + strip->strip_time= fmod(strip->strip_time - strip->actstart, strip->actend - strip->actstart); } /* gets the strip active at the current time for a list of strips for evaluation purposes */ diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 2430e417e51..b476ebf4994 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -519,7 +519,47 @@ void minmaxNurb(Nurb *nu, float *min, float *max) bp++; } } +} +/* be sure to call makeknots after this */ +void addNurbPoints(Nurb *nu, int number) +{ + BPoint *tmp= nu->bp; + int i; + nu->bp= (BPoint *)MEM_mallocN((nu->pntsu + number) * sizeof(BPoint), "rna_Curve_spline_points_add"); + + if(tmp) { + memmove(nu->bp, tmp, nu->pntsu * sizeof(BPoint)); + MEM_freeN(tmp); + } + + memset(nu->bp + nu->pntsu, 0, number * sizeof(BPoint)); + + for(i=0, tmp= nu->bp + nu->pntsu; i < number; i++, tmp++) { + tmp->radius= 1.0f; + } + + nu->pntsu += number; +} + +void addNurbPointsBezier(Nurb *nu, int number) +{ + BezTriple *tmp= nu->bezt; + int i; + nu->bezt= (BezTriple *)MEM_mallocN((nu->pntsu + number) * sizeof(BezTriple), "rna_Curve_spline_points_add"); + + if(tmp) { + memmove(nu->bezt, tmp, nu->pntsu * sizeof(BezTriple)); + MEM_freeN(tmp); + } + + memset(nu->bezt + nu->pntsu, 0, number * sizeof(BezTriple)); + + for(i=0, tmp= nu->bezt + nu->pntsu; i < number; i++, tmp++) { + tmp->radius= 1.0f; + } + + nu->pntsu += number; } /* ~~~~~~~~~~~~~~~~~~~~Non Uniform Rational B Spline calculations ~~~~~~~~~~~ */ @@ -603,7 +643,7 @@ void makeknots(Nurb *nu, short uv) if(nu->knotsu) MEM_freeN(nu->knotsu); if(check_valid_nurb_u(nu)) { nu->knotsu= MEM_callocN(4+sizeof(float)*KNOTSU(nu), "makeknots"); - if(nu->flagu & CU_CYCLIC) { + if(nu->flagu & CU_NURB_CYCLIC) { calcknots(nu->knotsu, nu->pntsu, nu->orderu, 0); /* cyclic should be uniform */ makecyclicknots(nu->knotsu, nu->pntsu, nu->orderu); } else { @@ -616,7 +656,7 @@ void makeknots(Nurb *nu, short uv) if(nu->knotsv) MEM_freeN(nu->knotsv); if(check_valid_nurb_v(nu)) { nu->knotsv= MEM_callocN(4+sizeof(float)*KNOTSV(nu), "makeknots"); - if(nu->flagv & CU_CYCLIC) { + if(nu->flagv & CU_NURB_CYCLIC) { calcknots(nu->knotsv, nu->pntsv, nu->orderv, 0); /* cyclic should be uniform */ makecyclicknots(nu->knotsv, nu->pntsv, nu->orderv); } else { @@ -734,18 +774,18 @@ void makeNurbfaces(Nurb *nu, float *coord_array, int rowstride) fp= nu->knotsu; ustart= fp[nu->orderu-1]; - if(nu->flagu & CU_CYCLIC) uend= fp[nu->pntsu+nu->orderu-1]; + if(nu->flagu & CU_NURB_CYCLIC) uend= fp[nu->pntsu+nu->orderu-1]; else uend= fp[nu->pntsu]; - ustep= (uend-ustart)/((nu->flagu & CU_CYCLIC) ? totu : totu - 1); + ustep= (uend-ustart)/((nu->flagu & CU_NURB_CYCLIC) ? totu : totu - 1); basisu= (float *)MEM_mallocN(sizeof(float)*KNOTSU(nu), "makeNurbfaces3"); fp= nu->knotsv; vstart= fp[nu->orderv-1]; - if(nu->flagv & CU_CYCLIC) vend= fp[nu->pntsv+nu->orderv-1]; + if(nu->flagv & CU_NURB_CYCLIC) vend= fp[nu->pntsv+nu->orderv-1]; else vend= fp[nu->pntsv]; - vstep= (vend-vstart)/((nu->flagv & CU_CYCLIC) ? totv : totv - 1); + vstep= (vend-vstart)/((nu->flagv & CU_NURB_CYCLIC) ? totv : totv - 1); len= KNOTSV(nu); basisv= (float *)MEM_mallocN(sizeof(float)*len*totv, "makeNurbfaces3"); @@ -753,7 +793,7 @@ void makeNurbfaces(Nurb *nu, float *coord_array, int rowstride) jend= (int *)MEM_mallocN(sizeof(float)*totv, "makeNurbfaces5"); /* precalculation of basisv and jstart,jend */ - if(nu->flagv & CU_CYCLIC) cycl= nu->orderv-1; + if(nu->flagv & CU_NURB_CYCLIC) cycl= nu->orderv-1; else cycl= 0; v= vstart; basis= basisv; @@ -764,7 +804,7 @@ void makeNurbfaces(Nurb *nu, float *coord_array, int rowstride) v+= vstep; } - if(nu->flagu & CU_CYCLIC) cycl= nu->orderu-1; + if(nu->flagu & CU_NURB_CYCLIC) cycl= nu->orderu-1; else cycl= 0; in= coord_array; u= ustart; @@ -882,13 +922,13 @@ void makeNurbcurve(Nurb *nu, float *coord_array, float *tilt_array, float *radiu fp= nu->knotsu; ustart= fp[nu->orderu-1]; - if(nu->flagu & CU_CYCLIC) uend= fp[nu->pntsu+nu->orderu-1]; + if(nu->flagu & CU_NURB_CYCLIC) uend= fp[nu->pntsu+nu->orderu-1]; else uend= fp[nu->pntsu]; - ustep= (uend-ustart)/(resolu - ((nu->flagu & CU_CYCLIC) ? 0 : 1)); + ustep= (uend-ustart)/(resolu - ((nu->flagu & CU_NURB_CYCLIC) ? 0 : 1)); basisu= (float *)MEM_mallocN(sizeof(float)*KNOTSU(nu), "makeNurbcurve3"); - if(nu->flagu & CU_CYCLIC) cycl= nu->orderu-1; + if(nu->flagu & CU_NURB_CYCLIC) cycl= nu->orderu-1; else cycl= 0; u= ustart; @@ -1022,8 +1062,8 @@ float *make_orco_surf(Object *ob) sizeu = nu->pntsu*nu->resolu; sizev = nu->pntsv*nu->resolv; - if (nu->flagu & CU_CYCLIC) sizeu++; - if (nu->flagv & CU_CYCLIC) sizev++; + if (nu->flagu & CU_NURB_CYCLIC) sizeu++; + if (nu->flagv & CU_NURB_CYCLIC) sizev++; if(nu->pntsv>1) tot+= sizeu * sizev; nu= nu->next; @@ -1036,8 +1076,8 @@ float *make_orco_surf(Object *ob) if(nu->pntsv>1) { sizeu = nu->pntsu*nu->resolu; sizev = nu->pntsv*nu->resolv; - if (nu->flagu & CU_CYCLIC) sizeu++; - if (nu->flagv & CU_CYCLIC) sizev++; + if (nu->flagu & CU_NURB_CYCLIC) sizeu++; + if (nu->flagv & CU_NURB_CYCLIC) sizev++; if(cu->flag & CU_UV_ORCO) { for(b=0; b< sizeu; b++) { @@ -1063,12 +1103,12 @@ float *make_orco_surf(Object *ob) for(b=0; bflagu & CU_CYCLIC)) + if (b==sizeu-1 && (nu->flagu & CU_NURB_CYCLIC)) use_b= 0; for(a=0; aflagv & CU_CYCLIC)) + if (a==sizev-1 && (nu->flagv & CU_NURB_CYCLIC)) use_a= 0; tdata = _tdata + 3 * (use_b * (nu->pntsv*nu->resolv) + use_a); @@ -1511,14 +1551,14 @@ static void alfa_bezpart(BezTriple *prevbezt, BezTriple *bezt, Nurb *nu, float * /* returns a point */ if(prevbezt==nu->bezt) { - if(nu->flagu & CU_CYCLIC) pprev= last; + if(nu->flagu & CU_NURB_CYCLIC) pprev= last; else pprev= prevbezt; } else pprev= prevbezt-1; /* next point */ if(bezt==last) { - if(nu->flagu & CU_CYCLIC) next= nu->bezt; + if(nu->flagu & CU_NURB_CYCLIC) next= nu->bezt; else next= bezt; } else next= bezt+1; @@ -1977,7 +2017,7 @@ void makeBevelList(Object *ob) bl= MEM_callocN(sizeof(BevList)+len*sizeof(BevPoint), "makeBevelList2"); BLI_addtail(&(cu->bev), bl); - if(nu->flagu & CU_CYCLIC) bl->poly= 0; + if(nu->flagu & CU_NURB_CYCLIC) bl->poly= 0; else bl->poly= -1; bl->nr= len; bl->dupe_nr= 0; @@ -1995,17 +2035,17 @@ void makeBevelList(Object *ob) } else if(nu->type == CU_BEZIER) { - len= resolu*(nu->pntsu+ (nu->flagu & CU_CYCLIC) -1)+1; /* in case last point is not cyclic */ + len= resolu*(nu->pntsu+ (nu->flagu & CU_NURB_CYCLIC) -1)+1; /* in case last point is not cyclic */ bl= MEM_callocN(sizeof(BevList)+len*sizeof(BevPoint), "makeBevelBPoints"); BLI_addtail(&(cu->bev), bl); - if(nu->flagu & CU_CYCLIC) bl->poly= 0; + if(nu->flagu & CU_NURB_CYCLIC) bl->poly= 0; else bl->poly= -1; bevp= (BevPoint *)(bl+1); a= nu->pntsu-1; bezt= nu->bezt; - if(nu->flagu & CU_CYCLIC) { + if(nu->flagu & CU_NURB_CYCLIC) { a++; prevbezt= nu->bezt+(nu->pntsu-1); } @@ -2066,7 +2106,7 @@ void makeBevelList(Object *ob) bezt++; } - if((nu->flagu & CU_CYCLIC)==0) { /* not cyclic: endpoint */ + if((nu->flagu & CU_NURB_CYCLIC)==0) { /* not cyclic: endpoint */ VECCOPY(bevp->vec, prevbezt->vec[1]); bevp->alfa= prevbezt->alfa; bevp->radius= prevbezt->radius; @@ -2081,7 +2121,7 @@ void makeBevelList(Object *ob) BLI_addtail(&(cu->bev), bl); bl->nr= len; bl->dupe_nr= 0; - if(nu->flagu & CU_CYCLIC) bl->poly= 0; + if(nu->flagu & CU_NURB_CYCLIC) bl->poly= 0; else bl->poly= -1; bevp= (BevPoint *)(bl+1); @@ -2521,7 +2561,7 @@ void calchandlesNurb(Nurb *nu) /* first, if needed, set handle flags */ a= nu->pntsu; bezt= nu->bezt; - if(nu->flagu & CU_CYCLIC) prev= bezt+(a-1); + if(nu->flagu & CU_NURB_CYCLIC) prev= bezt+(a-1); else prev= 0; next= bezt+1; @@ -2529,7 +2569,7 @@ void calchandlesNurb(Nurb *nu) /* first, if needed, set handle flags */ calchandleNurb(bezt, prev, next, 0); prev= bezt; if(a==1) { - if(nu->flagu & CU_CYCLIC) next= nu->bezt; + if(nu->flagu & CU_NURB_CYCLIC) next= nu->bezt; else next= 0; } else next++; @@ -2986,7 +3026,7 @@ int check_valid_nurb_u( struct Nurb *nu ) if (nu->type != CU_NURBS) return 1; /* not a nurb, lets assume its valid */ if (nu->pntsu < nu->orderu) return 0; - if (((nu->flag & CU_CYCLIC)==0) && ((nu->flagu>>1) & 2)) { /* Bezier U Endpoints */ + if (((nu->flag & CU_NURB_CYCLIC)==0) && (nu->flagu & CU_NURB_BEZIER)) { /* Bezier U Endpoints */ if (nu->orderu==4) { if (nu->pntsu < 5) return 0; /* bezier with 4 orderu needs 5 points */ } else if (nu->orderu != 3) return 0; /* order must be 3 or 4 */ @@ -3000,7 +3040,7 @@ int check_valid_nurb_v( struct Nurb *nu) if (nu->type != CU_NURBS) return 1; /* not a nurb, lets assume its valid */ if (nu->pntsv < nu->orderv) return 0; - if (((nu->flag & CU_CYCLIC)==0) && ((nu->flagv>>1) & 2)) { /* Bezier V Endpoints */ + if (((nu->flag & CU_NURB_CYCLIC)==0) && (nu->flagv & CU_NURB_BEZIER)) { /* Bezier V Endpoints */ if (nu->orderv==4) { if (nu->pntsv < 5) return 0; /* bezier with 4 orderu needs 5 points */ } else if (nu->orderv != 3) return 0; /* order must be 3 or 4 */ @@ -3015,7 +3055,7 @@ int clamp_nurb_order_u( struct Nurb *nu ) nu->orderu= nu->pntsu; change= 1; } - if(((nu->flag & CU_CYCLIC)==0) && (nu->flagu>>1)&2) { + if(((nu->flag & CU_NURB_CYCLIC)==0) && (nu->flagu & CU_NURB_BEZIER)) { CLAMP(nu->orderu, 3,4); change= 1; } @@ -3029,7 +3069,7 @@ int clamp_nurb_order_v( struct Nurb *nu) nu->orderv= nu->pntsv; change= 1; } - if(((nu->flag & CU_CYCLIC)==0) && (nu->flagv>>1)&2) { + if(((nu->flag & CU_NURB_CYCLIC)==0) && (nu->flagv & CU_NURB_BEZIER)) { CLAMP(nu->orderv, 3,4); change= 1; } diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 56eabc0f5ef..07ecf4c92a9 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -840,17 +840,17 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase) /* count */ len= 0; a= nu->pntsu-1; - if(nu->flagu & CU_CYCLIC) a++; + if(nu->flagu & CU_NURB_CYCLIC) a++; prevbezt= nu->bezt; bezt= prevbezt+1; while(a--) { - if(a==0 && (nu->flagu & CU_CYCLIC)) bezt= nu->bezt; + if(a==0 && (nu->flagu & CU_NURB_CYCLIC)) bezt= nu->bezt; if(prevbezt->h2==HD_VECT && bezt->h1==HD_VECT) len++; else len+= resolu; - if(a==0 && (nu->flagu & CU_CYCLIC)==0) len++; + if(a==0 && (nu->flagu & CU_NURB_CYCLIC)==0) len++; prevbezt= bezt; bezt++; @@ -867,7 +867,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase) data= dl->verts; - if(nu->flagu & CU_CYCLIC) { + if(nu->flagu & CU_NURB_CYCLIC) { dl->type= DL_POLY; a= nu->pntsu; } @@ -920,7 +920,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase) dl->charidx = nu->charidx; data= dl->verts; - if(nu->flagu & CU_CYCLIC) dl->type= DL_POLY; + if(nu->flagu & CU_NURB_CYCLIC) dl->type= DL_POLY; else dl->type= DL_SEGM; makeNurbcurve(nu, data, NULL, NULL, resolu, 3*sizeof(float)); } @@ -935,7 +935,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase) dl->charidx = nu->charidx; data= dl->verts; - if(nu->flagu & CU_CYCLIC) dl->type= DL_POLY; + if(nu->flagu & CU_NURB_CYCLIC) dl->type= DL_POLY; else dl->type= DL_SEGM; a= len; @@ -1610,7 +1610,7 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase, dl->rt= nu->flag; data= dl->verts; - if(nu->flagu & CU_CYCLIC) dl->type= DL_POLY; + if(nu->flagu & CU_NURB_CYCLIC) dl->type= DL_POLY; else dl->type= DL_SEGM; makeNurbcurve(nu, data, NULL, NULL, nu->resolu, 3*sizeof(float)); @@ -1631,8 +1631,8 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase, dl->parts= (nu->pntsu*nu->resolu); /* in reverse, because makeNurbfaces works that way */ dl->nr= (nu->pntsv*nu->resolv); - if(nu->flagv & CU_CYCLIC) dl->flag|= DL_CYCL_U; /* reverse too! */ - if(nu->flagu & CU_CYCLIC) dl->flag|= DL_CYCL_V; + if(nu->flagv & CU_NURB_CYCLIC) dl->flag|= DL_CYCL_U; /* reverse too! */ + if(nu->flagu & CU_NURB_CYCLIC) dl->flag|= DL_CYCL_V; makeNurbfaces(nu, data, 0); diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index efd93aa362d..8ec4814dc94 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -473,7 +473,7 @@ static void build_underline(Curve *cu, float x1, float y1, float x2, float y2, i nu2->pntsv = 1; nu2->orderu = 4; nu2->orderv = 1; - nu2->flagu = CU_CYCLIC; + nu2->flagu = CU_NURB_CYCLIC; bp = (BPoint*)MEM_callocN(4 * sizeof(BPoint),"underline_bp"); if (bp == 0){ diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 8d2dfcd1989..08130f51b0e 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1165,7 +1165,7 @@ void mesh_to_curve(Scene *scene, Object *ob) nu->pntsu= totpoly; nu->pntsv= 1; nu->orderu= 4; - nu->flagu= 2 | (closed ? CU_CYCLIC:0); /* endpoint */ + nu->flagu= CU_NURB_ENDPOINT | (closed ? CU_NURB_CYCLIC:0); /* endpoint */ nu->resolu= 12; nu->bp= (BPoint *)MEM_callocN(sizeof(BPoint)*totpoly, "bpoints"); diff --git a/source/blender/blenlib/BLI_listbase.h b/source/blender/blenlib/BLI_listbase.h index f2fec215c2b..1f6a1ee5a97 100644 --- a/source/blender/blenlib/BLI_listbase.h +++ b/source/blender/blenlib/BLI_listbase.h @@ -49,6 +49,7 @@ int BLI_findstringindex(struct ListBase *listbase, const char *id, int offset); void BLI_freelistN(struct ListBase *listbase); void BLI_addtail(struct ListBase *listbase, void *vlink); void BLI_remlink(struct ListBase *listbase, void *vlink); +int BLI_remlink_safe(struct ListBase *listbase, void *vlink); void BLI_addhead(struct ListBase *listbase, void *vlink); void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink); diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c index b08631b9317..d06ca7b44d6 100644 --- a/source/blender/blenlib/intern/freetypefont.c +++ b/source/blender/blenlib/intern/freetypefont.c @@ -150,7 +150,7 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf nu->pntsu = onpoints[j]; nu->resolu= 8; nu->flag= CU_2D; - nu->flagu= CU_CYCLIC; + nu->flagu= CU_NURB_CYCLIC; nu->bezt = bezt; //individual curve loop, start-end diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c index 5d046dce023..0a6831558d1 100644 --- a/source/blender/blenlib/intern/listbase.c +++ b/source/blender/blenlib/intern/listbase.c @@ -108,6 +108,17 @@ void BLI_remlink(ListBase *listbase, void *vlink) if (listbase->first == link) listbase->first = link->next; } +int BLI_remlink_safe(ListBase *listbase, void *vlink) +{ + if(BLI_findindex(listbase, vlink) != -1) { + BLI_remlink(listbase, vlink); + return 1; + } + else { + return 0; + } +} + void BLI_freelinkN(ListBase *listbase, void *vlink) { diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index b4666923a03..5d9531e6b37 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -545,7 +545,7 @@ static void applyarmature_fix_boneparents (Scene *scene, Object *armob) /* apply current transform from parent (not yet destroyed), * then calculate new parent inverse matrix */ - ED_object_apply_obmat(ob); + object_apply_mat4(ob, ob->obmat); what_does_parent(scene, ob, &workob); invert_m4_m4(ob->parentinv, workob.obmat); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index de4f426eb65..dfc76aff3dd 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -929,9 +929,9 @@ static void adduplicateflagNurb(Object *obedit, short flag) bezt1++; } - if(nu->flagu & CU_CYCLIC) { + if(nu->flagu & CU_NURB_CYCLIC) { if(starta!=0 || enda!=nu->pntsu-1) { - newnu->flagu &= ~CU_CYCLIC; + newnu->flagu &= ~CU_NURB_CYCLIC; } } } @@ -966,9 +966,9 @@ static void adduplicateflagNurb(Object *obedit, short flag) bp1++; } - if(nu->flagu & CU_CYCLIC) { + if(nu->flagu & CU_NURB_CYCLIC) { if(starta!=0 || enda!=nu->pntsu-1) { - newnu->flagu &= ~CU_CYCLIC; + newnu->flagu &= ~CU_NURB_CYCLIC; } } @@ -1904,7 +1904,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) newly created. Old points are discarded. */ /* count */ - if(nu->flagu & CU_CYCLIC) { + if(nu->flagu & CU_NURB_CYCLIC) { a= nu->pntsu; bezt= nu->bezt; prevbezt= bezt+(a-1); @@ -1925,7 +1925,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) beztnew = (BezTriple*)MEM_mallocN((amount + nu->pntsu) * sizeof(BezTriple), "subdivNurb"); beztn= beztnew; - if(nu->flagu & CU_CYCLIC) { + if(nu->flagu & CU_NURB_CYCLIC) { a= nu->pntsu; bezt= nu->bezt; prevbezt= bezt+(a-1); @@ -1957,7 +1957,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) mid_v3_v3v3(beztn->vec[1], vec+9, vec+12); VECCOPY(beztn->vec[2], vec+12); /* handle of next bezt */ - if(a==0 && (nu->flagu & CU_CYCLIC)) {VECCOPY(beztnew->vec[0], vec+6);} + if(a==0 && (nu->flagu & CU_NURB_CYCLIC)) {VECCOPY(beztnew->vec[0], vec+6);} else {VECCOPY(bezt->vec[0], vec+6);} beztn->radius = (prevbezt->radius + bezt->radius)/2.0f; @@ -1970,7 +1970,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) bezt++; } /* last point */ - if((nu->flagu & CU_CYCLIC)==0) memcpy(beztn, prevbezt, sizeof(BezTriple)); + if((nu->flagu & CU_NURB_CYCLIC)==0) memcpy(beztn, prevbezt, sizeof(BezTriple)); MEM_freeN(nu->bezt); nu->bezt= beztnew; @@ -1987,7 +1987,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) stable... nzc 30-5-'00 */ /* count */ - if(nu->flagu & CU_CYCLIC) { + if(nu->flagu & CU_NURB_CYCLIC) { a= nu->pntsu; bp= nu->bp; prevbp= bp+(a-1); @@ -2009,7 +2009,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) (BPoint*)MEM_mallocN((amount + nu->pntsu) * sizeof(BPoint), "subdivNurb2"); bpn= bpnew; - if(nu->flagu & CU_CYCLIC) { + if(nu->flagu & CU_NURB_CYCLIC) { a= nu->pntsu; bp= nu->bp; prevbp= bp+(a-1); @@ -2036,7 +2036,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) prevbp= bp; bp++; } - if((nu->flagu & CU_CYCLIC)==0) memcpy(bpn, prevbp, sizeof(BPoint)); /* last point */ + if((nu->flagu & CU_NURB_CYCLIC)==0) memcpy(bpn, prevbp, sizeof(BPoint)); /* last point */ MEM_freeN(nu->bp); nu->bp= bpnew; @@ -2423,8 +2423,8 @@ static int convertspline(short type, Nurb *nu) else if(type==CU_NURBS) { nu->type = CU_NURBS; nu->orderu= 4; - nu->flagu &= CU_CYCLIC; /* disable all flags except for cyclic */ - nu->flagu += 4; + nu->flagu &= CU_NURB_CYCLIC; /* disable all flags except for cyclic */ + nu->flagu |= CU_NURB_BEZIER; makeknots(nu, 1); a= nu->pntsu*nu->pntsv; bp= nu->bp; @@ -2473,11 +2473,11 @@ static int convertspline(short type, Nurb *nu) nu->orderu= 4; nu->orderv= 1; nu->type = type; - if(nu->flagu & CU_CYCLIC) c= nu->orderu-1; + if(nu->flagu & CU_NURB_CYCLIC) c= nu->orderu-1; else c= 0; if(type== CU_NURBS) { - nu->flagu &= CU_CYCLIC; /* disable all flags except for cyclic */ - nu->flagu += 4; + nu->flagu &= CU_NURB_CYCLIC; /* disable all flags except for cyclic */ + nu->flagu |= CU_NURB_BEZIER; makeknots(nu, 1); } } @@ -2992,7 +2992,7 @@ static int make_segment_exec(bContext *C, wmOperator *op) /* find both nurbs and points, nu1 will be put behind nu2 */ for(nu= editnurb->first; nu; nu= nu->next) { - if((nu->flagu & CU_CYCLIC)==0) { /* not cyclic */ + if((nu->flagu & CU_NURB_CYCLIC)==0) { /* not cyclic */ if(nu->type == CU_BEZIER) { bezt= nu->bezt; if(nu1==0) { @@ -3284,7 +3284,7 @@ static int spin_nurb(bContext *C, Scene *scene, Object *obedit, float *dvec, flo for(nu= editnurb->first; nu; nu= nu->next) { if(isNurbsel(nu)) { nu->orderv= 4; - nu->flagv |= CU_CYCLIC; + nu->flagv |= CU_NURB_CYCLIC; makeknots(nu, 2); } } @@ -3587,7 +3587,7 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op) bp= nu->bp; while(a--) { if( bp->f1 & SELECT ) { - nu->flagu ^= CU_CYCLIC; + nu->flagu ^= CU_NURB_CYCLIC; break; } bp++; @@ -3598,7 +3598,7 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op) bezt= nu->bezt; while(a--) { if( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) { - nu->flagu ^= CU_CYCLIC; + nu->flagu ^= CU_NURB_CYCLIC; break; } bezt++; @@ -3611,7 +3611,7 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op) bp= nu->bp; while(a--) { if( bp->f1 & SELECT ) { - nu->flagu ^= CU_CYCLIC; + nu->flagu ^= CU_NURB_CYCLIC; makeknots(nu, 1); /* 1==u type is ignored for cyclic curves */ break; } @@ -3626,11 +3626,11 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op) if( bp->f1 & SELECT) { if(direction==0 && nu->pntsu>1) { - nu->flagu ^= CU_CYCLIC; + nu->flagu ^= CU_NURB_CYCLIC; makeknots(nu, 1); /* 1==u type is ignored for cyclic curves */ } if(direction==1 && nu->pntsv>1) { - nu->flagv ^= CU_CYCLIC; + nu->flagv ^= CU_NURB_CYCLIC; makeknots(nu, 2); /* 2==v type is ignored for cyclic curves */ } break; @@ -4430,10 +4430,10 @@ static int delete_exec(bContext *C, wmOperator *op) bezt2= bezt+1; if( (bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT) ) ; else { /* maybe do not make cyclic */ - if(a==0 && (nu->flagu & CU_CYCLIC) ) { + if(a==0 && (nu->flagu & CU_NURB_CYCLIC) ) { bezt2= bezt+(nu->pntsu-1); if( (bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT) ) { - nu->flagu &= ~CU_CYCLIC; + nu->flagu &= ~CU_NURB_CYCLIC; WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } @@ -4456,10 +4456,10 @@ static int delete_exec(bContext *C, wmOperator *op) bp2= bp+1; if( bp2->f1 & 1 ) ; else { /* maybe do not make cyclic */ - if(a==0 && (nu->flagu & CU_CYCLIC) ) { + if(a==0 && (nu->flagu & CU_NURB_CYCLIC) ) { bp2= bp+(nu->pntsu-1); if( bp2->f1 & SELECT ) { - nu->flagu &= ~CU_CYCLIC; + nu->flagu &= ~CU_NURB_CYCLIC; WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } @@ -4484,14 +4484,14 @@ static int delete_exec(bContext *C, wmOperator *op) BLI_remlink(editnurb, nu); freeNurb(nu); nu = NULL; } - else if(nu1->flagu & CU_CYCLIC) { /* cyclic */ + else if(nu1->flagu & CU_NURB_CYCLIC) { /* cyclic */ bezt = (BezTriple*)MEM_mallocN((cut+1) * sizeof(BezTriple), "delNurb1"); memcpy(bezt, nu1->bezt,(cut+1)*sizeof(BezTriple)); a= nu1->pntsu-cut-1; memcpy(nu1->bezt, bezt2, a*sizeof(BezTriple)); memcpy(nu1->bezt+a, bezt, (cut+1)*sizeof(BezTriple)); - nu1->flagu &= ~CU_CYCLIC; + nu1->flagu &= ~CU_NURB_CYCLIC; MEM_freeN(bezt); calchandlesNurb(nu); } @@ -4526,14 +4526,14 @@ static int delete_exec(bContext *C, wmOperator *op) BLI_remlink(editnurb, nu); freeNurb(nu); nu= NULL; } - else if(nu1->flagu & CU_CYCLIC) { /* cyclic */ + else if(nu1->flagu & CU_NURB_CYCLIC) { /* cyclic */ bp = (BPoint*)MEM_mallocN((cut+1) * sizeof(BPoint), "delNurb5"); memcpy(bp, nu1->bp,(cut+1)*sizeof(BPoint)); a= nu1->pntsu-cut-1; memcpy(nu1->bp, bp2, a*sizeof(BPoint)); memcpy(nu1->bp+a, bp, (cut+1)*sizeof(BPoint)); - nu1->flagu &= ~CU_CYCLIC; + nu1->flagu &= ~CU_NURB_CYCLIC; MEM_freeN(bp); } else { /* add new curve */ @@ -4849,7 +4849,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname) nu->pntsu= 5; nu->pntsv= 1; nu->orderu= 5; - nu->flagu= 2; /* endpoint */ + nu->flagu= CU_NURB_ENDPOINT; /* endpoint */ nu->resolu= 8; nu->bp= callocstructN(BPoint, 5, "addNurbprim3"); @@ -4888,7 +4888,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname) if (!force_3d) nu->flag |= CU_2D; nu->pntsu= 4; nu->bezt= callocstructN(BezTriple, 4, "addNurbprim1"); - nu->flagu= CU_CYCLIC; + nu->flagu= CU_NURB_CYCLIC; bezt= nu->bezt; bezt->h1= bezt->h2= HD_AUTO; @@ -4925,7 +4925,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname) nu->pntsv= 1; nu->orderu= 4; nu->bp= callocstructN(BPoint, 8, "addNurbprim6"); - nu->flagu= CU_CYCLIC; + nu->flagu= CU_NURB_CYCLIC; bp= nu->bp; for(a=0; a<8; a++) { @@ -5047,7 +5047,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname) mul_m4_v3(mat,bp->vec); bp++; } - nu->flagu= 4; + nu->flagu= CU_NURB_BEZIER; makeknots(nu, 1); BLI_addtail(editnurb, nu); /* temporal for spin */ diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 7bcfc81bf26..5c9b939aa1f 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -423,7 +423,7 @@ static void gp_stroke_to_path (bContext *C, bGPDlayer *gpl, bGPDstroke *gps, Cur nu->pntsu= gps->totpoints; nu->pntsv= 1; nu->orderu= gps->totpoints; - nu->flagu= 2; /* endpoint */ + nu->flagu= CU_NURB_ENDPOINT; nu->resolu= 32; nu->bp= (BPoint *)MEM_callocN(sizeof(BPoint)*gps->totpoints, "bpoints"); diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 8045f2a9130..ba80a15d050 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -62,7 +62,6 @@ void ED_base_object_activate(struct bContext *C, struct Base *base); void ED_base_object_free_and_unlink(struct Scene *scene, struct Base *base); -void ED_object_apply_obmat(struct Object *ob); /* single object duplicate, if dupflag==0, fully linked, else it uses the flags given */ struct Base *ED_object_add_duplicate(struct Scene *scene, struct Base *base, int dupflag); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index e29a6703bb8..e12db3674d4 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -413,6 +413,15 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s.%s", RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop)); data->linedark[data->totline]= 1; data->totline++; + + if(but->rnapoin.id.data) { + ID *id= but->rnapoin.id.data; + if(id->lib && id->lib->name) { + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Library: %s", id->lib->name); + data->linedark[data->totline]= 1; + data->totline++; + } + } } else if (but->optype) { PointerRNA *opptr; diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index b1405d1d12e..484a67b94db 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1118,7 +1118,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base) ob->lay= base->lay; copy_m4_m4(ob->obmat, dob->mat); - ED_object_apply_obmat(ob); + object_apply_mat4(ob, ob->obmat); } copy_object_set_idnew(C, 0); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 807fa00d806..65e8fbeeb8f 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -150,34 +150,6 @@ static int pupmenu(const char *msg) {return 0;} static bContext *C; static void error_libdata() {} -/* ********************************** */ - -/* --------------------------------- */ - -void ED_object_apply_obmat(Object *ob) -{ - float mat[3][3], imat[3][3], tmat[3][3]; - - /* from obmat to loc rot size */ - - if(ob==NULL) return; - copy_m3_m4(mat, ob->obmat); - - VECCOPY(ob->loc, ob->obmat[3]); - - mat3_to_eul( ob->rot,mat); - eul_to_mat3( tmat,ob->rot); - - invert_m3_m3(imat, tmat); - - mul_m3_m3m3(tmat, imat, mat); - - ob->size[0]= tmat[0][0]; - ob->size[1]= tmat[1][1]; - ob->size[2]= tmat[2][2]; - -} - /* ********* clear/set restrict view *********/ static int object_restrictview_clear_exec(bContext *C, wmOperator *op) { diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index f55e7594c24..94eae2a7ab9 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -430,7 +430,7 @@ static int parent_clear_exec(bContext *C, wmOperator *op) else if(type == 1) { ob->parent= NULL; ob->track= NULL; - ED_object_apply_obmat(ob); + object_apply_mat4(ob, ob->obmat); } else if(type == 2) unit_m4(ob->parentinv); @@ -572,7 +572,7 @@ static int parent_set_exec(bContext *C, wmOperator *op) Object workob; /* apply transformation of previous parenting */ - ED_object_apply_obmat(ob); + object_apply_mat4(ob, ob->obmat); /* set the parent (except for follow-path constraint option) */ if(partype != PAR_PATH_CONST) @@ -887,7 +887,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op) } if(type == 1) - ED_object_apply_obmat(ob); + object_apply_mat4(ob, ob->obmat); } CTX_DATA_END; diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index db15322bbc4..ca6feabdf80 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -392,7 +392,7 @@ static void ignore_parent_tx(Main *bmain, Scene *scene, Object *ob ) /* a change was made, adjust the children to compensate */ for(ob_child=bmain->object.first; ob_child; ob_child=ob_child->id.next) { if(ob_child->parent == ob) { - ED_object_apply_obmat(ob_child); + object_apply_mat4(ob_child, ob_child->obmat); what_does_parent(scene, ob_child, &workob); invert_m4_m4(ob_child->parentinv, workob.obmat); } diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index d7f3436713c..e29a81612fa 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -40,6 +40,7 @@ #include "DNA_space_types.h" #include "DNA_world_types.h" +#include "BKE_animsys.h" #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_font.h" diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 944a93a713f..62a325b59f4 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -379,7 +379,7 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa) { PointerRNA strip_ptr; uiLayout *layout= pa->layout; - uiLayout *column, *subcolumn; + uiLayout *column, *subcolumn, *subrow; uiBlock *block; /* check context and also validity of pointer */ @@ -398,10 +398,13 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa) column= uiLayoutColumn(layout, 1); - uiItemR(column, NULL, 0, &strip_ptr, "animated_time", 0); - + subrow= uiLayoutRow(column, 0); + uiItemR(subrow, NULL, 0, &strip_ptr, "animated_time", 0); + uiItemR(subrow, NULL, 0, &strip_ptr, "animated_time_cyclic", 0); + subcolumn= uiLayoutColumn(column, 1); - uiLayoutSetEnabled(subcolumn, RNA_boolean_get(&strip_ptr, "animated_time")); + subrow= uiLayoutRow(subcolumn, 0); + uiLayoutSetEnabled(subrow, RNA_boolean_get(&strip_ptr, "animated_time")); uiItemR(subcolumn, NULL, 0, &strip_ptr, "strip_time", 0); } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 8fedc56df67..5a495488afa 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -5773,7 +5773,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } break; case OB_CAMERA: - if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) + if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0 || (rv3d->persp==RV3D_CAMOB && v3d->camera==ob)) /* special exception for active camera */ drawcamera(scene, v3d, rv3d, ob, flag); break; case OB_LATTICE: diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index b1f5e959388..79448ecf875 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2352,11 +2352,11 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) /* Draw particle edit brush XXX (removed) */ + + if(rv3d->persp==RV3D_CAMOB) drawviewborder(scene, ar, v3d); + if(rv3d->rflag & RV3D_FLYMODE) drawviewborder_flymode(ar); + if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { - - if(rv3d->persp==RV3D_CAMOB) drawviewborder(scene, ar, v3d); - if(rv3d->rflag & RV3D_FLYMODE) drawviewborder_flymode(ar); - /* draw grease-pencil stuff - needed to get paint-buffer shown too (since it's 2D) */ // if (v3d->flag2 & V3D_DISPGP) draw_gpencil_3dview((bContext *)C, 0); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index f09b127bfdd..efc3c80de5f 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -1353,11 +1353,12 @@ static int viewselected_exec(bContext *C, wmOperator *op) /* like a localview wi for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { if(pchan->bone->flag & BONE_SELECTED) { if(pchan->bone->layer & arm->layer) { + bPoseChannel *pchan_tx= pchan->custom_tx ? pchan->custom_tx : pchan; ok= 1; - VECCOPY(vec, pchan->pose_head); + VECCOPY(vec, pchan_tx->pose_head); mul_m4_v3(ob->obmat, vec); DO_MINMAX(vec, min, max); - VECCOPY(vec, pchan->pose_tail); + VECCOPY(vec, pchan_tx->pose_tail); mul_m4_v3(ob->obmat, vec); DO_MINMAX(vec, min, max); } diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 828d5368834..02c4a1d91ed 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -2288,12 +2288,12 @@ static void flyEvent(FlyInfo *fly, wmEvent *event) break; case FLY_MODAL_DIR_UP: - if (fly->speed < 0.0f) fly->speed= -fly->speed; + if (fly->speed > 0.0f) fly->speed= -fly->speed; fly->axis= 1; break; case FLY_MODAL_DIR_DOWN: - if (fly->speed > 0.0f) fly->speed= -fly->speed; + if (fly->speed < 0.0f) fly->speed= -fly->speed; fly->axis= 1; break; diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index 83f68758da9..8c2fc7db390 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -601,6 +601,7 @@ typedef enum eNlaStrip_Flag { /* strip influence is controlled by local F-Curve */ NLASTRIP_FLAG_USR_INFLUENCE = (1<<5), NLASTRIP_FLAG_USR_TIME = (1<<6), + NLASTRIP_FLAG_USR_TIME_CYCLIC = (1<<7), /* NLA strip length is synced to the length of the referenced action */ NLASTRIP_FLAG_SYNC_LENGTH = (1<<9), diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index 1e2cc2745a4..82418899172 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -288,7 +288,9 @@ typedef struct Curve { /* flagu flagv (nurb) */ -#define CU_CYCLIC 1 +#define CU_NURB_CYCLIC 1 +#define CU_NURB_ENDPOINT 2 +#define CU_NURB_BEZIER 4 /* *************** BEZTRIPLE **************** */ diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 178cdacf3c3..77eff6ad4c5 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -334,6 +334,7 @@ typedef struct ExtensionRNA { #define MainMaterials Main #define MainMeshes Main #define MainLamps Main +#define MainImages Main #define MainObjects Main #define MainTexts Main #define MainActions Main diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 24701ed866d..579ebfc9332 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -50,6 +50,14 @@ EnumPropertyItem beztriple_interpolation_mode_items[] = { {BEZT_IPO_BEZ, "BEZIER", 0, "Bezier", ""}, {0, NULL, 0, NULL, NULL}}; +EnumPropertyItem curve_type_items[] = { + {CU_POLY, "POLY", 0, "Poly", ""}, + {CU_BEZIER, "BEZIER", 0, "Bezier", ""}, + {CU_BSPLINE, "BSPLINE", 0, "BSpline", ""}, + {CU_CARDINAL, "CARDINAL", 0, "Cardinal", ""}, + {CU_NURBS, "NURBS", 0, "Ease", ""}, + {0, NULL, 0, NULL, NULL}}; + #ifdef RNA_RUNTIME #include "DNA_object_types.h" @@ -72,22 +80,6 @@ static StructRNA *rna_Curve_refine(PointerRNA *ptr) else return &RNA_Curve; } - -static PointerRNA rna_Curve_active_nurb_get(PointerRNA *ptr) -{ - Curve *cu= (Curve*)ptr->data; - Nurb *nu= NULL; - - if(cu->editnurb) - nu = BLI_findlink(cu->editnurb, cu->actnu); - - if(nu) - return rna_pointer_inherit_refine(ptr, &RNA_Spline, nu); - - return rna_pointer_inherit_refine(ptr, NULL, NULL); -} - - static void rna_BezTriple_handle1_get(PointerRNA *ptr, float *values) { BezTriple *bt= (BezTriple*)ptr->data; @@ -208,14 +200,17 @@ static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA rna_iterator_array_begin(iter, (void*)nu->bp, sizeof(BPoint), nu->pntsv>0 ? nu->pntsu*nu->pntsv : nu->pntsu, 0, NULL); } -static void rna_Curve_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) +static void rna_Curve_update_data_id(Main *bmain, Scene *scene, ID *id) { - ID *id= ptr->id.data; - DAG_id_flush_update(id, OB_RECALC_DATA); WM_main_add_notifier(NC_GEOM|ND_DATA, id); } +static void rna_Curve_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + rna_Curve_update_data_id(bmain, scene, ptr->id.data); +} + static void rna_Curve_update_deps(Main *bmain, Scene *scene, PointerRNA *ptr) { DAG_scene_sort(scene); @@ -316,6 +311,119 @@ static void rna_Nurb_update_knot_v(Main *bmain, Scene *scene, PointerRNA *ptr) rna_Curve_update_data(bmain, scene, ptr); } +static void rna_Curve_spline_points_add(ID *id, Nurb *nu, bContext *C, ReportList *reports, int number) +{ + if(nu->type == CU_BEZIER) { + BKE_report(reports, RPT_ERROR, "Bezier spline can't have points added"); + } + else if(number==0) { + // do nothing + } else { + + addNurbPoints(nu, number); + + /* update */ + makeknots(nu, 1); + + rna_Curve_update_data_id(CTX_data_main(C), CTX_data_scene(C), id); + } +} + +static void rna_Curve_spline_bezpoints_add(ID *id, Nurb *nu, bContext *C, ReportList *reports, int number) +{ + if(nu->type != CU_BEZIER) { + BKE_report(reports, RPT_ERROR, "Only bezier splines can be added"); + } + else if(number==0) { + // do nothing + } else { + addNurbPointsBezier(nu, number); + + /* update */ + makeknots(nu, 1); + + rna_Curve_update_data_id(CTX_data_main(C), CTX_data_scene(C), id); + } +} + +static Nurb *rna_Curve_spline_new(Curve *cu, int type) +{ + Nurb *nu= ( Nurb * ) MEM_callocN( sizeof( Nurb ), "spline.new" ); + + if(type==CU_BEZIER) { + BezTriple *bezt= (BezTriple *)MEM_callocN(sizeof(BezTriple), "spline.new.bezt"); + bezt->radius= 1.0; + nu->bezt= bezt; + } + else { + BPoint *bp= (BPoint *)MEM_callocN(sizeof(BPoint), "spline.new.bp"); + bp->radius= 1.0f; + nu->bp= bp; + } + + nu->type= type; + nu->pntsu= 1; + nu->pntsv= 1; + + nu->orderu= nu->orderv= 4; + nu->resolu= nu->resolv= 12; + nu->flag= CU_SMOOTH; + + BLI_addtail(&cu->nurb, nu); + + return nu; +} + +static void rna_Curve_spline_remove(Curve *cu, ReportList *reports, Nurb *nu) +{ + /* todo, check we're in the list */ + int found= 0; + if(cu->editnurb) { + found= BLI_remlink_safe(cu->editnurb, nu); + } + else { + found= BLI_remlink_safe(&cu->nurb, nu); + } + + if(!found) { + BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" does not contain spline given", cu->id.name+2); + return; + } + + freeNurb(nu); + /* invalidate pointer!, no can do */ +} + +static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr) +{ + Curve *cu= (Curve*)ptr->data; + Nurb *nu; + + if(cu->editnurb) + nu= BLI_findlink(cu->editnurb, cu->actnu); + else + nu= BLI_findlink(&cu->nurb, cu->actnu); // currently set to -1, should be changed to be allowed outside of editmode. + + if(nu) + return rna_pointer_inherit_refine(ptr, &RNA_Spline, nu); + + return rna_pointer_inherit_refine(ptr, NULL, NULL); +} + +static void rna_Curve_active_spline_set(PointerRNA *ptr, PointerRNA value) +{ + Curve *cu= (Curve*)ptr->data; + Nurb *nu= value.data; + + /* -1 is ok for an unset index */ + if(nu==NULL) + cu->actnu= -1; + else if(cu->editnurb) + cu->actnu= BLI_findindex(cu->editnurb, nu); + else + cu->actnu= BLI_findindex(&cu->nurb, nu); +} + #else static void rna_def_bpoint(BlenderRNA *brna) @@ -725,6 +833,100 @@ static void rna_def_text(BlenderRNA *brna) rna_def_nurbs(brna, srna); } + +/* curve.splines[0].points */ +static void rna_def_curve_spline_points(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + //PropertyRNA *prop; + + FunctionRNA *func; + PropertyRNA *parm; + + RNA_def_property_srna(cprop, "SplinePoints"); + srna= RNA_def_struct(brna, "SplinePoints", NULL); + RNA_def_struct_sdna(srna, "Nurb"); + RNA_def_struct_ui_text(srna, "Spline Points", "Collection of spline points"); + + func= RNA_def_function(srna, "add", "rna_Curve_spline_points_add"); + RNA_def_function_ui_description(func, "Add a number of points to this spline."); + RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_SELF_ID|FUNC_USE_REPORTS); + parm= RNA_def_int(func, "number", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX); + + /* + func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove"); + RNA_def_function_ui_description(func, "Remove a spline from a curve."); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove."); + RNA_def_property_flag(parm, PROP_REQUIRED); + */ +} + +static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + //PropertyRNA *prop; + + FunctionRNA *func; + PropertyRNA *parm; + + RNA_def_property_srna(cprop, "SplineBezierPoints"); + srna= RNA_def_struct(brna, "SplineBezierPoints", NULL); + RNA_def_struct_sdna(srna, "Nurb"); + RNA_def_struct_ui_text(srna, "Spline Bezier Points", "Collection of spline bezirt points"); + + func= RNA_def_function(srna, "add", "rna_Curve_spline_bezpoints_add"); + RNA_def_function_ui_description(func, "Add a number of points to this spline."); + RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_SELF_ID|FUNC_USE_REPORTS); + parm= RNA_def_int(func, "number", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX); + + /* + func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove"); + RNA_def_function_ui_description(func, "Remove a spline from a curve."); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove."); + RNA_def_property_flag(parm, PROP_REQUIRED); + */ +} + +/* curve.splines */ +static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + PropertyRNA *prop; + + FunctionRNA *func; + PropertyRNA *parm; + + RNA_def_property_srna(cprop, "CurveSplines"); + srna= RNA_def_struct(brna, "CurveSplines", NULL); + RNA_def_struct_sdna(srna, "Curve"); + RNA_def_struct_ui_text(srna, "Curve Splines", "Collection of curve splines"); + + func= RNA_def_function(srna, "new", "rna_Curve_spline_new"); + RNA_def_function_ui_description(func, "Add a new spline to the curve."); + parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline."); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline."); + RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove"); + RNA_def_function_ui_description(func, "Remove a spline from a curve."); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove."); + RNA_def_property_flag(parm, PROP_REQUIRED); + + prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "Object"); + RNA_def_property_pointer_funcs(prop, "rna_Curve_active_spline_get", "rna_Curve_active_spline_set", NULL); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Active Spline", "Active curve spline"); + /* Could call: ED_base_object_activate(C, scene->basact); + * but would be a bad level call and it seems the notifier is enough */ + RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL); +} + + static void rna_def_curve(BlenderRNA *brna) { StructRNA *srna; @@ -757,12 +959,7 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "nurb", NULL); RNA_def_property_struct_type(prop, "Spline"); RNA_def_property_ui_text(prop, "Splines", "Collection of splines in this curve data object"); - - prop= RNA_def_property(srna, "active_spline", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Spline"); - RNA_def_property_pointer_funcs(prop, "rna_Curve_active_nurb_get", NULL, NULL); - RNA_def_property_ui_text(prop, "Active Spline", "The active editmode spline"); - + rna_def_curve_splines(brna, prop); prop= RNA_def_property(srna, "draw_handles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "drawflag", CU_HIDE_HANDLES); @@ -888,14 +1085,6 @@ static void rna_def_curve(BlenderRNA *brna) static void rna_def_curve_nurb(BlenderRNA *brna) { - static EnumPropertyItem curve_type_items[] = { - {CU_POLY, "POLY", 0, "Poly", ""}, - {CU_BEZIER, "BEZIER", 0, "Bezier", ""}, - {CU_BSPLINE, "BSPLINE", 0, "BSpline", ""}, - {CU_CARDINAL, "CARDINAL", 0, "Cardinal", ""}, - {CU_NURBS, "NURBS", 0, "Ease", ""}, - {0, NULL, 0, NULL, NULL}}; - static EnumPropertyItem spline_interpolation_items[] = { {BEZT_IPO_CONST, "LINEAR", 0, "Linear", ""}, {BEZT_IPO_LIN, "CARDINAL", 0, "Cardinal", ""}, @@ -915,11 +1104,13 @@ static void rna_def_curve_nurb(BlenderRNA *brna) RNA_def_property_struct_type(prop, "SplinePoint"); RNA_def_property_collection_funcs(prop, "rna_BPoint_array_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_Nurb_length", 0, 0); RNA_def_property_ui_text(prop, "Points", "Collection of points that make up this poly or nurbs spline"); + rna_def_curve_spline_points(brna, prop); prop= RNA_def_property(srna, "bezier_points", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "BezierSplinePoint"); RNA_def_property_collection_sdna(prop, NULL, "bezt", "pntsu"); RNA_def_property_ui_text(prop, "Bezier Points", "Collection of points for bezier curves only"); + rna_def_curve_spline_bezpoints(brna, prop); prop= RNA_def_property(srna, "tilt_interpolation", PROP_ENUM, PROP_NONE); @@ -982,34 +1173,34 @@ static void rna_def_curve_nurb(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop= RNA_def_property(srna, "cyclic_u", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_CYCLIC); + RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_NURB_CYCLIC); RNA_def_property_ui_text(prop, "Cyclic U", "Make this curve or surface a closed loop in the U direction"); RNA_def_property_update(prop, 0, "rna_Nurb_update_handle_data"); /* only needed for cyclic_u because cyclic_v cant do bezier */ prop= RNA_def_property(srna, "cyclic_v", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_CYCLIC); + RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_CYCLIC); RNA_def_property_ui_text(prop, "Cyclic V", "Make this surface a closed loop in the V direction"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); /* Note, endpoint and bezier flags should never be on at the same time! */ prop= RNA_def_property(srna, "endpoint_u", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flagu", 2); + RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_NURB_ENDPOINT); RNA_def_property_ui_text(prop, "Endpoint U", "Make this nurbs curve or surface meet the endpoints in the U direction (Cyclic U must be disabled)"); RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u"); prop= RNA_def_property(srna, "endpoint_v", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flagv", 2); + RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_ENDPOINT); RNA_def_property_ui_text(prop, "Endpoint V", "Make this nurbs surface meet the endpoints in the V direction (Cyclic V must be disabled)"); RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v"); prop= RNA_def_property(srna, "bezier_u", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flagu", 4); + RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_NURB_BEZIER); RNA_def_property_ui_text(prop, "Bezier U", "Make this nurbs curve or surface act like a bezier spline in the U direction (Order U must be 3 or 4, Cyclic U must be disabled)"); RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u"); prop= RNA_def_property(srna, "bezier_v", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flagv", 4); + RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_BEZIER); RNA_def_property_ui_text(prop, "Bezier V", "Make this nurbs surface act like a bezier spline in the V direction (Order V must be 3 or 4, Cyclic V must be disabled)"); RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v"); diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 5f007c63b9e..9433294fdd3 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -69,11 +69,6 @@ Tex *rna_Main_add_texture(Main *bmain, char *name) return add_texture(name); } -Image *rna_Main_add_image(Main *bmain, char *filename) -{ - return BKE_add_image_file(filename, 0); -} - Camera *rna_Main_cameras_new(Main *bmain, char* name) { return add_camera(name); @@ -227,6 +222,27 @@ void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp) /* XXX python now has invalid pointer? */ } +Image *rna_Main_images_new(Main *bmain, char* name, int width, int height, int float_buffer) +{ + float color[4]= {0.0, 0.0, 0.0, 1.0}; + Image *image= BKE_add_image_size(width, height, name, float_buffer, 0, color); + image->id.us--; + return image; +} +Image *rna_Main_images_load(Main *bmain, char *filename) +{ + return BKE_add_image_file(filename, 0); +} +void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image) +{ + if(ID_REAL_USERS(image) <= 0) + free_libblock(&bmain->image, image); + else + BKE_reportf(reports, RPT_ERROR, "Image \"%s\" must have zero users to be removed, found %d.", image->id.name+2, ID_REAL_USERS(image)); + + /* XXX python now has invalid pointer? */ +} + Tex *rna_Main_textures_new(Main *bmain, char* name) { Tex *tex= add_texture(name); @@ -309,15 +325,20 @@ void rna_Main_actions_remove(Main *bmain, ReportList *reports, bAction *act) void RNA_api_main(StructRNA *srna) { + /* FunctionRNA *func; PropertyRNA *parm; - + */ + /* maybe we want to add functions in 'bpy.data' still? + * for now they are all in collections bpy.data.images.new(...) */ + /* func= RNA_def_function(srna, "add_image", "rna_Main_add_image"); RNA_def_function_ui_description(func, "Add a new image."); parm= RNA_def_string(func, "filename", "", 0, "", "Filename to load image from."); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_pointer(func, "image", "Image", "", "New image."); RNA_def_function_return(func, parm); + */ } @@ -491,8 +512,40 @@ void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop) } void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop) { + StructRNA *srna; + FunctionRNA *func; + PropertyRNA *parm; + RNA_def_property_srna(cprop, "MainImages"); + srna= RNA_def_struct(brna, "MainImages", NULL); + RNA_def_struct_ui_text(srna, "Main Images", "Collection of images"); + + func= RNA_def_function(srna, "new", "rna_Main_images_new"); + RNA_def_function_ui_description(func, "Add a new image to the main database"); + parm= RNA_def_string(func, "name", "Image", 0, "", "New name for the datablock."); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image.", 0, INT_MAX); + parm= RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image.", 0, INT_MAX); + parm= RNA_def_boolean(func, "float_buffer", 0, "Float Buffer", "Create an image with floating point color"); + /* return type */ + parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock."); + RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "load", "rna_Main_images_load"); + RNA_def_function_ui_description(func, "Load a new image into the main database"); + parm= RNA_def_string(func, "filename", "File Name", 0, "", "path of the file to load."); + RNA_def_property_flag(parm, PROP_REQUIRED); + /* return type */ + parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock."); + RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "remove", "rna_Main_images_remove"); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + RNA_def_function_ui_description(func, "Remove an image from the current blendfile."); + parm= RNA_def_pointer(func, "image", "Image", "", "Image to remove."); + RNA_def_property_flag(parm, PROP_REQUIRED); } + void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop) { diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 9cbe46dac58..b3f4aab7599 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -411,6 +411,11 @@ static void rna_def_nlastrip(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME); RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_time_set"); RNA_def_property_ui_text(prop, "Animated Strip Time", "Strip time is controlled by an F-Curve rather than automatically determined"); + + prop= RNA_def_property(srna, "animated_time_cyclic", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME_CYCLIC); + RNA_def_property_ui_text(prop, "Cyclic Strip Time", "Cycle the animated time within the action start & end"); + RNA_def_property_update(prop, 0, "rna_NlaStrip_transform_update"); // is there a better update flag? /* settings */ prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 117a1d5bc60..21a1b7994a5 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -125,7 +125,7 @@ void rna_Object_update(Main *bmain, Scene *scene, PointerRNA *ptr) void rna_Object_matrix_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - ED_object_apply_obmat(ptr->id.data); + object_apply_mat4(ptr->id.data, ((Object *)ptr->id.data)->obmat); rna_Object_update(bmain, scene, ptr); } diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 1686f3e69db..1fb24c2da28 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -178,12 +178,12 @@ static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter) return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object); } -static Base *rna_Scene_link_object(Scene *scene, ReportList *reports, Object *ob) +static Base *rna_Scene_object_link(Scene *scene, ReportList *reports, Object *ob) { Base *base; if (ob->type != OB_EMPTY && ob->data==NULL) { - BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is not an Empty type and has no Object Data set."); + BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is not an Empty type and has no Object Data set.", ob->id.name+2); return NULL; } @@ -204,7 +204,7 @@ static Base *rna_Scene_link_object(Scene *scene, ReportList *reports, Object *ob return base; } -static void rna_Scene_unlink_object(Scene *scene, bContext *C, ReportList *reports, Object *ob) +static void rna_Scene_object_unlink(Scene *scene, bContext *C, ReportList *reports, Object *ob) { Base *base= object_in_scene(ob, scene); if (!base) { @@ -2604,7 +2604,7 @@ static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_sdna(srna, "Scene"); RNA_def_struct_ui_text(srna, "Scene Objects", "Collection of scene objects"); - func= RNA_def_function(srna, "link", "rna_Scene_link_object"); + func= RNA_def_function(srna, "link", "rna_Scene_object_link"); RNA_def_function_ui_description(func, "Link object to scene."); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene."); @@ -2612,7 +2612,7 @@ static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop) parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base."); RNA_def_function_return(func, parm); - func= RNA_def_function(srna, "unlink", "rna_Scene_unlink_object"); + func= RNA_def_function(srna, "unlink", "rna_Scene_object_unlink"); RNA_def_function_ui_description(func, "Unlink object from scene."); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene."); diff --git a/source/blender/python/doc/sphinx_doc_gen.py b/source/blender/python/doc/sphinx_doc_gen.py index 701aad651cf..944dbb082a6 100644 --- a/source/blender/python/doc/sphinx_doc_gen.py +++ b/source/blender/python/doc/sphinx_doc_gen.py @@ -277,6 +277,8 @@ def rna2sphinx(BASEPATH): fw("\n") fw("An introduction to blender and python can be found at \n") fw("\n") + fw("`A PDF version of this document is also available `__\n") + fw("\n") fw(".. warning:: The Python API in Blender is **UNSTABLE**, It should only be used for testing, any script written now may break in future releases.\n") fw(" \n") fw(" The following areas are subject to change.\n") diff --git a/source/blender/python/doc/sphinx_doc_gen.sh b/source/blender/python/doc/sphinx_doc_gen.sh new file mode 100644 index 00000000000..3f5460a0626 --- /dev/null +++ b/source/blender/python/doc/sphinx_doc_gen.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# run from the blender source dir +# bash source/blender/python/doc/sphinx_doc_gen.sh +# ssh upload means you need a login into the server + +BLENDER="./blender.bin" +SSH_HOST="ideasman42@emo.blender.org" +SSH_UPLOAD="/data/www/vhosts/www.blender.org/documentation/250PythonDoc" + +# clear doc dir +rm -rf ./source/blender/python/doc/sphinx-in ./source/blender/python/doc/sphinx-out +$BLENDER -b -P ./source/blender/python/doc/sphinx_doc_gen.py + +# html +sphinx-build source/blender/python/doc/sphinx-in source/blender/python/doc/sphinx-out +cp source/blender/python/doc/sphinx-out/contents.html source/blender/python/doc/sphinx-out/index.html +ssh ideasman42@emo.blender.org 'rm -rf '$SSH_UPLOAD'/*' +rsync --progress -avze "ssh -p 22" /b/source/blender/python/doc/sphinx-out/* $SSH_HOST:$SSH_UPLOAD/ + +# pdf +sphinx-build -b latex source/blender/python/doc/sphinx-in source/blender/python/doc/sphinx-out +cd source/blender/python/doc/sphinx-out +make +cd ../../../../../ +rsync --progress -avze "ssh -p 22" source/blender/python/doc/sphinx-out/contents.pdf $SSH_HOST:$SSH_UPLOAD/blender_python_reference_250.pdf diff --git a/source/blender/python/generic/IDProp.c b/source/blender/python/generic/IDProp.c index eb883be5a56..f7eb800ef23 100644 --- a/source/blender/python/generic/IDProp.c +++ b/source/blender/python/generic/IDProp.c @@ -24,10 +24,8 @@ */ #include "BKE_idprop.h" - #include "IDProp.h" - -#define BSTR_EQ(a, b) (*(a) == *(b) && !strcmp(a, b)) +#include "MEM_guardedalloc.h" /*** Function to wrap ID properties ***/ PyObject *BPy_Wrap_IDProperty(ID *id, IDProperty *prop, IDProperty *parent); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index c9906bb1599..dcbdc6d64d4 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -359,7 +359,7 @@ static PyObject *pyrna_struct_repr( BPy_StructRNA *self ) return pyob; } - return PyUnicode_FromFormat( "", RNA_struct_identifier(self->ptr.type)); + return PyUnicode_FromFormat( "", RNA_struct_identifier(self->ptr.type), self->ptr.data); } static PyObject *pyrna_prop_repr( BPy_PropertyRNA *self ) @@ -1663,8 +1663,9 @@ int pyrna_struct_keyframe_parse(PointerRNA *ptr, PyObject *args, char *error_pre { char *path; PropertyRNA *prop; + int array_len; - if (!PyArg_ParseTuple(args, "s|if", &path, &index, &cfra)) { + if (!PyArg_ParseTuple(args, "s|if", &path, index, cfra)) { PyErr_Format(PyExc_TypeError, "%.200s expected a string and optionally an int and float arguments", error_prefix); return -1; } @@ -1693,6 +1694,12 @@ int pyrna_struct_keyframe_parse(PointerRNA *ptr, PyObject *args, char *error_pre return -1; } + array_len= RNA_property_array_length(ptr, prop); + if((*index) != -1 && (*index) >= array_len) { + PyErr_Format( PyExc_TypeError, "%.200s index out of range \"%s\", given %d, array length is %d", error_prefix, path, *index, array_len); + return -1; + } + if(*cfra==FLT_MAX) *cfra= CTX_data_scene(BPy_GetContext())->r.cfra; diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index fc6433b95b9..4f9218cc887 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -225,7 +225,6 @@ void ED_mesh_transform(struct Mesh *me, float *mat){} void ED_mesh_update(struct Mesh *mesh, struct bContext *C){} int ED_mesh_color_add(struct bContext *C, struct Scene *scene, struct Object *ob, struct Mesh *me){return 0;} int ED_mesh_uv_texture_add(struct bContext *C, struct Scene *scene, struct Object *ob, struct Mesh *me){return 0;} -void ED_object_apply_obmat(struct Object *ob){} void ED_object_constraint_dependency_update(struct Scene *scene, struct Object *ob){} void ED_object_constraint_update(struct Object *ob){} struct bDeformGroup *ED_vgroup_add_name(struct Object *ob, char *name){return (struct bDeformGroup *) NULL;} diff --git a/source/creator/creator.c b/source/creator/creator.c index 703ed09c976..7eb8f36e4d8 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -162,6 +162,7 @@ static void blender_esc(int sig) } /* buildinfo can have quotes */ +#ifdef BUILD_DATE static void strip_quotes(char *str) { if(str[0] == '"') { @@ -172,6 +173,7 @@ static void strip_quotes(char *str) } } } +#endif static int print_version(int argc, char **argv, void *data) { From 11b260ee065db2510d5dbf315bed9be0a7bed02b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 20 Mar 2010 16:56:52 +0000 Subject: [PATCH 134/153] warning fix --- source/blender/blenloader/BLO_readfile.h | 2 +- source/blender/blenloader/intern/readfile.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index 811b7e88f82..df7cd25a6db 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -205,7 +205,7 @@ int BLO_has_bfile_extension(char *str); /* return ok when a blenderfile, in dir is the filename, * in group the type of libdata */ -int BLO_is_a_library(char *path, char *dir, char *group); +int BLO_is_a_library(const char *path, char *dir, char *group); struct Main* BLO_library_append_begin(const struct bContext *C, BlendHandle** bh, char *dir); void BLO_library_append_named_part(const struct bContext *C, struct Main *mainl, BlendHandle** bh, char *name, int idcode, short flag); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 747920e68ce..1fbf6e93617 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1070,7 +1070,7 @@ int BLO_has_bfile_extension(char *str) return (BLI_testextensie(str, ".ble") || BLI_testextensie(str, ".blend")||BLI_testextensie(str, ".blend.gz")); } -int BLO_is_a_library(char *path, char *dir, char *group) +int BLO_is_a_library(const char *path, char *dir, char *group) { /* return ok when a blenderfile, in dir is the filename, * in group the type of libdata @@ -1087,7 +1087,7 @@ int BLO_is_a_library(char *path, char *dir, char *group) dir[len-1]= 0; /* Find the last slash */ - fd= (strrchr(dir, '/')>strrchr(dir, '\\'))?strrchr(dir, '/'):strrchr(dir, '\\'); + fd= BLI_last_slash(dir); if(fd==0) return 0; *fd= 0; @@ -1099,7 +1099,7 @@ int BLO_is_a_library(char *path, char *dir, char *group) char *gp = fd+1; // in case we have a .blend file, gp points to the group /* Find the last slash */ - fd= (strrchr(dir, '/')>strrchr(dir, '\\'))?strrchr(dir, '/'):strrchr(dir, '\\'); + fd= BLI_last_slash(dir); if (!fd || !BLO_has_bfile_extension(fd+1)) return 0; /* now we know that we are in a blend file and it is safe to From 66ccd94e3fa6a83555a6f7dd9dc1a78d66cd0c60 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 20 Mar 2010 18:03:59 +0000 Subject: [PATCH 135/153] patch #21680 from Richard Olsson wm.invoke_props_dialog() This is so python scripts can have popups which do not redo all the time. --- source/blender/makesrna/intern/rna_wm_api.c | 30 +++++--- source/blender/windowmanager/WM_api.h | 3 +- .../windowmanager/intern/wm_operators.c | 71 ++++++++++++++++++- 3 files changed, 93 insertions(+), 11 deletions(-) diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c index 6817f7a0fc6..66b620b106b 100644 --- a/source/blender/makesrna/intern/rna_wm_api.c +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -158,7 +158,11 @@ static int rna_event_add_modal_handler(struct bContext *C, struct wmOperator *op #else -static void rna_generic_op_invoke(FunctionRNA *func, int use_event, int use_ret) +#define WM_GEN_INVOKE_EVENT (1<<0) +#define WM_GEN_INVOKE_SIZE (1<<1) +#define WM_GEN_INVOKE_RETURN (1<<2) + +static void rna_generic_op_invoke(FunctionRNA *func, int flag) { PropertyRNA *parm; @@ -166,12 +170,17 @@ static void rna_generic_op_invoke(FunctionRNA *func, int use_event, int use_ret) parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call."); RNA_def_property_flag(parm, PROP_REQUIRED); - if(use_event) { + if(flag & WM_GEN_INVOKE_EVENT) { parm= RNA_def_pointer(func, "event", "Event", "", "Event."); RNA_def_property_flag(parm, PROP_REQUIRED); } - if(use_ret) { + if(flag & WM_GEN_INVOKE_SIZE) { + parm= RNA_def_int(func, "width", 300, 0, INT_MAX, "", "Width of the popup.", 0, INT_MAX); + parm= RNA_def_int(func, "height", 20, 0, INT_MAX, "", "Height of the popup.", 0, INT_MAX); + } + + if(flag & WM_GEN_INVOKE_RETURN) { parm= RNA_def_enum(func, "result", operator_return_items, 0, "result", ""); RNA_def_property_flag(parm, PROP_ENUM_FLAG); RNA_def_function_return(func, parm); @@ -185,7 +194,7 @@ void RNA_api_wm(StructRNA *srna) func= RNA_def_function(srna, "add_fileselect", "WM_event_add_fileselect"); RNA_def_function_ui_description(func, "Show up the file selector."); - rna_generic_op_invoke(func, 0, 0); + rna_generic_op_invoke(func, 0); func= RNA_def_function(srna, "add_keyconfig", "WM_keyconfig_add_user"); parm= RNA_def_string(func, "name", "", 0, "Name", ""); @@ -206,18 +215,21 @@ void RNA_api_wm(StructRNA *srna) /* invoke functions, for use with python */ func= RNA_def_function(srna, "invoke_props_popup", "WM_operator_props_popup"); RNA_def_function_ui_description(func, "Operator popup invoke."); - rna_generic_op_invoke(func, 1, 1); + rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT|WM_GEN_INVOKE_RETURN); + + /* invoked dialog opens popup with OK button, does not auto-exec operator. */ + func= RNA_def_function(srna, "invoke_props_dialog", "WM_operator_props_dialog_popup"); + RNA_def_function_ui_description(func, "Operator dialog (non-autoexec popup) invoke."); + rna_generic_op_invoke(func, WM_GEN_INVOKE_SIZE|WM_GEN_INVOKE_RETURN); /* invoke enum */ func= RNA_def_function(srna, "invoke_search_popup", "rna_Operator_enum_search_invoke"); - rna_generic_op_invoke(func, 0, 0); + rna_generic_op_invoke(func, 0); /* invoke functions, for use with python */ func= RNA_def_function(srna, "invoke_popup", "WM_operator_ui_popup"); RNA_def_function_ui_description(func, "Operator popup invoke."); - rna_generic_op_invoke(func, 0, 0); - parm= RNA_def_int(func, "width", 300, 0, INT_MAX, "", "Width of the popup.", 0, INT_MAX); - parm= RNA_def_int(func, "height", 20, 0, INT_MAX, "", "Height of the popup.", 0, INT_MAX); + rna_generic_op_invoke(func, WM_GEN_INVOKE_SIZE|WM_GEN_INVOKE_RETURN); } void RNA_api_operator(StructRNA *srna) diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 07f1368db23..70c0efd6a53 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -190,8 +190,9 @@ int WM_operator_filesel (struct bContext *C, struct wmOperator *op, struct wm int WM_operator_winactive (struct bContext *C); /* invoke callback, exec + redo popup */ int WM_operator_props_popup (struct bContext *C, struct wmOperator *op, struct wmEvent *event); +int WM_operator_props_dialog_popup (struct bContext *C, struct wmOperator *op, int width, int height); int WM_operator_redo_popup (struct bContext *C, struct wmOperator *op); -void WM_operator_ui_popup (struct bContext *C, struct wmOperator *op, int width, int height); +int WM_operator_ui_popup (struct bContext *C, struct wmOperator *op, int width, int height); int WM_operator_confirm_message(struct bContext *C, struct wmOperator *op, char *message); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 3a251ecd491..2833a0135fb 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -910,6 +910,60 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op) return block; } +/* Only invoked by OK button in popups created with wm_block_create_dialog() */ +static void dialog_exec_cb(bContext *C, void *arg1, void *arg2) +{ + wmOperator *op= arg1; + uiBlock *block= arg2; + + WM_operator_call(C, op); + + uiPupBlockClose(C, block); +} + +/* Dialogs are popups that require user verification (click OK) before exec */ +static uiBlock *wm_block_create_dialog(bContext *C, ARegion *ar, void *userData) +{ + struct { wmOperator *op; int width; int height; } * data = userData; + wmWindowManager *wm= CTX_wm_manager(C); + wmOperator *op= data->op; + PointerRNA ptr; + uiBlock *block; + uiLayout *layout; + uiBut *btn; + uiStyle *style= U.uistyles.first; + int columns= 2; + + block = uiBeginBlock(C, ar, "operator dialog", UI_EMBOSS); + uiBlockClearFlag(block, UI_BLOCK_LOOP); + uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT); + + if (!op->properties) { + IDPropertyTemplate val = {0}; + op->properties= IDP_New(IDP_GROUP, val, "wmOperatorProperties"); + } + + RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); + layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, data->width, data->height, style); + uiItemL(layout, op->type->name, 0); + + if (op->type->ui) { + op->layout= layout; + op->type->ui((bContext*)C, op); + op->layout= NULL; + } + else + uiDefAutoButsRNA(C, layout, &ptr, columns); + + /* Create OK button, the callback of which will execute op */ + btn= uiDefBut(block, BUT, 0, "OK", 0, 0, 0, 20, NULL, 0, 0, 0, 0, ""); + uiButSetFunc(btn, dialog_exec_cb, op, block); + + uiPopupBoundsBlock(block, 4.0f, 0, 0); + uiEndBlock(C, block); + + return block; +} static uiBlock *wm_operator_create_ui(bContext *C, ARegion *ar, void *userData) { @@ -958,13 +1012,28 @@ int WM_operator_props_popup(bContext *C, wmOperator *op, wmEvent *event) return retval; } -void WM_operator_ui_popup(bContext *C, wmOperator *op, int width, int height) +int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width, int height) +{ + struct { wmOperator *op; int width; int height; } data; + + data.op= op; + data.width= width; + data.height= height; + + /* op is not executed until popup OK but is clicked */ + uiPupBlock(C, wm_block_create_dialog, &data); + + return OPERATOR_RUNNING_MODAL; +} + +int WM_operator_ui_popup(bContext *C, wmOperator *op, int width, int height) { struct { wmOperator *op; int width; int height; } data; data.op = op; data.width = width; data.height = height; uiPupBlock(C, wm_operator_create_ui, &data); + return OPERATOR_RUNNING_MODAL; } int WM_operator_redo_popup(bContext *C, wmOperator *op) From 07b547980d14d0c4468bb37fb0e777a802275ff3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 20 Mar 2010 18:52:03 +0000 Subject: [PATCH 136/153] remove unused includes for blenlib, left ifdef's for non linux os's alone. --- source/blender/blenlib/intern/BLI_dynstr.c | 2 -- source/blender/blenlib/intern/BLI_ghash.c | 7 ------ source/blender/blenlib/intern/BLI_heap.c | 1 - source/blender/blenlib/intern/BLI_kdopbvh.c | 4 ---- source/blender/blenlib/intern/BLI_kdtree.c | 3 --- source/blender/blenlib/intern/BLI_linklist.c | 1 - source/blender/blenlib/intern/BLI_memarena.c | 2 -- source/blender/blenlib/intern/BLI_mempool.c | 2 -- source/blender/blenlib/intern/DLRB_tree.c | 6 ----- source/blender/blenlib/intern/bpath.c | 9 -------- source/blender/blenlib/intern/dynamiclist.c | 1 - source/blender/blenlib/intern/dynlib.c | 4 ++-- source/blender/blenlib/intern/fileops.c | 4 ---- source/blender/blenlib/intern/freetypefont.c | 10 ++++---- source/blender/blenlib/intern/jitter.c | 3 --- source/blender/blenlib/intern/math_base.c | 4 ---- .../blender/blenlib/intern/math_base_inline.c | 1 - source/blender/blenlib/intern/math_color.c | 4 ---- source/blender/blenlib/intern/math_geom.c | 4 ---- source/blender/blenlib/intern/math_matrix.c | 4 ---- source/blender/blenlib/intern/math_rotation.c | 4 ---- source/blender/blenlib/intern/math_vector.c | 4 ---- source/blender/blenlib/intern/noise.c | 1 - source/blender/blenlib/intern/path_util.c | 23 ++++--------------- source/blender/blenlib/intern/pbvh.c | 6 ----- source/blender/blenlib/intern/rct.c | 1 - source/blender/blenlib/intern/scanfill.c | 8 ------- source/blender/blenlib/intern/storage.c | 2 -- source/blender/blenlib/intern/string.c | 1 - source/blender/blenlib/intern/threads.c | 5 ---- source/blender/blenlib/intern/time.c | 3 +-- source/blender/blenlib/intern/voxel.c | 1 - 32 files changed, 12 insertions(+), 123 deletions(-) diff --git a/source/blender/blenlib/intern/BLI_dynstr.c b/source/blender/blenlib/intern/BLI_dynstr.c index 4b7b61e64d9..5b61a86305b 100644 --- a/source/blender/blenlib/intern/BLI_dynstr.c +++ b/source/blender/blenlib/intern/BLI_dynstr.c @@ -29,8 +29,6 @@ */ #include -#include -#include #include #include "MEM_guardedalloc.h" diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index 23200680d5d..b95f276a702 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -28,17 +28,10 @@ * A general (pointer -> pointer) hash table ADT */ -#include -#include -#include "MEM_guardedalloc.h" #include "BLI_ghash.h" -#include "BLI_mempool.h" - #include "BLO_sys_types.h" // for intptr_t support -#include "BKE_utildefines.h" - #ifdef HAVE_CONFIG_H #include #endif diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c index 196c9ed284c..6c4e568c380 100644 --- a/source/blender/blenlib/intern/BLI_heap.c +++ b/source/blender/blenlib/intern/BLI_heap.c @@ -28,7 +28,6 @@ * A heap / priority queue ADT. */ -#include #include #include "MEM_guardedalloc.h" diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 7118b804cad..bba9b1793c7 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -26,10 +26,6 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include "math.h" -#include -#include -#include #include #include "MEM_guardedalloc.h" diff --git a/source/blender/blenlib/intern/BLI_kdtree.c b/source/blender/blenlib/intern/BLI_kdtree.c index 38b4d7a54d2..cf94a0c9ffe 100644 --- a/source/blender/blenlib/intern/BLI_kdtree.c +++ b/source/blender/blenlib/intern/BLI_kdtree.c @@ -28,9 +28,6 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include -#include -#include #include "MEM_guardedalloc.h" diff --git a/source/blender/blenlib/intern/BLI_linklist.c b/source/blender/blenlib/intern/BLI_linklist.c index 4631d9e6bf2..f9c5fc58a63 100644 --- a/source/blender/blenlib/intern/BLI_linklist.c +++ b/source/blender/blenlib/intern/BLI_linklist.c @@ -29,7 +29,6 @@ */ #include "MEM_guardedalloc.h" -#include "BLI_blenlib.h" #include "BLI_linklist.h" #include "BLI_memarena.h" diff --git a/source/blender/blenlib/intern/BLI_memarena.c b/source/blender/blenlib/intern/BLI_memarena.c index 6c87f0914f9..07e22b30fcc 100644 --- a/source/blender/blenlib/intern/BLI_memarena.c +++ b/source/blender/blenlib/intern/BLI_memarena.c @@ -28,11 +28,9 @@ * Efficient memory allocation for lots of similar small chunks. */ -#include #include "MEM_guardedalloc.h" -#include "BLI_blenlib.h" #include "BLI_memarena.h" #include "BLI_linklist.h" diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c index 7972000c4d6..26d6f5af147 100644 --- a/source/blender/blenlib/intern/BLI_mempool.c +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -32,8 +32,6 @@ #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" -#include "DNA_listBase.h" -#include "BLI_linklist.h" #include typedef struct BLI_freenode{ diff --git a/source/blender/blenlib/intern/DLRB_tree.c b/source/blender/blenlib/intern/DLRB_tree.c index 9b38289f15b..69c9cc7e522 100644 --- a/source/blender/blenlib/intern/DLRB_tree.c +++ b/source/blender/blenlib/intern/DLRB_tree.c @@ -25,17 +25,11 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include -#include -#include - #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" #include "BLI_dlrbTree.h" -#include "DNA_listBase.h" - /* *********************************************** */ /* Tree API */ diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 8e294395c86..f7c16a0a8b2 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -27,12 +27,7 @@ */ #include -#include -#include -#include -#include -#include #include /* path/file handeling stuff */ @@ -46,13 +41,9 @@ #include "MEM_guardedalloc.h" -#include "DNA_ID.h" /* Library */ -#include "DNA_customdata_types.h" -#include "DNA_image_types.h" #include "DNA_mesh_types.h" #include "DNA_scene_types.h" /* to get the current frame */ #include "DNA_sequence_types.h" -#include "DNA_sound_types.h" #include "DNA_vfont_types.h" #include "DNA_windowmanager_types.h" diff --git a/source/blender/blenlib/intern/dynamiclist.c b/source/blender/blenlib/intern/dynamiclist.c index 4bcccab4b18..48ba8247ea9 100644 --- a/source/blender/blenlib/intern/dynamiclist.c +++ b/source/blender/blenlib/intern/dynamiclist.c @@ -34,7 +34,6 @@ #include "MEM_guardedalloc.h" -#include "DNA_listBase.h" #include "BLI_listbase.h" #include "BLI_dynamiclist.h" diff --git a/source/blender/blenlib/intern/dynlib.c b/source/blender/blenlib/intern/dynlib.c index eb41916c619..cc681a4c7c7 100644 --- a/source/blender/blenlib/intern/dynlib.c +++ b/source/blender/blenlib/intern/dynlib.c @@ -28,8 +28,6 @@ */ #include -#include -#include #include "../PIL_dynlib.h" @@ -47,6 +45,8 @@ */ #ifdef WIN32 +#include +#include #include diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 3503164ea56..73434c548a0 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -29,7 +29,6 @@ #include #include -#include #include #include @@ -49,9 +48,6 @@ #include "BLI_blenlib.h" -#include "BLI_storage.h" -#include "BLI_fileops.h" -#include "BLI_callbacks.h" #include "BKE_utildefines.h" diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c index d06ca7b44d6..9227803b681 100644 --- a/source/blender/blenlib/intern/freetypefont.c +++ b/source/blender/blenlib/intern/freetypefont.c @@ -36,10 +36,11 @@ #include #include FT_FREETYPE_H -#include FT_GLYPH_H -#include FT_BBOX_H -#include FT_SIZES_H -#include +/* not needed yet */ +// #include FT_GLYPH_H +// #include FT_BBOX_H +// #include FT_SIZES_H +// #include #include "MEM_guardedalloc.h" @@ -49,7 +50,6 @@ //XXX #include "BIF_toolbox.h" -#include "BKE_global.h" #include "BKE_font.h" #include "BKE_utildefines.h" diff --git a/source/blender/blenlib/intern/jitter.c b/source/blender/blenlib/intern/jitter.c index 12b7482897a..dfc554394d6 100644 --- a/source/blender/blenlib/intern/jitter.c +++ b/source/blender/blenlib/intern/jitter.c @@ -30,13 +30,10 @@ */ #include -#include #include #include "MEM_guardedalloc.h" -#include "BLI_math.h" #include "BLI_rand.h" -#include "BLI_jitter.h" void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1) diff --git a/source/blender/blenlib/intern/math_base.c b/source/blender/blenlib/intern/math_base.c index a0d878f3a03..8301f790614 100644 --- a/source/blender/blenlib/intern/math_base.c +++ b/source/blender/blenlib/intern/math_base.c @@ -25,10 +25,6 @@ * ***** END GPL LICENSE BLOCK ***** * */ -#include -#include -#include -#include #include "BLI_math.h" diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c index fa0ca097ef1..b364ff73e4f 100644 --- a/source/blender/blenlib/intern/math_base_inline.c +++ b/source/blender/blenlib/intern/math_base_inline.c @@ -26,7 +26,6 @@ * */ #include -#include #include #include #include diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index fc6e722afeb..633585a3336 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -25,10 +25,6 @@ * ***** END GPL LICENSE BLOCK ***** * */ -#include -#include -#include -#include #include "BLI_math.h" diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index d12aa1051dc..f2454f05977 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -25,10 +25,6 @@ * ***** END GPL LICENSE BLOCK ***** * */ -#include -#include -#include -#include #include "BLI_math.h" #include "BLI_memarena.h" diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index c970f2132c3..b3dd5a09f71 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -25,10 +25,6 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include -#include -#include -#include #include "BLI_math.h" diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index a92f80e35c7..b6dc0ca06cd 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -25,10 +25,6 @@ * ***** END GPL LICENSE BLOCK ***** * */ -#include -#include -#include -#include #include "BLI_math.h" diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c index 2452de0dc4c..97f5ea73ea9 100644 --- a/source/blender/blenlib/intern/math_vector.c +++ b/source/blender/blenlib/intern/math_vector.c @@ -25,10 +25,6 @@ * ***** END GPL LICENSE BLOCK ***** * */ -#include -#include -#include -#include #include "BLI_math.h" diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c index 343589d9a41..d0ce193e0e0 100644 --- a/source/blender/blenlib/intern/noise.c +++ b/source/blender/blenlib/intern/noise.c @@ -35,7 +35,6 @@ #endif #include -#include "BLI_blenlib.h" #ifdef HAVE_CONFIG_H #include diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 3fe9a387a54..00cb6764b60 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -29,20 +29,14 @@ * various string, file, list operations. */ -#include -#include #include #include #include -#include -#include /* for log10 */ #include "MEM_guardedalloc.h" -#include "DNA_listBase.h" #include "DNA_userdef_types.h" -#include "BLI_dynamiclist.h" #include "BLI_fileops.h" #include "BLI_path_util.h" #include "BLI_string.h" @@ -58,13 +52,9 @@ #include #endif -#ifndef WIN32 -#include -#else -#include -#endif #ifdef WIN32 +#include #ifdef _WIN32_IE #undef _WIN32_IE @@ -75,12 +65,7 @@ #include "BLI_winstuff.h" -#endif - - -#ifndef WIN32 -#include -#endif +#else /* non windows */ #ifdef __APPLE__ #include @@ -91,6 +76,8 @@ #include "binreloc.h" #endif +#endif /* WIN32 */ + /* local */ static int add_win32_extension(char *name); @@ -1512,8 +1499,6 @@ char* BLI_getbundle(void) { #endif #ifdef WITH_ICONV -#include "iconv.h" -#include "localcharset.h" void BLI_string_to_utf8(char *original, char *utf_8, const char *code) { diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c index 1cc4f4edfcd..c21f086156e 100644 --- a/source/blender/blenlib/intern/pbvh.c +++ b/source/blender/blenlib/intern/pbvh.c @@ -20,11 +20,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include -#include -#include -#include "MEM_guardedalloc.h" #include "DNA_meshdata_types.h" @@ -33,8 +29,6 @@ #include "BLI_pbvh.h" #include "BKE_DerivedMesh.h" -#include "BKE_mesh.h" -#include "BKE_utildefines.h" #include "gpu_buffers.h" diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c index 959d8be466f..4506115cd8c 100644 --- a/source/blender/blenlib/intern/rct.c +++ b/source/blender/blenlib/intern/rct.c @@ -36,7 +36,6 @@ */ #include "DNA_vec_types.h" -#include "BLI_blenlib.h" #ifdef HAVE_CONFIG_H #include diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c index efcc767fd18..9870951d4d3 100644 --- a/source/blender/blenlib/intern/scanfill.c +++ b/source/blender/blenlib/intern/scanfill.c @@ -28,20 +28,12 @@ * (uit traces) maart 95 */ -#include -#include -#include - #include "MEM_guardedalloc.h" -#include "DNA_listBase.h" -#include "DNA_mesh_types.h" #include "BLI_editVert.h" #include "BLI_listbase.h" #include "BLI_math.h" -#include "BLI_scanfill.h" -#include "BLI_callbacks.h" #ifdef HAVE_CONFIG_H #include diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 139bb551926..086f20b7e21 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -90,8 +90,6 @@ #include "BLI_listbase.h" #include "BLI_linklist.h" -#include "BLI_path_util.h" -#include "BLI_storage.h" #include "BLI_storage_types.h" #include "BLI_string.h" #include "BKE_utildefines.h" diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index dd1d0a3bd4f..fd0b7e13a66 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -32,7 +32,6 @@ * */ -#include #include #include #include diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index be016456fc4..351e0be1102 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -28,15 +28,10 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include -#include -#include -#include #include #include "MEM_guardedalloc.h" -#include "DNA_listBase.h" #include "BLI_blenlib.h" #include "BLI_gsqueue.h" diff --git a/source/blender/blenlib/intern/time.c b/source/blender/blenlib/intern/time.c index b0a284c4074..304884ba8ca 100644 --- a/source/blender/blenlib/intern/time.c +++ b/source/blender/blenlib/intern/time.c @@ -26,14 +26,13 @@ * * ***** END GPL LICENSE BLOCK ***** */ -#include "PIL_time.h" #ifdef HAVE_CONFIG_H #include #endif #ifdef WIN32 - +#include "PIL_time.h" #include double PIL_check_seconds_timer(void) diff --git a/source/blender/blenlib/intern/voxel.c b/source/blender/blenlib/intern/voxel.c index 78267528e21..302d721264d 100644 --- a/source/blender/blenlib/intern/voxel.c +++ b/source/blender/blenlib/intern/voxel.c @@ -25,7 +25,6 @@ * * ***** END GPL LICENSE BLOCK ***** */ -#include #include "BLI_voxel.h" From be8c398191ea7af2b44b77fa602bbcef0d64f48b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 20 Mar 2010 19:22:34 +0000 Subject: [PATCH 137/153] - submit docs now uses the new dialog with an OK button - submitting operator docs sent them twice. --- release/scripts/op/wm.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py index 0a333db421b..de3ca919efe 100644 --- a/release/scripts/op/wm.py +++ b/release/scripts/op/wm.py @@ -500,7 +500,8 @@ class WM_OT_doc_edit(bpy.types.Operator): class_name, class_prop = doc_id.split('.') if not doc_new: - return {'RUNNING_MODAL'} + self.report({'ERROR'}, "No input given for '%s'" % doc_id) + return {'CANCELLED'} # check if this is an operator op_name = class_name.upper() + '_OT_' + class_prop @@ -517,10 +518,6 @@ class WM_OT_doc_edit(bpy.types.Operator): print("op - old:'%s' -> new:'%s'" % (doc_orig, doc_new)) upload["title"] = 'OPERATOR %s:%s' % (doc_id, doc_orig) - upload["description"] = doc_new - - self._send_xmlrpc(upload) - else: rna = getattr(bpy.types, class_name).bl_rna doc_orig = rna.properties[class_prop].description @@ -536,9 +533,15 @@ class WM_OT_doc_edit(bpy.types.Operator): return {'FINISHED'} + def draw(self, context): + layout = self.layout + props = self.properties + layout.label(props, text="Descriptor ID: '%s'" % props.doc_id) + layout.prop(props, "doc_new", text="") + def invoke(self, context, event): wm = context.manager - return wm.invoke_props_popup(self, event) + return wm.invoke_props_dialog(self, event, width=600) class WM_OT_reload_scripts(bpy.types.Operator): From b6a111a6db9dd67e4aabaa366e5c2204e222e7cc Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sat, 20 Mar 2010 19:51:38 +0000 Subject: [PATCH 138/153] Hopefully another fix for MSVC... --- source/blender/blenlib/BLI_math_base.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index c143c44c594..28c5026910f 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -69,6 +69,9 @@ extern "C" { #ifndef M_LN10 #define M_LN10 2.30258509299404568402 #endif +#ifndef NAN +#define NAN (0.0/0.0) +#endif #ifndef sqrtf #define sqrtf(a) ((float)sqrt(a)) @@ -120,6 +123,7 @@ extern "C" { #ifndef FREE_WINDOWS #define isnan(n) _isnan(n) #define finite _finite +#define isfinite(n) _finite(n) #endif #endif From d904da1d03f2312944dc1b66215326aeefc0ec55 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sat, 20 Mar 2010 20:00:15 +0000 Subject: [PATCH 139/153] Yet another try to get NaN working on MSVC. --- source/blender/blenlib/BLI_math_base.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index 28c5026910f..cf3fda8ad36 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -70,7 +70,8 @@ extern "C" { #define M_LN10 2.30258509299404568402 #endif #ifndef NAN -#define NAN (0.0/0.0) +static __const char __qnan__[8] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f }; +#define NAN (*(__const double *) __qnan__) #endif #ifndef sqrtf From ba2cfeefd0a6feb1b0a7a7eb2a00f5c265fd180f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 20 Mar 2010 23:31:48 +0000 Subject: [PATCH 140/153] drawing text in a byte buffer wasnt working (probably never tested since float buffer is used for rendering) --- source/blender/blenfont/intern/blf_font.c | 56 +++++++++++++---------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 98044b965e1..35d7b6af19c 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -226,19 +226,21 @@ void blf_font_buffer(FontBLF *font, char *str) for (y= 0; y < g->height; y++) { for (x= 0; x < g->width; x++) { - fbuf= font->b_fbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw)); - data= g->bitmap + x + (yb * g->pitch); - a= data[0]/255.0f; + + a= *(g->bitmap + x + (yb * g->pitch)) / 255.0f; - if (a == 1.0) { - fbuf[0]= font->b_col[0]; - fbuf[1]= font->b_col[1]; - fbuf[2]= font->b_col[2]; - } - else { - fbuf[0]= (font->b_col[0]*a) + (fbuf[0] * (1-a)); - fbuf[1]= (font->b_col[1]*a) + (fbuf[1] * (1-a)); - fbuf[2]= (font->b_col[2]*a) + (fbuf[2] * (1-a)); + if(a > 0.0f) { + fbuf= font->b_fbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw)); + if (a >= 1.0f) { + fbuf[0]= font->b_col[0]; + fbuf[1]= font->b_col[1]; + fbuf[2]= font->b_col[2]; + } + else { + fbuf[0]= (font->b_col[0]*a) + (fbuf[0] * (1-a)); + fbuf[1]= (font->b_col[1]*a) + (fbuf[1] * (1-a)); + fbuf[2]= (font->b_col[2]*a) + (fbuf[2] * (1-a)); + } } } @@ -252,6 +254,11 @@ void blf_font_buffer(FontBLF *font, char *str) if (font->b_cbuf) { if (chx >= 0 && chx < font->bw && pen_y >= 0 && pen_y < font->bh) { + char b_col_char[3]; + b_col_char[0]= font->b_col[0] * 255; + b_col_char[1]= font->b_col[1] * 255; + b_col_char[2]= font->b_col[2] * 255; + if (g->pitch < 0) yb= 0; else @@ -259,19 +266,20 @@ void blf_font_buffer(FontBLF *font, char *str) for (y= 0; y < g->height; y++) { for (x= 0; x < g->width; x++) { - cbuf= font->b_cbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw)); - data= g->bitmap + x + (yb * g->pitch); - a= data[0]; + a= *(g->bitmap + x + (yb * g->pitch)) / 255.0f; - if (a == 256) { - cbuf[0]= font->b_col[0]; - cbuf[1]= font->b_col[1]; - cbuf[2]= font->b_col[2]; - } - else { - cbuf[0]= (font->b_col[0]*a) + (cbuf[0] * (256-a)); - cbuf[1]= (font->b_col[1]*a) + (cbuf[1] * (256-a)); - cbuf[2]= (font->b_col[2]*a) + (cbuf[2] * (256-a)); + if(a > 0.0f) { + cbuf= font->b_cbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw)); + if (a >= 1.0f) { + cbuf[0]= b_col_char[0]; + cbuf[1]= b_col_char[1]; + cbuf[2]= b_col_char[2]; + } + else { + cbuf[0]= (b_col_char[0]*a) + (cbuf[0] * (1-a)); + cbuf[1]= (b_col_char[1]*a) + (cbuf[1] * (1-a)); + cbuf[2]= (b_col_char[2]*a) + (cbuf[2] * (1-a)); + } } } From b06cdb3dd70890ad6b8458def8b935128272aac5 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sat, 20 Mar 2010 23:36:08 +0000 Subject: [PATCH 141/153] Finally, this should really fix the msvc and old ubuntu compiler problems with NAN and finite. --- source/blender/blenlib/BLI_math_base.h | 5 ++--- source/blender/editors/screen/screen_ops.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index cf3fda8ad36..b080aa6b5f0 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -70,8 +70,8 @@ extern "C" { #define M_LN10 2.30258509299404568402 #endif #ifndef NAN -static __const char __qnan__[8] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f }; -#define NAN (*(__const double *) __qnan__) +static const unsigned long __qnan__ = 0x7fc00000UL; +#define NAN ((const float) __qnan__) #endif #ifndef sqrtf @@ -124,7 +124,6 @@ static __const char __qnan__[8] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f }; #ifndef FREE_WINDOWS #define isnan(n) _isnan(n) #define finite _finite -#define isfinite(n) _finite(n) #endif #endif diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 969b88efc35..31df55b6818 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2411,7 +2411,7 @@ static int screen_animation_step(bContext *C, wmOperator *op, wmEvent *event) if((scene->audio.flag & AUDIO_SYNC) && !(sad->flag & ANIMPLAY_FLAG_REVERSE)) time = sound_sync_scene(scene); - if(isfinite(time)) + if(finite(time)) scene->r.cfra = floor(time * FPS); else { From d55cf90bb6330899b97079c07f8344a804389468 Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Sat, 20 Mar 2010 23:43:50 +0000 Subject: [PATCH 142/153] SVN maintenance. --- source/blender/python/doc/sphinx_doc_gen.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 source/blender/python/doc/sphinx_doc_gen.sh diff --git a/source/blender/python/doc/sphinx_doc_gen.sh b/source/blender/python/doc/sphinx_doc_gen.sh old mode 100644 new mode 100755 From 42a0ef4dcfca7934329cd3c0b911f9d895582efc Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sun, 21 Mar 2010 00:04:50 +0000 Subject: [PATCH 143/153] OK, compiling doesn't mean it runs, now it should really be fixed, as I don't use NAN directly anymore. --- source/blender/blenlib/BLI_math_base.h | 4 ---- source/blender/editors/screen/screen_ops.c | 7 ++----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index b080aa6b5f0..c143c44c594 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -69,10 +69,6 @@ extern "C" { #ifndef M_LN10 #define M_LN10 2.30258509299404568402 #endif -#ifndef NAN -static const unsigned long __qnan__ = 0x7fc00000UL; -#define NAN ((const float) __qnan__) -#endif #ifndef sqrtf #define sqrtf(a) ((float)sqrt(a)) diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 31df55b6818..ddf838f2535 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2401,17 +2401,14 @@ static int screen_animation_step(bContext *C, wmOperator *op, wmEvent *event) ScreenAnimData *sad= wt->customdata; ScrArea *sa; int sync; - float time = NAN; + float time; /* sync, don't sync, or follow scene setting */ if(sad->flag & ANIMPLAY_FLAG_SYNC) sync= 1; else if(sad->flag & ANIMPLAY_FLAG_NO_SYNC) sync= 0; else sync= (scene->flag & SCE_FRAME_DROP); - if((scene->audio.flag & AUDIO_SYNC) && !(sad->flag & ANIMPLAY_FLAG_REVERSE)) - time = sound_sync_scene(scene); - - if(finite(time)) + if((scene->audio.flag & AUDIO_SYNC) && !(sad->flag & ANIMPLAY_FLAG_REVERSE) && finite(time = sound_sync_scene(scene))) scene->r.cfra = floor(time * FPS); else { From 03acdd75e0c75b78bdf5c2c23bcf6c8cf40cb459 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 21 Mar 2010 00:25:52 +0000 Subject: [PATCH 144/153] [#21660] improved UV test grid from shuvro sarker (shuvro) Added text to the patch and made other minor tweaks. moved image generation functions into their own file. --- source/blender/blenkernel/BKE_image.h | 5 + source/blender/blenkernel/intern/image.c | 115 +----- source/blender/blenkernel/intern/image_gen.c | 360 +++++++++++++++++++ source/blender/makesrna/intern/rna_image.c | 3 +- 4 files changed, 378 insertions(+), 105 deletions(-) create mode 100644 source/blender/blenkernel/intern/image_gen.c diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h index d1808366944..df51d017594 100644 --- a/source/blender/blenkernel/BKE_image.h +++ b/source/blender/blenkernel/BKE_image.h @@ -162,6 +162,11 @@ struct Image *BKE_image_copy(struct Image *ima); /* merge source into dest, and free source */ void BKE_image_merge(struct Image *dest, struct Image *source); +/* image_gen.c */ +void BKE_image_buf_fill_color(unsigned char *rect, float *rect_float, int width, int height, float color[4]); +void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int height, int width); +void BKE_image_buf_fill_checker_color(unsigned char *rect, float *rect_float, int height, int width); + #ifdef __cplusplus } #endif diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index f870fc1083b..25a4f9b0a48 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -438,11 +438,8 @@ Image *BKE_add_image_file(const char *name, int frame) static ImBuf *add_ibuf_size(int width, int height, char *name, int floatbuf, short uvtestgrid, float color[4]) { ImBuf *ibuf; - float h=0.0, hoffs=0.0, hue=0.0, s=0.9, v=0.9, r, g, b; unsigned char *rect= NULL; float *rect_float= NULL; - int x, y; - int checkerwidth=32, dark=1; if (floatbuf) { ibuf= IMB_allocImBuf(width, height, 24, IB_rectfloat, 0); @@ -456,107 +453,17 @@ static ImBuf *add_ibuf_size(int width, int height, char *name, int floatbuf, sho strcpy(ibuf->name, "//Untitled"); ibuf->userflags |= IB_BITMAPDIRTY; - if (uvtestgrid) { - /* these two passes could be combined into one, but it's more readable and - * easy to tweak like this, speed isn't really that much of an issue in this situation... */ - - /* checkers */ - for(y=0; y 0) { - rect_float[0] = rect_float[1] = rect_float[2] = 0.25f; - rect_float[3] = 1.0f; - } else { - rect_float[0] = rect_float[1] = rect_float[2] = 0.58f; - rect_float[3] = 1.0f; - } - rect_float+=4; - } - else { - if (dark > 0) { - rect[0] = rect[1] = rect[2] = 64; - rect[3] = 255; - } else { - rect[0] = rect[1] = rect[2] = 150; - rect[3] = 255; - } - rect += 4; - } - } - } - - /* 2nd pass, colored + */ - if (floatbuf) rect_float= (float*)ibuf->rect_float; - else rect= (unsigned char*)ibuf->rect; - - for(y=0; y +#include "BLI_math_color.h" +#include "BLF_api.h" + +void BKE_image_buf_fill_color(unsigned char *rect, float *rect_float, int width, int height, float color[4]) +{ + int x, y; + + /* blank image */ + if(rect_float) { + for(y= 0; y 0) { + rect_float[0]= rect_float[1]= rect_float[2]= 0.25f; + rect_float[3]= 1.0f; + } else { + rect_float[0]= rect_float[1]= rect_float[2]= 0.58f; + rect_float[3]= 1.0f; + } + rect_float+= 4; + } + else { + if (dark > 0) { + rect[0]= rect[1]= rect[2]= 64; + rect[3]= 255; + } else { + rect[0]= rect[1]= rect[2]= 150; + rect[3]= 255; + } + rect+= 4; + } + } + } + + /* 2nd pass, colored + */ + for(y= 0; y Date: Sun, 21 Mar 2010 01:14:04 +0000 Subject: [PATCH 145/153] Fix syntax for ID keyword. --- extern/lzo/minilzo/Makefile | 2 +- release/getversion.py | 2 +- source/blender/blenfont/BLF_api.h | 2 +- source/blender/blenfont/Makefile | 2 +- source/blender/blenfont/intern/Makefile | 2 +- source/blender/blenfont/intern/blf.c | 2 +- source/blender/blenfont/intern/blf_font.c | 2 +- source/blender/blenfont/intern/blf_glyph.c | 2 +- source/blender/blenfont/intern/blf_util.c | 2 +- source/blender/blenkernel/BKE_idprop.h | 2 +- source/blender/blenkernel/BKE_softbody.h | 2 +- source/blender/blenkernel/intern/idprop.c | 2 +- source/blender/blenkernel/intern/image_gen.c | 2 +- source/blender/blenlib/BLI_args.h | 2 +- source/blender/blenlib/BLI_threads.h | 2 +- source/blender/blenlib/intern/BLI_args.c | 2 +- source/blender/blenlib/intern/graph.c | 2 +- source/blender/blenloader/BLO_undofile.h | 2 +- source/blender/blenloader/intern/undofile.c | 2 +- source/blender/editors/animation/anim_deps.c | 2 +- source/blender/editors/animation/anim_ipo_utils.c | 2 +- source/blender/editors/animation/anim_markers.c | 2 +- source/blender/editors/animation/anim_ops.c | 2 +- source/blender/editors/animation/fmodifier_ui.c | 2 +- source/blender/editors/animation/keyframes_edit.c | 2 +- source/blender/editors/animation/keyframes_general.c | 2 +- source/blender/editors/armature/armature_intern.h | 2 +- source/blender/editors/armature/armature_ops.c | 2 +- source/blender/editors/armature/editarmature_retarget.c | 2 +- source/blender/editors/armature/poseUtils.c | 2 +- source/blender/editors/armature/reeb.c | 2 +- source/blender/editors/armature/reeb.h | 2 +- source/blender/editors/curve/curve_intern.h | 2 +- source/blender/editors/curve/curve_ops.c | 2 +- source/blender/editors/gpencil/gpencil_intern.h | 2 +- source/blender/editors/include/BIF_glutil.h | 2 +- source/blender/editors/include/ED_anim_api.h | 2 +- source/blender/editors/include/ED_armature.h | 2 +- source/blender/editors/include/ED_curve.h | 2 +- source/blender/editors/include/ED_fileselect.h | 2 +- source/blender/editors/include/ED_image.h | 2 +- source/blender/editors/include/ED_info.h | 2 +- source/blender/editors/include/ED_keyframes_edit.h | 2 +- source/blender/editors/include/ED_markers.h | 2 +- source/blender/editors/include/ED_mesh.h | 2 +- source/blender/editors/include/ED_node.h | 2 +- source/blender/editors/include/ED_numinput.h | 2 +- source/blender/editors/include/ED_object.h | 2 +- source/blender/editors/include/ED_screen.h | 2 +- source/blender/editors/include/ED_screen_types.h | 2 +- source/blender/editors/include/ED_sculpt.h | 2 +- source/blender/editors/include/ED_sequencer.h | 2 +- source/blender/editors/include/ED_space_api.h | 2 +- source/blender/editors/include/ED_text.h | 2 +- source/blender/editors/include/ED_types.h | 2 +- source/blender/editors/include/ED_util.h | 2 +- source/blender/editors/include/ED_uvedit.h | 2 +- source/blender/editors/include/ED_view3d.h | 2 +- source/blender/editors/include/UI_icons.h | 2 +- source/blender/editors/mesh/editmesh_add.c | 2 +- source/blender/editors/mesh/editmesh_lib.c | 2 +- source/blender/editors/mesh/editmesh_loop.c | 2 +- source/blender/editors/mesh/editmesh_mods.c | 2 +- source/blender/editors/mesh/editmesh_tools.c | 2 +- source/blender/editors/mesh/loopcut.c | 2 +- source/blender/editors/mesh/mesh_intern.h | 2 +- source/blender/editors/mesh/mesh_ops.c | 2 +- source/blender/editors/mesh/meshtools.c | 2 +- source/blender/editors/object/object_bake.c | 2 +- source/blender/editors/object/object_intern.h | 2 +- source/blender/editors/object/object_ops.c | 2 +- source/blender/editors/physics/particle_boids.c | 2 +- source/blender/editors/physics/particle_object.c | 2 +- source/blender/editors/physics/physics_ops.c | 2 +- source/blender/editors/render/render_intern.h | 2 +- source/blender/editors/render/render_internal.c | 2 +- source/blender/editors/render/render_opengl.c | 2 +- source/blender/editors/render/render_ops.c | 2 +- source/blender/editors/render/render_shading.c | 2 +- source/blender/editors/screen/area.c | 2 +- source/blender/editors/screen/screen_context.c | 2 +- source/blender/editors/screen/screen_edit.c | 2 +- source/blender/editors/screen/screen_intern.h | 2 +- source/blender/editors/screen/screen_ops.c | 2 +- source/blender/editors/sculpt_paint/paint_intern.h | 2 +- source/blender/editors/space_action/action_intern.h | 2 +- source/blender/editors/space_action/action_ops.c | 2 +- source/blender/editors/space_action/space_action.c | 2 +- source/blender/editors/space_api/space.c | 2 +- source/blender/editors/space_api/spacetypes.c | 2 +- source/blender/editors/space_buttons/buttons_context.c | 2 +- source/blender/editors/space_buttons/buttons_intern.h | 2 +- source/blender/editors/space_buttons/buttons_ops.c | 2 +- source/blender/editors/space_buttons/space_buttons.c | 2 +- source/blender/editors/space_console/console_intern.h | 2 +- source/blender/editors/space_console/space_console.c | 2 +- source/blender/editors/space_file/file_draw.c | 2 +- source/blender/editors/space_file/file_intern.h | 2 +- source/blender/editors/space_file/file_ops.c | 2 +- source/blender/editors/space_file/space_file.c | 2 +- source/blender/editors/space_graph/graph_buttons.c | 2 +- source/blender/editors/space_graph/graph_intern.h | 2 +- source/blender/editors/space_graph/graph_ops.c | 2 +- source/blender/editors/space_graph/graph_utils.c | 2 +- source/blender/editors/space_graph/space_graph.c | 2 +- source/blender/editors/space_image/image_intern.h | 2 +- source/blender/editors/space_image/space_image.c | 2 +- source/blender/editors/space_info/info_intern.h | 2 +- source/blender/editors/space_logic/logic_intern.h | 2 +- source/blender/editors/space_logic/space_logic.c | 2 +- source/blender/editors/space_nla/nla_buttons.c | 2 +- source/blender/editors/space_nla/nla_channels.c | 2 +- source/blender/editors/space_nla/nla_draw.c | 2 +- source/blender/editors/space_nla/nla_edit.c | 2 +- source/blender/editors/space_nla/nla_intern.h | 2 +- source/blender/editors/space_nla/nla_ops.c | 2 +- source/blender/editors/space_nla/nla_select.c | 2 +- source/blender/editors/space_nla/space_nla.c | 2 +- source/blender/editors/space_node/node_buttons.c | 2 +- source/blender/editors/space_node/node_edit.c | 2 +- source/blender/editors/space_node/node_intern.h | 2 +- source/blender/editors/space_node/node_ops.c | 2 +- source/blender/editors/space_node/node_select.c | 2 +- source/blender/editors/space_node/node_state.c | 2 +- source/blender/editors/space_node/space_node.c | 2 +- source/blender/editors/space_outliner/outliner_intern.h | 2 +- source/blender/editors/space_outliner/outliner_ops.c | 2 +- source/blender/editors/space_script/script_edit.c | 2 +- source/blender/editors/space_script/script_intern.h | 2 +- source/blender/editors/space_script/script_ops.c | 2 +- source/blender/editors/space_script/space_script.c | 2 +- source/blender/editors/space_sequencer/sequencer_intern.h | 2 +- source/blender/editors/space_sequencer/sequencer_ops.c | 2 +- source/blender/editors/space_sequencer/space_sequencer.c | 2 +- source/blender/editors/space_sound/sound_intern.h | 2 +- source/blender/editors/space_sound/space_sound.c | 2 +- source/blender/editors/space_text/space_text.c | 2 +- source/blender/editors/space_text/text_intern.h | 2 +- source/blender/editors/space_time/time_intern.h | 2 +- source/blender/editors/space_time/time_ops.c | 2 +- source/blender/editors/space_userpref/space_userpref.c | 2 +- source/blender/editors/space_userpref/userpref_intern.h | 2 +- source/blender/editors/space_view3d/space_view3d.c | 2 +- source/blender/editors/space_view3d/view3d_buttons.c | 2 +- source/blender/editors/space_view3d/view3d_draw.c | 2 +- source/blender/editors/space_view3d/view3d_edit.c | 2 +- source/blender/editors/space_view3d/view3d_intern.h | 2 +- source/blender/editors/space_view3d/view3d_ops.c | 2 +- source/blender/editors/space_view3d/view3d_select.c | 2 +- source/blender/editors/space_view3d/view3d_toolbar.c | 2 +- source/blender/editors/space_view3d/view3d_view.c | 2 +- source/blender/editors/transform/transform_manipulator.c | 2 +- source/blender/editors/transform/transform_ndofinput.c | 2 +- source/blender/editors/transform/transform_orientations.c | 2 +- source/blender/editors/transform/transform_snap.c | 2 +- source/blender/editors/util/ed_util.c | 2 +- source/blender/editors/util/editmode_undo.c | 2 +- source/blender/editors/util/undo.c | 2 +- source/blender/editors/util/util_intern.h | 2 +- source/blender/editors/uvedit/uvedit_intern.h | 2 +- source/blender/imbuf/intern/IMB_radiance_hdr.h | 2 +- source/blender/imbuf/intern/radiance_hdr.c | 2 +- source/blender/makesrna/intern/rna_animation_api.c | 2 +- source/blender/makesrna/intern/rna_ui_api.c | 2 +- source/blender/nodes/Makefile | 2 +- source/blender/python/generic/IDProp.c | 2 +- source/blender/python/generic/IDProp.h | 2 +- source/blender/python/generic/blf.c | 2 +- source/blender/python/generic/blf.h | 2 +- source/blender/python/intern/bpy.c | 2 +- source/blender/python/intern/bpy.h | 2 +- source/blender/python/intern/bpy_app.c | 2 +- source/blender/python/intern/bpy_driver.c | 2 +- source/blender/python/intern/bpy_interface.c | 2 +- source/blender/python/intern/bpy_rna_callback.c | 2 +- source/blender/python/intern/bpy_rna_callback.h | 2 +- source/blender/python/intern/stubs.c | 2 +- source/blender/render/intern/include/shading.h | 2 +- source/blender/render/intern/source/imagetexture.c | 2 +- source/blender/render/intern/source/shadeinput.c | 2 +- source/blender/render/intern/source/shadeoutput.c | 2 +- source/blender/windowmanager/Makefile | 2 +- source/blender/windowmanager/WM_api.h | 2 +- source/blender/windowmanager/WM_types.h | 2 +- source/blender/windowmanager/intern/wm.c | 2 +- source/blender/windowmanager/intern/wm_apple.c | 2 +- source/blender/windowmanager/intern/wm_cursors.c | 2 +- source/blender/windowmanager/intern/wm_dragdrop.c | 2 +- source/blender/windowmanager/intern/wm_draw.c | 2 +- source/blender/windowmanager/intern/wm_event_system.c | 2 +- source/blender/windowmanager/intern/wm_files.c | 2 +- source/blender/windowmanager/intern/wm_gesture.c | 2 +- source/blender/windowmanager/intern/wm_init_exit.c | 2 +- source/blender/windowmanager/intern/wm_jobs.c | 2 +- source/blender/windowmanager/intern/wm_keymap.c | 2 +- source/blender/windowmanager/intern/wm_operators.c | 2 +- source/blender/windowmanager/intern/wm_window.c | 2 +- source/blender/windowmanager/wm.h | 2 +- source/blender/windowmanager/wm_draw.h | 2 +- source/blender/windowmanager/wm_event_system.h | 2 +- source/blender/windowmanager/wm_event_types.h | 2 +- source/blender/windowmanager/wm_files.h | 2 +- source/blender/windowmanager/wm_window.h | 2 +- source/gameengine/Ketsji/KX_PythonSeq.cpp | 2 +- source/gameengine/Ketsji/KX_PythonSeq.h | 2 +- 205 files changed, 205 insertions(+), 205 deletions(-) diff --git a/extern/lzo/minilzo/Makefile b/extern/lzo/minilzo/Makefile index 8f3d5042579..11e51f3ad96 100644 --- a/extern/lzo/minilzo/Makefile +++ b/extern/lzo/minilzo/Makefile @@ -1,5 +1,5 @@ # -# $Id: +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/release/getversion.py b/release/getversion.py index 057690f46e9..29622b2154d 100755 --- a/release/getversion.py +++ b/release/getversion.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- mode: python; tab-width: 4; indent-tabs-mode: t; -*- # vim: tabstop=4 -# $Id# +# $Id$ # ***** BEGIN GPL LICENSE BLOCK ***** # # This program is free software; you can redistribute it and/or diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index ef903671fae..c898820b949 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenfont/Makefile b/source/blender/blenfont/Makefile index 43eda027855..9f34d458126 100644 --- a/source/blender/blenfont/Makefile +++ b/source/blender/blenfont/Makefile @@ -1,5 +1,5 @@ # -# $Id: +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/blenfont/intern/Makefile b/source/blender/blenfont/intern/Makefile index 6e53ca959d3..38e76d03cad 100644 --- a/source/blender/blenfont/intern/Makefile +++ b/source/blender/blenfont/intern/Makefile @@ -1,5 +1,5 @@ # -# $Id: +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 682a0aabb4f..74211bae437 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 35d7b6af19c..1ee3e1503dd 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index f2f3f0ea4c4..8dadaca2653 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenfont/intern/blf_util.c b/source/blender/blenfont/intern/blf_util.c index 319a837bbb6..a4f9b6a15d0 100644 --- a/source/blender/blenfont/intern/blf_util.c +++ b/source/blender/blenfont/intern/blf_util.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h index 9634b872e91..6e364ef63b6 100644 --- a/source/blender/blenkernel/BKE_idprop.h +++ b/source/blender/blenkernel/BKE_idprop.h @@ -1,5 +1,5 @@ /** - * $Id: BKE_idprop.h + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/BKE_softbody.h b/source/blender/blenkernel/BKE_softbody.h index e7fbf50ad82..30b7e8cda53 100644 --- a/source/blender/blenkernel/BKE_softbody.h +++ b/source/blender/blenkernel/BKE_softbody.h @@ -1,7 +1,7 @@ /** * BKE_softbody.h * - * $Id: BKE_softbody.h + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index 37aee8fb4aa..e63a1c4c1ad 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -1,5 +1,5 @@ /** - * $Id: idprop.c + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c index e11ddfd59fa..86d07d70e64 100644 --- a/source/blender/blenkernel/intern/image_gen.c +++ b/source/blender/blenkernel/intern/image_gen.c @@ -1,6 +1,6 @@ /* image_gen.c * - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenlib/BLI_args.h b/source/blender/blenlib/BLI_args.h index d2bbdd1bf5f..61f83ccf6f9 100644 --- a/source/blender/blenlib/BLI_args.h +++ b/source/blender/blenlib/BLI_args.h @@ -1,7 +1,7 @@ /** * A general argument parsing module * - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h index 08e24d677f5..eda0e830736 100644 --- a/source/blender/blenlib/BLI_threads.h +++ b/source/blender/blenlib/BLI_threads.h @@ -1,6 +1,6 @@ /* * - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c index abf9dbcd9c5..1a677499d1f 100644 --- a/source/blender/blenlib/intern/BLI_args.c +++ b/source/blender/blenlib/intern/BLI_args.c @@ -1,7 +1,7 @@ /** * A general argument parsing module * - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenlib/intern/graph.c b/source/blender/blenlib/intern/graph.c index dd708b27019..808dc743d44 100644 --- a/source/blender/blenlib/intern/graph.c +++ b/source/blender/blenlib/intern/graph.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenloader/BLO_undofile.h b/source/blender/blenloader/BLO_undofile.h index 435091b49e0..9ec03c4e4d4 100644 --- a/source/blender/blenloader/BLO_undofile.h +++ b/source/blender/blenloader/BLO_undofile.h @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenloader/intern/undofile.c b/source/blender/blenloader/intern/undofile.c index d52646cbe00..f9d51e946a0 100644 --- a/source/blender/blenloader/intern/undofile.c +++ b/source/blender/blenloader/intern/undofile.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index b332da34c73..82575cf58fa 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 2167be2a16a..b71e9ac3507 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 310fa127dcd..4ebf03349ec 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 670a92e664b..348520b60bf 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 06a4a2f980b..5cc5deb2eae 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index ca1df14e14c..45a0ee295e7 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 1784c6ef32c..53a3648713e 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h index 9d0db52d007..099cfeddad7 100644 --- a/source/blender/editors/armature/armature_intern.h +++ b/source/blender/editors/armature/armature_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index ba2c6597e43..508ab19ca17 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index b3960c3cfd5..6eaa76d6422 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/armature/poseUtils.c b/source/blender/editors/armature/poseUtils.c index ecc84aaf4bb..d40f3f30bb2 100644 --- a/source/blender/editors/armature/poseUtils.c +++ b/source/blender/editors/armature/poseUtils.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 03d1408b7fc..ef5d566d0e8 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/armature/reeb.h b/source/blender/editors/armature/reeb.h index a4fc74bdd0d..3bebc423235 100644 --- a/source/blender/editors/armature/reeb.h +++ b/source/blender/editors/armature/reeb.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/curve/curve_intern.h b/source/blender/editors/curve/curve_intern.h index a9a9b5619ff..5b24407a53c 100644 --- a/source/blender/editors/curve/curve_intern.h +++ b/source/blender/editors/curve/curve_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index 45fa7f0c192..3f4498e83fe 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h index c2a8f339e14..1bfe65eb36c 100644 --- a/source/blender/editors/gpencil/gpencil_intern.h +++ b/source/blender/editors/gpencil/gpencil_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h index 99fb25e336d..8f37baf9af1 100644 --- a/source/blender/editors/include/BIF_glutil.h +++ b/source/blender/editors/include/BIF_glutil.h @@ -1,5 +1,5 @@ /** - * $Id: BIF_glutil.h + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 3892770c1f4..c331702a9ee 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 95d0c4cfaca..81ceaffaa5e 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h index d1bba6bf796..3710d4bc4cc 100644 --- a/source/blender/editors/include/ED_curve.h +++ b/source/blender/editors/include/ED_curve.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h index 8d7184902eb..5001323cb61 100644 --- a/source/blender/editors/include/ED_fileselect.h +++ b/source/blender/editors/include/ED_fileselect.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_image.h b/source/blender/editors/include/ED_image.h index 7bf0c284c9b..1d674112b8d 100644 --- a/source/blender/editors/include/ED_image.h +++ b/source/blender/editors/include/ED_image.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_info.h b/source/blender/editors/include/ED_info.h index 2132ef96709..33b890cea60 100644 --- a/source/blender/editors/include/ED_info.h +++ b/source/blender/editors/include/ED_info.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h index 1219cee3a11..805b86ea534 100644 --- a/source/blender/editors/include/ED_keyframes_edit.h +++ b/source/blender/editors/include/ED_keyframes_edit.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_markers.h b/source/blender/editors/include/ED_markers.h index 06434d70656..e5e1f3cef10 100644 --- a/source/blender/editors/include/ED_markers.h +++ b/source/blender/editors/include/ED_markers.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index cc875e5156f..d3e40551194 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h index 2abac1d502c..6e42b772bef 100644 --- a/source/blender/editors/include/ED_node.h +++ b/source/blender/editors/include/ED_node.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_numinput.h b/source/blender/editors/include/ED_numinput.h index ca5dc4797de..4f3918625d9 100644 --- a/source/blender/editors/include/ED_numinput.h +++ b/source/blender/editors/include/ED_numinput.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index ba80a15d050..92d0406dd58 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 2a4f70959a3..4a4c546ec92 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_screen_types.h b/source/blender/editors/include/ED_screen_types.h index 8580dcc33c9..03ea9a8f976 100644 --- a/source/blender/editors/include/ED_screen_types.h +++ b/source/blender/editors/include/ED_screen_types.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_sculpt.h b/source/blender/editors/include/ED_sculpt.h index 61267ef1c93..1167d116df7 100644 --- a/source/blender/editors/include/ED_sculpt.h +++ b/source/blender/editors/include/ED_sculpt.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_sequencer.h b/source/blender/editors/include/ED_sequencer.h index f996956c15d..d99187afce9 100644 --- a/source/blender/editors/include/ED_sequencer.h +++ b/source/blender/editors/include/ED_sequencer.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h index 3529eddd6d9..69a3d1f758a 100644 --- a/source/blender/editors/include/ED_space_api.h +++ b/source/blender/editors/include/ED_space_api.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_text.h b/source/blender/editors/include/ED_text.h index 156d1030063..081e83b1844 100644 --- a/source/blender/editors/include/ED_text.h +++ b/source/blender/editors/include/ED_text.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_types.h b/source/blender/editors/include/ED_types.h index 92de24fa33e..96a5d5857fa 100644 --- a/source/blender/editors/include/ED_types.h +++ b/source/blender/editors/include/ED_types.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_util.h b/source/blender/editors/include/ED_util.h index bbc52bf41c8..cc4f906ad37 100644 --- a/source/blender/editors/include/ED_util.h +++ b/source/blender/editors/include/ED_util.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_uvedit.h b/source/blender/editors/include/ED_uvedit.h index 6a3c980fb1c..1710a8439d1 100644 --- a/source/blender/editors/include/ED_uvedit.h +++ b/source/blender/editors/include/ED_uvedit.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 24c47c4e549..842b66a1f6f 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h index 7b84c7054b0..745073fd235 100644 --- a/source/blender/editors/include/UI_icons.h +++ b/source/blender/editors/include/UI_icons.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 2e6a9d7a646..de4230b8891 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/mesh/editmesh_lib.c b/source/blender/editors/mesh/editmesh_lib.c index 44c23bff38b..06d9301072e 100644 --- a/source/blender/editors/mesh/editmesh_lib.c +++ b/source/blender/editors/mesh/editmesh_lib.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/mesh/editmesh_loop.c b/source/blender/editors/mesh/editmesh_loop.c index 887af0af4c5..f2a099ca6a5 100644 --- a/source/blender/editors/mesh/editmesh_loop.c +++ b/source/blender/editors/mesh/editmesh_loop.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index ecdd4c184df..d0201f1c6ab 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 047a8fe2ca4..2fa6acf8d00 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -1,4 +1,4 @@ - /* $Id: + /* $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/loopcut.c index 012c552241a..1a37832d0cd 100644 --- a/source/blender/editors/mesh/loopcut.c +++ b/source/blender/editors/mesh/loopcut.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index df3ac960b7c..ed3ffcd987c 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 90419b6dd62..34577b7349e 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index a56b6e47ad9..df67868d2ad 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index c71e6ebcbea..1c8b71f5e44 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 5331de02560..23f5d0c1475 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index ab50bd4c37c..bbc5bcd8035 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/physics/particle_boids.c b/source/blender/editors/physics/particle_boids.c index e738aa34d07..7fa35d8c8ee 100644 --- a/source/blender/editors/physics/particle_boids.c +++ b/source/blender/editors/physics/particle_boids.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index 0a2c8a5b4a7..049f09f9901 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c index 55568c89e75..1425fdc10cf 100644 --- a/source/blender/editors/physics/physics_ops.c +++ b/source/blender/editors/physics/physics_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/render/render_intern.h b/source/blender/editors/render/render_intern.h index ecb12f156ec..110435c14bd 100644 --- a/source/blender/editors/render/render_intern.h +++ b/source/blender/editors/render/render_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index af58f3b4ee1..44d3b2bec7f 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index ae0d67626cf..196c6aa87e4 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/render/render_ops.c b/source/blender/editors/render/render_ops.c index e733ffbe5b6..366fc5cf5b7 100644 --- a/source/blender/editors/render/render_ops.c +++ b/source/blender/editors/render/render_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index e29a81612fa..8b98eb0e0b8 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 2c7d9f6ce0c..45a64af6dbd 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index 6d61c8c5819..902570f8717 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 8dc06c4f3b8..6dbde4cf73c 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/screen/screen_intern.h b/source/blender/editors/screen/screen_intern.h index 96b547eff21..5c104521a60 100644 --- a/source/blender/editors/screen/screen_intern.h +++ b/source/blender/editors/screen/screen_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index ddf838f2535..11a7ac119a4 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h index 4bd030459e0..2b94ce01c6d 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.h +++ b/source/blender/editors/sculpt_paint/paint_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_action/action_intern.h b/source/blender/editors/space_action/action_intern.h index 3ad7d3e24ff..ecbde7f4a21 100644 --- a/source/blender/editors/space_action/action_intern.h +++ b/source/blender/editors/space_action/action_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index 429c1cc63cd..d570da2fd62 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 111e500c6f5..beca03b1625 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_api/space.c b/source/blender/editors/space_api/space.c index c61e5d93160..89436c37a0a 100644 --- a/source/blender/editors/space_api/space.c +++ b/source/blender/editors/space_api/space.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index a3fe29536a3..b81fd384a6a 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -1,5 +1,5 @@ /** - * $Id: spacetypes.c + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 572176a256a..c0195fa71fb 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_buttons/buttons_intern.h b/source/blender/editors/space_buttons/buttons_intern.h index 28d52fd55cc..f28d77159a5 100644 --- a/source/blender/editors/space_buttons/buttons_intern.h +++ b/source/blender/editors/space_buttons/buttons_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 7b59f6aafa9..3ef111144de 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index b828a1e664c..dff11c62b4d 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_console/console_intern.h b/source/blender/editors/space_console/console_intern.h index 48159f2607c..c74d39f25e3 100644 --- a/source/blender/editors/space_console/console_intern.h +++ b/source/blender/editors/space_console/console_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index 6d55acf35ec..beabc033d7e 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 6259199d317..1359b5125fa 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 8c6709e762c..a7aeaa1d365 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index baf7e42bb63..1e9a7e1a706 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 640fce39b16..de3b016988d 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 78fd2e06683..c2cf3233f67 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h index 356cd05b509..a875558d6ef 100644 --- a/source/blender/editors/space_graph/graph_intern.h +++ b/source/blender/editors/space_graph/graph_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index 63c877e7402..e56a758f2b0 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_graph/graph_utils.c b/source/blender/editors/space_graph/graph_utils.c index 1d7ffdd1308..b0280e682cc 100644 --- a/source/blender/editors/space_graph/graph_utils.c +++ b/source/blender/editors/space_graph/graph_utils.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 31197f49002..7d34a91d6fa 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_image/image_intern.h b/source/blender/editors/space_image/image_intern.h index f5d84d7487f..09bd9edc86d 100644 --- a/source/blender/editors/space_image/image_intern.h +++ b/source/blender/editors/space_image/image_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 0510bc7e4cb..6cb369a72f2 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_info/info_intern.h b/source/blender/editors/space_info/info_intern.h index 939d984a0d8..128c0dace20 100644 --- a/source/blender/editors/space_info/info_intern.h +++ b/source/blender/editors/space_info/info_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_logic/logic_intern.h b/source/blender/editors/space_logic/logic_intern.h index 6a4888c3bf1..4d19a16ee9c 100644 --- a/source/blender/editors/space_logic/logic_intern.h +++ b/source/blender/editors/space_logic/logic_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c index ab37cad2bd8..8c5ccdd9a5d 100644 --- a/source/blender/editors/space_logic/space_logic.c +++ b/source/blender/editors/space_logic/space_logic.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 62a325b59f4..957529942c0 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 9708e12e738..1bc07811bf8 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 3a9d668e7f8..5b9b5331223 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index bc99ded4db6..a26d6b84e08 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 18ef91220f9..7570969158b 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 249256a47f9..0880c71059e 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 7729573070d..deb7fd5cd79 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 6ea843a00de..4b3dc72a089 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_node/node_buttons.c b/source/blender/editors/space_node/node_buttons.c index cbd3ad73024..317bce16f07 100644 --- a/source/blender/editors/space_node/node_buttons.c +++ b/source/blender/editors/space_node/node_buttons.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 7a5757e99d2..ce0b3f3fd59 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index 3a9a2e8ad83..ade31ee525a 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c index 4ce56f96146..171333946d1 100644 --- a/source/blender/editors/space_node/node_ops.c +++ b/source/blender/editors/space_node/node_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index 055290fbb66..9235a0547ca 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_node/node_state.c b/source/blender/editors/space_node/node_state.c index e754903efc5..0d7c182bc9e 100644 --- a/source/blender/editors/space_node/node_state.c +++ b/source/blender/editors/space_node/node_state.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index fb36c53e9fa..112a2bc49b6 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index 44b435af3bd..1c34cb5ef87 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_outliner/outliner_ops.c b/source/blender/editors/space_outliner/outliner_ops.c index fdfb89d32e3..adcacbe55c8 100644 --- a/source/blender/editors/space_outliner/outliner_ops.c +++ b/source/blender/editors/space_outliner/outliner_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c index cc90330459b..5a1ca49e79d 100644 --- a/source/blender/editors/space_script/script_edit.c +++ b/source/blender/editors/space_script/script_edit.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_script/script_intern.h b/source/blender/editors/space_script/script_intern.h index c24aae600c8..57e4cc6c793 100644 --- a/source/blender/editors/space_script/script_intern.h +++ b/source/blender/editors/space_script/script_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_script/script_ops.c b/source/blender/editors/space_script/script_ops.c index e6d2990677f..b3b0c40df07 100644 --- a/source/blender/editors/space_script/script_ops.c +++ b/source/blender/editors/space_script/script_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c index 4f7c0dc364b..cca9e0efbd1 100644 --- a/source/blender/editors/space_script/space_script.c +++ b/source/blender/editors/space_script/space_script.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h index e9f7da95a81..557402ded92 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c index 787d5712640..b09dd1a9a1e 100644 --- a/source/blender/editors/space_sequencer/sequencer_ops.c +++ b/source/blender/editors/space_sequencer/sequencer_ops.c @@ -1,6 +1,6 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 05e802ad60f..b6a099807dd 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_sound/sound_intern.h b/source/blender/editors/space_sound/sound_intern.h index fd64ccb22b1..7117e7d6df9 100644 --- a/source/blender/editors/space_sound/sound_intern.h +++ b/source/blender/editors/space_sound/sound_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_sound/space_sound.c b/source/blender/editors/space_sound/space_sound.c index f0ec9b3ebb9..c64ea7c6693 100644 --- a/source/blender/editors/space_sound/space_sound.c +++ b/source/blender/editors/space_sound/space_sound.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 44aeb9158f0..43849fda7f8 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index e8cecab8404..46820a54e36 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_time/time_intern.h b/source/blender/editors/space_time/time_intern.h index 5fe55444d45..31164d0c27a 100644 --- a/source/blender/editors/space_time/time_intern.h +++ b/source/blender/editors/space_time/time_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_time/time_ops.c b/source/blender/editors/space_time/time_ops.c index 08e84140f0e..9b391db0086 100644 --- a/source/blender/editors/space_time/time_ops.c +++ b/source/blender/editors/space_time/time_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c index 0a8eee1c7dd..d1a8c4e9ff9 100644 --- a/source/blender/editors/space_userpref/space_userpref.c +++ b/source/blender/editors/space_userpref/space_userpref.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_userpref/userpref_intern.h b/source/blender/editors/space_userpref/userpref_intern.h index 8c84cfdede4..206c8efe70e 100644 --- a/source/blender/editors/space_userpref/userpref_intern.h +++ b/source/blender/editors/space_userpref/userpref_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index f726b771fb3..bcfc0071237 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 21026de2439..82ed635cc0d 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 79448ecf875..ce3bf293051 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index efc3c80de5f..ce1bd14f9fe 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index d56d70d1fbc..301a88b6674 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 792153cab08..6d75d1d0b81 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 26214715805..2eecede4907 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 4a103da6d3c..11e5975cabb 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 02c4a1d91ed..fd7e2c22137 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index e152cc65bf3..754ad8ad9a3 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1,5 +1,5 @@ /** -* $Id: +* $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/transform/transform_ndofinput.c b/source/blender/editors/transform/transform_ndofinput.c index fa872339196..a6171723752 100644 --- a/source/blender/editors/transform/transform_ndofinput.c +++ b/source/blender/editors/transform/transform_ndofinput.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index db7d31bae56..6516582b9fc 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 5d16b87d7db..71952579b32 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index fde5df2ca14..ff982e9d133 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index a61fc5232d0..60f8385a5db 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 46dc3a6cf8d..4c7831c589c 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/util/util_intern.h b/source/blender/editors/util/util_intern.h index 75475f4abef..73675ab4ef9 100644 --- a/source/blender/editors/util/util_intern.h +++ b/source/blender/editors/util/util_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/uvedit/uvedit_intern.h b/source/blender/editors/uvedit/uvedit_intern.h index 5dabaf91b1a..25e2aa2a26f 100644 --- a/source/blender/editors/uvedit/uvedit_intern.h +++ b/source/blender/editors/uvedit/uvedit_intern.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/imbuf/intern/IMB_radiance_hdr.h b/source/blender/imbuf/intern/IMB_radiance_hdr.h index 18e8f0df376..325715906a0 100644 --- a/source/blender/imbuf/intern/IMB_radiance_hdr.h +++ b/source/blender/imbuf/intern/IMB_radiance_hdr.h @@ -1,7 +1,7 @@ /* * IMB_radiance_hdr.h * - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c index 5352f17b49e..570d8961758 100644 --- a/source/blender/imbuf/intern/radiance_hdr.c +++ b/source/blender/imbuf/intern/radiance_hdr.c @@ -1,7 +1,7 @@ /* * radiance_hdr.c * - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/makesrna/intern/rna_animation_api.c b/source/blender/makesrna/intern/rna_animation_api.c index 46ecc8679e7..659a30792bb 100644 --- a/source/blender/makesrna/intern/rna_animation_api.c +++ b/source/blender/makesrna/intern/rna_animation_api.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 07c4d9c826e..6415f04a39f 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/nodes/Makefile b/source/blender/nodes/Makefile index 400064f24b8..a173908aeb1 100644 --- a/source/blender/nodes/Makefile +++ b/source/blender/nodes/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/python/generic/IDProp.c b/source/blender/python/generic/IDProp.c index f7eb800ef23..ba563f9fcbf 100644 --- a/source/blender/python/generic/IDProp.c +++ b/source/blender/python/generic/IDProp.c @@ -1,5 +1,5 @@ /** - * $Id: IDProp.c + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/generic/IDProp.h b/source/blender/python/generic/IDProp.h index 6a8cb7db3c4..c0a07879c1d 100644 --- a/source/blender/python/generic/IDProp.h +++ b/source/blender/python/generic/IDProp.h @@ -1,5 +1,5 @@ /** - * $Id: IDProp.h + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/generic/blf.c b/source/blender/python/generic/blf.c index 52fe860f988..f703cfac2a9 100644 --- a/source/blender/python/generic/blf.c +++ b/source/blender/python/generic/blf.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/generic/blf.h b/source/blender/python/generic/blf.h index 0a0e97934e2..fae20ace996 100644 --- a/source/blender/python/generic/blf.h +++ b/source/blender/python/generic/blf.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 0e105e03184..1a75406d6c1 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/intern/bpy.h b/source/blender/python/intern/bpy.h index 024986b99a6..114d0f9a43d 100644 --- a/source/blender/python/intern/bpy.h +++ b/source/blender/python/intern/bpy.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index e90b58d9fac..15c6ad09e69 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index b9d42f053c9..eab4d352225 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 93f387408e8..285dbb78874 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/intern/bpy_rna_callback.c b/source/blender/python/intern/bpy_rna_callback.c index a49a534c61f..2404442dc18 100644 --- a/source/blender/python/intern/bpy_rna_callback.c +++ b/source/blender/python/intern/bpy_rna_callback.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/intern/bpy_rna_callback.h b/source/blender/python/intern/bpy_rna_callback.h index b6d771b23b2..d846b388c25 100644 --- a/source/blender/python/intern/bpy_rna_callback.h +++ b/source/blender/python/intern/bpy_rna_callback.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/intern/stubs.c b/source/blender/python/intern/stubs.c index 580ceefe9cb..d6dc5059342 100644 --- a/source/blender/python/intern/stubs.c +++ b/source/blender/python/intern/stubs.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/render/intern/include/shading.h b/source/blender/render/intern/include/shading.h index 247400487ac..8250c5631dd 100644 --- a/source/blender/render/intern/include/shading.h +++ b/source/blender/render/intern/include/shading.h @@ -1,5 +1,5 @@ /** -* $Id: +* $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index 8abde533028..4f0e21a9fbb 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -1,6 +1,6 @@ /** * - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index b80abe1e528..17ca087c52e 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -1,5 +1,5 @@ /** -* $Id: +* $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 43dab16d3fb..0e4148ac692 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -1,5 +1,5 @@ /** -* $Id: +* $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/Makefile b/source/blender/windowmanager/Makefile index ad574aa0d4c..90621f66057 100644 --- a/source/blender/windowmanager/Makefile +++ b/source/blender/windowmanager/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 70c0efd6a53..343ee737c82 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index bb4a7452e08..936b6550b0d 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 048487fcd68..f0c8a1cb978 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/intern/wm_apple.c b/source/blender/windowmanager/intern/wm_apple.c index 7853abc059c..67c49c4717f 100644 --- a/source/blender/windowmanager/intern/wm_apple.c +++ b/source/blender/windowmanager/intern/wm_apple.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index 5879e0f82d6..a84eb74be33 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -1,5 +1,5 @@ /** -* $Id: wm_cursors.c +* $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c index 372ef107c15..6f093b2b3a9 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.c +++ b/source/blender/windowmanager/intern/wm_dragdrop.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 6bbce386bd3..513e93d9e3d 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 8cfd45662ac..5de01a6259f 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index d535d8f5ea1..80226b8fa56 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -1,5 +1,5 @@ /** - * $Id: wm_files.c + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index 9674bbe51b7..856894aa74b 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index e5b5e0db1b4..af001aa9627 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c index cb229c301b2..dd1d41c082a 100644 --- a/source/blender/windowmanager/intern/wm_jobs.c +++ b/source/blender/windowmanager/intern/wm_jobs.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 81bef5336e8..1ec131dd73a 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 2833a0135fb..e3d71951b7c 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 0664c5ab8bb..ea41f03d864 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -1,5 +1,5 @@ /** - * $Id: wm_window.c + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/wm.h b/source/blender/windowmanager/wm.h index bf07ee0c884..7228a6dcd93 100644 --- a/source/blender/windowmanager/wm.h +++ b/source/blender/windowmanager/wm.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/wm_draw.h b/source/blender/windowmanager/wm_draw.h index fdece6efc00..42d3ec7e8bc 100644 --- a/source/blender/windowmanager/wm_draw.h +++ b/source/blender/windowmanager/wm_draw.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h index 2f4519d57ba..8fd650fb184 100644 --- a/source/blender/windowmanager/wm_event_system.h +++ b/source/blender/windowmanager/wm_event_system.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h index b71ccd430c0..5f6af878976 100644 --- a/source/blender/windowmanager/wm_event_types.h +++ b/source/blender/windowmanager/wm_event_types.h @@ -1,5 +1,5 @@ /* - * $Id: wm_event_types.h + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/wm_files.h b/source/blender/windowmanager/wm_files.h index b70e4551069..c633ed8388e 100644 --- a/source/blender/windowmanager/wm_files.h +++ b/source/blender/windowmanager/wm_files.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h index 9b996baa7ef..fa244036645 100644 --- a/source/blender/windowmanager/wm_window.h +++ b/source/blender/windowmanager/wm_window.h @@ -1,5 +1,5 @@ /** - * $Id: wm_window.h + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp index 2edebf1ac98..f28c9518ac4 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.cpp +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/gameengine/Ketsji/KX_PythonSeq.h b/source/gameengine/Ketsji/KX_PythonSeq.h index ac011d822f7..ca8f667852a 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.h +++ b/source/gameengine/Ketsji/KX_PythonSeq.h @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * From f9999f3445db47c41d2da538af3abc0ef25576c5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 21 Mar 2010 10:25:21 +0000 Subject: [PATCH 146/153] [#21692] Blender Crashes upon trying to view UV Test Grid (r27639) fix for mistake in own commit when moving grid color func into its own file. --- source/blender/blenkernel/intern/image_gen.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c index 86d07d70e64..2c4851b1835 100644 --- a/source/blender/blenkernel/intern/image_gen.c +++ b/source/blender/blenkernel/intern/image_gen.c @@ -72,6 +72,10 @@ void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int widt int checkerwidth= 32, dark= 1; int x, y; + + unsigned char *rect_orig= rect; + float *rect_float_orig= rect_float; + float h=0.0, hoffs=0.0, hue=0.0, s=0.9, v=0.9, r, g, b; @@ -104,7 +108,10 @@ void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int widt } } } - + + rect= rect_orig; + rect_float= rect_float_orig; + /* 2nd pass, colored + */ for(y= 0; y Date: Sun, 21 Mar 2010 13:07:31 +0000 Subject: [PATCH 147/153] remove includes that arnt needed --- source/blender/blenfont/intern/blf.c | 7 ------- source/blender/blenfont/intern/blf_dir.c | 3 --- source/blender/blenfont/intern/blf_font.c | 1 - source/blender/blenfont/intern/blf_glyph.c | 5 ----- source/blender/blenfont/intern/blf_util.c | 2 -- 5 files changed, 18 deletions(-) diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 74211bae437..9a65b15200f 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -41,14 +41,7 @@ #include "DNA_listBase.h" #include "DNA_vec_types.h" -#include "BKE_utildefines.h" - -#include "BLI_blenlib.h" -#include "BLI_linklist.h" /* linknode */ -#include "BLI_string.h" - #include "BIF_gl.h" -#include "BIF_glutil.h" #include "BLF_api.h" #include "blf_internal_types.h" diff --git a/source/blender/blenfont/intern/blf_dir.c b/source/blender/blenfont/intern/blf_dir.c index 5d623c61d34..e650586aa9c 100644 --- a/source/blender/blenfont/intern/blf_dir.c +++ b/source/blender/blenfont/intern/blf_dir.c @@ -36,14 +36,11 @@ #include "MEM_guardedalloc.h" -#include "DNA_listBase.h" #include "DNA_vec_types.h" #include "BKE_utildefines.h" #include "BLI_blenlib.h" -#include "BLI_linklist.h" /* linknode */ -#include "BLI_string.h" #include "BIF_gl.h" diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 1ee3e1503dd..2d79626a3d6 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -45,7 +45,6 @@ #include "BLI_blenlib.h" #include "BLI_linklist.h" /* linknode */ -#include "BLI_string.h" #include "BLI_math.h" #include "BIF_gl.h" diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 8dadaca2653..0d694c28b2b 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -39,14 +39,9 @@ #include "MEM_guardedalloc.h" -#include "DNA_listBase.h" #include "DNA_vec_types.h" -#include "BKE_utildefines.h" - #include "BLI_blenlib.h" -#include "BLI_linklist.h" /* linknode */ -#include "BLI_string.h" #include "BIF_gl.h" #include "BLF_api.h" diff --git a/source/blender/blenfont/intern/blf_util.c b/source/blender/blenfont/intern/blf_util.c index a4f9b6a15d0..30e6e3fd3f5 100644 --- a/source/blender/blenfont/intern/blf_util.c +++ b/source/blender/blenfont/intern/blf_util.c @@ -30,8 +30,6 @@ #include #include -#include "BIF_gl.h" - unsigned int blf_next_p2(unsigned int x) { From 546ca400d8092d77ced3621a8e47a103bf42f14c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 21 Mar 2010 13:42:25 +0000 Subject: [PATCH 148/153] removed unused includes, except for physics and particle related files --- .../blenkernel/intern/BME_Customdata.c | 4 +-- .../blenkernel/intern/BME_conversions.c | 8 ----- source/blender/blenkernel/intern/BME_eulers.c | 9 ------ source/blender/blenkernel/intern/BME_mesh.c | 4 --- .../blender/blenkernel/intern/BME_structure.c | 5 --- source/blender/blenkernel/intern/BME_tools.c | 4 --- .../blender/blenkernel/intern/DerivedMesh.c | 24 -------------- source/blender/blenkernel/intern/action.c | 12 ------- source/blender/blenkernel/intern/anim.c | 13 -------- source/blender/blenkernel/intern/anim_sys.c | 2 -- source/blender/blenkernel/intern/armature.c | 7 ---- source/blender/blenkernel/intern/blender.c | 14 -------- source/blender/blenkernel/intern/bmfont.c | 2 -- source/blender/blenkernel/intern/boids.c | 6 ---- source/blender/blenkernel/intern/booleanops.c | 7 ---- .../blenkernel/intern/booleanops_mesh.c | 14 -------- source/blender/blenkernel/intern/brush.c | 4 --- source/blender/blenkernel/intern/bvhutils.c | 9 ------ .../blender/blenkernel/intern/cdderivedmesh.c | 8 ----- source/blender/blenkernel/intern/cloth.c | 11 ------- source/blender/blenkernel/intern/colortools.c | 6 ---- source/blender/blenkernel/intern/constraint.c | 2 -- source/blender/blenkernel/intern/context.c | 3 -- source/blender/blenkernel/intern/curve.c | 3 -- source/blender/blenkernel/intern/customdata.c | 4 --- source/blender/blenkernel/intern/deform.c | 17 ---------- source/blender/blenkernel/intern/depsgraph.c | 20 ------------ source/blender/blenkernel/intern/displist.c | 27 ---------------- source/blender/blenkernel/intern/exotic.c | 9 ------ source/blender/blenkernel/intern/fcurve.c | 3 -- source/blender/blenkernel/intern/fmodifier.c | 7 ---- source/blender/blenkernel/intern/font.c | 3 -- source/blender/blenkernel/intern/gpencil.c | 14 -------- source/blender/blenkernel/intern/group.c | 5 --- source/blender/blenkernel/intern/icons.c | 3 -- source/blender/blenkernel/intern/idprop.c | 5 --- source/blender/blenkernel/intern/image.c | 7 ---- source/blender/blenkernel/intern/implicit.c | 3 -- source/blender/blenkernel/intern/ipo.c | 18 ----------- source/blender/blenkernel/intern/key.c | 5 --- source/blender/blenkernel/intern/lattice.c | 9 ------ source/blender/blenkernel/intern/library.c | 15 --------- source/blender/blenkernel/intern/material.c | 4 --- source/blender/blenkernel/intern/mball.c | 1 - source/blender/blenkernel/intern/mesh.c | 8 ----- source/blender/blenkernel/intern/modifier.c | 32 ------------------- source/blender/blenkernel/intern/multires.c | 8 ----- source/blender/blenkernel/intern/nla.c | 6 ---- source/blender/blenkernel/intern/node.c | 27 ---------------- source/blender/blenkernel/intern/object.c | 17 ---------- source/blender/blenkernel/intern/packedFile.c | 3 -- source/blender/blenkernel/intern/paint.c | 2 -- source/blender/blenkernel/intern/particle.c | 14 -------- source/blender/blenkernel/intern/pointcache.c | 1 - source/blender/blenkernel/intern/property.c | 2 -- source/blender/blenkernel/intern/report.c | 2 -- source/blender/blenkernel/intern/sca.c | 3 -- source/blender/blenkernel/intern/scene.c | 19 ----------- source/blender/blenkernel/intern/script.c | 7 ---- source/blender/blenkernel/intern/seqeffects.c | 4 --- source/blender/blenkernel/intern/sequencer.c | 3 -- source/blender/blenkernel/intern/shrinkwrap.c | 7 ---- .../blender/blenkernel/intern/simple_deform.c | 1 - source/blender/blenkernel/intern/softbody.c | 9 ------ source/blender/blenkernel/intern/sound.c | 3 -- .../blender/blenkernel/intern/subsurf_ccg.c | 6 ---- .../blender/blenkernel/intern/suggestions.c | 2 -- source/blender/blenkernel/intern/text.c | 3 -- source/blender/blenkernel/intern/texture.c | 8 ----- source/blender/blenkernel/intern/world.c | 10 ------ .../blenkernel/intern/writeframeserver.c | 3 -- 71 files changed, 1 insertion(+), 569 deletions(-) diff --git a/source/blender/blenkernel/intern/BME_Customdata.c b/source/blender/blenkernel/intern/BME_Customdata.c index cd9254eef53..736b5e05798 100644 --- a/source/blender/blenkernel/intern/BME_Customdata.c +++ b/source/blender/blenkernel/intern/BME_Customdata.c @@ -34,13 +34,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include -#include "BKE_bmesh.h" #include "BKE_bmeshCustomData.h" #include "bmesh_private.h" -#include #include "MEM_guardedalloc.h" -#include "BLI_mempool.h" /********************* Layer type information **********************/ typedef struct BME_LayerTypeInfo { diff --git a/source/blender/blenkernel/intern/BME_conversions.c b/source/blender/blenkernel/intern/BME_conversions.c index c5c74b388ff..d6a00450e4a 100644 --- a/source/blender/blenkernel/intern/BME_conversions.c +++ b/source/blender/blenkernel/intern/BME_conversions.c @@ -33,22 +33,14 @@ */ #include "MEM_guardedalloc.h" -#include "BKE_customdata.h" -#include "DNA_listBase.h" #include "DNA_meshdata_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" -#include "BKE_utildefines.h" #include "BKE_mesh.h" -#include "BKE_bmesh.h" -#include "BKE_global.h" -#include "BKE_DerivedMesh.h" #include "BKE_cdderivedmesh.h" -#include "BLI_blenlib.h" -#include "BLI_editVert.h" #include "BLI_edgehash.h" //XXX #include "BIF_editmesh.h" //XXX #include "editmesh.h" diff --git a/source/blender/blenkernel/intern/BME_eulers.c b/source/blender/blenkernel/intern/BME_eulers.c index 647671d0ed8..9c9c71292c2 100644 --- a/source/blender/blenkernel/intern/BME_eulers.c +++ b/source/blender/blenkernel/intern/BME_eulers.c @@ -34,17 +34,8 @@ #include "MEM_guardedalloc.h" -#include "DNA_listBase.h" -#include "DNA_meshdata_types.h" -#include "DNA_mesh_types.h" -#include "BKE_utildefines.h" -#include "BKE_customdata.h" -#include "BKE_bmesh.h" - -#include "BLI_blenlib.h" #include "bmesh_private.h" -#include "BLI_ghash.h" /********************************************************* * "Euler API" * diff --git a/source/blender/blenkernel/intern/BME_mesh.c b/source/blender/blenkernel/intern/BME_mesh.c index c34695b2fb5..f616d21c6fd 100644 --- a/source/blender/blenkernel/intern/BME_mesh.c +++ b/source/blender/blenkernel/intern/BME_mesh.c @@ -34,13 +34,9 @@ #include "MEM_guardedalloc.h" -#include "DNA_listBase.h" -#include "BLI_blenlib.h" -#include "BKE_utildefines.h" #include "BKE_bmesh.h" #include "bmesh_private.h" - /* * BME MAKE MESH * diff --git a/source/blender/blenkernel/intern/BME_structure.c b/source/blender/blenkernel/intern/BME_structure.c index da0ce4da43b..de3eb94beac 100644 --- a/source/blender/blenkernel/intern/BME_structure.c +++ b/source/blender/blenkernel/intern/BME_structure.c @@ -35,12 +35,7 @@ #include #include "MEM_guardedalloc.h" -#include "DNA_listBase.h" -#include "BKE_utildefines.h" #include "BKE_bmesh.h" -#include "BLI_blenlib.h" -#include "BLI_linklist.h" -#include "BLI_ghash.h" /** * MISC utility functions. * diff --git a/source/blender/blenkernel/intern/BME_tools.c b/source/blender/blenkernel/intern/BME_tools.c index 05dda65a914..9753ad47488 100644 --- a/source/blender/blenkernel/intern/BME_tools.c +++ b/source/blender/blenkernel/intern/BME_tools.c @@ -35,15 +35,11 @@ #include "MEM_guardedalloc.h" -#include "DNA_listBase.h" #include "DNA_meshdata_types.h" -#include "DNA_mesh_types.h" #include "DNA_object_types.h" -#include "BKE_utildefines.h" #include "BKE_bmesh.h" #include "BLI_math.h" -#include "BLI_blenlib.h" /*split this all into a seperate bevel.c file in src*/ diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 9d7fbccec75..e69686eeb00 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -33,51 +33,27 @@ #include #endif -#include "PIL_time.h" #include "MEM_guardedalloc.h" -#include "DNA_effect_types.h" -#include "DNA_mesh_types.h" #include "DNA_key_types.h" #include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" #include "DNA_object_types.h" -#include "DNA_object_force.h" -#include "DNA_object_fluidsim.h" // N_T #include "DNA_scene_types.h" // N_T -#include "DNA_texture_types.h" -#include "DNA_view3d_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_particle_types.h" #include "BLI_math.h" #include "BLI_blenlib.h" -#include "BLI_edgehash.h" #include "BLI_editVert.h" -#include "BLI_linklist.h" #include "BLI_memarena.h" #include "BKE_cdderivedmesh.h" -#include "BKE_customdata.h" -#include "BKE_DerivedMesh.h" -#include "BKE_deform.h" #include "BKE_displist.h" -#include "BKE_effect.h" -#include "BKE_fluidsim.h" -#include "BKE_global.h" -#include "BKE_key.h" -#include "BKE_material.h" #include "BKE_modifier.h" #include "BKE_mesh.h" #include "BKE_object.h" #include "BKE_paint.h" -#include "BKE_subsurf.h" #include "BKE_texture.h" #include "BKE_utildefines.h" -#include "BKE_particle.h" -#include "BKE_bvhutils.h" #include "BLO_sys_types.h" // for intptr_t support diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 13f247e7c3c..cf61de195e5 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -38,26 +38,16 @@ #include "MEM_guardedalloc.h" #include "DNA_anim_types.h" -#include "DNA_action_types.h" #include "DNA_armature_types.h" #include "DNA_constraint_types.h" -#include "DNA_curve_types.h" -#include "DNA_key_types.h" -#include "DNA_nla_types.h" -#include "DNA_object_types.h" #include "DNA_scene_types.h" #include "BKE_animsys.h" #include "BKE_action.h" #include "BKE_anim.h" -#include "BKE_armature.h" -#include "BKE_blender.h" #include "BKE_constraint.h" -#include "BKE_displist.h" #include "BKE_global.h" #include "BKE_fcurve.h" -#include "BKE_key.h" -#include "BKE_lattice.h" #include "BKE_library.h" #include "BKE_main.h" #include "BKE_object.h" @@ -68,10 +58,8 @@ #include "BLI_math.h" #include "BLI_blenlib.h" -#include "BLI_ghash.h" #include "RNA_access.h" -#include "RNA_types.h" /* *********************** NOTE ON POSE AND ACTION ********************** diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 08c8528384f..9eb6c3ad467 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -40,30 +40,18 @@ #include "BLI_math.h" #include "BLI_rand.h" -#include "DNA_listBase.h" #include "DNA_anim_types.h" -#include "DNA_action_types.h" #include "DNA_armature_types.h" -#include "DNA_curve_types.h" -#include "DNA_effect_types.h" #include "DNA_group_types.h" #include "DNA_key_types.h" -#include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_types.h" -#include "DNA_particle_types.h" #include "DNA_scene_types.h" -#include "DNA_view3d_types.h" #include "DNA_vfont_types.h" #include "BKE_anim.h" -#include "BKE_animsys.h" #include "BKE_curve.h" #include "BKE_DerivedMesh.h" -#include "BKE_displist.h" -#include "BKE_effect.h" #include "BKE_font.h" #include "BKE_group.h" #include "BKE_global.h" @@ -81,7 +69,6 @@ #endif // XXX bad level call... -#include "ED_mesh.h" /* --------------------- */ /* forward declarations */ diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 1e9103fb951..584f31769ef 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -36,7 +36,6 @@ #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" -#include "BLI_math.h" #include "BLI_dynstr.h" #include "DNA_anim_types.h" @@ -51,7 +50,6 @@ #include "BKE_utildefines.h" #include "RNA_access.h" -#include "RNA_types.h" #include "nla_private.h" diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 36c78c9f947..387b8a1d5b2 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -39,25 +39,19 @@ #include "DNA_anim_types.h" #include "DNA_armature_types.h" -#include "DNA_action_types.h" -#include "DNA_curve_types.h" #include "DNA_constraint_types.h" #include "DNA_mesh_types.h" #include "DNA_lattice_types.h" #include "DNA_meshdata_types.h" #include "DNA_nla_types.h" -#include "DNA_object_types.h" #include "DNA_scene_types.h" -#include "DNA_view3d_types.h" #include "BKE_animsys.h" #include "BKE_armature.h" #include "BKE_action.h" #include "BKE_anim.h" -#include "BKE_blender.h" #include "BKE_constraint.h" #include "BKE_curve.h" -#include "BKE_deform.h" #include "BKE_depsgraph.h" #include "BKE_DerivedMesh.h" #include "BKE_displist.h" @@ -67,7 +61,6 @@ #include "BKE_lattice.h" #include "BKE_main.h" #include "BKE_object.h" -#include "BKE_object.h" #include "BKE_utildefines.h" #include "BIK_api.h" #include "BKE_sketch.h" diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 171b48af974..d7f8d73e31f 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -48,45 +48,31 @@ #include "MEM_guardedalloc.h" -#include "DNA_curve_types.h" -#include "DNA_listBase.h" -#include "DNA_sdna_types.h" #include "DNA_userdef_types.h" -#include "DNA_object_types.h" -#include "DNA_mesh_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" -#include "DNA_sound_types.h" #include "DNA_sequence_types.h" #include "BLI_blenlib.h" #include "BLI_dynstr.h" -#include "IMB_imbuf_types.h" #include "IMB_imbuf.h" -#include "BKE_animsys.h" -#include "BKE_action.h" #include "BKE_blender.h" #include "BKE_context.h" -#include "BKE_curve.h" #include "BKE_depsgraph.h" #include "BKE_displist.h" -#include "BKE_font.h" #include "BKE_global.h" #include "BKE_idprop.h" #include "BKE_library.h" #include "BKE_ipo.h" #include "BKE_main.h" #include "BKE_node.h" -#include "BKE_object.h" #include "BKE_report.h" #include "BKE_scene.h" #include "BKE_screen.h" #include "BKE_sequencer.h" -#include "BKE_sound.h" -#include "BLI_editVert.h" #include "BLO_undofile.h" #include "BLO_readfile.h" diff --git a/source/blender/blenkernel/intern/bmfont.c b/source/blender/blenkernel/intern/bmfont.c index 409e7edb519..5f9b4f11850 100644 --- a/source/blender/blenkernel/intern/bmfont.c +++ b/source/blender/blenkernel/intern/bmfont.c @@ -51,11 +51,9 @@ #include #include "MEM_guardedalloc.h" -#include "BLI_blenlib.h" #include "BKE_global.h" #include "IMB_imbuf_types.h" -#include "BKE_bmfont.h" #include "BKE_bmfont_types.h" #ifdef HAVE_CONFIG_H diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c index b521ec41cba..25c42dfbf49 100644 --- a/source/blender/blenkernel/intern/boids.c +++ b/source/blender/blenkernel/intern/boids.c @@ -34,19 +34,13 @@ #include "MEM_guardedalloc.h" -#include "DNA_particle_types.h" -#include "DNA_modifier_types.h" #include "DNA_object_force.h" -#include "DNA_object_types.h" #include "DNA_scene_types.h" -#include "DNA_boid_types.h" -#include "DNA_listBase.h" #include "BLI_rand.h" #include "BLI_math.h" #include "BLI_blenlib.h" #include "BLI_kdtree.h" -#include "BLI_kdopbvh.h" #include "BKE_collision.h" #include "BKE_effect.h" #include "BKE_boids.h" diff --git a/source/blender/blenkernel/intern/booleanops.c b/source/blender/blenkernel/intern/booleanops.c index 14a740fb5d1..710bbfaf12b 100644 --- a/source/blender/blenkernel/intern/booleanops.c +++ b/source/blender/blenkernel/intern/booleanops.c @@ -34,7 +34,6 @@ #include "MEM_guardedalloc.h" #include "BLI_math.h" -#include "BLI_blenlib.h" #include "BLI_ghash.h" #include "DNA_material_types.h" @@ -45,17 +44,11 @@ #include "CSG_BooleanOps.h" -#include "BKE_booleanops.h" #include "BKE_cdderivedmesh.h" -#include "BKE_customdata.h" #include "BKE_depsgraph.h" -#include "BKE_DerivedMesh.h" -#include "BKE_global.h" -#include "BKE_library.h" #include "BKE_material.h" #include "BKE_mesh.h" #include "BKE_object.h" -#include "BKE_utildefines.h" diff --git a/source/blender/blenkernel/intern/booleanops_mesh.c b/source/blender/blenkernel/intern/booleanops_mesh.c index 1e99661f445..431e51cf149 100644 --- a/source/blender/blenkernel/intern/booleanops_mesh.c +++ b/source/blender/blenkernel/intern/booleanops_mesh.c @@ -30,24 +30,10 @@ */ #include "CSG_BooleanOps.h" -#include "BKE_booleanops.h" -#include "BKE_booleanops_mesh.h" #include "MEM_guardedalloc.h" -#include "DNA_material_types.h" -#include "DNA_mesh_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "BKE_global.h" -#include "BKE_mesh.h" -#include "BKE_displist.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" -#include "BKE_library.h" -#include "BKE_material.h" -#include "BLI_math.h" /** * Implementation of boolean ops mesh interface. diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index f2cb7d31592..4aaf95e7037 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -34,9 +34,6 @@ #include "DNA_brush_types.h" #include "DNA_color_types.h" -#include "DNA_image_types.h" -#include "DNA_object_types.h" -#include "DNA_texture_types.h" #include "DNA_scene_types.h" #include "DNA_windowmanager_types.h" @@ -56,7 +53,6 @@ #include "BKE_main.h" #include "BKE_paint.h" #include "BKE_texture.h" -#include "BKE_utildefines.h" diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index b7cda698a29..65fda678ce0 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -32,21 +32,12 @@ #include #include -#include "BKE_bvhutils.h" - -#include "DNA_object_types.h" -#include "DNA_modifier_types.h" #include "DNA_meshdata_types.h" #include "BKE_DerivedMesh.h" #include "BKE_utildefines.h" -#include "BKE_deform.h" -#include "BKE_cdderivedmesh.h" -#include "BKE_displist.h" -#include "BKE_global.h" #include "BLI_math.h" -#include "BLI_linklist.h" #include "MEM_guardedalloc.h" /* Math stuff for ray casting on mesh faces and for nearest surface */ diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 347a501dfcc..3a415d6564d 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -37,12 +37,8 @@ #include "BIF_gl.h" #include "BKE_cdderivedmesh.h" -#include "BKE_customdata.h" -#include "BKE_DerivedMesh.h" -#include "BKE_displist.h" #include "BKE_global.h" #include "BKE_mesh.h" -#include "BKE_multires.h" #include "BKE_utildefines.h" #include "BLI_math.h" @@ -51,12 +47,8 @@ #include "BLI_editVert.h" #include "BLI_pbvh.h" -#include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_fluidsim.h" #include "DNA_object_types.h" -#include "DNA_scene_types.h" #include "DNA_curve_types.h" /* for Curve */ #include "MEM_guardedalloc.h" diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 855de95572a..7183a514225 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -29,25 +29,14 @@ #include "BKE_cloth.h" -#include "DNA_cloth_types.h" -#include "DNA_mesh_types.h" -#include "DNA_object_force.h" -#include "DNA_scene_types.h" -#include "DNA_particle_types.h" - -#include "BKE_deform.h" -#include "BKE_DerivedMesh.h" #include "BKE_cdderivedmesh.h" #include "BKE_effect.h" #include "BKE_global.h" -#include "BKE_object.h" #include "BKE_modifier.h" #include "BKE_utildefines.h" -#include "BKE_particle.h" #include "BKE_pointcache.h" -#include "BLI_kdopbvh.h" #ifdef _WIN32 void tstart ( void ) diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 28b70b539c1..6410d02603d 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -40,20 +40,14 @@ #include "DNA_color_types.h" #include "DNA_curve_types.h" -#include "DNA_image_types.h" -#include "DNA_texture_types.h" #include "BKE_colortools.h" #include "BKE_curve.h" -#include "BKE_global.h" #include "BKE_ipo.h" -#include "BKE_image.h" -#include "BKE_main.h" #include "BKE_utildefines.h" #include "BLI_blenlib.h" #include "BLI_math.h" -#include "BLI_threads.h" #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 08ac5e6acce..78f1bb4e469 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -73,8 +73,6 @@ #include "BPY_extern.h" #endif -#include "ED_mesh.h" - #ifdef HAVE_CONFIG_H #include #endif diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 26320e2475f..e8f73a92ad5 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -27,8 +27,6 @@ #include "MEM_guardedalloc.h" -#include "DNA_ID.h" -#include "DNA_listBase.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "DNA_space_types.h" @@ -44,7 +42,6 @@ #include "BKE_context.h" #include "BKE_main.h" #include "BKE_screen.h" -#include "BKE_global.h" #ifndef DISABLE_PYTHON #include "BPY_extern.h" diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index b476ebf4994..06921a0b9af 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -42,12 +42,10 @@ #include "BLI_blenlib.h" #include "BLI_math.h" -#include "DNA_object_types.h" #include "DNA_curve_types.h" #include "DNA_material_types.h" /* for dereferencing pointers */ -#include "DNA_ID.h" #include "DNA_key_types.h" #include "DNA_scene_types.h" #include "DNA_vfont_types.h" @@ -61,7 +59,6 @@ #include "BKE_key.h" #include "BKE_library.h" #include "BKE_main.h" -#include "BKE_mesh.h" #include "BKE_object.h" #include "BKE_utildefines.h" // VECCOPY diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 07960dd2fa0..a0eef4d666e 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -37,16 +37,12 @@ #include "MEM_guardedalloc.h" -#include "DNA_customdata_types.h" -#include "DNA_listBase.h" #include "DNA_meshdata_types.h" #include "DNA_ID.h" #include "BLI_blenlib.h" #include "BLI_linklist.h" -#include "BLI_math.h" #include "BLI_mempool.h" -#include "BLI_string.h" #include "BKE_customdata.h" #include "BKE_customdata_file.h" diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index 728f77cd618..0ae8169cc67 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -38,29 +38,12 @@ #include "MEM_guardedalloc.h" -#include "DNA_curve_types.h" -#include "DNA_effect_types.h" -#include "DNA_lattice_types.h" -#include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_object_types.h" -#include "DNA_object_force.h" -#include "DNA_scene_types.h" -#include "BKE_curve.h" #include "BKE_deform.h" -#include "BKE_displist.h" -#include "BKE_effect.h" -#include "BKE_global.h" -#include "BKE_key.h" -#include "BKE_lattice.h" -#include "BKE_object.h" -#include "BKE_softbody.h" -#include "BKE_utildefines.h" -#include "BKE_mesh.h" #include "BLI_blenlib.h" -#include "BLI_math.h" #ifdef HAVE_CONFIG_H #include diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 155cc2af05e..397a0526160 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -29,35 +29,16 @@ #include #include -#include "BLI_blenlib.h" -#include "BLI_math.h" #include "BLI_winstuff.h" #include "DNA_anim_types.h" -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_boid_types.h" -#include "DNA_curve_types.h" #include "DNA_camera_types.h" -#include "DNA_ID.h" -#include "DNA_effect_types.h" #include "DNA_group_types.h" #include "DNA_lattice_types.h" -#include "DNA_lamp_types.h" #include "DNA_key_types.h" #include "DNA_mesh_types.h" -#include "DNA_modifier_types.h" -#include "DNA_nla_types.h" -#include "DNA_object_types.h" -#include "DNA_object_force.h" -#include "DNA_object_fluidsim.h" -#include "DNA_outliner_types.h" -#include "DNA_particle_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_view2d_types.h" -#include "DNA_view3d_types.h" #include "DNA_windowmanager_types.h" #include "BLI_ghash.h" @@ -75,7 +56,6 @@ #include "BKE_object.h" #include "BKE_particle.h" #include "BKE_pointcache.h" -#include "BKE_utildefines.h" #include "BKE_scene.h" #include "BKE_screen.h" diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 07ecf4c92a9..ed7d11872c1 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -35,55 +35,28 @@ #include "MEM_guardedalloc.h" -#include "IMB_imbuf_types.h" -#include "DNA_texture_types.h" -#include "DNA_meta_types.h" #include "DNA_curve_types.h" -#include "DNA_effect_types.h" -#include "DNA_listBase.h" -#include "DNA_lamp_types.h" -#include "DNA_object_types.h" -#include "DNA_object_force.h" -#include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" #include "DNA_scene_types.h" -#include "DNA_image_types.h" #include "DNA_material_types.h" -#include "DNA_view3d_types.h" -#include "DNA_lattice_types.h" -#include "DNA_key_types.h" #include "BLI_blenlib.h" #include "BLI_math.h" #include "BLI_editVert.h" -#include "BLI_edgehash.h" -#include "BKE_utildefines.h" #include "BKE_global.h" #include "BKE_displist.h" -#include "BKE_deform.h" -#include "BKE_DerivedMesh.h" #include "BKE_cdderivedmesh.h" #include "BKE_object.h" -#include "BKE_world.h" -#include "BKE_mesh.h" -#include "BKE_effect.h" #include "BKE_mball.h" #include "BKE_material.h" #include "BKE_curve.h" #include "BKE_key.h" #include "BKE_anim.h" -#include "BKE_screen.h" -#include "BKE_texture.h" -#include "BKE_library.h" #include "BKE_font.h" #include "BKE_lattice.h" -#include "BKE_scene.h" -#include "BKE_subsurf.h" #include "BKE_modifier.h" -#include "BKE_customdata.h" #include "RE_pipeline.h" #include "RE_shader_ext.h" diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index 9902503950b..772a589f520 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -55,35 +55,26 @@ #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_material_types.h" -#include "DNA_lamp_types.h" #include "DNA_curve_types.h" -#include "DNA_image_types.h" #include "DNA_camera_types.h" #include "DNA_scene_types.h" -#include "DNA_view3d_types.h" -#include "DNA_userdef_types.h" #include "BKE_utildefines.h" #include "BLI_blenlib.h" #include "BLI_math.h" -#include "BLI_editVert.h" #include "BKE_blender.h" #include "BKE_global.h" #include "BKE_main.h" #include "BKE_mesh.h" #include "BKE_library.h" -#include "BKE_global.h" #include "BKE_object.h" #include "BKE_material.h" -#include "BKE_exotic.h" #include "BKE_report.h" -#include "BKE_screen.h" #include "BKE_displist.h" #include "BKE_DerivedMesh.h" #include "BKE_curve.h" -#include "BKE_customdata.h" #ifndef DISABLE_PYTHON #include "BPY_extern.h" diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 807a723685a..5bfef86b7c6 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -45,7 +45,6 @@ #include "BLI_blenlib.h" #include "BLI_math.h" -#include "BLI_noise.h" #include "BKE_fcurve.h" #include "BKE_animsys.h" @@ -53,12 +52,10 @@ #include "BKE_armature.h" #include "BKE_curve.h" #include "BKE_global.h" -#include "BKE_idprop.h" #include "BKE_object.h" #include "BKE_utildefines.h" #include "RNA_access.h" -#include "RNA_types.h" #ifndef DISABLE_PYTHON #include "BPY_extern.h" diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index 969a4208cd3..a5dd415c2ee 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -41,18 +41,11 @@ #include "DNA_anim_types.h" #include "BLI_blenlib.h" -#include "BLI_math.h" -#include "BLI_noise.h" #include "BKE_fcurve.h" -#include "BKE_curve.h" -#include "BKE_global.h" #include "BKE_idprop.h" #include "BKE_utildefines.h" -#include "RNA_access.h" -#include "RNA_types.h" - #ifndef DISABLE_PYTHON #include "BPY_extern.h" /* for BPY_pydriver_eval() */ #endif diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 8ec4814dc94..1ca39bbaac4 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -47,8 +47,6 @@ #include "DNA_packedFile_types.h" #include "DNA_curve_types.h" -#include "DNA_object_types.h" -#include "DNA_view3d_types.h" #include "DNA_vfont_types.h" #include "DNA_scene_types.h" @@ -60,7 +58,6 @@ #include "BKE_font.h" #include "BKE_global.h" #include "BKE_main.h" -#include "BKE_screen.h" #include "BKE_anim.h" #include "BKE_curve.h" #include "BKE_displist.h" diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index c65961d0953..5612d69ed76 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -33,27 +33,13 @@ #include "MEM_guardedalloc.h" -#include "IMB_imbuf.h" -#include "IMB_imbuf_types.h" -#include "BLI_math.h" #include "BLI_blenlib.h" -#include "DNA_listBase.h" #include "DNA_gpencil_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" -#include "DNA_vec_types.h" -#include "BKE_blender.h" -#include "BKE_context.h" -#include "BKE_curve.h" #include "BKE_global.h" #include "BKE_gpencil.h" -#include "BKE_image.h" #include "BKE_library.h" #include "BKE_main.h" #include "BKE_utildefines.h" diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index 4f768bbad23..5f35ab87cb2 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -32,11 +32,7 @@ #include "MEM_guardedalloc.h" -#include "DNA_action_types.h" -#include "DNA_effect_types.h" #include "DNA_group_types.h" -#include "DNA_ID.h" -#include "DNA_ipo_types.h" #include "DNA_material_types.h" #include "DNA_object_types.h" #include "DNA_nla_types.h" @@ -47,7 +43,6 @@ #include "BKE_global.h" #include "BKE_group.h" -#include "BKE_ipo.h" #include "BKE_library.h" #include "BKE_main.h" #include "BKE_object.h" diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c index 1f22e8c1e3f..5580c73099e 100644 --- a/source/blender/blenkernel/intern/icons.c +++ b/source/blender/blenkernel/intern/icons.c @@ -38,8 +38,6 @@ #include "MEM_guardedalloc.h" -#include "DNA_ID.h" -#include "DNA_image_types.h" #include "DNA_lamp_types.h" #include "DNA_material_types.h" #include "DNA_texture_types.h" @@ -48,7 +46,6 @@ #include "BLI_ghash.h" #include "BKE_icons.h" -#include "BKE_utildefines.h" #include "BKE_global.h" /* only for G.background test */ #include "BLO_sys_types.h" // for intptr_t support diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index e63a1c4c1ad..7981c66d2f6 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -29,13 +29,8 @@ #include #include -#include "DNA_listBase.h" -#include "DNA_ID.h" - #include "BKE_idprop.h" -#include "BKE_global.h" #include "BKE_library.h" -#include "BKE_utildefines.h" #include "BLI_blenlib.h" diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 25a4f9b0a48..85f15094740 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -52,16 +52,12 @@ #include "intern/openexr/openexr_multi.h" #endif -#include "DNA_image_types.h" #include "DNA_packedFile_types.h" #include "DNA_scene_types.h" #include "DNA_camera_types.h" #include "DNA_sequence_types.h" -#include "DNA_texture_types.h" -#include "DNA_sequence_types.h" #include "DNA_userdef_types.h" -#include "BLI_math.h" #include "BLI_blenlib.h" #include "BLI_threads.h" @@ -73,8 +69,6 @@ #include "BKE_main.h" #include "BKE_packedFile.h" #include "BKE_scene.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" //XXX #include "BIF_editseq.h" @@ -84,7 +78,6 @@ #include "RE_pipeline.h" -#include "GPU_extensions.h" #include "GPU_draw.h" #include "BLO_sys_types.h" // for intptr_t support diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index 6912a65886a..b4fb34d8464 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -31,13 +31,10 @@ #include "BKE_cloth.h" -#include "DNA_cloth_types.h" -#include "DNA_scene_types.h" #include "DNA_object_force.h" #include "BKE_effect.h" #include "BKE_global.h" -#include "BKE_cloth.h" #include "BKE_utildefines.h" #ifdef _WIN32 diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 807b584d6f8..717bf873d2e 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -48,46 +48,28 @@ #include "MEM_guardedalloc.h" #include "DNA_anim_types.h" -#include "DNA_action_types.h" -#include "DNA_armature_types.h" #include "DNA_constraint_types.h" -#include "DNA_curve_types.h" #include "DNA_camera_types.h" #include "DNA_lamp_types.h" #include "DNA_ipo_types.h" #include "DNA_key_types.h" #include "DNA_material_types.h" -#include "DNA_mesh_types.h" #include "DNA_nla_types.h" -#include "DNA_object_types.h" -#include "DNA_object_force.h" -#include "DNA_particle_types.h" #include "DNA_sequence_types.h" #include "DNA_scene_types.h" -#include "DNA_sound_types.h" -#include "DNA_texture_types.h" -#include "DNA_view3d_types.h" #include "DNA_world_types.h" #include "BLI_blenlib.h" -#include "BLI_math.h" #include "BLI_dynstr.h" #include "BKE_utildefines.h" #include "BKE_animsys.h" #include "BKE_action.h" -#include "BKE_blender.h" -#include "BKE_curve.h" -#include "BKE_constraint.h" #include "BKE_fcurve.h" #include "BKE_global.h" -#include "BKE_ipo.h" -#include "BKE_library.h" #include "BKE_main.h" -#include "BKE_mesh.h" #include "BKE_nla.h" -#include "BKE_object.h" diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index 413d25edd31..9c78742ada0 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -40,24 +40,19 @@ #include "BLI_editVert.h" #include "DNA_anim_types.h" -#include "DNA_curve_types.h" #include "DNA_key_types.h" #include "DNA_lattice_types.h" -#include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" #include "BKE_animsys.h" -#include "BKE_action.h" -#include "BKE_blender.h" #include "BKE_curve.h" #include "BKE_customdata.h" #include "BKE_global.h" #include "BKE_key.h" #include "BKE_lattice.h" #include "BKE_library.h" -#include "BKE_mesh.h" #include "BKE_main.h" #include "BKE_object.h" #include "BKE_utildefines.h" diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index 8a06ce9234e..347fd01299f 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -41,22 +41,15 @@ #include "BLI_blenlib.h" #include "BLI_math.h" -#include "DNA_armature_types.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_lattice_types.h" #include "DNA_curve_types.h" #include "DNA_key_types.h" #include "BKE_anim.h" -#include "BKE_armature.h" -#include "BKE_curve.h" #include "BKE_cdderivedmesh.h" -#include "BKE_DerivedMesh.h" -#include "BKE_deform.h" #include "BKE_displist.h" #include "BKE_global.h" #include "BKE_key.h" @@ -65,8 +58,6 @@ #include "BKE_main.h" #include "BKE_mesh.h" #include "BKE_modifier.h" -#include "BKE_object.h" -#include "BKE_screen.h" #include "BKE_utildefines.h" //XXX #include "BIF_editdeform.h" diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 83268a0a165..91e53742fea 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -47,17 +47,11 @@ #include "MEM_guardedalloc.h" /* all types are needed here, in order to do memory operations */ -#include "DNA_ID.h" -#include "DNA_listBase.h" #include "DNA_scene_types.h" -#include "DNA_object_types.h" #include "DNA_mesh_types.h" #include "DNA_lattice_types.h" -#include "DNA_curve_types.h" #include "DNA_meta_types.h" #include "DNA_material_types.h" -#include "DNA_texture_types.h" -#include "DNA_image_types.h" #include "DNA_wave_types.h" #include "DNA_lamp_types.h" #include "DNA_camera_types.h" @@ -70,17 +64,10 @@ #include "DNA_sound_types.h" #include "DNA_group_types.h" #include "DNA_armature_types.h" -#include "DNA_action_types.h" -#include "DNA_userdef_types.h" #include "DNA_node_types.h" #include "DNA_nla_types.h" -#include "DNA_effect_types.h" -#include "DNA_brush_types.h" -#include "DNA_particle_types.h" -#include "DNA_space_types.h" #include "DNA_windowmanager_types.h" #include "DNA_anim_types.h" -#include "DNA_gpencil_types.h" #include "BLI_blenlib.h" #include "BLI_dynstr.h" @@ -93,7 +80,6 @@ #include "BKE_sound.h" #include "BKE_object.h" #include "BKE_screen.h" -#include "BKE_script.h" #include "BKE_mesh.h" #include "BKE_material.h" #include "BKE_curve.h" @@ -112,7 +98,6 @@ #include "BKE_armature.h" #include "BKE_action.h" #include "BKE_node.h" -#include "BKE_effect.h" #include "BKE_brush.h" #include "BKE_idprop.h" #include "BKE_particle.h" diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 05f0f20feff..2a2d73ca6a0 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -42,14 +42,10 @@ #include "DNA_node_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" -#include "BLI_blenlib.h" #include "BLI_math.h" #include "BKE_animsys.h" -#include "BKE_blender.h" #include "BKE_displist.h" #include "BKE_global.h" #include "BKE_icons.h" diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 24eeb1ab43f..d65870b71ce 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -57,7 +57,6 @@ /* #include "BKE_object.h" */ #include "BKE_animsys.h" #include "BKE_scene.h" -#include "BKE_blender.h" #include "BKE_library.h" #include "BKE_displist.h" #include "BKE_mball.h" diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 08130f51b0e..15f9fc4ac11 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -40,26 +40,18 @@ #include "MEM_guardedalloc.h" -#include "DNA_ID.h" -#include "DNA_anim_types.h" -#include "DNA_curve_types.h" #include "DNA_scene_types.h" #include "DNA_material_types.h" #include "DNA_object_types.h" -#include "DNA_image_types.h" #include "DNA_key_types.h" -#include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_ipo_types.h" #include "BKE_animsys.h" -#include "BKE_customdata.h" -#include "BKE_depsgraph.h" #include "BKE_main.h" #include "BKE_DerivedMesh.h" #include "BKE_global.h" #include "BKE_mesh.h" -#include "BKE_subsurf.h" #include "BKE_displist.h" #include "BKE_library.h" #include "BKE_material.h" diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 68087cb553c..4c4abf80db4 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -40,61 +40,30 @@ #include "math.h" #include "float.h" -#include "BLI_math.h" -#include "BLI_blenlib.h" -#include "BLI_kdopbvh.h" #include "BLI_kdtree.h" -#include "BLI_linklist.h" #include "BLI_rand.h" -#include "BLI_edgehash.h" -#include "BLI_ghash.h" -#include "BLI_memarena.h" #include "MEM_guardedalloc.h" -#include "DNA_action_types.h" #include "DNA_armature_types.h" #include "DNA_camera_types.h" -#include "DNA_cloth_types.h" #include "DNA_curve_types.h" -#include "DNA_effect_types.h" -#include "DNA_group_types.h" #include "DNA_key_types.h" #include "DNA_material_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_types.h" #include "DNA_object_fluidsim.h" -#include "DNA_object_force.h" -#include "DNA_particle_types.h" -#include "DNA_scene_types.h" -#include "DNA_smoke_types.h" -#include "DNA_texture_types.h" - -#include "BLI_editVert.h" - - -#include "BKE_main.h" -#include "BKE_anim.h" #include "BKE_action.h" #include "BKE_bmesh.h" #include "BKE_booleanops.h" #include "BKE_cloth.h" -#include "BKE_collision.h" #include "BKE_cdderivedmesh.h" -#include "BKE_curve.h" -#include "BKE_customdata.h" -#include "BKE_DerivedMesh.h" #include "BKE_displist.h" #include "BKE_fluidsim.h" #include "BKE_global.h" #include "BKE_multires.h" #include "BKE_key.h" #include "BKE_lattice.h" -#include "BKE_library.h" #include "BKE_material.h" #include "BKE_mesh.h" #include "BKE_modifier.h" @@ -106,7 +75,6 @@ #include "BKE_softbody.h" #include "BKE_subsurf.h" #include "BKE_texture.h" -#include "BKE_utildefines.h" #include "depsgraph_private.h" #include "BKE_deform.h" diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index cf1a81fc7e0..248b7ed407d 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -29,27 +29,19 @@ #include "MEM_guardedalloc.h" -#include "DNA_key_types.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" -#include "DNA_view3d_types.h" #include "BLI_math.h" #include "BLI_blenlib.h" #include "BLI_pbvh.h" #include "BKE_cdderivedmesh.h" -#include "BKE_customdata.h" -#include "BKE_depsgraph.h" -#include "BKE_DerivedMesh.h" -#include "BKE_global.h" #include "BKE_mesh.h" #include "BKE_modifier.h" #include "BKE_multires.h" -#include "BKE_object.h" #include "BKE_scene.h" #include "BKE_subsurf.h" #include "BKE_utildefines.h" diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index bbef2b3e0db..56da45ed19a 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -36,20 +36,14 @@ #include "MEM_guardedalloc.h" -#include "BLI_blenlib.h" #include "BLI_ghash.h" #include "DNA_anim_types.h" -#include "DNA_action_types.h" -#include "BKE_animsys.h" #include "BKE_action.h" #include "BKE_fcurve.h" #include "BKE_nla.h" -#include "BKE_blender.h" #include "BKE_library.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" #include "RNA_access.h" #include "nla_private.h" diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 77e54fe6769..10da12753e7 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -36,42 +36,16 @@ #include #include "DNA_anim_types.h" -#include "DNA_ID.h" -#include "DNA_image_types.h" -#include "DNA_node_types.h" -#include "DNA_material_types.h" -#include "DNA_texture_types.h" -#include "DNA_text_types.h" -#include "DNA_scene_types.h" #include "RNA_access.h" -#include "BKE_blender.h" -#include "BKE_colortools.h" #include "BKE_fcurve.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_node.h" -#include "BKE_texture.h" -#include "BKE_text.h" -#include "BKE_utildefines.h" #include "BKE_animsys.h" /* BKE_free_animdata only */ -#include "BLI_math.h" -#include "BLI_blenlib.h" -#include "BLI_rand.h" -#include "BLI_threads.h" #include "PIL_time.h" #include "MEM_guardedalloc.h" -#include "IMB_imbuf.h" - -#include "RE_pipeline.h" -#include "RE_shader_ext.h" /* <- TexResult */ -#include "RE_render_ext.h" /* <- ibuf_sample() */ #include "CMP_node.h" #include "intern/CMP_util.h" /* stupid include path... */ @@ -80,7 +54,6 @@ #include "TEX_node.h" #include "intern/TEX_util.h" -#include "GPU_extensions.h" #include "GPU_material.h" static ListBase empty_list = {NULL, NULL}; diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 336f45fc2e2..b08754a7a3f 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -40,34 +40,20 @@ #include "MEM_guardedalloc.h" #include "DNA_anim_types.h" -#include "DNA_action_types.h" #include "DNA_armature_types.h" -#include "DNA_boid_types.h" #include "DNA_camera_types.h" #include "DNA_constraint_types.h" -#include "DNA_curve_types.h" #include "DNA_group_types.h" #include "DNA_key_types.h" #include "DNA_lamp_types.h" #include "DNA_lattice_types.h" #include "DNA_material_types.h" -#include "DNA_mesh_types.h" #include "DNA_meta_types.h" -#include "DNA_curve_types.h" #include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_nla_types.h" -#include "DNA_object_types.h" -#include "DNA_object_force.h" -#include "DNA_object_fluidsim.h" -#include "DNA_outliner_types.h" -#include "DNA_particle_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "DNA_sequence_types.h" #include "DNA_space_types.h" -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" #include "DNA_view3d_types.h" #include "DNA_world_types.h" @@ -86,10 +72,8 @@ #include "BKE_colortools.h" #include "BKE_deform.h" #include "BKE_DerivedMesh.h" -#include "BKE_nla.h" #include "BKE_animsys.h" #include "BKE_anim.h" -#include "BKE_blender.h" #include "BKE_constraint.h" #include "BKE_curve.h" #include "BKE_displist.h" @@ -110,7 +94,6 @@ #include "BKE_property.h" #include "BKE_sca.h" #include "BKE_scene.h" -#include "BKE_screen.h" #include "BKE_sequencer.h" #include "BKE_softbody.h" diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index cdcdcc07eef..b62f856e1f3 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -49,17 +49,14 @@ #include "DNA_sound_types.h" #include "DNA_vfont_types.h" #include "DNA_packedFile_types.h" -#include "DNA_scene_types.h" #include "BLI_blenlib.h" #include "BKE_utildefines.h" #include "BKE_global.h" #include "BKE_main.h" -#include "BKE_screen.h" #include "BKE_sound.h" #include "BKE_image.h" -#include "BKE_font.h" #include "BKE_packedFile.h" #include "BKE_report.h" diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 5728c7a1fe0..cf5deb95258 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -27,13 +27,11 @@ #include "MEM_guardedalloc.h" -#include "DNA_brush_types.h" #include "DNA_object_types.h" #include "DNA_mesh_types.h" #include "DNA_scene_types.h" #include "BKE_brush.h" -#include "BKE_global.h" #include "BKE_library.h" #include "BKE_paint.h" diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 97e8d6c7f7d..f228dc5002e 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -35,27 +35,15 @@ #include "MEM_guardedalloc.h" -#include "DNA_boid_types.h" #include "DNA_curve_types.h" #include "DNA_group_types.h" -#include "DNA_ipo_types.h" // XXX old animation system stuff to remove! #include "DNA_key_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_force.h" -#include "DNA_object_types.h" #include "DNA_particle_types.h" -#include "DNA_scene_types.h" #include "DNA_smoke_types.h" -#include "DNA_texture_types.h" -#include "BLI_math.h" -#include "BLI_blenlib.h" -#include "BLI_dynstr.h" #include "BLI_kdtree.h" -#include "BLI_listbase.h" #include "BLI_rand.h" #include "BLI_threads.h" @@ -72,9 +60,7 @@ #include "BKE_utildefines.h" #include "BKE_displist.h" #include "BKE_particle.h" -#include "BKE_DerivedMesh.h" #include "BKE_object.h" -#include "BKE_cloth.h" #include "BKE_material.h" #include "BKE_key.h" #include "BKE_library.h" diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 3908429e606..7e73f9b23e7 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -54,7 +54,6 @@ #include "BKE_global.h" #include "BKE_library.h" #include "BKE_main.h" -#include "BKE_modifier.h" #include "BKE_object.h" #include "BKE_particle.h" #include "BKE_pointcache.h" diff --git a/source/blender/blenkernel/intern/property.c b/source/blender/blenkernel/intern/property.c index d65e3391f04..1129cc9d736 100644 --- a/source/blender/blenkernel/intern/property.c +++ b/source/blender/blenkernel/intern/property.c @@ -43,10 +43,8 @@ #include "DNA_property_types.h" #include "DNA_object_types.h" -#include "DNA_listBase.h" #include "BLI_blenlib.h" -#include "BKE_property.h" void free_property(bProperty *prop) { diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c index a2a44ca53a7..a7800ddc12a 100644 --- a/source/blender/blenkernel/intern/report.c +++ b/source/blender/blenkernel/intern/report.c @@ -27,8 +27,6 @@ #include "MEM_guardedalloc.h" -#include "DNA_listBase.h" - #include "BLI_blenlib.h" #include "BLI_dynstr.h" diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index 1c727ee1596..bc66f4d52d3 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -39,7 +39,6 @@ #include "MEM_guardedalloc.h" -#include "DNA_text_types.h" #include "DNA_controller_types.h" #include "DNA_sensor_types.h" #include "DNA_actuator_types.h" @@ -49,8 +48,6 @@ #include "BKE_utildefines.h" #include "BKE_global.h" #include "BKE_main.h" -#include "BKE_blender.h" -#include "BKE_sca.h" /* ******************* SENSORS ************************ */ diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 82aa5576a78..d36043a29ee 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -45,34 +45,15 @@ #include "MEM_guardedalloc.h" #include "DNA_anim_types.h" -#include "DNA_armature_types.h" -#include "DNA_color_types.h" -#include "DNA_constraint_types.h" -#include "DNA_curve_types.h" #include "DNA_group_types.h" -#include "DNA_lamp_types.h" -#include "DNA_material_types.h" -#include "DNA_meta_types.h" -#include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" -#include "BKE_action.h" #include "BKE_anim.h" #include "BKE_animsys.h" -#include "BKE_armature.h" -#include "BKE_colortools.h" -#include "BKE_colortools.h" -#include "BKE_constraint.h" #include "BKE_depsgraph.h" #include "BKE_global.h" -#include "BKE_group.h" -#include "BKE_ipo.h" #include "BKE_idprop.h" -#include "BKE_image.h" -#include "BKE_key.h" #include "BKE_library.h" #include "BKE_main.h" #include "BKE_node.h" diff --git a/source/blender/blenkernel/intern/script.c b/source/blender/blenkernel/intern/script.c index 424067a7046..c07032f71d7 100644 --- a/source/blender/blenkernel/intern/script.c +++ b/source/blender/blenkernel/intern/script.c @@ -31,17 +31,10 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include "BKE_script.h" -#include "DNA_space_types.h" #include "MEM_guardedalloc.h" /* -#include "BLI_blenlib.h" -#include "BKE_utildefines.h" -#include "BKE_library.h" -#include "BKE_global.h" -#include "BKE_main.h" #ifndef DISABLE_PYTHON #include "BPY_extern.h" // Blender Python library diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 770bcddfffd..77b1ae350d2 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -38,10 +38,6 @@ #include "DNA_sequence_types.h" #include "DNA_anim_types.h" -#include "BLI_blenlib.h" -#include "BLI_math.h" - -#include "BKE_global.h" #include "BKE_fcurve.h" #include "BKE_plugin_types.h" #include "BKE_sequencer.h" diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 424ca162bb4..1309bdf465b 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -35,7 +35,6 @@ #include "MEM_guardedalloc.h" #include "MEM_CacheLimiterC-Api.h" -#include "DNA_listBase.h" #include "DNA_sequence_types.h" #include "DNA_scene_types.h" #include "DNA_anim_types.h" @@ -46,7 +45,6 @@ #include "BKE_main.h" #include "BKE_sequencer.h" #include "BKE_fcurve.h" -#include "BKE_utildefines.h" #include "BKE_scene.h" #include "RNA_access.h" #include "RE_pipeline.h" @@ -55,7 +53,6 @@ #include "BLI_listbase.h" #include "BLI_path_util.h" #include "BLI_string.h" -#include "BLI_threads.h" #include #include "IMB_imbuf.h" diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index f0b3db4dca5..574ec848291 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -45,21 +45,14 @@ #include "BKE_lattice.h" #include "BKE_utildefines.h" #include "BKE_deform.h" -#include "BKE_cdderivedmesh.h" -#include "BKE_displist.h" -#include "BKE_global.h" #include "BKE_mesh.h" #include "BKE_subsurf.h" #include "BLI_math.h" -#include "BLI_kdtree.h" -#include "BLI_kdopbvh.h" #include "BLI_editVert.h" -#include "RE_raytrace.h" #include "MEM_guardedalloc.h" -#include "ED_mesh.h" /* Util macros */ #define TO_STR(a) #a diff --git a/source/blender/blenkernel/intern/simple_deform.c b/source/blender/blenkernel/intern/simple_deform.c index f3984eb1c8b..8ceb327b63c 100644 --- a/source/blender/blenkernel/intern/simple_deform.c +++ b/source/blender/blenkernel/intern/simple_deform.c @@ -30,7 +30,6 @@ #include "DNA_modifier_types.h" #include "DNA_meshdata_types.h" -#include "BKE_simple_deform.h" #include "BKE_DerivedMesh.h" #include "BKE_lattice.h" #include "BKE_deform.h" diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 1ebf613dea8..af40d9be643 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -56,16 +56,11 @@ variables on the UI for now /* types */ #include "DNA_curve_types.h" -#include "DNA_object_types.h" -#include "DNA_object_force.h" /* here is the softbody struct */ -#include "DNA_key_types.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" #include "DNA_lattice_types.h" #include "DNA_scene_types.h" -#include "BLI_blenlib.h" #include "BLI_math.h" #include "BLI_ghash.h" #include "BLI_threads.h" @@ -73,13 +68,9 @@ variables on the UI for now #include "BKE_curve.h" #include "BKE_effect.h" #include "BKE_global.h" -#include "BKE_key.h" -#include "BKE_object.h" #include "BKE_softbody.h" -#include "BKE_utildefines.h" #include "BKE_DerivedMesh.h" #include "BKE_pointcache.h" -#include "BKE_modifier.h" #include "BKE_deform.h" //XXX #include "BIF_editdeform.h" //XXX #include "BIF_graphics.h" diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 2f0cb318ca0..d40d4e02dc7 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -14,10 +14,8 @@ #include "DNA_anim_types.h" #include "DNA_scene_types.h" #include "DNA_sequence_types.h" -#include "DNA_sound_types.h" #include "DNA_packedFile_types.h" #include "DNA_screen_types.h" -#include "DNA_userdef_types.h" #include "AUD_C-API.h" @@ -31,7 +29,6 @@ #include "BKE_fcurve.h" #include "BKE_animsys.h" -#include "RNA_access.h" #ifdef HAVE_CONFIG_H #include diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 5d542e143c3..c5c3ae0f022 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -42,20 +42,14 @@ #include "DNA_scene_types.h" #include "BKE_cdderivedmesh.h" -#include "BKE_customdata.h" -#include "BKE_DerivedMesh.h" -#include "BKE_displist.h" #include "BKE_utildefines.h" #include "BKE_global.h" #include "BKE_mesh.h" -#include "BKE_multires.h" #include "BKE_scene.h" #include "BKE_subsurf.h" #include "BLI_blenlib.h" #include "BLI_edgehash.h" -#include "BLI_editVert.h" -#include "BLI_linklist.h" #include "BLI_math.h" #include "BLI_memarena.h" #include "BLI_pbvh.h" diff --git a/source/blender/blenkernel/intern/suggestions.c b/source/blender/blenkernel/intern/suggestions.c index 59635d4d344..1b720c1adaa 100644 --- a/source/blender/blenkernel/intern/suggestions.c +++ b/source/blender/blenkernel/intern/suggestions.c @@ -32,9 +32,7 @@ #include #include "MEM_guardedalloc.h" -#include "BLI_blenlib.h" #include "DNA_text_types.h" -#include "BKE_text.h" #include "BKE_suggestions.h" /**********************/ diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 37c583943c6..a0908529a3a 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -37,8 +37,6 @@ #include "BLI_blenlib.h" -#include "DNA_action_types.h" -#include "DNA_armature_types.h" #include "DNA_constraint_types.h" #include "DNA_controller_types.h" #include "DNA_scene_types.h" @@ -50,7 +48,6 @@ #include "BKE_global.h" #include "BKE_library.h" #include "BKE_main.h" -#include "BKE_node.h" #include "BKE_text.h" #include "BKE_utildefines.h" diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 16cb8a8fb49..0a3f46b617e 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -42,28 +42,21 @@ #include "BLI_blenlib.h" #include "BLI_math.h" -#include "BLI_rand.h" #include "BLI_kdopbvh.h" -#include "DNA_texture_types.h" #include "DNA_key_types.h" #include "DNA_object_types.h" #include "DNA_lamp_types.h" #include "DNA_material_types.h" -#include "DNA_image_types.h" #include "DNA_world_types.h" #include "DNA_brush_types.h" #include "DNA_node_types.h" #include "DNA_color_types.h" -#include "DNA_scene_types.h" -#include "IMB_imbuf_types.h" #include "IMB_imbuf.h" #include "BKE_plugin_types.h" - #include "BKE_utildefines.h" - #include "BKE_global.h" #include "BKE_main.h" @@ -73,7 +66,6 @@ #include "BKE_texture.h" #include "BKE_key.h" #include "BKE_icons.h" -#include "BKE_brush.h" #include "BKE_node.h" #include "BKE_animsys.h" diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index fff0a08136b..0ac8b14166d 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -35,20 +35,10 @@ #include "MEM_guardedalloc.h" #include "DNA_world_types.h" -#include "DNA_texture_types.h" #include "DNA_scene_types.h" -#include "DNA_object_types.h" -#include "DNA_camera_types.h" - - -#include "BLI_blenlib.h" -#include "BLI_math.h" - -#include "BKE_utildefines.h" #include "BKE_library.h" #include "BKE_animsys.h" -#include "BKE_world.h" #include "BKE_global.h" #include "BKE_main.h" #include "BKE_icons.h" diff --git a/source/blender/blenkernel/intern/writeframeserver.c b/source/blender/blenkernel/intern/writeframeserver.c index 20d858fffeb..d715d18877d 100644 --- a/source/blender/blenkernel/intern/writeframeserver.c +++ b/source/blender/blenkernel/intern/writeframeserver.c @@ -44,14 +44,11 @@ #include #include "MEM_guardedalloc.h" -#include "BLI_blenlib.h" #include "DNA_userdef_types.h" #include "BKE_global.h" #include "BKE_report.h" -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" #include "DNA_scene_types.h" From 49493dec557dfee46c0a29bdd81444f51bcef914 Mon Sep 17 00:00:00 2001 From: Tom Musgrove Date: Sun, 21 Mar 2010 14:46:43 +0000 Subject: [PATCH 149/153] --- source/blender/makesrna/intern/rna_sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index bdba1778d6b..3b07643a0ad 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -447,7 +447,7 @@ static void rna_def_strip_transform(BlenderRNA *brna) prop= RNA_def_property(srna, "offset_x", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "xofs"); - RNA_def_property_ui_text(prop, "Offset Y", ""); + RNA_def_property_ui_text(prop, "Offset X", ""); RNA_def_property_ui_range(prop, -4096, 4096, 1, 0); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); From 247b7249bd14f370aad991f176a1aafb5acefc45 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 21 Mar 2010 14:56:26 +0000 Subject: [PATCH 150/153] [#21682] help() doesn't work in the console replace pydoc's pager function so the console's input isnt used. --- release/scripts/modules/bpy/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py index 8f6bada6561..f0025290f09 100644 --- a/release/scripts/modules/bpy/__init__.py +++ b/release/scripts/modules/bpy/__init__.py @@ -50,6 +50,13 @@ def _main(): if not app.debug: _sys.stdin = None + # because of how the console works. we need our own help() pager func. + # replace the bold function because it adds crazy chars + import pydoc + pydoc.getpager = lambda: pydoc.plainpager + pydoc.TextDoc.bold = lambda self, text: text + + # if "-d" in sys.argv: # Enable this to measure startup speed if 0: import cProfile From f61b3ac81ab6e1925c6dfc7ff45fd5dac44a0f36 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sun, 21 Mar 2010 15:40:36 +0000 Subject: [PATCH 151/153] Fix for sequencer adding scene strips of the same scene resulting in an endless recursion. --- source/blender/blenkernel/intern/sound.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index d40d4e02dc7..7308146ef92 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -348,7 +348,9 @@ void sound_destroy_scene(struct Scene *scene) void* sound_scene_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip) { - return AUD_addSequencer(scene->sound_scene, &(sequence->scene->sound_scene), startframe / FPS, endframe / FPS, frameskip / FPS, sequence); + if(scene != sequence->scene) + return AUD_addSequencer(scene->sound_scene, &(sequence->scene->sound_scene), startframe / FPS, endframe / FPS, frameskip / FPS, sequence); + return NULL; } void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip) From cc8f79019914a8ea15a149993b13e26daae92c91 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 21 Mar 2010 15:47:13 +0000 Subject: [PATCH 152/153] recent removal of includes broke for msvc --- source/blender/blenkernel/intern/fmodifier.c | 1 + source/blender/blenkernel/intern/ipo.c | 1 + source/blender/blenkernel/intern/seqeffects.c | 1 + 3 files changed, 3 insertions(+) diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index a5dd415c2ee..a0bba578613 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -42,6 +42,7 @@ #include "BLI_blenlib.h" +#include "BKE_math.h" /* windows needs for M_PI */ #include "BKE_fcurve.h" #include "BKE_idprop.h" #include "BKE_utildefines.h" diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 717bf873d2e..d4e63160370 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -64,6 +64,7 @@ #include "BKE_utildefines.h" +#include "BKE_math.h" /* windows needs for M_PI */ #include "BKE_animsys.h" #include "BKE_action.h" #include "BKE_fcurve.h" diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 77b1ae350d2..83043eb70f0 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -38,6 +38,7 @@ #include "DNA_sequence_types.h" #include "DNA_anim_types.h" +#include "BKE_math.h" /* windows needs for M_PI */ #include "BKE_fcurve.h" #include "BKE_plugin_types.h" #include "BKE_sequencer.h" From dd4a8bff516bcc7c0dc14325cfff6ede17118e27 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 21 Mar 2010 15:59:08 +0000 Subject: [PATCH 153/153] take 2... --- source/blender/blenkernel/intern/fmodifier.c | 2 +- source/blender/blenkernel/intern/ipo.c | 2 +- source/blender/blenkernel/intern/seqeffects.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index a0bba578613..6c73a3ae64c 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -41,8 +41,8 @@ #include "DNA_anim_types.h" #include "BLI_blenlib.h" +#include "BLI_math.h" /* windows needs for M_PI */ -#include "BKE_math.h" /* windows needs for M_PI */ #include "BKE_fcurve.h" #include "BKE_idprop.h" #include "BKE_utildefines.h" diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index d4e63160370..2c0ca0f69f9 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -59,12 +59,12 @@ #include "DNA_scene_types.h" #include "DNA_world_types.h" +#include "BLI_math.h" /* windows needs for M_PI */ #include "BLI_blenlib.h" #include "BLI_dynstr.h" #include "BKE_utildefines.h" -#include "BKE_math.h" /* windows needs for M_PI */ #include "BKE_animsys.h" #include "BKE_action.h" #include "BKE_fcurve.h" diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 83043eb70f0..7cabb620085 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -34,11 +34,12 @@ #include "MEM_guardedalloc.h" #include "PIL_dynlib.h" +#include "BLI_math.h" /* windows needs for M_PI */ + #include "DNA_scene_types.h" #include "DNA_sequence_types.h" #include "DNA_anim_types.h" -#include "BKE_math.h" /* windows needs for M_PI */ #include "BKE_fcurve.h" #include "BKE_plugin_types.h" #include "BKE_sequencer.h"