slot = context.texture_slot
split = layout.split()
-
- """
- col = split.column()
- col.itemR(tex, "flip_axis")
- col.itemR(tex, "normal_map")
- if slot:
- row = col.row()
- row.active = tex.normal_map
- row.itemR(slot, "normal_map_space", text="")
- """
col = split.column()
col.itemL(text="Alpha:")
col.itemR(tex, "flip_axis", text="X/Y Axis")
col = split.column()
+ col.itemR(tex, "normal_map")
+ row = col.row()
+ row.active = tex.normal_map
+ row.itemR(tex, "normal_space", text="")
+
col.itemL(text="Filter:")
col.itemR(tex, "filter", text="")
col.itemR(tex, "mipmap")
col.itemL(text="Mirror:")
col.itemR(tex, "mirror_x", text="X")
col.itemR(tex, "mirror_y", text="Y")
+ layout.itemS()
+
elif tex.extension == 'CHECKER':
col = split.column(align=True)
row = col.row()
row.itemR(tex, "checker_odd", text="Odd")
split.itemR(tex, "checker_distance", text="Distance")
-
- layout.itemS()
+ layout.itemS()
split = layout.split()
{TEX_REPEAT, "REPEAT", 0, "Repeat", "Causes the image to repeat horizontally and vertically"},
{TEX_CHECKER, "CHECKER", 0, "Checker", "Causes the image to repeat in checker board pattern"},
{0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem prop_normal_space[] = {
+ {MTEX_NSPACE_CAMERA, "CAMERA", 0, "Extend", ""},
+ {MTEX_NSPACE_WORLD, "WORLD", 0, "World", ""},
+ {MTEX_NSPACE_OBJECT, "OBJECT", 0, "Object", ""},
+ {MTEX_NSPACE_TANGENT, "TANGENT", 0, "Tangent", ""},
+ {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ImageTexture", "Texture");
RNA_def_struct_ui_text(srna, "Image Texture", "");
rna_def_filter_size_common(srna);
- prop= RNA_def_property(srna, "normal_map", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP);
- RNA_def_property_ui_text(prop, "Normal Map", "Uses image RGB values for normal mapping");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
-
- /* XXX: mtex->normapspace "Sets space of normal map image" "Normal Space %t|Camera %x0|World %x1|Object %x2|Tangent %x3"
- * not sure why this goes in mtex instead of texture directly? */
-
prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "extend");
RNA_def_property_enum_items(prop, prop_image_extension);
RNA_def_property_range(prop, 1, 256);
RNA_def_property_ui_text(prop, "Filter Eccentricity", "Maximum eccentricity. Higher gives less blur at distant/oblique angles, but is also slower.");
RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+ /* Normal Map */
+ prop= RNA_def_property(srna, "normal_map", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP);
+ RNA_def_property_ui_text(prop, "Normal Map", "Uses image RGB values for normal mapping");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+ /* not sure why this goes in mtex instead of texture directly? */
+ RNA_def_struct_sdna(srna, "MTex");
+
+ prop= RNA_def_property(srna, "normal_space", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "normapspace");
+ RNA_def_property_enum_items(prop, prop_normal_space);
+ RNA_def_property_ui_text(prop, "Normal Space", "Sets space of normal map image.");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_plugin(BlenderRNA *brna)