Skip to content

Commit

Permalink
Fix rendering and export on some locales
Browse files Browse the repository at this point in the history
Specifically, on locales such as DE for which the decimal separator is not a period (.) but another symbol such as a comma.
  • Loading branch information
dictoon committed Jan 23, 2017
1 parent c34c04c commit 5af2dcb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/appleseed-max-impl/renderer/appleseedrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
#include <bitmap.h>

// Standard headers.
#include <clocale>
#include <cstddef>
#include <string>

namespace asf = foundation;
namespace asr = renderer;
Expand Down Expand Up @@ -357,6 +359,8 @@ int AppleseedRenderer::Render(
{
SuspendAll suspend(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);

std::string previous_locale(std::setlocale(LC_ALL, "C"));

m_time = time;

if (view_params)
Expand Down Expand Up @@ -445,6 +449,8 @@ int AppleseedRenderer::Render(
if (progress_cb)
progress_cb->SetTitle(_T("Done."));

std::setlocale(LC_ALL, previous_locale.c_str());

// Success.
return 1;
}
Expand Down

0 comments on commit 5af2dcb

Please sign in to comment.