toggle buttons for texture channels (hardcoded like UV layer buttons)
authorCampbell Barton <ideasman42@gmail.com>
Thu, 8 Oct 2009 15:29:43 +0000 (15:29 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 8 Oct 2009 15:29:43 +0000 (15:29 +0000)
source/blender/editors/interface/interface_templates.c
source/blender/makesrna/intern/rna_material.c

index 5b93f9ee06dbd9331171f396499055d962c2d44b..d94d2be3a948f12a0df6c1ae933a781e0900e402 100644 (file)
@@ -2070,6 +2070,10 @@ ListBase uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, char *pr
                                                uiDefIconButR(block, TOG, 0, ICON_SCENE, 0, 0, UI_UNIT_X, UI_UNIT_Y, &itemptr, "active_render", 0, 0, 0, 0, 0, NULL);
                                                uiBlockSetEmboss(block, UI_EMBOSS);
                                        }
+                                       else if (itemptr.type == &RNA_MaterialTextureSlot) {
+                                               uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, ptr, "use_textures", i, 0, 0, 0, 0,  NULL);
+                                       }
+                                       /* XXX - end hardcoded cruft */
 
                                        if(name)
                                                MEM_freeN(name);
index 28fcc3103b865353ba12f272ffa98fe4c64c85f9..b22b5916362b7a7ba3654f543ff2804a93ddf9f6 100644 (file)
@@ -1730,6 +1730,13 @@ void RNA_def_material(BlenderRNA *brna)
        rna_def_mtex_common(srna, "rna_Material_mtex_begin", "rna_Material_active_texture_get",
                "rna_Material_active_texture_set", "MaterialTextureSlot", "rna_Material_update");
        
+       /* only material has this one */
+       prop= RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_negative_sdna(prop, NULL, "septex", 1);
+       RNA_def_property_array(prop, 18);
+       RNA_def_property_ui_text(prop, "Use Textures", "Enable/Disable each texture.");
+       RNA_def_property_update(prop, 0, "rna_Material_update");
+
        rna_def_material_colors(srna);
        rna_def_material_diffuse(srna);
        rna_def_material_specularity(srna);