Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_cache.c
| Show First 20 Lines • Show All 3,802 Lines • ▼ Show 20 Lines | |||||
| void drw_batch_cache_generate_requested(Object *ob) | void drw_batch_cache_generate_requested(Object *ob) | ||||
| { | { | ||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | const DRWContextState *draw_ctx = DRW_context_state_get(); | ||||
| const ToolSettings *ts = draw_ctx->scene->toolsettings; | const ToolSettings *ts = draw_ctx->scene->toolsettings; | ||||
| const enum eContextObjectMode mode = CTX_data_mode_enum_ex( | const enum eContextObjectMode mode = CTX_data_mode_enum_ex( | ||||
| draw_ctx->object_edit, draw_ctx->obact, draw_ctx->object_mode); | draw_ctx->object_edit, draw_ctx->obact, draw_ctx->object_mode); | ||||
| const bool is_paint_mode = ELEM(mode, CTX_MODE_PAINT_TEXTURE, CTX_MODE_PAINT_VERTEX, CTX_MODE_PAINT_WEIGHT); | const bool is_paint_mode = ELEM(mode, CTX_MODE_PAINT_TEXTURE, CTX_MODE_PAINT_VERTEX, CTX_MODE_PAINT_WEIGHT); | ||||
| const bool use_hide = ( | const bool use_hide = ( | ||||
| (ob->type == OB_MESH) && | (ob->type == OB_MESH) && | ||||
| ((is_paint_mode && (ob == draw_ctx->obact) && | ((is_paint_mode && (ob == draw_ctx->obact) && | ||||
| (BKE_paint_select_face_test(ob) || BKE_paint_select_vert_test(ob))) || | DRW_object_use_hide_faces(ob)) || | ||||
| ((mode == CTX_MODE_EDIT_MESH) && BKE_object_is_in_editmode(ob)))); | ((mode == CTX_MODE_EDIT_MESH) && BKE_object_is_in_editmode(ob)))); | ||||
| struct Mesh *mesh_eval = ob->runtime.mesh_eval; | struct Mesh *mesh_eval = ob->runtime.mesh_eval; | ||||
| switch (ob->type) { | switch (ob->type) { | ||||
| case OB_MESH: | case OB_MESH: | ||||
| DRW_mesh_batch_cache_create_requested(ob, (Mesh *)ob->data, ts, is_paint_mode, use_hide); | DRW_mesh_batch_cache_create_requested(ob, (Mesh *)ob->data, ts, is_paint_mode, use_hide); | ||||
| break; | break; | ||||
| case OB_CURVE: | case OB_CURVE: | ||||
| Show All 14 Lines | |||||