diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-17 19:51:48 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-17 19:51:48 +0400 |
commit | 4c66e696fbcaefe40f0394fea8fc4a55bb7d6994 (patch) | |
tree | e8f60920e276ec1fec3c8014b77790a6c790deba | |
parent | 02987fd5e1fa3715d25bb7b9bd659fd509f40c57 (diff) | |
parent | b7f3887a3a8a66aeba3a16ae5d76b934af3ccc7c (diff) |
svn merge ^/trunk/blender -r44136:44189
24 files changed, 306 insertions, 91 deletions
diff --git a/build_files/scons/config/darwin-config.py b/build_files/scons/config/darwin-config.py index 8082c1e6986..17882342a86 100644 --- a/build_files/scons/config/darwin-config.py +++ b/build_files/scons/config/darwin-config.py @@ -86,6 +86,9 @@ else : LIBDIR = '${LCGDIR}' +if XCODE_CUR_VER >= '4.3': ## since version 4.3, XCode and developer dir are bundled ## + MACOSX_SDK = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform' + MACOSX_SDK + ############################################################################# ################### Dependency settings ################## ############################################################################# diff --git a/release/scripts/modules/bpy_extras/image_utils.py b/release/scripts/modules/bpy_extras/image_utils.py index 7d409510c85..c21b750fd1f 100644 --- a/release/scripts/modules/bpy_extras/image_utils.py +++ b/release/scripts/modules/bpy_extras/image_utils.py @@ -97,7 +97,7 @@ def load_image(imagepath, # image path has been checked so the path could not be read for some # reason, so be sure to return a placeholder - if place_holder: + if place_holder and image is None: image = _image_load_placeholder(path) return image diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index eb97e546379..b8a205dc662 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -684,6 +684,8 @@ class CLIP_PT_stabilization(Panel): row.active = stab.rotation_track is not None row.prop(stab, "influence_rotation") + layout.prop(stab, "filter_type") + class CLIP_PT_marker(Panel): bl_space_type = 'CLIP_EDITOR' diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 17d75dca41b..5870c9afaea 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Header, Menu, Panel +from .properties_paint_common import UnifiedPaintPanel class VIEW3D_HT_header(Header): @@ -51,6 +52,8 @@ class VIEW3D_HT_header(Header): elif obj: if mode_string not in {'PAINT_TEXTURE'}: sub.menu("VIEW3D_MT_%s" % mode_string.lower()) + if mode_string in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT', 'PAINT_TEXTURE'}: + sub.menu("VIEW3D_MT_brush") else: sub.menu("VIEW3D_MT_object") @@ -80,22 +83,23 @@ class VIEW3D_HT_header(Header): row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True) # Snap - snap_element = toolsettings.snap_element - row = layout.row(align=True) - row.prop(toolsettings, "use_snap", text="") - row.prop(toolsettings, "snap_element", text="", icon_only=True) - if snap_element != 'INCREMENT': - row.prop(toolsettings, "snap_target", text="") - if obj: - if obj.mode == 'OBJECT': - row.prop(toolsettings, "use_snap_align_rotation", text="") - elif obj.mode == 'EDIT': - row.prop(toolsettings, "use_snap_self", text="") - - if snap_element == 'VOLUME': - row.prop(toolsettings, "use_snap_peel_object", text="") - elif snap_element == 'FACE': - row.prop(toolsettings, "use_snap_project", text="") + if not obj or obj.mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT', 'PARTICLE_EDIT'}: + snap_element = toolsettings.snap_element + row = layout.row(align=True) + row.prop(toolsettings, "use_snap", text="") + row.prop(toolsettings, "snap_element", text="", icon_only=True) + if snap_element != 'INCREMENT': + row.prop(toolsettings, "snap_target", text="") + if obj: + if obj.mode == 'OBJECT': + row.prop(toolsettings, "use_snap_align_rotation", text="") + elif obj.mode == 'EDIT': + row.prop(toolsettings, "use_snap_self", text="") + + if snap_element == 'VOLUME': + row.prop(toolsettings, "use_snap_peel_object", text="") + elif snap_element == 'FACE': + row.prop(toolsettings, "use_snap_project", text="") # OpenGL render row = layout.row(align=True) @@ -1012,6 +1016,45 @@ class VIEW3D_MT_object_game(Menu): layout.operator("object.game_property_clear") + +# ********** Brush menu ********** +class VIEW3D_MT_brush(Menu): + bl_label = "Brush" + + def draw(self, context): + layout = self.layout + + settings = UnifiedPaintPanel.paint_settings(context) + brush = settings.brush + + ups = context.tool_settings.unified_paint_settings + layout.prop(ups, "use_unified_size", text="Unified Size") + layout.prop(ups, "use_unified_strength", text="Unified Strength") + + # skip if no active brush + if not brush: + return + + # TODO: still missing a lot of brush options here + + # sculpt options + if context.sculpt_object: + + sculpt_tool = brush.sculpt_tool + + layout.separator() + layout.operator_menu_enum("brush.curve_preset", "shape", text='Curve Preset') + layout.separator() + + if sculpt_tool != 'GRAB': + layout.prop_menu_enum(brush, "stroke_method") + + if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}: + layout.prop_menu_enum(brush, "direction") + + if sculpt_tool == 'LAYER': + layout.prop(brush, "use_persistent") + layout.operator("sculpt.set_persistent_base") # ********** Vertex paint menu ********** @@ -1115,7 +1158,6 @@ class VIEW3D_MT_sculpt(Menu): toolsettings = context.tool_settings sculpt = toolsettings.sculpt - brush = toolsettings.sculpt.brush layout.operator("ed.undo") layout.operator("ed.redo") @@ -1129,30 +1171,13 @@ class VIEW3D_MT_sculpt(Menu): layout.prop(sculpt, "lock_x") layout.prop(sculpt, "lock_y") layout.prop(sculpt, "lock_z") - layout.separator() - layout.operator_menu_enum("brush.curve_preset", "shape") - layout.separator() - - if brush is not None: # unlikely but can happen - sculpt_tool = brush.sculpt_tool - - if sculpt_tool != 'GRAB': - layout.prop_menu_enum(brush, "stroke_method") - - if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}: - layout.prop_menu_enum(brush, "direction") - - if sculpt_tool == 'LAYER': - layout.prop(brush, "use_persistent") - layout.operator("sculpt.set_persistent_base") layout.separator() layout.prop(sculpt, "use_threaded", text="Threaded Sculpt") + layout.prop(sculpt, "show_low_resolution") layout.prop(sculpt, "show_brush") + layout.prop(sculpt, "use_deform_only") - # TODO, make available from paint menu! - layout.prop(toolsettings, "sculpt_paint_use_unified_size", text="Unify Size") - layout.prop(toolsettings, "sculpt_paint_use_unified_strength", text="Unify Strength") # ********** Particle menu ********** diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c index d96011f0f1e..95203c2b1c0 100644 --- a/source/blender/blenfont/intern/blf_lang.c +++ b/source/blender/blenfont/intern/blf_lang.c @@ -101,7 +101,7 @@ static const char *locales[] = { "greek", "el_GR", "korean", "ko_KR", "nepali", "ne_NP", - "persian", "fa_PE", + "persian", "fa_IR", "indonesian", "id_ID", "serbian (latin)", "sr_RS@latin", "kyrgyz", "ky", diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index afa4752f1ff..9b8acc2b140 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -51,7 +51,7 @@ extern "C" { /* can be left blank, otherwise a,b,c... etc with no quotes */ #define BLENDER_VERSION_CHAR /* alpha/beta/rc/release, docs use this */ -#define BLENDER_VERSION_CYCLE release +#define BLENDER_VERSION_CYCLE alpha extern char versionstr[]; /* from blender.c */ diff --git a/source/blender/blenkernel/BKE_tracking.h b/source/blender/blenkernel/BKE_tracking.h index f720050f59c..ebbba7de7c7 100644 --- a/source/blender/blenkernel/BKE_tracking.h +++ b/source/blender/blenkernel/BKE_tracking.h @@ -138,7 +138,7 @@ void BKE_tracking_detect_fast(struct MovieTracking *tracking, struct ListBase *t /* 2D stabilization */ void BKE_tracking_stabilization_data(struct MovieTracking *tracking, int framenr, int width, int height, float loc[2], float *scale, float *angle); struct ImBuf *BKE_tracking_stabilize(struct MovieTracking *tracking, int framenr, struct ImBuf *ibuf, float loc[2], float *scale, float *angle); -void BKE_tracking_stabdata_to_mat4(int width, int height, float loc[2], float scale, float angle, float mat[4][4]); +void BKE_tracking_stabdata_to_mat4(int width, int height, float aspect, float loc[2], float scale, float angle, float mat[4][4]); /* Distortion/Undistortion */ void BKE_tracking_apply_intrinsics(struct MovieTracking *tracking, float co[2], float nco[2]); diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index b32421a6b3d..c3d2425f280 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -88,6 +88,7 @@ short id_type_can_have_animdata (ID *id) case ID_LA: case ID_CA: case ID_WO: case ID_SPK: case ID_SCE: + case ID_MC: { return 1; } @@ -793,6 +794,9 @@ void BKE_animdata_main_cb (Main *mainptr, ID_AnimData_Edit_Callback func, void * /* speakers */ ANIMDATA_IDS_CB(mainptr->speaker.first); + /* movie clips */ + ANIMDATA_IDS_CB(mainptr->movieclip.first); + /* objects */ ANIMDATA_IDS_CB(mainptr->object.first); @@ -874,6 +878,9 @@ void BKE_all_animdata_fix_paths_rename (const char *prefix, const char *oldName, /* speakers */ RENAMEFIX_ANIM_IDS(mainptr->speaker.first); + /* movie clips */ + RENAMEFIX_ANIM_IDS(mainptr->movieclip.first); + /* objects */ RENAMEFIX_ANIM_IDS(mainptr->object.first); @@ -2335,6 +2342,9 @@ void BKE_animsys_evaluate_all_animation (Main *main, Scene *scene, float ctime) /* speakers */ EVAL_ANIM_IDS(main->speaker.first, ADT_RECALC_ANIM); + /* movie clips */ + EVAL_ANIM_IDS(main->movieclip.first, ADT_RECALC_ANIM); + /* objects */ /* ADT_RECALC_ANIM doesn't need to be supplied here, since object AnimData gets * this tagged by Depsgraph on framechange. This optimisation means that objects diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index c90faa7e0ca..69b32ce46f8 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -64,6 +64,7 @@ #include "BLI_mempool.h" #include "BLI_threads.h" +#include "BKE_animsys.h" #include "BKE_constraint.h" #include "BKE_library.h" #include "BKE_global.h" @@ -276,9 +277,10 @@ typedef struct MovieClipCache { struct { ImBuf *ibuf; int framenr; + int postprocess_flag; - float loc[2], scale, angle; - int proxy; + float loc[2], scale, angle, aspect; + int proxy, filter; short render_flag; } stabilized; } MovieClipCache; @@ -701,9 +703,10 @@ ImBuf *BKE_movieclip_get_postprocessed_ibuf(MovieClip *clip, MovieClipUser *user return movieclip_get_postprocessed_ibuf(clip, user, clip->flag, postprocess_flag, 0); } -static ImBuf *get_stable_cached_frame(MovieClip *clip, MovieClipUser *user, int framenr) +static ImBuf *get_stable_cached_frame(MovieClip *clip, MovieClipUser *user, int framenr, int postprocess_flag) { MovieClipCache *cache = clip->cache; + MovieTracking *tracking = &clip->tracking; ImBuf *stableibuf; float tloc[2], tscale, tangle; short proxy = IMB_PROXY_NONE; @@ -722,6 +725,16 @@ static ImBuf *get_stable_cached_frame(MovieClip *clip, MovieClipUser *user, int if(cache->stabilized.render_flag!=render_flag || cache->stabilized.proxy!=proxy) return NULL; + if(cache->stabilized.postprocess_flag != postprocess_flag) + return NULL; + + /* stabilization also depends on pixel aspect ratio */ + if(cache->stabilized.aspect != tracking->camera.pixel_aspect) + return NULL; + + if(cache->stabilized.filter != tracking->stabilization.filter) + return NULL; + stableibuf = cache->stabilized.ibuf; BKE_tracking_stabilization_data(&clip->tracking, framenr, stableibuf->x, stableibuf->y, tloc, &tscale, &tangle); @@ -739,9 +752,11 @@ static ImBuf *get_stable_cached_frame(MovieClip *clip, MovieClipUser *user, int return stableibuf; } -static ImBuf *put_stabilized_frame_to_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, int framenr) +static ImBuf *put_stabilized_frame_to_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, + int framenr, int postprocess_flag) { MovieClipCache *cache = clip->cache; + MovieTracking *tracking = &clip->tracking; ImBuf *stableibuf; float tloc[2], tscale, tangle; @@ -757,6 +772,8 @@ static ImBuf *put_stabilized_frame_to_cache(MovieClip *clip, MovieClipUser *user cache->stabilized.scale = tscale; cache->stabilized.angle = tangle; cache->stabilized.framenr = framenr; + cache->stabilized.aspect = tracking->camera.pixel_aspect; + cache->stabilized.filter = tracking->stabilization.filter; if(clip->flag&MCLIP_USE_PROXY) { cache->stabilized.proxy= rendersize_to_proxy(user, clip->flag); @@ -767,6 +784,8 @@ static ImBuf *put_stabilized_frame_to_cache(MovieClip *clip, MovieClipUser *user cache->stabilized.render_flag = 0; } + cache->stabilized.postprocess_flag = postprocess_flag; + IMB_refImBuf(stableibuf); return stableibuf; @@ -785,10 +804,10 @@ ImBuf *BKE_movieclip_get_stable_ibuf(MovieClip *clip, MovieClipUser *user, float if(clip->tracking.stabilization.flag&TRACKING_2D_STABILIZATION) { MovieClipCache *cache= clip->cache; - stableibuf= get_stable_cached_frame(clip, user, framenr); + stableibuf= get_stable_cached_frame(clip, user, framenr, postprocess_flag); if(!stableibuf) - stableibuf= put_stabilized_frame_to_cache(clip, user, ibuf, framenr); + stableibuf= put_stabilized_frame_to_cache(clip, user, ibuf, framenr, postprocess_flag); if(loc) copy_v2_v2(loc, cache->stabilized.loc); if(scale) *scale= cache->stabilized.scale; @@ -889,6 +908,8 @@ static void free_buffers(MovieClip *clip) IMB_free_anim(clip->anim); clip->anim= FALSE; } + + BKE_free_animdata((ID *) clip); } void BKE_movieclip_reload(MovieClip *clip) diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 0790896da0d..b2188754503 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -1192,11 +1192,10 @@ static void seq_open_anim_file(Sequence * seq) } -static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra, char * name) +static int seq_proxy_get_fname(Sequence * seq, int cfra, int render_size, char * name) { int frameno; char dir[PROXY_MAXFILE]; - int render_size = context.preview_render_size; if (!seq->strip->proxy) { return FALSE; @@ -1226,22 +1225,17 @@ static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra, return TRUE; } - /* dirty hack to distinguish 100% render size from PROXY_100 */ - if (render_size == 99) { - render_size = 100; - } - /* generate a separate proxy directory for each preview size */ if (seq->type == SEQ_IMAGE) { BLI_snprintf(name, PROXY_MAXFILE, "%s/images/%d/%s_proxy", dir, - context.preview_render_size, + render_size, give_stripelem(seq, cfra)->name); frameno = 1; } else { frameno = (int) give_stripelem_index(seq, cfra) + seq->anim_startofs; BLI_snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/####", dir, - context.preview_render_size); + render_size); } BLI_path_abs(name, G.main->name); @@ -1258,6 +1252,12 @@ static struct ImBuf * seq_proxy_fetch(SeqRenderData context, Sequence * seq, int IMB_Proxy_Size psize = seq_rendersize_to_proxysize( context.preview_render_size); int size_flags; + int render_size = context.preview_render_size; + + /* dirty hack to distinguish 100% render size from PROXY_100 */ + if (render_size == 99) { + render_size = 100; + } if (!(seq->flag & SEQ_USE_PROXY)) { return NULL; @@ -1273,7 +1273,7 @@ static struct ImBuf * seq_proxy_fetch(SeqRenderData context, Sequence * seq, int if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { int frameno = (int) give_stripelem_index(seq, cfra) + seq->anim_startofs; if (seq->strip->proxy->anim == NULL) { - if (seq_proxy_get_fname(context, seq, cfra, name)==0) { + if (seq_proxy_get_fname(seq, cfra, render_size, name)==0) { return NULL; } @@ -1292,7 +1292,7 @@ static struct ImBuf * seq_proxy_fetch(SeqRenderData context, Sequence * seq, int IMB_TC_NONE, IMB_PROXY_NONE); } - if (seq_proxy_get_fname(context, seq, cfra, name) == 0) { + if (seq_proxy_get_fname(seq, cfra, render_size, name) == 0) { return NULL; } @@ -1313,7 +1313,7 @@ static void seq_proxy_build_frame(SeqRenderData context, int ok; struct ImBuf * ibuf; - if (!seq_proxy_get_fname(context, seq, cfra, name)) { + if (!seq_proxy_get_fname(seq, cfra, proxy_render_size, name)) { return; } diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index 695ea1dc07a..7461e057df5 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -726,6 +726,7 @@ static void tracks_map_merge(TracksMap *map, MovieTracking *tracking) { MovieTrackingTrack *track; MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking); + MovieTrackingTrack *rot_track= tracking->stabilization.rot_track; ListBase tracks= {NULL, NULL}, new_tracks= {NULL, NULL}; ListBase *old_tracks; int a; @@ -747,7 +748,7 @@ static void tracks_map_merge(TracksMap *map, MovieTracking *tracking) this is needed to keep names in unique state and it's faster to change names of currently operating tracks (if needed) */ for(a= 0; a<map->num_tracks; a++) { - int replace_sel= 0; + int replace_sel= 0, replace_rot= 0; MovieTrackingTrack *new_track, *old; track= &map->tracks[a]; @@ -766,8 +767,10 @@ static void tracks_map_merge(TracksMap *map, MovieTracking *tracking) /* original track was found, re-use flags and remove this track */ if(cur) { - if(act_track) + if(cur==act_track) replace_sel= 1; + if(cur==rot_track) + replace_rot= 1; track->flag= cur->flag; track->pat_flag= cur->pat_flag; @@ -786,6 +789,9 @@ static void tracks_map_merge(TracksMap *map, MovieTracking *tracking) if(replace_sel) /* update current selection in clip */ tracking->act_track= new_track; + if(replace_rot) /* update track used for rotation stabilization */ + tracking->stabilization.rot_track= new_track; + BLI_addtail(&tracks, new_track); } @@ -2445,8 +2451,8 @@ static void calculate_stabdata(MovieTracking *tracking, int framenr, float width *scale= (stab->scale-1.0f)*stab->scaleinf+1.0f; *angle= 0.0f; - loc[0]= (firstmedian[0]-median[0])*width*(*scale); - loc[1]= (firstmedian[1]-median[1])*height*(*scale); + loc[0]= (firstmedian[0]-median[0])*width; + loc[1]= (firstmedian[1]-median[1])*height; mul_v2_fl(loc, stab->locinf); @@ -2479,6 +2485,7 @@ static float stabilization_auto_scale_factor(MovieTracking *tracking, int width, { float firstmedian[2]; MovieTrackingStabilization *stab= &tracking->stabilization; + float aspect= tracking->camera.pixel_aspect; if(stab->ok) return stab->scale; @@ -2529,7 +2536,7 @@ static float stabilization_auto_scale_factor(MovieTracking *tracking, int width, float mat[4][4]; float points[4][2]={{0.0f, 0.0f}, {0.0f, height}, {width, height}, {width, 0.0f}}; - BKE_tracking_stabdata_to_mat4(width, height, loc, scale, angle, mat); + BKE_tracking_stabdata_to_mat4(width, height, aspect, loc, scale, angle, mat); for(i= 0; i<4; i++) { int j; @@ -2644,6 +2651,7 @@ ImBuf *BKE_tracking_stabilize(MovieTracking *tracking, int framenr, ImBuf *ibuf, MovieTrackingStabilization *stab= &tracking->stabilization; ImBuf *tmpibuf; float width= ibuf->x, height= ibuf->y; + float aspect= tracking->camera.pixel_aspect; if(loc) copy_v2_v2(tloc, loc); if(scale) tscale= *scale; @@ -2680,19 +2688,26 @@ ImBuf *BKE_tracking_stabilize(MovieTracking *tracking, int framenr, ImBuf *ibuf, IMB_rectcpy(tmpibuf, ibuf, tloc[0]-(tscale-1.0f)*width/2.0f, tloc[1]-(tscale-1.0f)*height/2.0f, 0, 0, ibuf->x, ibuf->y); } else { float mat[4][4]; - int i, j; + int i, j, filter= tracking->stabilization.filter; + void (*interpolation) (struct ImBuf*, struct ImBuf*, float, float, int, int) = NULL; - BKE_tracking_stabdata_to_mat4(ibuf->x, ibuf->y, tloc, tscale, tangle, mat); + BKE_tracking_stabdata_to_mat4(ibuf->x, ibuf->y, aspect, tloc, tscale, tangle, mat); invert_m4(mat); + if(filter == TRACKING_FILTER_NEAREAST) + interpolation = neareast_interpolation; + else if(filter == TRACKING_FILTER_BILINEAR) + interpolation = bilinear_interpolation; + else if(filter == TRACKING_FILTER_BICUBIC) + interpolation = bicubic_interpolation; + for(j=0; j<tmpibuf->y; j++) { for(i=0; i<tmpibuf->x;i++) { float vec[3]= {i, j, 0}; mul_v3_m4v3(vec, mat, vec); - /* TODO: add selector for interpolation method */ - neareast_interpolation(ibuf, tmpibuf, vec[0], vec[1], i, j); + interpolation(ibuf, tmpibuf, vec[0], vec[1], i, j); } } } @@ -2709,15 +2724,20 @@ ImBuf *BKE_tracking_stabilize(MovieTracking *tracking, int framenr, ImBuf *ibuf, return tmpibuf; } -void BKE_tracking_stabdata_to_mat4(int width, int height, float loc[2], float scale, float angle, float mat[4][4]) +void BKE_tracking_stabdata_to_mat4(int width, int height, float aspect, float loc[2], float scale, float angle, float mat[4][4]) { - float lmat[4][4], rmat[4][4], smat[4][4], cmat[4][4], icmat[4][4]; + float lmat[4][4], rmat[4][4], smat[4][4], cmat[4][4], icmat[4][4], amat[4][4], iamat[4][4]; float svec[3]= {scale, scale, scale}; unit_m4(rmat); unit_m4(lmat); unit_m4(smat); unit_m4(cmat); + unit_m4(amat); + + /* aspect ratio correction matrix */ + amat[0][0] = 1.0f / aspect; + invert_m4_m4(iamat, amat); /* image center as rotation center */ cmat[3][0]= (float)width/2.0f; @@ -2725,11 +2745,11 @@ void BKE_tracking_stabdata_to_mat4(int width, int height, float loc[2], float sc invert_m4_m4(icmat, cmat); size_to_mat4(smat, svec); /* scale matrix */ - add_v2_v2(lmat[3], loc); /* tranlation matrix */ + add_v2_v2(lmat[3], loc); /* translation matrix */ rotate_m4(rmat, 'Z', angle); /* rotation matrix */ /* compose transformation matrix */ - mul_serie_m4(mat, lmat, cmat, rmat, smat, icmat, NULL, NULL, NULL); + mul_serie_m4(mat, amat, lmat, cmat, rmat, smat, icmat, iamat, NULL); } MovieDistortion *BKE_tracking_distortion_create(void) diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index c4c3eb4a8b2..e9f7823dfe8 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -1244,7 +1244,7 @@ static void ffmpeg_set_expert_options(RenderData *rd) * The other options were taken from the libx264-default.preset * included in the ffmpeg distribution. */ -// ffmpeg_property_add_string(rd, "video", "flags:loop"); // this breakes compatibility for QT +// ffmpeg_property_add_string(rd, "video", "flags:loop"); // this breaks compatibility for QT ffmpeg_property_add_string(rd, "video", "cmp:chroma"); ffmpeg_property_add_string(rd, "video", "partitions:parti4x4"); ffmpeg_property_add_string(rd, "video", "partitions:partp8x8"); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index a0811fb0fcd..111d0a079e4 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6124,6 +6124,8 @@ static void direct_link_movieclip(FileData *fd, MovieClip *clip) MovieTracking *tracking= &clip->tracking; MovieTrackingObject *object; + clip->adt= newdataadr(fd, clip->adt); + if(fd->movieclipmap) clip->cache= newmclipadr(fd, clip->cache); else clip->cache= NULL; @@ -6161,6 +6163,9 @@ static void lib_link_movieclip(FileData *fd, Main *main) clip= main->movieclip.first; while(clip) { if(clip->id.flag & LIB_NEEDLINK) { + if (clip->adt) + lib_link_animdata(fd, &clip->id, clip->adt); + clip->gpd= newlibadr_us(fd, clip->id.lib, clip->gpd); clip->id.flag -= LIB_NEEDLINK; @@ -14154,6 +14159,11 @@ static void expand_sound(FileData *fd, Main *mainvar, bSound *snd) expand_doit(fd, mainvar, snd->ipo); // XXX depreceated - old animation system } +static void expand_movieclip(FileData *fd, Main *mainvar, MovieClip *clip) +{ + if (clip->adt) + expand_animdata(fd, mainvar, clip->adt); +} static void expand_main(FileData *fd, Main *mainvar) { @@ -14237,6 +14247,10 @@ static void expand_main(FileData *fd, Main *mainvar) break; case ID_PA: expand_particlesettings(fd, mainvar, (ParticleSettings *)id); + break; + case ID_MC: + expand_movieclip(fd, mainvar, (MovieClip *)id); + break; } doit= 1; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 1971ffca4df..a6a61286fb1 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2678,6 +2678,9 @@ static void write_movieclips(WriteData *wd, ListBase *idbase) MovieTrackingObject *object; writestruct(wd, ID_MC, "MovieClip", 1, clip); + if(clip->adt) + write_animdata(wd, clip->adt); + write_movieTracks(wd, &tracking->tracks); write_movieReconstruction(wd, &tracking->reconstruction); diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 49fa7837de6..6dda09a1451 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -1269,13 +1269,14 @@ void clip_draw_main(SpaceClip *sc, ARegion *ar, Scene *scene) if(ibuf) { float loc[2]; + float aspect= clip->tracking.camera.pixel_aspect; if(width != ibuf->x) mul_v2_v2fl(loc, sc->loc, (float)width / ibuf->x); else copy_v2_v2(loc, sc->loc); - BKE_tracking_stabdata_to_mat4(width, height, loc, sc->scale, sc->angle, sc->stabmat); + BKE_tracking_stabdata_to_mat4(width, height, aspect, loc, sc->scale, sc->angle, sc->stabmat); unit_m4(smat); smat[0][0]= 1.0f/width; diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index e1fe3788d05..3b7992e0468 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -886,6 +886,11 @@ static int image_replace_exec(bContext *C, wmOperator *op) /* we cant do much if the str is longer then FILE_MAX :/ */ BLI_strncpy(sima->image->name, str, sizeof(sima->image->name)); + if (BLI_testextensie_array(str, imb_ext_movie)) + sima->image->source= IMA_SRC_MOVIE; + else + sima->image->source= IMA_SRC_FILE; + /* XXX unpackImage frees image buffers */ ED_preview_kill_jobs(C); diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 60da368321f..61f08a84ac7 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -473,6 +473,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) uiBut *but; uiLayout *row; const float dpi_fac= UI_DPI_FAC; + int is_paint = 0; RNA_pointer_create(&screen->id, &RNA_SpaceView3D, v3d, &v3dptr); RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &toolsptr); @@ -487,6 +488,8 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) /* mode */ if(ob) { v3d->modeselect = ob->mode; + is_paint = ELEM5(ob->mode, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, + OB_MODE_TEXTURE_PAINT, OB_MODE_PARTICLE_EDIT); } else { v3d->modeselect = OB_MODE_OBJECT; @@ -499,20 +502,21 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) /* Draw type */ uiItemR(layout, &v3dptr, "viewport_shade", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); - if (obedit==NULL && ((ob && ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)))) { - /* Manipulators aren't used in weight paint mode */ - - PointerRNA meshptr; + if (obedit==NULL && is_paint) { + /* Manipulators aren't used in paint modes */ + if (!ELEM(ob->mode, OB_MODE_SCULPT, OB_MODE_PARTICLE_EDIT)) { + /* masks aren't used for sculpt and particle painting */ + PointerRNA meshptr; - RNA_pointer_create(&ob->id, &RNA_Mesh, ob->data, &meshptr); - if(ob->mode & (OB_MODE_TEXTURE_PAINT|OB_MODE_VERTEX_PAINT)) { - uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); - } - else { - - row= uiLayoutRow(layout, 1); - uiItemR(row, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); - uiItemR(row, &meshptr, "use_paint_mask_vertex", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + RNA_pointer_create(&ob->id, &RNA_Mesh, ob->data, &meshptr); + if(ob->mode & (OB_MODE_TEXTURE_PAINT|OB_MODE_VERTEX_PAINT)) { + uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + } + else { + row= uiLayoutRow(layout, 1); + uiItemR(row, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + uiItemR(row, &meshptr, "use_paint_mask_vertex", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + } } } else { const char *str_menu; diff --git a/source/blender/makesdna/DNA_movieclip_types.h b/source/blender/makesdna/DNA_movieclip_types.h index 80728cd9817..71029293d09 100644 --- a/source/blender/makesdna/DNA_movieclip_types.h +++ b/source/blender/makesdna/DNA_movieclip_types.h @@ -39,6 +39,7 @@ #include "DNA_tracking_types.h" struct anim; +struct AnimData; struct bGPdata; struct ImBuf; struct MovieClipProxy; @@ -61,6 +62,7 @@ typedef struct MovieClipProxy { typedef struct MovieClip { ID id; + struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */ char name[1024]; /* file path, 1024 = FILE_MAX */ diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h index 1b41131c07d..e81344d7d51 100644 --- a/source/blender/makesdna/DNA_tracking_types.h +++ b/source/blender/makesdna/DNA_tracking_types.h @@ -159,8 +159,10 @@ typedef struct MovieTrackingStabilization { float locinf, scaleinf, rotinf; /* influence on location, scale and rotation */ + int filter; /* filter used for pixel interpolation */ + /* some pre-computing run-time variables */ - int ok, pad; /* are precomputed values and scaled buf relevant? */ + int ok; /* are precomputed values and scaled buf relevant? */ float scale; /* autoscale factor */ struct ImBuf *scaleibuf; /* currently scaled ibuf */ @@ -258,6 +260,11 @@ enum { #define TRACKING_AUTOSCALE (1<<1) #define TRACKING_STABILIZE_ROTATION (1<<2) +/* MovieTrackingStrabilization->filter */ +#define TRACKING_FILTER_NEAREAST 0 +#define TRACKING_FILTER_BILINEAR 1 +#define TRACKING_FILTER_BICUBIC 2 + /* MovieTrackingReconstruction->flag */ #define TRACKING_RECONSTRUCTED (1<<0) diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c index 1d79040c4eb..a640f996b1a 100644 --- a/source/blender/makesrna/intern/rna_movieclip.c +++ b/source/blender/makesrna/intern/rna_movieclip.c @@ -88,57 +88,70 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna) /* build proxy sized */ prop= RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_25); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "25%", "Build proxy resolution 25% of the original footage dimension"); prop= RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_50); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "50%", "Build proxy resolution 50% of the original footage dimension"); prop= RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_75); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "75%", "Build proxy resolution 75% of the original footage dimension"); prop= RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_100); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "100%", "Build proxy resolution 100% of the original footage dimension"); prop= RNA_def_property(srna, "build_undistorted_25", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_25); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "25%", "Build proxy resolution 25% of the original undistorted footage dimension"); prop= RNA_def_property(srna, "build_undistorted_50", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_50); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "50%", "Build proxy resolution 50% of the original undistorted footage dimension"); prop= RNA_def_property(srna, "build_undistorted_75", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_75); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "75%", "Build proxy resolution 75% of the original undistorted footage dimension"); prop= RNA_def_property(srna, "build_undistorted_100", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_100); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "100%", "Build proxy resolution 100% of the original undistorted footage dimension"); /* build timecodes */ prop= RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_RECORD_RUN); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Rec Run", "Build record run time code index"); prop= RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_FREE_RUN); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Free Run", "Build free run time code index"); prop= RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Free Run (Rec Date)", "Build free run time code index using Record Date/Time"); /* quality of proxied image */ prop= RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "quality"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Quality", "JPEG quality of proxy images"); RNA_def_property_ui_range(prop, 1, 100, 1, 0); prop= RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "tc"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_items(prop, clip_tc_items); RNA_def_property_ui_text(prop, "Timecode", ""); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); @@ -146,6 +159,7 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna) /* directory */ prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH); RNA_def_property_string_sdna(prop, NULL, "dir"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update"); } @@ -223,6 +237,7 @@ static void rna_def_movieclip(BlenderRNA *brna) /* use proxy */ prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Use Proxy / Timecode", "Use a preview proxy and/or timecode index for this clip"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); @@ -247,6 +262,7 @@ static void rna_def_movieclip(BlenderRNA *brna) /* custom proxy directory */ prop= RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY_CUSTOM_DIR); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Create proxy images in a custom directory (default is movie location)"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update"); diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index aff8a85dd26..e4ce7304577 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -54,6 +54,11 @@ #include "WM_api.h" +static char *rna_tracking_path(PointerRNA *UNUSED(ptr)) +{ + return BLI_sprintfN("tracking"); +} + static void rna_tracking_defaultSettings_levelsUpdate(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) { MovieClip *clip= (MovieClip*)ptr->id.data; @@ -88,6 +93,13 @@ static void rna_tracking_defaultSettings_searchUpdate(Main *UNUSED(bmain), Scene settings->default_pattern_size= settings->default_search_size; } +static char *rna_trackingTrack_path(PointerRNA *ptr) +{ + MovieTrackingTrack *track = (MovieTrackingTrack *) ptr->data; + + return BLI_sprintfN("tracking.tracks[\"%s\"]", track->name); +} + static void rna_trackingTracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { MovieClip *clip= (MovieClip*)ptr->id.data; @@ -228,6 +240,11 @@ static void rna_tracking_trackerPyramid_update(Main *UNUSED(bmain), Scene *UNUSE BKE_tracking_clamp_track(track, CLAMP_PYRAMID_LEVELS); } +static char *rna_trackingCamera_path(PointerRNA *UNUSED(ptr)) +{ + return BLI_sprintfN("tracking.camera"); +} + static float rna_trackingCamera_focal_mm_get(PointerRNA *ptr) { MovieClip *clip= (MovieClip*)ptr->id.data; @@ -252,6 +269,11 @@ static void rna_trackingCamera_focal_mm_set(PointerRNA *ptr, float value) camera->focal= value; } +static char *rna_trackingStabilization_path(PointerRNA *UNUSED(ptr)) +{ + return BLI_sprintfN("tracking.stabilization"); +} + static int rna_track_2d_stabilization(CollectionPropertyIterator *UNUSED(iter), void *data) { MovieTrackingTrack *track= (MovieTrackingTrack*)data; @@ -681,11 +703,13 @@ static void rna_def_trackingCamera(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "MovieTrackingCamera", NULL); + RNA_def_struct_path_func(srna, "rna_trackingCamera_path"); RNA_def_struct_ui_text(srna, "Movie tracking camera data", "Match-moving camera data for tracking"); /* Sensor */ prop= RNA_def_property(srna, "sensor_width", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sensor_width"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0f, 500.0f); RNA_def_property_ui_text(prop, "Sensor", "Width of CCD sensor in millimeters"); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); @@ -693,6 +717,7 @@ static void rna_def_trackingCamera(BlenderRNA *brna) /* Focal Length */ prop= RNA_def_property(srna, "focal_length", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "focal"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0001f, 5000.0f); RNA_def_property_float_funcs(prop, "rna_trackingCamera_focal_mm_get", "rna_trackingCamera_focal_mm_set", NULL); RNA_def_property_ui_text(prop, "Focal Length", "Camera's focal length"); @@ -701,6 +726,7 @@ static void rna_def_trackingCamera(BlenderRNA *brna) /* Focal Length in pixels */ prop= RNA_def_property(srna, "focal_length_pixels", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "focal"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0f, 5000.0f); RNA_def_property_ui_text(prop, "Focal Length", "Camera's focal length"); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); @@ -709,6 +735,7 @@ static void rna_def_trackingCamera(BlenderRNA *brna) prop= RNA_def_property(srna, "units", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "units"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_items(prop, camera_units_items); RNA_def_property_ui_text(prop, "Units", "Units used for camera focal length"); @@ -716,24 +743,28 @@ static void rna_def_trackingCamera(BlenderRNA *brna) prop= RNA_def_property(srna, "principal", PROP_FLOAT, PROP_NONE); RNA_def_property_array(prop, 2); RNA_def_property_float_sdna(prop, NULL, "principal"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Principal Point", "Optical center of lens"); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL); /* Radial distortion parameters */ prop= RNA_def_property(srna, "k1", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "k1"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_range(prop, -10, 10, .1, 3); RNA_def_property_ui_text(prop, "K1", "First coefficient of third order polynomial radial distortion"); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_flushUpdate"); prop= RNA_def_property(srna, "k2", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "k2"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_range(prop, -10, 10, .1, 3); RNA_def_property_ui_text(prop, "K2", "Second coefficient of third order polynomial radial distortion"); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_flushUpdate"); prop= RNA_def_property(srna, "k3", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "k3"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_range(prop, -10, 10, .1, 3); RNA_def_property_ui_text(prop, "K3", "Third coefficient of third order polynomial radial distortion"); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_flushUpdate"); @@ -741,8 +772,10 @@ static void rna_def_trackingCamera(BlenderRNA *brna) /* pixel aspect */ prop= RNA_def_property(srna, "pixel_aspect", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "pixel_aspect"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.1f, 5000.0f); RNA_def_property_ui_range(prop, 0.1f, 5000.0f, 1, 2); + RNA_def_property_float_default(prop, 1.0f); RNA_def_property_ui_text(prop, "Pixel Aspect Ratio", "Pixel aspect ratio"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); } @@ -822,6 +855,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) rna_def_trackingMarker(brna); srna= RNA_def_struct(brna, "MovieTrackingTrack", NULL); + RNA_def_struct_path_func(srna, "rna_trackingTrack_path"); RNA_def_struct_ui_text(srna, "Movie tracking track data", "Match-moving track data for tracking"); RNA_def_struct_ui_icon(srna, ICON_ANIM_DATA); @@ -838,6 +872,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) RNA_def_property_array(prop, 2); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5); RNA_def_property_float_sdna(prop, NULL, "pat_min"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Pattern Min", "Left-bottom corner of pattern area in normalized coordinates relative to marker position"); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerPattern_update"); @@ -845,6 +880,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) RNA_def_property_array(prop, 2); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5); RNA_def_property_float_sdna(prop, NULL, "pat_max"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Pattern Max", "Right-bottom corner of pattern area in normalized coordinates relative to marker position"); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerPattern_update"); @@ -853,6 +889,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) RNA_def_property_array(prop, 2); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5); RNA_def_property_float_sdna(prop, NULL, "search_min"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Search Min", "Left-bottom corner of search area in normalized coordinates relative to marker position"); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerSearch_update"); @@ -860,6 +897,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) RNA_def_property_array(prop, 2); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 5); RNA_def_property_float_sdna(prop, NULL, "search_max"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Search Max", "Right-bottom corner of search area in normalized coordinates relative to marker position"); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerSearch_update"); @@ -867,6 +905,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) prop= RNA_def_property(srna, "frames_limit", PROP_INT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_int_sdna(prop, NULL, "frames_limit"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0, SHRT_MAX); RNA_def_property_ui_text(prop, "Frames Limit", "Every tracking cycle, this number of frames are tracked"); @@ -874,6 +913,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) prop= RNA_def_property(srna, "pattern_match", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_sdna(prop, NULL, "pattern_match"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_items(prop, pattern_match_items); RNA_def_property_ui_text(prop, "Pattern Match", "Track pattern from given frame when tracking marker to next frame"); @@ -881,6 +921,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) prop= RNA_def_property(srna, "margin", PROP_INT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_int_sdna(prop, NULL, "margin"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0, 300); RNA_def_property_ui_text(prop, "Margin", "Distance from image boudary at which marker stops tracking"); @@ -888,6 +929,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) prop= RNA_def_property(srna, "tracker", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_items(prop, tracker_items); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Tracker", "Tracking algorithm to use"); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerAlgorithm_update"); @@ -895,6 +937,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) prop= RNA_def_property(srna, "pyramid_levels", PROP_INT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_int_sdna(prop, NULL, "pyramid_levels"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 1, 16); RNA_def_property_ui_text(prop, "Pyramid levels", "Number of pyramid levels (increase on blurry footage)"); RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerPyramid_update"); @@ -919,24 +962,28 @@ static void rna_def_trackingTrack(BlenderRNA *brna) /* use_red_channel */ prop= RNA_def_property(srna, "use_red_channel", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TRACK_DISABLE_RED); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Use Red Channel", "Use red channel from footage for tracking"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); /* use_green_channel */ prop= RNA_def_property(srna, "use_green_channel", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TRACK_DISABLE_GREEN); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Use Green Channel", "Use green channel from footage for tracking"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); /* use_blue_channel */ prop= RNA_def_property(srna, "use_blue_channel", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TRACK_DISABLE_BLUE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Use Blue Channel", "Use blue channel from footage for tracking"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); /* preview_grayscale */ prop= RNA_def_property(srna, "use_grayscale_preview", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_PREVIEW_GRAYSCALE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Grayscale", "Display what the tracking algorithm sees in the preview"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); @@ -956,6 +1003,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) /* hide */ prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_HIDDEN); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Hide", "Track is hidden"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); @@ -986,12 +1034,14 @@ static void rna_def_trackingTrack(BlenderRNA *brna) /* locked */ prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_LOCKED); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Lock", "Track is locked and all changes to it are disabled"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); /* custom color */ prop= RNA_def_property(srna, "use_custom_color", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_CUSTOMCOLOR); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Custom Color", "Use custom color instead of theme-defined"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); @@ -1014,12 +1064,20 @@ static void rna_def_trackingStabilization(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; + static EnumPropertyItem filter_items[] = { + {TRACKING_FILTER_NEAREAST, "NEAREST", 0, "Nearest", ""}, + {TRACKING_FILTER_BILINEAR, "BILINEAR", 0, "Bilinear", ""}, + {TRACKING_FILTER_BICUBIC, "BICUBIC", 0, "Bicubic", ""}, + {0, NULL, 0, NULL, NULL}}; + srna= RNA_def_struct(brna, "MovieTrackingStabilization", NULL); + RNA_def_struct_path_func(srna, "rna_trackingStabilization_path"); RNA_def_struct_ui_text(srna, "Movie tracking stabilization data", "Match-moving stabilization data for tracking"); /* 2d stabilization */ prop= RNA_def_property(srna, "use_2d_stabilization", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_2D_STABILIZATION); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Use 2D stabilization", "Use 2D stabilization for footage"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); @@ -1040,12 +1098,14 @@ static void rna_def_trackingStabilization(BlenderRNA *brna) /* active track index */ prop= RNA_def_property(srna, "active_track_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "act_track"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_int_funcs(prop, "rna_tracking_stabTracks_active_index_get", "rna_tracking_stabTracks_active_index_set", "rna_tracking_stabTracks_active_index_range"); RNA_def_property_ui_text(prop, "Active Track Index", "Index of active track in stabilization tracks list"); /* autoscale */ prop= RNA_def_property(srna, "use_autoscale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_AUTOSCALE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Autoscale", "Automatically scale footage to cover unfilled areas when stabilizating"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); @@ -1072,6 +1132,7 @@ static void rna_def_trackingStabilization(BlenderRNA *brna) /* use_stabilize_rotation */ prop= RNA_def_property(srna, "use_stabilize_rotation", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_STABILIZE_ROTATION); RNA_def_property_ui_text(prop, "Stabilize Rotation", "Stabilize horizon line on the shot"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); @@ -1082,6 +1143,13 @@ static void rna_def_trackingStabilization(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Rotation Influence", "Influence of stabilization algorithm on footage rotation"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); + + /* filter */ + prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "filter"); + RNA_def_property_enum_items(prop, filter_items); + RNA_def_property_ui_text(prop, "Filter", "Method to use to filter stabilization"); + RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate"); } static void rna_def_reconstructedCamera(BlenderRNA *brna) @@ -1280,6 +1348,7 @@ static void rna_def_tracking(BlenderRNA *brna) rna_def_trackingObject(brna); srna= RNA_def_struct(brna, "MovieTracking", NULL); + RNA_def_struct_path_func(srna, "rna_tracking_path"); RNA_def_struct_ui_text(srna, "Movie tracking data", "Match-moving data for tracking"); /* settings */ @@ -1315,6 +1384,7 @@ static void rna_def_tracking(BlenderRNA *brna) /* active object index */ prop= RNA_def_property(srna, "active_object_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "objectnr"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_int_funcs(prop, "rna_tracking_active_object_index_get", "rna_tracking_active_object_index_set", "rna_tracking_active_object_index_range"); RNA_def_property_ui_text(prop, "Active Object Index", "Index of active object"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 8e3178a6298..1bfed372626 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -698,7 +698,10 @@ static void rna_def_panel(BlenderRNA *brna) "name of the class used to define the panel. For example, if the " "class name is \"OBJECT_PT_hello\", and bl_idname is not set by the " "script, then bl_idname = \"OBJECT_PT_hello\""); - + + /* panel's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime + * when drawing panel and having this flag set will make runtime switching of language much more tricky + * because label will be stored translated */ prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->label"); RNA_def_property_flag(prop, PROP_REGISTER); @@ -823,7 +826,10 @@ static void rna_def_menu(BlenderRNA *brna) "class name is \"OBJECT_MT_hello\", and bl_idname is not set by the " "script, then bl_idname = \"OBJECT_MT_hello\")"); - prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE); + /* menu's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime + * when drawing panel and having this flag set will make runtime switching of language much more tricky + * because label will be stored translated */ + prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->label"); RNA_def_property_flag(prop, PROP_REGISTER); RNA_def_property_ui_text(prop, "Label", "The menu label"); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index f7c85583150..919ee215f29 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2827,7 +2827,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) {24, "KOREAN", 0, "Korean (한국 언어)", "ko_KR"}, {25, "NEPALI", 0, "Nepali (नेपाली)", "ne_NP"}, /* using the utf8 flipped form of Persian (فارسی) */ - {26, "PERSIAN", 0, "Persian (ﯽﺳﺭﺎﻓ)", "fa_PE"}, + {26, "PERSIAN", 0, "Persian (ﯽﺳﺭﺎﻓ)", "fa_IR"}, {19, "POLISH", 0, "Polish (Polski)", "pl_PL"}, {20, "ROMANIAN", 0, "Romanian (Român)", "ro_RO"}, {17, "SERBIAN", 0, "Serbian (Српски)", "sr_RS"}, diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 4f8f301dcbd..07c8552008a 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -1245,6 +1245,9 @@ static void rna_def_operator(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP); RNA_def_struct_name_property(srna, prop); + /* operator's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime + * when drawing panel and having this flag set will make runtime switching of language much more tricky + * because label will be stored translated */ prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->name"); RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */ @@ -1306,7 +1309,10 @@ static void rna_def_macro_operator(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP); RNA_def_struct_name_property(srna, prop); - prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE); + /* menu's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime + * when drawing panel and having this flag set will make runtime switching of language much more tricky + * because label will be stored translated */ + prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->name"); RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_label_set"); |