diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_texture.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_texture.py | 73 |
1 files changed, 59 insertions, 14 deletions
diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index caf19a9e469..d05527b7ef6 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -21,15 +21,15 @@ import bpy from bpy.types import Menu, Panel, UIList from bpy.types import ( - Brush, - FreestyleLineStyle, - Lamp, - Material, - Object, - ParticleSettings, - Texture, - World, - ) + Brush, + FreestyleLineStyle, + Lamp, + Material, + Object, + ParticleSettings, + Texture, + World, +) from rna_prop_ui import PropertyPanel @@ -60,6 +60,7 @@ class TEXTURE_MT_envmap_specials(Menu): class TEXTURE_UL_texslots(UIList): + def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): # assert(isinstance(item, bpy.types.MaterialTextureSlot) ma = data @@ -198,7 +199,8 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel): if tex_collection: row = layout.row() - row.template_list("TEXTURE_UL_texslots", "", idblock, "texture_slots", idblock, "active_texture_index", rows=2) + row.template_list("TEXTURE_UL_texslots", "", idblock, "texture_slots", + idblock, "active_texture_index", rows=2) col = row.column(align=True) col.operator("texture.slot_move", text="", icon='TRIA_UP').type = 'UP' @@ -1210,12 +1212,22 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): row = layout.row() sub = row.row() - sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and (tex.texture.use_normal_map or tex.texture.use_derivative_map)) + sub.active = ( + (tex.use_map_normal or tex.use_map_warp) and + not (tex.texture.type == 'IMAGE' and + (tex.texture.use_normal_map or tex.texture.use_derivative_map)) + ) sub.prop(tex, "bump_method", text="Method") - # the space setting is supported for: derivative-maps + bump-maps (DEFAULT,BEST_QUALITY), not for normal-maps + # the space setting is supported for: derivative-maps + bump-maps + # (DEFAULT,BEST_QUALITY), not for normal-maps sub = row.row() - sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and tex.texture.use_normal_map) and ((tex.bump_method in {'BUMP_LOW_QUALITY', 'BUMP_MEDIUM_QUALITY', 'BUMP_BEST_QUALITY'}) or (tex.texture.type == 'IMAGE' and tex.texture.use_derivative_map)) + sub.active = ( + (tex.use_map_normal or tex.use_map_warp) and + not (tex.texture.type == 'IMAGE' and tex.texture.use_normal_map) and + ((tex.bump_method in {'BUMP_LOW_QUALITY', 'BUMP_MEDIUM_QUALITY', 'BUMP_BEST_QUALITY'}) or + (tex.texture.type == 'IMAGE' and tex.texture.use_derivative_map)) + ) sub.prop(tex, "bump_objectspace", text="Space") @@ -1224,5 +1236,38 @@ class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, Panel): _context_path = "texture" _property_type = Texture + +classes = ( + TEXTURE_MT_specials, + TEXTURE_MT_envmap_specials, + TEXTURE_UL_texslots, + TEXTURE_PT_context_texture, + TEXTURE_PT_preview, + TEXTURE_PT_colors, + TEXTURE_PT_clouds, + TEXTURE_PT_wood, + TEXTURE_PT_marble, + TEXTURE_PT_magic, + TEXTURE_PT_blend, + TEXTURE_PT_stucci, + TEXTURE_PT_image, + TEXTURE_PT_image_sampling, + TEXTURE_PT_image_mapping, + TEXTURE_PT_envmap, + TEXTURE_PT_envmap_sampling, + TEXTURE_PT_musgrave, + TEXTURE_PT_voronoi, + TEXTURE_PT_distortednoise, + TEXTURE_PT_voxeldata, + TEXTURE_PT_pointdensity, + TEXTURE_PT_pointdensity_turbulence, + TEXTURE_PT_ocean, + TEXTURE_PT_mapping, + TEXTURE_PT_influence, + TEXTURE_PT_custom_props, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) |