Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArystanbek Dyussenov <arystan.d@gmail.com>2009-07-03 21:44:20 +0400
committerArystanbek Dyussenov <arystan.d@gmail.com>2009-07-03 21:44:20 +0400
commit2a23fda9d55034e524be32bd8cb196ae4cd93920 (patch)
tree0bf24db1bfb14f3baeef133fbc98211b637144cc /source/blender/makesrna/intern/rna_image.c
parent617851bf21ac5da10bfd171816187e1336cd4a69 (diff)
OBJ importer almost converted, except a few features (NURBS, NGON, FGON and sharp edges).
Added to API: - Main.add_image - Material.z_transparency - two temporary properties: Image.depth and Image.has_data
Diffstat (limited to 'source/blender/makesrna/intern/rna_image.c')
-rw-r--r--source/blender/makesrna/intern/rna_image.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index c74e46c17da..fbef838d06c 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -66,6 +66,29 @@ static int rna_Image_dirty_get(PointerRNA *ptr)
return 0;
}
+static int rna_Image_has_data_get(PointerRNA *ptr)
+{
+ Image *im= (Image*)ptr->data;
+
+ if (im->ibufs.first)
+ return 1;
+
+ return 0;
+}
+
+static int rna_Image_depth_get(PointerRNA *ptr)
+{
+ Image *im= (Image*)ptr->data;
+ ImBuf *ibuf= BKE_image_get_ibuf(im, NULL);
+
+ if (!ibuf) return 0;
+
+ if (ibuf->rect_float)
+ return 128;
+
+ return ibuf->depth;
+}
+
#else
static void rna_def_imageuser(BlenderRNA *brna)
@@ -275,6 +298,20 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_V);
RNA_def_property_ui_text(prop, "Clamp Y", "Disable texture repeating vertically.");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+
+ /*
+ Image.has_data and Image.depth are temporary,
+ Update import_obj.py when they are replaced (Arystan)
+ */
+ prop= RNA_def_property(srna, "has_data", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_Image_has_data_get", NULL);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Has data", "True if this image has data.");
+
+ prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
+ RNA_def_property_int_funcs(prop, "rna_Image_depth_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Depth", "Image bit depth.");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
}
void RNA_def_image(BlenderRNA *brna)