From c284725a1a69be3f9a80d88e17be922e6ce63f72 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Thu, 4 Aug 2011 07:12:03 +0000 Subject: 3D Audio GSoC: * versioning stuff for btheme->tv3d.speaker * separating object.c speaker functions in own source file Thanks Brecht for the suggestions. --- source/blender/blenkernel/BKE_object.h | 5 -- source/blender/blenkernel/BKE_speaker.h | 43 +++++++++ source/blender/blenkernel/CMakeLists.txt | 2 + source/blender/blenkernel/intern/library.c | 1 + source/blender/blenkernel/intern/object.c | 95 +------------------- source/blender/blenkernel/intern/speaker.c | 139 +++++++++++++++++++++++++++++ 6 files changed, 186 insertions(+), 99 deletions(-) create mode 100644 source/blender/blenkernel/BKE_speaker.h create mode 100644 source/blender/blenkernel/intern/speaker.c (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index f9e01a524ab..a6b5c04b5c3 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -88,11 +88,6 @@ void make_local_lamp(struct Lamp *la); void free_camera(struct Camera *ca); void free_lamp(struct Lamp *la); -void *add_speaker(const char *name); -struct Speaker *copy_speaker(struct Speaker *spk); -void make_local_speaker(struct Speaker *spk); -void free_speaker(struct Speaker *spk); - struct Object *add_only_object(int type, const char *name); struct Object *add_object(struct Scene *scene, int type); diff --git a/source/blender/blenkernel/BKE_speaker.h b/source/blender/blenkernel/BKE_speaker.h new file mode 100644 index 00000000000..111bd86fdd3 --- /dev/null +++ b/source/blender/blenkernel/BKE_speaker.h @@ -0,0 +1,43 @@ +/* + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Jörg Müller. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef BKE_SPEAKER_H +#define BKE_SPEAKER_H + +/** \file BKE_speaker.h + * \ingroup bke + * \brief General operations for speakers. + */ + +void *add_speaker(const char *name); +struct Speaker *copy_speaker(struct Speaker *spk); +void make_local_speaker(struct Speaker *spk); +void free_speaker(struct Speaker *spk); + +#endif diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index defcef58463..c1797427cc2 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -140,6 +140,7 @@ set(SRC intern/smoke.c intern/softbody.c intern/sound.c + intern/speaker.c intern/subsurf_ccg.c intern/suggestions.c intern/text.c @@ -220,6 +221,7 @@ set(SRC BKE_smoke.h BKE_softbody.h BKE_sound.h + BKE_speaker.h BKE_subsurf.h BKE_suggestions.h BKE_text.h diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 85f87992c28..8668168936b 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -109,6 +109,7 @@ #include "BKE_particle.h" #include "BKE_gpencil.h" #include "BKE_fcurve.h" +#include "BKE_speaker.h" #include "RNA_access.h" diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 66bf4ea208b..a615bc42f66 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -56,7 +56,6 @@ #include "DNA_sequence_types.h" #include "DNA_sound_types.h" #include "DNA_space_types.h" -#include "DNA_speaker_types.h" #include "DNA_view3d_types.h" #include "DNA_world_types.h" @@ -98,6 +97,7 @@ #include "BKE_sca.h" #include "BKE_scene.h" #include "BKE_sequencer.h" +#include "BKE_speaker.h" #include "BKE_softbody.h" #include "BKE_material.h" @@ -977,99 +977,6 @@ void free_lamp(Lamp *la) la->id.icon_id = 0; } -void *add_speaker(const char *name) -{ - Speaker *spk; - - spk= alloc_libblock(&G.main->speaker, ID_SPK, name); - - spk->attenuation = 1.0f; - spk->cone_angle_inner = 360.0f; - spk->cone_angle_outer = 360.0f; - spk->cone_volume_outer = 1.0f; - spk->distance_max = FLT_MAX; - spk->distance_reference = 1.0f; - spk->flag = 0; - spk->pitch = 1.0f; - spk->sound = NULL; - spk->volume = 1.0f; - spk->volume_max = 1.0f; - spk->volume_min = 0.0f; - - return spk; -} - -Speaker *copy_speaker(Speaker *spk) -{ - Speaker *spkn; - - spkn= copy_libblock(spk); - if(spkn->sound) - spkn->sound->id.us++; - - return spkn; -} - -void make_local_speaker(Speaker *spk) -{ - Main *bmain= G.main; - Object *ob; - int local=0, lib=0; - - /* - only lib users: do nothing - * - only local users: set flag - * - mixed: make copy - */ - - if(spk->id.lib==NULL) return; - if(spk->id.us==1) { - spk->id.lib= NULL; - spk->id.flag= LIB_LOCAL; - new_id(&bmain->speaker, (ID *)spk, NULL); - return; - } - - ob= bmain->object.first; - while(ob) { - if(ob->data==spk) { - if(ob->id.lib) lib= 1; - else local= 1; - } - ob= ob->id.next; - } - - if(local && lib==0) { - spk->id.lib= NULL; - spk->id.flag= LIB_LOCAL; - new_id(&bmain->speaker, (ID *)spk, NULL); - } - else if(local && lib) { - Speaker *spkn= copy_speaker(spk); - spkn->id.us= 0; - - ob= bmain->object.first; - while(ob) { - if(ob->data==spk) { - - if(ob->id.lib==NULL) { - ob->data= spkn; - spkn->id.us++; - spk->id.us--; - } - } - ob= ob->id.next; - } - } -} - -void free_speaker(Speaker *spk) -{ - if(spk->sound) - spk->sound->id.us--; - - BKE_free_animdata((ID *)spk); -} - /* *************************************************** */ static void *add_obdata_from_type(int type) diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c new file mode 100644 index 00000000000..200dbd41899 --- /dev/null +++ b/source/blender/blenkernel/intern/speaker.c @@ -0,0 +1,139 @@ +/* speaker.c + * + * + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Jörg Müller. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/blenkernel/intern/speaker.c + * \ingroup bke + */ + +#include "DNA_object_types.h" +#include "DNA_sound_types.h" +#include "DNA_speaker_types.h" + +#include "BLI_math.h" + +#include "BKE_animsys.h" +#include "BKE_global.h" +#include "BKE_library.h" +#include "BKE_main.h" +#include "BKE_speaker.h" + +void *add_speaker(const char *name) +{ + Speaker *spk; + + spk= alloc_libblock(&G.main->speaker, ID_SPK, name); + + spk->attenuation = 1.0f; + spk->cone_angle_inner = 360.0f; + spk->cone_angle_outer = 360.0f; + spk->cone_volume_outer = 1.0f; + spk->distance_max = FLT_MAX; + spk->distance_reference = 1.0f; + spk->flag = 0; + spk->pitch = 1.0f; + spk->sound = NULL; + spk->volume = 1.0f; + spk->volume_max = 1.0f; + spk->volume_min = 0.0f; + + return spk; +} + +Speaker *copy_speaker(Speaker *spk) +{ + Speaker *spkn; + + spkn= copy_libblock(spk); + if(spkn->sound) + spkn->sound->id.us++; + + return spkn; +} + +void make_local_speaker(Speaker *spk) +{ + Main *bmain= G.main; + Object *ob; + int local=0, lib=0; + + /* - only lib users: do nothing + * - only local users: set flag + * - mixed: make copy + */ + + if(spk->id.lib==NULL) return; + if(spk->id.us==1) { + spk->id.lib= NULL; + spk->id.flag= LIB_LOCAL; + new_id(&bmain->speaker, (ID *)spk, NULL); + return; + } + + ob= bmain->object.first; + while(ob) { + if(ob->data==spk) { + if(ob->id.lib) lib= 1; + else local= 1; + } + ob= ob->id.next; + } + + if(local && lib==0) { + spk->id.lib= NULL; + spk->id.flag= LIB_LOCAL; + new_id(&bmain->speaker, (ID *)spk, NULL); + } + else if(local && lib) { + Speaker *spkn= copy_speaker(spk); + spkn->id.us= 0; + + ob= bmain->object.first; + while(ob) { + if(ob->data==spk) { + + if(ob->id.lib==NULL) { + ob->data= spkn; + spkn->id.us++; + spk->id.us--; + } + } + ob= ob->id.next; + } + } +} + +void free_speaker(Speaker *spk) +{ + if(spk->sound) + spk->sound->id.us--; + + BKE_free_animdata((ID *)spk); +} -- cgit v1.2.3 From 900928f8bf47b8f1bbb1b2cd863d2d9649c940a0 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 4 Aug 2011 14:13:05 +0000 Subject: Bassam Feature Request: "Auto Clamped" handles can now be set per handle/key This used to be a weird per-curve setting which would happen to get applied/work correctly if handles were set to "auto", and was a source of constant confusion for both old and new animators. The main effect of this handle-type/option was really to just ensure that auto-handles stayed horizontal, instead of tilting as the keys were moved. This commit simply changes this from a per-curve to per keyframe/handle setting. --- source/blender/blenkernel/intern/curve.c | 10 +++++----- source/blender/blenkernel/intern/fcurve.c | 11 ++++------- source/blender/blenkernel/intern/ipo.c | 13 ++++++++++++- source/blender/blenkernel/intern/nla.c | 4 ++-- 4 files changed, 23 insertions(+), 15 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index eb364af6ff8..2f1a85c57b3 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -2473,7 +2473,7 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) if(len2==0.0f) len2=1.0f; - if(bezt->h1==HD_AUTO || bezt->h2==HD_AUTO) { /* auto */ + if(ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM) || ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) { /* auto */ vx= dx1/len2 + dx/len1; vy= dy1/len2 + dy/len1; vz= dz1/len2 + dz/len1; @@ -2484,13 +2484,13 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) if(len1>5.0f*len2) len1= 5.0f*len2; if(len2>5.0f*len1) len2= 5.0f*len1; - if(bezt->h1==HD_AUTO) { + if(ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM)) { len1/=len; *(p2-3)= *p2-vx*len1; *(p2-2)= *(p2+1)-vy*len1; *(p2-1)= *(p2+2)-vz*len1; - if(mode==2 && next && prev) { // keep horizontal if extrema + if((bezt->h1==HD_AUTO_ANIM) && next && prev) { // keep horizontal if extrema float ydiff1= prev->vec[1][1] - bezt->vec[1][1]; float ydiff2= next->vec[1][1] - bezt->vec[1][1]; if( (ydiff1 <= 0.0f && ydiff2 <= 0.0f) || (ydiff1 >= 0.0f && ydiff2 >= 0.0f) ) { @@ -2512,13 +2512,13 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) } } } - if(bezt->h2==HD_AUTO) { + if(ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) { len2/=len; *(p2+3)= *p2+vx*len2; *(p2+4)= *(p2+1)+vy*len2; *(p2+5)= *(p2+2)+vz*len2; - if(mode==2 && next && prev) { // keep horizontal if extrema + if((bezt->h2==HD_AUTO_ANIM) && next && prev) { // keep horizontal if extrema float ydiff1= prev->vec[1][1] - bezt->vec[1][1]; float ydiff2= next->vec[1][1] - bezt->vec[1][1]; if( (ydiff1 <= 0.0f && ydiff2 <= 0.0f) || (ydiff1 >= 0.0f && ydiff2 >= 0.0f) ) { diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index aa8f817ae3c..28f17b3cf86 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -792,13 +792,10 @@ void calchandles_fcurve (FCurve *fcu) if (bezt->vec[2][0] < bezt->vec[1][0]) bezt->vec[2][0]= bezt->vec[1][0]; /* calculate auto-handles */ - if (fcu->flag & FCURVE_AUTO_HANDLES) - calchandleNurb(bezt, prev, next, 2); /* 2==special autohandle && keep extrema horizontal */ - else - calchandleNurb(bezt, prev, next, 1); /* 1==special autohandle */ + calchandleNurb(bezt, prev, next, 1); /* 1==special autohandle */ /* for automatic ease in and out */ - if ((bezt->h1==HD_AUTO) && (bezt->h2==HD_AUTO)) { + if (ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM) && ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) { /* only do this on first or last beztriple */ if ((a == 0) || (a == fcu->totvert-1)) { /* set both handles to have same horizontal value as keyframe */ @@ -846,9 +843,9 @@ void testhandles_fcurve (FCurve *fcu) /* one or two handles selected only */ if (ELEM(flag, 0, 7)==0) { /* auto handles become aligned */ - if (bezt->h1==HD_AUTO) + if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM)) bezt->h1= HD_ALIGN; - if (bezt->h2==HD_AUTO) + if (ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM)) bezt->h2= HD_ALIGN; /* vector handles become 'free' when only one half selected */ diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 104ce2b3b32..d41a3a36b2d 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1157,7 +1157,6 @@ static void icu_to_fcurves (ID *id, ListBase *groups, ListBase *list, IpoCurve * if (icu->flag & IPO_ACTIVE) fcu->flag |= FCURVE_ACTIVE; if (icu->flag & IPO_MUTE) fcu->flag |= FCURVE_MUTED; if (icu->flag & IPO_PROTECT) fcu->flag |= FCURVE_PROTECTED; - if (icu->flag & IPO_AUTO_HORIZ) fcu->flag |= FCURVE_AUTO_HANDLES; /* set extrapolation */ switch (icu->extrap) { @@ -1242,6 +1241,12 @@ static void icu_to_fcurves (ID *id, ListBase *groups, ListBase *list, IpoCurve * /* 'hide' flag is now used for keytype - only 'keyframes' existed before */ dst->hide= BEZT_KEYTYPE_KEYFRAME; + /* auto-handles - per curve to per handle */ + if (icu->flag & IPO_AUTO_HORIZ) { + if (dst->h1 == HD_AUTO) dst->h1 = HD_AUTO_ANIM; + if (dst->h2 == HD_AUTO) dst->h2 = HD_AUTO_ANIM; + } + /* correct values, by checking if the flag of interest is set */ if ( ((int)(dst->vec[1][1])) & (abp->bit) ) dst->vec[0][1]= dst->vec[1][1]= dst->vec[2][1] = 1.0f; @@ -1292,6 +1297,12 @@ static void icu_to_fcurves (ID *id, ListBase *groups, ListBase *list, IpoCurve * /* 'hide' flag is now used for keytype - only 'keyframes' existed before */ dst->hide= BEZT_KEYTYPE_KEYFRAME; + + /* auto-handles - per curve to per handle */ + if (icu->flag & IPO_AUTO_HORIZ) { + if (dst->h1 == HD_AUTO) dst->h1 = HD_AUTO_ANIM; + if (dst->h2 == HD_AUTO) dst->h2 = HD_AUTO_ANIM; + } /* correct values for euler rotation curves * - they were degrees/10 diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 8391e9f6ab1..f2ce8e4e6f1 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1185,7 +1185,7 @@ void BKE_nlastrip_validate_fcurves (NlaStrip *strip) BLI_addtail(&strip->fcurves, fcu); /* set default flags */ - fcu->flag = (FCURVE_VISIBLE|FCURVE_AUTO_HANDLES|FCURVE_SELECTED); + fcu->flag = (FCURVE_VISIBLE|FCURVE_SELECTED); /* store path - make copy, and store that */ fcu->rna_path= BLI_strdupn("influence", 9); @@ -1206,7 +1206,7 @@ void BKE_nlastrip_validate_fcurves (NlaStrip *strip) BLI_addtail(&strip->fcurves, fcu); /* set default flags */ - fcu->flag = (FCURVE_VISIBLE|FCURVE_AUTO_HANDLES|FCURVE_SELECTED); + fcu->flag = (FCURVE_VISIBLE|FCURVE_SELECTED); /* store path - make copy, and store that */ fcu->rna_path= BLI_strdupn("strip_time", 10); -- cgit v1.2.3 From dca090abc87fc57cb0a98bbe07ea8868f04f8c97 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 5 Aug 2011 11:23:28 +0000 Subject: Assorted loose ends for auto-clamped handles work * Tweaked order of handle types to make it easier to find Auto/Auto- clamped in the list * Fixed a number of places which were still just checking for auto- handles when they should have included auto-clamped too, including handle rotation --- source/blender/blenkernel/intern/curve.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 2f1a85c57b3..b1beb6c449a 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -2674,15 +2674,15 @@ void testhandlesNurb(Nurb *nu) if(bezt->f1 & SELECT) flag++; if(bezt->f2 & SELECT) flag += 2; if(bezt->f3 & SELECT) flag += 4; - + if( !(flag==0 || flag==7) ) { - if(bezt->h1==HD_AUTO) { /* auto */ + if(ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM)) { /* auto */ bezt->h1= HD_ALIGN; } - if(bezt->h2==HD_AUTO) { /* auto */ + if(ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM)) { /* auto */ bezt->h2= HD_ALIGN; } - + if(bezt->h1==HD_VECT) { /* vector */ if(flag < 4) bezt->h1= 0; } @@ -2692,7 +2692,7 @@ void testhandlesNurb(Nurb *nu) } bezt++; } - + calchandlesNurb(nu); } -- cgit v1.2.3 From 2d884fc035d403d43c7a18e3e61cd56ccdfbec2b Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sun, 7 Aug 2011 11:54:58 +0000 Subject: 3D Audio GSoC: * Pepper depends on ffmpeg 0.7.1 or higher now, windows and mac build systems set to ffmpeg-0.8 * Fixed orientation retrieval in OpenAL device code. * Added stopAll() method to AUD_IDevice (also for Python) and call it on BGE exit * Changed BGE to use audaspace via native C++ instead over the C API. * Made AUD_SequencerFactory and AUD_SequencerEntry thread safe. * Changed sound caching into a flag which fixes problems on file loading, especially with undo. * Removed unused parameter from sound_mute_scene_sound * Fixed bug: changing FPS didn't update the sequencer sound positions. * Fixed bug: Properties of sequencer strips weren't set correctly. * Minor warning fixes. --- source/blender/blenkernel/BKE_sequencer.h | 3 ++- source/blender/blenkernel/BKE_sound.h | 6 ++--- source/blender/blenkernel/intern/sequencer.c | 36 ++++++++++++++++++++++------ source/blender/blenkernel/intern/sound.c | 35 ++++++++++++++++++++------- 4 files changed, 61 insertions(+), 19 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index cebf99097aa..773096d1e0d 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -282,8 +282,9 @@ void free_imbuf_seq(struct Scene *scene, struct ListBase * seqbasep, int check_m struct Sequence *seq_dupli_recursive(struct Scene *scene, struct Scene *scene_to, struct Sequence * seq, int dupe_flag); int seq_swap(struct Sequence *seq_a, struct Sequence *seq_b, const char **error_str); +void seq_update_sound_bounds_all(struct Scene *scene); void seq_update_sound_bounds(struct Scene* scene, struct Sequence *seq); -void seq_update_muting(struct Scene* scene, struct Editing *ed); +void seq_update_muting(struct Editing *ed); void seq_update_sound(struct Scene *scene, struct bSound *sound); void seqbase_sound_reload(struct Scene *scene, ListBase *seqbase); void seqbase_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq); diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index 632a2a0bb3b..2cd006385e0 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -62,9 +62,9 @@ struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, floa void sound_delete(struct bContext *C, struct bSound* sound); -void sound_cache(struct bSound* sound, int ignore); +void sound_cache(struct bSound* sound); -void sound_cache_notifying(struct Main* main, struct bSound* sound, int ignore); +void sound_cache_notifying(struct Main* main, struct bSound* sound); void sound_delete_cache(struct bSound* sound); @@ -92,7 +92,7 @@ void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int void sound_remove_scene_sound(struct Scene *scene, void* handle); -void sound_mute_scene_sound(struct Scene *scene, void* handle, char mute); +void sound_mute_scene_sound(void* handle, char mute); void sound_move_scene_sound(struct Scene *scene, void* handle, int startframe, int endframe, int frameskip); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 9ff3ce7afe2..93e0c920745 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -3145,6 +3145,28 @@ int shuffle_seq_time(ListBase * seqbasep, Scene *evil_scene) return offset? 0:1; } +void seq_update_sound_bounds_all(Scene *scene) +{ + Editing *ed = scene->ed; + + if(ed) + { + Sequence *seq; + + for(seq = ed->seqbase.first; seq; seq = seq->next) + { + if(seq->type == SEQ_META) + { + seq_update_sound_bounds_recursive(scene, seq); + } + else if(ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) + { + seq_update_sound_bounds(scene, seq); + } + } + } +} + void seq_update_sound_bounds(Scene* scene, Sequence *seq) { if(seq->scene_sound) @@ -3154,7 +3176,7 @@ void seq_update_sound_bounds(Scene* scene, Sequence *seq) } } -static void seq_update_muting_recursive(Scene *scene, ListBase *seqbasep, Sequence *metaseq, int mute) +static void seq_update_muting_recursive(ListBase *seqbasep, Sequence *metaseq, int mute) { Sequence *seq; int seqmute; @@ -3170,26 +3192,26 @@ static void seq_update_muting_recursive(Scene *scene, ListBase *seqbasep, Sequen if(seq == metaseq) seqmute= 0; - seq_update_muting_recursive(scene, &seq->seqbase, metaseq, seqmute); + seq_update_muting_recursive(&seq->seqbase, metaseq, seqmute); } else if(ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) { if(seq->scene_sound) { - sound_mute_scene_sound(scene, seq->scene_sound, seqmute); + sound_mute_scene_sound(seq->scene_sound, seqmute); } } } } -void seq_update_muting(Scene *scene, Editing *ed) +void seq_update_muting(Editing *ed) { if(ed) { /* mute all sounds up to current metastack list */ MetaStack *ms= ed->metastack.last; if(ms) - seq_update_muting_recursive(scene, &ed->seqbase, ms->parseq, 1); + seq_update_muting_recursive(&ed->seqbase, ms->parseq, 1); else - seq_update_muting_recursive(scene, &ed->seqbase, NULL, 0); + seq_update_muting_recursive(&ed->seqbase, NULL, 0); } } @@ -3469,7 +3491,7 @@ void seq_load_apply(Scene *scene, Sequence *seq, SeqLoadInfo *seq_load) if(seq_load->flag & SEQ_LOAD_SOUND_CACHE) { if(seq->sound) - sound_cache(seq->sound, 0); + sound_cache(seq->sound); } seq_load->tot_success++; diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 59f5cdb678e..890fc114e68 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -91,6 +91,7 @@ void sound_free(struct bSound* sound) if(sound->cache) { AUD_unload(sound->cache); + sound->cache = NULL; } #endif // WITH_AUDASPACE } @@ -250,23 +251,25 @@ void sound_delete(struct bContext *C, struct bSound* sound) } } -void sound_cache(struct bSound* sound, int ignore) +void sound_cache(struct bSound* sound) { - if(sound->cache && !ignore) + sound->flags |= SOUND_FLAGS_CACHING; + if(sound->cache) AUD_unload(sound->cache); sound->cache = AUD_bufferSound(sound->handle); sound->playback_handle = sound->cache; } -void sound_cache_notifying(struct Main* main, struct bSound* sound, int ignore) +void sound_cache_notifying(struct Main* main, struct bSound* sound) { - sound_cache(sound, ignore); + sound_cache(sound); sound_update_sequencer(main, sound); } void sound_delete_cache(struct bSound* sound) { + sound->flags &= ~SOUND_FLAGS_CACHING; if(sound->cache) { AUD_unload(sound->cache); @@ -279,6 +282,12 @@ void sound_load(struct Main *bmain, struct bSound* sound) { if(sound) { + if(sound->cache) + { + AUD_unload(sound->cache); + sound->cache = NULL; + } + if(sound->handle) { AUD_unload(sound->handle); @@ -330,6 +339,11 @@ void sound_load(struct Main *bmain, struct bSound* sound) break; } #endif + if(sound->flags & SOUND_FLAGS_CACHING) + { + sound->cache = AUD_bufferSound(sound->handle); + } + if(sound->cache) sound->playback_handle = sound->cache; else @@ -400,7 +414,12 @@ void* sound_scene_add_scene_sound(struct Scene *scene, struct Sequence* sequence void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip) { - return AUD_addSequence(scene->sound_scene, sequence->sound->playback_handle, startframe / FPS, endframe / FPS, frameskip / FPS); + void* handle = AUD_addSequence(scene->sound_scene, sequence->sound->playback_handle, startframe / FPS, endframe / FPS, frameskip / FPS); + AUD_muteSequence(handle, (sequence->flag & SEQ_MUTE) != 0); + AUD_setSequenceAnimData(handle, AUD_AP_VOLUME, CFRA, &sequence->volume, 0); + AUD_setSequenceAnimData(handle, AUD_AP_PITCH, CFRA, &sequence->pitch, 0); + AUD_setSequenceAnimData(handle, AUD_AP_PANNING, CFRA, &sequence->pan, 0); + return handle; } void sound_remove_scene_sound(struct Scene *scene, void* handle) @@ -408,7 +427,7 @@ void sound_remove_scene_sound(struct Scene *scene, void* handle) AUD_removeSequence(scene->sound_scene, handle); } -void sound_mute_scene_sound(struct Scene *scene, void* handle, char mute) +void sound_mute_scene_sound(void* handle, char mute) { AUD_muteSequence(handle, mute); } @@ -612,7 +631,7 @@ void sound_force_device(int UNUSED(device)) {} void sound_init_once(void) {} void sound_init(struct Main *UNUSED(bmain)) {} void sound_exit(void) {} -void sound_cache(struct bSound* UNUSED(sound), int UNUSED(ignore)) { } +void sound_cache(struct bSound* UNUSED(sound)) { } void sound_delete_cache(struct bSound* UNUSED(sound)) {} void sound_load(struct Main *UNUSED(bmain), struct bSound* UNUSED(sound)) {} void sound_create_scene(struct Scene *UNUSED(scene)) {} @@ -621,7 +640,7 @@ void sound_mute_scene(struct Scene *UNUSED(scene), int UNUSED(muted)) {} void* sound_scene_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; } void* sound_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; } void sound_remove_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle)) {} -void sound_mute_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), char UNUSED(mute)) {} +void sound_mute_scene_sound(void* UNUSED(handle), char UNUSED(mute)) {} void sound_move_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) {} static void sound_start_play_scene(struct Scene *UNUSED(scene)) {} void sound_play_scene(struct Scene *UNUSED(scene)) {} -- cgit v1.2.3 From 022e815fbd6d81f9b1baa177cce1abf2f42bcb21 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 7 Aug 2011 12:27:20 +0000 Subject: Sound clip NLA Strips for Nexyon These are basically just for specifying when a speaker should fire off it's soundclip, and as such, many NLA operations are irrelevant for it. They can only be specified on object-level for speaker objects. I've still got some UI tweaks I'll need to work on in order for these to be able to be added even when the speaker doesn't have any NLA tracks yet. (EDIT: while typing this, I had an idea for how to do this, but that'll be for next commit). In the mean time, you'll need to add a single keyframe for the object, snowflake that action and delete the NLA strip before you can start editing. --- source/blender/blenkernel/BKE_nla.h | 3 +++ source/blender/blenkernel/intern/anim_sys.c | 3 +++ source/blender/blenkernel/intern/nla.c | 40 +++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 0206756a1ad..49c1f8acd24 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -39,6 +39,8 @@ struct AnimData; struct NlaStrip; struct NlaTrack; struct bAction; +struct Scene; +struct Speaker; /* ----------------------------- */ /* Data Management */ @@ -54,6 +56,7 @@ void copy_nladata(ListBase *dst, ListBase *src); struct NlaTrack *add_nlatrack(struct AnimData *adt, struct NlaTrack *prev); struct NlaStrip *add_nlastrip(struct bAction *act); struct NlaStrip *add_nlastrip_to_stack(struct AnimData *adt, struct bAction *act); +struct NlaStrip *add_nla_soundstrip(struct Scene *scene, struct Speaker *spk); /* ----------------------------- */ /* API */ diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index a43cdc8143e..832d13c9c2f 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1921,6 +1921,9 @@ void nlastrip_evaluate (PointerRNA *ptr, ListBase *channels, ListBase *modifiers case NLASTRIP_TYPE_META: /* meta */ nlastrip_evaluate_meta(ptr, channels, modifiers, nes); break; + + default: /* do nothing */ + break; } /* clear temp recursion safe-check */ diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index f2ce8e4e6f1..dad49646622 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -46,6 +46,8 @@ #include "DNA_anim_types.h" #include "DNA_scene_types.h" +#include "DNA_sound_types.h" +#include "DNA_speaker_types.h" #include "BKE_action.h" #include "BKE_fcurve.h" @@ -53,6 +55,9 @@ #include "BKE_global.h" #include "BKE_library.h" +#ifdef WITH_AUDASPACE +# include "AUD_C-API.h" +#endif #include "RNA_access.h" #include "nla_private.h" @@ -337,6 +342,41 @@ NlaStrip *add_nlastrip_to_stack (AnimData *adt, bAction *act) return strip; } +/* Add a NLA Strip referencing the given speaker's sound */ +NlaStrip *add_nla_soundstrip (Scene *scene, Speaker *speaker) +{ + NlaStrip *strip = MEM_callocN(sizeof(NlaStrip), "NlaSoundStrip"); + + /* if speaker has a sound, set the strip length to the length of the sound, + * otherwise default to length of 10 frames + */ +#ifdef WITH_AUDASPACE + if (speaker->sound) + { + AUD_SoundInfo info = AUD_getInfo(speaker->sound->playback_handle); + + strip->end = ceil(info.length * FPS); + } + else +#endif + { + strip->end = 10.0f; + } + + /* general settings */ + strip->type = NLASTRIP_TYPE_SOUND; + + strip->flag = NLASTRIP_FLAG_SELECT; + strip->extendmode = NLASTRIP_EXTEND_NOTHING; /* nothing to extend... */ + + /* strip should be referenced as-is */ + strip->scale= 1.0f; + strip->repeat = 1.0f; + + /* return this strip */ + return strip; +} + /* *************************************************** */ /* NLA Evaluation <-> Editing Stuff */ -- cgit v1.2.3 From 13249b925eda7752b65a36d8270a3af3bdc02981 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Tue, 9 Aug 2011 08:38:14 +0000 Subject: 3D Audio GSoC: Speaker objects fully functional! Minor changes: * Fixed three memory bugs found via valgrind. * Fixed bug with jack transport crashing after file loading. * Sound NLA Strips now start at CFRA instead of 0. --- source/blender/blenkernel/BKE_sound.h | 4 ++ source/blender/blenkernel/intern/blender.c | 3 + source/blender/blenkernel/intern/library.c | 2 +- source/blender/blenkernel/intern/scene.c | 3 + source/blender/blenkernel/intern/sound.c | 88 +++++++++++++++++++++++++++++- 5 files changed, 98 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index 2cd006385e0..c36532ee4cc 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -46,6 +46,8 @@ void sound_init_once(void); void sound_init(struct Main *main); +void sound_init_main(struct Main *bmain); + void sound_exit(void); void sound_force_device(int device); @@ -124,6 +126,8 @@ int sound_read_sound_buffer(struct bSound* sound, float* buffer, int length, flo int sound_get_channels(struct bSound* sound); +void sound_update_scene(struct Main* bmain, struct Scene* scene); + void* sound_get_factory(void* sound); #endif diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index a3a4c5b555b..5f33059e117 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -82,6 +82,7 @@ #include "BKE_scene.h" #include "BKE_screen.h" #include "BKE_sequencer.h" +#include "BKE_sound.h" #include "BLO_undofile.h" @@ -247,6 +248,8 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath G.main= bfd->main; CTX_data_main_set(C, G.main); + + sound_init_main(G.main); if (bfd->user) { diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 8668168936b..c362f3eb2fe 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -533,7 +533,6 @@ int set_listbasepointers(Main *main, ListBase **lb) lb[a++]= &(main->latt); lb[a++]= &(main->lamp); lb[a++]= &(main->camera); - lb[a++]= &(main->speaker); lb[a++]= &(main->text); lb[a++]= &(main->sound); @@ -541,6 +540,7 @@ int set_listbasepointers(Main *main, ListBase **lb) lb[a++]= &(main->brush); lb[a++]= &(main->script); lb[a++]= &(main->particle); + lb[a++]= &(main->speaker); lb[a++]= &(main->world); lb[a++]= &(main->screen); diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 74126fd57a1..12e81e8296e 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -966,6 +966,9 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen /* scene drivers... */ scene_update_drivers(bmain, scene); + + /* update sound system animation */ + sound_update_scene(bmain, scene); } /* this is called in main loop, doing tagged updates before redraw */ diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 890fc114e68..17df6ba23cb 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -13,13 +13,16 @@ #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" +#include "BLI_math.h" #include "DNA_anim_types.h" +#include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_sequence_types.h" #include "DNA_packedFile_types.h" #include "DNA_screen_types.h" #include "DNA_sound_types.h" +#include "DNA_speaker_types.h" #ifdef WITH_AUDASPACE # include "AUD_C-API.h" @@ -175,7 +178,12 @@ void sound_init(struct Main *bmain) if(!AUD_init(device, specs, buffersize)) AUD_init(AUD_NULL_DEVICE, specs, buffersize); - + + sound_init_main(bmain); +} + +void sound_init_main(struct Main *bmain) +{ #ifdef WITH_JACK AUD_setSyncCallback(sound_sync_callback, bmain); #else @@ -617,6 +625,84 @@ int sound_get_channels(struct bSound* sound) return info.specs.channels; } +void sound_update_scene(struct Main* bmain, struct Scene* scene) +{ + Object* ob; + NlaTrack* track; + NlaStrip* strip; + Speaker* speaker; + + void* new_set = AUD_createSet(); + void* handle; + float quat[4]; + + for(ob = bmain->object.first; ob; ob = ob->id.next) + { + if(ob->type == OB_SPEAKER) + { + if(ob->adt) + { + for(track = ob->adt->nla_tracks.first; track; track = track->next) + { + for(strip = track->strips.first; strip; strip = strip->next) + { + if(strip->type == NLASTRIP_TYPE_SOUND) + { + speaker = (Speaker*)ob->data; + + if(AUD_removeSet(scene->speaker_handles, strip->speaker_handle)) + { + AUD_moveSequence(strip->speaker_handle, strip->start / FPS, -1, 0); + } + else + { + if(speaker && speaker->sound) + { + strip->speaker_handle = AUD_addSequence(scene->sound_scene, speaker->sound->playback_handle, strip->start / FPS, -1, 0); + AUD_setRelativeSequence(strip->speaker_handle, 0); + } + } + + if(strip->speaker_handle) + { + AUD_addSet(new_set, strip->speaker_handle); + AUD_updateSequenceData(strip->speaker_handle, speaker->volume_max, + speaker->volume_min, speaker->distance_max, + speaker->distance_reference, speaker->attenuation, + speaker->cone_angle_outer, speaker->cone_angle_inner, + speaker->cone_volume_outer); + + mat4_to_quat(quat, ob->obmat); + AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_LOCATION, CFRA, ob->obmat[3], 1); + AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_ORIENTATION, CFRA, quat, 1); + AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_VOLUME, CFRA, &speaker->volume, 1); + AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_PITCH, CFRA, &speaker->pitch, 1); + AUD_updateSequenceSound(strip->speaker_handle, speaker->sound->playback_handle); + AUD_muteSequence(strip->speaker_handle, ((strip->flag & NLASTRIP_FLAG_MUTED) != 0) || ((speaker->flag & SPK_MUTED) != 0)); + } + } + } + } + } + } + } + + while((handle = AUD_getSet(scene->speaker_handles))) + { + AUD_removeSequence(scene->sound_scene, handle); + } + + if(scene->camera) + { + mat4_to_quat(quat, scene->camera->obmat); + AUD_setSequencerAnimData(scene->sound_scene, AUD_AP_LOCATION, CFRA, scene->camera->obmat[3], 1); + AUD_setSequencerAnimData(scene->sound_scene, AUD_AP_ORIENTATION, CFRA, quat, 1); + } + + AUD_destroySet(scene->speaker_handles); + scene->speaker_handles = new_set; +} + void* sound_get_factory(void* sound) { return ((struct bSound*) sound)->playback_handle; -- cgit v1.2.3 From a672ab5e737202bede956a88357a96cf2728df15 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Tue, 9 Aug 2011 14:10:32 +0000 Subject: 3D Audio GSoC: Improved waveform drawing in the sequencer. * Drawing the waveform of a sequencer strip is now independent from whether the sound is cached or not. * Improved drawing of the waveform in the sequencer (especially speed!). * Making it possible to vertically zoom more in the sequencer to better see the waveform for lipsync. * Fixed a bug which crashed blender on loading a sound file via ffmpeg. --- source/blender/blenkernel/BKE_sound.h | 12 ++++++++++- source/blender/blenkernel/intern/sound.c | 35 +++++++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 6 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index c36532ee4cc..ecf0d7e459a 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -35,6 +35,8 @@ * \author nzc */ +#define SOUND_WAVE_SAMPLES_PER_SECOND 250 + struct PackedFile; struct bSound; struct bContext; @@ -42,6 +44,12 @@ struct ListBase; struct Main; struct Sequence; +typedef struct SoundWaveform +{ + int length; + float *data; +} SoundWaveform; + void sound_init_once(void); void sound_init(struct Main *main); @@ -122,7 +130,9 @@ float sound_sync_scene(struct Scene *scene); int sound_scene_playing(struct Scene *scene); -int sound_read_sound_buffer(struct bSound* sound, float* buffer, int length, float start, float end); +void sound_free_waveform(struct bSound* sound); + +void sound_read_waveform(struct bSound* sound); int sound_get_channels(struct bSound* sound); diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 17df6ba23cb..888c719a304 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -24,6 +24,7 @@ #include "DNA_sound_types.h" #include "DNA_speaker_types.h" +#define WITH_AUDASPACE #ifdef WITH_AUDASPACE # include "AUD_C-API.h" #endif @@ -96,6 +97,8 @@ void sound_free(struct bSound* sound) AUD_unload(sound->cache); sound->cache = NULL; } + + sound_free_waveform(sound); #endif // WITH_AUDASPACE } @@ -608,12 +611,34 @@ int sound_scene_playing(struct Scene *scene) return -1; } -int sound_read_sound_buffer(struct bSound* sound, float* buffer, int length, float start, float end) +void sound_free_waveform(struct bSound* sound) +{ + if(sound->waveform) + { + MEM_freeN(((SoundWaveform*)sound->waveform)->data); + MEM_freeN(sound->waveform); + } + + sound->waveform = NULL; +} + +void sound_read_waveform(struct bSound* sound) { - AUD_Sound* limiter = AUD_limitSound(sound->cache, start, end); - int ret= AUD_readSound(limiter, buffer, length); - AUD_unload(limiter); - return ret; + AUD_SoundInfo info; + + info = AUD_getInfo(sound->playback_handle); + + if(info.length > 0) + { + SoundWaveform* waveform = MEM_mallocN(sizeof(SoundWaveform), "SoundWaveform");; + int length = info.length * SOUND_WAVE_SAMPLES_PER_SECOND; + + waveform->data = MEM_mallocN(length * sizeof(float) * 3, "SoundWaveform.samples"); + waveform->length = AUD_readSound(sound->playback_handle, waveform->data, length, SOUND_WAVE_SAMPLES_PER_SECOND); + + sound_free_waveform(sound); + sound->waveform = waveform; + } } int sound_get_channels(struct bSound* sound) -- cgit v1.2.3 From 8655385c9edb5e61416018406f8a3fe3b8e7d141 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Tue, 9 Aug 2011 14:34:42 +0000 Subject: Fix for last commit: MSVC dislikes ;; --- source/blender/blenkernel/intern/sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 888c719a304..80cb2072357 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -630,7 +630,7 @@ void sound_read_waveform(struct bSound* sound) if(info.length > 0) { - SoundWaveform* waveform = MEM_mallocN(sizeof(SoundWaveform), "SoundWaveform");; + SoundWaveform* waveform = MEM_mallocN(sizeof(SoundWaveform), "SoundWaveform"); int length = info.length * SOUND_WAVE_SAMPLES_PER_SECOND; waveform->data = MEM_mallocN(length * sizeof(float) * 3, "SoundWaveform.samples"); -- cgit v1.2.3 From ef40d8e4f0c69f4a2da24ea6bd8ce560aa3b180a Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Tue, 9 Aug 2011 17:37:12 +0000 Subject: Another error in last bigger commit. --- source/blender/blenkernel/intern/sound.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 80cb2072357..1b09db84125 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -24,7 +24,6 @@ #include "DNA_sound_types.h" #include "DNA_speaker_types.h" -#define WITH_AUDASPACE #ifdef WITH_AUDASPACE # include "AUD_C-API.h" #endif -- cgit v1.2.3 From fee7337249342c3d5a332358883af9afe961f38d Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Thu, 11 Aug 2011 11:41:24 +0000 Subject: 3D Audio GSoC: Adding a mono flag to mixdown non-mono sounds for 3D audio. * Added mono sound loading. * Bugfix: AUD_COMPARE_SPECS usage was wrong. * Bugfix: JOS resampler = instead of ==. * Bugfix: Change of a sound should apply settings in AUD_SequencerHandle. * Bugfix: Memory leak when canceling open sound operator. --- source/blender/blenkernel/intern/sound.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 1b09db84125..9c62b92a924 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -349,6 +349,13 @@ void sound_load(struct Main *bmain, struct bSound* sound) break; } #endif + if(sound->flags & SOUND_FLAGS_MONO) + { + void* handle = AUD_monoSound(sound->handle); + AUD_unload(sound->handle); + sound->handle = handle; + } + if(sound->flags & SOUND_FLAGS_CACHING) { sound->cache = AUD_bufferSound(sound->handle); -- cgit v1.2.3 From db72192c22787fdf99bc7b20c6864b37b8e871f4 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 12 Aug 2011 07:20:49 +0000 Subject: Bye bye vile relics of extinct version control systems, Causing a flurry of refresh file prompts post-commit, Confusing local diffs and causing merge conflicts, Stating the obvious; redundant and useless... We shall not miss thou, blasted expand $keywords$ --- source/blender/blenkernel/BKE_action.h | 2 -- source/blender/blenkernel/BKE_anim.h | 2 -- source/blender/blenkernel/BKE_animsys.h | 2 -- source/blender/blenkernel/BKE_armature.h | 2 -- source/blender/blenkernel/BKE_constraint.h | 2 -- source/blender/blenkernel/BKE_nla.h | 2 -- source/blender/blenkernel/intern/action.c | 2 -- source/blender/blenkernel/intern/anim.c | 6 +----- source/blender/blenkernel/intern/anim_sys.c | 2 -- source/blender/blenkernel/intern/armature.c | 2 -- source/blender/blenkernel/intern/constraint.c | 2 -- source/blender/blenkernel/intern/fcurve.c | 2 -- source/blender/blenkernel/intern/fmodifier.c | 2 -- source/blender/blenkernel/intern/gpencil.c | 2 -- source/blender/blenkernel/intern/ipo.c | 5 +---- source/blender/blenkernel/intern/nla.c | 2 -- 16 files changed, 2 insertions(+), 37 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h index 7d3de68c005..67efb7752ea 100644 --- a/source/blender/blenkernel/BKE_action.h +++ b/source/blender/blenkernel/BKE_action.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/BKE_anim.h b/source/blender/blenkernel/BKE_anim.h index 25165eeaee7..44aebdf6205 100644 --- a/source/blender/blenkernel/BKE_anim.h +++ b/source/blender/blenkernel/BKE_anim.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h index bf619d76e68..98f9ee14c7e 100644 --- a/source/blender/blenkernel/BKE_animsys.h +++ b/source/blender/blenkernel/BKE_animsys.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h index efa87532859..7d60c00156d 100644 --- a/source/blender/blenkernel/BKE_armature.h +++ b/source/blender/blenkernel/BKE_armature.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h index ddff45c5422..925d1180dbd 100644 --- a/source/blender/blenkernel/BKE_constraint.h +++ b/source/blender/blenkernel/BKE_constraint.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 49c1f8acd24..773c5ced1cb 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index a6539f00605..9c2467505cd 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 7ddb078ef8e..b965d14af00 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1,8 +1,4 @@ -/* anim.c - * - * - * $Id$ - * +/* * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 832d13c9c2f..1c4746b1828 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 0b31e51d62e..62ce184a2d7 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index a321e718bbb..91091d3880f 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 28f17b3cf86..2e532222d5b 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index dcf81c19479..64e51023816 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index db0c9d2735f..c2e94cc97db 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index d41a3a36b2d..0d3f3cc5ae4 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1,7 +1,4 @@ -/* ipo.c - * - * $Id$ - * +/* * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index dad49646622..463f3bdd5cb 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or -- cgit v1.2.3 From a458de88b65c5fcb0f11c005c040163d3cf76cec Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Mon, 15 Aug 2011 21:50:09 +0000 Subject: 3D Audio GSoC: High quality resampling on mixdown, linear for playback. * Lots of improvements and fixes for the JOS resampler, now it works fine! * High quality filter coefficients for the JOS resampler (sorry for the 5 MB source file). * Fix for GE orientation bug. Note: moto uses x,y,z,w quaternion storage, while rest of blender uses w,x,y,z. * Minor changes/fixes. --- source/blender/blenkernel/intern/sound.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 9c62b92a924..d7385a86105 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -372,14 +372,7 @@ void sound_load(struct Main *bmain, struct bSound* sound) AUD_Device* sound_mixdown(struct Scene *scene, AUD_DeviceSpecs specs, int start, float volume) { - AUD_Device* mixdown = AUD_openReadDevice(specs); - - AUD_setDeviceVolume(mixdown, volume); - - AUD_setSequencerSpecs(scene->sound_scene, specs.specs); - AUD_freeHandle(AUD_playDevice(mixdown, scene->sound_scene, start / FPS)); - - return mixdown; + return AUD_openMixdownDevice(specs, scene->sound_scene, volume, start / FPS); } void sound_create_scene(struct Scene *scene) -- cgit v1.2.3 From a67562e73cbc2f4a9641fbc4d1147b4b2cc935c4 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 16 Aug 2011 01:02:26 +0000 Subject: Bugfix [#28267] keyframed values for shapekeys of copied objects are linked Shapekey actions weren't getting copied when their owner data was. This was due to the IMO totally convoluted way in which the duplicate action flags have been set up: - the function to copy animdata takes a param to specify whether actions are copied or not, but this is never touched (i.e. this always just gets FALSE passed in) - instead, we jump around in hoops later figuring out whether the userpref wants copying to occur, then fixing up the links IIRC, part of this may be due to a desire/need to not duplicate actions when dealing with NodeTree copies for multi-threaded rendering, but at the expense of complicating everything else. --- source/blender/blenkernel/intern/anim_sys.c | 2 +- source/blender/blenkernel/intern/fmodifier.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 1c4746b1828..3c6daf8b39d 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -287,7 +287,7 @@ int BKE_copy_animdata_id (ID *id_to, ID *id_from, const short do_action) return 1; } -void BKE_copy_animdata_id_action(struct ID *id) +void BKE_copy_animdata_id_action(ID *id) { AnimData *adt= BKE_animdata_from_id(id); if (adt) { diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index 64e51023816..42554679795 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -604,7 +604,7 @@ static float fcm_cycles_time (FCurve *fcu, FModifier *fcm, float UNUSED(cvalue), /* calculate the 'number' of the cycle */ cycle= ((float)side * (evaltime - ofs) / cycdx); - + /* calculate the time inside the cycle */ cyct= fmod(evaltime - ofs, cycdx); -- cgit v1.2.3 From 06ae5e48258dacc5598b23286d46891be32a08e5 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 22 Aug 2011 02:14:39 +0000 Subject: Reshuffling DopeSheet filter icons so that they appear more obviously related to each other --- source/blender/blenkernel/intern/fmodifier.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index 42554679795..95c0aa60991 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -629,11 +629,11 @@ static float fcm_cycles_time (FCurve *fcu, FModifier *fcm, float UNUSED(cvalue), cycyofs = (float)ceil((evaltime - ofs) / cycdx); cycyofs *= cycdy; } - + /* special case for cycle start/end */ if(cyct == 0.0f) { evaltime = (side == 1 ? lastkey[0] : prevkey[0]); - + if((mode == FCM_EXTRAPOLATE_MIRROR) && ((int)cycle % 2)) evaltime = (side == 1 ? prevkey[0] : lastkey[0]); } -- cgit v1.2.3 From ee40894c05b1d5f07eda671bad74f18605cde0b6 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 22 Aug 2011 11:51:23 +0000 Subject: Bugfix [#28217] Moving multiple selected action strips causes strips to scale towards zero This is an attempted bugfix for a bug which seems to be very fickle to reproduce (it only happens sporadically after quickly jerking the strips around in a certain way). So far when testing, I haven't had any more problems after applying this fix, though it may just be unreliable testing. --- source/blender/blenkernel/intern/nla.c | 35 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 0235724c69c..25f824bba19 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -851,34 +851,35 @@ void BKE_nlameta_flush_transforms (NlaStrip *mstrip) /* for each child-strip, calculate new start/end points based on this new info */ for (strip= mstrip->strips.first; strip; strip= strip->next) { if (scaleChanged) { - PointerRNA ptr; - float p1, p2, nStart, nEnd; + float p1, p2; /* compute positions of endpoints relative to old extents of strip */ p1= (strip->start - oStart) / oLen; p2= (strip->end - oStart) / oLen; - /* compute the new strip endpoints using the proportions */ - nStart= (p1 * nLen) + mstrip->start; - nEnd= (p2 * nLen) + mstrip->start; - - /* firstly, apply the new positions manually, then apply using RNA - * - first time is to make sure no truncation errors from one endpoint not being - * set yet occur - * - second time is to make sure scale is computed properly... - */ - strip->start= nStart; - strip->end= nEnd; - - RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &ptr); - RNA_float_set(&ptr, "frame_start", nStart); - RNA_float_set(&ptr, "frame_end", nEnd); + /* apply new strip endpoints using the proportions, then wait for second pass to flush scale properly */ + strip->start= (p1 * nLen) + mstrip->start; + strip->end= (p2 * nLen) + mstrip->start; } else { /* just apply the changes in offset to both ends of the strip */ strip->start += offset; strip->end += offset; } + } + + /* apply a second pass over child strips, to finish up unfinished business */ + for (strip= mstrip->strips.first; strip; strip= strip->next) { + /* only if scale changed, need to perform RNA updates */ + if (scaleChanged) { + PointerRNA ptr; + + /* use RNA updates to compute scale properly */ + RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &ptr); + + RNA_float_set(&ptr, "frame_start", strip->start); + RNA_float_set(&ptr, "frame_end", strip->end); + } /* finally, make sure the strip's children (if it is a meta-itself), get updated */ BKE_nlameta_flush_transforms(strip); -- cgit v1.2.3 From ff8daca1f117b34c92462f4ab3bbe2aa50f95166 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Tue, 23 Aug 2011 11:44:24 +0000 Subject: Bugfix: Removing a sound from a speaker resulted in a crash. --- source/blender/blenkernel/intern/sound.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index d7385a86105..a364f860255 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -676,11 +676,17 @@ void sound_update_scene(struct Main* bmain, struct Scene* scene) if(AUD_removeSet(scene->speaker_handles, strip->speaker_handle)) { - AUD_moveSequence(strip->speaker_handle, strip->start / FPS, -1, 0); + if(speaker->sound) + AUD_moveSequence(strip->speaker_handle, strip->start / FPS, -1, 0); + else + { + AUD_removeSequence(scene->sound_scene, strip->speaker_handle); + strip->speaker_handle = NULL; + } } else { - if(speaker && speaker->sound) + if(speaker->sound) { strip->speaker_handle = AUD_addSequence(scene->sound_scene, speaker->sound->playback_handle, strip->start / FPS, -1, 0); AUD_setRelativeSequence(strip->speaker_handle, 0); -- cgit v1.2.3 From 8e12b7b054c3c4e95a23f26db232d99ff18e2b90 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 28 Aug 2011 11:39:18 +0000 Subject: Assorted comment clarification in response to code review notes --- source/blender/blenkernel/intern/anim_sys.c | 2 +- source/blender/blenkernel/intern/depsgraph.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 3c6daf8b39d..b690c9b4a91 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1168,7 +1168,7 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i * for we know that which the updates in RNA were really just for * flushing property editing via UI/Py */ - if (RNA_struct_is_a(new_ptr.type, &RNA_PoseBone)) { + if (new_ptr.type == &RNA_PoseBone) { /* bone transforms - update pose (i.e. tag depsgraph) */ skip_updates_hack = 1; } diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 4802601307a..6f27a104144 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -2062,8 +2062,19 @@ static short animdata_use_time(AnimData *adt) return 1; } - /* experimental check: if we have drivers, more likely than not, on a frame change + /* If we have drivers, more likely than not, on a frame change * they'll need updating because their owner changed + * + * This is kindof a hack to get around a whole host of problems + * involving drivers using non-object datablock data (which the + * depsgraph currently has no way of representing let alone correctly + * dependency sort+tagging). By doing this, at least we ensure that + * some commonly attempted drivers (such as scene -> current frame; + * see "Driver updates fail" thread on Bf-committers dated July 2) + * will work correctly, and that other non-object datablocks will have + * their drivers update at least on frame change. + * + * -- Aligorith, July 4 2011 */ if (adt->drivers.first) return 1; -- cgit v1.2.3 From b4b046995b21d59e315eb71ed08fc1ae066c891b Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sun, 28 Aug 2011 14:21:44 +0000 Subject: * Removing mocap GSoC (is an addon already). * Fixing ffmpeg-0.8 errors. * Fixing Ketsji paths. * Removing DoSound from BGE. * Fixing audio scene update to use only current scene objects. --- source/blender/blenkernel/BKE_sound.h | 2 +- source/blender/blenkernel/intern/scene.c | 2 +- source/blender/blenkernel/intern/sequencer.c | 15 +++++---------- source/blender/blenkernel/intern/sound.c | 7 +++++-- 4 files changed, 12 insertions(+), 14 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index ecf0d7e459a..e1b6ff02bc4 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -136,7 +136,7 @@ void sound_read_waveform(struct bSound* sound); int sound_get_channels(struct bSound* sound); -void sound_update_scene(struct Main* bmain, struct Scene* scene); +void sound_update_scene(struct Scene* scene); void* sound_get_factory(void* sound); diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 12e81e8296e..d6003a44a7d 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -968,7 +968,7 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen scene_update_drivers(bmain, scene); /* update sound system animation */ - sound_update_scene(bmain, scene); + sound_update_scene(scene); } /* this is called in main loop, doing tagged updates before redraw */ diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 4cec086aad4..bfbaa223a99 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -3150,18 +3150,14 @@ void seq_update_sound_bounds_all(Scene *scene) { Editing *ed = scene->ed; - if(ed) - { + if(ed) { Sequence *seq; - for(seq = ed->seqbase.first; seq; seq = seq->next) - { - if(seq->type == SEQ_META) - { + for(seq = ed->seqbase.first; seq; seq = seq->next) { + if(seq->type == SEQ_META) { seq_update_sound_bounds_recursive(scene, seq); } - else if(ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) - { + else if(ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) { seq_update_sound_bounds(scene, seq); } } @@ -3170,8 +3166,7 @@ void seq_update_sound_bounds_all(Scene *scene) void seq_update_sound_bounds(Scene* scene, Sequence *seq) { - if(seq->scene_sound) - { + if(seq->scene_sound) { sound_move_scene_sound(scene, seq->scene_sound, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs); /* mute is set in seq_update_muting_recursive */ } diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index a364f860255..842923e63d0 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -24,6 +24,7 @@ #include "DNA_sound_types.h" #include "DNA_speaker_types.h" +#define WITH_AUDASPACE #ifdef WITH_AUDASPACE # include "AUD_C-API.h" #endif @@ -649,9 +650,10 @@ int sound_get_channels(struct bSound* sound) return info.specs.channels; } -void sound_update_scene(struct Main* bmain, struct Scene* scene) +void sound_update_scene(struct Scene* scene) { Object* ob; + Base* base; NlaTrack* track; NlaStrip* strip; Speaker* speaker; @@ -660,8 +662,9 @@ void sound_update_scene(struct Main* bmain, struct Scene* scene) void* handle; float quat[4]; - for(ob = bmain->object.first; ob; ob = ob->id.next) + for(base = FIRSTBASE; base; base=base->next) { + ob = base->object; if(ob->type == OB_SPEAKER) { if(ob->adt) -- cgit v1.2.3 From 5bac37f6d4d2e8d584ae0ec6bafd2808c47fbb25 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Mon, 29 Aug 2011 15:01:55 +0000 Subject: * Reverting Titlecard commit r37537 * Reverting update recent files commit r37155 * Turning reference counts into unsigned ints * Minor things --- source/blender/blenkernel/intern/seqeffects.c | 135 -------------------------- source/blender/blenkernel/intern/sequencer.c | 3 +- source/blender/blenkernel/intern/sound.c | 1 - 3 files changed, 1 insertion(+), 138 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 7e760319e70..34748c64efb 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -40,11 +40,8 @@ #include "BLI_dynlib.h" #include "BLI_math.h" /* windows needs for M_PI */ -#include "BLI_string.h" #include "BLI_utildefines.h" -#include "BLF_api.h" - #include "DNA_scene_types.h" #include "DNA_sequence_types.h" #include "DNA_anim_types.h" @@ -2807,130 +2804,6 @@ static struct ImBuf * do_solid_color( return out; } -/* ********************************************************************** - TITLE CARD - ********************************************************************** */ - -static void init_title_card(Sequence *seq) -{ - TitleCardVars *tv; - - if(seq->effectdata)MEM_freeN(seq->effectdata); - seq->effectdata = MEM_callocN(sizeof(struct TitleCardVars), "titlecard"); - - tv = (TitleCardVars *)seq->effectdata; - - BLI_strncpy(tv->titlestr, "Title goes here", sizeof(tv->titlestr)); - tv->fgcol[0] = tv->fgcol[1] = tv->fgcol[2] = 1.0f; /* white */ -} - -static int num_inputs_titlecard(void) -{ - return 0; -} - -static void free_title_card(Sequence *seq) -{ - if(seq->effectdata)MEM_freeN(seq->effectdata); - seq->effectdata = NULL; -} - -static void copy_title_card(Sequence *dst, Sequence *src) -{ - dst->effectdata = MEM_dupallocN(src->effectdata); -} - -static int early_out_titlecard(struct Sequence *UNUSED(seq), - float UNUSED(facf0), float UNUSED(facf1)) -{ - return -1; -} - -static struct ImBuf * do_title_card( - SeqRenderData context, Sequence *seq, float cfra, - float facf0, float facf1, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3) -{ - TitleCardVars *tv = (TitleCardVars *)seq->effectdata; - - SolidColorVars cv = {{0}}; - struct ImBuf *out; - - int titleFontId = blf_default_font_render; // XXX: bad design! - - int width = context.rectx; - int height = context.recty; - float w, h; - int x, y; - - /* use fake solid-color vars to get backdrop (and an out buffer at the same time) */ - VECCOPY(cv.col, tv->bgcol); - seq->effectdata = &cv; - - out = do_solid_color(context, seq, cfra, - facf0, facf1, - ibuf1, ibuf2, ibuf3); - - seq->effectdata = tv; - - /* draw text */ - /* FIXME: imbuf out->rect is unsigned int NOT unsigned char, but without passing this pointer - * this drawing code doesn't work. This cast really masks some potential bugs though... - */ - BLF_buffer(titleFontId, out->rect_float, (unsigned char *)out->rect, width, height, 4); - - if (tv->titlestr[0]) { - /* automatic scale - these formulae have been derived experimentally: - * - base size is based on 40pt at 960 width - * - each 26 characters, size jumps down one step, - * but this decrease needs to be exponential to fit everything - */ - float lfac = strlen(tv->titlestr) / 26.0f; - float size = (width * 0.06f) * (1.0f - 0.1f*lfac*lfac); - - BLF_size(titleFontId, size, 72); - BLF_buffer_col(titleFontId, tv->fgcol[0], tv->fgcol[1], tv->fgcol[2], 1.0); - - BLF_width_and_height(titleFontId, tv->titlestr, &w, &h); - x = width/2.0f - w/2.0f; - if (tv->subtitle[0]) - y = height/2.0f + h; - else - y = height/2.0f; - - BLF_position(titleFontId, x, y, 0.0); - BLF_draw_buffer(titleFontId, tv->titlestr); - } - - if (tv->subtitle[0]) { - /* automatic scale - these formulae have been derived experimentally (as above): - * - base size is based on 20pt at 960 width - * - size steps aren't quite as refined here. Need a slower-growing curve! - */ - float lfac = strlen(tv->subtitle) / 36.0f; - float size = (width * 0.03f) * (1.0f - 0.1f*lfac*lfac*log(lfac)); - - BLF_size(titleFontId, size, 72); - BLF_buffer_col(titleFontId, tv->fgcol[0], tv->fgcol[1], tv->fgcol[2], 1.0); - - BLF_width_and_height(titleFontId, tv->subtitle, &w, &h); - x = width/2.0f - w/2.0f; - if (tv->titlestr[0]) - y = height/2.0f - h; - else - y = height/2.0f; - - BLF_position(titleFontId, x, y, 0.0); - BLF_draw_buffer(titleFontId, tv->subtitle); - } - - /* cleanup the buffer. */ - BLF_buffer(UIFONT_DEFAULT, NULL, NULL, 0, 0, 0); - - return out; -} - /* ********************************************************************** MULTICAM ********************************************************************** */ @@ -3470,14 +3343,6 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type) rval.early_out = early_out_adjustment; rval.execute = do_adjustment; break; - case SEQ_TITLECARD: - rval.init = init_title_card; - rval.num_inputs = num_inputs_titlecard; - rval.early_out = early_out_titlecard; - rval.free = free_title_card; - rval.copy = copy_title_card; - rval.execute = do_title_card; - break; } return rval; diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index bfbaa223a99..023a10b3103 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -903,7 +903,6 @@ static const char *give_seqname_by_type(int type) case SEQ_MULTICAM: return "Multicam"; case SEQ_ADJUSTMENT: return "Adjustment"; case SEQ_SPEED: return "Speed"; - case SEQ_TITLECARD: return "Title Card"; default: return NULL; } @@ -3029,7 +3028,7 @@ Sequence *seq_foreground_frame_get(Scene *scene, int frame) if(seq->flag & SEQ_MUTE || seq->startdisp > frame || seq->enddisp <= frame) continue; /* only use elements you can see - not */ - if (ELEM6(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE, SEQ_COLOR, SEQ_TITLECARD)) { + if (ELEM5(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE, SEQ_COLOR)) { if (seq->machine > best_machine) { best_seq = seq; best_machine = seq->machine; diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 842923e63d0..abead8d43dd 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -24,7 +24,6 @@ #include "DNA_sound_types.h" #include "DNA_speaker_types.h" -#define WITH_AUDASPACE #ifdef WITH_AUDASPACE # include "AUD_C-API.h" #endif -- cgit v1.2.3 From 88a538048bf7671db6a51fa2791ed1c87fa88611 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 29 Aug 2011 16:07:44 +0000 Subject: Fix #28347: VBO's highlights wrong faces when Mirror modifier is in use Added callback to drawMappedFaces which checks if two faces have got equal draw options. After discussion with Brecht we found it's nicest solution for now: - Disabling VBOs in edit mode for this case wouldn't be nicer for this case - some additional flag stored in DM should be added in this case. - Adding new callback in DM isn't nicer that this solution. - Handling face selection in drawobject would lead to duplicated code which is also not nice. Hopefully, this callback could handle all cases in the future. Also, Brecht mentioned current VBO implementation isn't perfect, so maybe when we'll redesign this area dealing with edit mode wouldn't be so tricky. --- source/blender/blenkernel/BKE_DerivedMesh.h | 3 ++- source/blender/blenkernel/intern/DerivedMesh.c | 6 ++++- source/blender/blenkernel/intern/cdderivedmesh.c | 31 +++++++++++++++++++----- source/blender/blenkernel/intern/subsurf_ccg.c | 6 ++++- 4 files changed, 37 insertions(+), 9 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h index 46b533f33fd..6e17b056685 100644 --- a/source/blender/blenkernel/BKE_DerivedMesh.h +++ b/source/blender/blenkernel/BKE_DerivedMesh.h @@ -283,7 +283,8 @@ struct DerivedMesh { int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), void *userData, int useColors, - int (*setMaterial)(int, void *attribs)); + int (*setMaterial)(int, void *attribs), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index)); /* Draw mapped faces using MTFace * o Drawing options too complicated to enumerate, look at code. diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index c84bcaabbd3..ff7f2586767 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -637,7 +637,8 @@ static void emDM_foreachMappedFaceCenter(DerivedMesh *dm, void (*func)(void *use } /* note, material function is ignored for now. */ -static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), void *userData, int UNUSED(useColors), int (*setMaterial)(int, void *attribs)) +static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), void *userData, int UNUSED(useColors), int (*setMaterial)(int, void *attribs), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index)) { EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; EditFace *efa; @@ -645,6 +646,9 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us (void)setMaterial; /* unused */ + /* currently unused -- each original face is handled separately */ + (void)compareDrawOptions; + if (emdm->vertexCos) { EditVert *eve; diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 12fb11c68b3..5eb97630e83 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -843,7 +843,8 @@ static void cdDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tfa cdDM_drawFacesTex_common(dm, setDrawOptions, NULL, NULL); } -static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), void *userData, int useColors, int (*setMaterial)(int, void *attribs)) +static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), void *userData, int useColors, int (*setMaterial)(int, void *attribs), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index)) { CDDerivedMesh *cddm = (CDDerivedMesh*) dm; MVert *mv = cddm->mvert; @@ -958,6 +959,7 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us MFace *mface= mf + actualFace; int drawSmooth= (mface->flag & ME_SMOOTH); int draw = 1; + int flush = 0; if(i != tottri-1) next_actualFace= dm->drawObject->triangle_to_mface[i+1]; @@ -972,11 +974,28 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us /* Goal is to draw as long of a contiguous triangle array as possible, so draw when we hit either an invisible triangle or at the end of the array */ - if(!draw || i == tottri - 1 || mf[actualFace].mat_nr != mf[next_actualFace].mat_nr) { - if(prevstart != i) - /* Add one to the length (via `draw') - if we're drawing at the end of the array */ - glDrawArrays(GL_TRIANGLES,prevstart*3, (i-prevstart+draw)*3); + + /* flush buffer if current triangle isn't drawable or it's last triangle... */ + flush= !draw || i == tottri - 1; + + /* ... or when material setting is dissferent */ + flush|= mf[actualFace].mat_nr != mf[next_actualFace].mat_nr; + + if(!flush && compareDrawOptions) { + int next_orig= (index==NULL) ? next_actualFace : index[next_actualFace]; + + /* also compare draw options and flush buffer if they're different + need for face selection highlight in edit mode */ + flush|= compareDrawOptions(userData, orig, next_orig) == 0; + } + + if(flush) { + int first= prevstart*3; + int count= (i-prevstart+(draw ? 1 : 0))*3; /* Add one to the length if we're drawing at the end of the array */ + + if(count) + glDrawArrays(GL_TRIANGLES, first, count); + prevstart = i + 1; } } diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 67d7e7bffd6..186a5ea1852 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -1779,7 +1779,8 @@ static void ccgDM_drawUVEdges(DerivedMesh *dm) } } -static void ccgDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), void *userData, int useColors, int (*setMaterial)(int, void *attribs)) { +static void ccgDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), void *userData, int useColors, int (*setMaterial)(int, void *attribs), + int (*compareDrawOptions)(void *userData, int cur_index, int next_index)) { CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm; CCGSubSurf *ss = ccgdm->ss; MCol *mcol= NULL; @@ -1787,6 +1788,9 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *u char *faceFlags = ccgdm->faceFlags; int gridFaces = gridSize - 1, totface; + /* currently unused -- each original face is handled separately */ + (void)compareDrawOptions; + if(useColors) { mcol = dm->getFaceDataArray(dm, CD_WEIGHT_MCOL); if(!mcol) -- cgit v1.2.3 From 5b5e600db6f529ad7e1af9d4bb3a193be2265342 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Tue, 30 Aug 2011 07:57:55 +0000 Subject: Last bunch of minor fixes before merge. * Use NULL in AUD_Reference.h * Use SETLOOPER in sound.c * Move flags to the end of Speaker struct. --- source/blender/blenkernel/intern/sound.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index abead8d43dd..985fef974d3 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -37,6 +37,7 @@ #include "BKE_packedFile.h" #include "BKE_animsys.h" #include "BKE_sequencer.h" +#include "BKE_scene.h" // evil global ;-) static int sound_cfra; @@ -656,12 +657,13 @@ void sound_update_scene(struct Scene* scene) NlaTrack* track; NlaStrip* strip; Speaker* speaker; + Scene* sce_it; void* new_set = AUD_createSet(); void* handle; float quat[4]; - for(base = FIRSTBASE; base; base=base->next) + for(SETLOOPER(scene, sce_it, base)) { ob = base->object; if(ob->type == OB_SPEAKER) -- cgit v1.2.3 From b3704f45c4e165618e898b5b7d1a7391ad14dc50 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 30 Aug 2011 10:07:50 +0000 Subject: Fixes for snprintf usage: * replace by BLI_snprintf in various places, note _snprintf on windows does not properly null terminate the string. * fix overflow in sequencer proxy code due to buffer being smaller than specified size. * fix some usage of snprintf as strcpy, this is will go wrong if the string contains % characters. * remove BLI_dynstr_printf function in gpu module, use BLI_dynstr_appendf --- source/blender/blenkernel/intern/particle_system.c | 11 +++-------- source/blender/blenkernel/intern/pointcache.c | 20 ++++++++++---------- source/blender/blenkernel/intern/report.c | 6 ------ source/blender/blenkernel/intern/sequencer.c | 13 ++++--------- source/blender/blenkernel/intern/unit.c | 11 ++++++----- source/blender/blenkernel/intern/writeffmpeg.c | 6 +----- 6 files changed, 24 insertions(+), 43 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index f62ba2be193..e1ea6e419d3 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -69,6 +69,7 @@ #include "BLI_listbase.h" #include "BLI_threads.h" #include "BLI_storage.h" /* For _LARGEFILE64_SOURCE; zlib needs this on some systems */ +#include "BLI_string.h" #include "BLI_utildefines.h" #include "BKE_main.h" @@ -104,12 +105,6 @@ #include #include -#ifdef WIN32 -#ifndef snprintf -#define snprintf _snprintf -#endif -#endif - #endif // DISABLE_ELBEEM /************************************************/ @@ -3876,7 +3871,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra)) gzf = gzopen(filename, "rb"); if (!gzf) { - snprintf(debugStrBuffer,256,"readFsPartData::error - Unable to open file for reading '%s' \n", filename); + BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer),"readFsPartData::error - Unable to open file for reading '%s' \n", filename); // XXX bad level call elbeemDebugOut(debugStrBuffer); return; } @@ -3937,7 +3932,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra)) gzclose( gzf ); totpart = psys->totpart = activeParts; - snprintf(debugStrBuffer,256,"readFsPartData::done - particles:%d, active:%d, file:%d, mask:%d \n", psys->totpart,activeParts,fileParts,readMask); + BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"readFsPartData::done - particles:%d, active:%d, file:%d, mask:%d \n", psys->totpart,activeParts,fileParts,readMask); // bad level call // XXX elbeemDebugOut(debugStrBuffer); diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 0f0afe30392..a56010a5ccf 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -917,14 +917,14 @@ static int ptcache_path(PTCacheID *pid, char *filename) if (i > 6) file[i-6] = '\0'; - snprintf(filename, MAX_PTCACHE_PATH, "//"PTCACHE_PATH"%s", file); /* add blend file name to pointcache dir */ + BLI_snprintf(filename, MAX_PTCACHE_PATH, "//"PTCACHE_PATH"%s", file); /* add blend file name to pointcache dir */ BLI_path_abs(filename, blendfilename); return BLI_add_slash(filename); /* new strlen() */ } /* use the temp path. this is weak but better then not using point cache at all */ /* btempdir is assumed to exist and ALWAYS has a trailing slash */ - snprintf(filename, MAX_PTCACHE_PATH, "%s"PTCACHE_PATH"%d", btempdir, abs(getpid())); + BLI_snprintf(filename, MAX_PTCACHE_PATH, "%s"PTCACHE_PATH"%d", btempdir, abs(getpid())); return BLI_add_slash(filename); /* new strlen() */ } @@ -948,7 +948,7 @@ static int ptcache_filename(PTCacheID *pid, char *filename, int cfra, short do_p idname = (pid->ob->id.name+2); /* convert chars to hex so they are always a valid filename */ while('\0' != *idname) { - snprintf(newname, MAX_PTCACHE_FILE, "%02X", (char)(*idname++)); + BLI_snprintf(newname, MAX_PTCACHE_FILE, "%02X", (char)(*idname++)); newname+=2; len += 2; } @@ -967,12 +967,12 @@ static int ptcache_filename(PTCacheID *pid, char *filename, int cfra, short do_p if(pid->cache->flag & PTCACHE_EXTERNAL) { if(pid->cache->index >= 0) - snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02u"PTCACHE_EXT, cfra, pid->stack_index); /* always 6 chars */ + BLI_snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02u"PTCACHE_EXT, cfra, pid->stack_index); /* always 6 chars */ else - snprintf(newname, MAX_PTCACHE_FILE, "_%06d"PTCACHE_EXT, cfra); /* always 6 chars */ + BLI_snprintf(newname, MAX_PTCACHE_FILE, "_%06d"PTCACHE_EXT, cfra); /* always 6 chars */ } else { - snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02u"PTCACHE_EXT, cfra, pid->stack_index); /* always 6 chars */ + BLI_snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02u"PTCACHE_EXT, cfra, pid->stack_index); /* always 6 chars */ } len += 16; } @@ -2002,7 +2002,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra) if (dir==NULL) return; - snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index); + BLI_snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index); while ((de = readdir(dir)) != NULL) { if (strstr(de->d_name, ext)) { /* do we have the right extension?*/ @@ -2204,7 +2204,7 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra if (dir==NULL) return; - snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index); + BLI_snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index); while ((de = readdir(dir)) != NULL) { if (strstr(de->d_name, ext)) { /* do we have the right extension?*/ @@ -2904,7 +2904,7 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, char *from, char *to) return; } - snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index); + BLI_snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index); /* put new name into cache */ strcpy(pid->cache->name, to); @@ -2960,7 +2960,7 @@ void BKE_ptcache_load_external(PTCacheID *pid) return; if(cache->index >= 0) - snprintf(ext, sizeof(ext), "_%02d"PTCACHE_EXT, cache->index); + BLI_snprintf(ext, sizeof(ext), "_%02d"PTCACHE_EXT, cache->index); else strcpy(ext, PTCACHE_EXT); diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c index f84d98a31b4..4926edaeec2 100644 --- a/source/blender/blenkernel/intern/report.c +++ b/source/blender/blenkernel/intern/report.c @@ -44,12 +44,6 @@ #include #include -#ifdef _WIN32 -#ifndef vsnprintf -#define vsnprintf _vsnprintf -#endif -#endif - static const char *report_type_str(int type) { switch(type) { diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 40e02d65323..9ef30bdd49b 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -78,11 +78,6 @@ # include "AUD_C-API.h" #endif -#ifdef WIN32 -#define snprintf _snprintf -#endif - - static ImBuf* seq_render_strip_stack( SeqRenderData context, ListBase *seqbasep, float cfra, int chanshown); @@ -1193,7 +1188,7 @@ static void seq_open_anim_file(Sequence * seq) static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra, char * name) { int frameno; - char dir[FILE_MAXDIR]; + char dir[PROXY_MAXFILE]; int render_size = context.preview_render_size; if (!seq->strip->proxy) { @@ -1211,7 +1206,7 @@ static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra, if (seq->flag & (SEQ_USE_PROXY_CUSTOM_DIR|SEQ_USE_PROXY_CUSTOM_FILE)) { strcpy(dir, seq->strip->proxy->dir); } else if (seq->type == SEQ_IMAGE) { - snprintf(dir, PROXY_MAXFILE, "%s/BL_proxy", seq->strip->dir); + BLI_snprintf(dir, PROXY_MAXFILE, "%s/BL_proxy", seq->strip->dir); } else { return FALSE; } @@ -1232,14 +1227,14 @@ static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra, /* generate a separate proxy directory for each preview size */ if (seq->type == SEQ_IMAGE) { - snprintf(name, PROXY_MAXFILE, "%s/images/%d/%s_proxy", dir, + BLI_snprintf(name, PROXY_MAXFILE, "%s/images/%d/%s_proxy", dir, context.preview_render_size, give_stripelem(seq, cfra)->name); frameno = 1; } else { frameno = (int) give_stripelem_index(seq, cfra) + seq->anim_startofs; - snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/####", dir, + BLI_snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/####", dir, context.preview_render_size); } diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index a9792bc44fa..72fe1c19884 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -34,6 +34,7 @@ #include "BKE_unit.h" #include "BLI_math.h" +#include "BLI_string.h" #include "BLI_winstuff.h" @@ -344,7 +345,7 @@ static int unit_as_string(char *str, int len_max, double value, int prec, bUnitC /* Convert to a string */ { - len= snprintf(str, len_max, "%.*lf", prec, value_conv); + len= BLI_snprintf(str, len_max, "%.*lf", prec, value_conv); if(len >= len_max) len= len_max; @@ -495,7 +496,7 @@ static int unit_scale_str(char *str, int len_max, char *str_tmp, double scale_pr len_name = strlen(replace_str); len_move= (len - (found_ofs+len_name)) + 1; /* 1+ to copy the string terminator */ - len_num= snprintf(str_tmp, TEMP_STR_SIZE, "*%lg"SEP_STR, unit->scalar/scale_pref); /* # removed later */ + len_num= BLI_snprintf(str_tmp, TEMP_STR_SIZE, "*%lg"SEP_STR, unit->scalar/scale_pref); /* # removed later */ if(len_num > len_max) len_num= len_max; @@ -629,12 +630,12 @@ int bUnit_ReplaceString(char *str, int len_max, char *str_prev, double scale_pre /* add the unit prefix and re-run, use brackets incase there was an expression given */ - if(snprintf(str_tmp, sizeof(str_tmp), "(%s)%s", str, unit->name) < sizeof(str_tmp)) { + if(BLI_snprintf(str_tmp, sizeof(str_tmp), "(%s)%s", str, unit->name) < sizeof(str_tmp)) { strncpy(str, str_tmp, len_max); return bUnit_ReplaceString(str, len_max, NULL, scale_pref, system, type); } else { - /* snprintf would not fit into str_tmp, cant do much in this case + /* BLI_snprintf would not fit into str_tmp, cant do much in this case * check for this because otherwise bUnit_ReplaceString could call its self forever */ return 0; } @@ -705,7 +706,7 @@ void bUnit_ToUnitAltName(char *str, int len_max, char *orig_str, int system, int /* print the alt_name */ if(unit->name_alt) - len_name= snprintf(str, len_max, "%s", unit->name_alt); + len_name= BLI_snprintf(str, len_max, "%s", unit->name_alt); else len_name= 0; diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 24e0fe95a1f..13875ff19f7 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -39,10 +39,6 @@ #include #include -#if defined(WIN32) && (!(defined snprintf)) -#define snprintf _snprintf -#endif - #include "MEM_guardedalloc.h" #include "DNA_scene_types.h" @@ -652,7 +648,7 @@ static int start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty, Report fmt->audio_codec = ffmpeg_audio_codec; - snprintf(of->filename, sizeof(of->filename), "%s", name); + BLI_snprintf(of->filename, sizeof(of->filename), "%s", name); /* set the codec to the user's selection */ switch(ffmpeg_type) { case FFMPEG_AVI: -- cgit v1.2.3 From 947d4a654b7ec3b7f413f2132a0524ab2e2e5c9e Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Tue, 30 Aug 2011 10:09:10 +0000 Subject: Fix for [#25062] Sound Actuator - Positional Audio. Now all sounds that are not mono but have 3D checked automatically get reduced to mono during BGE conversion time. Also removed the now unneeded function sound_get_channels and added a missing header file to audaspace's CMakeLists.txt. --- source/blender/blenkernel/BKE_sound.h | 2 -- source/blender/blenkernel/intern/sound.c | 10 ---------- 2 files changed, 12 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index e1b6ff02bc4..fac5bf1cfd2 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -134,8 +134,6 @@ void sound_free_waveform(struct bSound* sound); void sound_read_waveform(struct bSound* sound); -int sound_get_channels(struct bSound* sound); - void sound_update_scene(struct Scene* scene); void* sound_get_factory(void* sound); diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 985fef974d3..cdb509ab8e1 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -641,15 +641,6 @@ void sound_read_waveform(struct bSound* sound) } } -int sound_get_channels(struct bSound* sound) -{ - AUD_SoundInfo info; - - info = AUD_getInfo(sound->playback_handle); - - return info.specs.channels; -} - void sound_update_scene(struct Scene* scene) { Object* ob; @@ -769,6 +760,5 @@ void sound_seek_scene(struct bContext *UNUSED(C)) {} float sound_sync_scene(struct Scene *UNUSED(scene)) { return 0.0f; } int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; } int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; } -int sound_get_channels(struct bSound* UNUSED(sound)) { return 1; } #endif // WITH_AUDASPACE -- cgit v1.2.3 From 471c005137540dd4c348c2f8e93146c0dff37a3f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 31 Aug 2011 01:07:55 +0000 Subject: typo fix: end of lines ;; --> ; --- source/blender/blenkernel/intern/collision.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index e2a1b0dfb33..a63e91cc8be 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -1091,7 +1091,7 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM VECADDMUL(cloth1->verts[collpair->ap1].impulse, pimpulse, w1*2.0); VECADDMUL(cloth1->verts[collpair->ap2].impulse, pimpulse, w2*2.0); - VECADDMUL(cloth1->verts[collpair->ap3].impulse, pimpulse, w3*2.0);; + VECADDMUL(cloth1->verts[collpair->ap3].impulse, pimpulse, w3*2.0); cloth1->verts[collpair->ap1].impulse_count++; cloth1->verts[collpair->ap2].impulse_count++; cloth1->verts[collpair->ap3].impulse_count++; -- cgit v1.2.3 From 00143a3d557d87dda2bb7074dfe2b1a3acf5f28f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 1 Sep 2011 01:48:50 +0000 Subject: spaces -> tabs (configure you're editors right!) --- source/blender/blenkernel/intern/collision.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index a63e91cc8be..ed073f03270 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -1487,8 +1487,8 @@ static CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, sdis = clmd->coll_parms->distance_repel + epsilon2 + FLT_EPSILON; - /*apply a repulsion force, to help the solver along. - this is kindof crude, it only tests one vert of the triangle*/ + /* apply a repulsion force, to help the solver along. + * this is kindof crude, it only tests one vert of the triangle */ if (isect_ray_plane_v3(cloth->verts[collpair->ap1].tx, n2, collmd->current_xnew[collpair->bp1].co, collmd->current_xnew[collpair->bp2].co, collmd->current_xnew[collpair->bp3].co, &l, 0)) -- cgit v1.2.3 From 473292dcd7f0f51b91316fc59cdf7d97d11435a5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 1 Sep 2011 09:46:07 +0000 Subject: fix for building without audaspace, since pepper merge --- source/blender/blenkernel/intern/sound.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index cdb509ab8e1..50a7b4a7a73 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -760,5 +760,17 @@ void sound_seek_scene(struct bContext *UNUSED(C)) {} float sound_sync_scene(struct Scene *UNUSED(scene)) { return 0.0f; } int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; } int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; } +void sound_read_waveform(struct bSound* sound) { (void)sound; } +void sound_init_main(struct Main *bmain) { (void)bmain; } +void sound_set_cfra(int cfra) { (void)cfra; } +void sound_update_sequencer(struct Main* main, struct bSound* sound) { (void)main; (void)sound; } +void sound_update_scene(struct Scene* scene) { (void)scene; } +void sound_update_scene_sound(void* handle, struct bSound* sound) { (void)handle; (void)sound; } +void sound_update_scene_listener(struct Scene *scene) { (void)scene; } +void sound_update_fps(struct Scene *scene) { (void)scene; } +void sound_set_scene_sound_volume(void* handle, float volume, char animated) { (void)handle; (void)volume; (void)animated; } +void sound_set_scene_sound_pan(void* handle, float pan, char animated) { (void)handle; (void)pan; (void)animated; } +void sound_set_scene_volume(struct Scene *scene, float volume) { (void)scene; (void)volume; } +void sound_set_scene_sound_pitch(void* handle, float pitch, char animated) { (void)handle; (void)pitch; (void)animated; } #endif // WITH_AUDASPACE -- cgit v1.2.3 From 1f7b41775bcc8832355c13785c299156a870c749 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 2 Sep 2011 03:32:57 +0000 Subject: minor warning fixes, also correct some float -> double promotions in shadeoutput.c --- source/blender/blenkernel/intern/nla.c | 4 +++- source/blender/blenkernel/intern/sound.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 25f824bba19..53ccd55bde8 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -341,7 +341,7 @@ NlaStrip *add_nlastrip_to_stack (AnimData *adt, bAction *act) } /* Add a NLA Strip referencing the given speaker's sound */ -NlaStrip *add_nla_soundstrip (Scene *scene, Speaker *speaker) +NlaStrip *add_nla_soundstrip (Scene *UNUSED(scene), Speaker *speaker) { NlaStrip *strip = MEM_callocN(sizeof(NlaStrip), "NlaSoundStrip"); @@ -359,6 +359,8 @@ NlaStrip *add_nla_soundstrip (Scene *scene, Speaker *speaker) #endif { strip->end = 10.0f; + /* quiet compiler warnings */ + (void)speaker; } /* general settings */ diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 50a7b4a7a73..74f4830b86c 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -39,8 +39,10 @@ #include "BKE_sequencer.h" #include "BKE_scene.h" +#ifdef WITH_AUDASPACE // evil global ;-) static int sound_cfra; +#endif struct bSound* sound_new_file(struct Main *bmain, const char *filename) { -- cgit v1.2.3 From dc7f56455c8a6e045a7a8ab683376ccc91ab8b93 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 2 Sep 2011 04:34:58 +0000 Subject: fix for error in recent commit, when audaspace is enabled --- source/blender/blenkernel/intern/nla.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 53ccd55bde8..6ce80342dd6 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -341,7 +341,7 @@ NlaStrip *add_nlastrip_to_stack (AnimData *adt, bAction *act) } /* Add a NLA Strip referencing the given speaker's sound */ -NlaStrip *add_nla_soundstrip (Scene *UNUSED(scene), Speaker *speaker) +NlaStrip *add_nla_soundstrip (Scene *scene, Speaker *speaker) { NlaStrip *strip = MEM_callocN(sizeof(NlaStrip), "NlaSoundStrip"); @@ -360,6 +360,7 @@ NlaStrip *add_nla_soundstrip (Scene *UNUSED(scene), Speaker *speaker) { strip->end = 10.0f; /* quiet compiler warnings */ + (void)scene; (void)speaker; } -- cgit v1.2.3 From a6a14d0a1e2dcc1aa5535a96339245bb645fba58 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sat, 3 Sep 2011 08:18:43 +0000 Subject: == CustomData == * Added comments for each entry in the LAYERTYPEINFO array noting the number and name of the layer type; was hard to tell before which entry was what --- source/blender/blenkernel/intern/customdata.c | 28 +++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 8d19322c0db..c342bbc917f 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -808,41 +808,65 @@ static void layerDefault_mcol(void *data, int count) static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = { + /* 0: CD_MVERT */ {sizeof(MVert), "MVert", 1, NULL, NULL, NULL, NULL, NULL, NULL}, + /* 1: CD_MSTICKY */ {sizeof(MSticky), "MSticky", 1, NULL, NULL, NULL, layerInterp_msticky, NULL, NULL}, + /* 2: CD_MDEFORMVERT */ {sizeof(MDeformVert), "MDeformVert", 1, NULL, layerCopy_mdeformvert, layerFree_mdeformvert, layerInterp_mdeformvert, NULL, NULL}, + /* 3: CD_MEDGE */ {sizeof(MEdge), "MEdge", 1, NULL, NULL, NULL, NULL, NULL, NULL}, + /* 4: CD_MFACE */ {sizeof(MFace), "MFace", 1, NULL, NULL, NULL, NULL, NULL, NULL}, + /* 5: CD_MTFACE */ {sizeof(MTFace), "MTFace", 1, "UVTex", layerCopy_tface, NULL, layerInterp_tface, layerSwap_tface, layerDefault_tface}, + /* 6: CD_MCOL */ /* 4 MCol structs per face */ {sizeof(MCol)*4, "MCol", 4, "Col", NULL, NULL, layerInterp_mcol, layerSwap_mcol, layerDefault_mcol}, + /* 7: CD_ORIGINDEX */ {sizeof(int), "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, + /* 8: CD_NORMAL */ /* 3 floats per normal vector */ {sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, + /* 9: CD_FLAGS */ {sizeof(int), "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, + /* 10: CD_PROP_FLT */ {sizeof(MFloatProperty), "MFloatProperty",1,"Float",NULL,NULL,NULL,NULL}, + /* 11: CD_PROP_INT */ {sizeof(MIntProperty), "MIntProperty",1,"Int",NULL,NULL,NULL,NULL}, + /* 12: CD_PROP_STR */ {sizeof(MStringProperty), "MStringProperty",1,"String",NULL,NULL,NULL,NULL}, + /* 13: CD_ORIGSPACE */ {sizeof(OrigSpaceFace), "OrigSpaceFace", 1, "UVTex", layerCopy_origspace_face, NULL, layerInterp_origspace_face, layerSwap_origspace_face, layerDefault_origspace_face}, + /* 14: CD_ORCO */ {sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, + /* 15: CD_MTEXPOLY */ {sizeof(MTexPoly), "MTexPoly", 1, "Face Texture", NULL, NULL, NULL, NULL, NULL}, + /* 16: CD_MLOOPUV */ {sizeof(MLoopUV), "MLoopUV", 1, "UV coord", NULL, NULL, layerInterp_mloopuv, NULL, NULL}, + /* 17: CD_MLOOPCOL */ {sizeof(MLoopCol), "MLoopCol", 1, "Col", NULL, NULL, layerInterp_mloopcol, NULL, layerDefault_mloopcol}, + /* 18: CD_TANGENT */ {sizeof(float)*4*4, "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, + /* 19: CD_MDISPS */ {sizeof(MDisps), "MDisps", 1, NULL, layerCopy_mdisps, layerFree_mdisps, layerInterp_mdisps, layerSwap_mdisps, NULL, layerRead_mdisps, layerWrite_mdisps, layerFilesize_mdisps, layerValidate_mdisps}, + /* 20: CD_WEIGHT_MCOL */ {sizeof(MCol)*4, "MCol", 4, "WeightCol", NULL, NULL, layerInterp_mcol, layerSwap_mcol, layerDefault_mcol}, - {sizeof(MCol)*4, "MCol", 4, "IDCol", NULL, NULL, layerInterp_mcol, + /* 21: CD_ID_MCOL */ + {sizeof(MCol)*4, "MCol", 4, "IDCol", NULL, NULL, layerInterp_mcol, layerSwap_mcol, layerDefault_mcol}, - {sizeof(MCol)*4, "MCol", 4, "TexturedCol", NULL, NULL, layerInterp_mcol, + /* 22: CD_TEXTURE_MCOL */ + {sizeof(MCol)*4, "MCol", 4, "TexturedCol", NULL, NULL, layerInterp_mcol, layerSwap_mcol, layerDefault_mcol}, + /* 23: CD_CLOTH_ORCO */ {sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL} }; -- cgit v1.2.3 From 451136e7c0860b5240d4fcec50c95cd4790b8e2b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 3 Sep 2011 15:36:36 +0000 Subject: warning fixes --- source/blender/blenkernel/intern/mesh_validate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c index 9c916d517c5..70398594872 100644 --- a/source/blender/blenkernel/intern/mesh_validate.c +++ b/source/blender/blenkernel/intern/mesh_validate.c @@ -166,7 +166,7 @@ int BKE_mesh_validate_arrays(Mesh *me, MVert *UNUSED(mverts), unsigned int totve } if(BLI_edgehash_haskey(edge_hash, med->v1, med->v2)) { - PRINT(" edge %u: is a duplicate of, %u\n", i, GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, med->v1, med->v2))); + PRINT(" edge %u: is a duplicate of, %d\n", i, GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, med->v1, med->v2))); remove= do_fixes; } -- cgit v1.2.3