Revision: 39216
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39216
Author:   nexyon
Date:     2011-08-09 15:26:02 +0000 (Tue, 09 Aug 2011)
Log Message:
-----------
Merging pepper up to r39215.

Revision Links:
--------------
    
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39215

Modified Paths:
--------------
    branches/soc-2011-salad/intern/audaspace/FX/AUD_DoubleReader.cpp
    branches/soc-2011-salad/intern/audaspace/FX/AUD_SuperposeReader.cpp
    branches/soc-2011-salad/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
    branches/soc-2011-salad/intern/audaspace/intern/AUD_AnimateableProperty.cpp
    branches/soc-2011-salad/intern/audaspace/intern/AUD_C-API.cpp
    branches/soc-2011-salad/intern/audaspace/intern/AUD_C-API.h
    branches/soc-2011-salad/intern/audaspace/intern/AUD_LinearResampleReader.cpp
    branches/soc-2011-salad/intern/audaspace/intern/AUD_ReadDevice.cpp
    branches/soc-2011-salad/intern/audaspace/intern/AUD_Space.h
    branches/soc-2011-salad/release/scripts/modules/mocap_constraints.py
    branches/soc-2011-salad/release/scripts/modules/mocap_tools.py
    branches/soc-2011-salad/release/scripts/modules/retarget.py
    branches/soc-2011-salad/release/scripts/startup/bl_ui/space_sequencer.py
    branches/soc-2011-salad/release/scripts/startup/ui_mocap.py
    branches/soc-2011-salad/source/blender/blenkernel/BKE_sound.h
    branches/soc-2011-salad/source/blender/blenkernel/intern/blender.c
    branches/soc-2011-salad/source/blender/blenkernel/intern/library.c
    branches/soc-2011-salad/source/blender/blenkernel/intern/scene.c
    branches/soc-2011-salad/source/blender/blenkernel/intern/sound.c
    branches/soc-2011-salad/source/blender/blenloader/intern/readfile.c
    branches/soc-2011-salad/source/blender/collada/AnimationExporter.cpp
    branches/soc-2011-salad/source/blender/collada/AnimationExporter.h
    branches/soc-2011-salad/source/blender/collada/AnimationImporter.cpp
    branches/soc-2011-salad/source/blender/collada/AnimationImporter.h
    branches/soc-2011-salad/source/blender/collada/TransformWriter.cpp
    branches/soc-2011-salad/source/blender/editors/object/object_add.c
    
branches/soc-2011-salad/source/blender/editors/space_sequencer/sequencer_draw.c
    
branches/soc-2011-salad/source/blender/editors/space_sequencer/space_sequencer.c
    branches/soc-2011-salad/source/blender/makesdna/DNA_anim_types.h
    branches/soc-2011-salad/source/blender/makesdna/DNA_sequence_types.h
    branches/soc-2011-salad/source/blender/makesdna/DNA_sound_types.h
    branches/soc-2011-salad/source/blender/makesrna/intern/rna_sequencer.c
    branches/soc-2011-salad/source/creator/CMakeLists.txt
    branches/soc-2011-salad/source/gameengine/Converter/BL_ActionActuator.cpp
    branches/soc-2011-salad/source/gameengine/Converter/BL_ShapeDeformer.cpp
    branches/soc-2011-salad/source/gameengine/Ketsji/BL_Action.cpp
    branches/soc-2011-salad/source/gameengine/Ketsji/BL_Action.h
    branches/soc-2011-salad/source/gameengine/Ketsji/BL_ActionManager.cpp
    branches/soc-2011-salad/source/gameengine/Ketsji/BL_ActionManager.h
    branches/soc-2011-salad/source/gameengine/Ketsji/KX_GameObject.cpp
    branches/soc-2011-salad/source/gameengine/Ketsji/KX_GameObject.h

Property Changed:
----------------
    branches/soc-2011-salad/


Property changes on: branches/soc-2011-salad
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-carrot:36828-39099
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-38309
/branches/soc-2011-pepper:36830-39147
/branches/soc-2011-tomato:36831-39069
/trunk/blender:36834-39191
   + /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-carrot:36828-39099
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-38309
/branches/soc-2011-pepper:36830-39215
/branches/soc-2011-tomato:36831-39069
/trunk/blender:36834-39191

Modified: branches/soc-2011-salad/intern/audaspace/FX/AUD_DoubleReader.cpp
===================================================================
--- branches/soc-2011-salad/intern/audaspace/FX/AUD_DoubleReader.cpp    
2011-08-09 15:12:20 UTC (rev 39215)
+++ branches/soc-2011-salad/intern/audaspace/FX/AUD_DoubleReader.cpp    
2011-08-09 15:26:02 UTC (rev 39216)
@@ -97,7 +97,7 @@
                        AUD_Specs specs1, specs2;
                        specs1 = m_reader1->getSpecs();
                        specs2 = m_reader2->getSpecs();
-                       if(memcmp(&specs1, &specs2, sizeof(AUD_Specs)))
+                       if(AUD_COMPARE_SPECS(specs1, specs2))
                                length = len;
                        else
                        {

Modified: branches/soc-2011-salad/intern/audaspace/FX/AUD_SuperposeReader.cpp
===================================================================
--- branches/soc-2011-salad/intern/audaspace/FX/AUD_SuperposeReader.cpp 
2011-08-09 15:12:20 UTC (rev 39215)
+++ branches/soc-2011-salad/intern/audaspace/FX/AUD_SuperposeReader.cpp 
2011-08-09 15:26:02 UTC (rev 39216)
@@ -81,7 +81,7 @@
 {
        AUD_Specs specs = m_reader1->getSpecs();
        AUD_Specs s2 = m_reader2->getSpecs();
-       if(memcmp(&specs, &s2, sizeof(AUD_Specs)))
+       if(AUD_COMPARE_SPECS(specs, s2))
                AUD_THROW(AUD_ERROR_SPECS, specs_error);
 
        int samplesize = AUD_SAMPLE_SIZE(specs);

Modified: branches/soc-2011-salad/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
===================================================================
--- branches/soc-2011-salad/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp        
2011-08-09 15:12:20 UTC (rev 39215)
+++ branches/soc-2011-salad/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp        
2011-08-09 15:26:02 UTC (rev 39216)
@@ -177,6 +177,7 @@
 
 AUD_FFMPEGReader::AUD_FFMPEGReader(std::string filename) :
        m_pkgbuf(AVCODEC_MAX_AUDIO_FRAME_SIZE<<1),
+       m_formatCtx(NULL),
        m_aviocontext(NULL),
        m_membuf(NULL)
 {

Modified: 
branches/soc-2011-salad/intern/audaspace/intern/AUD_AnimateableProperty.cpp
===================================================================
--- branches/soc-2011-salad/intern/audaspace/intern/AUD_AnimateableProperty.cpp 
2011-08-09 15:12:20 UTC (rev 39215)
+++ branches/soc-2011-salad/intern/audaspace/intern/AUD_AnimateableProperty.cpp 
2011-08-09 15:26:02 UTC (rev 39216)
@@ -105,10 +105,10 @@
                return;
        }
 
-       float last = (getSize() / (sizeof(float) * m_count) - 1);
+       int last = getSize() / (sizeof(float) * m_count) - 1;
        float t = position - floor(position);
 
-       if(position > last)
+       if(position >= last)
        {
                position = last;
                t = 0;
@@ -128,24 +128,18 @@
                float* p1 = getBuffer() + pos;
                float* p2;
                float* p3;
+               last *= m_count;
 
                if(pos == 0)
                        p0 = p1;
                else
                        p0 = p1 - m_count;
 
-               if(pos > last)
-               {
-                       p3 = p2 = p1;
-               }
+               p2 = p1 + m_count;
+               if(pos + m_count == last)
+                       p3 = p2;
                else
-               {
-                       p2 = p1 + m_count;
-                       if(pos + m_count > last)
-                               p3 = p2;
-                       else
-                               p3 = p2 + m_count;
-               }
+                       p3 = p2 + m_count;
 
                for(int i = 0; i < m_count; i++)
                {

Modified: branches/soc-2011-salad/intern/audaspace/intern/AUD_C-API.cpp
===================================================================
--- branches/soc-2011-salad/intern/audaspace/intern/AUD_C-API.cpp       
2011-08-09 15:12:20 UTC (rev 39215)
+++ branches/soc-2011-salad/intern/audaspace/intern/AUD_C-API.cpp       
2011-08-09 15:26:02 UTC (rev 39216)
@@ -816,7 +816,7 @@
        if(high < rate)
                sound = new AUD_LowpassFactory(sound, high);
        if(low > 0)
-               sound = new AUD_HighpassFactory(sound, low);;
+               sound = new AUD_HighpassFactory(sound, low);
 
        sound = new AUD_EnvelopeFactory(sound, attack, release, threshold, 
0.1f);
        sound = new AUD_LinearResampleFactory(sound, specs);
@@ -1055,7 +1055,7 @@
        return -1;
 }
 
-int AUD_readSound(AUD_Sound* sound, sample_t* buffer, int length)
+int AUD_readSound(AUD_Sound* sound, sample_t* buffer, int length, int 
samples_per_second)
 {
        AUD_DeviceSpecs specs;
        sample_t* buf;
@@ -1067,39 +1067,41 @@
 
        AUD_Reference<AUD_IReader> reader = AUD_ChannelMapperFactory(*sound, 
specs).createReader();
 
-       int len = reader->getLength();
-       float samplejump = (float)len / (float)length;
-       float min, max;
+       specs.specs = reader->getSpecs();
+       int len;
+       float samplejump = specs.rate / samples_per_second;
+       float min, max, power;
        bool eos;
 
        for(int i = 0; i < length; i++)
        {
                len = floor(samplejump * (i+1)) - floor(samplejump * i);
 
-               if(aBuffer.getSize() < len * 
AUD_SAMPLE_SIZE(reader->getSpecs()))
-               {
-                       aBuffer.resize(len * 
AUD_SAMPLE_SIZE(reader->getSpecs()));
-                       buf = aBuffer.getBuffer();
-               }
+               aBuffer.assureSize(len * AUD_SAMPLE_SIZE(specs));
+               buf = aBuffer.getBuffer();
 
                reader->read(len, eos, buf);
 
-               if(eos)
-               {
-                       length = i;
-                       break;
-               }
-
                max = min = *buf;
+               power = *buf * *buf;
                for(int j = 1; j < len; j++)
                {
                        if(buf[j] < min)
                                min = buf[j];
                        if(buf[j] > max)
                                max = buf[j];
-                       buffer[i * 2] = min;
-                       buffer[i * 2 + 1] = max;
+                       power += buf[j] * buf[j];
                }
+
+               buffer[i * 3] = min;
+               buffer[i * 3 + 1] = max;
+               buffer[i * 3 + 2] = sqrt(power) / len;
+
+               if(eos)
+               {
+                       length = i;
+                       break;
+               }
        }
 
        return length;

Modified: branches/soc-2011-salad/intern/audaspace/intern/AUD_C-API.h
===================================================================
--- branches/soc-2011-salad/intern/audaspace/intern/AUD_C-API.h 2011-08-09 
15:12:20 UTC (rev 39215)
+++ branches/soc-2011-salad/intern/audaspace/intern/AUD_C-API.h 2011-08-09 
15:26:02 UTC (rev 39216)
@@ -502,7 +502,7 @@
 
 extern int AUD_doesPlayback(void);
 
-extern int AUD_readSound(AUD_Sound* sound, sample_t* buffer, int length);
+extern int AUD_readSound(AUD_Sound* sound, sample_t* buffer, int length, int 
samples_per_second);
 
 extern AUD_Sound* AUD_copy(AUD_Sound* sound);
 

Modified: 
branches/soc-2011-salad/intern/audaspace/intern/AUD_LinearResampleReader.cpp
===================================================================
--- 
branches/soc-2011-salad/intern/audaspace/intern/AUD_LinearResampleReader.cpp    
    2011-08-09 15:12:20 UTC (rev 39215)
+++ 
branches/soc-2011-salad/intern/audaspace/intern/AUD_LinearResampleReader.cpp    
    2011-08-09 15:26:02 UTC (rev 39216)
@@ -82,7 +82,7 @@
 
        int samplesize = AUD_SAMPLE_SIZE(specs);
        int size = length;
-       float factor = float(m_rate) / float(m_reader->getSpecs().rate);
+       float factor = m_rate / m_reader->getSpecs().rate;
        float spos;
        sample_t low, high;
        eos = false;

Modified: branches/soc-2011-salad/intern/audaspace/intern/AUD_ReadDevice.cpp
===================================================================
--- branches/soc-2011-salad/intern/audaspace/intern/AUD_ReadDevice.cpp  
2011-08-09 15:12:20 UTC (rev 39215)
+++ branches/soc-2011-salad/intern/audaspace/intern/AUD_ReadDevice.cpp  
2011-08-09 15:26:02 UTC (rev 39216)
@@ -70,7 +70,7 @@
 
 void AUD_ReadDevice::changeSpecs(AUD_Specs specs)
 {
-       if(memcmp(&specs, &m_specs.specs, sizeof(specs)))
+       if(AUD_COMPARE_SPECS(specs, m_specs.specs))
                setSpecs(specs);
 }
 

Modified: branches/soc-2011-salad/intern/audaspace/intern/AUD_Space.h
===================================================================
--- branches/soc-2011-salad/intern/audaspace/intern/AUD_Space.h 2011-08-09 
15:12:20 UTC (rev 39215)
+++ branches/soc-2011-salad/intern/audaspace/intern/AUD_Space.h 2011-08-09 
15:26:02 UTC (rev 39216)
@@ -41,6 +41,8 @@
 /// Throws a AUD_Exception with the provided error code.
 #define AUD_THROW(exception, errorstr) { AUD_Exception e; e.error = exception; 
e.str = errorstr; throw e; }
 
+#define AUD_COMPARE_SPECS(s1, s2) ((s1.rate == s2.rate) && (s1.channels == 
s2.channels))
+
 /// Returns the bit for a channel mask.
 #define AUD_CHANNEL_BIT(channel) (0x01 << channel)
 

Modified: branches/soc-2011-salad/release/scripts/modules/mocap_constraints.py
===================================================================
--- branches/soc-2011-salad/release/scripts/modules/mocap_constraints.py        
2011-08-09 15:12:20 UTC (rev 39215)
+++ branches/soc-2011-salad/release/scripts/modules/mocap_constraints.py        
2011-08-09 15:26:02 UTC (rev 39216)
@@ -59,7 +59,7 @@
         c_type = "LIMIT_LOCATION"
         #create and store the new constraint within m_constraint
     real_constraint = cons_obj.constraints.new(c_type)
-    real_constraint.name = "Mocap fix " + str(len(cons_obj.constraints))
+    real_constraint.name = "Auto fixes " + str(len(cons_obj.constraints))
     m_constraint.real_constraint_bone = consObjToBone(cons_obj)
     m_constraint.real_constraint = real_constraint.name
     #set the rest of the constraint properties
@@ -364,7 +364,8 @@
                 simpleBake += [end_bone]
     for bone in selectedBones:
         bone.bone.select = True
-    constraintTrack = obj.animation_data.nla_tracks["Mocap fixes"]
+    tracks = [track for track in obj.data.mocapNLATracks if track.active][0]
+    constraintTrack = obj.animation_data.nla_tracks[tracks.auto_fix_track]
     constraintStrip = constraintTrack.strips[0]
     constraintStrip.action_frame_start = s_frame
     constraintStrip.action_frame_end = e_frame
@@ -403,7 +404,8 @@
     obj = context.active_object
     bones = obj.pose.bones
     scene = bpy.context.scene
-    constraintTrack = obj.animation_data.nla_tracks["Mocap fixes"]
+    tracks = obj.data.mocapNLATracks[obj.animation_data.action]
+    constraintTrack = obj.animation_data.nla_tracks[tracks.auto_fix_track]
     constraintStrip = constraintTrack.strips[0]
     action = constraintStrip.action
     # delete the fcurves on the strip

Modified: branches/soc-2011-salad/release/scripts/modules/mocap_tools.py
===================================================================
--- branches/soc-2011-salad/release/scripts/modules/mocap_tools.py      
2011-08-09 15:12:20 UTC (rev 39215)

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to