Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-02-01 22:08:37 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-02-01 22:08:37 +0400
commitf193291b32bceeb91a5d0d69554d6e2d56538df0 (patch)
treeb4a0ada454ff2d3d0e69afae49c8a50a5eb4c756 /source/blender
parentd882f05b824f4111ef5c319c89a2f85b1773c579 (diff)
Movie Clip Editor: proxy sizes for original and undistortted footages are now controlling separately
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_clip/clip_ops.c44
-rw-r--r--source/blender/makesdna/DNA_movieclip_types.h13
-rw-r--r--source/blender/makesrna/intern/rna_movieclip.c26
3 files changed, 58 insertions, 25 deletions
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index 5053379d376..5d0f294b06a 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -834,6 +834,27 @@ static void proxy_freejob(void *pjv)
MEM_freeN(pj);
}
+static int proxy_bitflag_to_array(int size_flag, int build_sizes[4], int undistort)
+{
+ int build_count = 0;
+ int size_flags[2][4] = {{MCLIP_PROXY_SIZE_25,
+ MCLIP_PROXY_SIZE_50,
+ MCLIP_PROXY_SIZE_75,
+ MCLIP_PROXY_SIZE_100},
+ {MCLIP_PROXY_UNDISTORTED_SIZE_25,
+ MCLIP_PROXY_UNDISTORTED_SIZE_50,
+ MCLIP_PROXY_UNDISTORTED_SIZE_75,
+ MCLIP_PROXY_UNDISTORTED_SIZE_100}};
+ int size_nr = undistort ? 1 : 0;
+
+ if(size_flag & size_flags[size_nr][0]) build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_25;
+ if(size_flag & size_flags[size_nr][1]) build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_50;
+ if(size_flag & size_flags[size_nr][2]) build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_75;
+ if(size_flag & size_flags[size_nr][3]) build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_100;
+
+ return build_count;
+}
+
/* only this runs inside thread */
static void proxy_startjob(void *pjv, short *stop, short *do_update, float *progress)
{
@@ -841,22 +862,23 @@ static void proxy_startjob(void *pjv, short *stop, short *do_update, float *prog
Scene *scene=pj->scene;
MovieClip *clip= pj->clip;
struct MovieDistortion *distortion= NULL;
- int cfra, undistort;
- short tc_flag, size_flag, quality, build_flag;
- int sfra= SFRA, efra= EFRA;
+ short tc_flag, size_flag, quality;
+ int cfra, sfra= SFRA, efra= EFRA;
int build_sizes[4], build_count= 0;
+ int build_undistort_sizes[4], build_undistort_count= 0;
tc_flag= clip->proxy.build_tc_flag;
size_flag= clip->proxy.build_size_flag;
quality= clip->proxy.quality;
- build_flag= clip->proxy.build_flag;
- undistort= build_flag&MCLIP_PROXY_RENDER_UNDISTORT;
+
+ build_count= proxy_bitflag_to_array(size_flag, build_sizes, 0);
+ build_undistort_count= proxy_bitflag_to_array(size_flag, build_undistort_sizes, 1);
if(clip->source == MCLIP_SRC_MOVIE) {
if(clip->anim)
IMB_anim_index_rebuild(clip->anim, tc_flag, size_flag, quality, stop, do_update, progress);
- if(!undistort) {
+ if(!build_undistort_count) {
return;
}
else {
@@ -865,20 +887,14 @@ static void proxy_startjob(void *pjv, short *stop, short *do_update, float *prog
}
}
- if(size_flag&IMB_PROXY_25) build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_25;
- if(size_flag&IMB_PROXY_50) build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_50;
- if(size_flag&IMB_PROXY_75) build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_75;
- if(size_flag&IMB_PROXY_100) build_sizes[build_count++]= MCLIP_PROXY_RENDER_SIZE_100;
-
- if(undistort)
+ if(build_undistort_count)
distortion= BKE_tracking_distortion_create();
for(cfra= sfra; cfra<=efra; cfra++) {
if(clip->source != MCLIP_SRC_MOVIE)
BKE_movieclip_build_proxy_frame(clip, pj->clip_flag, NULL, cfra, build_sizes, build_count, 0);
- if(undistort)
- BKE_movieclip_build_proxy_frame(clip, pj->clip_flag, distortion, cfra, build_sizes, build_count, 1);
+ BKE_movieclip_build_proxy_frame(clip, pj->clip_flag, distortion, cfra, build_undistort_sizes, build_undistort_count, 1);
if(*stop || G.afbreek)
break;
diff --git a/source/blender/makesdna/DNA_movieclip_types.h b/source/blender/makesdna/DNA_movieclip_types.h
index 1a56c273922..e5c706d2a3a 100644
--- a/source/blender/makesdna/DNA_movieclip_types.h
+++ b/source/blender/makesdna/DNA_movieclip_types.h
@@ -57,8 +57,6 @@ typedef struct MovieClipProxy {
short quality; /* proxy build quality */
short build_size_flag; /* size flags (see below) of all proxies to build */
short build_tc_flag; /* time code flags (see below) of all tc indices to build */
- short build_flag, pad; /* other build flags */
- char pad2[4];
} MovieClipProxy;
typedef struct MovieClip {
@@ -98,8 +96,15 @@ typedef struct MovieClipScopes {
float slide_scale[2]; /* scale used for sliding from previewe area */
} MovieClipScopes;
-/* MovieClipProxy->build_flag */
-#define MCLIP_PROXY_BUILD_UNDISTORT 1 /* build undistorted proxies as well */
+/* MovieClipProxy->build_size_flag */
+#define MCLIP_PROXY_SIZE_25 (1<<0)
+#define MCLIP_PROXY_SIZE_50 (1<<1)
+#define MCLIP_PROXY_SIZE_75 (1<<2)
+#define MCLIP_PROXY_SIZE_100 (1<<3)
+#define MCLIP_PROXY_UNDISTORTED_SIZE_25 (1<<4)
+#define MCLIP_PROXY_UNDISTORTED_SIZE_50 (1<<5)
+#define MCLIP_PROXY_UNDISTORTED_SIZE_75 (1<<6)
+#define MCLIP_PROXY_UNDISTORTED_SIZE_100 (1<<7)
/* MovieClip->source */
#define MCLIP_SRC_SEQUENCE 1
diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c
index fbc6a0155f2..1d79040c4eb 100644
--- a/source/blender/makesrna/intern/rna_movieclip.c
+++ b/source/blender/makesrna/intern/rna_movieclip.c
@@ -87,24 +87,36 @@ 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", IMB_PROXY_25);
+ RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_25);
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", IMB_PROXY_50);
+ RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_50);
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", IMB_PROXY_75);
+ RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_75);
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", IMB_PROXY_100);
+ RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_100);
RNA_def_property_ui_text(prop, "100%", "Build proxy resolution 100% of the original footage dimension");
- prop= RNA_def_property(srna, "build_undistorted", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "build_flag", MCLIP_PROXY_BUILD_UNDISTORT);
- RNA_def_property_ui_text(prop, "Build Undistorted", "Also build undistorted proxies for selected sizes");
+ 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_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_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_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_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);