Ejemplo n.º 1
0
static void sound_sync_callback(void *data, int mode, float time)
{
  // Ugly: Blender doesn't like it when the animation is played back during rendering
  if (G.is_rendering) {
    return;
  }

  Main *bmain = (Main *)data;
  Scene *scene;

  scene = bmain->scenes.first;
  while (scene) {
    if (scene->audio.flag & AUDIO_SYNC) {
      if (mode) {
        BKE_sound_play_scene(scene);
      }
      else {
        BKE_sound_stop_scene(scene);
      }
      if (scene->playback_handle) {
        AUD_Handle_setPosition(scene->playback_handle, time);
      }
    }
    scene = scene->id.next;
  }
}
Ejemplo n.º 2
0
static void sound_sync_callback(void *data, int mode, float time)
{
	struct Main *bmain = (struct Main *)data;
	struct Scene *scene;

	scene = bmain->scene.first;
	while (scene) {
		if (scene->audio.flag & AUDIO_SYNC) {
			if (mode)
				BKE_sound_play_scene(scene);
			else
				BKE_sound_stop_scene(scene);
			if (scene->playback_handle)
				AUD_Handle_setPosition(scene->playback_handle, time);
		}
		scene = scene->id.next;
	}
}