Started RNA for MTex
authorNicholas Bishop <nicholasbishop@gmail.com>
Sat, 3 Jan 2009 08:08:44 +0000 (08:08 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Sat, 3 Jan 2009 08:08:44 +0000 (08:08 +0000)
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_texture.c

index 7f2992212475e62e2f19a8820f585cdff4c4cbeb..dcf23be34cdab4353b999ebcf1b27291dd9ac098 100644 (file)
@@ -113,6 +113,7 @@ extern StructRNA RNA_Lattice;
 extern StructRNA RNA_LatticeModifier;
 extern StructRNA RNA_LatticePoint;
 extern StructRNA RNA_Library;
+extern StructRNA RNA_MappingTexture;
 extern StructRNA RNA_MCol;
 extern StructRNA RNA_MColLayer;
 extern StructRNA RNA_MFloatProperty;
index 77bcd23ae14ed0f7668f36f9a0411c63351f5c7f..7abf5c0e41a6e8dcfb299f0cd1be21ab67304a5d 100644 (file)
 
 #include "rna_internal.h"
 
+#include "DNA_material_types.h"
 #include "DNA_texture_types.h"
 
 #ifdef RNA_RUNTIME
 
 #else
 
+void rna_def_mapping_texture(BlenderRNA *brna)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+
+       static EnumPropertyItem prop_texture_coordinates_items[] = {
+               {TEXCO_ORCO, "ORIGINAL_COORDINATES", "Original Coordinates", ""},
+               {TEXCO_REFL, "REFLECTION_VECTOR", "Reflection Vector", ""},
+               {TEXCO_NORM, "NORMAL_VECTOR", "Normal Vector", ""},
+               {TEXCO_GLOB, "GLOBAL", "Global", ""},
+               {TEXCO_UV, "UV", "UV", ""},
+               {TEXCO_OBJECT, "LINKED_OBJECT", "Linked Object", ""},
+               {TEXCO_STRAND, "STRAND", "Strand", ""},
+               {TEXCO_STRESS, "STRESS", "Stress", ""},
+               {TEXCO_SPEED, "TANGENT", "Tangent", ""},
+               {0, NULL, NULL, NULL}};
+
+       static EnumPropertyItem prop_blend_type_items[] = {
+               {MTEX_BLEND, "MIX", "Mix", ""},
+               {MTEX_ADD, "ADD", "Add", ""},
+               {MTEX_SUB, "SUBTRACT", "Subtract", ""},
+               {MTEX_MUL, "MULTIPLY", "Multiply", ""},
+               {MTEX_SCREEN, "SCREEN", "Screen", ""},
+               {MTEX_OVERLAY, "OVERLAY", "Overlay", ""},
+               {MTEX_DIFF, "DIFFERENCE", "Difference", ""},
+               {MTEX_DIV, "DIVIDE", "Divide", ""},
+               {MTEX_DARK, "DARKEN", "Darken", ""},
+               {MTEX_LIGHT, "LIGHTEN", "Lighten", ""},
+               {MTEX_BLEND_HUE, "HUE", "Hue", ""},
+               {MTEX_BLEND_SAT, "SATURATION", "Saturation", ""},
+               {MTEX_BLEND_VAL, "VALUE", "Value", ""},
+               {MTEX_BLEND_COLOR, "COLOR", "Color", ""},
+               {0, NULL, NULL, NULL}};
+
+       srna= RNA_def_struct(brna, "MappingTexture", NULL);
+       RNA_def_struct_sdna(srna, "MTex");
+       RNA_def_struct_ui_text(srna, "MappingTexture", "DOC_BROKEN");
+
+       prop= RNA_def_property(srna, "texture_coordinates", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "texco");
+       RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
+       RNA_def_property_ui_text(prop, "Texture Coordinates", "");
+
+       /* XXX: MTex.mapto and MTex.maptoneg */
+
+       prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "blendtype");
+       RNA_def_property_enum_items(prop, prop_blend_type_items);
+       RNA_def_property_ui_text(prop, "Blend Type", "");
+
+       prop= RNA_def_property(srna, "mapping_object", PROP_POINTER, PROP_NONE);
+       RNA_def_property_pointer_sdna(prop, NULL, "object");
+       RNA_def_property_struct_type(prop, "Object");
+       RNA_def_property_ui_text(prop, "Mapping Object", "");
+
+       prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
+       RNA_def_property_pointer_sdna(prop, NULL, "tex");
+       RNA_def_property_struct_type(prop, "Texture");
+       RNA_def_property_ui_text(prop, "Texture", "");
+}
+
 void rna_def_environment_map(BlenderRNA *brna)
 {
        StructRNA *srna;
@@ -153,6 +215,7 @@ void RNA_def_texture(BlenderRNA *brna)
                {TEX_CELLNOISE, "CELL_NOISE", "Cell Noise", ""},
                {0, NULL, NULL, NULL}};
 
+       rna_def_mapping_texture(brna);
        rna_def_environment_map(brna);
 
        srna= RNA_def_struct(brna, "Texture", "ID");