Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/modes/edit_lattice_mode.c
| Show First 20 Lines • Show All 176 Lines • ▼ Show 20 Lines | if (!stl->g_data) { | ||||
| /* Alloc transient pointers */ | /* Alloc transient pointers */ | ||||
| stl->g_data = MEM_mallocN(sizeof(*stl->g_data), __func__); | stl->g_data = MEM_mallocN(sizeof(*stl->g_data), __func__); | ||||
| } | } | ||||
| { | { | ||||
| DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL; | DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL; | ||||
| psl->wire_pass = DRW_pass_create("Lattice Wire", state); | psl->wire_pass = DRW_pass_create("Lattice Wire", state); | ||||
| stl->g_data->wire_shgrp = DRW_shgroup_create(sh_data->wire, psl->wire_pass); | stl->g_data->wire_shgrp = DRW_shgroup_create(sh_data->wire, psl->wire_pass); | ||||
| if (rv3d->rflag & RV3D_CLIPPING) { | if (DRW_state_is_clipping_enabled()) { | ||||
| DRW_shgroup_state_enable(stl->g_data->wire_shgrp, DRW_STATE_CLIP_PLANES); | DRW_shgroup_state_enable(stl->g_data->wire_shgrp, DRW_STATE_CLIP_PLANES); | ||||
| } | } | ||||
| state = DRW_STATE_WRITE_COLOR; | state = DRW_STATE_WRITE_COLOR; | ||||
| psl->vert_pass = DRW_pass_create("Lattice Verts", state); | psl->vert_pass = DRW_pass_create("Lattice Verts", state); | ||||
| stl->g_data->vert_shgrp = DRW_shgroup_create(sh_data->overlay_vert, psl->vert_pass); | stl->g_data->vert_shgrp = DRW_shgroup_create(sh_data->overlay_vert, psl->vert_pass); | ||||
| DRW_shgroup_uniform_block(stl->g_data->vert_shgrp, "globalsBlock", G_draw.block_ubo); | DRW_shgroup_uniform_block(stl->g_data->vert_shgrp, "globalsBlock", G_draw.block_ubo); | ||||
| if (rv3d->rflag & RV3D_CLIPPING) { | if (DRW_state_is_clipping_enabled()) { | ||||
| DRW_shgroup_state_enable(stl->g_data->vert_shgrp, DRW_STATE_CLIP_PLANES); | DRW_shgroup_state_enable(stl->g_data->vert_shgrp, DRW_STATE_CLIP_PLANES); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Add geometry to shadingGroups. Execute for each objects */ | /* Add geometry to shadingGroups. Execute for each objects */ | ||||
| static void EDIT_LATTICE_cache_populate(void *vedata, Object *ob) | static void EDIT_LATTICE_cache_populate(void *vedata, Object *ob) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines | |||||