Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_gpencil.h
| Show All 18 Lines | |||||
| #ifndef __BKE_GPENCIL_H__ | #ifndef __BKE_GPENCIL_H__ | ||||
| #define __BKE_GPENCIL_H__ | #define __BKE_GPENCIL_H__ | ||||
| /** \file | /** \file | ||||
| * \ingroup bke | * \ingroup bke | ||||
| */ | */ | ||||
| struct Scene; | |||||
| struct ArrayGpencilModifierData; | struct ArrayGpencilModifierData; | ||||
| struct BoundBox; | struct BoundBox; | ||||
| struct Brush; | struct Brush; | ||||
| struct CurveMapping; | struct CurveMapping; | ||||
| struct Depsgraph; | struct Depsgraph; | ||||
| struct GpencilModifierData; | struct GpencilModifierData; | ||||
| struct LatticeGpencilModifierData; | struct LatticeGpencilModifierData; | ||||
| struct ListBase; | struct ListBase; | ||||
| Show All 9 Lines | |||||
| struct bGPDpalettecolor; | struct bGPDpalettecolor; | ||||
| struct bGPDspoint; | struct bGPDspoint; | ||||
| struct bGPDstroke; | struct bGPDstroke; | ||||
| struct bGPdata; | struct bGPdata; | ||||
| struct MDeformVert; | struct MDeformVert; | ||||
| struct MDeformWeight; | struct MDeformWeight; | ||||
| struct GPUBatch; | |||||
brecht: Did all these structs really need to move out of the draw module and into blenkernel?
As far… | |||||
antoniovAuthorUnsubmitted Done Inline ActionsYou are right, better in draw module. antoniov: You are right, better in draw module. | |||||
| struct GPUVertBuf; | |||||
| struct GPUVertFormat; | |||||
| struct GpencilBatchGroup; | |||||
| #define GP_SIMPLIFY(scene) ((scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ENABLE)) | |||||
| #define GP_SIMPLIFY_ONPLAY(playing) \ | |||||
| (((playing == true) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ON_PLAY)) || \ | |||||
| ((scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ON_PLAY) == 0)) | |||||
| #define GP_SIMPLIFY_FILL(scene, playing) \ | |||||
| ((GP_SIMPLIFY_ONPLAY(playing) && (GP_SIMPLIFY(scene)) && \ | |||||
| (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_FILL))) | |||||
| #define GP_SIMPLIFY_MODIF(scene, playing) \ | |||||
| ((GP_SIMPLIFY_ONPLAY(playing) && (GP_SIMPLIFY(scene)) && \ | |||||
| (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_MODIFIER))) | |||||
| #define GP_SIMPLIFY_FX(scene, playing) \ | |||||
| ((GP_SIMPLIFY_ONPLAY(playing) && (GP_SIMPLIFY(scene)) && \ | |||||
| (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_FX))) | |||||
| #define GP_SIMPLIFY_BLEND(scene, playing) \ | |||||
| ((GP_SIMPLIFY_ONPLAY(playing) && (GP_SIMPLIFY(scene)) && \ | |||||
| (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_BLEND))) | |||||
| /* GPUBatch Cache Element */ | |||||
| typedef struct GpencilBatchCacheElem { | |||||
| struct GPUBatch *batch; | |||||
| struct GPUVertBuf *vbo; | |||||
| int vbo_len; | |||||
| /* attr ids */ | |||||
| struct GPUVertFormat *format; | |||||
| uint pos_id; | |||||
| uint color_id; | |||||
| uint thickness_id; | |||||
| uint uvdata_id; | |||||
| uint prev_pos_id; | |||||
| /* size for VBO alloc */ | |||||
| int tot_vertex; | |||||
| } GpencilBatchCacheElem; | |||||
| /* Defines each batch group to define later the shgroup */ | |||||
| typedef struct GpencilBatchGroup { | |||||
| struct bGPDlayer *gpl; /* reference to original layer */ | |||||
| struct bGPDframe *gpf; /* reference to original frame */ | |||||
| struct bGPDstroke *gps; /* reference to original stroke */ | |||||
| short type; /* type of element */ | |||||
| bool onion; /* the group is part of onion skin */ | |||||
| int vertex_idx; /* index of vertex data */ | |||||
| } GpencilBatchGroup; | |||||
| typedef enum GpencilBatchGroup_Type { | |||||
| eGpencilBatchGroupType_Stroke = 1, | |||||
| eGpencilBatchGroupType_Point = 2, | |||||
| eGpencilBatchGroupType_Fill = 3, | |||||
| eGpencilBatchGroupType_Edit = 4, | |||||
| eGpencilBatchGroupType_Edlin = 5, | |||||
| } GpencilBatchGroup_Type; | |||||
| /* Runtime data for GPU and derived frames after applying modifiers */ | |||||
| typedef struct GpencilBatchCache { | |||||
| struct GpencilBatchCacheElem b_stroke; | |||||
| struct GpencilBatchCacheElem b_point; | |||||
| struct GpencilBatchCacheElem b_fill; | |||||
| struct GpencilBatchCacheElem b_edit; | |||||
| struct GpencilBatchCacheElem b_edlin; | |||||
| /* settings to determine if cache is invalid */ | |||||
| bool is_dirty; | |||||
| bool is_editmode; | |||||
| int cache_frame; | |||||
| /* data with the shading groups */ | |||||
| int grp_used; /* total groups in arrays */ | |||||
| int grp_size; /* max size of the array */ | |||||
| struct GpencilBatchGroup *grp_cache; /* array of elements */ | |||||
| } GpencilBatchCache; | |||||
| /* ------------ Grease-Pencil API ------------------ */ | /* ------------ Grease-Pencil API ------------------ */ | ||||
| void BKE_gpencil_free_point_weights(struct MDeformVert *dvert); | void BKE_gpencil_free_point_weights(struct MDeformVert *dvert); | ||||
| void BKE_gpencil_free_stroke_weights(struct bGPDstroke *gps); | void BKE_gpencil_free_stroke_weights(struct bGPDstroke *gps); | ||||
| void BKE_gpencil_free_stroke(struct bGPDstroke *gps); | void BKE_gpencil_free_stroke(struct bGPDstroke *gps); | ||||
| bool BKE_gpencil_free_strokes(struct bGPDframe *gpf); | bool BKE_gpencil_free_strokes(struct bGPDframe *gpf); | ||||
| void BKE_gpencil_free_frames(struct bGPDlayer *gpl); | void BKE_gpencil_free_frames(struct bGPDlayer *gpl); | ||||
| void BKE_gpencil_free_layers(struct ListBase *list); | void BKE_gpencil_free_layers(struct ListBase *list); | ||||
| ▲ Show 20 Lines • Show All 175 Lines • Show Last 20 Lines | |||||
Did all these structs really need to move out of the draw module and into blenkernel?
As far as I know for other data structures this stays in the draw module. Probably any code outside that needs to access it can call into some function in the draw module?