toggle buttons for texture channels (hardcoded like UV layer buttons)

This commit is contained in:
Campbell Barton
2009-10-08 15:29:43 +00:00
parent 88613b9184
commit 66634e2be4
2 changed files with 11 additions and 0 deletions

View 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);

View 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);