svn merge ^/trunk/blender -r43693:43733
authorCampbell Barton <ideasman42@gmail.com>
Thu, 26 Jan 2012 19:20:33 +0000 (19:20 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 26 Jan 2012 19:20:33 +0000 (19:20 +0000)
41 files changed:
extern/libmv/third_party/glog/src/config.h
extern/libmv/third_party/glog/src/config_linux.h
intern/cycles/blender/blender_session.cpp
intern/cycles/kernel/kernel_film.h
intern/cycles/kernel/kernel_passes.h
intern/cycles/kernel/kernel_path.h
intern/cycles/render/buffers.cpp
intern/cycles/util/util_progress.h
intern/ffmpeg/ffmpeg_compat.h
intern/ghost/intern/GHOST_NDOFManager.cpp
intern/ghost/intern/GHOST_NDOFManager.h
release/scripts/presets/keyconfig/maya.py
release/scripts/presets/tracking_settings/blurry_footage.py
release/scripts/presets/tracking_settings/default.py
release/scripts/presets/tracking_settings/fast_motion.py
release/scripts/startup/bl_operators/clip.py
release/scripts/startup/bl_operators/presets.py
release/scripts/startup/bl_ui/space_clip.py
release/scripts/startup/bl_ui/space_logic.py
source/blender/avi/intern/endian.c
source/blender/blenkernel/BKE_cloth.h
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/tracking.c
source/blender/blenlib/intern/math_matrix.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/space_clip/clip_graph_draw.c
source/blender/editors/space_clip/clip_graph_ops.c
source/blender/editors/space_clip/clip_intern.h
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_tracking_types.h
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_scene_api.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_tracking.c
source/blender/modifiers/intern/MOD_cloth.c
source/blender/render/intern/source/pipeline.c

index 49c0d8905b0cc6ea37102211019f376e7a98fd5b..102bf9e4034d29ba8569ff5a2b8a29b8e503495b 100644 (file)
@@ -2,14 +2,14 @@
 /* src/config.h.in.  Generated from configure.ac by autoheader.  */
 
 /* Namespace for Google classes */
-#ifdef __APPLE__
+#if defined(__APPLE__)
  #include "config_mac.h"
-#elif __FreeBSD__
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
  #include "config_freebsd.h"
-#elif __MINGW32__
+#elif defined(__MINGW32__)
  #include "windows/config.h"
-#elif __GNUC__
+#elif defined(__linux__)
  #include "config_linux.h"
-#elif _MSC_VER
+#elif defined(_MSC_VER)
  #include "windows/config.h"
 #endif
index ffd4e778de6eaeece0be56ed905545f059ac99c4..faf032949bb49e9c991037162cc1cd84a9e0e684 100644 (file)
 /* How to access the PC from a struct ucontext */
 #if defined(_M_X64) || defined(__amd64__) || defined(__x86_64__)
   #define PC_FROM_UCONTEXT uc_mcontext.gregs[REG_RIP]
-#else
+#elif defined(_M_IX86) || defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__)
   #define PC_FROM_UCONTEXT uc_mcontext.gregs[REG_EIP]
+#else
+  #undef PC_FROM_UCONTEXT
 #endif
 
 /* Define to necessary symbol if this constant uses a non-standard name on
index ff1c32831bb130279d51f38070286c38ad3245b3..5e3102fd7c707010e1207e6d33670f8965c1f277 100644 (file)
@@ -203,6 +203,9 @@ void BlenderSession::render()
                b_rlay = *b_iter;
 
                /* add passes */
+               vector<Pass> passes;
+               Pass::add(PASS_COMBINED, passes);
+
                if(session_params.device.type == DEVICE_CPU) { /* todo */
                        BL::RenderLayer::passes_iterator b_pass_iter;
                        
@@ -211,12 +214,13 @@ void BlenderSession::render()
                                PassType pass_type = get_pass_type(b_pass);
 
                                if(pass_type != PASS_NONE)
-                                       Pass::add(pass_type, buffer_params.passes);
+                                       Pass::add(pass_type, passes);
                        }
                }
 
-               scene->film->passes = buffer_params.passes;
-               scene->film->need_update = true;
+               buffer_params.passes = passes;
+               scene->film->passes = passes;
+               scene->film->tag_update(scene);
 
                /* update session */
                session->reset(buffer_params, session_params.samples);
index d0fb5402291c1c8608317db8a3fda1d0c6f9d7f8..232049fb6cb9ff76258b6d457425032e0817f7e9 100644 (file)
@@ -59,7 +59,7 @@ __device void kernel_film_tonemap(KernelGlobals *kg,
        buffer += index*kernel_data.film.pass_stride;
 
        /* map colors */
-       float4 irradiance = *(float4*)buffer;
+       float4 irradiance = *((__global float4*)buffer);
        float4 float_result = film_map(kg, irradiance, sample);
        uchar4 byte_result = film_float_to_byte(float_result);
 
index 0e775812edad360ced5215a4a3299aad0f0ee175..cfd73c98bade11e6b4521f367b0ee56852e799b1 100644 (file)
@@ -20,31 +20,22 @@ CCL_NAMESPACE_BEGIN
 
 __device_inline void kernel_write_pass_float(__global float *buffer, int sample, float value)
 {
-       float *buf = buffer;
+       __global float *buf = buffer;
        *buf = (sample == 0)? value: *buf + value;
 }
 
 __device_inline void kernel_write_pass_float3(__global float *buffer, int sample, float3 value)
 {
-       float3 *buf = (float3*)buffer;
+       __global float3 *buf = (__global float3*)buffer;
        *buf = (sample == 0)? value: *buf + value;
 }
 
 __device_inline void kernel_write_pass_float4(__global float *buffer, int sample, float4 value)
 {
-       float4 *buf = (float4*)buffer;
+       __global float4 *buf = (__global float4*)buffer;
        *buf = (sample == 0)? value: *buf + value;
 }
 
-__device_inline void kernel_clear_passes(__global float *buffer, int sample, int pass_stride)
-{
-#ifdef __PASSES__
-       if(sample == 0 && pass_stride != 4)
-               for(int i = 4; i < pass_stride; i++)
-                       buffer[i] = 0.0f;
-#endif
-}
-
 __device void kernel_write_data_passes(KernelGlobals *kg, __global float *buffer, PathRadiance *L,
        ShaderData *sd, int sample, int path_flag, float3 throughput)
 {
index c0bfa32040523388b7a1a4df90dee2a53df8d9d3..1a42cf1ed7ec169c8110799a58a89e0916e79e82 100644 (file)
@@ -220,7 +220,7 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
 
        path_radiance_init(&L, kernel_data.film.use_light_pass);
 
-#ifdef __EMISSION__
+#if defined(__EMISSION__) || defined(__BACKGROUND__)
        float ray_pdf = 0.0f;
 #endif
        PathState state;
@@ -239,11 +239,13 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
                        if(kernel_data.background.transparent && (state.flag & PATH_RAY_CAMERA)) {
                                L_transparent += average(throughput);
                        }
+#ifdef __BACKGROUND__
                        else {
                                /* sample background shader */
                                float3 L_background = indirect_background(kg, &ray, state.flag, ray_pdf);
                                path_radiance_accum_background(&L, throughput, L_background, state.bounce);
                        }
+#endif
 
                        break;
                }
@@ -377,8 +379,6 @@ __device void kernel_path_trace(KernelGlobals *kg,
        rng_state += index;
        buffer += index*pass_stride;
 
-       kernel_clear_passes(buffer, sample, pass_stride);
-
        /* initialize random numbers */
        RNG rng;
 
index 08dda9441119dba565a792c44ab9e570b86155c2..56219482ef0716cd8e94da07a88802f710013227 100644 (file)
@@ -157,10 +157,17 @@ bool RenderBuffers::get_pass(PassType type, float exposure, int sample, int comp
                        assert(pass.components == components);
 
                        /* scalar */
-                       for(int i = 0; i < size; i++, in += pass_stride, pixels++) {
-                               float f = *in;
-
-                               pixels[0] = f*scale_exposure;
+                       if(type == PASS_DEPTH) {
+                               for(int i = 0; i < size; i++, in += pass_stride, pixels++) {
+                                       float f = *in;
+                                       pixels[0] = (f == 0.0f)? 1e10f: f*scale_exposure;
+                               }
+                       }
+                       else {
+                               for(int i = 0; i < size; i++, in += pass_stride, pixels++) {
+                                       float f = *in;
+                                       pixels[0] = f*scale_exposure;
+                               }
                        }
                }
                else if(components == 3) {
index acb00b03507c8a37ab508a4f7feb9a7beecb68d9..2cc2995bcfe0572322bdf77476e4ec41d6a4124b 100644 (file)
@@ -96,7 +96,7 @@ public:
        {
                thread_scoped_lock lock(progress_mutex);
 
-               start_time = start_time;
+               start_time = start_time_;
        }
 
        void set_sample(int sample_, double sample_time_)
index dfdad22e17681aa0cd900715cbd48ec34a8a9ac8..582086d130b0b45db518616390ab07a8e0894a78 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <libavcodec/avcodec.h>
 #include <libavutil/rational.h>
+#include <libavutil/opt.h>
 
 #if (LIBAVFORMAT_VERSION_MAJOR > 52) || ((LIBAVFORMAT_VERSION_MAJOR >= 52) && (LIBAVFORMAT_VERSION_MINOR >= 101))
 #define FFMPEG_HAVE_PARSE_UTILS 1
index db4ed306dbeb48cc5dfe0988431a0c0731a20205..0f5149de03716c1af8b5d4bd33531d179a90fca1 100644 (file)
@@ -77,6 +77,12 @@ static const char* ndof_button_names[] = {
        "NDOF_BUTTON_8",
        "NDOF_BUTTON_9",
        "NDOF_BUTTON_10",
+       // more general-purpose buttons
+       "NDOF_BUTTON_A",
+       "NDOF_BUTTON_B",
+       "NDOF_BUTTON_C",
+       // the end
+       "NDOF_BUTTON_LAST"
 };
 #endif
 
@@ -169,7 +175,7 @@ static const NDOF_ButtonT SpaceMousePro_HID_map[] = {
 };
 
 /* this is the older SpacePilot (sans Pro)
- * thanks to polosson for the info in this table */
+ * thanks to polosson for info about this device */
 static const NDOF_ButtonT SpacePilot_HID_map[] = {
        NDOF_BUTTON_1,
        NDOF_BUTTON_2,
@@ -194,6 +200,23 @@ static const NDOF_ButtonT SpacePilot_HID_map[] = {
        NDOF_BUTTON_NONE // the CONFIG button -- what does it do?
 };
 
+/* this is the older Spaceball 5000 USB
+ * thanks to Tehrasha Darkon for info about this device */
+static const NDOF_ButtonT Spaceball5000_HID_map[] = {
+       NDOF_BUTTON_1,
+       NDOF_BUTTON_2,
+       NDOF_BUTTON_3,
+       NDOF_BUTTON_4,
+       NDOF_BUTTON_5,
+       NDOF_BUTTON_6,
+       NDOF_BUTTON_7,
+       NDOF_BUTTON_8,
+       NDOF_BUTTON_9,
+       NDOF_BUTTON_A,
+       NDOF_BUTTON_B,
+       NDOF_BUTTON_C
+};
+
 GHOST_NDOFManager::GHOST_NDOFManager(GHOST_System& sys)
        : m_system(sys)
        , m_deviceType(NDOF_UnknownDevice) // each platform has its own device detection code
@@ -237,12 +260,12 @@ bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short produ
                                        m_buttonCount = 15;
                                        break;
                                case 0xC629:
-                                       puts("ndof: using SpacePilotPro");
+                                       puts("ndof: using SpacePilot Pro");
                                        m_deviceType = NDOF_SpacePilotPro;
                                        m_buttonCount = 31;
                                        break;
                                case 0xC62B:
-                                       puts("ndof: using SpaceMousePro");
+                                       puts("ndof: using SpaceMouse Pro");
                                        m_deviceType = NDOF_SpaceMousePro;
                                        m_buttonCount = 27;
                                        // ^^ actually has 15 buttons, but their HID codes range from 0 to 26
@@ -255,6 +278,12 @@ bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short produ
                                        m_buttonCount = 21;
                                        break;
 
+                               case 0xC621:
+                                       puts("ndof: using Spaceball 5000");
+                                       m_deviceType = NDOF_Spaceball5000;
+                                       m_buttonCount = 12;
+                                       break;
+
                                case 0xC623:
                                        puts("ndof: SpaceTraveler not supported, please file a bug report");
                                        m_buttonCount = 8;
@@ -385,8 +414,21 @@ void GHOST_NDOFManager::updateButton(int button_number, bool press, GHOST_TUns64
                                default: sendButtonEvent(SpacePilot_HID_map[button_number], press, time, window);
                        }
                        break;
+               case NDOF_Spaceball5000:
+                       // has no special 'keyboard' buttons
+                       sendButtonEvent(Spaceball5000_HID_map[button_number], press, time, window);
+                       break;
                case NDOF_UnknownDevice:
-                       printf("ndof: button %d on unknown device (ignoring)\n", button_number);
+                       printf("ndof: button %d on unknown device (", button_number);
+                       // map to the 'general purpose' buttons
+                       // this is mainly for old serial devices
+                       if (button_number < NDOF_BUTTON_LAST - NDOF_BUTTON_1) {
+                               printf("sending)\n");
+                               sendButtonEvent((NDOF_ButtonT)(NDOF_BUTTON_1 + button_number), press, time, window);
+                       }
+                       else {
+                               printf("discarding)\n");
+                       }
        }
 
        int mask = 1 << button_number;
index 701f458ccf1155cfb7a25ca7fc171f2c81c9bb4c..c4e980bb89502bcae8ce20b6dbdb4c8487773cd4 100644 (file)
@@ -40,7 +40,8 @@ typedef enum {
        NDOF_SpaceMousePro,
 
        // older devices
-       NDOF_SpacePilot
+       NDOF_SpacePilot,
+       NDOF_Spaceball5000
 
        } NDOF_DeviceT;
 
@@ -87,7 +88,12 @@ typedef enum {
        NDOF_BUTTON_8,
        NDOF_BUTTON_9,
        NDOF_BUTTON_10,
-
+       // more general-purpose buttons
+       NDOF_BUTTON_A,
+       NDOF_BUTTON_B,
+       NDOF_BUTTON_C,
+       // the end
+       NDOF_BUTTON_LAST
        } NDOF_ButtonT;
 
 class GHOST_NDOFManager
index 142088ea33284401534e4a0d2a174f765dda971f..40bf1a9d1245db815b6d5909e436d9bb1acc322a 100644 (file)
@@ -219,7 +219,8 @@ kmi.properties.value_1 = 'DISABLED'
 kmi.properties.value_2 = 'ENABLED'
 kmi = km.keymap_items.new('view3d.game_start', 'P', 'PRESS')
 kmi = km.keymap_items.new('object.select_all', 'A', 'PRESS')
-kmi = km.keymap_items.new('object.select_all', 'I', 'PRESS', ctrl=True).action = 'INVERT'
+kmi = km.keymap_items.new('object.select_all', 'I', 'PRESS', ctrl=True)
+kmi.properties.action = 'INVERT'
 kmi = km.keymap_items.new('object.select_linked', 'L', 'PRESS', shift=True)
 kmi = km.keymap_items.new('object.select_grouped', 'G', 'PRESS', shift=True)
 kmi = km.keymap_items.new('object.select_mirror', 'M', 'PRESS', shift=True, ctrl=True)
index c805301df78882b7867606370578139fc6231f73..c06d4c3835b75cfc119571ab970ecb433d79c819 100644 (file)
@@ -9,3 +9,6 @@ settings.default_search_size = 100
 settings.default_frames_limit = 0
 settings.default_pattern_match = 'PREV_FRAME'
 settings.default_margin = 0
+settings.use_default_red_channel = True
+settings.use_default_green_channel = True
+settings.use_default_blue_channel = True
index 3846f92d8284c32e9113ec3bb4317ad0f39c584e..b9fd1928472853139a30abd9c82c9dc0ecd6dc56 100644 (file)
@@ -9,3 +9,6 @@ settings.default_search_size = 61
 settings.default_frames_limit = 0
 settings.default_pattern_match = 'KEYFRAME'
 settings.default_margin = 0
+settings.use_default_red_channel = True
+settings.use_default_green_channel = True
+settings.use_default_blue_channel = True
index f99fd7f0c42e8320dbb962cbf3888d0d158f341c..dce3304eddb6044ec92fd75f85043d70508ac5d0 100644 (file)
@@ -9,3 +9,6 @@ settings.default_search_size = 300
 settings.default_frames_limit = 0
 settings.default_pattern_match = 'PREV_FRAME'
 settings.default_margin = 5
+settings.use_default_red_channel = True
+settings.use_default_green_channel = True
+settings.use_default_blue_channel = True
index ac82ffbf48fc27013bd4910dff7206bb30cb97aa..787f3be4e76e3fae16ead2fc6ab00b28e9f02f94 100644 (file)
@@ -90,6 +90,34 @@ def CLIP_track_view_selected(sc, track):
     return False
 
 
+def CLIP_default_settings_from_track(clip, track):
+    settings = clip.tracking.settings
+
+    width = clip.size[0]
+    height = clip.size[1]
+
+    pattern = track.pattern_max - track.pattern_min
+    search = track.search_max - track.search_min
+
+    pattern[0] = pattern[0] * clip.size[0]
+    pattern[1] = pattern[1] * clip.size[1]
+
+    search[0] = search[0] * clip.size[0]
+    search[1] = search[1] * clip.size[1]
+
+    settings.default_tracker = track.tracker
+    settings.default_pyramid_levels = track.pyramid_levels
+    settings.default_correlation_min = track.correlation_min
+    settings.default_pattern_size = max(pattern[0], pattern[1])
+    settings.default_search_size = max(search[0], search[1])
+    settings.default_frames_limit = track.frames_limit
+    settings.default_pattern_match = track.pattern_match
+    settings.default_margin = track.margin
+    settings.use_default_red_channel = track.use_red_channel
+    settings.use_default_green_channel = track.use_green_channel
+    settings.use_default_blue_channel = track.use_blue_channel
+
+
 class CLIP_OT_track_to_empty(Operator):
     """Create an Empty object which will be copying movement of active track"""
 
@@ -805,3 +833,29 @@ class CLIP_OT_setup_tracking_scene(Operator):
         self._setupObjects(context)
 
         return {'FINISHED'}
+
+class CLIP_OT_track_settings_as_default(Operator):
+    """Copy trackign settings from active track to default settings"""
+
+    bl_idname = "clip.track_settings_as_default"
+    bl_label = "Track Settings As Default"
+    bl_options = {'UNDO', 'REGISTER'}
+
+    @classmethod
+    def poll(cls, context):
+        sc = context.space_data
+
+        if sc.type != 'CLIP_EDITOR':
+            return False
+
+        clip = sc.clip
+
+        return clip and clip.tracking.tracks.active
+
+    def execute(self, context):
+        sc = context.space_data
+        clip = sc.clip
+
+        CLIP_default_settings_from_track(clip, clip.tracking.tracks.active)
+
+        return {'FINISHED'}
index 0ba19ad8109a95214898a338f137c1be5ee44f74..1aecfbbaa778ceea989f4062854a94fba58d0f41 100644 (file)
@@ -409,7 +409,10 @@ class AddPresetTrackingSettings(AddPresetBase, Operator):
         "settings.default_search_size",
         "settings.default_frames_limit",
         "settings.default_pattern_match",
-        "settings.default_margin"
+        "settings.default_margin",
+        "settings.use_default_red_channel",
+        "settings.use_default_green_channel",
+        "settings.use_default_blue_channel"
     ]
 
     preset_subdir = "tracking_settings"
index c8582e532bba264b05f65103b3b3a6452ea6c1bd..e7ccc1e624ece20fd8fde248b6c3f91d2d69aa12 100644 (file)
@@ -127,6 +127,13 @@ class CLIP_PT_tools_marker(Panel):
 
             col.separator()
 
+            row = col.row(align=True)
+            row.prop(settings, "use_default_red_channel", text="R", toggle=True)
+            row.prop(settings, "use_default_green_channel", text="G", toggle=True)
+            row.prop(settings, "use_default_blue_channel", text="B", toggle=True)
+
+            col.separator()
+
             sub = col.column(align=True)
             sub.prop(settings, "default_pattern_size")
             sub.prop(settings, "default_search_size")
@@ -147,6 +154,9 @@ class CLIP_PT_tools_marker(Panel):
             col.label(text="Match:")
             col.prop(settings, "default_pattern_match", text="")
 
+            col.separator()
+            col.operator('clip.track_settings_as_default', text="Copy From Active Track")
+
 
 class CLIP_PT_tools_tracking(Panel):
     bl_space_type = 'CLIP_EDITOR'
@@ -559,6 +569,9 @@ class CLIP_PT_display(Panel):
 
         col.prop(sc, "lock_selection")
 
+        if sc.view == 'GRAPH':
+            col.prop(sc, "lock_time_cursor")
+
         clip = sc.clip
         if clip:
             col.label(text="Display Aspect Ratio:")
index 1593f2c71ec1783e54190196bab56d1de200a386..da6d1f7212359ab19190dc573d712c0c23865739 100644 (file)
@@ -68,7 +68,7 @@ class LOGIC_PT_properties(Panel):
             row = box.row()
             row.prop(prop, "name", text="")
             row.prop(prop, "type", text="")
-            row.prop(prop, "value", text="", toggle=True)  # we don't care about the type. rna will display correctly
+            row.prop(prop, "value", text="")
             row.prop(prop, "show_debug", text="", toggle=True, icon='INFO')
             row.operator("object.game_property_remove", text="", icon='X', emboss=False).index = i
 
index 29b3047eca4ba0f6f69a721cec6226dd3a3f9b76..adcc7e8750a38ebce34525c6ba5bd76e1803f205 100644 (file)
 #include "endian.h"
 #include "avi_intern.h"
 
+#ifdef __BIG_ENDIAN__
+#include "MEM_guardedalloc.h"
+#endif
+
 #ifdef __BIG_ENDIAN__
 static void invert (int *num)
 {
index 62c3df7c6f49048a7cb4f6b6c0c66059a3d4e775..6d42b8dc80b8c79bc9026b5ac442746ad8fa1d8f 100644 (file)
@@ -216,7 +216,7 @@ void clmdSetInterruptCallBack ( int ( *f ) ( void ) );
 void cloth_free_modifier_extern ( struct ClothModifierData *clmd );
 void cloth_free_modifier ( struct ClothModifierData *clmd );
 void cloth_init ( struct ClothModifierData *clmd );
-struct DerivedMesh *clothModifier_do ( struct ClothModifierData *clmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm);
+void clothModifier_do ( struct ClothModifierData *clmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm, float (*vertexCos)[3]);
 
 void cloth_update_normals ( ClothVertex *verts, int nVerts, struct MFace *face, int totface );
 int cloth_uses_vgroup(struct ClothModifierData *clmd);
index 44df3edb3e589bbc93384cdad1e846c871d9af09..ca0898a70857a466a9a5cd4d8f20e65668853f62 100644 (file)
@@ -91,7 +91,7 @@ static CM_SOLVER_DEF  solvers [] =
 /* ********** cloth engine ******* */
 /* Prototypes for internal functions.
 */
-static void cloth_to_object (Object *ob,  ClothModifierData *clmd, DerivedMesh *dm);
+static void cloth_to_object (Object *ob,  ClothModifierData *clmd, float (*vertexCos)[3]);
 static void cloth_from_mesh ( ClothModifierData *clmd, DerivedMesh *dm );
 static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *dm, float framenr, int first);
 static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm );
@@ -430,9 +430,8 @@ static int do_step_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul
 /************************************************
  * clothModifier_do - main simulation function
 ************************************************/
-DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, DerivedMesh *dm)
+void clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, DerivedMesh *dm, float (*vertexCos)[3])
 {
-       DerivedMesh *result;
        PointCache *cache;
        PTCacheID pid;
        float timescale;
@@ -442,20 +441,14 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
        clmd->scene= scene;     /* nice to pass on later :) */
        framenr= (int)scene->r.cfra;
        cache= clmd->point_cache;
-       result = CDDM_copy(dm, 0);
 
        BKE_ptcache_id_from_cloth(&pid, ob, clmd);
        BKE_ptcache_id_time(&pid, scene, framenr, &startframe, &endframe, &timescale);
        clmd->sim_parms->timescale= timescale;
 
-       if(!result) {
-               BKE_ptcache_invalidate(cache);
-               return dm;
-       }
-
        if(clmd->sim_parms->reset
                || (framenr == (startframe - clmd->sim_parms->preroll) && clmd->sim_parms->preroll != 0)
-               || (clmd->clothObject && result->getNumVerts(result) != clmd->clothObject->numverts))
+               || (clmd->clothObject && dm->getNumVerts(dm) != clmd->clothObject->numverts))
        {
                clmd->sim_parms->reset = 0;
                cache->flag |= PTCACHE_OUTDATED;
@@ -463,7 +456,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
                BKE_ptcache_validate(cache, 0);
                cache->last_exact= 0;
                cache->flag &= ~PTCACHE_REDO_NEEDED;
-               return result;
+               return;
        }
        
        // unused in the moment, calculated separately in implicit.c
@@ -475,20 +468,20 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
 
                /* do simulation */
                if(!do_init_cloth(ob, clmd, dm, framenr))
-                       return result;
+                       return;
 
                do_step_cloth(ob, clmd, dm, framenr);
-               cloth_to_object(ob, clmd, result);
+               cloth_to_object(ob, clmd, vertexCos);
 
                clmd->clothObject->last_frame= framenr;
 
-               return result;
+               return;
        }
 
        /* simulation is only active during a specific period */
        if(framenr < startframe) {
                BKE_ptcache_invalidate(cache);
-               return result;
+               return;
        }
        else if(framenr > endframe) {
                framenr= endframe;
@@ -496,7 +489,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
 
        /* initialize simulation data if it didn't exist already */
        if(!do_init_cloth(ob, clmd, dm, framenr))
-               return result;
+               return;
 
        if((framenr == startframe) && (clmd->sim_parms->preroll == 0)) {
                BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
@@ -504,7 +497,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
                BKE_ptcache_validate(cache, framenr);
                cache->flag &= ~PTCACHE_REDO_NEEDED;
                clmd->clothObject->last_frame= framenr;
-               return result;
+               return;
        }
 
        /* try to read from cache */
@@ -512,7 +505,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
 
        if(cache_result == PTCACHE_READ_EXACT || cache_result == PTCACHE_READ_INTERPOLATED) {
                implicit_set_positions(clmd);
-               cloth_to_object (ob, clmd, result);
+               cloth_to_object (ob, clmd, vertexCos);
 
                BKE_ptcache_validate(cache, framenr);
 
@@ -521,7 +514,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
 
                clmd->clothObject->last_frame= framenr;
 
-               return result;
+               return;
        }
        else if(cache_result==PTCACHE_READ_OLD) {
                implicit_set_positions(clmd);
@@ -529,11 +522,11 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
        else if( /*ob->id.lib ||*/ (cache->flag & PTCACHE_BAKED)) { /* 2.4x disabled lib, but this can be used in some cases, testing further - campbell */
                /* if baked and nothing in cache, do nothing */
                BKE_ptcache_invalidate(cache);
-               return result;
+               return;
        }
 
        if(framenr!=clmd->clothObject->last_frame+1)
-               return result;
+               return;
 
        /* if on second frame, write cache for first frame */
        if(cache->simframe == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0))
@@ -550,10 +543,8 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
        else
                BKE_ptcache_write(&pid, framenr);
 
-       cloth_to_object (ob, clmd, result);
+       cloth_to_object (ob, clmd, vertexCos);
        clmd->clothObject->last_frame= framenr;
-
-       return result;
 }
 
 /* frees all */
@@ -708,24 +699,19 @@ void cloth_free_modifier_extern ( ClothModifierData *clmd )
  * cloth_to_object - copies the deformed vertices to the object.
  *
  **/
-static void cloth_to_object (Object *ob,  ClothModifierData *clmd, DerivedMesh *dm)
+static void cloth_to_object (Object *ob,  ClothModifierData *clmd, float (*vertexCos)[3])
 {
        unsigned int    i = 0;
-       MVert *mvert = NULL;
-       unsigned int numverts;
        Cloth *cloth = clmd->clothObject;
 
        if (clmd->clothObject) {
                /* inverse matrix is not uptodate... */
                invert_m4_m4(ob->imat, ob->obmat);
 
-               mvert = CDDM_get_verts(dm);
-               numverts = dm->getNumVerts(dm);
-
-               for (i = 0; i < numverts; i++)
+               for (i = 0; i < cloth->numverts; i++)
                {
-                       copy_v3_v3 (mvert[i].co, cloth->verts[i].x);
-                       mul_m4_v3(ob->imat, mvert[i].co);       /* cloth is in global coords */
+                       copy_v3_v3 (vertexCos[i], cloth->verts[i].x);
+                       mul_m4_v3(ob->imat, vertexCos[i]);      /* cloth is in global coords */
                }
        }
 }
index daee707d143e40332f299dfe80667aee97a95301..f259ddbf5770bf1175998db96ea00dafdbc1ece4 100644 (file)
@@ -3489,6 +3489,7 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
        int totedge;
        int k;
        float hairmat[4][4];
+       float (*deformedVerts)[3];
 
        if(!psys->clmd) {
                psys->clmd = (ClothModifierData*)modifier_new(eModifierType_Cloth);
@@ -3582,7 +3583,15 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
        psys->clmd->point_cache = psys->pointcache;
        psys->clmd->sim_parms->effector_weights = psys->part->effector_weights;
 
-       psys->hair_out_dm = clothModifier_do(psys->clmd, sim->scene, sim->ob, dm);
+       deformedVerts = MEM_callocN(sizeof(*deformedVerts)*dm->getNumVerts(dm), "do_hair_dynamics vertexCos");
+       psys->hair_out_dm = CDDM_copy(dm, 0);
+       psys->hair_out_dm->getVertCos(psys->hair_out_dm, deformedVerts);
+
+       clothModifier_do(psys->clmd, sim->scene, sim->ob, dm, deformedVerts);
+
+       CDDM_apply_vert_coords(psys->hair_out_dm, deformedVerts);
+
+       MEM_freeN(deformedVerts);
 
        psys->clmd->sim_parms->effector_weights = NULL;
 }
index ea3f076523fb975b19008782ce0fc74f5e53913b..9bff5e3003dd03f25d236d28120688f4815fed77 100644 (file)
@@ -242,6 +242,7 @@ MovieTrackingTrack *BKE_tracking_add_track(MovieTracking *tracking, ListBase *tr
        track->margin= settings->default_margin;
        track->pattern_match= settings->default_pattern_match;
        track->frames_limit= settings->default_frames_limit;
+       track->flag= settings->default_flag;
 
        memset(&marker, 0, sizeof(marker));
        marker.pos[0]= x;
index cd54c944ba9c84b89d084b761fa007ee0c82220a..0c8c98988d1e1c0c6bfba8e383c702b43f348ae1 100644 (file)
@@ -778,32 +778,38 @@ void orthogonalize_m4(float mat[][4], int axis)
        mul_v3_fl(mat[2], size[2]);
 }
 
-int is_orthogonal_m3(float mat[][3])
+int is_orthogonal_m3(float m[][3])
 {
-       if (fabsf(dot_v3v3(mat[0], mat[1])) > 1.5f * FLT_EPSILON)
-               return 0;
+    int i, j;
 
-       if (fabsf(dot_v3v3(mat[1], mat[2])) > 1.5f * FLT_EPSILON)
-               return 0;
+    for (i = 0; i < 3; i++) {
+        for (j = 0; j < i; j++) {
+            if (fabsf(dot_v3v3(m[i], m[j])) > 1.5f * FLT_EPSILON)
+                return 0;
+        }
 
-       if (fabsf(dot_v3v3(mat[0], mat[2])) > 1.5f * FLT_EPSILON)
-               return 0;
-       
-       return 1;
+        if (fabsf(dot_v3v3(m[i], m[i]) - 1) > 1.5f * FLT_EPSILON)
+            return 0;
+    }
+
+    return 1;
 }
 
-int is_orthogonal_m4(float mat[][4])
+int is_orthogonal_m4(float m[][4])
 {
-       if (fabsf(dot_v3v3(mat[0], mat[1])) > 1.5f * FLT_EPSILON)
-               return 0;
+    int i, j;
 
-       if (fabsf(dot_v3v3(mat[1], mat[2])) > 1.5f * FLT_EPSILON)
-               return 0;
+    for (i = 0; i < 4; i++) {
+        for (j = 0; j < i; j++) {
+            if (fabsf(dot_vn_vn(m[i], m[j], 4)) > 1.5f * FLT_EPSILON)
+                return 0;
+        }
 
-       if (fabsf(dot_v3v3(mat[0], mat[2])) > 1.5f * FLT_EPSILON)
-               return 0;
-       
-       return 1;
+        if (fabsf(dot_vn_vn(m[i], m[i], 4) - 1) > 1.5f * FLT_EPSILON)
+            return 0;
+    }
+
+    return 1;
 }
 
 void normalize_m3(float mat[][3])
index 93d8f9c0c8a51392c055a875e1243ec540cfd1f6..cfb375c25581af265689a7d8da77f75265aafe34 100644 (file)
@@ -1527,6 +1527,8 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction
        const int pos_prev= but->pos;
        const int has_sel= (but->selend - but->selsta) > 0;
 
+       ui_check_but(but);
+
        /* special case, quit selection and set cursor */
        if (has_sel && !select) {
                if (jump == BUTTON_EDIT_JUMP_ALL) {
@@ -3030,12 +3032,28 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, wm
                                data->value= ui_step_name_menu(but, -1);
                                button_activate_state(C, but, BUTTON_STATE_EXIT);
                                ui_apply_button(C, but->block, but, data, 1);
+
+                               /* button's state need to be changed to EXIT so moving mouse away from this mouse wouldn't lead
+                                * to cancel changes made to this button, but shanging state to EXIT also makes no button active for
+                                * a while which leads to triggering operator when doing fast scrolling mouse wheel.
+                                * using post activate stuff from button allows to make button be active again after checking for all
+                                * all that mouse leave and cancel stuff, so wuick scrool wouldnt't be an issue anumore.
+                                * same goes for scrolling wheel in another direction below (sergey)
+                                */
+                               data->postbut= but;
+                               data->posttype= BUTTON_ACTIVATE_OVER;
+
                                return WM_UI_HANDLER_BREAK;
                        }
                        else if(event->type == WHEELUPMOUSE && event->alt) {
                                data->value= ui_step_name_menu(but, 1);
                                button_activate_state(C, but, BUTTON_STATE_EXIT);
                                ui_apply_button(C, but->block, but, data, 1);
+
+                               /* why this is needed described above */
+                               data->postbut= but;
+                               data->posttype= BUTTON_ACTIVATE_OVER;
+
                                return WM_UI_HANDLER_BREAK;
                        }
                }
index 19acfaccaa354e645671e71bbab7fc9cc92cf3a0..cd0844a38a33e57f8cebea3f90f07bff4b61ed6e 100644 (file)
@@ -952,6 +952,9 @@ static void ui_text_leftclip(uiFontStyle *fstyle, uiBut *but, rcti *rect)
        if(but->editstr && but->pos >= 0) {
                if(but->ofs > but->pos)
                        but->ofs= but->pos;
+
+               if(BLF_width(fstyle->uifont_id, but->drawstr) <= okwidth)
+                       but->ofs = 0;
        }
        else but->ofs= 0;
        
index e913ae77f05e6b1b53dd95800b79c51cc76223c2..6fabe802ff025d401accb4f00c02e34f0a8bbb32 100644 (file)
@@ -47,6 +47,7 @@
 #include "ED_clip.h"
 
 #include "BIF_gl.h"
+#include "BIF_glutil.h"
 
 #include "WM_types.h"
 
@@ -120,6 +121,26 @@ static void draw_graph_cfra(SpaceClip *sc, ARegion *ar, Scene *scene)
        glScalef(xscale, 1.0, 1.0);
 }
 
+static void draw_graph_sfra_efra(Scene *scene, View2D *v2d)
+{
+       UI_view2d_view_ortho(v2d);
+
+       /* currently clip editor supposes that editing clip length is equal to scene frame range */
+       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+       glEnable(GL_BLEND);
+               glColor4f(0.0f, 0.0f, 0.0f, 0.4f);
+
+               glRectf(v2d->cur.xmin, v2d->cur.ymin, (float)SFRA, v2d->cur.ymax);
+               glRectf((float)EFRA, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
+       glDisable(GL_BLEND);
+
+       UI_ThemeColorShade(TH_BACK, -60);
+
+       /* thin lines where the actual frames are */
+       fdrawline((float)SFRA, v2d->cur.ymin, (float)SFRA, v2d->cur.ymax);
+       fdrawline((float)EFRA, v2d->cur.ymin, (float)EFRA, v2d->cur.ymax);
+}
+
 static void tracking_segment_point_cb(void *UNUSED(userdata), MovieTrackingTrack *UNUSED(track),
                        MovieTrackingMarker *marker, int UNUSED(coord), float val)
 {
@@ -255,6 +276,9 @@ void clip_draw_graph(SpaceClip *sc, ARegion *ar, Scene *scene)
                        draw_frame_curves(sc);
        }
 
+       /* frame range */
+       draw_graph_sfra_efra(scene, v2d);
+
        /* current frame */
        draw_graph_cfra(sc, ar, scene);
 }
index 8be5e520b1fd1eea541146b4193eef3ae92fdf00..6a56de266899c02dbba282b2804859307018d220 100644 (file)
@@ -30,6 +30,7 @@
  */
 
 #include "DNA_object_types.h"  /* SELECT */
+#include "DNA_scene_types.h"
 
 #include "MEM_guardedalloc.h"
 
 
 /******************** common graph-editing utilities ********************/
 
+static int ED_space_clip_graph_poll(bContext *C)
+{
+       SpaceClip *sc = CTX_wm_space_clip(C);
+
+       if(sc && sc->clip) {
+               ARegion *ar = CTX_wm_region(C);
+
+               return ar->regiontype == RGN_TYPE_PREVIEW;
+       }
+
+       return 0;
+}
+
 typedef struct {
        int action;
 } SelectUserData;
@@ -278,7 +292,7 @@ void CLIP_OT_graph_select(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= select_exec;
        ot->invoke= select_invoke;
-       ot->poll= ED_space_clip_poll;
+       ot->poll= ED_space_clip_graph_poll;
 
        /* flags */
        ot->flag= OPTYPE_UNDO;
@@ -357,8 +371,112 @@ void CLIP_OT_graph_delete_knot(wmOperatorType *ot)
 
        /* api callbacks */
        ot->exec= delete_knot_exec;
-       ot->poll= ED_space_clip_poll;
+       ot->poll= ED_space_clip_graph_poll;
 
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
+
+/******************** view all operator ********************/
+
+typedef struct {
+       float min, max;
+} ViewAllUserData;
+
+static void view_all_cb(void *userdata, MovieTrackingTrack *UNUSED(track), MovieTrackingMarker *UNUSED(marker),
+                        int UNUSED(coord), float val)
+{
+       ViewAllUserData *data = (ViewAllUserData *)userdata;
+
+       if(val < data->min) data->min = val;
+       if(val > data->max) data->max = val;
+}
+
+static int view_all_exec(bContext *C, wmOperator *UNUSED(op))
+{
+       Scene *scene = CTX_data_scene(C);
+       ARegion *ar = CTX_wm_region(C);
+       SpaceClip *sc = CTX_wm_space_clip(C);
+       View2D *v2d = &ar->v2d;
+       ViewAllUserData userdata;
+       float extra;
+
+       userdata.max = -FLT_MAX;
+       userdata.min = FLT_MAX;
+
+       clip_graph_tracking_values_iterate(sc, &userdata, view_all_cb, NULL, NULL);
+
+       /* set extents of view to start/end frames */
+       v2d->cur.xmin = (float)SFRA;
+       v2d->cur.xmax = (float)EFRA;
+
+       if (userdata.min < userdata.max) {
+               v2d->cur.ymin = userdata.min;
+               v2d->cur.ymax = userdata.max;
+       }
+       else {
+               v2d->cur.ymin = -10;
+               v2d->cur.ymax = 10;
+       }
+
+       /* we need an extra "buffer" factor on either side so that the endpoints are visible */
+       extra= 0.01f * (v2d->cur.xmax - v2d->cur.xmin);
+       v2d->cur.xmin -= extra;
+       v2d->cur.xmax += extra;
+
+       extra= 0.01f * (v2d->cur.ymax - v2d->cur.ymin);
+       v2d->cur.ymin -= extra;
+       v2d->cur.ymax += extra;
+
+       ED_region_tag_redraw(ar);
+
+       return OPERATOR_FINISHED;
+}
+
+void CLIP_OT_graph_view_all(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name = "View All";
+       ot->description = "View all curves in editor";
+       ot->idname = "CLIP_OT_graph_view_all";
+
+       /* api callbacks */
+       ot->exec = view_all_exec;
+       ot->poll = ED_space_clip_graph_poll;
+}
+
+/******************** jump to current frame operator ********************/
+
+void ED_clip_graph_center_current_frame(Scene *scene, ARegion *ar)
+{
+       View2D *v2d = &ar->v2d;
+       float extra = (v2d->cur.xmax - v2d->cur.xmin) / 2.0;
+
+       /* set extents of view to start/end frames */
+       v2d->cur.xmin = (float)CFRA - extra;
+       v2d->cur.xmax = (float)CFRA + extra;
+}
+
+static int center_current_frame_exec(bContext *C, wmOperator *UNUSED(op))
+{
+       Scene *scene = CTX_data_scene(C);
+       ARegion *ar = CTX_wm_region(C);
+
+       ED_clip_graph_center_current_frame(scene, ar);
+
+       ED_region_tag_redraw(ar);
+
+       return OPERATOR_FINISHED;
+}
+
+void CLIP_OT_graph_center_current_frame(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name = "Center Current Frame";
+       ot->description = "Scroll view so current frame would be centered";
+       ot->idname = "CLIP_OT_graph_center_current_frame";
+
+       /* api callbacks */
+       ot->exec = center_current_frame_exec;
+       ot->poll = ED_space_clip_graph_poll;
+}
index 3f7456e90dc4fda70d01ceb289d471450c55f977..9ff58a73ca241fc311f47796ed81514eb86c3159 100644 (file)
@@ -55,9 +55,13 @@ void clip_draw_curfra_label(struct SpaceClip *sc, float x, float y);
 void clip_draw_graph(struct SpaceClip *sc, struct ARegion *ar, struct Scene *scene);
 
 /* clip_graph_ops.c */
+void ED_clip_graph_center_current_frame(struct Scene *scene, struct ARegion *ar);
+
 void CLIP_OT_graph_select(struct wmOperatorType *ot);
 void CLIP_OT_graph_delete_curve(struct wmOperatorType *ot);
 void CLIP_OT_graph_delete_knot(struct wmOperatorType *ot);
+void CLIP_OT_graph_view_all(struct wmOperatorType *ot);
+void CLIP_OT_graph_center_current_frame(struct wmOperatorType *ot);
 
 /* clip_ops.c */
 void CLIP_OT_open(struct wmOperatorType *ot);
index 04871156412c1e423ab84b8e7b16f60d45de0bc8..0d34cc2cfbf8d4600962277a67fa2f1ab11b0eab 100644 (file)
@@ -78,7 +78,7 @@ static void init_preview_region(const bContext *C, ARegion *ar)
        ar->flag|= RGN_FLAG_HIDDEN;
 
        ar->v2d.tot.xmin= 0.0f;
-       ar->v2d.tot.ymin= (float)scene->r.sfra - 10.0f;
+       ar->v2d.tot.ymin= -10.0f;
        ar->v2d.tot.xmax= (float)scene->r.efra;
        ar->v2d.tot.ymax= 10.0f;
 
@@ -373,6 +373,8 @@ static void clip_operatortypes(void)
        WM_operatortype_append(CLIP_OT_graph_select);
        WM_operatortype_append(CLIP_OT_graph_delete_curve);
        WM_operatortype_append(CLIP_OT_graph_delete_knot);
+       WM_operatortype_append(CLIP_OT_graph_view_all);
+       WM_operatortype_append(CLIP_OT_graph_center_current_frame);
 
        /* object tracking */
        WM_operatortype_append(CLIP_OT_tracking_object_new);
@@ -418,6 +420,13 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
        RNA_enum_set(kmi->ptr, "mode", SC_MODE_DISTORTION);
        RNA_boolean_set(kmi->ptr, "toggle", TRUE);
 
+       kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", ZKEY, KM_PRESS, 0, 0);
+       RNA_string_set(kmi->ptr, "data_path", "space_data.view");
+       RNA_string_set(kmi->ptr, "value_1", "CLIP");
+       RNA_string_set(kmi->ptr, "value_2", "GRAPH");
+
+       WM_keymap_add_item(keymap, "CLIP_OT_solve_camera", SKEY, KM_PRESS, KM_SHIFT, 0);
+
        /* ******** Hotkeys avalaible for main region only ******** */
 
        keymap= WM_keymap_find(keyconf, "Clip Editor", SPACE_CLIP, 0);
@@ -546,6 +555,13 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "CLIP_OT_graph_delete_knot", DELKEY, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "CLIP_OT_graph_delete_knot", XKEY, KM_PRESS, KM_SHIFT, 0);
 
+       /* view */
+       WM_keymap_add_item(keymap, "CLIP_OT_graph_view_all", HOMEKEY, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "CLIP_OT_graph_center_current_frame", PADPERIOD, KM_PRESS, 0, 0);
+
+       kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", LKEY, KM_PRESS, 0, 0);
+       RNA_string_set(kmi->ptr, "data_path", "space_data.lock_time_cursor");
+
        transform_keymap_for_space(keyconf, keymap, SPACE_CLIP);
 }
 
@@ -588,10 +604,6 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
                                ar_main->alignment= RGN_ALIGN_NONE;
                                view_changed= 1;
                        }
-                       if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) {
-                               ar_preview->alignment= RGN_ALIGN_NONE;
-                               view_changed= 1;
-                       }
                        break;
                case SC_VIEW_GRAPH:
                        if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN)) {
@@ -604,7 +616,7 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
                                ar_main->alignment= RGN_ALIGN_NONE;
                                view_changed= 1;
                        }
-                       if (ar_preview && ar_preview->alignment != RGN_ALIGN_TOP) {
+                       if (ar_preview && !ELEM(ar_preview->alignment, RGN_ALIGN_TOP,  RGN_ALIGN_BOTTOM)) {
                                ar_preview->alignment= RGN_ALIGN_TOP;
                                view_changed= 1;
                        }
@@ -767,6 +779,9 @@ static void clip_preview_area_draw(const bContext *C, ARegion *ar)
        Scene *scene= CTX_data_scene(C);
        short unitx= V2D_UNIT_FRAMESCALE, unity= V2D_UNIT_VALUES;
 
+       if(sc->flag & SC_LOCK_TIMECURSOR)
+               ED_clip_graph_center_current_frame(scene, ar);
+
        /* clear and setup matrix */
        UI_ThemeClearColor(TH_BACK);
        glClear(GL_COLOR_BUFFER_BIT);
index 060e59265e0d095756070b019cbb7c236260681d..60da368321f56eed8fdf3533dffdd7b6a47a5d49 100644 (file)
@@ -232,6 +232,8 @@ static int view3d_layers_invoke(bContext *C, wmOperator *op, wmEvent *event)
        
        if(event->shift)
                RNA_boolean_set(op->ptr, "extend", TRUE);
+       else
+               RNA_boolean_set(op->ptr, "extend", FALSE);
        
        if(event->alt) {
                int nr= RNA_int_get(op->ptr, "nr") + 10;
index 80fd404772e329b9368932b8644ae65f76de533e..ee3c0ee82344b88899608abb462061a2524fb538 100644 (file)
@@ -248,6 +248,12 @@ static void EDBM_backbuf_checkAndSelectTFaces(Mesh *me, int select)
 
 /* *********************** GESTURE AND LASSO ******************* */
 
+typedef struct LassoSelectUserData {
+       ViewContext *vc;
+       rcti *rect;
+       int (*mcords)[2], moves, select, pass, done;
+} LassoSelectUserData;
+
 static int view3d_selectable_data(bContext *C)
 {
        Object *ob = CTX_data_active_object(C);
@@ -464,43 +470,43 @@ static void lasso_select_boundbox(rcti *rect, int mcords[][2], short moves)
 
 static void do_lasso_select_mesh__doSelectVert(void *userData, BMVert *eve, int x, int y, int UNUSED(index))
 {
-       struct { ViewContext vc; rcti *rect; int (*mcords)[2], moves, select, pass, done; } *data = userData;
+       LassoSelectUserData *data = userData;
 
        if (BLI_in_rcti(data->rect, x, y) && lasso_inside(data->mcords, data->moves, x, y)) {
-               BM_Select(data->vc.em->bm, eve, data->select);
+               BM_Select(data->vc->em->bm, eve, data->select);
        }
 }
 static void do_lasso_select_mesh__doSelectEdge(void *userData, BMEdge *eed, int x0, int y0, int x1, int y1, int index)
 {
-       struct { ViewContext vc; rcti *rect; int (*mcords)[2], moves, select, pass, done; } *data = userData;
+       LassoSelectUserData *data = userData;
 
        if (EDBM_check_backbuf(bm_solidoffs+index)) {
                if (data->pass==0) {
                        if (    edge_fully_inside_rect(data->rect, x0, y0, x1, y1)  &&
                                        lasso_inside(data->mcords, data->moves, x0, y0) &&
                                        lasso_inside(data->mcords, data->moves, x1, y1)) {
-                               BM_Select(data->vc.em->bm, eed, data->select);
+                               BM_Select(data->vc->em->bm, eed, data->select);
                                data->done = 1;
                        }
                } else {
                        if (lasso_inside_edge(data->mcords, data->moves, x0, y0, x1, y1)) {
-                               BM_Select(data->vc.em->bm, eed, data->select);
+                               BM_Select(data->vc->em->bm, eed, data->select);
                        }
                }
        }
 }
 static void do_lasso_select_mesh__doSelectFace(void *userData, BMFace *efa, int x, int y, int UNUSED(index))
 {
-       struct { ViewContext vc; rcti *rect; int (*mcords)[2], moves, select, pass, done; } *data = userData;
+       LassoSelectUserData *data = userData;
 
        if (BLI_in_rcti(data->rect, x, y) && lasso_inside(data->mcords, data->moves, x, y)) {
-               BM_Select(data->vc.em->bm, efa, data->select);
+               BM_Select(data->vc->em->bm, efa, data->select);
        }
 }
 
 static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
 {
-       struct { ViewContext vc; rcti *rect; int (*mcords)[2], moves, select, pass, done; } data;
+       LassoSelectUserData data;
        ToolSettings *ts= vc->scene->toolsettings;
        rcti rect;
        int bbsel;
@@ -510,7 +516,7 @@ static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves,
        /* set editmesh */
        vc->em= ((Mesh *)vc->obedit->data)->edit_btmesh;
 
-       data.vc= *vc;
+       data.vc= vc;
        data.rect = &rect;
        data.mcords = mcords;
        data.moves = moves;
@@ -618,7 +624,7 @@ static void do_lasso_select_mesh_uv(int mcords[][2], short moves, short select)
 
 static void do_lasso_select_curve__doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
 {
-       struct { ViewContext *vc; int (*mcords)[2]; short moves; short select; } *data = userData;
+       LassoSelectUserData *data = userData;
        Object *obedit= data->vc->obedit;
        Curve *cu= (Curve*)obedit->data;
 
@@ -647,7 +653,7 @@ static void do_lasso_select_curve__doSelect(void *userData, Nurb *UNUSED(nu), BP
 
 static void do_lasso_select_curve(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
 {
-       struct { ViewContext *vc; int (*mcords)[2]; short moves; short select; } data;
+       LassoSelectUserData data;
 
        /* set vc->editnurb */
        data.vc = vc;
@@ -664,7 +670,7 @@ static void do_lasso_select_curve(ViewContext *vc, int mcords[][2], short moves,
 
 static void do_lasso_select_lattice__doSelect(void *userData, BPoint *bp, int x, int y)
 {
-       struct { int (*mcords)[2]; short moves; short select; } *data = userData;
+       LassoSelectUserData *data = userData;
 
        if (lasso_inside(data->mcords, data->moves, x, y)) {
                bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
@@ -672,7 +678,7 @@ static void do_lasso_select_lattice__doSelect(void *userData, BPoint *bp, int x,
 }
 static void do_lasso_select_lattice(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
 {
-       struct { int (*mcords)[2]; short moves; short select; } data;
+       LassoSelectUserData data;
 
        /* set editdata in vc */
        data.mcords = mcords;
@@ -1632,6 +1638,11 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce
 
 /* ********************  border and circle ************************************** */
 
+typedef struct BoxSelectUserData {
+       ViewContext *vc;
+       rcti *rect;
+       int select, pass, done;
+} BoxSelectUserData;
 
 int edge_inside_circle(short centx, short centy, short rad, short x1, short y1, short x2, short y2)
 {
@@ -1657,7 +1668,7 @@ int edge_inside_circle(short centx, short centy, short rad, short x1, short y1,
 
 static void do_nurbs_box_select__doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
 {
-       struct { ViewContext *vc; rcti *rect; int select; } *data = userData;
+       BoxSelectUserData *data = userData;
        Object *obedit= data->vc->obedit;
        Curve *cu= (Curve*)obedit->data;
 
@@ -1685,7 +1696,7 @@ static void do_nurbs_box_select__doSelect(void *userData, Nurb *UNUSED(nu), BPoi
 }
 static int do_nurbs_box_select(ViewContext *vc, rcti *rect, int select, int extend)
 {
-       struct { ViewContext *vc; rcti *rect; int select; } data;
+       BoxSelectUserData data;
        
        data.vc = vc;
        data.rect = rect;
@@ -1702,7 +1713,7 @@ static int do_nurbs_box_select(ViewContext *vc, rcti *rect, int select, int exte
 
 static void do_lattice_box_select__doSelect(void *userData, BPoint *bp, int x, int y)
 {
-       struct { ViewContext vc; rcti *rect; int select; } *data = userData;
+       BoxSelectUserData *data = userData;
 
        if (BLI_in_rcti(data->rect, x, y)) {
                bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
@@ -1710,9 +1721,9 @@ static void do_lattice_box_select__doSelect(void *userData, BPoint *bp, int x, i
 }
 static int do_lattice_box_select(ViewContext *vc, rcti *rect, int select, int extend)
 {
-       struct { ViewContext vc; rcti *rect; int select, pass, done; } data;
+       BoxSelectUserData data;
 
-       data.vc= *vc;
+       data.vc= vc;
        data.rect = rect;
        data.select = select;
 
@@ -1727,44 +1738,44 @@ static int do_lattice_box_select(ViewContext *vc, rcti *rect, int select, int ex
 
 static void do_mesh_box_select__doSelectVert(void *userData, BMVert *eve, int x, int y, int UNUSED(index))
 {
-       struct { ViewContext vc; rcti *rect; short select, pass, done; } *data = userData;
+       BoxSelectUserData *data = userData;
 
        if (BLI_in_rcti(data->rect, x, y)) {
-               BM_Select(data->vc.em->bm, eve, data->select);
+               BM_Select(data->vc->em->bm, eve, data->select);
        }
 }
 static void do_mesh_box_select__doSelectEdge(void *userData, BMEdge *eed, int x0, int y0, int x1, int y1, int index)
 {
-       struct { ViewContext vc; rcti *rect; short select, pass, done; } *data = userData;
+       BoxSelectUserData *data = userData;
 
        if(EDBM_check_backbuf(bm_solidoffs+index)) {
                if (data->pass==0) {
                        if (edge_fully_inside_rect(data->rect, x0, y0, x1, y1)) {
-                               BM_Select(data->vc.em->bm, eed, data->select);
+                               BM_Select(data->vc->em->bm, eed, data->select);
                                data->done = 1;
                        }
                } else {
                        if (edge_inside_rect(data->rect, x0, y0, x1, y1)) {
-                               BM_Select(data->vc.em->bm, eed, data->select);
+                               BM_Select(data->vc->em->bm, eed, data->select);
                        }
                }
        }
 }
 static void do_mesh_box_select__doSelectFace(void *userData, BMFace *efa, int x, int y, int UNUSED(index))
 {
-       struct { ViewContext vc; rcti *rect; short select, pass, done; } *data = userData;
+       BoxSelectUserData *data = userData;
 
        if (BLI_in_rcti(data->rect, x, y)) {
-               BM_Select(data->vc.em->bm, efa, data->select);
+               BM_Select(data->vc->em->bm, efa, data->select);
        }
 }
 static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int extend)
 {
-       struct { ViewContext vc; rcti *rect; short select, pass, done; } data;
+       BoxSelectUserData data;
        ToolSettings *ts= vc->scene->toolsettings;
        int bbsel;
        
-       data.vc= *vc;
+       data.vc= vc;
        data.rect = rect;
        data.select = select;
        data.pass = 0;
@@ -2259,9 +2270,16 @@ void VIEW3D_OT_select(wmOperatorType *ot)
 
 /* -------------------- circle select --------------------------------------------- */
 
+typedef struct CircleSelectUserData {
+       ViewContext *vc;
+       short select;
+       int mval[2];
+       float radius;
+} CircleSelectUserData;
+
 static void mesh_circle_doSelectVert(void *userData, BMVert *eve, int x, int y, int UNUSED(index))
 {
-       struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData;
+       CircleSelectUserData *data = userData;
        int mx = x - data->mval[0], my = y - data->mval[1];
        float r = sqrt(mx*mx + my*my);
 
@@ -2271,7 +2289,7 @@ static void mesh_circle_doSelectVert(void *userData, BMVert *eve, int x, int y,
 }
 static void mesh_circle_doSelectEdge(void *userData, BMEdge *eed, int x0, int y0, int x1, int y1, int UNUSED(index))
 {
-       struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData;
+       CircleSelectUserData *data = userData;
 
        if (edge_inside_circle(data->mval[0], data->mval[1], (short) data->radius, x0, y0, x1, y1)) {
                BM_Select(data->vc->em->bm, eed, data->select);
@@ -2279,7 +2297,7 @@ static void mesh_circle_doSelectEdge(void *userData, BMEdge *eed, int x0, int y0
 }
 static void mesh_circle_doSelectFace(void *userData, BMFace *efa, int x, int y, int UNUSED(index))
 {
-       struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData;
+       CircleSelectUserData *data = userData;
        int mx = x - data->mval[0], my = y - data->mval[1];
        float r = sqrt(mx*mx + my*my);
        
@@ -2292,7 +2310,7 @@ static void mesh_circle_select(ViewContext *vc, int select, const int mval[2], f
 {
        ToolSettings *ts= vc->scene->toolsettings;
        int bbsel;
-       struct {ViewContext *vc; short select; int mval[2]; float radius; } data;
+       CircleSelectUserData data;
        
        bbsel= EDBM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0));
        ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
@@ -2354,7 +2372,7 @@ static void paint_vertsel_circle_select(ViewContext *vc, int select, const int m
        Object *ob= vc->obact;
        Mesh *me = ob?ob->data:NULL;
        /* int bbsel; */ /* UNUSED */
-       /* struct {ViewContext *vc; short select; int mval[2]; float radius; } data = {NULL}; */ /* UNUSED */
+       /* CircleSelectUserData data = {NULL}; */ /* UNUSED */
        if (me) {
                bm_vertoffs= me->totvert+1;     /* max index array */
 
@@ -2369,7 +2387,7 @@ static void paint_vertsel_circle_select(ViewContext *vc, int select, const int m
 
 static void nurbscurve_circle_doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
 {
-       struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData;
+       CircleSelectUserData *data = userData;
        int mx = x - data->mval[0], my = y - data->mval[1];
        float r = sqrt(mx*mx + my*my);
        Object *obedit= data->vc->obedit;
@@ -2400,7 +2418,7 @@ static void nurbscurve_circle_doSelect(void *userData, Nurb *UNUSED(nu), BPoint
 }
 static void nurbscurve_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
 {
-       struct {ViewContext *vc; short select; int mval[2]; float radius; } data;
+       CircleSelectUserData data;
 
        /* set vc-> edit data */
        
@@ -2417,7 +2435,7 @@ static void nurbscurve_circle_select(ViewContext *vc, int select, const int mval
 
 static void latticecurve_circle_doSelect(void *userData, BPoint *bp, int x, int y)
 {
-       struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData;
+       CircleSelectUserData *data = userData;
        int mx = x - data->mval[0], my = y - data->mval[1];
        float r = sqrt(mx*mx + my*my);
 
@@ -2427,7 +2445,7 @@ static void latticecurve_circle_doSelect(void *userData, BPoint *bp, int x, int
 }
 static void lattice_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
 {
-       struct {ViewContext *vc; short select; int mval[2]; float radius; } data;
+       CircleSelectUserData data;
 
        /* set vc-> edit data */
        
@@ -2444,7 +2462,7 @@ static void lattice_circle_select(ViewContext *vc, int select, const int mval[2]
 // NOTE: pose-bone case is copied from editbone case...
 static short pchan_circle_doSelectJoint(void *userData, bPoseChannel *pchan, int x, int y)
 {
-       struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData;
+       CircleSelectUserData *data = userData;
        int mx = x - data->mval[0], my = y - data->mval[1];
        float r = sqrt(mx*mx + my*my);
        
@@ -2459,7 +2477,7 @@ static short pchan_circle_doSelectJoint(void *userData, bPoseChannel *pchan, int
 }
 static void pose_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
 {
-       struct {ViewContext *vc; short select; int mval[2]; float radius; } data;
+       CircleSelectUserData data;
        bArmature *arm = vc->obact->data;
        bPose *pose = vc->obact->pose;
        bPoseChannel *pchan;
@@ -2509,7 +2527,7 @@ static void pose_circle_select(ViewContext *vc, int select, const int mval[2], f
 
 static short armature_circle_doSelectJoint(void *userData, EditBone *ebone, int x, int y, short head)
 {
-       struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData;
+       CircleSelectUserData *data = userData;
        int mx = x - data->mval[0], my = y - data->mval[1];
        float r = sqrt(mx*mx + my*my);
        
@@ -2532,7 +2550,7 @@ static short armature_circle_doSelectJoint(void *userData, EditBone *ebone, int
 }
 static void armature_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
 {
-       struct {ViewContext *vc; short select, mval[2]; float radius; } data;
+       CircleSelectUserData data;
        bArmature *arm= vc->obedit->data;
        EditBone *ebone;
        int change= FALSE;
index d57da31793e3403883162e2355194468ca57fa44..06138bc075720e79ac6079cbcb8902d57a8f279b 100644 (file)
@@ -900,7 +900,8 @@ enum {
 #define SC_SHOW_FILTERS                        (1<<13)
 #define SC_SHOW_GRAPH_FRAMES   (1<<14)
 #define SC_SHOW_GRAPH_TRACKS   (1<<15)
-#define SC_SHOW_PYRAMID_LEVELS         (1<<16)
+#define SC_SHOW_PYRAMID_LEVELS (1<<16)
+#define SC_LOCK_TIMECURSOR             (1<<17)
 
 /* SpaceClip->mode */
 #define SC_MODE_TRACKING               0
index 6ab8b5524ffaefb0226a4812df8fad53abe556a9..1b41131c07de1d99fd9d09dd1572bbf96ef3d259 100644 (file)
@@ -121,6 +121,9 @@ typedef struct MovieTrackingSettings {
        short default_frames_limit;                     /* number of frames to be tarcked during single tracking session (if TRACKING_FRAMES_LIMIT is set) */
        short default_margin;                           /* margin from frame boundaries */
        short default_pattern_match;            /* re-adjust every N frames */
+       short default_flag;                                     /* default flags like color channels used by default */
+
+       short pod;
 
        /* ** common tracker settings ** */
        short speed;                    /* speed of tracking */
@@ -129,7 +132,7 @@ typedef struct MovieTrackingSettings {
        int keyframe1, keyframe2;       /* two keyframes for reconstrution initialization */
 
        /* ** which camera intrinsics to refine. uses on the REFINE_* flags */
-       short refine_camera_intrinsics, pad2;
+       short refine_camera_intrinsics, pad23;
 
        /* ** tool settings ** */
 
@@ -142,6 +145,8 @@ typedef struct MovieTrackingSettings {
 
        /* set object scale */
        float object_distance;          /* distance between two bundles used for object scaling */
+
+       int pad3;
 } MovieTrackingSettings;
 
 typedef struct MovieTrackingStabilization {
index 3dc0e7c37e4fd3acdc4d505b46ea5b85ee26cd6f..5339ee58acf57e8aabaa9682c941d844d626b275 100644 (file)
@@ -4747,8 +4747,15 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *UNUSE
                                        break;
                                case PROP_STRING: {
                                        const char *defvalue= ((StringPropertyRNA*)parm)->defaultvalue;
-                                       if(defvalue && defvalue[0])
+                                       if(defvalue && defvalue[0]) {
+                                               /* causes bug [#29988], possibly this is only correct for thick wrapped
+                                                * need to look further into it - campbell */
+#if 0
                                                BLI_strncpy(data, defvalue, size);
+#else
+                                               memcpy(data, &defvalue, size);
+#endif
+                                       }
                                        break;
                                }
                                case PROP_POINTER:
index 14e518da4b56355922f15d8316d9cf8c8168565e..153317fb687b2507badc073b3f64da9fda92f671 100644 (file)
@@ -57,6 +57,7 @@ static void rna_Scene_frame_set(Scene *scene, int frame, float subframe)
        
        CLAMP(scene->r.cfra, MINAFRAME, MAXFRAME);
        scene_update_for_newframe(G.main, scene, (1<<20) - 1);
+       scene_camera_switch_update(scene);
 
        /* cant use NC_SCENE|ND_FRAME because this casues wm_event_do_notifiers to call 
         * scene_update_for_newframe which will loose any un-keyed changes [#24690] */
index d7f1c375a2162632faa672562b1da379b5072b6c..571fe05238d416cb27f3d12f97f2760058873bfc 100644 (file)
@@ -2375,6 +2375,11 @@ static void rna_def_space_time(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
        RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
        
+       prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TIME_DRAWFRAMES);
+       RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
+       RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
+       
        /* displaying cache status */
        prop= RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DISPLAY);
@@ -2895,6 +2900,12 @@ static void rna_def_space_clip(BlenderRNA *brna)
        RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_LOCK_SELECTION);
        RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, "rna_SpaceClipEditor_lock_selection_update");
 
+       /* lock to time cursor */
+       prop= RNA_def_property(srna, "lock_time_cursor", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_ui_text(prop, "Lock to Time Cursor", "Lock curves view to time cursos during playback and tracking");
+       RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_LOCK_TIMECURSOR);
+       RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
+
        /* show markers pathes */
        prop= RNA_def_property(srna, "show_track_path", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_TRACK_PATH);
index 5573ceccf8f713ededa4eb85d829b477728c50cf..993c0ca0bde398989f65ab41a1cb558bd2e98ddc 100644 (file)
@@ -639,6 +639,26 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
        RNA_def_property_update(prop, 0, "rna_tracking_defaultSettings_searchUpdate");
        RNA_def_property_ui_text(prop, "Search Size", "Size of search area for newly created tracks");
 
+       /* use_red_channel */
+       prop= RNA_def_property(srna, "use_default_red_channel", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_negative_sdna(prop, NULL, "default_flag", TRACK_DISABLE_RED);
+       RNA_def_property_ui_text(prop, "Use Red Channel", "Use red channel from footage for tracking");
+       RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
+
+       /* use_green_channel */
+       prop= RNA_def_property(srna, "use_default_green_channel", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_negative_sdna(prop, NULL, "default_flag", TRACK_DISABLE_GREEN);
+       RNA_def_property_ui_text(prop, "Use Green Channel", "Use green channel from footage for tracking");
+       RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
+
+       /* use_blue_channel */
+       prop= RNA_def_property(srna, "use_default_blue_channel", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_negative_sdna(prop, NULL, "default_flag", TRACK_DISABLE_BLUE);
+       RNA_def_property_ui_text(prop, "Use Blue Channel", "Use blue channel from footage for tracking");
+       RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
+
+       /* ** object tracking ** */
+
        /* object distance */
        prop= RNA_def_property(srna, "object_distance", PROP_FLOAT, PROP_NONE);
        RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
index 6c9bbd11e9cfe247600c14c48d5618da7a334103..7e46d3f0fe3abb99abb866959eb41d952cc249e0 100644 (file)
@@ -67,11 +67,10 @@ static void initData(ModifierData *md)
        cloth_init (clmd);
 }
 
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
-                                               DerivedMesh *dm,
-                                               int UNUSED(useRenderParams),
-                                               int UNUSED(isFinalCalc))
+static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3],
+                       int UNUSED(numVerts), int UNUSED(useRenderParams), int UNUSED(isFinalCalc))
 {
+       DerivedMesh *dm;
        ClothModifierData *clmd = (ClothModifierData*) md;
        DerivedMesh *result=NULL;
        
@@ -79,19 +78,22 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
        if(!clmd->sim_parms || !clmd->coll_parms)
        {
                initData(md);
-               
+
                if(!clmd->sim_parms || !clmd->coll_parms)
-                       return dm;
+                       return;
        }
 
-       result = clothModifier_do(clmd, md->scene, ob, dm);
+       dm = get_dm(ob, NULL, derivedData, NULL, 0);
 
-       if(result)
-       {
-               CDDM_calc_normals(result);
-               return result;
+       clothModifier_do(clmd, md->scene, ob, dm, vertexCos);
+
+       if(result) {
+               result->getVertCos(result, vertexCos);
+               result->release(result);
        }
-       return dm;
+
+       if(dm != derivedData)
+               dm->release(dm);
 }
 
 static void updateDepgraph(
@@ -206,17 +208,17 @@ ModifierTypeInfo modifierType_Cloth = {
        /* name */              "Cloth",
        /* structName */        "ClothModifierData",
        /* structSize */        sizeof(ClothModifierData),
-       /* type */              eModifierTypeType_Nonconstructive,
+       /* type */              eModifierTypeType_OnlyDeform,
        /* flags */             eModifierTypeFlag_AcceptsMesh
                                                        | eModifierTypeFlag_UsesPointCache
                                                        | eModifierTypeFlag_Single,
 
        /* copyData */          copyData,
-       /* deformVerts */       NULL,
+       /* deformVerts */       deformVerts,
        /* deformMatrices */    NULL,
        /* deformVertsEM */     NULL,
        /* deformMatricesEM */  NULL,
-       /* applyModifier */     applyModifier,
+       /* applyModifier */     NULL,
        /* applyModifierEM */   NULL,
        /* initData */          initData,
        /* requiredDataMask */  requiredDataMask,
index f585912c18c3e2f9316d620f01aecae9513074c2..604ba189dcfb4a1ae2d840370f5fea7183780080 100644 (file)
@@ -1894,6 +1894,7 @@ static void validate_render_settings(Render *re)
        if(RE_engine_is_external(re)) {
                /* not supported yet */
                re->r.scemode &= ~(R_EXR_TILE_FILE|R_FULL_SAMPLE);
+               re->r.mode &= ~R_FIELDS;
        }
 }