51
55
#include "IMB_imbuf_types.h"
53
static void rna_Image_animated_update(Main *bmain, Scene *scene, PointerRNA *ptr)
57
static void rna_Image_animated_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
55
Image *ima= (Image*)ptr->data;
59
Image *ima = (Image*)ptr->data;
58
if(ima->flag & IMA_TWINANIM) {
59
nr= ima->xrep*ima->yrep;
60
if(ima->twsta>=nr) ima->twsta= 1;
61
if(ima->twend>=nr) ima->twend= nr-1;
62
if(ima->twsta>ima->twend) ima->twsta= 1;
62
if (ima->flag & IMA_TWINANIM) {
63
nr = ima->xrep*ima->yrep;
64
if (ima->twsta >= nr) ima->twsta = 1;
65
if (ima->twend >= nr) ima->twend = nr-1;
66
if (ima->twsta>ima->twend) ima->twsta = 1;
66
70
static int rna_Image_dirty_get(PointerRNA *ptr)
68
Image *ima= (Image*)ptr->data;
72
Image *ima = (Image*)ptr->data;
71
for(ibuf=ima->ibufs.first; ibuf; ibuf=ibuf->next)
72
if(ibuf->userflags & IB_BITMAPDIRTY)
75
for (ibuf = ima->ibufs.first; ibuf; ibuf = ibuf->next)
76
if (ibuf->userflags & IB_BITMAPDIRTY)
78
static void rna_Image_source_update(Main *bmain, Scene *scene, PointerRNA *ptr)
82
static void rna_Image_source_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
80
Image *ima= ptr->id.data;
84
Image *ima = ptr->id.data;
81
85
BKE_image_signal(ima, NULL, IMA_SIGNAL_SRC_CHANGE);
82
DAG_id_flush_update(&ima->id, 0);
86
DAG_id_tag_update(&ima->id, 0);
85
static void rna_Image_fields_update(Main *bmain, Scene *scene, PointerRNA *ptr)
89
static void rna_Image_fields_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
87
Image *ima= ptr->id.data;
91
Image *ima = ptr->id.data;
91
ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock);
96
if(!(ima->flag & IMA_FIELDS) && (ibuf->flags & IB_fields)) nr= 1;
97
if((ima->flag & IMA_FIELDS) && !(ibuf->flags & IB_fields)) nr= 1;
95
ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
100
if (!(ima->flag & IMA_FIELDS) && (ibuf->flags & IB_fields)) nr = 1;
101
if ((ima->flag & IMA_FIELDS) && !(ibuf->flags & IB_fields)) nr = 1;
100
104
BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
103
107
BKE_image_release_ibuf(ima, lock);
106
static void rna_Image_reload_update(Main *bmain, Scene *scene, PointerRNA *ptr)
108
Image *ima= ptr->id.data;
110
static void rna_Image_free_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
112
Image *ima = ptr->id.data;
113
BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
114
WM_main_add_notifier(NC_IMAGE|NA_EDITED, &ima->id);
115
DAG_id_tag_update(&ima->id, 0);
119
static void rna_Image_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
121
Image *ima = ptr->id.data;
109
122
BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
110
DAG_id_flush_update(&ima->id, 0);
123
WM_main_add_notifier(NC_IMAGE|NA_EDITED, &ima->id);
124
DAG_id_tag_update(&ima->id, 0);
113
static void rna_Image_generated_update(Main *bmain, Scene *scene, PointerRNA *ptr)
127
static void rna_Image_generated_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
115
Image *ima= ptr->id.data;
129
Image *ima = ptr->id.data;
116
130
BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
119
static void rna_ImageUser_update(Main *bmain, Scene *scene, PointerRNA *ptr)
133
static void rna_ImageUser_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
121
ImageUser *iuser= ptr->data;
135
ImageUser *iuser = ptr->data;
123
137
BKE_image_user_calc_frame(iuser, scene->r.cfra, 0);
126
static EnumPropertyItem *rna_Image_source_itemf(bContext *C, PointerRNA *ptr, int *free)
128
Image *ima= (Image*)ptr->data;
129
EnumPropertyItem *item= NULL;
132
if(ima->source == IMA_SRC_VIEWER) {
141
char *rna_ImageUser_path(PointerRNA *ptr)
144
/* ImageUser *iuser= ptr->data; */
146
switch (GS(((ID *)ptr->id.data)->name)) {
148
return BLI_strdup("image_user");
152
return BLI_strdup("");
155
static EnumPropertyItem *rna_Image_source_itemf(bContext *UNUSED(C), PointerRNA *ptr,
156
PropertyRNA *UNUSED(prop), int *free)
158
Image *ima = (Image*)ptr->data;
159
EnumPropertyItem *item = NULL;
162
if (ima->source == IMA_SRC_VIEWER) {
133
163
RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_VIEWER);
221
362
PropertyRNA *prop;
223
srna= RNA_def_struct(brna, "ImageUser", NULL);
224
RNA_def_struct_ui_text(srna, "Image User", "Parameters defining how an Image datablock is used by another datablock");
364
srna = RNA_def_struct(brna, "ImageUser", NULL);
365
RNA_def_struct_ui_text(srna, "Image User",
366
"Parameters defining how an Image datablock is used by another datablock");
367
RNA_def_struct_path_func(srna, "rna_ImageUser_path");
226
prop= RNA_def_property(srna, "auto_refresh", PROP_BOOLEAN, PROP_NONE);
369
prop = RNA_def_property(srna, "use_auto_refresh", PROP_BOOLEAN, PROP_NONE);
227
370
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANIM_ALWAYS);
228
371
RNA_def_property_ui_text(prop, "Auto Refresh", "Always refresh image on frame changes");
229
372
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
232
prop= RNA_def_property(srna, "cyclic", PROP_BOOLEAN, PROP_NONE);
375
prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
233
376
RNA_def_property_boolean_sdna(prop, NULL, "cycl", 0);
234
377
RNA_def_property_ui_text(prop, "Cyclic", "Cycle the images in the movie");
235
378
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
237
prop= RNA_def_property(srna, "frames", PROP_INT, PROP_NONE);
380
prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE);
381
RNA_def_property_int_sdna(prop, NULL, "frames");
238
382
RNA_def_property_range(prop, 0, MAXFRAMEF);
239
RNA_def_property_ui_text(prop, "Frames", "Sets the number of images of a movie to use");
240
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
242
prop= RNA_def_property(srna, "offset", PROP_INT, PROP_NONE);
243
RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF);
244
RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation");
245
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
247
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
383
RNA_def_property_ui_text(prop, "Frames", "Number of images of a movie to use");
384
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
386
prop = RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
387
RNA_def_property_int_sdna(prop, NULL, "offset");
388
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
389
RNA_def_property_ui_text(prop, "Offset", "Offset the number of the frame to use in the animation");
390
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
392
prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
248
393
RNA_def_property_int_sdna(prop, NULL, "sfra");
249
RNA_def_property_range(prop, 1.0f, MAXFRAMEF);
250
RNA_def_property_ui_text(prop, "Start Frame", "Sets the global starting frame of the movie");
394
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
395
RNA_def_property_ui_text(prop, "Start Frame",
396
"Global starting frame of the movie/sequence, assuming first picture has a #1");
251
397
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
253
prop= RNA_def_property(srna, "fields_per_frame", PROP_INT, PROP_NONE);
399
prop = RNA_def_property(srna, "fields_per_frame", PROP_INT, PROP_NONE);
254
400
RNA_def_property_int_sdna(prop, NULL, "fie_ima");
255
RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF);
256
RNA_def_property_ui_text(prop, "Fields per Frame", "The number of fields per rendered frame (2 fields is 1 image)");
401
RNA_def_property_range(prop, 1, 200);
402
RNA_def_property_ui_text(prop, "Fields per Frame", "Number of fields per rendered frame (2 fields is 1 image)");
257
403
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
259
prop= RNA_def_property(srna, "multilayer_layer", PROP_INT, PROP_UNSIGNED);
405
prop = RNA_def_property(srna, "multilayer_layer", PROP_INT, PROP_UNSIGNED);
260
406
RNA_def_property_int_sdna(prop, NULL, "layer");
261
407
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_multi_cb */
262
408
RNA_def_property_ui_text(prop, "Layer", "Layer in multilayer image");
264
prop= RNA_def_property(srna, "multilayer_pass", PROP_INT, PROP_UNSIGNED);
410
prop = RNA_def_property(srna, "multilayer_pass", PROP_INT, PROP_UNSIGNED);
265
411
RNA_def_property_int_sdna(prop, NULL, "pass");
266
412
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_multi_cb */
267
413
RNA_def_property_ui_text(prop, "Pass", "Pass in multilayer image");
273
419
PropertyRNA *prop;
274
static const EnumPropertyItem prop_type_items[]= {
420
static const EnumPropertyItem prop_type_items[] = {
275
421
{IMA_TYPE_IMAGE, "IMAGE", 0, "Image", ""},
276
422
{IMA_TYPE_MULTILAYER, "MULTILAYER", 0, "Multilayer", ""},
277
423
{IMA_TYPE_UV_TEST, "UV_TEST", 0, "UV Test", ""},
278
424
{IMA_TYPE_R_RESULT, "RENDER_RESULT", 0, "Render Result", ""},
279
425
{IMA_TYPE_COMPOSITE, "COMPOSITING", 0, "Compositing", ""},
280
426
{0, NULL, 0, NULL, NULL}};
281
static const EnumPropertyItem prop_generated_type_items[]= {
427
static const EnumPropertyItem prop_generated_type_items[] = {
282
428
{0, "BLANK", 0, "Blank", "Generate a blank image"},
283
429
{1, "UV_GRID", 0, "UV Grid", "Generated grid to test UV mappings"},
284
430
{2, "COLOR_GRID", 0, "Color Grid", "Generated improved UV grid to test UV mappings"},
285
431
{0, NULL, 0, NULL, NULL}};
286
static const EnumPropertyItem prop_mapping_items[]= {
432
static const EnumPropertyItem prop_mapping_items[] = {
287
433
{0, "UV", 0, "UV Coordinates", "Use UV coordinates for mapping the image"},
288
434
{IMA_REFLECT, "REFLECTION", 0, "Reflection", "Use reflection mapping for mapping the image"},
289
435
{0, NULL, 0, NULL, NULL}};
290
static const EnumPropertyItem prop_field_order_items[]= {
436
static const EnumPropertyItem prop_field_order_items[] = {
291
437
{0, "EVEN", 0, "Upper First", "Upper field first"},
292
438
{IMA_STD_FIELD, "ODD", 0, "Lower First", "Lower field first"},
293
439
{0, NULL, 0, NULL, NULL}};
295
srna= RNA_def_struct(brna, "Image", "ID");
441
srna = RNA_def_struct(brna, "Image", "ID");
296
442
RNA_def_struct_ui_text(srna, "Image", "Image datablock referencing an external or packed image");
297
443
RNA_def_struct_ui_icon(srna, ICON_IMAGE_DATA);
299
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
445
prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
300
446
RNA_def_property_string_sdna(prop, NULL, "name");
301
447
RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name");
302
448
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update");
304
450
/* eek. this is horrible but needed so we can save to a new name without blanking the data :( */
305
prop= RNA_def_property(srna, "filepath_raw", PROP_STRING, PROP_FILEPATH);
451
prop = RNA_def_property(srna, "filepath_raw", PROP_STRING, PROP_FILEPATH);
306
452
RNA_def_property_string_sdna(prop, NULL, "name");
307
453
RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name (without data refreshing)");
309
prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
455
prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
310
456
RNA_def_property_enum_items(prop, image_type_items);
311
457
RNA_def_property_enum_funcs(prop, "rna_Image_file_format_get", "rna_Image_file_format_set", NULL);
312
458
RNA_def_property_ui_text(prop, "File Format", "Format used for re-saving this file");
314
prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
460
prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
315
461
RNA_def_property_enum_items(prop, image_source_items);
316
462
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Image_source_itemf");
317
463
RNA_def_property_ui_text(prop, "Source", "Where the image comes from");
318
464
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_source_update");
320
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
466
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
321
467
RNA_def_property_enum_items(prop, prop_type_items);
322
468
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
323
469
RNA_def_property_ui_text(prop, "Type", "How to generate the image");
324
470
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
326
prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
472
prop = RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
327
473
RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
328
474
RNA_def_property_ui_text(prop, "Packed File", "");
330
prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
476
prop = RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
331
477
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
332
478
RNA_def_property_enum_items(prop, prop_field_order_items);
333
RNA_def_property_ui_text(prop, "Field Order", "Order of video fields. Select which lines are displayed first");
479
RNA_def_property_ui_text(prop, "Field Order", "Order of video fields (select which lines are displayed first)");
334
480
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
337
prop= RNA_def_property(srna, "fields", PROP_BOOLEAN, PROP_NONE);
483
prop = RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
338
484
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_FIELDS);
339
485
RNA_def_property_ui_text(prop, "Fields", "Use fields of the image");
340
486
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_fields_update");
342
prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE);
488
prop = RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
343
489
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_DO_PREMUL);
344
490
RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha");
345
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update");
491
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_free_update");
493
prop = RNA_def_property(srna, "use_color_unpremultiply", PROP_BOOLEAN, PROP_NONE);
494
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_CM_PREDIVIDE);
495
RNA_def_property_ui_text(prop, "Color Unpremultiply",
496
"For premultiplied alpha images, do color space conversion on colors without alpha, "
497
"to avoid fringing for images with light backgrounds");
498
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_free_update");
347
prop= RNA_def_property(srna, "dirty", PROP_BOOLEAN, PROP_NONE);
500
prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
348
501
RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL);
349
502
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
350
503
RNA_def_property_ui_text(prop, "Dirty", "Image has changed and is not saved");
352
505
/* generated image (image_generated_change_cb) */
353
prop= RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE);
506
prop = RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE);
354
507
RNA_def_property_enum_sdna(prop, NULL, "gen_type");
355
508
RNA_def_property_enum_items(prop, prop_generated_type_items);
356
509
RNA_def_property_ui_text(prop, "Generated Type", "Generated image type");
357
510
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
359
prop= RNA_def_property(srna, "generated_width", PROP_INT, PROP_NONE);
512
prop = RNA_def_property(srna, "generated_width", PROP_INT, PROP_NONE);
360
513
RNA_def_property_int_sdna(prop, NULL, "gen_x");
361
514
RNA_def_property_range(prop, 1, 16384);
362
515
RNA_def_property_ui_text(prop, "Generated Width", "Generated image width");
363
516
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
365
prop= RNA_def_property(srna, "generated_height", PROP_INT, PROP_NONE);
518
prop = RNA_def_property(srna, "generated_height", PROP_INT, PROP_NONE);
366
519
RNA_def_property_int_sdna(prop, NULL, "gen_y");
367
520
RNA_def_property_range(prop, 1, 16384);
368
521
RNA_def_property_ui_text(prop, "Generated Height", "Generated image height");
369
522
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
524
prop = RNA_def_property(srna, "use_generated_float", PROP_BOOLEAN, PROP_NONE);
525
RNA_def_property_boolean_sdna(prop, NULL, "gen_flag", IMA_GEN_FLOAT);
526
RNA_def_property_ui_text(prop, "Float Buffer", "Generate floating point buffer");
527
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
371
529
/* realtime properties */
372
prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
530
prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
373
531
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
374
532
RNA_def_property_enum_items(prop, prop_mapping_items);
375
533
RNA_def_property_ui_text(prop, "Mapping", "Mapping type to use for this image in the game engine");
376
534
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
378
prop= RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
536
prop = RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
379
537
RNA_def_property_float_sdna(prop, NULL, "aspx");
380
538
RNA_def_property_array(prop, 2);
381
539
RNA_def_property_range(prop, 0.1f, 5000.0f);
382
540
RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this image, does not affect rendering");
383
541
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
385
prop= RNA_def_property(srna, "animated", PROP_BOOLEAN, PROP_NONE);
543
prop = RNA_def_property(srna, "use_animation", PROP_BOOLEAN, PROP_NONE);
386
544
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TWINANIM);
387
545
RNA_def_property_ui_text(prop, "Animated", "Use as animated texture in the game engine");
388
546
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");
390
prop= RNA_def_property(srna, "animation_start", PROP_INT, PROP_NONE);
548
prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
391
549
RNA_def_property_int_sdna(prop, NULL, "twsta");
392
550
RNA_def_property_range(prop, 0, 128);
393
551
RNA_def_property_ui_text(prop, "Animation Start", "Start frame of an animated texture");
394
552
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");
396
prop= RNA_def_property(srna, "animation_end", PROP_INT, PROP_NONE);
554
prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
397
555
RNA_def_property_int_sdna(prop, NULL, "twend");
398
556
RNA_def_property_range(prop, 0, 128);
399
557
RNA_def_property_ui_text(prop, "Animation End", "End frame of an animated texture");
400
558
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");
402
prop= RNA_def_property(srna, "animation_speed", PROP_INT, PROP_NONE);
560
prop = RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
403
561
RNA_def_property_int_sdna(prop, NULL, "animspeed");
404
562
RNA_def_property_range(prop, 1, 100);
405
563
RNA_def_property_ui_text(prop, "Animation Speed", "Speed of the animation in frames per second");
406
564
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
408
prop= RNA_def_property(srna, "tiles", PROP_BOOLEAN, PROP_NONE);
566
prop = RNA_def_property(srna, "use_tiles", PROP_BOOLEAN, PROP_NONE);
409
567
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TILES);
410
RNA_def_property_ui_text(prop, "Tiles", "Use of tilemode for faces (default shift-LMB to pick the tile for selected faces)");
568
RNA_def_property_ui_text(prop, "Tiles",
569
"Use of tilemode for faces (default shift-LMB to pick the tile for selected faces)");
411
570
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
413
prop= RNA_def_property(srna, "tiles_x", PROP_INT, PROP_NONE);
572
prop = RNA_def_property(srna, "tiles_x", PROP_INT, PROP_NONE);
414
573
RNA_def_property_int_sdna(prop, NULL, "xrep");
415
574
RNA_def_property_range(prop, 1, 16);
416
575
RNA_def_property_ui_text(prop, "Tiles X", "Degree of repetition in the X direction");
417
576
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
419
prop= RNA_def_property(srna, "tiles_y", PROP_INT, PROP_NONE);
578
prop = RNA_def_property(srna, "tiles_y", PROP_INT, PROP_NONE);
420
579
RNA_def_property_int_sdna(prop, NULL, "yrep");
421
580
RNA_def_property_range(prop, 1, 16);
422
581
RNA_def_property_ui_text(prop, "Tiles Y", "Degree of repetition in the Y direction");
423
582
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
425
prop= RNA_def_property(srna, "clamp_x", PROP_BOOLEAN, PROP_NONE);
584
prop = RNA_def_property(srna, "use_clamp_x", PROP_BOOLEAN, PROP_NONE);
426
585
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_U);
427
586
RNA_def_property_ui_text(prop, "Clamp X", "Disable texture repeating horizontally");
428
587
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
430
prop= RNA_def_property(srna, "clamp_y", PROP_BOOLEAN, PROP_NONE);
589
prop = RNA_def_property(srna, "use_clamp_y", PROP_BOOLEAN, PROP_NONE);
431
590
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_V);
432
591
RNA_def_property_ui_text(prop, "Clamp Y", "Disable texture repeating vertically");
433
592
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
435
prop= RNA_def_property(srna, "bindcode", PROP_INT, PROP_UNSIGNED);
594
prop = RNA_def_property(srna, "bindcode", PROP_INT, PROP_UNSIGNED);
436
595
RNA_def_property_int_sdna(prop, NULL, "bindcode");
437
596
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
438
597
RNA_def_property_ui_text(prop, "Bindcode", "OpenGL bindcode");
439
598
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
600
prop = RNA_def_property(srna, "render_slot", PROP_INT, PROP_UNSIGNED);
601
RNA_def_property_range(prop, 0, IMA_MAX_RENDER_SLOT - 1);
602
RNA_def_property_ui_text(prop, "Render Slot", "The current render slot displayed, only for viewer type images");
603
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
442
Image.has_data and Image.depth are temporary,
443
Update import_obj.py when they are replaced (Arystan)
445
prop= RNA_def_property(srna, "has_data", PROP_BOOLEAN, PROP_NONE);
606
* Image.has_data and Image.depth are temporary,
607
* Update import_obj.py when they are replaced (Arystan)
609
prop = RNA_def_property(srna, "has_data", PROP_BOOLEAN, PROP_NONE);
446
610
RNA_def_property_boolean_funcs(prop, "rna_Image_has_data_get", NULL);
447
611
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
448
612
RNA_def_property_ui_text(prop, "Has data", "True if this image has data");
450
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
614
prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
451
615
RNA_def_property_int_funcs(prop, "rna_Image_depth_get", NULL, NULL);
452
616
RNA_def_property_ui_text(prop, "Depth", "Image bit depth");
453
617
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
455
prop= RNA_def_int_vector(srna, "size" , 2 , NULL , 0, 0, "Size" , "Width and height in pixels, zero when image data cant be loaded" , 0 , 0);
619
prop = RNA_def_int_vector(srna, "size" , 2 , NULL , 0, 0, "Size" ,
620
"Width and height in pixels, zero when image data cant be loaded" , 0 , 0);
456
621
RNA_def_property_int_funcs(prop, "rna_Image_size_get" , NULL, NULL);
457
622
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
624
prop = RNA_def_float_vector(srna, "resolution" , 2 , NULL , 0, 0, "Resolution" , "X/Y pixels per meter" , 0 , 0);
625
RNA_def_property_float_funcs(prop, "rna_Image_resolution_get" , "rna_Image_resolution_set", NULL);
627
prop = RNA_def_property(srna, "pixels", PROP_FLOAT, PROP_NONE);
628
RNA_def_property_flag(prop, PROP_DYNAMIC);
629
RNA_def_property_multi_array(prop, 1, NULL);
630
RNA_def_property_ui_text(prop, "Pixels", "Image pixels in floating point values");
631
RNA_def_property_dynamic_array_funcs(prop, "rna_Image_pixels_get_length");
632
RNA_def_property_float_funcs(prop, "rna_Image_pixels_get", "rna_Image_pixels_set", NULL);
459
634
RNA_api_image(srna);