diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_blender.h | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_particle.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/CMakeLists.txt | 14 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/anim.c | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/bvhutils.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 19 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sound.c | 141 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/writeffmpeg.c | 21 |
12 files changed, 164 insertions, 73 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 07f0885372a..7c11f9e964e 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -43,7 +43,7 @@ extern "C" { /* these lines are grep'd, watch out for our not-so-awesome regex * and keep comment above the defines. * Use STRINGIFY() rather than defining with quotes */ -#define BLENDER_VERSION 257 +#define BLENDER_VERSION 258 #define BLENDER_SUBVERSION 1 #define BLENDER_MINVERSION 250 @@ -51,9 +51,9 @@ extern "C" { /* used by packaging tools */ /* can be left blank, otherwise a,b,c... etc with no quotes */ -#define BLENDER_VERSION_CHAR b +#define BLENDER_VERSION_CHAR /* alpha/beta/rc/release, docs use this */ -#define BLENDER_VERSION_CYCLE beta +#define BLENDER_VERSION_CYCLE release struct ListBase; struct MemFile; diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index feeab98ad78..5b565223ece 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -147,7 +147,8 @@ typedef struct ParticleBillboardData struct Object *ob; float vec[3], vel[3]; float offset[2]; - float size, tilt, random, time; + float size[2]; + float tilt, random, time; int uv[3]; int lock, num; int totnum; diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 5afaa13ddcd..adf10916aaf 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -44,8 +44,6 @@ set(INC ../nodes ../editors/include ../render/extern/include - ../../../intern/audaspace/intern - ../../../intern/ffmpeg ../../../intern/bsp/extern ../blenfont ../../../intern/decimation/extern ../../../intern/elbeem/extern @@ -239,6 +237,13 @@ set(SRC add_definitions(-DGLEW_STATIC) +if(WITH_AUDASPACE) + list(APPEND INC + ../../../intern/audaspace/intern + ) + add_definitions(-DWITH_AUDASPACE) +endif() + if(WITH_BULLET) list(APPEND INC ../../../extern/bullet2/src) add_definitions(-DUSE_BULLET) @@ -275,12 +280,13 @@ endif() if(WITH_CODEC_QUICKTIME) list(APPEND INC ../quicktime) - list(APPEND INC_SYS ${QUICKTIME_INC}) + list(APPEND INC_SYS ${QUICKTIME_INCLUDE_DIRS}) add_definitions(-DWITH_QUICKTIME) endif() if(WITH_CODEC_FFMPEG) - list(APPEND INC_SYS ${FFMPEG_INC}) + list(APPEND INC ../../../intern/ffmpeg) + list(APPEND INC_SYS ${FFMPEG_INCLUDE_DIRS}) add_definitions(-DWITH_FFMPEG) endif() diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 1763866c000..0747d87a0ab 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -171,7 +171,12 @@ bMotionPath *animviz_verify_motionpaths(Scene *scene, Object *ob, bPoseChannel * avs= &ob->avs; dst= &ob->mpath; } - + + /* avoid 0 size allocs */ + if(avs->path_sf >= avs->path_ef) { + return NULL; + } + /* if there is already a motionpath, just return that, * but provided it's settings are ok */ diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index fd25ebe266f..0b31e51d62e 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1343,8 +1343,12 @@ void vec_roll_to_mat3(float *vec, float roll, float mat[][3]) cross_v3_v3v3(axis,target,nor); /* was 0.0000000000001, caused bug [#23954], smaller values give unstable - * roll when toggling editmode */ - if (dot_v3v3(axis,axis) > 0.00001f) { + * roll when toggling editmode. + * + * was 0.00001, causes bug [#27675], with 0.00000495, + * so a value inbetween these is needed. + */ + if (dot_v3v3(axis,axis) > 0.000001f) { /* if nor is *not* a multiple of target ... */ normalize_v3(axis); diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 0f545ad3ff9..633a05589cd 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -64,6 +64,7 @@ #include "BLI_dynstr.h" #include "BLI_path_util.h" #include "BLI_utildefines.h" +#include "BLI_callbacks.h" #include "IMB_imbuf.h" @@ -110,6 +111,9 @@ void free_blender(void) BKE_spacetypes_free(); /* after free main, it uses space callbacks */ IMB_exit(); + + BLI_cb_finalize(); + seq_stripelem_cache_destruct(); free_nodesystem(); diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index cc45abb5998..c3aeb440938 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -719,7 +719,7 @@ void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data) if(!data->cached) BLI_bvhtree_free(data->tree); - memset( data, 0, sizeof(data) ); + memset( data, 0, sizeof(*data) ); } } diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 3a8a2ae9c09..64e374fe4c0 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -32,8 +32,10 @@ */ -#ifdef WITH_PYTHON -#include <Python.h> +#if 0 /* pynodes commented for now */ +# ifdef WITH_PYTHON +# include <Python.h> +# endif #endif #include "MEM_guardedalloc.h" diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index f71e2e9a6e9..72c92eed312 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3534,6 +3534,8 @@ static void default_particle_settings(ParticleSettings *part) part->path_start = 0.0f; part->path_end = 1.0f; + part->bb_size[0] = part->bb_size[1] = 1.0f; + part->keyed_loops = 1; part->color_vec_max = 1.f; @@ -4505,8 +4507,8 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3] mul_v3_fl(tvec, -sin(bb->tilt * (float)M_PI)); VECADD(yvec, yvec, tvec); - mul_v3_fl(xvec, bb->size); - mul_v3_fl(yvec, bb->size); + mul_v3_fl(xvec, bb->size[0]); + mul_v3_fl(yvec, bb->size[1]); VECADDFAC(center, bb->vec, xvec, bb->offset[0]); VECADDFAC(center, center, yvec, bb->offset[1]); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index b82ac69fc9e..265cc3eeb79 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -73,7 +73,10 @@ #include "BKE_context.h" #include "BKE_sound.h" -#include "AUD_C-API.h" + +#ifdef WITH_AUDASPACE +# include "AUD_C-API.h" +#endif #ifdef WIN32 #define snprintf _snprintf @@ -697,6 +700,7 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range) } seq->strip->len = seq->len; case SEQ_SOUND: +#ifdef WITH_AUDASPACE if(!seq->sound) return; seq->len = ceil(AUD_getInfo(seq->sound->playback_handle).length * FPS); @@ -706,6 +710,9 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range) seq->len = 0; } seq->strip->len = seq->len; +#else + return; +#endif break; case SEQ_SCENE: { @@ -3493,6 +3500,7 @@ Sequence *sequencer_add_image_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo return seq; } +#ifdef WITH_AUDASPACE Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load) { Scene *scene= CTX_data_scene(C); /* only for sound */ @@ -3550,6 +3558,15 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo return seq; } +#else // WITH_AUDASPACE +Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load) +{ + (void)C; + (void)seqbasep; + (void)seq_load; + return NULL; +} +#endif // WITH_AUDASPACE Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load) { diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index e0e456a371e..0eb2392b012 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -21,7 +21,9 @@ #include "DNA_screen_types.h" #include "DNA_sound_types.h" -#include "AUD_C-API.h" +#ifdef WITH_AUDASPACE +# include "AUD_C-API.h" +#endif #include "BKE_utildefines.h" #include "BKE_global.h" @@ -36,6 +38,62 @@ static int force_device = -1; + +struct bSound* sound_new_file(struct Main *bmain, const char *filename) +{ + bSound* sound = NULL; + + char str[FILE_MAX]; + char *path; + + int len; + + strcpy(str, filename); + + path = /*bmain ? bmain->name :*/ G.main->name; + + BLI_path_abs(str, path); + + len = strlen(filename); + while(len > 0 && filename[len-1] != '/' && filename[len-1] != '\\') + len--; + + sound = alloc_libblock(&bmain->sound, ID_SO, filename+len); + BLI_strncpy(sound->name, filename, FILE_MAX); +// XXX unused currently sound->type = SOUND_TYPE_FILE; + + sound_load(bmain, sound); + + if(!sound->playback_handle) + { + free_libblock(&bmain->sound, sound); + sound = NULL; + } + + return sound; +} + +void sound_free(struct bSound* sound) +{ + if (sound->packedfile) + { + freePackedFile(sound->packedfile); + sound->packedfile = NULL; + } + +#ifdef WITH_AUDASPACE + if(sound->handle) + { + AUD_unload(sound->handle); + sound->handle = NULL; + sound->playback_handle = NULL; + } +#endif // WITH_AUDASPACE +} + + +#ifdef WITH_AUDASPACE + #ifdef WITH_JACK static void sound_sync_callback(void* data, int mode, float time) { @@ -123,40 +181,6 @@ void sound_exit(void) AUD_exit(); } -struct bSound* sound_new_file(struct Main *bmain, const char *filename) -{ - bSound* sound = NULL; - - char str[FILE_MAX]; - char *path; - - int len; - - strcpy(str, filename); - - path = /*bmain ? bmain->name :*/ G.main->name; - - BLI_path_abs(str, path); - - len = strlen(filename); - while(len > 0 && filename[len-1] != '/' && filename[len-1] != '\\') - len--; - - sound = alloc_libblock(&bmain->sound, ID_SO, filename+len); - BLI_strncpy(sound->name, filename, FILE_MAX); -// XXX unused currently sound->type = SOUND_TYPE_FILE; - - sound_load(bmain, sound); - - if(!sound->playback_handle) - { - free_libblock(&bmain->sound, sound); - sound = NULL; - } - - return sound; -} - // XXX unused currently #if 0 struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source) @@ -301,22 +325,6 @@ void sound_load(struct Main *bmain, struct bSound* sound) } } -void sound_free(struct bSound* sound) -{ - if (sound->packedfile) - { - freePackedFile(sound->packedfile); - sound->packedfile = NULL; - } - - if(sound->handle) - { - AUD_unload(sound->handle); - sound->handle = NULL; - sound->playback_handle = NULL; - } -} - static float sound_get_volume(Scene* scene, Sequence* sequence, float time) { AnimData *adt= BKE_animdata_from_id(&scene->id); @@ -502,3 +510,34 @@ int sound_get_channels(struct bSound* sound) return info.specs.channels; } + +#else // WITH_AUDASPACE + +#include "BLI_utildefines.h" + +int sound_define_from_str(const char *UNUSED(str)) { return -1;} +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_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)) {} +void sound_destroy_scene(struct Scene *UNUSED(scene)) {} +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_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)) {} +void sound_stop_scene(struct Scene *UNUSED(scene)) {} +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 0; } +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 diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index c729565533f..4db53999f10 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -49,7 +49,9 @@ #include "BLI_blenlib.h" -#include "AUD_C-API.h" /* must be before BKE_sound.h for define */ +#ifdef WITH_AUDASPACE +# include "AUD_C-API.h" +#endif #include "BKE_global.h" #include "BKE_idprop.h" @@ -89,7 +91,9 @@ static uint8_t* audio_output_buffer = 0; static int audio_outbuf_size = 0; static double audio_time = 0.0f; +#ifdef WITH_AUDASPACE static AUD_Device* audio_mixdown_device = 0; +#endif #define FFMPEG_AUTOSPLIT_SIZE 2000000000 @@ -103,6 +107,7 @@ static void delete_picture(AVFrame* f) } } +#ifdef WITH_AUDASPACE static int write_audio_frame(void) { AVCodecContext* c = NULL; @@ -145,6 +150,7 @@ static int write_audio_frame(void) } return 0; } +#endif // #ifdef WITH_AUDASPACE /* Allocate a temporary frame */ static AVFrame* alloc_picture(int pix_fmt, int width, int height) @@ -851,7 +857,7 @@ int start_ffmpeg(struct Scene *scene, RenderData *rd, int rectx, int recty, Repo ffmpeg_autosplit_count = 0; success = start_ffmpeg_impl(rd, rectx, recty, reports); - +#ifdef WITH_AUDASPACE if(audio_stream) { AVCodecContext* c = audio_stream->codec; @@ -861,12 +867,13 @@ int start_ffmpeg(struct Scene *scene, RenderData *rd, int rectx, int recty, Repo specs.rate = rd->ffcodecdata.audio_mixrate; audio_mixdown_device = sound_mixdown(scene, specs, rd->sfra, rd->ffcodecdata.audio_volume); } - +#endif return success; } void end_ffmpeg(void); +#ifdef WITH_AUDASPACE static void write_audio_frames(double to_pts) { int finished = 0; @@ -878,6 +885,7 @@ static void write_audio_frames(double to_pts) } } } +#endif int append_ffmpeg(RenderData *rd, int frame, int *pixels, int rectx, int recty, ReportList *reports) { @@ -905,8 +913,9 @@ int append_ffmpeg(RenderData *rd, int frame, int *pixels, int rectx, int recty, } } +#ifdef WITH_AUDASPACE write_audio_frames((frame - rd->sfra) / (((double)rd->frs_sec) / rd->frs_sec_base)); - +#endif return success; } @@ -920,12 +929,14 @@ void end_ffmpeg(void) write_audio_frames(); }*/ +#ifdef WITH_AUDASPACE if(audio_mixdown_device) { AUD_closeReadDevice(audio_mixdown_device); audio_mixdown_device = 0; } - +#endif + if (video_stream && video_stream->codec) { fprintf(stderr, "Flushing delayed frames...\n"); flush_ffmpeg (); |