svn merge ^/trunk/blender -r42886:42902
authorCampbell Barton <ideasman42@gmail.com>
Tue, 27 Dec 2011 13:28:30 +0000 (13:28 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 27 Dec 2011 13:28:30 +0000 (13:28 +0000)
19 files changed:
CMakeLists.txt
SConstruct
build_files/scons/config/linuxcross-config.py
build_files/scons/config/win32-mingw-config.py
build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-vc-config.py
source/blender/blenkernel/BKE_global.h
source/blender/blenkernel/BKE_movieclip.h
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/tracking.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/space_clip/clip_ops.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_view3d/drawobject.c
source/blender/makesdna/DNA_mesh_types.h
source/blender/makesdna/DNA_movieclip_types.h
source/blender/quicktime/apple/qtkit_export.m
source/blender/windowmanager/intern/wm_operators.c
source/creator/CMakeLists.txt

index bdd6e5e00d1d0a140f86b0e7c704fcae8b7bee26..9de7eeb5ec2e34646738f8a12536447540135ffc 100644 (file)
@@ -660,7 +660,7 @@ elseif(WIN32)
        if(WITH_OPENAL)
                set(OPENAL ${LIBDIR}/openal)
                set(OPENAL_INCLUDE_DIR ${OPENAL}/include)
-               set(OPENAL_LIBRARY wrap_oal)
+               set(OPENAL_LIBRARY OpenAL32)
                set(OPENAL_LIBPATH ${OPENAL}/lib)
        endif()
 
index 1a03827840461a2e5cdbc34d4807691a91245fea..88444c6131485020679b5db7182bc6e8ae7b6953 100644 (file)
@@ -756,7 +756,6 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
 
     if env['WITH_BF_OPENAL']:
         dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
-        dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
 
     if env['WITH_BF_SNDFILE']:
         dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
index 5e2c1d67d1ff777079764eb23d72c804690d281d..7ec27af9ea82a1fa099766853ce51d04262086b4 100644 (file)
@@ -13,7 +13,7 @@ WITH_BF_OPENAL = True
 WITH_BF_STATICOPENAL = False
 BF_OPENAL = LIBDIR + '/openal'
 BF_OPENAL_INC = '${BF_OPENAL}/include'
-BF_OPENAL_LIB = 'OpenAL32 wrap_oal'
+BF_OPENAL_LIB = 'OpenAL32'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
 # Warning, this static lib configuration is untested! users of this OS please confirm.
 BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
index 6e65e093a46630dc0d337c3224f8f99fa68279db..d9fafbda5b04d3e9cc0c9894683402a4a3392a80 100644 (file)
@@ -14,7 +14,7 @@ BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION[0]}${BF_PY
 WITH_BF_OPENAL = True
 BF_OPENAL = LIBDIR + '/openal'
 BF_OPENAL_INC = '${BF_OPENAL}/include'
-BF_OPENAL_LIB = 'wrap_oal'
+BF_OPENAL_LIB = 'OpenAL32'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
 
 WITH_BF_FFMPEG = True
index 53ac9937885c5a66d913142a8bdc12c8f866a3d8..097740c4b858df7338f8b6a106d258cfadb5e78d 100644 (file)
@@ -20,7 +20,7 @@ BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
 WITH_BF_OPENAL = True
 BF_OPENAL = LIBDIR + '/openal'
 BF_OPENAL_INC = '${BF_OPENAL}/include '
-BF_OPENAL_LIB = 'wrap_oal'
+BF_OPENAL_LIB = 'OpenAL32'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
 
 WITH_BF_ICONV = True
index 74a526a59f71966c8314b1e073d76c8d8182af07..f502d3ac360a263e07c558c176f0bdfdf7c0027e 100644 (file)
@@ -20,7 +20,7 @@ BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
 WITH_BF_OPENAL = True
 BF_OPENAL = LIBDIR + '/openal'
 BF_OPENAL_INC = '${BF_OPENAL}/include '
-BF_OPENAL_LIB = 'wrap_oal'
+BF_OPENAL_LIB = 'OpenAL32'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
 
 WITH_BF_SNDFILE = True
index 5ccdd7c04af30628e628f28d769993d299840a08..7668d5392daa403f4ab806bfe0abae7b96a56c6b 100644 (file)
@@ -141,6 +141,7 @@ typedef struct Global {
 #define G_FILE_RECOVER                  (1 << 23)
 #define G_FILE_RELATIVE_REMAP   (1 << 24)
 #define G_FILE_HISTORY                  (1 << 25)
+#define G_FILE_MESH_COMPAT              (1 << 26)                              /* BMesh option to save as older mesh format */
 
 /* G.windowstate */
 #define G_WINDOWSTATE_USERDEF          0
index 4d16df8afa39a897b27ee6e3a41a648872137c0c..b41f038941de40e1fcc984e664974e52b2c48057 100644 (file)
@@ -60,7 +60,7 @@ void BKE_movieclip_update_scopes(struct MovieClip *clip, struct MovieClipUser *u
 
 void BKE_movieclip_get_cache_segments(struct MovieClip *clip, struct MovieClipUser *user, int *totseg_r, int **points_r);
 
-void BKE_movieclip_build_proxy_frame(struct MovieClip *clip, struct MovieDistortion *distortion,
+void BKE_movieclip_build_proxy_frame(struct MovieClip *clip, int clip_flag, struct MovieDistortion *distortion,
                        int cfra, int *build_sizes, int build_count, int undistorted);
 
 #define TRACK_CLEAR_UPTO               0
index 7b2cfd46d337e0152619aca49b2f7fc050ccb93e..10c060e0aabbb4f880ed9cfa22092f87bdcb16b3 100644 (file)
@@ -918,15 +918,17 @@ static void movieclip_build_proxy_ibuf(MovieClip *clip, ImBuf *ibuf, int cfra, i
        IMB_freeImBuf(scaleibuf);
 }
 
-void BKE_movieclip_build_proxy_frame(MovieClip *clip, struct MovieDistortion *distortion,
+void BKE_movieclip_build_proxy_frame(MovieClip *clip, int clip_flag, struct MovieDistortion *distortion,
                        int cfra, int *build_sizes, int build_count, int undistorted)
 {
        ImBuf *ibuf;
        MovieClipUser user;
 
        user.framenr= cfra;
+       user.render_flag= 0;
+       user.render_size= MCLIP_PROXY_RENDER_SIZE_FULL;
 
-       ibuf= BKE_movieclip_get_ibuf_flag(clip, &user, 0);
+       ibuf= BKE_movieclip_get_ibuf_flag(clip, &user, clip_flag);
 
        if(ibuf) {
                ImBuf *tmpibuf= ibuf;
index 04e8c3df0774c111c4c7f10062e9bcd147a73e7c..1a0007c5bfe3b94668c3593da8e5e2c09f6f1c2f 100644 (file)
@@ -730,6 +730,7 @@ typedef struct TrackContext {
 typedef struct MovieTrackingContext {
        MovieClipUser user;
        MovieClip *clip;
+       int clip_flag;
 
        int first_time, frames;
 
@@ -830,7 +831,20 @@ MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *u
        }
 
        context->clip= clip;
+
+       /* store needed clip flags passing to get_buffer functions
+        * - MCLIP_USE_PROXY is needed to because timecode affects on movie clip
+        *   only in case Proxy/Timecode flag is set, so store this flag to use
+        *   timecodes properly but reset render size to SIZE_FULL so correct resolution
+        *   would be used for images
+        * - MCLIP_USE_PROXY_CUSTOM_DIR is needed because proxy/timecode files might
+        *   be stored in a different location
+        * ignore all the rest pssible flags for now */
+       context->clip_flag= clip->flag&MCLIP_TIMECODE_FLAGS;
+
        context->user= *user;
+       context->user.render_size= 0;
+       context->user.render_flag= MCLIP_PROXY_RENDER_SIZE_FULL;
 
        if(!sequence)
                BLI_begin_threaded_malloc();
@@ -1044,7 +1058,7 @@ static ImBuf *get_frame_ibuf(MovieTrackingContext *context, int framenr)
 
        user.framenr= framenr;
 
-       ibuf= BKE_movieclip_get_ibuf_flag(context->clip, &user, 0);
+       ibuf= BKE_movieclip_get_ibuf_flag(context->clip, &user, context->clip_flag);
 
        return ibuf;
 }
@@ -1148,7 +1162,7 @@ int BKE_tracking_next(MovieTrackingContext *context)
        if(context->backwards) context->user.framenr--;
        else context->user.framenr++;
 
-       ibuf_new= BKE_movieclip_get_ibuf_flag(context->clip, &context->user, 0);
+       ibuf_new= BKE_movieclip_get_ibuf_flag(context->clip, &context->user, context->clip_flag);
        if(!ibuf_new)
                return 0;
 
index eb4321c57ec4f95269c211783ca162e4d58f0bed..e7847048faca126832aa46d85619e1e1a3266d96 100644 (file)
@@ -175,6 +175,10 @@ typedef struct {
        MemFile *compare, *current;
        
        int tot, count, error, memsize;
+
+#ifdef USE_MESH_FORWARDS_COMAT
+       char use_mesh_compat; /* option to save with older mesh format */
+#endif
 } WriteData;
 
 static WriteData *writedata_new(int file)
@@ -2666,7 +2670,10 @@ static void write_global(WriteData *wd, int fileflags, Main *mainvar)
        fg.curscene= screen->scene;
        fg.displaymode= G.displaymode;
        fg.winpos= G.winpos;
-       fg.fileflags= (fileflags & ~(G_FILE_NO_UI|G_FILE_RELATIVE_REMAP));      // prevent to save this, is not good convention, and feature with concerns...
+
+       /* prevent to save this, is not good convention, and feature with concerns... */
+       fg.fileflags= (fileflags & ~(G_FILE_NO_UI|G_FILE_RELATIVE_REMAP|G_FILE_MESH_COMPAT));
+
        fg.globalf= G.f;
        BLI_strncpy(fg.filename, mainvar->name, sizeof(fg.filename));
 
@@ -2709,7 +2716,11 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil
        blo_split_main(&mainlist, mainvar);
 
        wd= bgnwrite(handle, compare, current);
-       
+
+#ifdef USE_MESH_FORWARDS_COMAT
+       wd->use_mesh_compat = (write_flags & G_FILE_MESH_COMPAT) != 0;
+#endif
+
        sprintf(buf, "BLENDER%c%c%.3d", (sizeof(void*)==8)?'-':'_', (ENDIAN_ORDER==B_ENDIAN)?'V':'v', BLENDER_VERSION);
        mywrite(wd, buf, 12);
 
index 34726732a177fae94a3965699ee4f7d7314d68e7..fe0b58ddda9e3588b5a6c340378ff0810766086d 100644 (file)
@@ -827,6 +827,7 @@ typedef struct ProxyBuildJob {
        Scene *scene;
        struct Main *main;
        MovieClip *clip;
+       int clip_flag;
 } ProxyJob;
 
 static void proxy_freejob(void *pjv)
@@ -877,10 +878,10 @@ static void proxy_startjob(void *pjv, short *stop, short *do_update, float *prog
 
        for(cfra= sfra; cfra<=efra; cfra++) {
                if(clip->source != MCLIP_SRC_MOVIE)
-                       BKE_movieclip_build_proxy_frame(clip, NULL, cfra, build_sizes, build_count, 0);
+                       BKE_movieclip_build_proxy_frame(clip, pj->clip_flag, NULL, cfra, build_sizes, build_count, 0);
 
                if(undistort)
-                       BKE_movieclip_build_proxy_frame(clip, distortion, cfra, build_sizes, build_count, 1);
+                       BKE_movieclip_build_proxy_frame(clip, pj->clip_flag, distortion, cfra, build_sizes, build_count, 1);
 
                if(*stop || G.afbreek)
                        break;
@@ -911,6 +912,7 @@ static int clip_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op))
        pj->scene= scene;
        pj->main= CTX_data_main(C);
        pj->clip= clip;
+       pj->clip_flag= clip->flag&MCLIP_TIMECODE_FLAGS;
 
        WM_jobs_customdata(steve, pj, proxy_freejob);
        WM_jobs_timer(steve, 0.2, NC_MOVIECLIP|ND_DISPLAY, 0);
index 8a11c8815274a9ee8ca5ce82dafd8f6fb864376f..d911e68236b09b4bd9b99de06db2ccb476554c0c 100644 (file)
@@ -2406,7 +2406,8 @@ static int detect_features_exec(bContext *C, wmOperator *op)
 {
        SpaceClip *sc= CTX_wm_space_clip(C);
        MovieClip *clip= ED_space_clip(sc);
-       ImBuf *ibuf= BKE_movieclip_get_ibuf_flag(clip, &sc->user, 0);
+       int clip_flag= clip->flag&MCLIP_TIMECODE_FLAGS;
+       ImBuf *ibuf= BKE_movieclip_get_ibuf_flag(clip, &sc->user, clip_flag);
        MovieTrackingTrack *track= clip->tracking.tracks.first;
        int placement= RNA_enum_get(op->ptr, "placement");
        int margin= RNA_int_get(op->ptr, "margin");
index ea3fe09ff6986cb04500689dfcffc7abc69513d0..3a45f3eb5bbb26346195a4b3a411db5ca8c8dbe2 100644 (file)
@@ -2847,35 +2847,41 @@ static void draw_em_indices(BMEditMesh *em)
 
        /* For now, reuse appropriate theme colors from stats text colors */
        i= 0;
-       UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEANG, col);
-       BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
-               if (BM_TestHFlag(v, BM_SELECT)) {
-                       sprintf(val, "%d", i);
-                       view3d_cached_text_draw_add(v->co, val, 0, V3D_CACHE_TEXT_ASCII, col);
+       if (em->selectmode & SCE_SELECT_VERTEX) {
+               UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEANG, col);
+               BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
+                       if (BM_TestHFlag(v, BM_SELECT)) {
+                               sprintf(val, "%d", i);
+                               view3d_cached_text_draw_add(v->co, val, 0, V3D_CACHE_TEXT_ASCII, col);
+                       }
+                       i++;
                }
-               i++;
        }
 
-       i= 0;
-       UI_GetThemeColor3ubv(TH_DRAWEXTRA_EDGELEN, col);
-       BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
-               if (BM_TestHFlag(e, BM_SELECT)) {
-                       sprintf(val, "%d", i);
-                       mid_v3_v3v3(pos, e->v1->co, e->v2->co);
-                       view3d_cached_text_draw_add(pos, val, 0, V3D_CACHE_TEXT_ASCII, col);
+       if (em->selectmode & SCE_SELECT_EDGE) {
+               i= 0;
+               UI_GetThemeColor3ubv(TH_DRAWEXTRA_EDGELEN, col);
+               BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+                       if (BM_TestHFlag(e, BM_SELECT)) {
+                               sprintf(val, "%d", i);
+                               mid_v3_v3v3(pos, e->v1->co, e->v2->co);
+                               view3d_cached_text_draw_add(pos, val, 0, V3D_CACHE_TEXT_ASCII, col);
+                       }
+                       i++;
                }
-               i++;
        }
 
-       i= 0;
-       UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEAREA, col);
-       BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
-               if (BM_TestHFlag(f, BM_SELECT)) {
-                       BM_Compute_Face_CenterMean(bm, f, pos);
-                       sprintf(val, "%d", i);
-                       view3d_cached_text_draw_add(pos, val, 0, V3D_CACHE_TEXT_ASCII, col);
-               }
-               i++;
+       if (em->selectmode & SCE_SELECT_FACE) {
+               i= 0;
+               UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEAREA, col);
+               BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
+                       if (BM_TestHFlag(f, BM_SELECT)) {
+                               BM_Compute_Face_CenterMean(bm, f, pos);
+                               sprintf(val, "%d", i);
+                               view3d_cached_text_draw_add(pos, val, 0, V3D_CACHE_TEXT_ASCII, col);
+                       }
+                       i++;
+               }
        }
 }
 
index bb8c6083ea15a2d931c71e7e67dd57c8b6029544..18dd682bfaf94efba23d0ebde9d02a8695a5a743 100644 (file)
@@ -211,6 +211,8 @@ typedef struct TFace {
 
 /* this is so we can save bmesh files that load in trunk, ignoring NGons
  * will eventually be removed */
+
 #define USE_MESH_FORWARDS_COMAT
 
+
 #endif
index fc21f26fa32bce4980eadc4d525a2f1cdf26ef61..1a065741121177a034d6ca0d2edd14d6ae31400c 100644 (file)
@@ -113,6 +113,8 @@ typedef struct MovieClipScopes {
 #define MCLIP_USE_PROXY                                        (1<<0)
 #define MCLIP_USE_PROXY_CUSTOM_DIR             (1<<1)
 
+#define MCLIP_TIMECODE_FLAGS                   (MCLIP_USE_PROXY|MCLIP_USE_PROXY_CUSTOM_DIR)
+
 /* MovieClip->render_size */
 #define MCLIP_PROXY_RENDER_SIZE_FULL   0
 #define MCLIP_PROXY_RENDER_SIZE_25             1
index 8fd04026233836b80b2feaf37ae247b2bf86d3b4..b1fa00d3509d4cb94b350740fe6cf692048ca62b 100644 (file)
@@ -106,21 +106,26 @@ static struct QuicktimeExport *qtexport;
 /* Video codec */
 static QuicktimeCodecTypeDesc qtVideoCodecList[] = {
        {kRawCodecType, 1, "Uncompressed"},
-       {kJPEGCodecType, 2, "JPEG"},
-       {kMotionJPEGACodecType, 3, "M-JPEG A"},
-       {kMotionJPEGBCodecType, 4, "M-JPEG B"},
-       {kDVCPALCodecType, 5, "DV PAL"},
-       {kDVCNTSCCodecType, 6, "DV/DVCPRO NTSC"},
-       {kDVCPROHD720pCodecType, 7, "DVCPRO HD 720p"},
-       {kDVCPROHD1080i50CodecType, 8, "DVCPRO HD 1080i50"},
-       {kDVCPROHD1080i60CodecType, 9, "DVCPRO HD 1080i60"},
-       {kMPEG4VisualCodecType, 10, "MPEG4"},
-       {kH263CodecType, 11, "H.263"},
-       {kH264CodecType, 12, "H.264"},
-       {kAnimationCodecType, 13, "Animation"},
+       {k422YpCbCr8CodecType, 2, "Uncompressed 8-bit 4:2:2"},
+       {k422YpCbCr10CodecType, 3, "Uncompressed 10-bit 4:2:2"},
+       {kComponentVideoCodecType, 4, "Component Video"},
+       {kPixletCodecType, 5, "Pixlet"},
+       {kPNGCodecType, 6, "PNG"},
+       {kJPEGCodecType, 7, "JPEG"},
+       {kMotionJPEGACodecType, 8, "M-JPEG A"},
+       {kMotionJPEGBCodecType, 9, "M-JPEG B"},
+       {kDVCPALCodecType, 10, "DV PAL"},
+       {kDVCNTSCCodecType, 11, "DV/DVCPRO NTSC"},
+       {kDVCPROHD720pCodecType, 12, "DVCPRO HD 720p"},
+       {kDVCPROHD1080i50CodecType, 13, "DVCPRO HD 1080i50"},
+       {kDVCPROHD1080i60CodecType, 14, "DVCPRO HD 1080i60"},
+       {kMPEG4VisualCodecType, 15, "MPEG4"},
+       {kH263CodecType, 16, "H.263"},
+       {kH264CodecType, 17, "H.264"},
+       {kAnimationCodecType, 18, "Animation"},
        {0,0,NULL}};
 
-static int qtVideoCodecCount = 13;
+static int qtVideoCodecCount = 18;
 
 int quicktime_get_num_videocodecs() {
        return qtVideoCodecCount;
index b6f59418f0a7f96c885dc6801b09e000c218275a..db8f9794c886f21ba8c648e01cb3839ea49de646 100644 (file)
@@ -46,6 +46,7 @@
 #include "DNA_scene_types.h"
 #include "DNA_userdef_types.h"
 #include "DNA_windowmanager_types.h"
+#include "DNA_mesh_types.h" /* only for USE_MESH_FORWARDS_COMAT */
 
 #include "BLF_translation.h"
 
@@ -2011,6 +2012,9 @@ static void WM_OT_save_as_mainfile(wmOperatorType *ot)
        RNA_def_boolean(ot->srna, "compress", 0, "Compress", "Write compressed .blend file");
        RNA_def_boolean(ot->srna, "relative_remap", 1, "Remap Relative", "Remap relative paths when saving in a different directory");
        RNA_def_boolean(ot->srna, "copy", 0, "Save Copy", "Save a copy of the actual working state but does not make saved file active");
+#ifdef USE_MESH_FORWARDS_COMAT
+       RNA_def_boolean(ot->srna, "use_mesh_compat", 0, "Legacy Mesh Format", "Save using legacy mesh format (no ngons)");
+#endif
 }
 
 /* *************** save file directly ******** */
index 9bd9719ad8305af647fd62713895ac4bbc7c5799..ac21bf5b21f656df92b9356f314fc119917bc6a8 100644 (file)
@@ -532,7 +532,6 @@ elseif(WIN32)
                install(
                        FILES
                                ${LIBDIR}/openal/lib/OpenAL32.dll
-                               ${LIBDIR}/openal/lib/wrap_oal.dll
                        DESTINATION ${TARGETDIR}
                )
        endif()