diff options
Diffstat (limited to 'source/blender/blenkernel/BKE_DerivedMesh.h')
-rw-r--r-- | source/blender/blenkernel/BKE_DerivedMesh.h | 78 |
1 files changed, 28 insertions, 50 deletions
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h index 4d2e9ef8b3c..9d48ddb4f32 100644 --- a/source/blender/blenkernel/BKE_DerivedMesh.h +++ b/source/blender/blenkernel/BKE_DerivedMesh.h @@ -98,6 +98,9 @@ struct ColorBand; struct GPUVertexAttribs; struct GPUDrawObject; struct PBVH; +struct EvaluationContext; + +#include "DNA_object_enums.h" /* number of sub-elements each mesh element has (for interpolation) */ #define SUB_ELEMS_VERT 0 @@ -142,8 +145,6 @@ typedef int (*DMSetMaterial)(int mat_nr, void *attribs); typedef int (*DMCompareDrawOptions)(void *userData, int cur_index, int next_index); typedef void (*DMSetDrawInterpOptions)(void *userData, int index, float t); typedef DMDrawOption (*DMSetDrawOptions)(void *userData, int index); -typedef DMDrawOption (*DMSetDrawOptionsMappedTex)(void *userData, int origindex, int mat_nr); -typedef DMDrawOption (*DMSetDrawOptionsTex)(struct MTexPoly *mtexpoly, const bool has_vcol, int matnr); typedef enum DMDrawFlag { DM_DRAW_USE_COLORS = (1 << 0), @@ -382,16 +383,13 @@ struct DerivedMesh { /** Get the BVH used for paint modes */ - struct PBVH *(*getPBVH)(struct Object *ob, DerivedMesh *dm); + struct PBVH *(*getPBVH)(struct Object *ob, DerivedMesh *dm, eObjectMode object_mode); /* Drawing Operations */ /** Draw all vertices as bgl points (no options) */ void (*drawVerts)(DerivedMesh *dm); - /** Draw edges in the UV mesh (if exists) */ - void (*drawUVEdges)(DerivedMesh *dm); - /** Draw all edges as lines (no options) * * Also called for *final* editmode DerivedMeshes @@ -411,14 +409,6 @@ struct DerivedMesh { void (*drawFacesSolid)(DerivedMesh *dm, float (*partial_redraw_planes)[4], bool fast, DMSetMaterial setMaterial); - /** Draw all faces using MTFace - * - Drawing options too complicated to enumerate, look at code. - */ - void (*drawFacesTex)(DerivedMesh *dm, - DMSetDrawOptionsTex setDrawOptions, - DMCompareDrawOptions compareDrawOptions, - void *userData, DMDrawFlag flag); - /** Draw all faces with GLSL materials * o setMaterial is called for every different material nr * o Only if setMaterial returns true @@ -445,14 +435,6 @@ struct DerivedMesh { void *userData, DMDrawFlag flag); - /** Draw mapped faces using MTFace - * - Drawing options too complicated to enumerate, look at code. - */ - void (*drawMappedFacesTex)(DerivedMesh *dm, - DMSetDrawOptionsMappedTex setDrawOptions, - DMCompareDrawOptions compareDrawOptions, - void *userData, DMDrawFlag flag); - /** Draw mapped faces with GLSL materials * - setMaterial is called for every different material nr * - setDrawOptions is called for every face @@ -680,56 +662,56 @@ void mesh_get_mapped_verts_coords(DerivedMesh *dm, float (*r_cos)[3], const int /* */ DerivedMesh *mesh_get_derived_final( - struct Scene *scene, struct Object *ob, - CustomDataMask dataMask); + const struct EvaluationContext *eval_ctx, struct Scene *scene, + struct Object *ob, CustomDataMask dataMask); DerivedMesh *mesh_get_derived_deform( - struct Scene *scene, struct Object *ob, - CustomDataMask dataMask); + const struct EvaluationContext *eval_ctx, struct Scene *scene, + struct Object *ob, CustomDataMask dataMask); DerivedMesh *mesh_create_derived_for_modifier( - struct Scene *scene, struct Object *ob, + const struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob, struct ModifierData *md, int build_shapekey_layers); DerivedMesh *mesh_create_derived_render( - struct Scene *scene, struct Object *ob, - CustomDataMask dataMask); + const struct EvaluationContext *eval_ctx, struct Scene *scene, + struct Object *ob, CustomDataMask dataMask); DerivedMesh *getEditDerivedBMesh( struct BMEditMesh *em, struct Object *ob, CustomDataMask data_mask, float (*vertexCos)[3]); DerivedMesh *mesh_create_derived_index_render( - struct Scene *scene, struct Object *ob, - CustomDataMask dataMask, int index); + const struct EvaluationContext *eval_ctx, struct Scene *scene, + struct Object *ob, CustomDataMask dataMask, int index); /* same as above but wont use render settings */ DerivedMesh *mesh_create_derived(struct Mesh *me, float (*vertCos)[3]); DerivedMesh *mesh_create_derived_view( - struct Scene *scene, struct Object *ob, - CustomDataMask dataMask); + const struct EvaluationContext *eval_ctx, struct Scene *scene, + struct Object *ob, CustomDataMask dataMask); DerivedMesh *mesh_create_derived_no_deform( - struct Scene *scene, struct Object *ob, - float (*vertCos)[3], + const struct EvaluationContext *eval_ctx, struct Scene *scene, + struct Object *ob, float (*vertCos)[3], CustomDataMask dataMask); DerivedMesh *mesh_create_derived_no_deform_render( - struct Scene *scene, struct Object *ob, - float (*vertCos)[3], + const struct EvaluationContext *eval_ctx, struct Scene *scene, + struct Object *ob, float (*vertCos)[3], CustomDataMask dataMask); /* for gameengine */ DerivedMesh *mesh_create_derived_no_virtual( - struct Scene *scene, struct Object *ob, float (*vertCos)[3], - CustomDataMask dataMask); + const struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob, + float (*vertCos)[3], CustomDataMask dataMask); DerivedMesh *mesh_create_derived_physics( - struct Scene *scene, struct Object *ob, float (*vertCos)[3], - CustomDataMask dataMask); + const struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob, + float (*vertCos)[3], CustomDataMask dataMask); DerivedMesh *editbmesh_get_derived_base( struct Object *ob, struct BMEditMesh *em, CustomDataMask data_mask); DerivedMesh *editbmesh_get_derived_cage( - struct Scene *scene, struct Object *, + const struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *, struct BMEditMesh *em, CustomDataMask dataMask); DerivedMesh *editbmesh_get_derived_cage_and_final( - struct Scene *scene, struct Object *, + const struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *, struct BMEditMesh *em, CustomDataMask dataMask, DerivedMesh **r_final); @@ -738,7 +720,7 @@ DerivedMesh *object_get_derived_final(struct Object *ob, const bool for_render); float (*editbmesh_get_vertex_cos(struct BMEditMesh *em, int *r_numVerts))[3]; bool editbmesh_modifier_is_enabled(struct Scene *scene, struct ModifierData *md, DerivedMesh *dm); void makeDerivedMesh( - struct Scene *scene, struct Object *ob, struct BMEditMesh *em, + const struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob, struct BMEditMesh *em, CustomDataMask dataMask, const bool build_shapekey_layers); void weight_to_rgb(float r_rgb[3], const float weight); @@ -789,19 +771,15 @@ void DM_draw_attrib_vertex_uniforms(const DMVertexAttribs *attribs); void DM_calc_tangents_names_from_gpu( const struct GPUVertexAttribs *gattribs, char (*tangent_names)[MAX_NAME], int *tangent_names_count); + void DM_add_named_tangent_layer_for_uv( CustomData *uv_data, CustomData *tan_data, int numLoopData, const char *layer_name); -#define DM_TANGENT_MASK_ORCO (1 << 9) -void DM_calc_loop_tangents_step_0( - const CustomData *loopData, bool calc_active_tangent, - const char (*tangent_names)[MAX_NAME], int tangent_names_count, - bool *rcalc_act, bool *rcalc_ren, int *ract_uv_n, int *rren_uv_n, - char *ract_uv_name, char *rren_uv_name, short *rtangent_mask); void DM_calc_loop_tangents( DerivedMesh *dm, bool calc_active_tangent, const char (*tangent_names)[MAX_NAME], int tangent_names_count); + void DM_calc_auto_bump_scale(DerivedMesh *dm); /** Set object's bounding box based on DerivedMesh min/max data */ |