WIP: Onion Skinning Prototype #107641
|
@ -129,6 +129,7 @@ static void OVERLAY_engine_init(void *vedata)
|
|||
OVERLAY_outline_init(data);
|
||||
OVERLAY_wireframe_init(data);
|
||||
OVERLAY_paint_init(data);
|
||||
OVERLAY_onion_skin_init(data);
|
||||
}
|
||||
|
||||
static void OVERLAY_cache_init(void *vedata)
|
||||
|
@ -216,12 +217,10 @@ static void OVERLAY_cache_init(void *vedata)
|
|||
OVERLAY_image_cache_init(data);
|
||||
OVERLAY_metaball_cache_init(data);
|
||||
OVERLAY_motion_path_cache_init(data);
|
||||
OVERLAY_onion_skin_init(data);
|
||||
OVERLAY_outline_cache_init(data);
|
||||
OVERLAY_particle_cache_init(data);
|
||||
OVERLAY_wireframe_cache_init(data);
|
||||
OVERLAY_volume_cache_init(data);
|
||||
OVERLAY_onion_skin_init(data);
|
||||
}
|
||||
|
||||
BLI_INLINE OVERLAY_DupliData *OVERLAY_duplidata_get(Object *ob, void *vedata, bool *do_init)
|
||||
|
|
|
@ -4,16 +4,24 @@
|
|||
|
||||
#include "ED_onion_skin.h"
|
||||
#include "MEM_guardedalloc.h"
|
||||
#include "WM_api.h"
|
||||
#include "WM_types.h"
|
||||
|
||||
static void add_exec(bContext *C, wmOperator *op)
|
||||
static int onion_skin_add_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
ListBase selected = {NULL, NULL};
|
||||
CTX_data_selected_objects(C, &selected);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
|
||||
|
||||
LISTBASE_FOREACH (Object *, ob, &selected) {
|
||||
/* Mesh *mesh; */
|
||||
OnionSkinMesh *link = MEM_callocN(sizeof(OnionSkinMesh), "onion skin mesh link");
|
||||
/* link->mesh = mesh; */
|
||||
BLI_addtail(&scene->onion_skin_cache.meshes, link);
|
||||
}
|
||||
|
||||
BLI_freelistN(&selected);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static void ANIM_OT_onion_skin_add(wmOperatorType *ot)
|
||||
|
@ -24,7 +32,7 @@ static void ANIM_OT_onion_skin_add(wmOperatorType *ot)
|
|||
ot->idname = "ANIM_OT_onion_skin_add";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec = add_exec;
|
||||
ot->exec = onion_skin_add_exec;
|
||||
/* ot->cancel = WM_gesture_box_cancel; */
|
||||
|
||||
/* ot->poll = ed_markers_poll_markers_exist; */
|
||||
|
@ -35,7 +43,7 @@ static void ANIM_OT_onion_skin_add(wmOperatorType *ot)
|
|||
/* properties */
|
||||
}
|
||||
|
||||
ED_operatortypes_onion_skin(void)
|
||||
void ED_operatortypes_onion_skin(void)
|
||||
{
|
||||
WM_operatortype_append(ANIM_OT_onion_skin_add);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "DNA_customdata_types.h" /* Scene's runtime custom-data masks. */
|
||||
#include "DNA_layer_types.h"
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_mesh_types.h"
|
||||
#include "DNA_vec_types.h"
|
||||
#include "DNA_view3d_types.h"
|
||||
|
||||
|
@ -1875,9 +1876,15 @@ enum {
|
|||
/** \name Scene ID-Block
|
||||
* \{ */
|
||||
|
||||
typedef struct SceneOnionSkin {
|
||||
SceneOnionSkin *prev, *next;
|
||||
typedef struct OnionSkinMesh {
|
||||
struct OnionSkinMesh *prev, *next;
|
||||
Mesh *mesh;
|
||||
} OnionSkinMesh;
|
||||
|
||||
typedef struct SceneOnionSkin {
|
||||
float color[3];
|
||||
float alpha;
|
||||
ListBase meshes /* OnionSkinMesh */;
|
||||
} SceneOnionSkin;
|
||||
|
||||
typedef struct Scene {
|
||||
|
@ -1999,7 +2006,7 @@ typedef struct Scene {
|
|||
struct SceneDisplay display;
|
||||
struct SceneEEVEE eevee;
|
||||
struct SceneGpencil grease_pencil_settings;
|
||||
struct ListBase onion_skin_cache /* SceneOnionSkin */;
|
||||
struct SceneOnionSkin onion_skin_cache;
|
||||
} Scene;
|
||||
|
||||
/** \} */
|
||||
|
|
Loading…
Reference in New Issue