Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/overlay_armature.c
| Show First 20 Lines • Show All 585 Lines • ▼ Show 20 Lines | static void drw_shgroup_bone_custom_solid(ArmatureDrawContext *ctx, | ||||
| drw_batch_cache_generate_requested_delayed(custom); | drw_batch_cache_generate_requested_delayed(custom); | ||||
| } | } | ||||
| static void drw_shgroup_bone_custom_wire(ArmatureDrawContext *ctx, | static void drw_shgroup_bone_custom_wire(ArmatureDrawContext *ctx, | ||||
| const float (*bone_mat)[4], | const float (*bone_mat)[4], | ||||
| const float color[4], | const float color[4], | ||||
| Object *custom) | Object *custom) | ||||
| { | { | ||||
| /* See comments in #drw_shgroup_bone_custom_solid. */ | |||||
| Mesh *mesh = BKE_object_get_evaluated_mesh(custom); | |||||
| if (mesh == NULL) { | |||||
| return; | |||||
| } | |||||
| /* TODO(fclem): arg... less than ideal but we never iter on this object | /* TODO(fclem): arg... less than ideal but we never iter on this object | ||||
| * to assure batch cache is valid. */ | * to assure batch cache is valid. */ | ||||
| drw_batch_cache_validate(custom); | DRW_mesh_batch_cache_validate(mesh); | ||||
| struct GPUBatch *geom = DRW_cache_object_all_edges_get(custom); | |||||
| struct GPUBatch *geom = DRW_mesh_batch_cache_get_all_edges(mesh); | |||||
| if (geom) { | if (geom) { | ||||
| DRWCallBuffer *buf = custom_bone_instance_shgroup(ctx, ctx->custom_wire, geom); | DRWCallBuffer *buf = custom_bone_instance_shgroup(ctx, ctx->custom_wire, geom); | ||||
| BoneInstanceData inst_data; | BoneInstanceData inst_data; | ||||
| mul_m4_m4m4(inst_data.mat, ctx->ob->obmat, bone_mat); | mul_m4_m4m4(inst_data.mat, ctx->ob->obmat, bone_mat); | ||||
| OVERLAY_bone_instance_data_set_color_hint(&inst_data, color); | OVERLAY_bone_instance_data_set_color_hint(&inst_data, color); | ||||
| OVERLAY_bone_instance_data_set_color(&inst_data, color); | OVERLAY_bone_instance_data_set_color(&inst_data, color); | ||||
| DRW_buffer_add_entry_struct(buf, inst_data.mat); | DRW_buffer_add_entry_struct(buf, inst_data.mat); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,722 Lines • Show Last 20 Lines | |||||