svn merge ^/trunk/blender -r43392:43420
authorCampbell Barton <ideasman42@gmail.com>
Mon, 16 Jan 2012 11:50:17 +0000 (11:50 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 16 Jan 2012 11:50:17 +0000 (11:50 +0000)
78 files changed:
release/scripts/modules/animsys_refactor.py
release/scripts/startup/bl_ui/space_clip.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/blenkernel/BKE_main.h
source/blender/blenkernel/BKE_movieclip.h
source/blender/blenkernel/BKE_tracking.h
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/tracking.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/armature/armature_ops.c
source/blender/editors/gpencil/gpencil_ops.c
source/blender/editors/interface/interface_ops.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/object/object_ops.c
source/blender/editors/physics/physics_ops.c
source/blender/editors/render/render_opengl.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_intern.h
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_clip/clip_editor.c
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_console/console_ops.c
source/blender/editors/space_console/space_console.c
source/blender/editors/space_file/space_file.c
source/blender/editors/space_graph/graph_ops.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_sequencer/sequencer_ops.c
source/blender/editors/space_text/space_text.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_ops.c
source/blender/editors/transform/transform_ops.c
source/blender/makesdna/DNA_brush_types.h
source/blender/makesdna/DNA_dynamicpaint_types.h
source/blender/makesdna/DNA_image_types.h
source/blender/makesdna/DNA_meta_types.h
source/blender/makesdna/DNA_movieclip_types.h
source/blender/makesdna/DNA_object_force.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_sound_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_texture_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/intern/rna_fluidsim.c
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_sculpt_paint.c
source/blender/makesrna/intern/rna_space.c
source/blender/python/intern/bpy_rna.c
source/blender/python/mathutils/mathutils_Matrix.c
source/blender/windowmanager/intern/wm_dragdrop.c
source/blender/windowmanager/intern/wm_operators.c
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_ShapeActionActuator.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
source/gameengine/Expressions/PyObjectPlus.h
source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
source/gameengine/GameLogic/SCA_ILogicBrick.h
source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
source/gameengine/GameLogic/SCA_KeyboardSensor.h
source/gameengine/GameLogic/SCA_PropertyActuator.cpp
source/gameengine/GameLogic/SCA_PropertySensor.cpp
source/gameengine/GameLogic/SCA_RandomActuator.cpp
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
source/gameengine/Ketsji/KX_ConstraintActuator.cpp
source/gameengine/Ketsji/KX_IpoActuator.cpp
source/gameengine/Ketsji/KX_RaySensor.cpp
source/gameengine/Ketsji/KX_SceneActuator.cpp
source/gameengine/Ketsji/KX_TouchSensor.cpp
source/gameengine/Rasterizer/RAS_TexVert.cpp

index 8db21e357d99da99a25aedee74f33465ba5c6a3e..097a0296a8ed19f0c105375cc122913b4913c737 100644 (file)
@@ -532,8 +532,6 @@ data_2_56_to_2_59 = (
     ("ShaderNodeMapping", "minimum", "min"),
     ("ShaderNodeMapping", "clamp_maximum", "use_max"),
     ("ShaderNodeMapping", "clamp_minimum", "use_min"),
-    ("VertexPaint", "all_faces", "use_all_faces"),
-    ("VertexPaint", "spray", "use_spray"),
     ("ParticleEdit", "add_keys", "default_key_count"),
     ("ParticleEdit", "selection_mode", "select_mode"),
     ("ParticleEdit", "auto_velocity", "use_auto_velocity"),
index aef6e317e776f8db847a049a77244350286dbe7e..0cf3a9211670e080dd295e5e529082af74019435 100644 (file)
@@ -515,6 +515,17 @@ class CLIP_PT_display(Panel):
         layout = self.layout
         sc = context.space_data
 
+        row = layout.row(align=True)
+        sub = row.row()
+        sub.prop(sc, "show_red_channel", text="R", toggle=True)
+        sub.prop(sc, "show_green_channel", text="G", toggle=True)
+        sub.prop(sc, "show_blue_channel", text="B", toggle=True)
+
+        row.separator()
+
+        sub = row.row()
+        sub.prop(sc, "use_grayscale_preview", text="B/W", toggle=True)
+
         col = layout.column(align=True)
 
         col.prop(sc, "show_marker_pattern", text="Pattern")
index 1e537c23ea3011519402243b38433a00038e4c6b..248452a0e8c35bf0a9158969ad1a1115c424cf8b 100644 (file)
@@ -1070,9 +1070,10 @@ class VIEW3D_PT_tools_weightpaint_options(PaintPanel, Panel):
         wpaint = tool_settings.weight_paint
 
         col = layout.column()
-        col.prop(wpaint, "use_all_faces")
+
         col.prop(wpaint, "use_normal")
         col.prop(wpaint, "use_spray")
+        col.prop(wpaint, "use_group_restrict")
 
         obj = context.weight_paint_object
         if obj.type == 'MESH':
index 28eb59ebdb623e0591c2e2f48da2e17e0bff9e9d..51bcd18fab6d236bf6bd6d8db7fbebecfcdc4065 100644 (file)
@@ -50,7 +50,7 @@ struct Library;
 
 typedef struct Main {
        struct Main *next, *prev;
-       char name[240];
+       char name[240]; /* 240 = FILE_MAX */
        short versionfile, subversionfile;
        short minversionfile, minsubversionfile;
        int revision;   /* svn revision of binary that saved file */
index b41f038941de40e1fcc984e664974e52b2c48057..6f404bf5feec32694d25a2576c1f7a08af968e47 100644 (file)
@@ -47,7 +47,8 @@ struct MovieClip *BKE_add_movieclip_file(const char *name);
 void BKE_movieclip_reload(struct MovieClip *clip);
 
 struct ImBuf *BKE_movieclip_get_ibuf(struct MovieClip *clip, struct MovieClipUser *user);
-struct ImBuf *BKE_movieclip_get_stable_ibuf(struct MovieClip *clip, struct MovieClipUser *user, float loc[2], float *scale, float *angle);
+struct ImBuf *BKE_movieclip_get_postprocessed_ibuf(struct MovieClip *clip, struct MovieClipUser *user, int postprocess_flag);
+struct ImBuf *BKE_movieclip_get_stable_ibuf(struct MovieClip *clip, struct MovieClipUser *user, float loc[2], float *scale, float *angle, int postprocess_flag);
 struct ImBuf *BKE_movieclip_get_ibuf_flag(struct MovieClip *clip, struct MovieClipUser *user, int flag);
 void BKE_movieclip_get_size(struct MovieClip *clip, struct MovieClipUser *user, int *width, int *height);
 void BKE_movieclip_aspect(struct MovieClip *clip, float *aspx, float *aspy);
@@ -63,8 +64,10 @@ void BKE_movieclip_get_cache_segments(struct MovieClip *clip, struct MovieClipUs
 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
-#define TRACK_CLEAR_REMAINED   1
-#define TRACK_CLEAR_ALL                        2
+/* postprocessing flags */
+#define MOVIECLIP_DISABLE_RED       (1<<0)
+#define MOVIECLIP_DISABLE_GREEN     (1<<1)
+#define MOVIECLIP_DISABLE_BLUE      (1<<2)
+#define MOVIECLIP_PREVIEW_GRAYSCALE (1<<3)
 
 #endif
index bd5790e1319064e979e3f6f6042ac2fc7e3622b3..d3f297ece8638f8db4a84331d7df8d99fa410ede 100644 (file)
@@ -97,6 +97,8 @@ struct ListBase *BKE_tracking_object_tracks(struct MovieTracking *tracking, stru
 struct MovieTrackingReconstruction *BKE_tracking_object_reconstruction(struct MovieTracking *tracking,
                        struct MovieTrackingObject *object);
 
+void BKE_tracking_disable_imbuf_channels(struct ImBuf *ibuf, int disable_red, int disable_green, int disable_blue, int grayscale);
+
 /* clipboard */
 void BKE_tracking_free_clipboard(void);
 void BKE_tracking_clipboard_copy_tracks(struct MovieTracking *tracking, struct MovieTrackingObject *object);
@@ -166,6 +168,10 @@ void BKE_tracking_deselect_track(struct MovieTrackingTrack *track, int area);
 
 #define MARKER_VISIBLE(sc, marker)                     (((marker)->flag&MARKER_DISABLED)==0 || ((sc)->flag&SC_HIDE_DISABLED)==0)
 
+#define TRACK_CLEAR_UPTO               0
+#define TRACK_CLEAR_REMAINED   1
+#define TRACK_CLEAR_ALL                        2
+
 #define CLAMP_PAT_DIM          1
 #define CLAMP_PAT_POS          2
 #define CLAMP_SEARCH_DIM       3
index 9e5917f0b073099edfdd10e2b531f2d08b5d1fef..ce337608cc5ee9452ae9b406c0c745570342af8c 100644 (file)
@@ -1608,7 +1608,7 @@ int BKE_write_ibuf(ImBuf *ibuf, const char *name, ImageFormatData *imf)
        return(ok);
 }
 
-/* same as BKE_write_ibuf_as but crappy workaround not to perminantly modify
+/* same as BKE_write_ibuf() but crappy workaround not to perminantly modify
  * _some_, values in the imbuf */
 int BKE_write_ibuf_as(ImBuf *ibuf, const char *name, ImageFormatData *imf,
                       const short save_copy)
index 33a6782244b2b72e9312d8c5c98c48ae0a091b67..3b1dc2973ad7fadd7cb54666121e0c9fed5214d9 100644 (file)
@@ -257,18 +257,30 @@ typedef struct MovieClipCache {
        /* regular movie cache */
        struct MovieCache *moviecache;
 
-       /* cache for stable shot */
-       int stable_framenr;
-       float stable_loc[2], stable_scale, stable_angle;
-       ImBuf *stableibuf;
-       int proxy;
-       short render_flag;
+       /* cached postprocessed shot */
+       struct {
+               ImBuf *ibuf;
+               int framenr;
+               int flag;
 
-       /* cache for undistorted shot */
-       int undist_framenr;
-       float principal[2];
-       float k1, k2, k3;
-       ImBuf *undistibuf;
+               /* cache for undistorted shot */
+               float principal[2];
+               float k1, k2, k3;
+               short undistoriton_used;
+
+               int proxy;
+               short render_flag;
+       } postprocessed;
+
+       /* cache for stable shot */
+       struct {
+               ImBuf *ibuf;
+               int framenr;
+
+               float loc[2], scale, angle;
+               int proxy;
+               short render_flag;
+       } stabilized;
 } MovieClipCache;
 
 typedef struct MovieClipImBufCacheKey {
@@ -465,111 +477,179 @@ static void real_ibuf_size(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, in
        }
 }
 
-static int need_undistorted_cache(MovieClipUser *user, int flag)
+static ImBuf *get_undistorted_ibuf(MovieClip *clip, struct MovieDistortion *distortion, ImBuf *ibuf)
+{
+       ImBuf *undistibuf;
+
+       /* XXX: because of #27997 do not use float buffers to undistort,
+               otherwise, undistorted proxy can be darker than it should */
+       imb_freerectfloatImBuf(ibuf);
+
+       if(distortion)
+               undistibuf= BKE_tracking_distortion_exec(distortion, &clip->tracking, ibuf, ibuf->x, ibuf->y, 0.0f, 1);
+       else
+               undistibuf= BKE_tracking_undistort(&clip->tracking, ibuf, ibuf->x, ibuf->y, 0.0f);
+
+       if(undistibuf->userflags&IB_RECT_INVALID) {
+               ibuf->userflags&= ~IB_RECT_INVALID;
+               IMB_rect_from_float(undistibuf);
+       }
+
+       IMB_scaleImBuf(undistibuf, ibuf->x, ibuf->y);
+
+       return undistibuf;
+}
+
+static int need_undistortion_postprocess(MovieClipUser *user, int flag)
 {
+       int result = 0;
+
        /* only full undistorted render can be used as on-fly undistorting image */
-       if(flag&MCLIP_USE_PROXY) {
-               if(user->render_size != MCLIP_PROXY_RENDER_SIZE_FULL || (user->render_flag&MCLIP_PROXY_RENDER_UNDISTORT)==0)
-                       return 0;
+       if(flag & MCLIP_USE_PROXY) {
+               result |= (user->render_size == MCLIP_PROXY_RENDER_SIZE_FULL) &&
+                         (user->render_flag & MCLIP_PROXY_RENDER_UNDISTORT) != 0;
        }
-       else return 0;
 
-       return 1;
+       return result;
 }
 
-static ImBuf *get_undistorted_cache(MovieClip *clip, MovieClipUser *user)
+static int need_postprocessed_frame(MovieClipUser *user, int flag, int postprocess_flag)
+{
+       int result = postprocess_flag;
+
+       result |= need_undistortion_postprocess(user, flag);
+
+       return result;
+}
+
+static int check_undistortion_cache_flags(MovieClip *clip)
 {
        MovieClipCache *cache= clip->cache;
        MovieTrackingCamera *camera= &clip->tracking.camera;
+
+       /* check for distortion model changes */
+       if(!equals_v2v2(camera->principal, cache->postprocessed.principal))
+               return 0;
+
+       if(!equals_v3v3(&camera->k1, &cache->postprocessed.k1))
+               return 0;
+
+       return 1;
+}
+
+static ImBuf *get_postprocessed_cached_frame(MovieClip *clip, MovieClipUser *user, int flag, int postprocess_flag)
+{
+       MovieClipCache *cache= clip->cache;
        int framenr= user->framenr;
+       short proxy= IMB_PROXY_NONE;
+       int render_flag= 0;
 
-       /* no cache or no cached undistorted image */
-       if(!clip->cache || !clip->cache->undistibuf)
+       if(flag&MCLIP_USE_PROXY) {
+               proxy= rendersize_to_proxy(user, flag);
+               render_flag= user->render_flag;
+       }
+
+       /* no cache or no cached postprocessed image */
+       if(!clip->cache || !clip->cache->postprocessed.ibuf)
                return NULL;
 
-       /* undistortion happened for other frame */
-       if(cache->undist_framenr!=framenr)
+       /* postprocessing happened for other frame */
+       if(cache->postprocessed.framenr != framenr)
                return NULL;
 
-       /* check for distortion model changes */
-       if(!equals_v2v2(camera->principal, cache->principal))
+       /* cached ibuf used different proxy settings */
+       if(cache->postprocessed.render_flag != render_flag || cache->postprocessed.proxy != proxy)
                return NULL;
 
-       if(!equals_v3v3(&camera->k1, &cache->k1))
+       if(cache->postprocessed.flag != postprocess_flag)
                return NULL;
 
-       IMB_refImBuf(cache->undistibuf);
+       if(need_undistortion_postprocess(user, flag)) {
+               if(!check_undistortion_cache_flags(clip))
+                       return NULL;
+       }
+       else if(cache->postprocessed.undistoriton_used)
+               return NULL;
 
-       return cache->undistibuf;
+       IMB_refImBuf(cache->postprocessed.ibuf);
+
+       return cache->postprocessed.ibuf;
 }
 
-static ImBuf *get_undistorted_ibuf(MovieClip *clip, struct MovieDistortion *distortion, ImBuf *ibuf)
+static ImBuf *put_postprocessed_frame_to_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, int flag, int postprocess_flag)
 {
-       ImBuf *undistibuf;
+       MovieClipCache *cache= clip->cache;
+       MovieTrackingCamera *camera= &clip->tracking.camera;
+       ImBuf *postproc_ibuf = NULL;
 
-       /* XXX: because of #27997 do not use float buffers to undistort,
-               otherwise, undistorted proxy can be darker than it should */
-       imb_freerectfloatImBuf(ibuf);
+       if(cache->postprocessed.ibuf)
+               IMB_freeImBuf(cache->postprocessed.ibuf);
 
-       if(distortion)
-               undistibuf= BKE_tracking_distortion_exec(distortion, &clip->tracking, ibuf, ibuf->x, ibuf->y, 0.0f, 1);
-       else
-               undistibuf= BKE_tracking_undistort(&clip->tracking, ibuf, ibuf->x, ibuf->y, 0.0f);
+       cache->postprocessed.framenr= user->framenr;
+       cache->postprocessed.flag = postprocess_flag;
 
-       if(undistibuf->userflags&IB_RECT_INVALID) {
-               ibuf->userflags&= ~IB_RECT_INVALID;
-               IMB_rect_from_float(undistibuf);
+       if(flag&MCLIP_USE_PROXY) {
+               cache->postprocessed.proxy= rendersize_to_proxy(user, flag);
+               cache->postprocessed.render_flag= user->render_flag;
+       }
+       else {
+               cache->postprocessed.proxy = IMB_PROXY_NONE;
+               cache->postprocessed.render_flag = 0;
        }
 
-       IMB_scaleImBuf(undistibuf, ibuf->x, ibuf->y);
+       if(need_undistortion_postprocess(user, flag)) {
+               copy_v2_v2(cache->postprocessed.principal, camera->principal);
+               copy_v3_v3(&cache->postprocessed.k1, &camera->k1);
+               cache->postprocessed.undistoriton_used = 1;
+               postproc_ibuf= get_undistorted_ibuf(clip, NULL, ibuf);
+       }
+       else cache->postprocessed.undistoriton_used = 0;
 
-       return undistibuf;
-}
+       if(postprocess_flag) {
+               int disable_red   = postprocess_flag & MOVIECLIP_DISABLE_RED,
+                   disable_green = postprocess_flag & MOVIECLIP_DISABLE_GREEN,
+                       disable_blue  = postprocess_flag & MOVIECLIP_DISABLE_BLUE,
+                       grayscale     = postprocess_flag & MOVIECLIP_PREVIEW_GRAYSCALE;
 
-static ImBuf *put_undistorted_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf)
-{
-       MovieClipCache *cache= clip->cache;
-       MovieTrackingCamera *camera= &clip->tracking.camera;
+               if(!postproc_ibuf)
+                       postproc_ibuf = IMB_dupImBuf(ibuf);
 
-       copy_v2_v2(cache->principal, camera->principal);
-       copy_v3_v3(&cache->k1, &camera->k1);
-       cache->undist_framenr= user->framenr;
+               if(disable_red || disable_green || disable_blue || grayscale)
+                       BKE_tracking_disable_imbuf_channels(postproc_ibuf, disable_red, disable_green, disable_blue, 1);
+       }
 
-       if(cache->undistibuf)
-               IMB_freeImBuf(cache->undistibuf);
+       IMB_refImBuf(postproc_ibuf);
 
-       cache->undistibuf= get_undistorted_ibuf(clip, NULL, ibuf);
+       cache->postprocessed.ibuf= postproc_ibuf;
 
-       if(cache->stableibuf) {
+       if(cache->stabilized.ibuf) {
                /* force stable buffer be re-calculated */
-               IMB_freeImBuf(cache->stableibuf);
-               cache->stableibuf= NULL;
+               IMB_freeImBuf(cache->stabilized.ibuf);
+               cache->stabilized.ibuf= NULL;
        }
 
-       IMB_refImBuf(cache->undistibuf);
-
-       return cache->undistibuf;
+       return postproc_ibuf;
 }
 
-ImBuf *BKE_movieclip_get_ibuf(MovieClip *clip, MovieClipUser *user)
+static ImBuf *movieclip_get_postprocessed_ibuf(MovieClip *clip, MovieClipUser *user, int flag, int postprocess_flag)
 {
        ImBuf *ibuf= NULL;
-       int framenr= user->framenr;
-       int cache_undistorted= 0;
+       int framenr= user->framenr, need_postprocess= 0;
 
        /* cache isn't threadsafe itself and also loading of movies
           can't happen from concurent threads that's why we use lock here */
        BLI_lock_thread(LOCK_MOVIECLIP);
 
-       /* try to obtain cached undistorted image first */
-       if(need_undistorted_cache(user, clip->flag)) {
-               ibuf= get_undistorted_cache(clip, user);
+       /* try to obtain cached postprocessed frame first */
+       if(need_postprocessed_frame(user, flag, postprocess_flag)) {
+               ibuf= get_postprocessed_cached_frame(clip, user, flag, postprocess_flag);
+
                if(!ibuf)
-                       cache_undistorted= 1;
+                       need_postprocess= 1;
        }
 
        if(!ibuf)
-               ibuf= get_imbuf_cache(clip, user, clip->flag);
+               ibuf= get_imbuf_cache(clip, user, flag);
 
        if(!ibuf) {
                int use_sequence= 0;
@@ -579,23 +659,23 @@ ImBuf *BKE_movieclip_get_ibuf(MovieClip *clip, MovieClipUser *user)
                        (user->render_size!=MCLIP_PROXY_RENDER_SIZE_FULL);
 
                if(clip->source==MCLIP_SRC_SEQUENCE || use_sequence)
-                       ibuf= movieclip_load_sequence_file(clip, user, framenr, clip->flag);
+                       ibuf= movieclip_load_sequence_file(clip, user, framenr, flag);
                else {
-                       ibuf= movieclip_load_movie_file(clip, user, framenr, clip->flag);
+                       ibuf= movieclip_load_movie_file(clip, user, framenr, flag);
                }
 
                if(ibuf)
-                       put_imbuf_cache(clip, user, ibuf, clip->flag);
+                       put_imbuf_cache(clip, user, ibuf, flag);
        }
 
        if(ibuf) {
                clip->lastframe= framenr;
                real_ibuf_size(clip, user, ibuf, &clip->lastsize[0], &clip->lastsize[1]);
 
-               /* put undistorted frame to cache */
-               if(cache_undistorted) {
+               /* postprocess frame and put to cache */
+               if(need_postprocess) {
                        ImBuf *tmpibuf= ibuf;
-                       ibuf= put_undistorted_cache(clip, user, tmpibuf);
+                       ibuf= put_postprocessed_frame_to_cache(clip, user, tmpibuf, flag, postprocess_flag);
                        IMB_freeImBuf(tmpibuf);
                }
        }
@@ -605,105 +685,113 @@ ImBuf *BKE_movieclip_get_ibuf(MovieClip *clip, MovieClipUser *user)
        return ibuf;
 }
 
+ImBuf *BKE_movieclip_get_ibuf(MovieClip *clip, MovieClipUser *user)
+{
+       return BKE_movieclip_get_ibuf_flag(clip, user, clip->flag);
+}
+
 ImBuf *BKE_movieclip_get_ibuf_flag(MovieClip *clip, MovieClipUser *user, int flag)
 {
-       ImBuf *ibuf= NULL;
-       int framenr= user->framenr;
-       int cache_undistorted= 0;
+       return movieclip_get_postprocessed_ibuf(clip, user, flag, 0);
+}
 
-       /* cache isn't threadsafe itself and also loading of movies
-          can't happen from concurent threads that's why we use lock here */
-       BLI_lock_thread(LOCK_MOVIECLIP);
+ImBuf *BKE_movieclip_get_postprocessed_ibuf(MovieClip *clip, MovieClipUser *user, int postprocess_flag)
+{
+       return movieclip_get_postprocessed_ibuf(clip, user, clip->flag, postprocess_flag);
+}
 
-       /* try to obtain cached undistorted image first */
-       if(need_undistorted_cache(user, flag)) {
-               ibuf= get_undistorted_cache(clip, user);
-               if(!ibuf)
-                       cache_undistorted= 1;
+static ImBuf *get_stable_cached_frame(MovieClip *clip, MovieClipUser *user, int framenr)
+{
+       MovieClipCache *cache = clip->cache;
+       ImBuf *stableibuf;
+       float tloc[2], tscale, tangle;
+       short proxy = IMB_PROXY_NONE;
+       int render_flag = 0;
+
+       if(clip->flag&MCLIP_USE_PROXY) {
+               proxy = rendersize_to_proxy(user, clip->flag);
+               render_flag = user->render_flag;
        }
 
-       ibuf= get_imbuf_cache(clip, user, flag);
+       /* there's no cached frame or it was calculated for another frame */
+       if(!cache->stabilized.ibuf || cache->stabilized.framenr != framenr)
+               return NULL;
 
-       if(!ibuf) {
-               if(clip->source==MCLIP_SRC_SEQUENCE) {
-                       ibuf= movieclip_load_sequence_file(clip, user, framenr, flag);
-               } else {
-                       ibuf= movieclip_load_movie_file(clip, user, framenr, flag);
-               }
+       /* cached ibuf used different proxy settings */
+       if(cache->stabilized.render_flag!=render_flag || cache->stabilized.proxy!=proxy)
+               return NULL;
 
-               if(ibuf) {
-                       int bits= MCLIP_USE_PROXY|MCLIP_USE_PROXY_CUSTOM_DIR;
+       stableibuf = cache->stabilized.ibuf;
 
-                       if((flag&bits)==(clip->flag&bits))
-                               put_imbuf_cache(clip, user, ibuf, clip->flag);
-               }
-       }
+       BKE_tracking_stabilization_data(&clip->tracking, framenr, stableibuf->x, stableibuf->y, tloc, &tscale, &tangle);
 
-       /* put undistorted frame to cache */
-       if(ibuf && cache_undistorted) {
-               ImBuf *tmpibuf= ibuf;
-               ibuf= put_undistorted_cache(clip, user, tmpibuf);
-               IMB_freeImBuf(tmpibuf);
+       /* check for stabilization parameters */
+       if(tscale != cache->stabilized.scale ||
+          tangle != cache->stabilized.angle ||
+          !equals_v2v2(tloc, cache->stabilized.loc))
+       {
+               return NULL;
        }
 
-       BLI_unlock_thread(LOCK_MOVIECLIP);
+       IMB_refImBuf(stableibuf);
 
-       return ibuf;
+       return stableibuf;
 }
 
-ImBuf *BKE_movieclip_get_stable_ibuf(MovieClip *clip, MovieClipUser *user, float loc[2], float *scale, float *angle)
+static ImBuf *put_stabilized_frame_to_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, int framenr)
 {
-       ImBuf *ibuf, *stableibuf= NULL;
-       int framenr= user->framenr;
+       MovieClipCache *cache = clip->cache;
+       ImBuf *stableibuf;
+       float tloc[2], tscale, tangle;
 
-       ibuf= BKE_movieclip_get_ibuf(clip, user);
+       if(cache->stabilized.ibuf)
+               IMB_freeImBuf(cache->stabilized.ibuf);
 
-       if(!ibuf)
-               return NULL;
+       stableibuf = BKE_tracking_stabilize(&clip->tracking, framenr, ibuf, tloc, &tscale, &tangle);
 
-       if(clip->tracking.stabilization.flag&TRACKING_2D_STABILIZATION) {
-               float tloc[2], tscale, tangle;
-               short proxy= IMB_PROXY_NONE;
-               int render_flag= 0;
+       cache->stabilized.ibuf= stableibuf;
 
-               if(clip->flag&MCLIP_USE_PROXY) {
-                       proxy= rendersize_to_proxy(user, clip->flag);
-                       render_flag= user->render_flag;
-               }
+       copy_v2_v2(cache->stabilized.loc, tloc);
 
-               if(clip->cache->stableibuf && clip->cache->stable_framenr==framenr) {   /* there's cached ibuf */
-                       if(clip->cache->render_flag==render_flag && clip->cache->proxy==proxy) {        /* cached ibuf used the same proxy settings */
-                               stableibuf= clip->cache->stableibuf;
+       cache->stabilized.scale = tscale;
+       cache->stabilized.angle = tangle;
+       cache->stabilized.framenr = framenr;
 
-                               BKE_tracking_stabilization_data(&clip->tracking, framenr, stableibuf->x, stableibuf->y, tloc, &tscale, &tangle);
+       if(clip->flag&MCLIP_USE_PROXY) {
+               cache->stabilized.proxy= rendersize_to_proxy(user, clip->flag);
+               cache->stabilized.render_flag= user->render_flag;
+       }
+       else {
+               cache->stabilized.proxy = IMB_PROXY_NONE;
+               cache->stabilized.render_flag = 0;
+       }
 
-                               /* check for stabilization parameters */
-                               if(!equals_v2v2(tloc, clip->cache->stable_loc) || tscale!=clip->cache->stable_scale || tangle!=clip->cache->stable_angle) {
-                                       stableibuf= NULL;
-                               }
-                       }
-               }
+       IMB_refImBuf(stableibuf);
 
-               if(!stableibuf) {
-                       if(clip->cache->stableibuf)
-                               IMB_freeImBuf(clip->cache->stableibuf);
+       return stableibuf;
+}
 
-                       stableibuf= BKE_tracking_stabilize(&clip->tracking, framenr, ibuf, tloc, &tscale, &tangle);
+ImBuf *BKE_movieclip_get_stable_ibuf(MovieClip *clip, MovieClipUser *user, float loc[2], float *scale, float *angle, int postprocess_flag)
+{
+       ImBuf *ibuf, *stableibuf= NULL;
+       int framenr= user->framenr;
 
-                       copy_v2_v2(clip->cache->stable_loc, tloc);
-                       clip->cache->stable_scale= tscale;
-                       clip->cache->stable_angle= tangle;
-                       clip->cache->stable_framenr= framenr;
-                       clip->cache->stableibuf= stableibuf;
-                       clip->cache->proxy= proxy;
-                       clip->cache->render_flag= render_flag;
-               }
+       ibuf= BKE_movieclip_get_postprocessed_ibuf(clip, user, postprocess_flag);
+
+       if(!ibuf)
+               return NULL;
+
+       if(clip->tracking.stabilization.flag&TRACKING_2D_STABILIZATION) {
+               MovieClipCache *cache= clip->cache;
+
+               stableibuf= get_stable_cached_frame(clip, user, framenr);
 
-               IMB_refImBuf(stableibuf);
+               if(!stableibuf)
+                       stableibuf= put_stabilized_frame_to_cache(clip, user, ibuf, framenr);
 
-               if(loc)         copy_v2_v2(loc, tloc);
-               if(scale)       *scale= tscale;
-               if(angle)       *angle= tangle;
+               if(loc)         copy_v2_v2(loc, cache->stabilized.loc);
+               if(scale)       *scale= cache->stabilized.scale;
+               if(angle)       *angle= cache->stabilized.angle;
        } else {
                if(loc)         zero_v2(loc);
                if(scale)       *scale= 1.0f;
@@ -786,11 +874,11 @@ static void free_buffers(MovieClip *clip)
        if(clip->cache) {
                IMB_moviecache_free(clip->cache->moviecache);
 
-               if(clip->cache->stableibuf)
-                       IMB_freeImBuf(clip->cache->stableibuf);
+               if(clip->cache->postprocessed.ibuf)
+                       IMB_freeImBuf(clip->cache->postprocessed.ibuf);
 
-               if(clip->cache->undistibuf)
-                       IMB_freeImBuf(clip->cache->undistibuf);
+               if(clip->cache->stabilized.ibuf)
+                       IMB_freeImBuf(clip->cache->stabilized.ibuf);
 
                MEM_freeN(clip->cache);
                clip->cache= NULL;
index 8831d7e73b2cb971780be3cfd89785efb18b5105..73170612ff737e226a8e8aebedcc9133619a6467 100644 (file)
@@ -1010,19 +1010,19 @@ void BKE_tracking_context_free(MovieTrackingContext *context)
 /* zap channels from the imbuf that are disabled by the user. this can lead to
  * better tracks sometimes. however, instead of simply zeroing the channels
  * out, do a partial grayscale conversion so the display is better. */
-static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track, int grayscale)
+void BKE_tracking_disable_imbuf_channels(ImBuf *ibuf, int disable_red, int disable_green, int disable_blue, int grayscale)
 {
        int x, y;
        float scale;
 
-       if((track->flag&(TRACK_DISABLE_RED|TRACK_DISABLE_GREEN|TRACK_DISABLE_BLUE))==0 && !grayscale)
+       if(!disable_red && !disable_green && !disable_blue && !grayscale)
                return;
 
        /* If only some components are selected, it's important to rescale the result
         * appropriately so that e.g. if only blue is selected, it's not zeroed out. */
-       scale = ((track->flag&TRACK_DISABLE_RED  ) ? 0.0f : 0.2126f) +
-               ((track->flag&TRACK_DISABLE_GREEN) ? 0.0f : 0.7152f) +
-               ((track->flag&TRACK_DISABLE_BLUE)  ? 0.0f : 0.0722f);
+       scale = (disable_red   ? 0.0f : 0.2126f) +
+               (disable_green ? 0.0f : 0.7152f) +
+               (disable_blue  ? 0.0f : 0.0722f);
 
        for(y= 0; y<ibuf->y; y++) {
                for (x= 0; x<ibuf->x; x++) {
@@ -1030,9 +1030,9 @@ static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track, int g
 
                        if(ibuf->rect_float) {
                                float *rrgbf= ibuf->rect_float + pixel*4;
-                               float r = (track->flag&TRACK_DISABLE_RED)   ? 0.0f : rrgbf[0];
-                               float g = (track->flag&TRACK_DISABLE_GREEN) ? 0.0f : rrgbf[1];
-                               float b = (track->flag&TRACK_DISABLE_BLUE)  ? 0.0f : rrgbf[2];
+                               float r = disable_red   ? 0.0f : rrgbf[0];
+                               float g = disable_green ? 0.0f : rrgbf[1];
+                               float b = disable_blue  ? 0.0f : rrgbf[2];
                                if (grayscale) {
                                        float gray = (0.2126f*r + 0.7152f*g + 0.0722f*b) / scale;
                                        rrgbf[0] = rrgbf[1] = rrgbf[2] = gray;
@@ -1043,9 +1043,9 @@ static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track, int g
                                }
                        } else {
                                char *rrgb= (char*)ibuf->rect + pixel*4;
-                               char r = (track->flag&TRACK_DISABLE_RED)   ? 0 : rrgb[0];
-                               char g = (track->flag&TRACK_DISABLE_GREEN) ? 0 : rrgb[1];
-                               char b = (track->flag&TRACK_DISABLE_BLUE)  ? 0 : rrgb[2];
+                               char r = disable_red   ? 0 : rrgb[0];
+                               char g = disable_green ? 0 : rrgb[1];
+                               char b = disable_blue  ? 0 : rrgb[2];
                                if (grayscale) {
                                        float gray = (0.2126f*r + 0.7152f*g + 0.0722f*b) / scale;
                                        rrgb[0] = rrgb[1] = rrgb[2] = gray;
@@ -1059,12 +1059,18 @@ static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track, int g
        }
 }
 
+static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track, int grayscale)
+{
+       BKE_tracking_disable_imbuf_channels(ibuf, track->flag&TRACK_DISABLE_RED,
+                       track->flag&TRACK_DISABLE_GREEN, track->flag&TRACK_DISABLE_RED, grayscale);
+}
+
 static ImBuf *get_area_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
                        float min[2], float max[2], int margin, int anchored, float pos[2], int origin[2])
 {
        ImBuf *tmpibuf;
        int x, y;
-       int x1, y1 /*, x2, y2 */ /* UNUSED */, w, h;
+       int x1, y1, w, h;
        float mpos[2];
 
        copy_v2_v2(mpos, marker->pos);
@@ -1086,11 +1092,6 @@ static ImBuf *get_area_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTracki
        x1= x-(int)(w/2.0f);
        y1= y-(int)(h/2.0f);
 
-#if 0 /* UNUSED */
-       x2= x+(int)(w/2.0f);
-       y2= y+(int)(h/2.0f);
-#endif
-
        /* dimensions should be odd */
        tmpibuf= IMB_allocImBuf(w+margin*2, h+margin*2, 32, IB_rect);
        IMB_rectcpy(tmpibuf, ibuf, 0, 0, x1-margin, y1-margin, w+margin*2, h+margin*2);
@@ -1113,9 +1114,6 @@ static ImBuf *get_area_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTracki
                disable_imbuf_channels(tmpibuf, track, 1 /* grayscale */);
        }
 
-       tmpibuf->ftype= PNG;
-       IMB_saveiff(tmpibuf, "/tmp/1.png", IB_rect);
-
        return tmpibuf;
 }
 
index 0328be060cc4832920f2d185d6114faf6f040da1..7e1634d6eca50790b101a36c93a42c459b4ad61f 100644 (file)
@@ -5239,7 +5239,6 @@ static void lib_link_screen(FileData *fd, Main *main)
                                        }
                                        else if(sl->spacetype==SPACE_BUTS) {
                                                SpaceButs *sbuts= (SpaceButs *)sl;
-                                               sbuts->ri= NULL;
                                                sbuts->pinid= newlibadr(fd, sc->id.lib, sbuts->pinid);
                                                sbuts->mainbo= sbuts->mainb;
                                                sbuts->mainbuser= sbuts->mainb;
@@ -14517,7 +14516,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
                                        /* allow typing in a new lib path */
                                        if(G.rt==-666) {
                                                while(fd==NULL) {
-                                                       char newlib_path[240] = { 0 };
+                                                       char newlib_path[FILE_MAX] = { 0 };
                                                        printf("Missing library...'\n");
                                                        printf("        current file: %s\n", G.main->name);
                                                        printf("        absolute lib: %s\n", mainptr->curlib->filepath);
index cc1fae170d0b9be6037588f7d1c8001cb2070b5e..e17aea3f8f3785b567daddb3a7d81a64e9b505c3 100644 (file)
@@ -1494,11 +1494,12 @@ void ED_marker_keymap(wmKeyConfig *keyconf)
 
 #ifdef DURIAN_CAMERA_SWITCH
        kmi= WM_keymap_add_item(keymap, "MARKER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
-       RNA_boolean_set(kmi->ptr, "camera", 1);
+       RNA_boolean_set(kmi->ptr, "extend", FALSE);
+       RNA_boolean_set(kmi->ptr, "camera", TRUE);
 
        kmi= WM_keymap_add_item(keymap, "MARKER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
-       RNA_boolean_set(kmi->ptr, "extend", 1);
-       RNA_boolean_set(kmi->ptr, "camera", 1);
+       RNA_boolean_set(kmi->ptr, "extend", TRUE);
+       RNA_boolean_set(kmi->ptr, "camera", TRUE);
 #else
        (void)kmi;
 #endif
index 81482466a30f934ebe00c28ae29d9592537b1bc2..29cdf6a61f7fe58e7d433b74484a0370f60c9293 100644 (file)
@@ -220,16 +220,17 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "SKETCH_OT_gesture", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "SKETCH_OT_draw_stroke", LEFTMOUSE, KM_PRESS, 0, 0);
        kmi = WM_keymap_add_item(keymap, "SKETCH_OT_draw_stroke", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
-       RNA_boolean_set(kmi->ptr, "snap", 1);
+       RNA_boolean_set(kmi->ptr, "snap", TRUE);
        WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, 0, 0);
        kmi = WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, KM_CTRL, 0);
-       RNA_boolean_set(kmi->ptr, "snap", 1);
+       RNA_boolean_set(kmi->ptr, "snap", TRUE);
 
        /* only set in editmode armature, by space_view3d listener */
        kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, 0, 0);
-               RNA_boolean_set(kmi->ptr, "unselected", FALSE);
+       RNA_boolean_set(kmi->ptr, "unselected", FALSE);
        kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0);
-               RNA_boolean_set(kmi->ptr, "unselected", TRUE);
+       RNA_boolean_set(kmi->ptr, "unselected", TRUE);
+
        WM_keymap_add_item(keymap, "ARMATURE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
        WM_keymap_add_item(keymap, "ARMATURE_OT_align", AKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
        WM_keymap_add_item(keymap, "ARMATURE_OT_calculate_roll", NKEY, KM_PRESS, KM_CTRL, 0);
@@ -304,9 +305,11 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_menu(keymap, "INFO_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0);
        
-       WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, 0, 0);
-       kmi= WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0);
-               RNA_boolean_set(kmi->ptr, "unselected", 1);
+       kmi = WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, 0, 0);
+       RNA_boolean_set(kmi->ptr, "unselected", FALSE);
+       kmi = WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_boolean_set(kmi->ptr, "unselected", TRUE);
+
        WM_keymap_add_item(keymap, "POSE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
        
        WM_keymap_add_menu(keymap, "VIEW3D_MT_pose_apply", AKEY, KM_PRESS, KM_CTRL, 0);
@@ -321,9 +324,11 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "POSE_OT_rotation_mode_set", RKEY, KM_PRESS, KM_CTRL, 0);
        
        WM_keymap_add_item(keymap, "POSE_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0);
-       WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
+       kmi = WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
+       RNA_boolean_set(kmi->ptr, "flipped", FALSE);
+
        kmi= WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
-               RNA_boolean_set(kmi->ptr, "flipped", 1);
+       RNA_boolean_set(kmi->ptr, "flipped", TRUE);
        
        kmi = WM_keymap_add_item(keymap, "POSE_OT_select_all", AKEY, KM_PRESS, 0, 0);
                RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
index 150e0ba90e4f4842b541c02155c84ca85b828be5..954c79bb17d85aa26faad581c541c50c9591a2b5 100644 (file)
@@ -55,7 +55,8 @@ void ED_keymap_gpencil(wmKeyConfig *keyconf)
        
        /* Draw */
                /* draw */
-       WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, 0, DKEY);
+       kmi=WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, 0, DKEY);
+               RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_DRAW);
                /* draw - straight lines */
        kmi=WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, KM_CTRL, DKEY);
                RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_DRAW_STRAIGHT);
index b50df29918dbba1bc9fd52298d215e5195ea08ac..40cf0213203fb3f7104019e92fe991afd03870b3 100644 (file)
@@ -494,7 +494,7 @@ struct uiEditSourceStore {
 } uiEditSourceStore;
 
 struct uiEditSourceButStore {
-       char py_dbg_fn[240];
+       char py_dbg_fn[FILE_MAX];
        int py_dbg_ln;
 } uiEditSourceButStore;
 
@@ -584,7 +584,7 @@ void UI_editsource_active_but_test(uiBut *but)
 /* editsource operator component */
 
 static int editsource_text_edit(bContext *C, wmOperator *op,
-                                char filepath[240], int line)
+                                char filepath[FILE_MAX], int line)
 {
        struct Main *bmain= CTX_data_main(C);
        Text *text;
index a993e651b5f5790c624de3056e6f438de070abb1..2959d525cfb9d130064dd22c9603d457e0e754f8 100644 (file)
@@ -1207,6 +1207,7 @@ typedef struct v2dScrollerMove {
        float delta;                    /* amount moved by mouse on axis of interest */
        
        float scrollbarwidth;   /* width of the scrollbar itself, used for page up/down clicks */
+       int scrollbar_orig;      /* initial location of scrollbar x/y, mouse relative */
        
        int lastx, lasty;               /* previous mouse coordinates (in screen coordinates) for determining movement */
 } v2dScrollerMove;
@@ -1302,15 +1303,16 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event,
        vsm->v2d= v2d;
        vsm->ar= ar;
        vsm->scroller= in_scroller;
-       
+
        /* store mouse-coordinates, and convert mouse/screen coordinates to region coordinates */
        vsm->lastx = event->x;
        vsm->lasty = event->y;
-       
        /* 'zone' depends on where mouse is relative to bubble 
         *      - zooming must be allowed on this axis, otherwise, default to pan
         */
        scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
+
+
        if (in_scroller == 'h') {
                /* horizontal scroller - calculate adjustment factor first */
                mask_size= (float)(v2d->hor.xmax - v2d->hor.xmin);
@@ -1325,6 +1327,7 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event,
                }
 
                vsm->scrollbarwidth = scrollers->hor_max - scrollers->hor_min;
+               vsm->scrollbar_orig = ((scrollers->hor_max + scrollers->hor_min) / 2) + ar->winrct.xmin;
        }
        else {
                /* vertical scroller - calculate adjustment factor first */
@@ -1340,6 +1343,7 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event,
                }
                
                vsm->scrollbarwidth = scrollers->vert_max - scrollers->vert_min;
+               vsm->scrollbar_orig = ((scrollers->vert_max + scrollers->vert_min) / 2) +  + ar->winrct.ymin;
        }
        
        UI_view2d_scrollers_free(scrollers);
@@ -1464,6 +1468,7 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, wmEvent *event)
                        break;
                        
                case LEFTMOUSE:
+               case MIDDLEMOUSE:
                        if (event->val==KM_RELEASE) {
                                /* single-click was in empty space outside bubble, so scroll by 1 'page' */
                                if (ELEM(vsm->zone, SCROLLHANDLE_MIN_OUTSIDE, SCROLLHANDLE_MAX_OUTSIDE)) {
@@ -1484,6 +1489,7 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, wmEvent *event)
                                }
                        }
                        break;
+
        }
 
        return OPERATOR_RUNNING_MODAL;
@@ -1508,6 +1514,21 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event)
                scroller_activate_init(C, op, event, in_scroller);
                vsm= (v2dScrollerMove *)op->customdata;
                
+               /* support for quick jump to location - gtk and qt do this on linux */
+               if (event->type == MIDDLEMOUSE) {
+                       switch (vsm->scroller) {
+                               case 'h': /* horizontal scroller - so only horizontal movement ('cur' moves opposite to mouse) */
+                                       vsm->delta= (float)(event->x - vsm->scrollbar_orig);
+                                       break;
+                               case 'v': /* vertical scroller - so only vertical movement ('cur' moves opposite to mouse) */
+                                       vsm->delta= (float)(event->y - vsm->scrollbar_orig);
+                                       break;
+                       }
+                       scroller_activate_apply(C, op);
+
+                       vsm->zone= SCROLLHANDLE_BAR;
+               }
+
                /* check if zoom zones are inappropriate (i.e. zoom widgets not shown), so cannot continue
                 * NOTE: see view2d.c for latest conditions, and keep this in sync with that
                 */
@@ -1669,6 +1690,10 @@ void UI_view2d_keymap(wmKeyConfig *keyconf)
 {
        wmKeyMap *keymap= WM_keymap_find(keyconf, "View2D", 0, 0);
        
+       /* scrollers */
+       WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", MIDDLEMOUSE, KM_PRESS, 0, 0);
+
        /* pan/scroll */
        WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, KM_SHIFT, 0);
@@ -1713,12 +1738,13 @@ void UI_view2d_keymap(wmKeyConfig *keyconf)
        
        /* borderzoom - drag */
        WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_border", BKEY, KM_PRESS, KM_SHIFT, 0);
-       
-       /* scrollers */
-       WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0);
 
        /* Alternative keymap for buttons listview */
        keymap= WM_keymap_find(keyconf, "View2D Buttons List", 0, 0);
+
+       WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", MIDDLEMOUSE, KM_PRESS, 0, 0);
+
        WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MOUSEPAN, 0, 0, 0);
        WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_down", WHEELDOWNMOUSE, KM_PRESS, 0, 0);
@@ -1732,6 +1758,5 @@ void UI_view2d_keymap(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_out", PADMINUS, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_in", PADPLUSKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "VIEW2D_OT_reset", HOMEKEY, KM_PRESS, 0, 0);
-       WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0);
 }
 
index 68d11837d0d8d7dc62667befe97b0082741bd9c3..eba4dd1878a82f8ec7da4294dca9f83c7995b71a 100644 (file)
@@ -269,20 +269,20 @@ void ED_keymap_object(wmKeyConfig *keyconf)
        
        /* Note: this keymap works disregarding mode */
        kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0);
-               RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT);
-               RNA_boolean_set(kmi->ptr, "toggle", 1);
+       RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT);
+       RNA_boolean_set(kmi->ptr, "toggle", TRUE);
 
        kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0);
-               RNA_enum_set(kmi->ptr, "mode", OB_MODE_POSE);
-               RNA_boolean_set(kmi->ptr, "toggle", 1);
+       RNA_enum_set(kmi->ptr, "mode", OB_MODE_POSE);
+       RNA_boolean_set(kmi->ptr, "toggle", TRUE);
 
        kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", VKEY, KM_PRESS, 0, 0);
-               RNA_enum_set(kmi->ptr, "mode", OB_MODE_VERTEX_PAINT);
-               RNA_boolean_set(kmi->ptr, "toggle", 1);
+       RNA_enum_set(kmi->ptr, "mode", OB_MODE_VERTEX_PAINT);
+       RNA_boolean_set(kmi->ptr, "toggle", TRUE);
        
        kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0);
-               RNA_enum_set(kmi->ptr, "mode", OB_MODE_WEIGHT_PAINT);
-               RNA_boolean_set(kmi->ptr, "toggle", 1);
+       RNA_enum_set(kmi->ptr, "mode", OB_MODE_WEIGHT_PAINT);
+       RNA_boolean_set(kmi->ptr, "toggle", TRUE);
        
        WM_keymap_add_item(keymap, "OBJECT_OT_origin_set", CKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_CTRL, 0);
 
@@ -297,27 +297,29 @@ void ED_keymap_object(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "VIEW3D_OT_game_start", PKEY, KM_PRESS, 0, 0);
 
        kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_all", AKEY, KM_PRESS, 0, 0);
-               RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
+       RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
        kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0);
-               RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
+       RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
 
        WM_keymap_add_item(keymap, "OBJECT_OT_select_linked", LKEY, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "OBJECT_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "OBJECT_OT_select_mirror", MKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
        
-       kmi= WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0);
-               RNA_enum_set_identifier(kmi->ptr, "direction", "PARENT");
-               RNA_boolean_set(kmi->ptr, "extend", FALSE);
-       kmi= WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
-               RNA_enum_set_identifier(kmi->ptr, "direction", "PARENT");
-               RNA_boolean_set(kmi->ptr, "extend", TRUE);
-
-       kmi= WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
-               RNA_enum_set_identifier(kmi->ptr, "direction", "CHILD");
-               RNA_boolean_set(kmi->ptr, "extend", FALSE);
-       kmi= WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
-               RNA_enum_set_identifier(kmi->ptr, "direction", "CHILD");
-               RNA_boolean_set(kmi->ptr, "extend", TRUE);
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0);
+       RNA_enum_set_identifier(kmi->ptr, "direction", "PARENT");
+       RNA_boolean_set(kmi->ptr, "extend", FALSE);
+
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_enum_set_identifier(kmi->ptr, "direction", "PARENT");
+       RNA_boolean_set(kmi->ptr, "extend", TRUE);
+
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
+       RNA_enum_set_identifier(kmi->ptr, "direction", "CHILD");
+       RNA_boolean_set(kmi->ptr, "extend", FALSE);
+
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_enum_set_identifier(kmi->ptr, "direction", "CHILD");
+       RNA_boolean_set(kmi->ptr, "extend", TRUE);
 
        WM_keymap_verify_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_verify_item(keymap, "OBJECT_OT_parent_no_inverse_set", PKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
@@ -334,20 +336,34 @@ void ED_keymap_object(wmKeyConfig *keyconf)
        WM_keymap_verify_item(keymap, "OBJECT_OT_origin_clear", OKEY, KM_PRESS, KM_ALT, 0);
        
        WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_clear", HKEY, KM_PRESS, KM_ALT, 0);
-       WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_set", HKEY, KM_PRESS, 0, 0);
-       RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_set", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_set", HKEY, KM_PRESS, 0, 0);
+       RNA_boolean_set(kmi->ptr, "unselected", FALSE);
+
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_set", HKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_boolean_set(kmi->ptr, "unselected", TRUE);
 
        /* same as above but for rendering */
        WM_keymap_add_item(keymap, "OBJECT_OT_hide_render_clear", HKEY, KM_PRESS, KM_ALT|KM_CTRL, 0);
        WM_keymap_add_item(keymap, "OBJECT_OT_hide_render_set", HKEY, KM_PRESS, KM_CTRL, 0);
-//     RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_hide_render_set", HKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "unselected", 1); // conflicts, removing
+
+       /* conflicts, removing */
+#if 0
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_hide_render_set", HKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)
+       RNA_boolean_set(kmi->ptr, "unselected", TRUE);
+#endif
 
        WM_keymap_add_item(keymap, "OBJECT_OT_move_to_layer", MKEY, KM_PRESS, 0, 0);
        
-       WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, 0, 0);
-       RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "use_global", TRUE);
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, 0, 0);
+       RNA_boolean_set(kmi->ptr, "use_global", FALSE);
+
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_boolean_set(kmi->ptr, "use_global", TRUE);
+
        WM_keymap_add_item(keymap, "OBJECT_OT_delete", DELKEY, KM_PRESS, 0, 0);
-       RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_delete", DELKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "use_global", TRUE);
+       RNA_boolean_set(kmi->ptr, "use_global", FALSE);
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_delete", DELKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_boolean_set(kmi->ptr, "use_global", TRUE);
 
        WM_keymap_add_menu(keymap, "INFO_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0);
 
@@ -393,7 +409,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
        
        WM_keymap_add_item(keymap, "OBJECT_OT_vertex_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
        
-               /* menus */
+       /* menus */
        WM_keymap_add_menu(keymap, "VIEW3D_MT_hook", HKEY, KM_PRESS, KM_CTRL, 0);
 
        ED_object_generic_keymap(keyconf, keymap, 2);
index 09f99a58dd765d74d019511e0c3640265a19ba9d..ebd3dc6617d6cc28cd9e4878b9161094c0ed63d7 100644 (file)
 #include "ED_physics.h"
 #include "ED_object.h"
 
+#include "BLI_utildefines.h"
+
 #include "physics_intern.h" // own include
 
+
 /***************************** particles ***********************************/
 
 static void operatortypes_particle(void)
@@ -109,7 +112,7 @@ static void keymap_particle(wmKeyConfig *keyconf)
        RNA_boolean_set(WM_keymap_add_item(keymap, "PARTICLE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
 
        kmi = WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, KM_ANY, 0);
-       RNA_boolean_set(kmi->ptr, "release_confirm", 1);
+       RNA_boolean_set(kmi->ptr, "release_confirm", TRUE);
 
        WM_keymap_add_item(keymap, "PARTICLE_OT_brush_edit", LEFTMOUSE, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "PARTICLE_OT_brush_edit", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
index 06e15f4a5f676dee7d9cdcd7c9338988eb428d3f..6bb3b2ca7f8918ec659a892586cded6ad3f4ba56 100644 (file)
@@ -240,7 +240,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
                        }
 
                        BKE_makepicstring(name, scene->r.pic, oglrender->bmain->name, scene->r.cfra, scene->r.im_format.imtype, scene->r.scemode & R_EXTENSION, FALSE);
-                       ok= BKE_write_ibuf(ibuf, name, &scene->r.im_format); /* no need to stamp here */
+                       ok= BKE_write_ibuf_as(ibuf, name, &scene->r.im_format, TRUE); /* no need to stamp here */
                        if(ok)  printf("OpenGL Render written to '%s'\n", name);
                        else    printf("OpenGL Render failed to write '%s'\n", name);
                }
index eaca87f2d6fc6fff809b7a5979f209f9fd967dfc..a3874c9f28abe7f4cd61dc5719b91eb8bd095dea 100644 (file)
@@ -3604,11 +3604,11 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
 #if 0 // XXX: disabled for restoring later... bad implementation
        keymap= WM_keymap_find(keyconf, "Frames", 0, 0);
        kmi = WM_keymap_add_item(keymap, "SCREEN_OT_animation_play", RIGHTARROWKEY, KM_PRESS, KM_ALT, 0);
-               RNA_boolean_set(kmi->ptr, "cycle_speed", 1);
+               RNA_boolean_set(kmi->ptr, "cycle_speed", TRUE);
        
        kmi = WM_keymap_add_item(keymap, "SCREEN_OT_animation_play", LEFTARROWKEY, KM_PRESS, KM_ALT, 0);
-               RNA_boolean_set(kmi->ptr, "reverse", 1);
-               RNA_boolean_set(kmi->ptr, "cycle_speed", 1);
+               RNA_boolean_set(kmi->ptr, "reverse", TRUE);
+               RNA_boolean_set(kmi->ptr, "cycle_speed", TRUE);
        
        WM_keymap_add_item(keymap, "SCREEN_OT_animation_play", DOWNARROWKEY, KM_PRESS, KM_ALT, 0);
 #endif
index a5e68f9a244f24e91215d56d3499f240b0fe5ddf..2fc7d569d63f7e735a319c864efbedca5e47c99d 100644 (file)
@@ -126,7 +126,7 @@ void paint_calc_redraw_planes(float planes[4][4],
                                                          const struct rcti *screen_rect);
 
 void projectf(struct bglMats *mats, const float v[3], float p[2]);
-float paint_calc_object_space_radius(struct ViewContext *vc, float center[3], float pixel_radius);
+float paint_calc_object_space_radius(struct ViewContext *vc, const float center[3], float pixel_radius);
 float paint_get_tex_pixel(struct Brush* br, float u, float v);
 int imapaint_pick_face(struct ViewContext *vc, struct Mesh *me, const int mval[2], unsigned int *index);
 void imapaint_pick_uv(struct Scene *scene, struct Object *ob, unsigned int faceindex, const int xy[2], float uv[2]);
index e81e1f6dc779fc1c4099ae0c5fee88a16eeee9cc..2a0ebb8316df86900b30ce6638481b0ec995f0bb 100644 (file)
@@ -395,67 +395,14 @@ void ED_operatortypes_paint(void)
 static void ed_keymap_paint_brush_switch(wmKeyMap *keymap, const char *mode)
 {
        wmKeyMapItem *kmi;
-
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", ONEKEY, KM_PRESS, 0, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 0);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", TWOKEY, KM_PRESS, 0, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 1);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", THREEKEY, KM_PRESS, 0, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 2);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", FOURKEY, KM_PRESS, 0, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 3);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", FIVEKEY, KM_PRESS, 0, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 4);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", SIXKEY, KM_PRESS, 0, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 5);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", SEVENKEY, KM_PRESS, 0, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 6);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", EIGHTKEY, KM_PRESS, 0, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 7);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", NINEKEY, KM_PRESS, 0, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 8);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", ZEROKEY, KM_PRESS, 0, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 9);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", ONEKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 10);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", TWOKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 11);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", THREEKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 12);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", FOURKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 13);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", FIVEKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 14);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", SIXKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 15);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", SEVENKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 16);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", EIGHTKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 17);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", NINEKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 18);
-       kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", ZEROKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_string_set(kmi->ptr, "mode", mode);
-       RNA_int_set(kmi->ptr, "index", 19);
+       int i;
+       /* index 0-9 (zero key is tenth), shift key for index 10-19 */
+       for (i = 0; i < 20; i++) {
+               kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set",
+                                       ZEROKEY + ((i + 1) % 10), KM_PRESS, i < 10 ? 0 : KM_SHIFT, 0);
+               RNA_string_set(kmi->ptr, "mode", mode);
+               RNA_int_set(kmi->ptr, "index", i);
+       }
 }
 
 static void ed_keymap_paint_brush_size(wmKeyMap *keymap, const char *UNUSED(path))
@@ -556,11 +503,11 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
        /* multires switch */
        kmi= WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEUPKEY, KM_PRESS, 0, 0);
        RNA_int_set(kmi->ptr, "level", 1);
-       RNA_boolean_set(kmi->ptr, "relative", 1);
+       RNA_boolean_set(kmi->ptr, "relative", TRUE);
 
        kmi= WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEDOWNKEY, KM_PRESS, 0, 0);
        RNA_int_set(kmi->ptr, "level", -1);
-       RNA_boolean_set(kmi->ptr, "relative", 1);
+       RNA_boolean_set(kmi->ptr, "relative", TRUE);
 
        ed_keymap_paint_brush_switch(keymap, "sculpt");
        ed_keymap_paint_brush_size(keymap, "tool_settings.sculpt.brush.size");
index c3e0c35f524aee2e08968828670ee37860628a54..67bd6ca925568f9bf13ffd0b1df8cfb2954b3767 100644 (file)
@@ -510,31 +510,33 @@ static void paint_draw_alpha_overlay(Sculpt *sd, Brush *brush,
 /* Special actions taken when paint cursor goes over mesh */
 /* TODO: sculpt only for now */
 static void paint_cursor_on_hit(Sculpt *sd, Brush *brush, ViewContext *vc,
-                               float location[3], float *visual_strength)
+                                                               const float location[3])
 {
        float unprojected_radius, projected_radius;
 
-       /* TODO: check whether this should really only be done when
-          brush is over mesh? */
-       if(sd->draw_pressure && brush_use_alpha_pressure(vc->scene, brush))
-               (*visual_strength) *= sd->pressure_value;
-
-       if(sd->draw_anchored)
-               projected_radius = sd->anchored_size;
-       else {
-               if(brush->flag & BRUSH_ANCHORED)
-                       projected_radius = 8;
-               else
-                       projected_radius = brush_size(vc->scene, brush);
-       }
-       unprojected_radius = paint_calc_object_space_radius(vc, location,
-                                                           projected_radius);
+       /* update the brush's cached 3D radius */
+       if(!brush_use_locked_size(vc->scene, brush)) {
+               /* get 2D brush radius */
+               if(sd->draw_anchored)
+                       projected_radius = sd->anchored_size;
+               else {
+                       if(brush->flag & BRUSH_ANCHORED)
+                               projected_radius = 8;
+                       else
+                               projected_radius = brush_size(vc->scene, brush);
+               }
+       
+               /* convert brush radius from 2D to 3D */
+               unprojected_radius = paint_calc_object_space_radius(vc, location,
+                                                                                                                       projected_radius);
 
-       if(sd->draw_pressure && brush_use_size_pressure(vc->scene, brush))
-               unprojected_radius *= sd->pressure_value;
+               /* scale 3D brush radius by pressure */
+               if(sd->draw_pressure && brush_use_size_pressure(vc->scene, brush))
+                       unprojected_radius *= sd->pressure_value;
 
-       if(!brush_use_locked_size(vc->scene, brush))
+               /* set cached value in either Brush or UnifiedPaintSettings */
                brush_set_unprojected_radius(vc->scene, brush, unprojected_radius);
+       }
 }
 
 static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
@@ -613,8 +615,13 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
                        outline_col = brush->sub_col;
 
                /* only do if brush is over the mesh */
-               if(hit)
-                       paint_cursor_on_hit(sd, brush, &vc, location, &visual_strength);
+               if(hit) {
+                       /* scale the alpha by pen pressure */
+                       if(sd->draw_pressure && brush_use_alpha_pressure(vc.scene, brush))
+                               visual_strength *= sd->pressure_value;
+
+                       paint_cursor_on_hit(sd, brush, &vc, location);
+               }
 
                /* don't show effect of strength past the soft limit */
                if(visual_strength > 1)
index 6b8637579325d91d499c2c6419584a8551c6467c..702937658135e58ee946d53f2cb25f28444ab182 100644 (file)
@@ -152,7 +152,7 @@ void projectf(bglMats *mats, const float v[3], float p[2])
        p[1]= uy;
 }
 
-float paint_calc_object_space_radius(ViewContext *vc, float center[3],
+float paint_calc_object_space_radius(ViewContext *vc, const float center[3],
                                     float pixel_radius)
 {
        Object *ob = vc->obact;
index 0c326af406fd4892bb222b06d9a06ea7334e2eba..e6928e31dc74fab48fccc100affcb1cc2c5ffb16 100644 (file)
@@ -96,11 +96,6 @@ static SpaceLink *buttons_new(const bContext *UNUSED(C))
 static void buttons_free(SpaceLink *sl)
 {      
        SpaceButs *sbuts= (SpaceButs*) sl;
-       
-       if(sbuts->ri) { 
-               if (sbuts->ri->rect) MEM_freeN(sbuts->ri->rect);
-               MEM_freeN(sbuts->ri);
-       }
 
        if(sbuts->path)
                MEM_freeN(sbuts->path);
@@ -131,7 +126,6 @@ static SpaceLink *buttons_duplicate(SpaceLink *sl)
        SpaceButs *sbutsn= MEM_dupallocN(sl);
        
        /* clear or remove stuff from old */
-       sbutsn->ri= NULL;
        sbutsn->path= NULL;
        sbutsn->texuser= NULL;
        
index 0d1c312792a7464c89c720f7098b6006d0a8cb86..eb8f30b6739aeabff5532da287b8d6321a038585 100644 (file)
@@ -250,9 +250,9 @@ static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf,
 
                glBegin(GL_LINE_LOOP);
                        glVertex2f(0.0f, 0.0f);
-                       glVertex2f(ibuf->x, 0.0f);
-                       glVertex2f(ibuf->x, ibuf->y);
-                       glVertex2f(0.0f, ibuf->y);
+                       glVertex2f(width, 0.0f);
+                       glVertex2f(width, height);
+                       glVertex2f(0.0f, height);
                glEnd();
 
                glPopMatrix();
@@ -1259,14 +1259,24 @@ void clip_draw_main(SpaceClip *sc, ARegion *ar, Scene *scene)
                float smat[4][4], ismat[4][4];
 
                ibuf= ED_space_clip_get_stable_buffer(sc, sc->loc, &sc->scale, &sc->angle);
-               BKE_tracking_stabdata_to_mat4(width, height, sc->loc, sc->scale, sc->angle, sc->stabmat);
 
-               unit_m4(smat);
-               smat[0][0]= 1.0f/width;
-               smat[1][1]= 1.0f/height;
-               invert_m4_m4(ismat, smat);
+               if(ibuf) {
+                       float loc[2];
 
-               mul_serie_m4(sc->unistabmat, smat, sc->stabmat, ismat, NULL, NULL, NULL, NULL, NULL);
+                       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);
+
+                       unit_m4(smat);
+                       smat[0][0]= 1.0f/width;
+                       smat[1][1]= 1.0f/height;
+                       invert_m4_m4(ismat, smat);
+
+                       mul_serie_m4(sc->unistabmat, smat, sc->stabmat, ismat, NULL, NULL, NULL, NULL, NULL);
+               }
        } else {
                ibuf= ED_space_clip_get_buffer(sc);
 
index d75df0ab51e579ca48f5dde694ebbfdcee6c2630..35d870022a48f10ea54a5febd148b08e4f28a0cc 100644 (file)
@@ -86,7 +86,7 @@ ImBuf *ED_space_clip_get_buffer(SpaceClip *sc)
        if(sc->clip) {
                ImBuf *ibuf;
 
-               ibuf= BKE_movieclip_get_ibuf(sc->clip, &sc->user);
+               ibuf= BKE_movieclip_get_postprocessed_ibuf(sc->clip, &sc->user, sc->postproc_flag);
 
                if(ibuf && (ibuf->rect || ibuf->rect_float))
                        return ibuf;
@@ -103,7 +103,7 @@ ImBuf *ED_space_clip_get_stable_buffer(SpaceClip *sc, float loc[2], float *scale
        if(sc->clip) {
                ImBuf *ibuf;
 
-               ibuf= BKE_movieclip_get_stable_ibuf(sc->clip, &sc->user, loc, scale, angle);
+               ibuf= BKE_movieclip_get_stable_ibuf(sc->clip, &sc->user, loc, scale, angle, sc->postproc_flag);
 
                if(ibuf && (ibuf->rect || ibuf->rect_float))
                        return ibuf;
index 82da9b3b956545af24af0a21182d3a9fd061b183..b2527fbe4e0ad357a9776818d7be01222c32f02d 100644 (file)
@@ -399,22 +399,24 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
 
        /* 2d tracking */
        kmi= WM_keymap_add_item(keymap, "CLIP_OT_track_markers", LEFTARROWKEY, KM_PRESS, KM_ALT, 0);
-       RNA_boolean_set(kmi->ptr, "backwards", 1);
+       RNA_boolean_set(kmi->ptr, "backwards", TRUE);
+       RNA_boolean_set(kmi->ptr, "sequence", FALSE);
        WM_keymap_add_item(keymap, "CLIP_OT_track_markers", RIGHTARROWKEY, KM_PRESS, KM_ALT, 0);
        kmi= WM_keymap_add_item(keymap, "CLIP_OT_track_markers", TKEY, KM_PRESS, KM_CTRL, 0);
-       RNA_boolean_set(kmi->ptr, "sequence", 1);
+       RNA_boolean_set(kmi->ptr, "backwards", FALSE);
+       RNA_boolean_set(kmi->ptr, "sequence", TRUE);
        kmi= WM_keymap_add_item(keymap, "CLIP_OT_track_markers", TKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
-       RNA_boolean_set(kmi->ptr, "backwards", 1);
-       RNA_boolean_set(kmi->ptr, "sequence", 1);
+       RNA_boolean_set(kmi->ptr, "backwards", TRUE);
+       RNA_boolean_set(kmi->ptr, "sequence", TRUE);
 
        /* mode */
        kmi= WM_keymap_add_item(keymap, "CLIP_OT_mode_set", TABKEY, KM_PRESS, 0, 0);
        RNA_enum_set(kmi->ptr, "mode", SC_MODE_RECONSTRUCTION);
-       RNA_boolean_set(kmi->ptr, "toggle", 1);
+       RNA_boolean_set(kmi->ptr, "toggle", TRUE);
 
        kmi= WM_keymap_add_item(keymap, "CLIP_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0);
        RNA_enum_set(kmi->ptr, "mode", SC_MODE_DISTORTION);
-       RNA_boolean_set(kmi->ptr, "toggle", 1);
+       RNA_boolean_set(kmi->ptr, "toggle", TRUE);
 
        /* ******** Hotkeys avalaible for main region only ******** */
 
@@ -490,10 +492,11 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
        kmi= WM_keymap_add_item(keymap, "CLIP_OT_lock_tracks", LKEY, KM_PRESS, KM_ALT, 0);
        RNA_enum_set(kmi->ptr, "action", 1);    /* unlock */
 
-       WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, 0, 0);
+       kmi= WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, 0, 0);
+       RNA_boolean_set(kmi->ptr, "unselected", FALSE);
 
        kmi= WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_boolean_set(kmi->ptr, "unselected", 1);
+       RNA_boolean_set(kmi->ptr, "unselected", TRUE);
 
        WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks_clear", HKEY, KM_PRESS, KM_ALT, 0);
 
index c91c8e1bd146b67b055df9d3c206c828d42fe351..9640701965c3b2d49e6cc769e860ce907959b5e5 100644 (file)
@@ -655,7 +655,11 @@ static int console_history_append_exec(bContext *C, wmOperator *op)
 
        ED_area_tag_redraw(sa);
 
-       console_scroll_bottom(ar);
+       /* when calling render modally this can be NULL when calling:
+        * bpy.ops.render.render('INVOKE_DEFAULT') */
+       if (ar) {
+               console_scroll_bottom(ar);
+       }
 
        return OPERATOR_FINISHED;
 }
index c713317aa7e45bce37725263588dba9513a6a270..1a2541cbc901b61efc2f6e866d7444de44ba6428 100644 (file)
@@ -276,19 +276,19 @@ static void console_keymap(struct wmKeyConfig *keyconf)
        
        kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0);
        RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
-       RNA_boolean_set(kmi->ptr, "reverse", 0);
+       RNA_boolean_set(kmi->ptr, "reverse", FALSE);
        
        kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0);
        RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
-       RNA_boolean_set(kmi->ptr, "reverse", 1);
+       RNA_boolean_set(kmi->ptr, "reverse", TRUE);
 
        kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
        RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
-       RNA_boolean_set(kmi->ptr, "reverse", 0);
+       RNA_boolean_set(kmi->ptr, "reverse", FALSE);
        
        kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADMINUS, KM_PRESS, KM_CTRL, 0);
        RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
-       RNA_boolean_set(kmi->ptr, "reverse", 1);
+       RNA_boolean_set(kmi->ptr, "reverse", TRUE);
 
        RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", LEFTARROWKEY, KM_PRESS, 0, 0)->ptr, "type", PREV_CHAR);
        RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", RIGHTARROWKEY, KM_PRESS, 0, 0)->ptr, "type", NEXT_CHAR);
index 7bc71e333ea25646cfb2599d7110f6614a2776bd..02c9728348e294ea11295a1e6e5e6321986b666f 100644 (file)
@@ -410,13 +410,13 @@ static void file_keymap(struct wmKeyConfig *keyconf)
        /* keys for main area */
        keymap= WM_keymap_find(keyconf, "File Browser Main", SPACE_FILE, 0);
        kmi= WM_keymap_add_item(keymap, "FILE_OT_execute", LEFTMOUSE, KM_DBL_CLICK, 0, 0);
-       RNA_boolean_set(kmi->ptr, "need_active", 1);
+       RNA_boolean_set(kmi->ptr, "need_active", TRUE);
        WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, 0, 0);
        kmi = WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, KM_SHIFT, 0);
-       RNA_boolean_set(kmi->ptr, "extend", 1);
+       RNA_boolean_set(kmi->ptr, "extend", TRUE);
        kmi = WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, KM_ALT, 0);
-       RNA_boolean_set(kmi->ptr, "extend", 1);
-       RNA_boolean_set(kmi->ptr, "fill", 1);
+       RNA_boolean_set(kmi->ptr, "extend", TRUE);
+       RNA_boolean_set(kmi->ptr, "fill", TRUE);
        WM_keymap_add_item(keymap, "FILE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "FILE_OT_refresh", PADPERIOD, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "FILE_OT_select_border", BKEY, KM_PRESS, 0, 0);
index 5c39da94ecdc401246843d8f5e63ff327b136870..aa245585d11219a0dc7c481441669c75ddd721ff 100644 (file)
@@ -295,7 +295,7 @@ static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
                RNA_boolean_set(kmi->ptr, "column", FALSE);
        
        /* select left/right */
-       WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
+       kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
                RNA_boolean_set(kmi->ptr, "extend", FALSE);
                RNA_enum_set(kmi->ptr, "mode", GRAPHKEYS_LRSEL_TEST);
        kmi= WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
index 06674513868edd6c118dd0d5dcd6ef865ff0c07b..e7a139fe465975843312063b87d0048bb4f905ca 100644 (file)
@@ -858,7 +858,9 @@ static int image_replace_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
        
        RNA_string_get(op->ptr, "filepath", str);
-       BLI_strncpy(sima->image->name, str, sizeof(sima->image->name)); /* we cant do much if the str is longer then 240 :/ */
+
+       /* we cant do much if the str is longer then FILE_MAX :/ */
+       BLI_strncpy(sima->image->name, str, sizeof(sima->image->name));
 
        /* XXX unpackImage frees image buffers */
        ED_preview_kill_jobs(C);
index c9cb5bd406d411c2c7160b87fae23d5b8e7f9f63..6fce836af988143024d90708fea7310e82fa1f9f 100644 (file)
@@ -542,7 +542,7 @@ static void image_keymap(struct wmKeyConfig *keyconf)
        /* toggle editmode is handy to have while UV unwrapping */
        kmi= WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0);
        RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT);
-       RNA_boolean_set(kmi->ptr, "toggle", 1);
+       RNA_boolean_set(kmi->ptr, "toggle", TRUE);
 }
 
 /* dropboxes */
index a6d8b6c2612d3b609a89e8cd5c71875122b5f80b..986aab8fa61e8374c9b508d8faf3d9ec67cd7eec 100644 (file)
@@ -216,21 +216,21 @@ void sequencer_keymap(wmKeyConfig *keyconf)
        RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "linked_right", 1);
        
        kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0);
-       RNA_boolean_set(kmi->ptr, "linked_left", 1);
-       RNA_boolean_set(kmi->ptr, "linked_right", 1);
+       RNA_boolean_set(kmi->ptr, "linked_left", TRUE);
+       RNA_boolean_set(kmi->ptr, "linked_right", TRUE);
 
        kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL|KM_ALT, 0);
-       RNA_boolean_set(kmi->ptr, "extend", 1);
-       RNA_boolean_set(kmi->ptr, "linked_left", 1);
-       RNA_boolean_set(kmi->ptr, "linked_right", 1);
+       RNA_boolean_set(kmi->ptr, "extend", TRUE);
+       RNA_boolean_set(kmi->ptr, "linked_left", TRUE);
+       RNA_boolean_set(kmi->ptr, "linked_right", TRUE);
 
        kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
-       RNA_boolean_set(kmi->ptr, "extend", 1);
-       RNA_boolean_set(kmi->ptr, "linked_left", 1);
+       RNA_boolean_set(kmi->ptr, "extend", TRUE);
+       RNA_boolean_set(kmi->ptr, "linked_left", TRUE);
 
        kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0);
-       RNA_boolean_set(kmi->ptr, "extend", 1);
-       RNA_boolean_set(kmi->ptr, "linked_right", 1);
+       RNA_boolean_set(kmi->ptr, "extend", TRUE);
+       RNA_boolean_set(kmi->ptr, "linked_right", TRUE);
         */
 
        /* 2.5 method, Alt and use selected handle */
index 7e6af8ea789aae57963fae24afa58ca4227dd0eb..441a5eab97617946ba9eb4f95a6bebc3a28953c2 100644 (file)
@@ -268,19 +268,19 @@ static void text_keymap(struct wmKeyConfig *keyconf)
        
        kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0);
        RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
-       RNA_boolean_set(kmi->ptr, "reverse", 0);
+       RNA_boolean_set(kmi->ptr, "reverse", FALSE);
        
        kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0);
        RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
-       RNA_boolean_set(kmi->ptr, "reverse", 1);
+       RNA_boolean_set(kmi->ptr, "reverse", TRUE);
 
        kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
        RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
-       RNA_boolean_set(kmi->ptr, "reverse", 0);
+       RNA_boolean_set(kmi->ptr, "reverse", FALSE);
        
        kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADMINUS, KM_PRESS, KM_CTRL, 0);
        RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
-       RNA_boolean_set(kmi->ptr, "reverse", 1);
+       RNA_boolean_set(kmi->ptr, "reverse", TRUE);
        
        WM_keymap_add_item(keymap, "TEXT_OT_new", NKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "TEXT_OT_open", OKEY, KM_PRESS, KM_ALT, 0);
@@ -357,9 +357,11 @@ static void text_keymap(struct wmKeyConfig *keyconf)
        
        WM_keymap_add_item(keymap, "TEXT_OT_overwrite_toggle", INSERTKEY, KM_PRESS, 0, 0);
 
+       WM_keymap_add_item(keymap, "TEXT_OT_scroll_bar", LEFTMOUSE, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "TEXT_OT_scroll_bar", MIDDLEMOUSE, KM_PRESS, 0, 0);
+
        WM_keymap_add_item(keymap, "TEXT_OT_scroll", MIDDLEMOUSE, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "TEXT_OT_scroll", MOUSEPAN, 0, 0, 0);
-       WM_keymap_add_item(keymap, "TEXT_OT_scroll_bar", LEFTMOUSE, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "TEXT_OT_selection_set", EVT_TWEAK_L, KM_ANY, 0, 0);
        WM_keymap_add_item(keymap, "TEXT_OT_cursor_set", LEFTMOUSE, KM_PRESS, 0, 0);
        RNA_boolean_set(WM_keymap_add_item(keymap, "TEXT_OT_selection_set", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "select", 1);
index e8ad6e19fd416c92c5c51d19df400faec0b8648b..19f0c9bba6113a0be1935fcaf45f2603ec59dad4 100644 (file)
@@ -2232,8 +2232,8 @@ static int text_scroll_invoke(bContext *C, wmOperator *op, wmEvent *event)
                text_scroll_apply(C, op, event);
                scroll_exit(C, op);
                return OPERATOR_FINISHED;
-       }       
-       
+       }
+
        WM_event_add_modal_handler(C, op);
        
        return OPERATOR_RUNNING_MODAL;
@@ -2314,9 +2314,20 @@ static int text_scroll_bar_invoke(bContext *C, wmOperator *op, wmEvent *event)
        tsc->scrollbar= 1;
        tsc->zone= zone;
        op->customdata= tsc;
-       
        st->flags|= ST_SCROLL_SELECT;
 
+       /* jump scroll, works in v2d but needs to be added here too :S */
+       if (event->type == MIDDLEMOUSE) {
+               tsc->old[0] = ar->winrct.xmin + (st->txtbar.xmax + st->txtbar.xmin) / 2;
+               tsc->old[1] = ar->winrct.ymin + (st->txtbar.ymax + st->txtbar.ymin) / 2;
+
+               tsc->delta[0] = 0;
+               tsc->delta[1] = 0;
+               tsc->first = 0;
+               tsc->zone= SCROLLHANDLE_BAR;
+               text_scroll_apply(C, op, event);
+       }
+
        WM_event_add_modal_handler(C, op);
 
        return OPERATOR_RUNNING_MODAL;
index 224df5b9f806812a2e751332addd590db2dfc9e4..b07e0ccdc7465093551daa77e49f3c42d4ae7429 100644 (file)
@@ -921,6 +921,22 @@ static int view3d_camera_active_poll(bContext *C)
        return 0;
 }
 
+/* test for unlocked camera view in quad view */
+static int view3d_camera_user_poll(bContext *C)
+{
+       View3D *v3d;
+       ARegion *ar;
+
+       if (ED_view3d_context_user_region(C, &v3d, &ar)) {
+               RegionView3D *rv3d = ar->regiondata;
+               if(rv3d->persp==RV3D_CAMOB) {
+                       return 1;
+               }
+       }
+
+       return 0;
+}
+
 static int viewrotate_cancel(bContext *C, wmOperator *op)
 {
        viewops_data_free(C, op);
@@ -2257,13 +2273,18 @@ void VIEW3D_OT_view_center_cursor(wmOperatorType *ot)
 
 static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op)) /* was view3d_home() in 2.4x */
 {
-       ARegion *ar= CTX_wm_region(C);
-       RegionView3D *rv3d= CTX_wm_region_view3d(C);
-       View3D *v3d= CTX_wm_view3d(C);
        Scene *scene= CTX_data_scene(C);
        float xfac, yfac;
        float size[2];
 
+       View3D *v3d;
+       ARegion *ar;
+       RegionView3D *rv3d;
+
+       /* no NULL check is needed, poll checks */
+       ED_view3d_context_user_region(C, &v3d, &ar);
+       rv3d = ar->regiondata;
+
        rv3d->camdx= rv3d->camdy= 0.0f;
 
        ED_view3d_calc_camera_border_size(scene, ar, v3d, rv3d, size);
@@ -2289,7 +2310,7 @@ void VIEW3D_OT_view_center_camera(wmOperatorType *ot)
 
        /* api callbacks */
        ot->exec= view3d_center_camera_exec;
-       ot->poll= view3d_camera_active_poll;
+       ot->poll= view3d_camera_user_poll;
 
        /* flags */
        ot->flag= 0;
@@ -2543,11 +2564,16 @@ static void view3d_set_1_to_1_viewborder(Scene *scene, ARegion *ar, View3D *v3d)
 static int view3d_zoom_1_to_1_camera_exec(bContext *C, wmOperator *UNUSED(op))
 {
        Scene *scene= CTX_data_scene(C);
-       ARegion *ar= CTX_wm_region(C);
 
-       view3d_set_1_to_1_viewborder(scene, ar, CTX_wm_view3d(C));
+       View3D *v3d;
+       ARegion *ar;
 
-       WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, CTX_wm_view3d(C));
+       /* no NULL check is needed, poll checks */
+       ED_view3d_context_user_region(C, &v3d, &ar);
+
+       view3d_set_1_to_1_viewborder(scene, ar, v3d);
+
+       WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d);
 
        return OPERATOR_FINISHED;
 }
@@ -2561,7 +2587,7 @@ void VIEW3D_OT_zoom_camera_1_to_1(wmOperatorType *ot)
 
        /* api callbacks */
        ot->exec= view3d_zoom_1_to_1_camera_exec;
-       ot->poll= view3d_camera_active_poll;
+       ot->poll= view3d_camera_user_poll;
 
        /* flags */
        ot->flag= 0;
@@ -2660,6 +2686,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
        static int perspo = RV3D_PERSP;
        int viewnum, align_active, nextperspo;
 
+       /* no NULL check is needed, poll checks */
        ED_view3d_context_user_region(C, &v3d, &ar);
        rv3d = ar->regiondata;
 
index 4594544b4f85639d28582b883550d7886a7bc96c..22470fe930dd8c3f236f9cf20532d4bfa8b1bb14 100644 (file)
@@ -121,7 +121,7 @@ void view3d_keymap(wmKeyConfig *keyconf)
        keymap= WM_keymap_find(keyconf, "3D View", SPACE_VIEW3D, 0);
        
        kmi = WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, KM_ANY, 0);
-       RNA_boolean_set(kmi->ptr, "release_confirm", 1);
+       RNA_boolean_set(kmi->ptr, "release_confirm", TRUE);
        /*
         * Doesn't work with KM_SHIFT, have to use KM_ANY and filter in invoke
         * */
index b7aba109cdd9446ad6b9f53939278f026ea59102..1843768bcd7c508985361f2de51c3378ac89b3c6 100644 (file)
@@ -843,7 +843,7 @@ void transform_operatortypes(void)
 
 void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spaceid)
 {
-       wmKeyMapItem *km;
+       wmKeyMapItem *kmi;
        wmKeyMap *modalmap;
        
        /* transform.c, only adds modal map once, checks if it's there */
@@ -879,71 +879,71 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
 
                        WM_keymap_add_item(keymap, "TRANSFORM_OT_select_orientation", SPACEKEY, KM_PRESS, KM_ALT, 0);
 
-                       km = WM_keymap_add_item(keymap, "TRANSFORM_OT_create_orientation", SPACEKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
-                       RNA_boolean_set(km->ptr, "use", 1);
+                       kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_create_orientation", SPACEKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
+                       RNA_boolean_set(kmi->ptr, "use", TRUE);
 
                        WM_keymap_add_item(keymap, OP_MIRROR, MKEY, KM_PRESS, KM_CTRL, 0);
 
-                       km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0);
-                       RNA_string_set(km->ptr, "data_path", "tool_settings.use_snap");
+                       kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0);
+                       RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_snap");
 
                        WM_keymap_add_item(keymap, "TRANSFORM_OT_snap_type", TABKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
 
-                       km = WM_keymap_add_item(keymap, OP_TRANSLATION, TKEY, KM_PRESS, KM_SHIFT, 0);
-                       RNA_boolean_set(km->ptr, "texture_space", 1);
+                       kmi = WM_keymap_add_item(keymap, OP_TRANSLATION, TKEY, KM_PRESS, KM_SHIFT, 0);
+                       RNA_boolean_set(kmi->ptr, "texture_space", TRUE);
 
-                       km = WM_keymap_add_item(keymap, OP_RESIZE, TKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0);
-                       RNA_boolean_set(km->ptr, "texture_space", 1);
+                       kmi = WM_keymap_add_item(keymap, OP_RESIZE, TKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0);
+                       RNA_boolean_set(kmi->ptr, "texture_space", TRUE);
 
                        break;
                case SPACE_ACTION:
-                       km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0);
-                       RNA_enum_set(km->ptr, "mode", TFM_TIME_TRANSLATE);
+                       kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0);
+                       RNA_enum_set(kmi->ptr, "mode", TFM_TIME_TRANSLATE);
                        
-                       km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
-                       RNA_enum_set(km->ptr, "mode", TFM_TIME_TRANSLATE);
+                       kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
+                       RNA_enum_set(kmi->ptr, "mode", TFM_TIME_TRANSLATE);
                        
-                       km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
-                       RNA_enum_set(km->ptr, "mode", TFM_TIME_EXTEND);
+                       kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
+                       RNA_enum_set(kmi->ptr, "mode", TFM_TIME_EXTEND);
                        
-                       km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0);
-                       RNA_enum_set(km->ptr, "mode", TFM_TIME_SCALE);
+                       kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0);
+                       RNA_enum_set(kmi->ptr, "mode", TFM_TIME_SCALE);
                        
-                       km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", TKEY, KM_PRESS, KM_SHIFT, 0);
-                       RNA_enum_set(km->ptr, "mode", TFM_TIME_SLIDE);
+                       kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", TKEY, KM_PRESS, KM_SHIFT, 0);
+                       RNA_enum_set(kmi->ptr, "mode", TFM_TIME_SLIDE);
                        break;
                case SPACE_IPO:
                        WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
                        
                        WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
                        
-                       km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
-                       RNA_enum_set(km->ptr, "mode", TFM_TIME_EXTEND);
+                       kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
+                       RNA_enum_set(kmi->ptr, "mode", TFM_TIME_EXTEND);
                        
                        WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
                        
                        WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
                        break;
                case SPACE_NLA:
-                       km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0);
-                       RNA_enum_set(km->ptr, "mode", TFM_TRANSLATION);
+                       kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0);
+                       RNA_enum_set(kmi->ptr, "mode", TFM_TRANSLATION);
                        
-                       km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
-                       RNA_enum_set(km->ptr, "mode", TFM_TRANSLATION);
+                       kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
+                       RNA_enum_set(kmi->ptr, "mode", TFM_TRANSLATION);
                        
-                       km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
-                       RNA_enum_set(km->ptr, "mode", TFM_TIME_EXTEND);
+                       kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
+                       RNA_enum_set(kmi->ptr, "mode", TFM_TIME_EXTEND);
                        
-                       km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0);
-                       RNA_enum_set(km->ptr, "mode", TFM_TIME_SCALE);
+                       kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0);
+                       RNA_enum_set(kmi->ptr, "mode", TFM_TIME_SCALE);
                        break;
                case SPACE_NODE:
                        WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
 
-                       km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_A, KM_ANY, 0, 0);
-                       RNA_boolean_set(km->ptr, "release_confirm", 1);
-                       km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
-                       RNA_boolean_set(km->ptr, "release_confirm", 1);
+                       kmi= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_A, KM_ANY, 0, 0);
+                       RNA_boolean_set(kmi->ptr, "release_confirm", TRUE);
+                       kmi= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
+                       RNA_boolean_set(kmi->ptr, "release_confirm", TRUE);
 
                        WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
 
@@ -954,8 +954,8 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
 
                        WM_keymap_add_item(keymap, OP_SEQ_SLIDE, EVT_TWEAK_S, KM_ANY, 0, 0);
 
-                       km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
-                       RNA_enum_set(km->ptr, "mode", TFM_TIME_EXTEND);
+                       kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
+                       RNA_enum_set(kmi->ptr, "mode", TFM_TIME_EXTEND);
                        break;
                case SPACE_IMAGE:
                        WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
@@ -970,8 +970,8 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
 
                        WM_keymap_add_item(keymap, "TRANSFORM_OT_mirror", MKEY, KM_PRESS, KM_CTRL, 0);
 
-                       km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0);
-                       RNA_string_set(km->ptr, "data_path", "tool_settings.use_snap");
+                       kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0);
+                       RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_snap");
                        break;
                case SPACE_CLIP:
                        WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
index 6e7385d683d60299e3b8cf3616e861923aea0444..f21c589d825ae7a2907e5ab4b52328f3a555f48f 100644 (file)
@@ -59,7 +59,7 @@ typedef struct Brush {
 
        struct ImBuf *icon_imbuf;
        PreviewImage *preview;
-       char icon_filepath[240];
+       char icon_filepath[240]; /* 240 = FILE_MAX */
 
        float normal_weight;
 
index cee8e5cd8d7f183a2dff768c768e300f5c1a09ad..0bf4ffb76ee5c60ce94981be25179fcab57faa00 100644 (file)
@@ -125,7 +125,7 @@ typedef struct DynamicPaintSurface {
        int pad_;
 
        char uvlayer_name[64];  /* MAX_CUSTOMDATA_LAYER_NAME */
-       char image_output_path[240];
+       char image_output_path[240];  /* 240 = FILE_MAX */
        char output_name[64];  /* MAX_CUSTOMDATA_LAYER_NAME */
        char output_name2[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ /* some surfaces have 2 outputs */
 
index a1b0ab06ecd7b7dca42dc52d5cc8ca5b90251d4e..110ac59edc9f2e5f88ac551b0f0d897ca61d70be 100644 (file)
@@ -69,7 +69,7 @@ typedef struct ImageUser {
 typedef struct Image {
        ID id;
        
-       char name[240];                 /* file path */
+       char name[240];                 /* file path, 240 = FILE_MAX */
        
        ListBase ibufs;                                 /* not written in file */
        struct GPUTexture *gputexture;  /* not written in file */
index ae658cee8f57e32da0c962727b87fbc9c1710c0a..863e2b2e6ed313558b60e8a390bab7166a049534 100644 (file)
@@ -45,7 +45,6 @@ typedef struct MetaElem {
        struct MetaElem *next, *prev;
 
        struct BoundBox *bb;        /* Bound Box of MetaElem */
-       int i1,j1,k1, i2,j2,k2;     /* corners of Bounding Box in lattice */
 
        short type, flag, selcol1, selcol2;
        float x, y, z;          /* Position of center of MetaElem */
index 5d2f2f5978fc90c6c7b3672469afaa8f505bb088..c08a5e95e92978151ea28a3237e6507d8ddb579a 100644 (file)
@@ -64,7 +64,7 @@ typedef struct MovieClipProxy {
 typedef struct MovieClip {
        ID id;
 
-       char name[240];         /* file path */
+       char name[240];         /* file path, 240 = FILE_MAX */
 
        int source;                     /* sequence or movie */
        int lastframe;          /* last accessed frame number */
index 28c28bbf329d33d3688299d882c3b9c5cbad1fd4..41f79546b156cb0f8ed210f96f62dc292ecbbb78 100644 (file)
@@ -195,7 +195,7 @@ typedef struct PointCache {
        char name[64];
        char prev_name[64];
        char info[64];
-       char path[240]; /* file path */
+       char path[240]; /* file path, 240 = FILE_MAX */
        char *cached_frames;    /* array of length endframe-startframe+1 with flags to indicate cached frames */
                                                        /* can be later used for other per frame flags too if needed */
        struct ListBase mem_cache;
index a2dfea11cdbd9909a49b0c3e7b9f4a919ef2bf8c..2ac08d5e9f24a94e6d40abaf465c81c2d50d74fe 100644 (file)
@@ -471,7 +471,7 @@ typedef struct RenderData {
        float bake_maxdist, bake_biasdist, bake_pad;
 
        /* path to render output */
-       char pic[240];
+       char pic[240]; /* 240 = FILE_MAX */
 
        /* stamps flags. */
        int stamp;
@@ -797,12 +797,12 @@ typedef struct VPaint {
 
 /* VPaint flag */
 #define VP_COLINDEX    1
-#define VP_AREA                2
+#define VP_AREA                2  /* vertex paint only */
 
 #define VP_NORMALS     8
 #define VP_SPRAY       16
 // #define VP_MIRROR_X 32 // deprecated in 2.5x use (me->editflag & ME_EDIT_MIRROR_X)
-#define VP_ONLYVGROUP  128
+#define VP_ONLYVGROUP  128  /* weight paint only */
 
 /* *************************************************************** */
 /* Transform Orientations */
index f530730a544d27b78279c66d71aec689a3024abf..82185c811a173bb568dd41cfe8380d168ce86ef1 100644 (file)
@@ -49,7 +49,7 @@ typedef struct bSound {
        /**
         * The path to the sound file.
         */
-       char name[240];
+       char name[240];  /* 240 = FILE_MAX */
 
        /**
         * The packed file.
index d502e56bf10cb0797fd8b78de628f04eaa833051..aa7a84c577b9723a09e2ddb82f7e0915054edcec 100644 (file)
@@ -133,8 +133,6 @@ typedef struct SpaceButs {
        float blockscale  DNA_DEPRECATED;
        
        short blockhandler[8]  DNA_DEPRECATED;
-       
-       struct RenderInfo *ri;
 
        View2D v2d  DNA_DEPRECATED;                                             /* deprecated, copied to region */
        
@@ -518,6 +516,9 @@ typedef struct SpaceClip {
        int pad;
        float stabmat[4][4], unistabmat[4][4];          /* current stabilization matrix and the same matrix in unified space,
                                                                                                   defined when drawing and used for mouse position calculation */
+
+       /* movie postprocessing */
+       int postproc_flag, pad2;
 } SpaceClip;
 
 /* view3d  Now in DNA_view3d_types.h */
index e711124d39c00039807f24021a00a9ef5ede6dc5..1cc84669e3b5275e4f874ccb52b41a9a8ca59e43 100644 (file)
@@ -200,7 +200,7 @@ typedef struct VoxelData {
        struct Object *object; /* for rendering smoke sims */
        float int_multiplier;   
        int still_frame;
-       char source_path[240];
+       char source_path[240];  /* 240 = FILE_MAX */
 
        /* temporary data */
        float *dataset;
index fc418069c5c86d4e55ecfe25ebecb8cad147e82b..2fa785e4156b1eee09ac5601e2fa97ce4be36687 100644 (file)
@@ -318,16 +318,16 @@ typedef struct SolidLight {
 typedef struct UserDef {
        int flag, dupflag;
        int savetime;
-       char tempdir[160];      // FILE_MAXDIR length
+       char tempdir[160];      /* FILE_MAXDIR length */
        char fontdir[160];
-       char renderdir[240]; // FILE_MAX length
+       char renderdir[240]; /* FILE_MAX length */
        char textudir[160];
        char plugtexdir[160];
        char plugseqdir[160];
        char pythondir[160];
        char sounddir[160];
-       char image_editor[240]; // FILE_MAX length
-       char anim_player[240];  // FILE_MAX length
+       char image_editor[240]; /* 240 = FILE_MAX */
+       char anim_player[240];  /* 240 = FILE_MAX */
        int anim_player_preset;
        
        short v2d_min_gridsize;         /* minimum spacing between gridlines in View2D grids */
index 428f56b51309f7c7ee55cf4dfaac57782ffafd5a..f853e7b8dd98619e67b231e53e933c8a04b04e78 100644 (file)
@@ -304,7 +304,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
        RNA_def_property_update(prop, 0, "rna_fluid_find_enframe");
 
        prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
-       RNA_def_property_string_maxlength(prop, 240);
+       RNA_def_property_string_maxlength(prop, FILE_MAX);
        RNA_def_property_string_sdna(prop, NULL, "surfdataPath");
        RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store baked fluid simulation files in");
        RNA_def_property_update(prop, 0, "rna_fluid_update");
@@ -381,7 +381,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
        RNA_def_property_int_sdna(prop, NULL, "surfaceSubdivs");
        RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
        RNA_def_property_range(prop, 0, 5);
-       RNA_def_property_ui_text(prop, "Surface Subdivisions", "Number of isosurface subdivisions (this is necessary for the inclusion of particles into the surface generation - WARNING: can lead to longer computation times !)");
+       RNA_def_property_ui_text(prop, "Surface Subdivisions", "Number of isosurface subdivisions (this is necessary for the inclusion of particles into the surface generation - WARNING: can lead to longer computation times !)");
 
        prop= RNA_def_property(srna, "use_speed_vectors", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "domainNovecgen", 0);
@@ -554,7 +554,7 @@ static void rna_def_fluidsim_particle(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Alpha Influence", "Amount of particle alpha change, inverse of size influence: 0=off (all same alpha), 1=full (large particles get lower alphas, smaller ones higher values)");
 
        prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
-       RNA_def_property_string_maxlength(prop, 240);
+       RNA_def_property_string_maxlength(prop, FILE_MAX);
        RNA_def_property_string_sdna(prop, NULL, "surfdataPath");
        RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store and load particles from");
        RNA_def_property_update(prop, 0, "rna_fluid_update");
index be03da6839d0730ab2144a626db56663b6080a8f..dc1faa29be286cc94fe5bd081c60001301d57653 100644 (file)
@@ -32,6 +32,8 @@
 
 #include "rna_internal.h"
 
+#include "BKE_utildefines.h"
+
 #ifdef RNA_RUNTIME
 
 #include "BKE_main.h"
@@ -323,7 +325,7 @@ void RNA_def_main(BlenderRNA *brna)
        RNA_def_struct_ui_icon(srna, ICON_BLENDER);
 
        prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
-       RNA_def_property_string_maxlength(prop, 240);
+       RNA_def_property_string_maxlength(prop, FILE_MAX);
        RNA_def_property_string_funcs(prop, "rna_Main_filepath_get", "rna_Main_filepath_length", "rna_Main_filepath_set");
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        RNA_def_property_ui_text(prop, "Filename", "Path to the .blend file");
index a15ca5de5c19e571387fc96f59b789525dd1de42..cd929d3aeda2191d554ab3dae0c5302926694270 100644 (file)
@@ -289,6 +289,7 @@ static void rna_def_sculpt(BlenderRNA  *brna)
        RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Sculpt_update");
 }
 
+/* use for weight paint too */
 static void rna_def_vertex_paint(BlenderRNA *brna)
 {
        StructRNA *srna;
@@ -297,7 +298,8 @@ static void rna_def_vertex_paint(BlenderRNA *brna)
        srna= RNA_def_struct(brna, "VertexPaint", "Paint");
        RNA_def_struct_sdna(srna, "VPaint");
        RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode");
-       
+
+       /* vertex paint only */
        prop= RNA_def_property(srna, "use_all_faces", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_AREA);
        RNA_def_property_ui_text(prop, "All Faces", "Paint on all faces inside brush");
@@ -309,6 +311,11 @@ static void rna_def_vertex_paint(BlenderRNA *brna)
        prop= RNA_def_property(srna, "use_spray", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_SPRAY);
        RNA_def_property_ui_text(prop, "Spray", "Keep applying paint effect while holding mouse");
+
+       /* weight paint only */
+       prop= RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_ONLYVGROUP);
+       RNA_def_property_ui_text(prop, "Restrict", "Restrict painting to verts already apart of the vertex group");
 }
 
 static void rna_def_image_paint(BlenderRNA *brna)
index 5b0b97d19be05a473d05b41f69f2ba34ee3d5ddd..d7f1c375a2162632faa672562b1da379b5072b6c 100644 (file)
@@ -35,6 +35,7 @@
 #include "rna_internal.h"
 
 #include "BKE_key.h"
+#include "BKE_movieclip.h"
 
 #include "DNA_action_types.h"
 #include "DNA_key_types.h"
@@ -2984,6 +2985,32 @@ static void rna_def_space_clip(BlenderRNA *brna)
        RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GRAPH_TRACKS);
        RNA_def_property_ui_text(prop, "Show Tracks", "Display the speed curves (in \"x\" direction red, in \"y\" direction green) for the selected tracks");
        RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
+
+       /* ** channels ** */
+
+       /* show_red_channel */
+       prop= RNA_def_property(srna, "show_red_channel", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_negative_sdna(prop, NULL, "postproc_flag", MOVIECLIP_DISABLE_RED);
+       RNA_def_property_ui_text(prop, "Show Red Channel", "Show red channel in the frame");
+       RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
+
+       /* show_green_channel */
+       prop= RNA_def_property(srna, "show_green_channel", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_negative_sdna(prop, NULL, "postproc_flag", MOVIECLIP_DISABLE_GREEN);
+       RNA_def_property_ui_text(prop, "Show Green Channel", "Show green channel in the frame");
+       RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
+
+       /* show_blue_channel */
+       prop= RNA_def_property(srna, "show_blue_channel", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_negative_sdna(prop, NULL, "postproc_flag", MOVIECLIP_DISABLE_BLUE);
+       RNA_def_property_ui_text(prop, "Show Blue Channel", "Show blue channel in the frame");
+       RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
+
+       /* preview_grayscale */
+       prop= RNA_def_property(srna, "use_grayscale_preview", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "postproc_flag", MOVIECLIP_PREVIEW_GRAYSCALE);
+       RNA_def_property_ui_text(prop, "Grayscale", "Display frame in grayscale mode");
+       RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
 }
 
 
index eaa8b82e4d78e67a3a80c3ea3065e981c69f42c8..4940c53551e49ade70ea5d7bc9cd8aec369efa6e 100644 (file)
@@ -743,14 +743,28 @@ int pyrna_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int
        return 0;
 }
 
+/* note on __cmp__:
+ * checking the 'ptr->data' matches works in almost all cases,
+ * however there are a few RNA properties that are fake sub-structs and
+ * share the pointer with the parent, in those cases this happens 'a.b == a'
+ * see: r43352 for example.
+ *
+ * So compare the 'ptr->type' as well to avoid this problem.
+ * It's highly unlikely this would happen that 'ptr->data' and 'ptr->prop' would match,
+ * but _not_ 'ptr->type' but include this check for completeness.
+ * - campbell */
+
 static int pyrna_struct_compare(BPy_StructRNA *a, BPy_StructRNA *b)
 {
-       return (a->ptr.data == b->ptr.data && a->ptr.type == b->ptr.type) ? 0 : -1;
+       return ( (a->ptr.data == b->ptr.data) &&
+                (a->ptr.type == b->ptr.type)) ? 0 : -1;
 }
 
 static int pyrna_prop_compare(BPy_PropertyRNA *a, BPy_PropertyRNA *b)
 {
-       return (a->prop == b->prop && a->ptr.data == b->ptr.data) ? 0 : -1;
+       return ( (a->prop == b->prop) &&
+                (a->ptr.data == b->ptr.data) &&
+                (a->ptr.type == b->ptr.type) ) ? 0 : -1;
 }
 
 static PyObject *pyrna_struct_richcmp(PyObject *a, PyObject *b, int op)
index f10d8c48c92ce1b2585069fd87c98b6224342ba1..7fe4b5ba5dd001e9231be2435d5fa35f04000448 100644 (file)
@@ -1939,13 +1939,6 @@ static PyObject *Matrix_mul(PyObject *m1, PyObject *m2)
                     Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);
        return NULL;
 }
-static PyObject *Matrix_inv(MatrixObject *self)
-{
-       if (BaseMath_ReadCallback(self) == -1)
-               return NULL;
-
-       return Matrix_invert(self);
-}
 
 /*-----------------PROTOCOL DECLARATIONS--------------------------*/
 static PySequenceMethods Matrix_SeqMethods = {
@@ -2049,7 +2042,7 @@ static PyNumberMethods Matrix_NumMethods = {
                (unaryfunc)     0,      /*tp_positive*/
                (unaryfunc)     0,      /*tp_absolute*/
                (inquiry)       0,      /*tp_bool*/
-               (unaryfunc)     Matrix_inv,     /*nb_invert*/
+               (unaryfunc)     Matrix_inverted,        /*nb_invert*/
                NULL,                           /*nb_lshift*/
                (binaryfunc)0,  /*nb_rshift*/
                NULL,                           /*nb_and*/
index 94f6eb19e2c659453931cdb91ae319e2dd0ff1e8..299266154dd8ff4c66fb549547859272eb323a93 100644 (file)
@@ -248,7 +248,7 @@ void wm_drags_check_ops(bContext *C, wmEvent *event)
 
 /* ************** draw ***************** */
 
-static void wm_drop_operator_draw(char *name, int x, int y)
+static void wm_drop_operator_draw(const char *name, int x, int y)
 {
        int width= UI_GetStringWidth(name);
        
index edd822bd2da0ed59ae0b7dfe067b56906db8d21d..ec4e035068a8bea9ea6f47e0443fc9435339e2c0 100644 (file)
@@ -3882,7 +3882,7 @@ void wm_window_keymap(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
        WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", F2KEY, KM_PRESS, 0, 0);
        kmi= WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_ALT|KM_CTRL, 0);
-       RNA_boolean_set(kmi->ptr, "copy", 1);
+       RNA_boolean_set(kmi->ptr, "copy", TRUE);
 
        WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, KM_ALT, 0);
        WM_keymap_add_item(keymap, "WM_OT_quit_blender", QKEY, KM_PRESS, KM_CTRL, 0);
index 445f2b8f0ba8f6ef1d9558fa8195fa42d7b18e20..493516aeef4fd0424d1391886b98fa5aaa21e6e9 100644 (file)
@@ -286,7 +286,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
                        exitrequested = KX_EXIT_REQUEST_NO_REQUEST;
                        if (bfd) BLO_blendfiledata_free(bfd);
                        
-                       char basedpath[240];
+                       char basedpath[FILE_MAX];
                        // base the actuator filename with respect
                        // to the original file working directory
 
index 2aab04987655ba58f824c5cf20865eaabb7d1cd3..c63b32830b005d9e633e43083f54b61604a01e45 100644 (file)
@@ -526,8 +526,8 @@ PyAttributeDef BL_ActionActuator::Attributes[] = {
        KX_PYATTRIBUTE_RO_FUNCTION("channelNames", BL_ActionActuator, pyattr_get_channel_names),
        KX_PYATTRIBUTE_SHORT_RW("priority", 0, 100, false, BL_ActionActuator, m_priority),
        KX_PYATTRIBUTE_RW_FUNCTION("frame", BL_ActionActuator, pyattr_get_frame, pyattr_set_frame),
-       KX_PYATTRIBUTE_STRING_RW("propName", 0, 31, false, BL_ActionActuator, m_propname),
-       KX_PYATTRIBUTE_STRING_RW("framePropName", 0, 31, false, BL_ActionActuator, m_framepropname),
+       KX_PYATTRIBUTE_STRING_RW("propName", 0, MAX_PROP_NAME, false, BL_ActionActuator, m_propname),
+       KX_PYATTRIBUTE_STRING_RW("framePropName", 0, MAX_PROP_NAME, false, BL_ActionActuator, m_framepropname),
        KX_PYATTRIBUTE_RW_FUNCTION("useContinue", BL_ActionActuator, pyattr_get_use_continue, pyattr_set_use_continue),
        KX_PYATTRIBUTE_FLOAT_RW_CHECK("blendTime", 0, MAXFRAMEF, BL_ActionActuator, m_blendframe, CheckBlendTime),
        KX_PYATTRIBUTE_SHORT_RW_CHECK("mode",0,100,false,BL_ActionActuator,m_playtype,CheckType),
index aa62479d420420a63c8e021a968491e4d92f6337..d679d1a57927afdf5d11bdb73287081abf7b9db9 100644 (file)
@@ -519,8 +519,8 @@ PyAttributeDef BL_ShapeActionActuator::Attributes[] = {
        KX_PYATTRIBUTE_RW_FUNCTION("action", BL_ShapeActionActuator, pyattr_get_action, pyattr_set_action),
        KX_PYATTRIBUTE_SHORT_RW("priority", 0, 100, false, BL_ShapeActionActuator, m_priority),
        KX_PYATTRIBUTE_FLOAT_RW_CHECK("frame", 0, MAXFRAMEF, BL_ShapeActionActuator, m_localtime, CheckFrame),
-       KX_PYATTRIBUTE_STRING_RW("propName", 0, 31, false, BL_ShapeActionActuator, m_propname),
-       KX_PYATTRIBUTE_STRING_RW("framePropName", 0, 31, false, BL_ShapeActionActuator, m_framepropname),
+       KX_PYATTRIBUTE_STRING_RW("propName", 0, MAX_PROP_NAME, false, BL_ShapeActionActuator, m_propname),
+       KX_PYATTRIBUTE_STRING_RW("framePropName", 0, MAX_PROP_NAME, false, BL_ShapeActionActuator, m_framepropname),
        KX_PYATTRIBUTE_FLOAT_RW_CHECK("blendTime", 0, MAXFRAMEF, BL_ShapeActionActuator, m_blendframe, CheckBlendTime),
        KX_PYATTRIBUTE_SHORT_RW_CHECK("mode",0,100,false,BL_ShapeActionActuator,m_playtype,CheckType),
        { NULL }        //Sentinel
index 4fe436d634c7080f6a13a9f20b8985bd19c599f5..bed9e5380907eb7dc0735bbaed4d9508033f86f6 100644 (file)
@@ -888,11 +888,11 @@ void      KX_BlenderSceneConverter::TestHandlesPhysicsObjectToAnimationIpo()
                        {
                                //KX_IPhysicsController* physCtrl = gameObj->GetPhysicsController();
                                
+#if 0
                                Object* blenderObject = gameObj->GetBlenderObject();
                                if (blenderObject && blenderObject->ipo)
                                {
                                        // XXX animato
-#if 0
                                        Ipo* ipo = blenderObject->ipo;
                                        
                                        //create the curves, if not existing
@@ -903,17 +903,11 @@ void      KX_BlenderSceneConverter::TestHandlesPhysicsObjectToAnimationIpo()
                                        testhandles_ipocurve(findIpoCurve((IpoCurve *)ipo->curve.first,"RotX"));
                                        testhandles_ipocurve(findIpoCurve((IpoCurve *)ipo->curve.first,"RotY"));
                                        testhandles_ipocurve(findIpoCurve((IpoCurve *)ipo->curve.first,"RotZ"));
-#endif
                                }
+#endif
                        }
-
                }
-               
-       
        }
-
-
-
 }
 
 #ifdef WITH_PYTHON
index b1072dd8336d99eb9e729976f6d9ba9d82f8204d..107ae453c8e7a63776bc37bb0b93a06005b50438 100644 (file)
@@ -54,6 +54,8 @@ extern "C" {
 }
 #endif
 
+#define MAX_PROP_NAME 64
+
 static inline void Py_Fatal(const char *M)
 {
        fprintf(stderr, "%s\n", M);
index 8b0ea2394c83137070d6d7cf64393188452aa758..8b7702228ce609e3ad658ae93a3d0b5ed47a5516 100644 (file)
@@ -150,7 +150,7 @@ PyMethodDef SCA_ActuatorSensor::Methods[] = {
 };
 
 PyAttributeDef SCA_ActuatorSensor::Attributes[] = {
-       KX_PYATTRIBUTE_STRING_RW_CHECK("actuator",0,100,false,SCA_ActuatorSensor,m_checkactname,CheckActuator),
+       KX_PYATTRIBUTE_STRING_RW_CHECK("actuator",0,MAX_PROP_NAME,false,SCA_ActuatorSensor,m_checkactname,CheckActuator),
        { NULL }        //Sentinel
 };
 
index 87b37a8ef393bbb4473d8eeb2755c122661555cc..051bc2aafceb26280e72c470c8f0b0f8da516528 100644 (file)
@@ -133,8 +133,8 @@ public:
 
 
        /* for moving logic bricks between scenes */
-       virtual void            Replace_IScene(SCA_IScene *val) {};
-       virtual void            Replace_NetworkScene(NG_NetworkScene *val) {};
+       virtual void            Replace_IScene(SCA_IScene *val) {}
+       virtual void            Replace_NetworkScene(NG_NetworkScene *val) {}
 
 #ifdef WITH_PYTHON
        // python methods
index 45780735c4970b204baa266407416b568671f7d9..97cd01dff3889a203d59142384a059c4532e22ab 100644 (file)
@@ -479,8 +479,8 @@ PyAttributeDef SCA_KeyboardSensor::Attributes[] = {
        KX_PYATTRIBUTE_INT_RW("key",0,SCA_IInputDevice::KX_ENDKEY,true,SCA_KeyboardSensor,m_hotkey),
        KX_PYATTRIBUTE_SHORT_RW("hold1",0,SCA_IInputDevice::KX_ENDKEY,true,SCA_KeyboardSensor,m_qual),
        KX_PYATTRIBUTE_SHORT_RW("hold2",0,SCA_IInputDevice::KX_ENDKEY,true,SCA_KeyboardSensor,m_qual2),
-       KX_PYATTRIBUTE_STRING_RW("toggleProperty",0,100,false,SCA_KeyboardSensor,m_toggleprop),
-       KX_PYATTRIBUTE_STRING_RW("targetProperty",0,100,false,SCA_KeyboardSensor,m_targetprop),
+       KX_PYATTRIBUTE_STRING_RW("toggleProperty",0,MAX_PROP_NAME,false,SCA_KeyboardSensor,m_toggleprop),
+       KX_PYATTRIBUTE_STRING_RW("targetProperty",0,MAX_PROP_NAME,false,SCA_KeyboardSensor,m_targetprop),
        { NULL }        //Sentinel
 };
 
index e7283978ae14523968aaaa031fd74c466db26746..441c833d3a870b9e508c57cfd0fa3e8dbb7866b8 100644 (file)
@@ -111,7 +111,7 @@ public:
        /* --------------------------------------------------------------------- */
 
        // KeyEvents: 
-       KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,getEventList); 
+       KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,getEventList);
        // KeyStatus: 
        KX_PYMETHOD_DOC_O(SCA_KeyboardSensor,getKeyStatus);
        
index 844cf7ae96dca83dbb1c9a9cd3a65448f97a79a2..544b1da76af1b03b3cf7f162ca79b2828505088a 100644 (file)
@@ -257,7 +257,7 @@ PyMethodDef SCA_PropertyActuator::Methods[] = {
 };
 
 PyAttributeDef SCA_PropertyActuator::Attributes[] = {
-       KX_PYATTRIBUTE_STRING_RW_CHECK("propName",0,100,false,SCA_PropertyActuator,m_propname,CheckProperty),
+       KX_PYATTRIBUTE_STRING_RW_CHECK("propName",0,MAX_PROP_NAME,false,SCA_PropertyActuator,m_propname,CheckProperty),
        KX_PYATTRIBUTE_STRING_RW("value",0,100,false,SCA_PropertyActuator,m_exprtxt),
        KX_PYATTRIBUTE_INT_RW("mode", KX_ACT_PROP_NODEF+1, KX_ACT_PROP_MAX-1, false, SCA_PropertyActuator, m_type), /* ATTR_TODO add constents to game logic dict */
        { NULL }        //Sentinel
index e1ee6c75b95a673e18d8a0f414c6d7216f4bada8..8e324bbb0d71c267a0f02e57bcf5177ecb7b7b9f 100644 (file)
@@ -377,7 +377,7 @@ PyMethodDef SCA_PropertySensor::Methods[] = {
 
 PyAttributeDef SCA_PropertySensor::Attributes[] = {
        KX_PYATTRIBUTE_INT_RW_CHECK("mode",KX_PROPSENSOR_NODEF,KX_PROPSENSOR_MAX-1,false,SCA_PropertySensor,m_checktype,modeChange),
-       KX_PYATTRIBUTE_STRING_RW_CHECK("propName",0,100,false,SCA_PropertySensor,m_checkpropname,CheckProperty),
+       KX_PYATTRIBUTE_STRING_RW_CHECK("propName",0,MAX_PROP_NAME,false,SCA_PropertySensor,m_checkpropname,CheckProperty),
        KX_PYATTRIBUTE_STRING_RW_CHECK("value",0,100,false,SCA_PropertySensor,m_checkpropval,validValueForProperty),
        KX_PYATTRIBUTE_STRING_RW_CHECK("min",0,100,false,SCA_PropertySensor,m_checkpropval,validValueForIntervalProperty),
        KX_PYATTRIBUTE_STRING_RW_CHECK("max",0,100,false,SCA_PropertySensor,m_checkpropmaxval,validValueForIntervalProperty),
index 430326cbce083800cb90000acebe66bf29da6108..59925f4404031fd968ec8c6c364a5b6a19f725d4 100644 (file)
@@ -361,7 +361,7 @@ PyAttributeDef SCA_RandomActuator::Attributes[] = {
        KX_PYATTRIBUTE_FLOAT_RO("para1",SCA_RandomActuator,m_parameter1),
        KX_PYATTRIBUTE_FLOAT_RO("para2",SCA_RandomActuator,m_parameter2),
        KX_PYATTRIBUTE_ENUM_RO("distribution",SCA_RandomActuator,m_distribution),
-       KX_PYATTRIBUTE_STRING_RW_CHECK("propName",0,100,false,SCA_RandomActuator,m_propname,CheckProperty),
+       KX_PYATTRIBUTE_STRING_RW_CHECK("propName",0,MAX_PROP_NAME,false,SCA_RandomActuator,m_propname,CheckProperty),
        KX_PYATTRIBUTE_RW_FUNCTION("seed",SCA_RandomActuator,pyattr_get_seed,pyattr_set_seed),
        { NULL }        //Sentinel
 };     
index c725847037ae971f8a4d4c91676a33d236ad5cbb..9166f0dded4c2745c94c68c809684d668a25b9b9 100644 (file)
@@ -765,7 +765,7 @@ int main(int argc, char** argv)
                                        // if we got an exitcode 3 (KX_EXIT_REQUEST_START_OTHER_GAME) load a different file
                                        if (exitcode == KX_EXIT_REQUEST_START_OTHER_GAME)
                                        {
-                                               char basedpath[240];
+                                               char basedpath[FILE_MAX];
                                                
                                                // base the actuator filename relative to the last file
                                                BLI_strncpy(basedpath, exitstring.Ptr(), sizeof(basedpath));
index 5d5f3ff3f87a228cabeee5c2a02259a7ba96fd68..9d5a6907c46df5c9fa5927143beb63fb0c1553b5 100644 (file)
@@ -129,7 +129,7 @@ PyMethodDef KX_NetworkMessageActuator::Methods[] = {
 };
 
 PyAttributeDef KX_NetworkMessageActuator::Attributes[] = {
-       KX_PYATTRIBUTE_STRING_RW("propName", 0, 100, false, KX_NetworkMessageActuator, m_toPropName),
+       KX_PYATTRIBUTE_STRING_RW("propName", 0, MAX_PROP_NAME, false, KX_NetworkMessageActuator, m_toPropName),
        KX_PYATTRIBUTE_STRING_RW("subject", 0, 100, false, KX_NetworkMessageActuator, m_subject),
        KX_PYATTRIBUTE_BOOL_RW("usePropBody", KX_NetworkMessageActuator, m_bPropBody),
        KX_PYATTRIBUTE_STRING_RW("body", 0, 16384, false, KX_NetworkMessageActuator, m_body),
index ea3a64d0d73d890c0bba42a9a17b0c6e73e2f369..da8df24d7047cf710e30818e1c36e54e92c3af11 100644 (file)
@@ -600,7 +600,7 @@ PyAttributeDef KX_ConstraintActuator::Attributes[] = {
        KX_PYATTRIBUTE_FLOAT_ARRAY_RW_CHECK("direction",-FLT_MAX,FLT_MAX,KX_ConstraintActuator,m_refDirection,3,pyattr_check_direction),
        KX_PYATTRIBUTE_INT_RW("option",0,0xFFFF,false,KX_ConstraintActuator,m_option),
        KX_PYATTRIBUTE_INT_RW("time",0,1000,true,KX_ConstraintActuator,m_activeTime),
-       KX_PYATTRIBUTE_STRING_RW("propName",0,32,true,KX_ConstraintActuator,m_property),
+       KX_PYATTRIBUTE_STRING_RW("propName",0,MAX_PROP_NAME,true,KX_ConstraintActuator,m_property),
        KX_PYATTRIBUTE_FLOAT_RW("min",-FLT_MAX,FLT_MAX,KX_ConstraintActuator,m_minimumBound),
        KX_PYATTRIBUTE_FLOAT_RW("distance",-FLT_MAX,FLT_MAX,KX_ConstraintActuator,m_minimumBound),
        KX_PYATTRIBUTE_FLOAT_RW("max",-FLT_MAX,FLT_MAX,KX_ConstraintActuator,m_maximumBound),
index 878bdcedfda091ce990d91db0966617a62d6119d..e0cd9726104a0f950a0bf48f8fd0d71a94ec9152 100644 (file)
@@ -442,8 +442,8 @@ PyMethodDef KX_IpoActuator::Methods[] = {
 PyAttributeDef KX_IpoActuator::Attributes[] = {
        KX_PYATTRIBUTE_RW_FUNCTION("frameStart", KX_IpoActuator, pyattr_get_frame_start, pyattr_set_frame_start),
        KX_PYATTRIBUTE_RW_FUNCTION("frameEnd", KX_IpoActuator, pyattr_get_frame_end, pyattr_set_frame_end),
-       KX_PYATTRIBUTE_STRING_RW("propName", 0, 64, false, KX_IpoActuator, m_propname),
-       KX_PYATTRIBUTE_STRING_RW("framePropName", 0, 64, false, KX_IpoActuator, m_framepropname),
+       KX_PYATTRIBUTE_STRING_RW("propName", 0, MAX_PROP_NAME, false, KX_IpoActuator, m_propname),
+       KX_PYATTRIBUTE_STRING_RW("framePropName", 0, MAX_PROP_NAME, false, KX_IpoActuator, m_framepropname),
        KX_PYATTRIBUTE_INT_RW("mode", KX_ACT_IPO_NODEF+1, KX_ACT_IPO_MAX-1, true, KX_IpoActuator, m_type),
        KX_PYATTRIBUTE_BOOL_RW("useIpoAsForce", KX_IpoActuator, m_ipo_as_force),
        KX_PYATTRIBUTE_BOOL_RW("useIpoAdd", KX_IpoActuator, m_ipo_add),
index 6fa14c94f99da5263b4ad0c4c4ae291fc136f892..0cc0e7318c11163c24b589ba0e5ab89a843908c1 100644 (file)
@@ -352,7 +352,7 @@ PyAttributeDef KX_RaySensor::Attributes[] = {
        KX_PYATTRIBUTE_BOOL_RW("useMaterial", KX_RaySensor, m_bFindMaterial),
        KX_PYATTRIBUTE_BOOL_RW("useXRay", KX_RaySensor, m_bXRay),
        KX_PYATTRIBUTE_FLOAT_RW("range", 0, 10000, KX_RaySensor, m_distance),
-       KX_PYATTRIBUTE_STRING_RW("propName", 0, 100, false, KX_RaySensor, m_propertyname),
+       KX_PYATTRIBUTE_STRING_RW("propName", 0, MAX_PROP_NAME, false, KX_RaySensor, m_propertyname),
        KX_PYATTRIBUTE_INT_RW("axis", 0, 5, true, KX_RaySensor, m_axis),
        KX_PYATTRIBUTE_FLOAT_ARRAY_RO("hitPosition", KX_RaySensor, m_hitPosition, 3),
        KX_PYATTRIBUTE_FLOAT_ARRAY_RO("rayDirection", KX_RaySensor, m_rayDirection, 3),
index 16474437142a7d3eb6c1eb341cf7e18f76db78eb..3370805978422491547f5f98116e1d7aa4eb7715 100644 (file)
@@ -249,7 +249,7 @@ PyMethodDef KX_SceneActuator::Methods[] =
 };
 
 PyAttributeDef KX_SceneActuator::Attributes[] = {
-       KX_PYATTRIBUTE_STRING_RW("scene",0,32,true,KX_SceneActuator,m_nextSceneName),
+       KX_PYATTRIBUTE_STRING_RW("scene",0,MAX_ID_NAME-2,true,KX_SceneActuator,m_nextSceneName),
        KX_PYATTRIBUTE_RW_FUNCTION("camera",KX_SceneActuator,pyattr_get_camera,pyattr_set_camera),
        KX_PYATTRIBUTE_BOOL_RW("useRestart", KX_SceneActuator, m_restart),
        KX_PYATTRIBUTE_INT_RW("mode", KX_SCENE_NODEF+1, KX_SCENE_MAX-1, true, KX_SceneActuator, m_mode),
index aa864349035b2298d3e79bef84e20d16e57dba9e..d7bcf1306a1800639d7681720bc2c4217ef27149 100644 (file)
@@ -321,7 +321,7 @@ PyMethodDef KX_TouchSensor::Methods[] = {
 };
 
 PyAttributeDef KX_TouchSensor::Attributes[] = {
-       KX_PYATTRIBUTE_STRING_RW("propName",0,100,false,KX_TouchSensor,m_touchedpropname),
+       KX_PYATTRIBUTE_STRING_RW("propName",0,MAX_PROP_NAME,false,KX_TouchSensor,m_touchedpropname),
        KX_PYATTRIBUTE_BOOL_RW("useMaterial",KX_TouchSensor,m_bFindMaterial),
        KX_PYATTRIBUTE_BOOL_RW("usePulseCollision",KX_TouchSensor,m_bTouchPulse),
        KX_PYATTRIBUTE_RO_FUNCTION("hitObject", KX_TouchSensor, pyattr_get_object_hit),
index 18a987a332a189e88473d7da06e613c54abf5719..1e8630c72d8f9d90101df29304c8f55c66e1fa79 100644 (file)
@@ -104,7 +104,7 @@ void RAS_TexVert::SetFlag(const short flag)
 
 void RAS_TexVert::SetUnit(const unsigned int u)
 {
-       m_unit = u<=MAX_UNIT?u:MAX_UNIT;
+       m_unit = u <= (unsigned int) MAX_UNIT ? u: (unsigned int)MAX_UNIT;
 }
 
 void RAS_TexVert::SetNormal(const MT_Vector3& normal)