4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * Contributor(s): Brecht Van Lommel
22 * ***** END GPL LICENSE BLOCK *****
25 /** \file blender/makesrna/intern/rna_image.c
32 #include "RNA_define.h"
33 #include "RNA_enum_types.h"
35 #include "rna_internal.h"
37 #include "DNA_image_types.h"
38 #include "DNA_scene_types.h"
40 #include "BKE_context.h"
41 #include "BKE_depsgraph.h"
42 #include "BKE_image.h"
46 static EnumPropertyItem image_source_items[]= {
47 {IMA_SRC_FILE, "FILE", 0, "Single Image", "Single image file"},
48 {IMA_SRC_SEQUENCE, "SEQUENCE", 0, "Image Sequence", "Multiple image files, as a sequence"},
49 {IMA_SRC_MOVIE, "MOVIE", 0, "Movie File", "Movie file"},
50 {IMA_SRC_GENERATED, "GENERATED", 0, "Generated", "Generated image"},
51 {IMA_SRC_VIEWER, "VIEWER", 0, "Viewer", "Compositing node viewer"},
52 {0, NULL, 0, NULL, NULL}};
56 #include "IMB_imbuf_types.h"
58 static void rna_Image_animated_update(Main *bmain, Scene *scene, PointerRNA *ptr)
60 Image *ima= (Image*)ptr->data;
63 if(ima->flag & IMA_TWINANIM) {
64 nr= ima->xrep*ima->yrep;
65 if(ima->twsta>=nr) ima->twsta= 1;
66 if(ima->twend>=nr) ima->twend= nr-1;
67 if(ima->twsta>ima->twend) ima->twsta= 1;
71 static int rna_Image_dirty_get(PointerRNA *ptr)
73 Image *ima= (Image*)ptr->data;
76 for(ibuf=ima->ibufs.first; ibuf; ibuf=ibuf->next)
77 if(ibuf->userflags & IB_BITMAPDIRTY)
83 static void rna_Image_source_update(Main *bmain, Scene *scene, PointerRNA *ptr)
85 Image *ima= ptr->id.data;
86 BKE_image_signal(ima, NULL, IMA_SIGNAL_SRC_CHANGE);
87 DAG_id_tag_update(&ima->id, 0);
90 static void rna_Image_fields_update(Main *bmain, Scene *scene, PointerRNA *ptr)
92 Image *ima= ptr->id.data;
96 ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock);
101 if(!(ima->flag & IMA_FIELDS) && (ibuf->flags & IB_fields)) nr= 1;
102 if((ima->flag & IMA_FIELDS) && !(ibuf->flags & IB_fields)) nr= 1;
105 BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
108 BKE_image_release_ibuf(ima, lock);
111 static void rna_Image_reload_update(Main *bmain, Scene *scene, PointerRNA *ptr)
113 Image *ima= ptr->id.data;
114 BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
115 DAG_id_tag_update(&ima->id, 0);
118 static void rna_Image_generated_update(Main *bmain, Scene *scene, PointerRNA *ptr)
120 Image *ima= ptr->id.data;
121 BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
124 static void rna_ImageUser_update(Main *bmain, Scene *scene, PointerRNA *ptr)
126 ImageUser *iuser= ptr->data;
128 BKE_image_user_calc_frame(iuser, scene->r.cfra, 0);
132 char *rna_ImageUser_path(PointerRNA *ptr)
135 // ImageUser *iuser= ptr->data;
137 switch(GS(((ID *)ptr->id.data)->name)) {
139 return BLI_strdup("image_user");
143 return BLI_strdup("");
146 static EnumPropertyItem *rna_Image_source_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
148 Image *ima= (Image*)ptr->data;
149 EnumPropertyItem *item= NULL;
152 if(ima->source == IMA_SRC_VIEWER) {
153 RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_VIEWER);
156 RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_FILE);
157 RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_SEQUENCE);
158 RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_MOVIE);
159 RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_GENERATED);
162 RNA_enum_item_end(&item, &totitem);
168 static int rna_Image_file_format_get(PointerRNA *ptr)
170 Image *image= (Image*)ptr->data;
171 ImBuf *ibuf= BKE_image_get_ibuf(image, NULL);
172 return BKE_ftype_to_imtype(ibuf ? ibuf->ftype : 0);
175 static void rna_Image_file_format_set(PointerRNA *ptr, int value)
177 Image *image= (Image*)ptr->data;
178 if(BKE_imtype_is_movie(value) == 0) { /* should be able to throw an error here */
180 int ftype= BKE_imtype_to_ftype(value);
183 ibuf= BKE_image_get_ibuf(image, NULL);
188 /* to be safe change all buffer file types */
189 for(ibuf= image->ibufs.first; ibuf; ibuf= ibuf->next) {
195 static int rna_Image_has_data_get(PointerRNA *ptr)
197 Image *im= (Image*)ptr->data;
205 static void rna_Image_size_get(PointerRNA *ptr,int *values)
207 Image *im= (Image*)ptr->data;
211 ibuf = BKE_image_acquire_ibuf(im, NULL , &lock);
221 BKE_image_release_ibuf(im, lock);
224 static void rna_Image_resolution_get(PointerRNA *ptr, float *values)
226 Image *im= (Image*)ptr->data;
230 ibuf = BKE_image_acquire_ibuf(im, NULL , &lock);
232 values[0]= ibuf->ppm[0];
233 values[1]= ibuf->ppm[1];
240 BKE_image_release_ibuf(im, lock);
243 static void rna_Image_resolution_set(PointerRNA *ptr, const float *values)
245 Image *im= (Image*)ptr->data;
249 ibuf = BKE_image_acquire_ibuf(im, NULL , &lock);
251 ibuf->ppm[0]= values[0];
252 ibuf->ppm[1]= values[1];
255 BKE_image_release_ibuf(im, lock);
258 static int rna_Image_depth_get(PointerRNA *ptr)
260 Image *im= (Image*)ptr->data;
265 ibuf= BKE_image_acquire_ibuf(im, NULL, &lock);
269 else if(ibuf->rect_float)
270 depth= ibuf->depth * 4;
274 BKE_image_release_ibuf(im, lock);
279 static int rna_Image_pixels_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
281 Image *ima= ptr->id.data;
285 ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock);
288 length[0]= ibuf->x*ibuf->y*ibuf->channels;
292 BKE_image_release_ibuf(ima, lock);
297 static void rna_Image_pixels_get(PointerRNA *ptr, float *values)
299 Image *ima= ptr->id.data;
304 ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock);
307 size= ibuf->x*ibuf->y*ibuf->channels;
309 if(ibuf->rect_float) {
310 memcpy(values, ibuf->rect_float, sizeof(float)*size);
313 for(i = 0; i < size; i++)
314 values[i] = ((unsigned char*)ibuf->rect)[i]*(1.0f/255.0f);
318 BKE_image_release_ibuf(ima, lock);
321 static void rna_Image_pixels_set(PointerRNA *ptr, const float *values)
323 Image *ima= ptr->id.data;
328 ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock);
331 size= ibuf->x*ibuf->y*ibuf->channels;
333 if(ibuf->rect_float) {
334 memcpy(ibuf->rect_float, values, sizeof(float)*size);
337 for(i = 0; i < size; i++)
338 ((unsigned char*)ibuf->rect)[i] = FTOCHAR(values[i]);
341 ibuf->userflags |= IB_BITMAPDIRTY;
344 BKE_image_release_ibuf(ima, lock);
349 static void rna_def_imageuser(BlenderRNA *brna)
354 srna= RNA_def_struct(brna, "ImageUser", NULL);
355 RNA_def_struct_ui_text(srna, "Image User", "Parameters defining how an Image datablock is used by another datablock");
356 RNA_def_struct_path_func(srna, "rna_ImageUser_path");
358 prop= RNA_def_property(srna, "use_auto_refresh", PROP_BOOLEAN, PROP_NONE);
359 RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANIM_ALWAYS);
360 RNA_def_property_ui_text(prop, "Auto Refresh", "Always refresh image on frame changes");
361 RNA_def_property_update(prop, 0, "rna_ImageUser_update");
364 prop= RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
365 RNA_def_property_boolean_sdna(prop, NULL, "cycl", 0);
366 RNA_def_property_ui_text(prop, "Cyclic", "Cycle the images in the movie");
367 RNA_def_property_update(prop, 0, "rna_ImageUser_update");
369 prop= RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE);
370 RNA_def_property_int_sdna(prop, NULL, "frames");
371 RNA_def_property_range(prop, 0, MAXFRAMEF);
372 RNA_def_property_ui_text(prop, "Frames", "Sets the number of images of a movie to use");
373 RNA_def_property_update(prop, 0, "rna_ImageUser_update");
375 prop= RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
376 RNA_def_property_int_sdna(prop, NULL, "offset");
377 RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
378 RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation");
379 RNA_def_property_update(prop, 0, "rna_ImageUser_update");
381 prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
382 RNA_def_property_int_sdna(prop, NULL, "sfra");
383 RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
384 RNA_def_property_ui_text(prop, "Start Frame", "Sets the global starting frame of the movie/sequence, assuming first picture has a #1");
385 RNA_def_property_update(prop, 0, "rna_ImageUser_update");
387 prop= RNA_def_property(srna, "fields_per_frame", PROP_INT, PROP_NONE);
388 RNA_def_property_int_sdna(prop, NULL, "fie_ima");
389 RNA_def_property_range(prop, 1, 200);
390 RNA_def_property_ui_text(prop, "Fields per Frame", "The number of fields per rendered frame (2 fields is 1 image)");
391 RNA_def_property_update(prop, 0, "rna_ImageUser_update");
393 prop= RNA_def_property(srna, "multilayer_layer", PROP_INT, PROP_UNSIGNED);
394 RNA_def_property_int_sdna(prop, NULL, "layer");
395 RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_multi_cb */
396 RNA_def_property_ui_text(prop, "Layer", "Layer in multilayer image");
398 prop= RNA_def_property(srna, "multilayer_pass", PROP_INT, PROP_UNSIGNED);
399 RNA_def_property_int_sdna(prop, NULL, "pass");
400 RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_multi_cb */
401 RNA_def_property_ui_text(prop, "Pass", "Pass in multilayer image");
404 static void rna_def_image(BlenderRNA *brna)
408 static const EnumPropertyItem prop_type_items[]= {
409 {IMA_TYPE_IMAGE, "IMAGE", 0, "Image", ""},
410 {IMA_TYPE_MULTILAYER, "MULTILAYER", 0, "Multilayer", ""},
411 {IMA_TYPE_UV_TEST, "UV_TEST", 0, "UV Test", ""},
412 {IMA_TYPE_R_RESULT, "RENDER_RESULT", 0, "Render Result", ""},
413 {IMA_TYPE_COMPOSITE, "COMPOSITING", 0, "Compositing", ""},
414 {0, NULL, 0, NULL, NULL}};
415 static const EnumPropertyItem prop_generated_type_items[]= {
416 {0, "BLANK", 0, "Blank", "Generate a blank image"},
417 {1, "UV_GRID", 0, "UV Grid", "Generated grid to test UV mappings"},
418 {2, "COLOR_GRID", 0, "Color Grid", "Generated improved UV grid to test UV mappings"},
419 {0, NULL, 0, NULL, NULL}};
420 static const EnumPropertyItem prop_mapping_items[]= {
421 {0, "UV", 0, "UV Coordinates", "Use UV coordinates for mapping the image"},
422 {IMA_REFLECT, "REFLECTION", 0, "Reflection", "Use reflection mapping for mapping the image"},
423 {0, NULL, 0, NULL, NULL}};
424 static const EnumPropertyItem prop_field_order_items[]= {
425 {0, "EVEN", 0, "Upper First", "Upper field first"},
426 {IMA_STD_FIELD, "ODD", 0, "Lower First", "Lower field first"},
427 {0, NULL, 0, NULL, NULL}};
429 srna= RNA_def_struct(brna, "Image", "ID");
430 RNA_def_struct_ui_text(srna, "Image", "Image datablock referencing an external or packed image");
431 RNA_def_struct_ui_icon(srna, ICON_IMAGE_DATA);
433 prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
434 RNA_def_property_string_sdna(prop, NULL, "name");
435 RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name");
436 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update");
438 /* eek. this is horrible but needed so we can save to a new name without blanking the data :( */
439 prop= RNA_def_property(srna, "filepath_raw", PROP_STRING, PROP_FILEPATH);
440 RNA_def_property_string_sdna(prop, NULL, "name");
441 RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name (without data refreshing)");
443 prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
444 RNA_def_property_enum_items(prop, image_type_items);
445 RNA_def_property_enum_funcs(prop, "rna_Image_file_format_get", "rna_Image_file_format_set", NULL);
446 RNA_def_property_ui_text(prop, "File Format", "Format used for re-saving this file");
448 prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
449 RNA_def_property_enum_items(prop, image_source_items);
450 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Image_source_itemf");
451 RNA_def_property_ui_text(prop, "Source", "Where the image comes from");
452 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_source_update");
454 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
455 RNA_def_property_enum_items(prop, prop_type_items);
456 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
457 RNA_def_property_ui_text(prop, "Type", "How to generate the image");
458 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
460 prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
461 RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
462 RNA_def_property_ui_text(prop, "Packed File", "");
464 prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
465 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
466 RNA_def_property_enum_items(prop, prop_field_order_items);
467 RNA_def_property_ui_text(prop, "Field Order", "Order of video fields. Select which lines are displayed first");
468 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
471 prop= RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
472 RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_FIELDS);
473 RNA_def_property_ui_text(prop, "Fields", "Use fields of the image");
474 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_fields_update");
476 prop= RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
477 RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_DO_PREMUL);
478 RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha");
479 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update");
481 prop= RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
482 RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL);
483 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
484 RNA_def_property_ui_text(prop, "Dirty", "Image has changed and is not saved");
486 /* generated image (image_generated_change_cb) */
487 prop= RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE);
488 RNA_def_property_enum_sdna(prop, NULL, "gen_type");
489 RNA_def_property_enum_items(prop, prop_generated_type_items);
490 RNA_def_property_ui_text(prop, "Generated Type", "Generated image type");
491 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
493 prop= RNA_def_property(srna, "generated_width", PROP_INT, PROP_NONE);
494 RNA_def_property_int_sdna(prop, NULL, "gen_x");
495 RNA_def_property_range(prop, 1, 16384);
496 RNA_def_property_ui_text(prop, "Generated Width", "Generated image width");
497 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
499 prop= RNA_def_property(srna, "generated_height", PROP_INT, PROP_NONE);
500 RNA_def_property_int_sdna(prop, NULL, "gen_y");
501 RNA_def_property_range(prop, 1, 16384);
502 RNA_def_property_ui_text(prop, "Generated Height", "Generated image height");
503 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
505 /* realtime properties */
506 prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
507 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
508 RNA_def_property_enum_items(prop, prop_mapping_items);
509 RNA_def_property_ui_text(prop, "Mapping", "Mapping type to use for this image in the game engine");
510 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
512 prop= RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
513 RNA_def_property_float_sdna(prop, NULL, "aspx");
514 RNA_def_property_array(prop, 2);
515 RNA_def_property_range(prop, 0.1f, 5000.0f);
516 RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this image, does not affect rendering");
517 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
519 prop= RNA_def_property(srna, "use_animation", PROP_BOOLEAN, PROP_NONE);
520 RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TWINANIM);
521 RNA_def_property_ui_text(prop, "Animated", "Use as animated texture in the game engine");
522 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");
524 prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
525 RNA_def_property_int_sdna(prop, NULL, "twsta");
526 RNA_def_property_range(prop, 0, 128);
527 RNA_def_property_ui_text(prop, "Animation Start", "Start frame of an animated texture");
528 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");
530 prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
531 RNA_def_property_int_sdna(prop, NULL, "twend");
532 RNA_def_property_range(prop, 0, 128);
533 RNA_def_property_ui_text(prop, "Animation End", "End frame of an animated texture");
534 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");
536 prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
537 RNA_def_property_int_sdna(prop, NULL, "animspeed");
538 RNA_def_property_range(prop, 1, 100);
539 RNA_def_property_ui_text(prop, "Animation Speed", "Speed of the animation in frames per second");
540 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
542 prop= RNA_def_property(srna, "use_tiles", PROP_BOOLEAN, PROP_NONE);
543 RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TILES);
544 RNA_def_property_ui_text(prop, "Tiles", "Use of tilemode for faces (default shift-LMB to pick the tile for selected faces)");
545 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
547 prop= RNA_def_property(srna, "tiles_x", PROP_INT, PROP_NONE);
548 RNA_def_property_int_sdna(prop, NULL, "xrep");
549 RNA_def_property_range(prop, 1, 16);
550 RNA_def_property_ui_text(prop, "Tiles X", "Degree of repetition in the X direction");
551 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
553 prop= RNA_def_property(srna, "tiles_y", PROP_INT, PROP_NONE);
554 RNA_def_property_int_sdna(prop, NULL, "yrep");
555 RNA_def_property_range(prop, 1, 16);
556 RNA_def_property_ui_text(prop, "Tiles Y", "Degree of repetition in the Y direction");
557 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
559 prop= RNA_def_property(srna, "use_clamp_x", PROP_BOOLEAN, PROP_NONE);
560 RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_U);
561 RNA_def_property_ui_text(prop, "Clamp X", "Disable texture repeating horizontally");
562 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
564 prop= RNA_def_property(srna, "use_clamp_y", PROP_BOOLEAN, PROP_NONE);
565 RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_V);
566 RNA_def_property_ui_text(prop, "Clamp Y", "Disable texture repeating vertically");
567 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
569 prop= RNA_def_property(srna, "bindcode", PROP_INT, PROP_UNSIGNED);
570 RNA_def_property_int_sdna(prop, NULL, "bindcode");
571 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
572 RNA_def_property_ui_text(prop, "Bindcode", "OpenGL bindcode");
573 RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
576 Image.has_data and Image.depth are temporary,
577 Update import_obj.py when they are replaced (Arystan)
579 prop= RNA_def_property(srna, "has_data", PROP_BOOLEAN, PROP_NONE);
580 RNA_def_property_boolean_funcs(prop, "rna_Image_has_data_get", NULL);
581 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
582 RNA_def_property_ui_text(prop, "Has data", "True if this image has data");
584 prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
585 RNA_def_property_int_funcs(prop, "rna_Image_depth_get", NULL, NULL);
586 RNA_def_property_ui_text(prop, "Depth", "Image bit depth");
587 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
589 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);
590 RNA_def_property_int_funcs(prop, "rna_Image_size_get" , NULL, NULL);
591 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
593 prop= RNA_def_float_vector(srna, "resolution" , 2 , NULL , 0, 0, "Resolution" , "X/Y pixels per meter" , 0 , 0);
594 RNA_def_property_float_funcs(prop, "rna_Image_resolution_get" , "rna_Image_resolution_set", NULL);
596 prop= RNA_def_property(srna, "pixels", PROP_FLOAT, PROP_NONE);
597 RNA_def_property_flag(prop, PROP_DYNAMIC);
598 RNA_def_property_multi_array(prop, 1, NULL);
599 RNA_def_property_ui_text(prop, "Pixels", "Image pixels in floating point values");
600 RNA_def_property_dynamic_array_funcs(prop, "rna_Image_pixels_get_length");
601 RNA_def_property_float_funcs(prop, "rna_Image_pixels_get", "rna_Image_pixels_set", NULL);
606 void RNA_def_image(BlenderRNA *brna)
609 rna_def_imageuser(brna);