Per-track grease pencil data blocks
Added support of tracks to have their own grease pencil datablock. This is controllable by Clip/Track toggle in Grease Pencil panel in Clip Editor. This toggle shows whether grease pencil stroke should go to movie clip's datablock or to active track. As soon as this toggle is switched to Track, all further strokes would be added to active track and only strokes which belongs to active track would be displayed on the screen. This strokes would be relative to track's position, which means if one made some strokes to track and started moving it, stokes would be moved together with track. Different tracks might share the same grease pencil datablock. Also hide draw modes which are not supported by space clip. Initial idea why tracks should have grease pencil datablocks was to support easy mask creation for tracking. This seemed fastest and easiest way to achieve mask editing for tracks. To get mask for specified track there's function BKE_tracking_track_mask_get which requires MovieTracking structure, track for which mask is creating and also width and height of current overall frame. it'll return ImBuf with mask (probably it's more like overkill, because internally it works with single-channel value buffer and probably that's one should be passing to libmv). Probably hacking grease pencil in such way is not ideal solution, but that part of code might be cleaned up further and it seems to be straightforward to use grease pencil for such a purpose. Note: this is commit to tomato branch, not to trunk.
This commit is contained in:
@@ -77,6 +77,7 @@ struct ImBuf *BKE_tracking_get_pattern_imbuf(struct ImBuf *ibuf, struct MovieTra
|
||||
struct ImBuf *BKE_tracking_get_search_imbuf(struct ImBuf *ibuf, struct MovieTrackingTrack *track,
|
||||
struct MovieTrackingMarker *marker, int margin, int anchored,
|
||||
float pos[2], int origin[2]);
|
||||
struct ImBuf *BKE_tracking_track_mask_get(struct MovieTracking *tracking, struct MovieTrackingTrack *track, int width, int height);
|
||||
|
||||
void BKE_track_unique_name(struct ListBase *tracksbase, struct MovieTrackingTrack *track);
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ set(INC
|
||||
../../../intern/memutil
|
||||
../../../intern/mikktspace
|
||||
../../../intern/opennl/extern
|
||||
../../../intern/raskter
|
||||
|
||||
# XXX - BAD LEVEL CALL WM_api.h
|
||||
../windowmanager
|
||||
|
||||
@@ -17,6 +17,7 @@ incs += ' #/intern/smoke/extern'
|
||||
incs += ' #/intern/mikktspace'
|
||||
incs += ' #/intern/audaspace/intern'
|
||||
incs += ' #/intern/ffmpeg'
|
||||
incs += ' #/intern/raskter'
|
||||
|
||||
incs += ' ' + env['BF_OPENGL_INC']
|
||||
incs += ' ' + env['BF_ZLIB_INC']
|
||||
|
||||
@@ -59,6 +59,8 @@
|
||||
#include "IMB_imbuf_types.h"
|
||||
#include "IMB_imbuf.h"
|
||||
|
||||
#include "raskter.h"
|
||||
|
||||
#ifdef WITH_LIBMV
|
||||
# include "libmv-capi.h"
|
||||
#else
|
||||
@@ -1263,6 +1265,106 @@ ImBuf *BKE_tracking_get_search_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, Mov
|
||||
return get_area_imbuf(ibuf, track, marker, track->search_min, track->search_max, margin, anchored, pos, origin);
|
||||
}
|
||||
|
||||
static bGPDlayer *track_mask_gpencil_layer_get(MovieTrackingTrack *track)
|
||||
{
|
||||
bGPDlayer *layer;
|
||||
|
||||
if (!track->gpd)
|
||||
return NULL;
|
||||
|
||||
layer = track->gpd->layers.first;
|
||||
|
||||
while (layer) {
|
||||
if (layer->flag & GP_LAYER_ACTIVE)
|
||||
return layer;
|
||||
|
||||
layer = layer->next;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void track_mask_gpencil_layer_rasterize(MovieTracking *tracking, MovieTrackingTrack *track,
|
||||
bGPDlayer *layer, ImBuf *ibuf, int width, int height)
|
||||
{
|
||||
bGPDframe *frame = layer->frames.first;
|
||||
float *mask;
|
||||
int x, y;
|
||||
float aspy = 1.0f / tracking->camera.pixel_aspect;
|
||||
|
||||
mask = MEM_callocN(ibuf->x * ibuf->y * sizeof(float), "track mask");
|
||||
|
||||
while (frame) {
|
||||
bGPDstroke *stroke = frame->strokes.first;
|
||||
|
||||
while (stroke) {
|
||||
bGPDspoint *stroke_points = stroke->points;
|
||||
float *mask_points, *fp;
|
||||
int i;
|
||||
|
||||
if (stroke->flag & GP_STROKE_2DSPACE) {
|
||||
fp = mask_points = MEM_callocN(2 * stroke->totpoints * sizeof(float),
|
||||
"track mask rasterization points");
|
||||
|
||||
for (i = 0; i < stroke->totpoints; i++, fp += 2) {
|
||||
fp[0] = stroke_points[i].x * width / ibuf->x - track->search_min[0];
|
||||
fp[1] = stroke_points[i].y * height * aspy / ibuf->x - track->search_min[1];
|
||||
}
|
||||
|
||||
PLX_raskterize(mask_points, stroke->totpoints, mask, ibuf->x, ibuf->y);
|
||||
|
||||
MEM_freeN(mask_points);
|
||||
}
|
||||
|
||||
stroke = stroke->next;
|
||||
}
|
||||
|
||||
frame = frame->next;
|
||||
}
|
||||
|
||||
for (y = 0; y < ibuf->y; y++) {
|
||||
for (x = 0; x < ibuf->x; x++) {
|
||||
float *pixel = &ibuf->rect_float[4 * (y * ibuf->x + x)];
|
||||
float val = mask[y * ibuf->x + x];
|
||||
|
||||
pixel[0] = val;
|
||||
pixel[1] = val;
|
||||
pixel[2] = val;
|
||||
pixel[3] = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
MEM_freeN(mask);
|
||||
|
||||
IMB_rect_from_float(ibuf);
|
||||
}
|
||||
|
||||
ImBuf *BKE_tracking_track_mask_get(MovieTracking *tracking, MovieTrackingTrack *track, int width, int height)
|
||||
{
|
||||
ImBuf *ibuf;
|
||||
bGPDlayer *layer = track_mask_gpencil_layer_get(track);
|
||||
int mask_width, mask_height;
|
||||
|
||||
/* XXX: currently copied from get_area_ibuf */
|
||||
mask_width = (track->search_max[0] - track->search_min[0]) * width;
|
||||
mask_height = (track->search_max[1] - track->search_min[1]) * height;
|
||||
|
||||
mask_width = mask_width | 1;
|
||||
mask_height = mask_height | 1;
|
||||
|
||||
ibuf = IMB_allocImBuf(mask_width, mask_height, 32, IB_rect | IB_rectfloat);
|
||||
|
||||
if (layer) {
|
||||
track_mask_gpencil_layer_rasterize(tracking, track, layer, ibuf, width, height);
|
||||
}
|
||||
else {
|
||||
float white[4] = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
IMB_rectfill(ibuf, white);
|
||||
}
|
||||
|
||||
return ibuf;
|
||||
}
|
||||
|
||||
#ifdef WITH_LIBMV
|
||||
|
||||
/* Convert from float and byte RGBA to grayscale. Supports different coefficients for RGB. */
|
||||
|
||||
@@ -6198,7 +6198,7 @@ static void direct_link_movieReconstruction(FileData *fd, MovieTrackingReconstru
|
||||
reconstruction->cameras= newdataadr(fd, reconstruction->cameras);
|
||||
}
|
||||
|
||||
static void direct_link_movieTracks(FileData *fd, ListBase *tracksbase)
|
||||
static void direct_link_movieTracks(FileData *fd, MovieClip *clip, ListBase *tracksbase)
|
||||
{
|
||||
MovieTrackingTrack *track;
|
||||
|
||||
@@ -6207,6 +6207,7 @@ static void direct_link_movieTracks(FileData *fd, ListBase *tracksbase)
|
||||
track= tracksbase->first;
|
||||
while (track) {
|
||||
track->markers= newdataadr(fd, track->markers);
|
||||
track->gpd= newlibadr_us(fd, clip->id.lib, track->gpd);
|
||||
|
||||
track= track->next;
|
||||
}
|
||||
@@ -6225,7 +6226,7 @@ static void direct_link_movieclip(FileData *fd, MovieClip *clip)
|
||||
if (fd->movieclipmap) clip->tracking.camera.intrinsics= newmclipadr(fd, clip->tracking.camera.intrinsics);
|
||||
else clip->tracking.camera.intrinsics= NULL;
|
||||
|
||||
direct_link_movieTracks(fd, &tracking->tracks);
|
||||
direct_link_movieTracks(fd, clip, &tracking->tracks);
|
||||
direct_link_movieReconstruction(fd, &tracking->reconstruction);
|
||||
|
||||
clip->tracking.act_track= newdataadr(fd, clip->tracking.act_track);
|
||||
@@ -6245,7 +6246,7 @@ static void direct_link_movieclip(FileData *fd, MovieClip *clip)
|
||||
|
||||
object= tracking->objects.first;
|
||||
while (object) {
|
||||
direct_link_movieTracks(fd, &object->tracks);
|
||||
direct_link_movieTracks(fd, clip, &object->tracks);
|
||||
direct_link_movieReconstruction(fd, &object->reconstruction);
|
||||
|
||||
object= object->next;
|
||||
|
||||
@@ -2886,6 +2886,7 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil
|
||||
write_windowmanagers(wd, &mainvar->wm);
|
||||
write_screens (wd, &mainvar->screen);
|
||||
}
|
||||
write_gpencils (wd, &mainvar->gpencil);
|
||||
write_movieclips (wd, &mainvar->movieclip);
|
||||
write_masks (wd, &mainvar->mask);
|
||||
write_scenes (wd, &mainvar->scene);
|
||||
@@ -2912,7 +2913,6 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil
|
||||
write_nodetrees(wd, &mainvar->nodetree);
|
||||
write_brushes (wd, &mainvar->brush);
|
||||
write_scripts (wd, &mainvar->script);
|
||||
write_gpencils (wd, &mainvar->gpencil);
|
||||
write_libraries(wd, mainvar->next);
|
||||
|
||||
if (write_user_block) {
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
#include "DNA_gpencil_types.h"
|
||||
#include "DNA_screen_types.h"
|
||||
#include "DNA_space_types.h"
|
||||
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_global.h"
|
||||
@@ -236,6 +237,7 @@ static void draw_gpencil_panel(bContext *C, uiLayout *layout, bGPdata *gpd, Poin
|
||||
PointerRNA gpd_ptr;
|
||||
bGPDlayer *gpl;
|
||||
uiLayout *col, *row;
|
||||
SpaceClip *sc= CTX_wm_space_clip(C);
|
||||
short v3d_stroke_opts = STROKE_OPTS_NORMAL;
|
||||
const short is_v3d = CTX_wm_view3d(C) != NULL;
|
||||
|
||||
@@ -244,6 +246,16 @@ static void draw_gpencil_panel(bContext *C, uiLayout *layout, bGPdata *gpd, Poin
|
||||
|
||||
/* draw gpd settings first ------------------------------------- */
|
||||
col = uiLayoutColumn(layout, 0);
|
||||
|
||||
if (sc) {
|
||||
bScreen *screen = CTX_wm_screen(C);
|
||||
PointerRNA sc_ptr;
|
||||
|
||||
RNA_pointer_create(&screen->id, &RNA_SpaceClipEditor, sc, &sc_ptr);
|
||||
row = uiLayoutRow(col, 1);
|
||||
uiItemR(row, &sc_ptr, "grease_pencil_source", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
||||
}
|
||||
|
||||
/* current Grease Pencil block */
|
||||
/* TODO: show some info about who owns this? */
|
||||
uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_add", NULL, "GPENCIL_OT_data_unlink");
|
||||
@@ -281,14 +293,17 @@ static void draw_gpencil_panel(bContext *C, uiLayout *layout, bGPdata *gpd, Poin
|
||||
row = uiLayoutRow(col, 1);
|
||||
uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "VIEW", NULL, ICON_NONE);
|
||||
uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "CURSOR", NULL, ICON_NONE);
|
||||
row = uiLayoutRow(col, 1);
|
||||
uiLayoutSetActive(row, v3d_stroke_opts);
|
||||
uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "SURFACE", NULL, ICON_NONE);
|
||||
uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "STROKE", NULL, ICON_NONE);
|
||||
|
||||
row = uiLayoutRow(col, 0);
|
||||
uiLayoutSetActive(row, v3d_stroke_opts == STROKE_OPTS_V3D_ON);
|
||||
uiItemR(row, &gpd_ptr, "use_stroke_endpoints", 0, NULL, ICON_NONE);
|
||||
if (sc == NULL) {
|
||||
row = uiLayoutRow(col, 1);
|
||||
uiLayoutSetActive(row, v3d_stroke_opts);
|
||||
uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "SURFACE", NULL, ICON_NONE);
|
||||
uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "STROKE", NULL, ICON_NONE);
|
||||
|
||||
row = uiLayoutRow(col, 0);
|
||||
uiLayoutSetActive(row, v3d_stroke_opts == STROKE_OPTS_V3D_ON);
|
||||
uiItemR(row, &gpd_ptr, "use_stroke_endpoints", 0, NULL, ICON_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
#include "BKE_library.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_report.h"
|
||||
#include "BKE_tracking.h"
|
||||
|
||||
|
||||
#include "WM_api.h"
|
||||
@@ -144,9 +145,23 @@ bGPdata **gpencil_data_get_pointers(bContext *C, PointerRNA *ptr)
|
||||
MovieClip *clip = ED_space_clip(sc);
|
||||
|
||||
if (clip) {
|
||||
/* for now, as long as there's a clip, default to using that in Clip Editor */
|
||||
if (ptr) RNA_id_pointer_create(&clip->id, ptr);
|
||||
return &clip->gpd;
|
||||
if (sc->gpencil_src == SC_GPENCIL_SRC_TRACK) {
|
||||
MovieTrackingTrack *track = BKE_tracking_active_track(&clip->tracking);
|
||||
|
||||
if (!track)
|
||||
return NULL;
|
||||
|
||||
if (ptr)
|
||||
RNA_pointer_create(&clip->id, &RNA_MovieTrackingTrack, track, ptr);
|
||||
|
||||
return &track->gpd;
|
||||
}
|
||||
else {
|
||||
if (ptr)
|
||||
RNA_id_pointer_create(&clip->id, ptr);
|
||||
|
||||
return &clip->gpd;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_report.h"
|
||||
#include "BKE_tracking.h"
|
||||
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
@@ -1125,6 +1126,15 @@ static int gp_session_initdata(bContext *C, tGPsdata *p)
|
||||
p->custom_color[1] = 0.0f;
|
||||
p->custom_color[2] = 0.5f;
|
||||
p->custom_color[3] = 0.9f;
|
||||
|
||||
if (sc->gpencil_src == SC_GPENCIL_SRC_TRACK) {
|
||||
int framenr = sc->user.framenr;
|
||||
MovieTrackingTrack *track = BKE_tracking_active_track(&sc->clip->tracking);
|
||||
MovieTrackingMarker *marker = BKE_tracking_exact_marker(track, framenr);
|
||||
|
||||
p->imat[3][0] -= marker->pos[0];
|
||||
p->imat[3][1] -= marker->pos[1];
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -1196,8 +1196,10 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip,
|
||||
int i, j, a;
|
||||
float pos[2], tpos[2], grid[11][11][2];
|
||||
MovieTracking *tracking = &clip->tracking;
|
||||
bGPdata *gpd = NULL;
|
||||
float aspy = 1.0f / tracking->camera.pixel_aspect;
|
||||
float dx = (float)width / n, dy = (float)height / n * aspy;
|
||||
float offsx = 0.0f, offsy = 0.0f;
|
||||
|
||||
if (sc->mode != SC_MODE_DISTORTION)
|
||||
return;
|
||||
@@ -1305,8 +1307,27 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip,
|
||||
}
|
||||
}
|
||||
|
||||
if (sc->flag & SC_MANUAL_CALIBRATION && clip->gpd) {
|
||||
bGPDlayer *layer = clip->gpd->layers.first;
|
||||
if (sc->gpencil_src == SC_GPENCIL_SRC_TRACK) {
|
||||
MovieTrackingTrack *track = BKE_tracking_active_track(&sc->clip->tracking);
|
||||
|
||||
if (track) {
|
||||
int framenr = sc->user.framenr;
|
||||
MovieTrackingMarker *marker = BKE_tracking_exact_marker(track, framenr);
|
||||
|
||||
offsx = marker->pos[0];
|
||||
offsy = marker->pos[1];
|
||||
|
||||
gpd = track->gpd;
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
gpd = clip->gpd;
|
||||
}
|
||||
|
||||
|
||||
if (sc->flag & SC_MANUAL_CALIBRATION) {
|
||||
bGPDlayer *layer = gpd->layers.first;
|
||||
|
||||
while (layer) {
|
||||
bGPDframe *frame = layer->frames.first;
|
||||
@@ -1331,11 +1352,11 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip,
|
||||
float npos[2], dpos[2], len;
|
||||
int steps;
|
||||
|
||||
pos[0] = stroke->points[i].x * width;
|
||||
pos[1] = stroke->points[i].y * height * aspy;
|
||||
pos[0] = (stroke->points[i].x + offsx) * width;
|
||||
pos[1] = (stroke->points[i].y + offsy) * height * aspy;
|
||||
|
||||
npos[0] = stroke->points[i + 1].x * width;
|
||||
npos[1] = stroke->points[i + 1].y * height * aspy;
|
||||
npos[0] = (stroke->points[i + 1].x + offsx) * width;
|
||||
npos[1] = (stroke->points[i + 1].y + offsy) * height * aspy;
|
||||
|
||||
len = len_v2v2(pos, npos);
|
||||
steps = ceil(len / 5.0f);
|
||||
@@ -1360,7 +1381,7 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip,
|
||||
}
|
||||
else if (stroke->totpoints == 1) {
|
||||
glBegin(GL_POINTS);
|
||||
glVertex2f(stroke->points[0].x, stroke->points[0].y);
|
||||
glVertex2f(stroke->points[0].x + offsx, stroke->points[0].y + offsy);
|
||||
glEnd();
|
||||
}
|
||||
}
|
||||
@@ -1464,6 +1485,18 @@ void clip_draw_grease_pencil(bContext *C, int onlyv2d)
|
||||
if (ibuf) {
|
||||
glPushMatrix();
|
||||
glMultMatrixf(sc->unistabmat);
|
||||
|
||||
if (sc->gpencil_src == SC_GPENCIL_SRC_TRACK) {
|
||||
MovieTrackingTrack *track = BKE_tracking_active_track(&sc->clip->tracking);
|
||||
|
||||
if (track) {
|
||||
int framenr = sc->user.framenr;
|
||||
MovieTrackingMarker *marker = BKE_tracking_exact_marker(track, framenr);
|
||||
|
||||
glTranslatef(marker->pos[0], marker->pos[1], 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
draw_gpencil_2dimage(C, ibuf);
|
||||
|
||||
IMB_freeImBuf(ibuf);
|
||||
|
||||
@@ -389,8 +389,11 @@ static void clip_listener(ScrArea *sa, wmNotifier *wmn)
|
||||
}
|
||||
break;
|
||||
case NC_SCREEN:
|
||||
if (wmn->data == ND_ANIMPLAY) {
|
||||
ED_area_tag_redraw(sa);
|
||||
switch (wmn->data) {
|
||||
case ND_ANIMPLAY:
|
||||
case ND_GPENCIL:
|
||||
ED_area_tag_redraw(sa);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case NC_SPACE:
|
||||
|
||||
@@ -521,7 +521,10 @@ typedef struct SpaceClip {
|
||||
* defined when drawing and used for mouse position calculation */
|
||||
|
||||
/* movie postprocessing */
|
||||
int postproc_flag, pad2;
|
||||
int postproc_flag;
|
||||
|
||||
/* grease pencil */
|
||||
short gpencil_src, pad2;
|
||||
|
||||
void *draw_context;
|
||||
|
||||
@@ -935,6 +938,10 @@ enum {
|
||||
/* SpaceClip->dope_flag */
|
||||
#define SC_DOPE_SORT_INVERSE 1
|
||||
|
||||
/* SPaceClip->gpencil_src */
|
||||
#define SC_GPENCIL_SRC_CLIP 0
|
||||
#define SC_GPENCIL_SRC_TRACK 1
|
||||
|
||||
/* space types, moved from DNA_screen_types.h */
|
||||
/* Do NOT change order, append on end. types are hardcoded needed */
|
||||
enum {
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
/* match-moving data */
|
||||
|
||||
struct bGPdata;
|
||||
struct ImBuf;
|
||||
struct MovieReconstructedCamera;
|
||||
struct MovieTrackingCamera;
|
||||
@@ -127,6 +128,8 @@ typedef struct MovieTrackingTrack {
|
||||
|
||||
/* ** SAD tracker settings ** */
|
||||
float minimum_correlation; /* minimal correlation which is still treated as successful tracking */
|
||||
|
||||
struct bGPdata *gpd; /* grease-pencil data */
|
||||
} MovieTrackingTrack;
|
||||
|
||||
typedef struct MovieTrackingSettings {
|
||||
|
||||
@@ -284,6 +284,7 @@ static void rna_def_movieclip(BlenderRNA *brna)
|
||||
RNA_def_property_flag(prop, PROP_EDITABLE);
|
||||
RNA_def_property_struct_type(prop, "GreasePencil");
|
||||
RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this movie clip");
|
||||
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
||||
}
|
||||
|
||||
void RNA_def_movieclip(BlenderRNA *brna)
|
||||
|
||||
@@ -2980,6 +2980,12 @@ static void rna_def_space_clip(BlenderRNA *brna)
|
||||
{0, NULL, 0, NULL, NULL}
|
||||
};
|
||||
|
||||
static EnumPropertyItem gpencil_source_items[] = {
|
||||
{SC_GPENCIL_SRC_CLIP, "CLIP", 0, "Clip", "Show grease pencil datablock which belongs to movie clip"},
|
||||
{SC_GPENCIL_SRC_TRACK, "TRACK", 0, "Track", "Show grease pencil datablock which belongs to active track"},
|
||||
{0, NULL, 0, NULL, NULL}
|
||||
};
|
||||
|
||||
srna = RNA_def_struct(brna, "SpaceClipEditor", "Space");
|
||||
RNA_def_struct_sdna(srna, "SpaceClip");
|
||||
RNA_def_struct_ui_text(srna, "Space Clip Editor", "Clip editor space data");
|
||||
@@ -3166,6 +3172,13 @@ static void rna_def_space_clip(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
|
||||
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
||||
|
||||
/* grease pencil source */
|
||||
prop = RNA_def_property(srna, "grease_pencil_source", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, NULL, "gpencil_src");
|
||||
RNA_def_property_enum_items(prop, gpencil_source_items);
|
||||
RNA_def_property_ui_text(prop, "Grease Pencil Source", "Where the grease pencil comes from");
|
||||
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
||||
|
||||
/* ** dopesheet ** */
|
||||
|
||||
/* dopesheet sort */
|
||||
|
||||
@@ -1088,6 +1088,14 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
|
||||
RNA_def_property_float_sdna(prop, NULL, "error");
|
||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||
RNA_def_property_ui_text(prop, "Average Error", "Average error of re-projection");
|
||||
|
||||
/* grease pencil */
|
||||
prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "gpd");
|
||||
RNA_def_property_flag(prop, PROP_EDITABLE);
|
||||
RNA_def_property_struct_type(prop, "GreasePencil");
|
||||
RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this track");
|
||||
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
||||
}
|
||||
|
||||
static void rna_def_trackingStabilization(BlenderRNA *brna)
|
||||
|
||||
Reference in New Issue
Block a user