Blender  V2.93
BlenderContext.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #pragma once
22 
23 #include "BKE_context.h"
24 #include "BKE_main.h"
25 #include "BLI_linklist.h"
26 #include "BlenderTypes.h"
27 #include "DEG_depsgraph.h"
28 #include "DEG_depsgraph_query.h"
29 #include "DNA_layer_types.h"
30 #include "DNA_object_types.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
38 
39 bool bc_is_in_Export_set(LinkNode *export_set, Object *ob, ViewLayer *view_layer);
40 bool bc_is_base_node(LinkNode *export_set, Object *ob, ViewLayer *view_layer);
42  Object *ob,
43  ViewLayer *view_layer);
44 int bc_is_marked(Object *ob);
45 void bc_remove_mark(Object *ob);
46 void bc_set_mark(Object *ob);
47 
48 #ifdef __cplusplus
49 }
50 
51 class BlenderContext {
52  private:
55  Scene *scene;
56  ViewLayer *view_layer;
57  Main *main;
58 
59  public:
60  BlenderContext(bContext *C);
61  bContext *get_context();
62  Depsgraph *get_depsgraph();
63  Scene *get_scene();
64  Scene *get_evaluated_scene();
65  Object *get_evaluated_object(Object *ob);
66  ViewLayer *get_view_layer();
67  Main *get_main();
68 };
69 #endif
static const BC_global_forward_axis BC_DEFAULT_FORWARD
void bc_remove_mark(Object *ob)
Object * bc_get_highest_exported_ancestor_or_self(LinkNode *export_set, Object *ob, ViewLayer *view_layer)
int bc_is_marked(Object *ob)
static const BC_global_up_axis BC_DEFAULT_UP
bool bc_is_in_Export_set(LinkNode *export_set, Object *ob, ViewLayer *view_layer)
void bc_set_mark(Object *ob)
bool bc_is_base_node(LinkNode *export_set, Object *ob, ViewLayer *view_layer)
BC_global_up_axis
Definition: BlenderTypes.h:38
@ BC_GLOBAL_UP_Z
Definition: BlenderTypes.h:41
BC_global_forward_axis
Definition: BlenderTypes.h:29
@ BC_GLOBAL_FORWARD_Y
Definition: BlenderTypes.h:31
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
Object is a sort of wrapper for general info.
#define C
Definition: RandGen.cpp:39
Scene scene
const Depsgraph * depsgraph
int main(int argc, char **argv)
Definition: msgfmt.c:457
struct SELECTID_Context context
Definition: select_engine.c:47
Definition: BKE_main.h:116