WIP: Onion Skinning Prototype #107641
|
@ -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_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);
|
||||
if (geom) {
|
||||
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) {
|
||||
DRW_shgroup_call(pd->onion_skin_grp, geom, ob);
|
||||
}
|
||||
} */
|
||||
}
|
||||
|
||||
void OVERLAY_onion_skin_draw(OVERLAY_Data *vedata)
|
||||
|
|
|
@ -32,8 +32,15 @@ static int onion_skin_add_exec(bContext *C, wmOperator *op)
|
|||
Scene *scene = CTX_data_scene(C);
|
||||
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
if (!ob) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
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");
|
||||
link->mesh = copy;
|
||||
|
|
Loading…
Reference in New Issue