Changeset View
Changeset View
Standalone View
Standalone View
source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
| /* SPDX-License-Identifier: GPL-2.0-or-later */ | /* SPDX-License-Identifier: GPL-2.0-or-later */ | ||||
| /** \file | /** \file | ||||
| * \ingroup freestyle | * \ingroup freestyle | ||||
| */ | */ | ||||
| #include <iostream> | #include <iostream> | ||||
| #include <map> | #include <map> | ||||
| #include <set> | #include <set> | ||||
| #include "../application/AppCanvas.h" | #include "../application/AppCanvas.h" | ||||
| #include "../application/AppConfig.h" | |||||
| #include "../application/AppView.h" | #include "../application/AppView.h" | ||||
| #include "../application/Controller.h" | #include "../application/Controller.h" | ||||
| #include "BlenderStrokeRenderer.h" | #include "BlenderStrokeRenderer.h" | ||||
| using namespace std; | using namespace std; | ||||
| using namespace Freestyle; | using namespace Freestyle; | ||||
| Show All 29 Lines | |||||
| #include "FRS_freestyle.h" | #include "FRS_freestyle.h" | ||||
| extern "C" { | extern "C" { | ||||
| struct FreestyleGlobals g_freestyle; | struct FreestyleGlobals g_freestyle; | ||||
| // Freestyle configuration | // Freestyle configuration | ||||
| static bool freestyle_is_initialized = false; | static bool freestyle_is_initialized = false; | ||||
| static Config::Path *pathconfig = nullptr; | |||||
| static Controller *controller = nullptr; | static Controller *controller = nullptr; | ||||
| static AppView *view = nullptr; | static AppView *view = nullptr; | ||||
| // line set buffer for copy & paste | // line set buffer for copy & paste | ||||
| static FreestyleLineSet lineset_buffer; | static FreestyleLineSet lineset_buffer; | ||||
| static bool lineset_copied = false; | static bool lineset_copied = false; | ||||
| static void load_post_callback(struct Main * /*main*/, | static void load_post_callback(struct Main * /*main*/, | ||||
| Show All 17 Lines | |||||
| //======================================================= | //======================================================= | ||||
| void FRS_init() | void FRS_init() | ||||
| { | { | ||||
| if (freestyle_is_initialized) { | if (freestyle_is_initialized) { | ||||
| return; | return; | ||||
| } | } | ||||
| pathconfig = new Config::Path; | |||||
| controller = new Controller(); | controller = new Controller(); | ||||
| view = new AppView; | view = new AppView; | ||||
| controller->setView(view); | controller->setView(view); | ||||
| controller->Clear(); | controller->Clear(); | ||||
| g_freestyle.scene = nullptr; | g_freestyle.scene = nullptr; | ||||
| lineset_copied = false; | lineset_copied = false; | ||||
| BKE_callback_add(&load_post_callback_funcstore, BKE_CB_EVT_LOAD_POST); | BKE_callback_add(&load_post_callback_funcstore, BKE_CB_EVT_LOAD_POST); | ||||
| freestyle_is_initialized = true; | freestyle_is_initialized = true; | ||||
| } | } | ||||
| void FRS_set_context(bContext *C) | void FRS_set_context(bContext *C) | ||||
| { | { | ||||
| if (G.debug & G_DEBUG_FREESTYLE) { | if (G.debug & G_DEBUG_FREESTYLE) { | ||||
| cout << "FRS_set_context: context 0x" << C << " scene 0x" << CTX_data_scene(C) << endl; | cout << "FRS_set_context: context 0x" << C << " scene 0x" << CTX_data_scene(C) << endl; | ||||
| } | } | ||||
| controller->setContext(C); | controller->setContext(C); | ||||
| } | } | ||||
| void FRS_exit() | void FRS_exit() | ||||
| { | { | ||||
| delete pathconfig; | |||||
| delete controller; | delete controller; | ||||
| delete view; | delete view; | ||||
| } | } | ||||
| //======================================================= | //======================================================= | ||||
| // Rendering | // Rendering | ||||
| //======================================================= | //======================================================= | ||||
| ▲ Show 20 Lines • Show All 651 Lines • Show Last 20 Lines | |||||