diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-06-24 12:12:38 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-06-24 12:25:04 +0400 |
commit | e7c92f11453e58a3a0a455d14f011671987bddc2 (patch) | |
tree | 49089b854240a9ce43c224d73e5d646ddc3eb970 /source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp | |
parent | dd96be356d82390ce051f004e1f5390e44602ffc (diff) |
Freestyle: Progress bar updates during mesh loading.
Diffstat (limited to 'source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp')
-rw-r--r-- | source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp index 72baea156a0..b504d2c8c40 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp @@ -28,6 +28,8 @@ #include "BKE_global.h" +#include <sstream> + namespace Freestyle { BlenderFileLoader::BlenderFileLoader(Render *re, SceneRenderLayer *srl) @@ -38,6 +40,7 @@ BlenderFileLoader::BlenderFileLoader(Render *re, SceneRenderLayer *srl) _numFacesRead = 0; _minEdgeSize = DBL_MAX; _smooth = (srl->freestyleConfig.flags & FREESTYLE_FACE_SMOOTHNESS_FLAG) != 0; + _pRenderMonitor = NULL; } BlenderFileLoader::~BlenderFileLoader() @@ -86,9 +89,21 @@ NodeGroup *BlenderFileLoader::Load() #endif int id = 0; + unsigned cnt = 1; + unsigned cntStep = (unsigned)ceil(0.01f * _re->totinstance); for (obi = (ObjectInstanceRen *)_re->instancetable.first; obi; obi = obi->next) { - if (_pRenderMonitor && _pRenderMonitor->testBreak()) - break; + if (_pRenderMonitor) { + if (_pRenderMonitor->testBreak()) + break; + if (cnt % cntStep == 0) { + stringstream ss; + ss << "Freestyle: Mesh loading " << (100 * cnt / _re->totinstance) << "%"; + _pRenderMonitor->setInfo(ss.str()); + _pRenderMonitor->progress((float)cnt / _re->totinstance); + } + cnt++; + } + if (!(obi->lay & _srl->lay)) continue; char *name = obi->ob->id.name; |