~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to source/blender/editors/space_clip/clip_buttons.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
#include "BLI_math.h"
42
42
#include "BLI_utildefines.h"
43
43
#include "BLI_listbase.h"
 
44
#include "BLI_rect.h"
 
45
 
 
46
#include "BLF_translation.h"
44
47
 
45
48
#include "BKE_context.h"
46
49
#include "BKE_depsgraph.h"
59
62
#include "WM_api.h"
60
63
#include "WM_types.h"
61
64
 
62
 
#include "clip_intern.h"        // own include
 
65
#include "clip_intern.h"  /* own include */
63
66
 
64
67
/* Panels */
65
68
 
 
69
static int clip_grease_pencil_panel_poll(const bContext *C, PanelType *UNUSED(pt))
 
70
{
 
71
        SpaceClip *sc = CTX_wm_space_clip(C);
 
72
 
 
73
        return sc->view == SC_VIEW_CLIP;
 
74
}
 
75
 
66
76
void ED_clip_buttons_register(ARegionType *art)
67
77
{
68
78
        PanelType *pt;
70
80
        pt = MEM_callocN(sizeof(PanelType), "spacetype clip panel gpencil");
71
81
        strcpy(pt->idname, "CLIP_PT_gpencil");
72
82
        strcpy(pt->label, "Grease Pencil");
 
83
        pt->draw_header = gpencil_panel_standard_header;
73
84
        pt->draw = gpencil_panel_standard;
74
85
        pt->flag |= PNL_DEFAULT_CLOSED;
 
86
        pt->poll = clip_grease_pencil_panel_poll;
75
87
        BLI_addtail(&art->paneltypes, pt);
76
88
}
77
89
 
110
122
                uiTemplateID(layout, C, ptr, propname, NULL, "CLIP_OT_open", NULL);
111
123
 
112
124
        if (clip) {
113
 
                row = uiLayoutRow(layout, 0);
 
125
                uiLayout *col;
 
126
 
 
127
                row = uiLayoutRow(layout, FALSE);
114
128
                block = uiLayoutGetBlock(row);
115
 
                uiDefBut(block, LABEL, 0, "File Path:", 0, 19, 145, 19, NULL, 0, 0, 0, 0, "");
 
129
                uiDefBut(block, LABEL, 0, IFACE_("File Path:"), 0, 19, 145, 19, NULL, 0, 0, 0, 0, "");
116
130
 
117
 
                row = uiLayoutRow(layout, 0);
118
 
                split = uiLayoutSplit(row, 0.0, 0);
119
 
                row = uiLayoutRow(split, 1);
 
131
                row = uiLayoutRow(layout, FALSE);
 
132
                split = uiLayoutSplit(row, 0.0f, FALSE);
 
133
                row = uiLayoutRow(split, TRUE);
120
134
 
121
135
                uiItemR(row, &clipptr, "filepath", 0, "", ICON_NONE);
122
136
                uiItemO(row, "", ICON_FILE_REFRESH, "clip.reload");
 
137
 
 
138
                col = uiLayoutColumn(layout, FALSE);
 
139
                uiTemplateColorspaceSettings(col, &clipptr, "colorspace_settings");
123
140
        }
124
141
}
125
142
 
152
169
        scopesptr = RNA_property_pointer_get(ptr, prop);
153
170
        scopes = (MovieClipScopes *)scopesptr.data;
154
171
 
155
 
        rect.xmin = 0; rect.xmax = 200;
156
 
        rect.ymin = 0; rect.ymax = 120;
 
172
        rect.xmin = 0; rect.xmax = 10.0f * UI_UNIT_X;
 
173
        rect.ymin = 0; rect.ymax = 6.0f * UI_UNIT_Y;
157
174
 
158
175
        block = uiLayoutAbsoluteBlock(layout);
159
176
 
160
 
        scopes->track_preview_height = (scopes->track_preview_height<=UI_UNIT_Y)?UI_UNIT_Y:scopes->track_preview_height;
 
177
        scopes->track_preview_height =
 
178
                (scopes->track_preview_height <= 20) ? 20 : scopes->track_preview_height;
161
179
 
162
 
        uiDefBut(block, TRACKPREVIEW, 0, "", rect.xmin, rect.ymin, rect.xmax-rect.xmin, scopes->track_preview_height, scopes, 0, 0, 0, 0, "");
 
180
        uiDefBut(block, TRACKPREVIEW, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect),
 
181
                 scopes->track_preview_height * UI_DPI_FAC, scopes, 0, 0, 0, 0, "");
163
182
}
164
183
 
165
184
/********************* Marker Template ************************/
166
185
 
167
 
#define B_MARKER_POS                    3
168
 
#define B_MARKER_OFFSET                 4
169
 
#define B_MARKER_PAT_DIM                5
170
 
#define B_MARKER_SEARCH_POS             6
171
 
#define B_MARKER_SEARCH_DIM             7
172
 
#define B_MARKER_FLAG                   8
 
186
#define B_MARKER_POS            3
 
187
#define B_MARKER_OFFSET         4
 
188
#define B_MARKER_PAT_DIM        5
 
189
#define B_MARKER_SEARCH_POS     6
 
190
#define B_MARKER_SEARCH_DIM     7
 
191
#define B_MARKER_FLAG           8
173
192
 
174
193
typedef struct {
175
 
        int compact;                                                            /* compact mode */
 
194
        int compact;                                /* compact mode */
176
195
 
177
196
        MovieClip *clip;
178
 
        MovieClipUser *user;                                            /* user of clip */
 
197
        MovieClipUser *user;                        /* user of clip */
179
198
        MovieTrackingTrack *track;
 
199
        MovieTrackingMarker *marker;
180
200
 
181
 
        int framenr;                                                            /* current frame number */
182
 
        float marker_pos[2];                                            /* position of marker in pixel coords */
183
 
        float track_pat[2];                                                     /* position and dimensions of marker pattern in pixel coords */
184
 
        float track_offset[2];                                          /* offset of "parenting" point */
185
 
        float track_search_pos[2], track_search[2];     /* position and dimensions of marker search in pixel coords */
186
 
        int marker_flag;                                                        /* marker's flags */
 
201
        int framenr;                                    /* current frame number */
 
202
        float marker_pos[2];                            /* position of marker in pixel coords */
 
203
        float marker_pat[2];                            /* position and dimensions of marker pattern in pixel coords */
 
204
        float track_offset[2];                          /* offset of "parenting" point */
 
205
        float marker_search_pos[2], marker_search[2];   /* position and dimensions of marker search in pixel coords */
 
206
        int marker_flag;                                /* marker's flags */
187
207
} MarkerUpdateCb;
188
208
 
189
209
static void to_pixel_space(float r[2], float a[2], int width, int height)
195
215
 
196
216
static void marker_update_cb(bContext *C, void *arg_cb, void *UNUSED(arg))
197
217
{
198
 
        MarkerUpdateCb *cb = (MarkerUpdateCb*) arg_cb;
 
218
        MarkerUpdateCb *cb = (MarkerUpdateCb *) arg_cb;
199
219
        MovieTrackingMarker *marker;
200
220
 
201
221
        if (!cb->compact)
202
222
                return;
203
223
 
204
 
        marker = BKE_tracking_ensure_marker(cb->track, cb->framenr);
 
224
        marker = BKE_tracking_marker_ensure(cb->track, cb->framenr);
205
225
 
206
226
        marker->flag = cb->marker_flag;
207
227
 
208
 
        WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, NULL);
 
228
        WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, NULL);
209
229
}
210
230
 
211
231
static void marker_block_handler(bContext *C, void *arg_cb, int event)
212
232
{
213
 
        MarkerUpdateCb *cb = (MarkerUpdateCb*) arg_cb;
 
233
        MarkerUpdateCb *cb = (MarkerUpdateCb *) arg_cb;
214
234
        MovieTrackingMarker *marker;
215
235
        int width, height, ok = FALSE;
216
236
 
217
237
        BKE_movieclip_get_size(cb->clip, cb->user, &width, &height);
218
238
 
219
 
        marker = BKE_tracking_ensure_marker(cb->track, cb->framenr);
 
239
        marker = BKE_tracking_marker_ensure(cb->track, cb->framenr);
220
240
 
221
241
        if (event == B_MARKER_POS) {
222
 
                marker->pos[0] = cb->marker_pos[0]/width;
223
 
                marker->pos[1] = cb->marker_pos[1]/height;
 
242
                marker->pos[0] = cb->marker_pos[0] / width;
 
243
                marker->pos[1] = cb->marker_pos[1] / height;
224
244
 
225
245
                /* to update position of "parented" objects */
226
246
                DAG_id_tag_update(&cb->clip->id, 0);
227
 
                WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, NULL);
 
247
                WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, NULL);
228
248
 
229
249
                ok = TRUE;
230
250
        }
231
251
        else if (event == B_MARKER_PAT_DIM) {
232
 
                float dim[2], pat_dim[2];
233
 
 
234
 
                sub_v2_v2v2(pat_dim, cb->track->pat_max, cb->track->pat_min);
235
 
 
236
 
                dim[0] = cb->track_pat[0] / width;
237
 
                dim[1] = cb->track_pat[1] / height;
238
 
 
239
 
                sub_v2_v2(dim, pat_dim);
240
 
                mul_v2_fl(dim, 0.5f);
241
 
 
242
 
                cb->track->pat_min[0] -= dim[0];
243
 
                cb->track->pat_min[1] -= dim[1];
244
 
 
245
 
                cb->track->pat_max[0] += dim[0];
246
 
                cb->track->pat_max[1] += dim[1];
247
 
 
248
 
                BKE_tracking_clamp_track(cb->track, CLAMP_PAT_DIM);
 
252
                float dim[2], pat_dim[2], pat_min[2], pat_max[2];
 
253
                float scale_x, scale_y;
 
254
                int a;
 
255
 
 
256
                BKE_tracking_marker_pattern_minmax(cb->marker, pat_min, pat_max);
 
257
 
 
258
                sub_v2_v2v2(pat_dim, pat_max, pat_min);
 
259
 
 
260
                dim[0] = cb->marker_pat[0] / width;
 
261
                dim[1] = cb->marker_pat[1] / height;
 
262
 
 
263
                scale_x = dim[0] / pat_dim[0];
 
264
                scale_y = dim[1] / pat_dim[1];
 
265
 
 
266
                for (a = 0; a < 4; a++) {
 
267
                        cb->marker->pattern_corners[a][0] *= scale_x;
 
268
                        cb->marker->pattern_corners[a][1] *= scale_y;
 
269
                }
 
270
 
 
271
                BKE_tracking_marker_clamp(cb->marker, CLAMP_PAT_DIM);
249
272
 
250
273
                ok = TRUE;
251
274
        }
252
275
        else if (event == B_MARKER_SEARCH_POS) {
253
276
                float delta[2], side[2];
254
277
 
255
 
                sub_v2_v2v2(side, cb->track->search_max, cb->track->search_min);
 
278
                sub_v2_v2v2(side, cb->marker->search_max, cb->marker->search_min);
256
279
                mul_v2_fl(side, 0.5f);
257
280
 
258
 
                delta[0] = cb->track_search_pos[0] / width;
259
 
                delta[1] = cb->track_search_pos[1] / height;
260
 
 
261
 
                sub_v2_v2v2(cb->track->search_min, delta, side);
262
 
                add_v2_v2v2(cb->track->search_max, delta, side);
263
 
 
264
 
                BKE_tracking_clamp_track(cb->track, CLAMP_SEARCH_POS);
 
281
                delta[0] = cb->marker_search_pos[0] / width;
 
282
                delta[1] = cb->marker_search_pos[1] / height;
 
283
 
 
284
                sub_v2_v2v2(cb->marker->search_min, delta, side);
 
285
                add_v2_v2v2(cb->marker->search_max, delta, side);
 
286
 
 
287
                BKE_tracking_marker_clamp(cb->marker, CLAMP_SEARCH_POS);
265
288
 
266
289
                ok = TRUE;
267
290
        }
268
291
        else if (event == B_MARKER_SEARCH_DIM) {
269
292
                float dim[2], search_dim[2];
270
293
 
271
 
                sub_v2_v2v2(search_dim, cb->track->search_max, cb->track->search_min);
 
294
                sub_v2_v2v2(search_dim, cb->marker->search_max, cb->marker->search_min);
272
295
 
273
 
                dim[0] = cb->track_search[0]/width;
274
 
                dim[1] = cb->track_search[1]/height;
 
296
                dim[0] = cb->marker_search[0] / width;
 
297
                dim[1] = cb->marker_search[1] / height;
275
298
 
276
299
                sub_v2_v2(dim, search_dim);
277
300
                mul_v2_fl(dim, 0.5f);
278
301
 
279
 
                cb->track->search_min[0]-= dim[0];
280
 
                cb->track->search_min[1]-= dim[1];
281
 
 
282
 
                cb->track->search_max[0]+= dim[0];
283
 
                cb->track->search_max[1]+= dim[1];
284
 
 
285
 
                BKE_tracking_clamp_track(cb->track, CLAMP_SEARCH_DIM);
 
302
                cb->marker->search_min[0] -= dim[0];
 
303
                cb->marker->search_min[1] -= dim[1];
 
304
 
 
305
                cb->marker->search_max[0] += dim[0];
 
306
                cb->marker->search_max[1] += dim[1];
 
307
 
 
308
                BKE_tracking_marker_clamp(cb->marker, CLAMP_SEARCH_DIM);
286
309
 
287
310
                ok = TRUE;
288
311
        }
306
329
 
307
330
                /* to update position of "parented" objects */
308
331
                DAG_id_tag_update(&cb->clip->id, 0);
309
 
                WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, NULL);
 
332
                WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, NULL);
310
333
 
311
334
                ok = TRUE;
312
335
        }
313
336
 
314
337
        if (ok)
315
 
                WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, cb->clip);
 
338
                WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, cb->clip);
316
339
}
317
340
 
318
 
void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, PointerRNA *userptr, PointerRNA *trackptr, int compact)
 
341
void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, PointerRNA *userptr,
 
342
                      PointerRNA *trackptr, int compact)
319
343
{
320
344
        PropertyRNA *prop;
321
345
        uiBlock *block;
327
351
        MovieTrackingMarker *marker;
328
352
        MarkerUpdateCb *cb;
329
353
        const char *tip;
 
354
        float pat_min[2], pat_max[2];
330
355
 
331
356
        if (!ptr->data)
332
357
                return;
349
374
        user = userptr->data;
350
375
        track = trackptr->data;
351
376
 
352
 
        marker = BKE_tracking_get_marker(track, user->framenr);
 
377
        marker = BKE_tracking_marker_get(track, user->framenr);
353
378
 
354
379
        cb = MEM_callocN(sizeof(MarkerUpdateCb), "uiTemplateMarker update_cb");
355
380
        cb->compact = compact;
356
381
        cb->clip = clip;
357
382
        cb->user = user;
358
383
        cb->track = track;
 
384
        cb->marker = marker;
359
385
        cb->marker_flag = marker->flag;
360
386
        cb->framenr = user->framenr;
361
387
 
363
389
                block = uiLayoutGetBlock(layout);
364
390
 
365
391
                if (cb->marker_flag & MARKER_DISABLED)
366
 
                        tip= "Marker is disabled at current frame";
 
392
                        tip = TIP_("Marker is disabled at current frame");
367
393
                else
368
 
                        tip= "Marker is enabled at current frame";
 
394
                        tip = TIP_("Marker is enabled at current frame");
369
395
 
370
 
                bt = uiDefIconButBitI(block, TOGN, MARKER_DISABLED, 0, ICON_RESTRICT_VIEW_OFF, 0, 0, 20, 20, &cb->marker_flag, 0, 0, 1, 0, tip);
 
396
                bt = uiDefIconButBitI(block, TOGN, MARKER_DISABLED, 0, ICON_RESTRICT_VIEW_OFF, 0, 0, UI_UNIT_X, UI_UNIT_Y,
 
397
                                      &cb->marker_flag, 0, 0, 1, 0, tip);
371
398
                uiButSetNFunc(bt, marker_update_cb, cb, NULL);
372
399
        }
373
400
        else {
374
401
                int width, height, step, digits;
375
 
                float pat_dim[2], pat_pos[2], search_dim[2], search_pos[2];
 
402
                float pat_dim[2], search_dim[2], search_pos[2];
376
403
                uiLayout *col;
377
404
 
378
405
                BKE_movieclip_get_size(clip, user, &width, &height);
379
406
 
380
407
                if (track->flag & TRACK_LOCKED) {
381
 
                        uiLayoutSetActive(layout, 0);
 
408
                        uiLayoutSetActive(layout, FALSE);
382
409
                        block = uiLayoutAbsoluteBlock(layout);
383
 
                        uiDefBut(block, LABEL, 0, "Track is locked", 0, 0, 300, 19, NULL, 0, 0, 0, 0, "");
 
410
                        uiDefBut(block, LABEL, 0, IFACE_("Track is locked"), 0, 0, UI_UNIT_X*15.0f, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
384
411
 
385
412
                        return;
386
413
                }
387
414
 
388
 
                step= 100;
 
415
                step = 100;
389
416
                digits = 2;
390
417
 
391
 
                sub_v2_v2v2(pat_dim, track->pat_max, track->pat_min);
392
 
                sub_v2_v2v2(search_dim, track->search_max, track->search_min);
393
 
 
394
 
                add_v2_v2v2(search_pos, track->search_max, track->search_min);
 
418
                BKE_tracking_marker_pattern_minmax(marker, pat_min, pat_max);
 
419
 
 
420
                sub_v2_v2v2(pat_dim, pat_max, pat_min);
 
421
                sub_v2_v2v2(search_dim, marker->search_max, marker->search_min);
 
422
 
 
423
                add_v2_v2v2(search_pos, marker->search_max, marker->search_min);
395
424
                mul_v2_fl(search_pos, 0.5);
396
425
 
397
 
                add_v2_v2v2(pat_pos, track->pat_max, track->pat_min);
398
 
                mul_v2_fl(pat_pos, 0.5);
399
 
 
400
426
                to_pixel_space(cb->marker_pos, marker->pos, width, height);
401
 
                to_pixel_space(cb->track_pat, pat_dim, width, height);
402
 
                to_pixel_space(cb->track_search, search_dim, width, height);
403
 
                to_pixel_space(cb->track_search_pos, search_pos, width, height);
 
427
                to_pixel_space(cb->marker_pat, pat_dim, width, height);
 
428
                to_pixel_space(cb->marker_search, search_dim, width, height);
 
429
                to_pixel_space(cb->marker_search_pos, search_pos, width, height);
404
430
                to_pixel_space(cb->track_offset, track->offset, width, height);
405
431
 
406
432
                cb->marker_flag = marker->flag;
407
433
 
408
 
                block= uiLayoutAbsoluteBlock(layout);
 
434
                block = uiLayoutAbsoluteBlock(layout);
409
435
                uiBlockSetHandleFunc(block, marker_block_handler, cb);
410
436
                uiBlockSetNFunc(block, marker_update_cb, cb, NULL);
411
437
 
412
438
                if (cb->marker_flag & MARKER_DISABLED)
413
 
                        tip= "Marker is disabled at current frame";
 
439
                        tip = TIP_("Marker is disabled at current frame");
414
440
                else
415
 
                        tip= "Marker is enabled at current frame";
416
 
 
417
 
                uiDefButBitI(block, OPTIONN, MARKER_DISABLED, B_MARKER_FLAG,  "Enabled", 10, 190, 145, 19, &cb->marker_flag,
418
 
                        0, 0, 0, 0, tip);
419
 
 
420
 
                col = uiLayoutColumn(layout, 1);
421
 
                uiLayoutSetActive(col, (cb->marker_flag&MARKER_DISABLED)==0);
 
441
                        tip = TIP_("Marker is enabled at current frame");
 
442
 
 
443
                uiDefButBitI(block, OPTIONN, MARKER_DISABLED, B_MARKER_FLAG, IFACE_("Enabled"), 10, 190, 145, 19,
 
444
                             &cb->marker_flag, 0, 0, 0, 0, tip);
 
445
 
 
446
                col = uiLayoutColumn(layout, TRUE);
 
447
                uiLayoutSetActive(col, (cb->marker_flag & MARKER_DISABLED) == 0);
422
448
 
423
449
                block = uiLayoutAbsoluteBlock(col);
424
450
                uiBlockBeginAlign(block);
425
451
 
426
 
                uiDefBut(block, LABEL, 0, "Position:", 0, 190, 300, 19, NULL, 0, 0, 0, 0, "");
427
 
                uiDefButF(block, NUM, B_MARKER_POS, "X:", 10, 171, 145, 19, &cb->marker_pos[0],
428
 
                        -10*width, 10.0*width, step, digits, "X-position of marker at frame in screen coordinates");
429
 
                uiDefButF(block, NUM, B_MARKER_POS, "Y:", 165, 171, 145, 19, &cb->marker_pos[1],
430
 
                        -10*height, 10.0*height, step, digits, "Y-position of marker at frame in screen coordinates");
431
 
 
432
 
                uiDefBut(block, LABEL, 0, "Offset:", 0, 152, 300, 19, NULL, 0, 0, 0, 0, "");
433
 
                uiDefButF(block, NUM, B_MARKER_OFFSET, "X:", 10, 133, 145, 19, &cb->track_offset[0],
434
 
                        -10*width, 10.0*width, step, digits, "X-offset to parenting point");
435
 
                uiDefButF(block, NUM, B_MARKER_OFFSET, "Y:", 165, 133, 145, 19, &cb->track_offset[1],
436
 
                        -10*height, 10.0*height, step, digits, "Y-offset to parenting point");
437
 
 
438
 
                uiDefBut(block, LABEL, 0, "Pattern Area:", 0, 114, 300, 19, NULL, 0, 0, 0, 0, "");
439
 
                uiDefButF(block, NUM, B_MARKER_PAT_DIM, "Width:", 10, 95, 300, 19, &cb->track_pat[0], 3.0f,
440
 
                        10.0*width, step, digits, "Width of marker's pattern in screen coordinates");
441
 
                uiDefButF(block, NUM, B_MARKER_PAT_DIM, "Height:", 10, 76, 300, 19, &cb->track_pat[1], 3.0f,
442
 
                        10.0*height, step, digits, "Height of marker's pattern in screen coordinates");
443
 
 
444
 
                uiDefBut(block, LABEL, 0, "Search Area:", 0, 57, 300, 19, NULL, 0, 0, 0, 0, "");
445
 
                uiDefButF(block, NUM, B_MARKER_SEARCH_POS, "X:", 10, 38, 145, 19, &cb->track_search_pos[0],
446
 
                        -width, width, step, digits, "X-position of search at frame relative to marker's position");
447
 
                uiDefButF(block, NUM, B_MARKER_SEARCH_POS, "Y:", 165, 38, 145, 19, &cb->track_search_pos[1],
448
 
                        -height, height, step, digits, "X-position of search at frame relative to marker's position");
449
 
                uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, "Width:", 10, 19, 300, 19, &cb->track_search[0], 3.0f,
450
 
                        10.0*width, step, digits, "Width of marker's search in screen soordinates");
451
 
                uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, "Height:", 10, 0, 300, 19, &cb->track_search[1], 3.0f,
452
 
                        10.0*height, step, digits, "Height of marker's search in screen soordinates");
 
452
                uiDefBut(block, LABEL, 0, IFACE_("Position:"), 0, 190, 300, 19, NULL, 0, 0, 0, 0, "");
 
453
                uiDefButF(block, NUM, B_MARKER_POS, IFACE_("X:"), 10, 171, 145, 19, &cb->marker_pos[0],
 
454
                          -10 * width, 10.0 * width, step, digits, TIP_("X-position of marker at frame in screen coordinates"));
 
455
                uiDefButF(block, NUM, B_MARKER_POS, IFACE_("Y:"), 165, 171, 145, 19, &cb->marker_pos[1],
 
456
                          -10 * height, 10.0 * height, step, digits,
 
457
                          TIP_("Y-position of marker at frame in screen coordinates"));
 
458
 
 
459
                uiDefBut(block, LABEL, 0, IFACE_("Offset:"), 0, 152, 300, 19, NULL, 0, 0, 0, 0, "");
 
460
                uiDefButF(block, NUM, B_MARKER_OFFSET, IFACE_("X:"), 10, 133, 145, 19, &cb->track_offset[0],
 
461
                          -10 * width, 10.0 * width, step, digits, TIP_("X-offset to parenting point"));
 
462
                uiDefButF(block, NUM, B_MARKER_OFFSET, IFACE_("Y:"), 165, 133, 145, 19, &cb->track_offset[1],
 
463
                          -10 * height, 10.0 * height, step, digits, TIP_("Y-offset to parenting point"));
 
464
 
 
465
                uiDefBut(block, LABEL, 0, IFACE_("Pattern Area:"), 0, 114, 300, 19, NULL, 0, 0, 0, 0, "");
 
466
                uiDefButF(block, NUM, B_MARKER_PAT_DIM, IFACE_("Width:"), 10, 95, 300, 19, &cb->marker_pat[0], 3.0f,
 
467
                          10.0 * width, step, digits, TIP_("Width of marker's pattern in screen coordinates"));
 
468
                uiDefButF(block, NUM, B_MARKER_PAT_DIM, IFACE_("Height:"), 10, 76, 300, 19, &cb->marker_pat[1], 3.0f,
 
469
                          10.0 * height, step, digits, TIP_("Height of marker's pattern in screen coordinates"));
 
470
 
 
471
                uiDefBut(block, LABEL, 0, IFACE_("Search Area:"), 0, 57, 300, 19, NULL, 0, 0, 0, 0, "");
 
472
                uiDefButF(block, NUM, B_MARKER_SEARCH_POS, IFACE_("X:"), 10, 38, 145, 19, &cb->marker_search_pos[0],
 
473
                          -width, width, step, digits, TIP_("X-position of search at frame relative to marker's position"));
 
474
                uiDefButF(block, NUM, B_MARKER_SEARCH_POS, IFACE_("Y:"), 165, 38, 145, 19, &cb->marker_search_pos[1],
 
475
                          -height, height, step, digits, TIP_("Y-position of search at frame relative to marker's position"));
 
476
                uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, IFACE_("Width:"), 10, 19, 300, 19, &cb->marker_search[0], 3.0f,
 
477
                          10.0 * width, step, digits, TIP_("Width of marker's search in screen coordinates"));
 
478
                uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, IFACE_("Height:"), 10, 0, 300, 19, &cb->marker_search[1], 3.0f,
 
479
                          10.0 * height, step, digits, TIP_("Height of marker's search in screen coordinates"));
453
480
 
454
481
                uiBlockEndAlign(block);
455
482
        }