WIP: Onion Skinning Prototype #107641

Closed
Christoph Lendenfeld wants to merge 22 commits from ChrisLend/blender:onion_skin_test into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 12 additions and 5 deletions
Showing only changes of commit 47a7f7e342 - Show all commits

View File

@ -27,16 +27,16 @@ void OVERLAY_onion_skin_populate(OVERLAY_Data *vedata, Object *ob)
DRW_shgroup_uniform_vec3_copy(grp, "color", draw_ctx->scene->onion_skin_cache.color); DRW_shgroup_uniform_vec3_copy(grp, "color", draw_ctx->scene->onion_skin_cache.color);
DRW_shgroup_uniform_float_copy(grp, "alpha", draw_ctx->scene->onion_skin_cache.alpha); DRW_shgroup_uniform_float_copy(grp, "alpha", draw_ctx->scene->onion_skin_cache.alpha);
/* LISTBASE_FOREACH (OnionSkinMeshLink *, mesh_link, &draw_ctx->scene->onion_skin_cache.meshes) { LISTBASE_FOREACH (OnionSkinMeshLink *, mesh_link, &draw_ctx->scene->onion_skin_cache.meshes) {
struct GPUBatch *geom = DRW_mesh_batch_cache_get_surface((Mesh *)mesh_link->mesh); struct GPUBatch *geom = DRW_mesh_batch_cache_get_surface((Mesh *)mesh_link->mesh);
if (geom) { if (geom) {
DRW_shgroup_call(pd->onion_skin_grp, geom, ob); DRW_shgroup_call(pd->onion_skin_grp, geom, ob);
} }
} */ }
struct GPUBatch *geom = DRW_cache_object_surface_get(ob); /* struct GPUBatch *geom = DRW_cache_object_surface_get(ob);
if (geom) { if (geom) {
DRW_shgroup_call(pd->onion_skin_grp, geom, ob); DRW_shgroup_call(pd->onion_skin_grp, geom, ob);
} } */
} }
void OVERLAY_onion_skin_draw(OVERLAY_Data *vedata) void OVERLAY_onion_skin_draw(OVERLAY_Data *vedata)

View File

@ -32,8 +32,15 @@ static int onion_skin_add_exec(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C); Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C); Object *ob = CTX_data_active_object(C);
if (!ob) {
return OPERATOR_CANCELLED;
}
Mesh *mesh = BKE_mesh_from_object(ob); Mesh *mesh = BKE_mesh_from_object(ob);
Mesh *copy = BKE_mesh_copy_for_eval(mesh); if (!mesh) {
return OPERATOR_CANCELLED;
}
/* Mesh *copy = BKE_mesh_copy_for_eval(mesh); */
Mesh *copy = (Mesh *)BKE_id_copy_ex(NULL, &mesh->id, NULL, LIB_ID_COPY_LOCALIZE);
OnionSkinMeshLink *link = MEM_callocN(sizeof(OnionSkinMeshLink), "onion skin mesh link"); OnionSkinMeshLink *link = MEM_callocN(sizeof(OnionSkinMeshLink), "onion skin mesh link");
link->mesh = copy; link->mesh = copy;