diff options
author | Maxime Curioni <maxime.curioni@gmail.com> | 2009-04-09 01:44:38 +0400 |
---|---|---|
committer | Maxime Curioni <maxime.curioni@gmail.com> | 2009-04-09 01:44:38 +0400 |
commit | 7e1d0b50037c1fc88e52d1f377f4d96a7a11f8df (patch) | |
tree | a908c9a6ee052ae434761a9a09206b34a541a2d4 | |
parent | 8c8579d911c7bb9ceaf1e28a26950e6db882a79d (diff) |
Corrected the problem of the view moving after a Freestyle render, when positioned at the camera location
4 files changed, 8 insertions, 38 deletions
diff --git a/source/blender/freestyle/intern/app_blender/Controller.cpp b/source/blender/freestyle/intern/app_blender/Controller.cpp index ddb581438bd..3c338680076 100755 --- a/source/blender/freestyle/intern/app_blender/Controller.cpp +++ b/source/blender/freestyle/intern/app_blender/Controller.cpp @@ -645,7 +645,8 @@ Render* Controller::RenderStrokes(Render *re) { BlenderStrokeRenderer* blenderRenderer = new BlenderStrokeRenderer; _Canvas->Render( blenderRenderer ); Render* freestyle_render = blenderRenderer->RenderScene(re); - blenderRenderer->Close(); + delete blenderRenderer; + return freestyle_render; } diff --git a/source/blender/freestyle/intern/stroke/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/stroke/BlenderStrokeRenderer.cpp index 6dc45300b9d..9665aba9bd0 100644 --- a/source/blender/freestyle/intern/stroke/BlenderStrokeRenderer.cpp +++ b/source/blender/freestyle/intern/stroke/BlenderStrokeRenderer.cpp @@ -56,7 +56,7 @@ BlenderStrokeRenderer::BlenderStrokeRenderer() lb = scene->r.layers; scene->r= old_scene->r; scene->r.layers= lb; - set_scene( scene ); + set_scene_bg( scene ); // image dimensions float width = scene->r.xsch; @@ -89,14 +89,11 @@ BlenderStrokeRenderer::~BlenderStrokeRenderer(){ _textureManager = 0; } - // DEALLOCATE STRUCTURE - - // Scene* scene; - // Object* object_camera; - // Material* material; - - // Scene* old_scene; + free_scene( scene ); + free_object( object_camera ); + free_material( material ); + set_scene_bg( old_scene ); } void BlenderStrokeRenderer::RenderStrokeRep(StrokeRep *iStrokeRep) const{ @@ -239,30 +236,3 @@ Render* BlenderStrokeRenderer::RenderScene( Render *re ) { RE_BlenderFrame( freestyle_render, scene, 1); return freestyle_render; } - -void BlenderStrokeRenderer::Close() { - - Scene *sce; - bScreen *sc; - - // from header_info.c - /* check all sets */ - for( sce= (Scene*) G.main->scene.first; sce; sce= (Scene*)sce->id.next) { - if(sce->set == scene) sce->set= 0; - } - - /* check all sequences */ - clear_scene_in_allseqs(scene); - - /* check render layer nodes in other scenes */ - clear_scene_in_nodes(scene); - - for (sc= (bScreen*)G.main->screen.first; sc; sc= (bScreen*)sc->id.next ) { - if(sc->scene == scene) sc->scene= G.scene; - } - - free_libblock( &G.main->scene, scene ); - set_scene( old_scene ); - countall(); -} - diff --git a/source/blender/freestyle/intern/stroke/BlenderStrokeRenderer.h b/source/blender/freestyle/intern/stroke/BlenderStrokeRenderer.h index 03f365525ed..e128cc8628a 100644 --- a/source/blender/freestyle/intern/stroke/BlenderStrokeRenderer.h +++ b/source/blender/freestyle/intern/stroke/BlenderStrokeRenderer.h @@ -31,7 +31,6 @@ public: virtual void RenderStrokeRepBasic(StrokeRep *iStrokeRep) const; Render* RenderScene(Render *re); - void Close(); protected: Scene* scene; diff --git a/source/blender/freestyle/intern/stroke/StyleModule.h b/source/blender/freestyle/intern/stroke/StyleModule.h index 390a67d633d..53eb107ad00 100755 --- a/source/blender/freestyle/intern/stroke/StyleModule.h +++ b/source/blender/freestyle/intern/stroke/StyleModule.h @@ -69,7 +69,7 @@ public: Operators::reset(); int errorCode; - if( errorCode = _inter->interpretFile(_file_name)) { + if( (errorCode = _inter->interpretFile(_file_name)) ) { cerr << "Error: interpretation failed with code " << errorCode << endl; return NULL; } |