2009-11-01 15:21:20 +00:00
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
2009-11-03 07:23:02 +00:00
#
2009-11-01 15:21:20 +00:00
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
2009-11-03 07:23:02 +00:00
#
2009-11-01 15:21:20 +00:00
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
2010-02-12 13:34:04 +00:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2009-11-01 15:21:20 +00:00
#
# ##### END GPL LICENSE BLOCK #####
2009-10-31 20:16:59 +00:00
2009-10-31 23:35:56 +00:00
# <pep8 compliant>
2009-05-22 12:07:03 +00:00
import bpy
2010-01-08 08:54:41 +00:00
from rna_prop_ui import PropertyPanel
2009-05-22 12:07:03 +00:00
2009-11-12 15:41:44 +00:00
narrowui = 180
2009-10-31 23:35:56 +00:00
2009-11-14 13:35:44 +00:00
2010-03-09 09:17:45 +00:00
class TEXTURE_MT_specials ( bpy . types . Menu ) :
bl_label = " Texture Specials "
def draw ( self , context ) :
layout = self . layout
layout . operator ( " material.mtex_copy " , icon = ' COPYDOWN ' )
layout . operator ( " material.mtex_paste " , icon = ' PASTEDOWN ' )
2010-03-11 07:43:49 +00:00
class TEXTURE_MT_envmap_specials ( bpy . types . Menu ) :
bl_label = " Environment Map Specials "
def draw ( self , context ) :
layout = self . layout
layout . operator ( " texture.envmap_save " , icon = ' IMAGEFILE ' )
layout . operator ( " texture.envmap_clear " , icon = ' FILE_REFRESH ' )
layout . operator ( " texture.envmap_clear_all " , icon = ' FILE_REFRESH ' )
2009-10-12 14:38:35 +00:00
def context_tex_datablock ( context ) :
2010-03-17 22:54:55 +00:00
idblock = context . material
2009-11-14 13:35:44 +00:00
if idblock :
return idblock
2009-10-31 19:31:45 +00:00
2009-11-14 13:35:44 +00:00
idblock = context . lamp
if idblock :
return idblock
2009-10-31 19:31:45 +00:00
2009-11-14 13:35:44 +00:00
idblock = context . world
if idblock :
2009-10-31 19:31:45 +00:00
return idblock
2009-10-09 15:25:19 +00:00
2009-11-14 13:35:44 +00:00
idblock = context . brush
return idblock
2009-10-31 23:35:56 +00:00
2009-05-22 12:07:03 +00:00
class TextureButtonsPanel ( bpy . types . Panel ) :
2009-10-31 19:31:45 +00:00
bl_space_type = ' PROPERTIES '
bl_region_type = ' WINDOW '
bl_context = " texture "
def poll ( self , context ) :
tex = context . texture
return ( tex and ( tex . type != ' NONE ' or tex . use_nodes ) )
2009-10-31 23:35:56 +00:00
2009-05-28 23:45:50 +00:00
class TEXTURE_PT_preview ( TextureButtonsPanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Preview "
def draw ( self , context ) :
layout = self . layout
tex = context . texture
slot = context . texture_slot
idblock = context_tex_datablock ( context )
if idblock :
layout . template_preview ( tex , parent = idblock , slot = slot )
else :
layout . template_preview ( tex , slot = slot )
2009-10-31 23:35:56 +00:00
2009-07-09 09:42:34 +00:00
class TEXTURE_PT_context_texture ( TextureButtonsPanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " "
bl_show_header = False
def poll ( self , context ) :
return ( context . material or context . world or context . lamp or context . brush or context . texture )
def draw ( self , context ) :
layout = self . layout
2010-01-29 16:32:06 +00:00
slot = context . texture_slot
node = context . texture_node
2010-01-03 08:37:18 +00:00
space = context . space_data
2009-10-31 19:31:45 +00:00
tex = context . texture
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-10-31 19:31:45 +00:00
idblock = context_tex_datablock ( context )
2010-01-29 16:32:06 +00:00
tex_collection = space . pin_id == None and type ( idblock ) != bpy . types . Brush and not node
2009-10-31 19:31:45 +00:00
2010-01-03 08:37:18 +00:00
if tex_collection :
2009-10-31 19:31:45 +00:00
row = layout . row ( )
2010-02-07 12:51:47 +00:00
row . template_list ( idblock , " texture_slots " , idblock , " active_texture_index " , rows = 2 )
2009-10-31 19:31:45 +00:00
col = row . column ( align = True )
2009-12-10 10:23:53 +00:00
col . operator ( " texture.slot_move " , text = " " , icon = ' TRIA_UP ' ) . type = ' UP '
col . operator ( " texture.slot_move " , text = " " , icon = ' TRIA_DOWN ' ) . type = ' DOWN '
2010-03-09 09:17:45 +00:00
col . menu ( " TEXTURE_MT_specials " , icon = ' DOWNARROW_HLT ' , text = " " )
2010-01-31 14:46:28 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
split = layout . split ( percentage = 0.65 )
2010-01-03 08:37:18 +00:00
col = split . column ( )
2009-11-12 15:41:44 +00:00
else :
2010-01-03 08:37:18 +00:00
col = layout . column ( )
2010-01-31 14:46:28 +00:00
2010-01-03 08:37:18 +00:00
if tex_collection :
col . template_ID ( idblock , " active_texture " , new = " texture.new " )
2010-01-29 16:32:06 +00:00
elif node :
col . template_ID ( node , " texture " , new = " texture.new " )
2010-01-03 08:37:18 +00:00
elif idblock :
col . template_ID ( idblock , " texture " , new = " texture.new " )
2010-01-31 14:46:28 +00:00
2010-01-03 08:37:18 +00:00
if space . pin_id :
col . template_ID ( space , " pin_id " )
2010-01-31 14:46:28 +00:00
2010-01-03 08:37:18 +00:00
if wide_ui :
col = split . column ( )
2009-10-31 23:35:56 +00:00
2010-01-26 00:59:53 +00:00
if not space . pin_id :
2010-01-03 08:37:18 +00:00
col . prop ( space , " brush_texture " , text = " Brush " , toggle = True )
2009-10-31 19:31:45 +00:00
if tex :
split = layout . split ( percentage = 0.2 )
if tex . use_nodes :
if slot :
2009-11-23 00:27:30 +00:00
split . label ( text = " Output: " )
split . prop ( slot , " output_node " , text = " " )
2009-10-31 19:31:45 +00:00
else :
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-23 00:27:30 +00:00
split . label ( text = " Type: " )
split . prop ( tex , " type " , text = " " )
2009-11-12 15:41:44 +00:00
else :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " type " , text = " " )
2009-10-31 19:31:45 +00:00
2009-10-31 23:35:56 +00:00
2010-01-08 08:54:41 +00:00
class TEXTURE_PT_custom_props ( TextureButtonsPanel , PropertyPanel ) :
_context_path = " texture "
def poll ( self , context ) : # use alternate poll since NONE texture type is ok
return context . texture
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_colors ( TextureButtonsPanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Colors "
bl_default_closed = True
def draw ( self , context ) :
layout = self . layout
tex = context . texture
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-10-31 19:31:45 +00:00
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " use_color_ramp " , text = " Ramp " )
2009-10-31 19:31:45 +00:00
if tex . use_color_ramp :
layout . template_color_ramp ( tex , " color_ramp " , expand = True )
split = layout . split ( )
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . label ( text = " RGB Multiply: " )
2009-10-31 19:31:45 +00:00
sub = col . column ( align = True )
2009-11-23 00:27:30 +00:00
sub . prop ( tex , " factor_red " , text = " R " )
sub . prop ( tex , " factor_green " , text = " G " )
sub . prop ( tex , " factor_blue " , text = " B " )
2009-10-31 19:31:45 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . label ( text = " Adjust: " )
col . prop ( tex , " brightness " )
col . prop ( tex , " contrast " )
2009-10-31 19:31:45 +00:00
2009-08-17 18:37:58 +00:00
# Texture Slot Panels #
2009-10-31 19:31:45 +00:00
2009-10-31 23:35:56 +00:00
2009-08-17 18:37:58 +00:00
class TextureSlotPanel ( TextureButtonsPanel ) :
2009-10-31 23:35:56 +00:00
2009-10-31 19:31:45 +00:00
def poll ( self , context ) :
2009-10-31 23:35:56 +00:00
return ( context . texture_slot and
TextureButtonsPanel . poll ( self , context ) )
2009-10-31 19:31:45 +00:00
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_mapping ( TextureSlotPanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Mapping "
def draw ( self , context ) :
layout = self . layout
idblock = context_tex_datablock ( context )
tex = context . texture_slot
2009-11-14 13:35:44 +00:00
# textype = context.texture
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-10-31 19:31:45 +00:00
if type ( idblock ) != bpy . types . Brush :
split = layout . split ( percentage = 0.3 )
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . label ( text = " Coordinates: " )
2009-10-31 19:31:45 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " texture_coordinates " , text = " " )
2009-10-31 19:31:45 +00:00
if tex . texture_coordinates == ' ORCO ' :
"""
ob = context . object
if ob and ob . type == ' MESH ' :
split = layout . split ( percentage = 0.3 )
2009-11-23 00:27:30 +00:00
split . label ( text = " Mesh: " )
split . prop ( ob . data , " texco_mesh " , text = " " )
2009-10-31 19:31:45 +00:00
"""
elif tex . texture_coordinates == ' UV ' :
split = layout . split ( percentage = 0.3 )
2009-11-23 00:27:30 +00:00
split . label ( text = " Layer: " )
2009-10-31 19:31:45 +00:00
ob = context . object
2009-10-31 23:35:56 +00:00
if ob and ob . type == ' MESH ' :
2009-11-23 11:43:38 +00:00
split . prop_object ( tex , " uv_layer " , ob . data , " uv_textures " , text = " " )
2009-10-31 23:35:56 +00:00
else :
2009-11-23 00:27:30 +00:00
split . prop ( tex , " uv_layer " , text = " " )
2009-10-31 23:35:56 +00:00
2009-10-31 19:31:45 +00:00
elif tex . texture_coordinates == ' OBJECT ' :
split = layout . split ( percentage = 0.3 )
2009-11-23 00:27:30 +00:00
split . label ( text = " Object: " )
split . prop ( tex , " object " , text = " " )
2009-10-31 19:31:45 +00:00
if type ( idblock ) == bpy . types . Brush :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " map_mode " , expand = True )
2009-10-31 19:31:45 +00:00
row = layout . row ( )
row . active = tex . map_mode in ( ' FIXED ' , ' TILED ' )
2009-11-23 00:27:30 +00:00
row . prop ( tex , " angle " )
2009-10-31 19:31:45 +00:00
row = layout . row ( )
row . active = tex . map_mode in ( ' TILED ' , ' 3D ' )
2009-11-23 00:27:30 +00:00
row . column ( ) . prop ( tex , " size " )
2009-10-31 19:31:45 +00:00
else :
if type ( idblock ) == bpy . types . Material :
split = layout . split ( percentage = 0.3 )
2009-11-23 00:27:30 +00:00
split . label ( text = " Projection: " )
split . prop ( tex , " mapping " , text = " " )
2009-10-31 19:31:45 +00:00
split = layout . split ( )
col = split . column ( )
if tex . texture_coordinates in ( ' ORCO ' , ' UV ' ) :
2009-11-23 00:27:30 +00:00
col . prop ( tex , " from_dupli " )
2009-10-31 19:31:45 +00:00
elif tex . texture_coordinates == ' OBJECT ' :
2009-11-23 00:27:30 +00:00
col . prop ( tex , " from_original " )
2009-11-19 13:26:51 +00:00
elif wide_ui :
2009-11-23 00:27:30 +00:00
col . label ( )
2009-10-31 19:31:45 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-10-31 19:31:45 +00:00
row = col . row ( )
2009-11-23 00:27:30 +00:00
row . prop ( tex , " x_mapping " , text = " " )
row . prop ( tex , " y_mapping " , text = " " )
row . prop ( tex , " z_mapping " , text = " " )
2009-10-31 19:31:45 +00:00
# any non brush
2009-11-12 15:41:44 +00:00
split = layout . split ( )
2009-11-14 13:35:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " offset " )
2009-11-14 13:35:44 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-14 13:35:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " size " )
2009-10-31 19:31:45 +00:00
2009-06-09 16:04:07 +00:00
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_influence ( TextureSlotPanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Influence "
2009-10-31 23:35:56 +00:00
2009-10-31 19:31:45 +00:00
def poll ( self , context ) :
2010-01-03 08:37:18 +00:00
idblock = context_tex_datablock ( context )
if type ( idblock ) == bpy . types . Brush :
return False
2010-01-31 14:46:28 +00:00
2009-10-31 19:31:45 +00:00
return context . texture_slot
def draw ( self , context ) :
layout = self . layout
idblock = context_tex_datablock ( context )
2009-11-14 13:35:44 +00:00
# textype = context.texture
2009-10-31 19:31:45 +00:00
tex = context . texture_slot
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-10-31 19:31:45 +00:00
def factor_but ( layout , active , toggle , factor , name ) :
row = layout . row ( align = True )
2009-11-23 00:27:30 +00:00
row . prop ( tex , toggle , text = " " )
2009-10-31 19:31:45 +00:00
sub = row . row ( )
sub . active = active
2009-11-23 00:27:30 +00:00
sub . prop ( tex , factor , text = name , slider = True )
2009-10-31 19:31:45 +00:00
if type ( idblock ) == bpy . types . Material :
if idblock . type in ( ' SURFACE ' , ' HALO ' , ' WIRE ' ) :
split = layout . split ( )
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . label ( text = " Diffuse: " )
2009-10-31 19:31:45 +00:00
factor_but ( col , tex . map_diffuse , " map_diffuse " , " diffuse_factor " , " Intensity " )
factor_but ( col , tex . map_colordiff , " map_colordiff " , " colordiff_factor " , " Color " )
factor_but ( col , tex . map_alpha , " map_alpha " , " alpha_factor " , " Alpha " )
factor_but ( col , tex . map_translucency , " map_translucency " , " translucency_factor " , " Translucency " )
2009-11-23 00:27:30 +00:00
col . label ( text = " Specular: " )
2009-10-31 19:31:45 +00:00
factor_but ( col , tex . map_specular , " map_specular " , " specular_factor " , " Intensity " )
factor_but ( col , tex . map_colorspec , " map_colorspec " , " colorspec_factor " , " Color " )
factor_but ( col , tex . map_hardness , " map_hardness " , " hardness_factor " , " Hardness " )
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . label ( text = " Shading: " )
2009-10-31 19:31:45 +00:00
factor_but ( col , tex . map_ambient , " map_ambient " , " ambient_factor " , " Ambient " )
factor_but ( col , tex . map_emit , " map_emit " , " emit_factor " , " Emit " )
factor_but ( col , tex . map_mirror , " map_mirror " , " mirror_factor " , " Mirror " )
factor_but ( col , tex . map_raymir , " map_raymir " , " raymir_factor " , " Ray Mirror " )
2009-11-23 00:27:30 +00:00
col . label ( text = " Geometry: " )
2009-10-31 19:31:45 +00:00
factor_but ( col , tex . map_normal , " map_normal " , " normal_factor " , " Normal " )
factor_but ( col , tex . map_warp , " map_warp " , " warp_factor " , " Warp " )
factor_but ( col , tex . map_displacement , " map_displacement " , " displacement_factor " , " Displace " )
#sub = col.column()
#sub.active = tex.map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror
2009-11-23 00:27:30 +00:00
#sub.prop(tex, "default_value", text="Amount", slider=True)
2009-10-31 19:31:45 +00:00
elif idblock . type == ' VOLUME ' :
split = layout . split ( )
col = split . column ( )
factor_but ( col , tex . map_density , " map_density " , " density_factor " , " Density " )
factor_but ( col , tex . map_emission , " map_emission " , " emission_factor " , " Emission " )
factor_but ( col , tex . map_scattering , " map_scattering " , " scattering_factor " , " Scattering " )
factor_but ( col , tex . map_reflection , " map_reflection " , " reflection_factor " , " Reflection " )
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . label ( text = " " )
2010-03-10 04:30:17 +00:00
factor_but ( col , tex . map_coloremission , " map_coloremission " , " coloremission_factor " , " Emission Color " )
2009-10-31 19:31:45 +00:00
factor_but ( col , tex . map_colortransmission , " map_colortransmission " , " colortransmission_factor " , " Transmission Color " )
factor_but ( col , tex . map_colorreflection , " map_colorreflection " , " colorreflection_factor " , " Reflection Color " )
elif type ( idblock ) == bpy . types . Lamp :
2009-11-12 15:41:44 +00:00
split = layout . split ( )
col = split . column ( )
factor_but ( col , tex . map_color , " map_color " , " color_factor " , " Color " )
2009-11-14 13:35:44 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
factor_but ( col , tex . map_shadow , " map_shadow " , " shadow_factor " , " Shadow " )
2009-10-31 19:31:45 +00:00
elif type ( idblock ) == bpy . types . World :
split = layout . split ( )
col = split . column ( )
factor_but ( col , tex . map_blend , " map_blend " , " blend_factor " , " Blend " )
factor_but ( col , tex . map_horizon , " map_horizon " , " horizon_factor " , " Horizon " )
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-10-31 19:31:45 +00:00
factor_but ( col , tex . map_zenith_up , " map_zenith_up " , " zenith_up_factor " , " Zenith Up " )
factor_but ( col , tex . map_zenith_down , " map_zenith_down " , " zenith_down_factor " , " Zenith Down " )
2009-11-23 00:27:30 +00:00
layout . separator ( )
2009-10-31 19:31:45 +00:00
split = layout . split ( )
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " blend_type " , text = " Blend " )
col . prop ( tex , " rgb_to_intensity " )
2009-10-31 19:31:45 +00:00
sub = col . column ( )
sub . active = tex . rgb_to_intensity
2009-11-23 00:27:30 +00:00
sub . prop ( tex , " color " , text = " " )
2009-10-31 19:31:45 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " negate " , text = " Negative " )
col . prop ( tex , " stencil " )
2009-10-31 19:31:45 +00:00
if type ( idblock ) in ( bpy . types . Material , bpy . types . World ) :
2009-11-23 00:27:30 +00:00
col . prop ( tex , " default_value " , text = " DVar " , slider = True )
2009-06-08 19:44:07 +00:00
2009-08-08 17:21:34 +00:00
# Texture Type Panels #
2009-06-03 00:17:35 +00:00
2009-10-31 23:35:56 +00:00
2009-08-17 18:37:58 +00:00
class TextureTypePanel ( TextureButtonsPanel ) :
2009-10-31 23:35:56 +00:00
2009-10-31 19:31:45 +00:00
def poll ( self , context ) :
tex = context . texture
return ( tex and tex . type == self . tex_type and not tex . use_nodes )
2009-08-17 18:37:58 +00:00
2009-10-31 23:35:56 +00:00
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_clouds ( TextureTypePanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Clouds "
tex_type = ' CLOUDS '
def draw ( self , context ) :
layout = self . layout
tex = context . texture
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-10-31 19:31:45 +00:00
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " stype " , expand = True )
layout . label ( text = " Noise: " )
layout . prop ( tex , " noise_type " , text = " Type " , expand = True )
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " noise_basis " , text = " Basis " )
2009-11-12 15:41:44 +00:00
else :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " noise_basis " , text = " " )
2009-11-12 15:41:44 +00:00
split = layout . split ( )
2009-10-31 19:31:45 +00:00
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " noise_size " , text = " Size " )
col . prop ( tex , " noise_depth " , text = " Depth " )
2009-11-14 13:35:44 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " nabla " , text = " Nabla " )
2009-05-22 12:07:03 +00:00
2009-10-31 23:35:56 +00:00
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_wood ( TextureTypePanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Wood "
tex_type = ' WOOD '
def draw ( self , context ) :
layout = self . layout
tex = context . texture
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-10-31 19:31:45 +00:00
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " noisebasis2 " , expand = True )
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " stype " , expand = True )
2009-11-12 15:41:44 +00:00
else :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " stype " , text = " " )
2009-10-31 19:31:45 +00:00
col = layout . column ( )
col . active = tex . stype in ( ' RINGNOISE ' , ' BANDNOISE ' )
2009-11-23 00:27:30 +00:00
col . label ( text = " Noise: " )
col . row ( ) . prop ( tex , " noise_type " , text = " Type " , expand = True )
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " noise_basis " , text = " Basis " )
2009-11-12 15:41:44 +00:00
else :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " noise_basis " , text = " " )
2009-10-31 19:31:45 +00:00
2009-11-12 15:41:44 +00:00
split = layout . split ( )
split . active = tex . stype in ( ' RINGNOISE ' , ' BANDNOISE ' )
2009-11-14 13:35:44 +00:00
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " noise_size " , text = " Size " )
col . prop ( tex , " turbulence " )
2009-11-14 13:35:44 +00:00
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " nabla " )
2009-10-31 19:31:45 +00:00
2009-10-31 23:35:56 +00:00
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_marble ( TextureTypePanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Marble "
tex_type = ' MARBLE '
def draw ( self , context ) :
layout = self . layout
tex = context . texture
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-10-31 19:31:45 +00:00
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " stype " , expand = True )
layout . prop ( tex , " noisebasis2 " , expand = True )
layout . label ( text = " Noise: " )
layout . prop ( tex , " noise_type " , text = " Type " , expand = True )
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " noise_basis " , text = " Basis " )
2009-11-12 15:41:44 +00:00
else :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " noise_basis " , text = " " )
2009-10-31 19:31:45 +00:00
2009-11-12 15:41:44 +00:00
split = layout . split ( )
2009-11-14 13:35:44 +00:00
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " noise_size " , text = " Size " )
col . prop ( tex , " noise_depth " , text = " Depth " )
2009-11-14 13:35:44 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " turbulence " )
col . prop ( tex , " nabla " )
2009-05-22 12:07:03 +00:00
2009-10-31 23:35:56 +00:00
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_magic ( TextureTypePanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Magic "
tex_type = ' MAGIC '
def draw ( self , context ) :
layout = self . layout
tex = context . texture
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-10-31 19:31:45 +00:00
2009-11-12 15:41:44 +00:00
split = layout . split ( )
2009-11-14 13:35:44 +00:00
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " noise_depth " , text = " Depth " )
2009-11-14 13:35:44 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " turbulence " )
2009-05-22 12:07:03 +00:00
2009-10-31 23:35:56 +00:00
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_blend ( TextureTypePanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Blend "
tex_type = ' BLEND '
def draw ( self , context ) :
layout = self . layout
tex = context . texture
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-10-31 19:31:45 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " progression " )
2009-11-12 15:41:44 +00:00
else :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " progression " , text = " " )
2009-11-14 13:35:44 +00:00
2009-10-31 19:31:45 +00:00
sub = layout . row ( )
sub . active = ( tex . progression in ( ' LINEAR ' , ' QUADRATIC ' , ' EASING ' , ' RADIAL ' ) )
2009-11-23 00:27:30 +00:00
sub . prop ( tex , " flip_axis " , expand = True )
2009-10-31 19:31:45 +00:00
2009-10-31 23:35:56 +00:00
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_stucci ( TextureTypePanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Stucci "
tex_type = ' STUCCI '
def draw ( self , context ) :
layout = self . layout
tex = context . texture
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-10-31 19:31:45 +00:00
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " stype " , expand = True )
layout . label ( text = " Noise: " )
layout . prop ( tex , " noise_type " , text = " Type " , expand = True )
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " noise_basis " , text = " Basis " )
2009-11-12 15:41:44 +00:00
else :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " noise_basis " , text = " " )
2009-10-31 19:31:45 +00:00
2009-11-12 15:41:44 +00:00
split = layout . split ( )
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " noise_size " , text = " Size " )
2009-11-14 13:35:44 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " turbulence " )
2009-10-31 19:31:45 +00:00
2009-10-31 23:35:56 +00:00
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_image ( TextureTypePanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Image "
tex_type = ' IMAGE '
2009-09-16 18:47:42 +00:00
2009-10-31 19:31:45 +00:00
def draw ( self , context ) :
layout = self . layout
2009-07-21 12:57:55 +00:00
2009-10-31 19:31:45 +00:00
tex = context . texture
layout . template_image ( tex , " image " , tex . image_user )
2009-07-21 12:57:55 +00:00
2010-03-14 23:26:17 +00:00
2010-03-11 07:43:49 +00:00
def texture_filter_common ( tex , layout ) :
2010-03-14 23:26:17 +00:00
layout . label ( text = " Filter: " )
layout . prop ( tex , " filter " , text = " " )
if tex . mipmap and tex . filter in ( ' AREA ' , ' EWA ' , ' FELINE ' ) :
if tex . filter == ' FELINE ' :
layout . prop ( tex , " filter_probes " , text = " Probes " )
else :
layout . prop ( tex , " filter_eccentricity " , text = " Eccentricity " )
layout . prop ( tex , " filter_size " )
layout . prop ( tex , " filter_size_minimum " )
2010-03-11 07:43:49 +00:00
2009-10-31 23:35:56 +00:00
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_image_sampling ( TextureTypePanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Image Sampling "
bl_default_closed = True
tex_type = ' IMAGE '
def draw ( self , context ) :
layout = self . layout
tex = context . texture
2009-11-14 13:35:44 +00:00
# slot = context.texture_slot
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-10-31 19:31:45 +00:00
split = layout . split ( )
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . label ( text = " Alpha: " )
col . prop ( tex , " use_alpha " , text = " Use " )
col . prop ( tex , " calculate_alpha " , text = " Calculate " )
col . prop ( tex , " invert_alpha " , text = " Invert " )
col . separator ( )
col . prop ( tex , " flip_axis " , text = " Flip X/Y Axis " )
2009-10-31 19:31:45 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
else :
2009-11-23 00:27:30 +00:00
col . separator ( )
col . prop ( tex , " normal_map " )
2009-10-31 19:31:45 +00:00
row = col . row ( )
row . active = tex . normal_map
2009-11-23 00:27:30 +00:00
row . prop ( tex , " normal_space " , text = " " )
2009-10-31 19:31:45 +00:00
2009-11-23 00:27:30 +00:00
col . prop ( tex , " mipmap " )
2009-10-31 19:31:45 +00:00
row = col . row ( )
row . active = tex . mipmap
2009-11-23 00:27:30 +00:00
row . prop ( tex , " mipmap_gauss " )
col . prop ( tex , " interpolation " )
2009-05-22 12:07:03 +00:00
2010-03-11 07:43:49 +00:00
texture_filter_common ( tex , col )
2010-03-14 23:26:17 +00:00
2009-10-31 23:35:56 +00:00
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_image_mapping ( TextureTypePanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Image Mapping "
bl_default_closed = True
tex_type = ' IMAGE '
def draw ( self , context ) :
layout = self . layout
tex = context . texture
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-10-31 19:31:45 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " extension " )
2009-11-12 15:41:44 +00:00
else :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " extension " , text = " " )
2009-10-31 19:31:45 +00:00
split = layout . split ( )
if tex . extension == ' REPEAT ' :
col = split . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Repeat: " )
col . prop ( tex , " repeat_x " , text = " X " )
col . prop ( tex , " repeat_y " , text = " Y " )
2009-10-31 19:31:45 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Mirror: " )
col . prop ( tex , " mirror_x " , text = " X " )
col . prop ( tex , " mirror_y " , text = " Y " )
layout . separator ( )
2009-10-31 19:31:45 +00:00
elif tex . extension == ' CHECKER ' :
col = split . column ( align = True )
row = col . row ( )
2009-11-23 00:27:30 +00:00
row . prop ( tex , " checker_even " , text = " Even " )
row . prop ( tex , " checker_odd " , text = " Odd " )
2009-11-14 13:35:44 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " checker_distance " , text = " Distance " )
2009-11-14 13:35:44 +00:00
2009-11-23 00:27:30 +00:00
layout . separator ( )
2009-10-31 19:31:45 +00:00
split = layout . split ( )
col = split . column ( align = True )
2009-11-23 00:27:30 +00:00
#col.prop(tex, "crop_rectangle")
col . label ( text = " Crop Minimum: " )
col . prop ( tex , " crop_min_x " , text = " X " )
col . prop ( tex , " crop_min_y " , text = " Y " )
2009-10-31 19:31:45 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( align = True )
2009-11-23 00:27:30 +00:00
col . label ( text = " Crop Maximum: " )
col . prop ( tex , " crop_max_x " , text = " X " )
col . prop ( tex , " crop_max_y " , text = " Y " )
2009-10-31 19:31:45 +00:00
2009-10-31 23:35:56 +00:00
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_plugin ( TextureTypePanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Plugin "
tex_type = ' PLUGIN '
def draw ( self , context ) :
layout = self . layout
2009-11-14 13:35:44 +00:00
# tex = context.texture
2009-10-31 19:31:45 +00:00
2009-11-23 00:27:30 +00:00
layout . label ( text = " Nothing yet " )
2009-10-31 19:31:45 +00:00
2009-10-31 23:35:56 +00:00
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_envmap ( TextureTypePanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Environment Map "
tex_type = ' ENVIRONMENT_MAP '
def draw ( self , context ) :
layout = self . layout
2010-03-11 07:43:49 +00:00
tex = context . texture
env = tex . environment_map
2010-03-14 23:26:17 +00:00
2010-03-11 07:43:49 +00:00
wide_ui = context . region . width > narrowui
2010-03-14 23:26:17 +00:00
2010-03-11 07:43:49 +00:00
row = layout . row ( )
row . prop ( env , " source " , expand = True )
row . menu ( " TEXTURE_MT_envmap_specials " , icon = ' DOWNARROW_HLT ' , text = " " )
2010-03-14 23:26:17 +00:00
2010-03-11 07:43:49 +00:00
if env . source == ' IMAGE_FILE ' :
layout . template_ID ( tex , " image " , open = " image.open " )
layout . template_image ( tex , " image " , tex . image_user , compact = True )
else :
layout . prop ( env , " mapping " )
if env . mapping == ' PLANE ' :
layout . prop ( env , " zoom " )
layout . prop ( env , " viewpoint_object " )
2010-03-14 23:26:17 +00:00
2010-03-11 07:43:49 +00:00
split = layout . split ( )
2010-03-14 23:26:17 +00:00
2010-03-11 07:43:49 +00:00
col = split . column ( )
col . prop ( env , " ignore_layers " )
col . prop ( env , " resolution " )
col . prop ( env , " depth " )
if wide_ui :
col = split . column ( align = True )
2010-03-14 23:26:17 +00:00
2010-03-11 07:43:49 +00:00
col . label ( text = " Clipping: " )
col . prop ( env , " clip_start " , text = " Start " )
col . prop ( env , " clip_end " , text = " End " )
2009-10-31 19:31:45 +00:00
2010-03-11 07:43:49 +00:00
class TEXTURE_PT_envmap_sampling ( TextureTypePanel ) :
bl_label = " Environment Map Sampling "
bl_default_closed = True
tex_type = ' ENVIRONMENT_MAP '
def draw ( self , context ) :
layout = self . layout
tex = context . texture
2010-03-14 23:26:17 +00:00
2010-03-11 07:43:49 +00:00
texture_filter_common ( tex , layout )
2010-03-14 23:26:17 +00:00
2009-10-31 23:35:56 +00:00
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_musgrave ( TextureTypePanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Musgrave "
tex_type = ' MUSGRAVE '
def draw ( self , context ) :
layout = self . layout
tex = context . texture
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-10-31 19:31:45 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " musgrave_type " )
2009-11-12 15:41:44 +00:00
else :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " musgrave_type " , text = " " )
2009-10-31 19:31:45 +00:00
split = layout . split ( )
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " highest_dimension " , text = " Dimension " )
col . prop ( tex , " lacunarity " )
col . prop ( tex , " octaves " )
2009-10-31 19:31:45 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-10-31 19:31:45 +00:00
if ( tex . musgrave_type in ( ' HETERO_TERRAIN ' , ' RIDGED_MULTIFRACTAL ' , ' HYBRID_MULTIFRACTAL ' ) ) :
2009-11-23 00:27:30 +00:00
col . prop ( tex , " offset " )
2009-10-31 19:31:45 +00:00
if ( tex . musgrave_type in ( ' RIDGED_MULTIFRACTAL ' , ' HYBRID_MULTIFRACTAL ' ) ) :
2009-11-23 00:27:30 +00:00
col . prop ( tex , " gain " )
col . prop ( tex , " noise_intensity " , text = " Intensity " )
2009-10-31 19:31:45 +00:00
2009-11-23 00:27:30 +00:00
layout . label ( text = " Noise: " )
2009-10-31 19:31:45 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " noise_basis " , text = " Basis " )
2009-11-12 15:41:44 +00:00
else :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " noise_basis " , text = " " )
2009-10-31 19:31:45 +00:00
2009-11-12 15:41:44 +00:00
split = layout . split ( )
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " noise_size " , text = " Size " )
2009-11-14 13:35:44 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " nabla " )
2009-05-22 12:07:03 +00:00
2009-10-31 23:35:56 +00:00
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_voronoi ( TextureTypePanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Voronoi "
tex_type = ' VORONOI '
def draw ( self , context ) :
layout = self . layout
tex = context . texture
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-10-31 19:31:45 +00:00
split = layout . split ( )
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . label ( text = " Distance Metric: " )
col . prop ( tex , " distance_metric " , text = " " )
2009-10-31 19:31:45 +00:00
sub = col . column ( )
sub . active = tex . distance_metric == ' MINKOVSKY '
2009-11-23 00:27:30 +00:00
sub . prop ( tex , " minkovsky_exponent " , text = " Exponent " )
col . label ( text = " Coloring: " )
col . prop ( tex , " coloring " , text = " " )
col . prop ( tex , " noise_intensity " , text = " Intensity " )
2009-10-31 19:31:45 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
sub = col . column ( align = True )
2009-11-23 00:27:30 +00:00
sub . label ( text = " Feature Weights: " )
sub . prop ( tex , " weight_1 " , text = " 1 " , slider = True )
sub . prop ( tex , " weight_2 " , text = " 2 " , slider = True )
sub . prop ( tex , " weight_3 " , text = " 3 " , slider = True )
sub . prop ( tex , " weight_4 " , text = " 4 " , slider = True )
2009-10-31 19:31:45 +00:00
2009-11-23 00:27:30 +00:00
layout . label ( text = " Noise: " )
2009-10-31 19:31:45 +00:00
2009-11-12 15:41:44 +00:00
split = layout . split ( )
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " noise_size " , text = " Size " )
2009-11-14 13:35:44 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " nabla " )
2009-10-31 19:31:45 +00:00
2009-10-31 23:35:56 +00:00
2009-08-17 18:37:58 +00:00
class TEXTURE_PT_distortednoise ( TextureTypePanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Distorted Noise "
tex_type = ' DISTORTED_NOISE '
def draw ( self , context ) :
layout = self . layout
tex = context . texture
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-11-12 15:41:44 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " noise_distortion " )
layout . prop ( tex , " noise_basis " , text = " Basis " )
2009-11-12 15:41:44 +00:00
else :
2009-11-23 00:27:30 +00:00
layout . prop ( tex , " noise_distortion " , text = " " )
layout . prop ( tex , " noise_basis " , text = " " )
2009-10-31 19:31:45 +00:00
2009-11-12 15:41:44 +00:00
split = layout . split ( )
2009-10-31 19:31:45 +00:00
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " distortion " , text = " Distortion " )
col . prop ( tex , " noise_size " , text = " Size " )
2009-11-14 13:35:44 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . prop ( tex , " nabla " )
2009-10-31 19:31:45 +00:00
2009-10-31 23:35:56 +00:00
2009-08-13 05:21:25 +00:00
class TEXTURE_PT_voxeldata ( TextureButtonsPanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Voxel Data "
def poll ( self , context ) :
tex = context . texture
return ( tex and tex . type == ' VOXEL_DATA ' )
def draw ( self , context ) :
layout = self . layout
tex = context . texture
vd = tex . voxeldata
2009-11-23 00:27:30 +00:00
layout . prop ( vd , " file_format " )
2009-10-31 19:31:45 +00:00
if vd . file_format in [ ' BLENDER_VOXEL ' , ' RAW_8BIT ' ] :
2009-11-23 00:27:30 +00:00
layout . prop ( vd , " source_path " )
2009-10-31 19:31:45 +00:00
if vd . file_format == ' RAW_8BIT ' :
2009-11-23 00:27:30 +00:00
layout . prop ( vd , " resolution " )
2009-10-31 19:31:45 +00:00
elif vd . file_format == ' SMOKE ' :
2009-11-23 00:27:30 +00:00
layout . prop ( vd , " domain_object " )
2010-01-25 15:10:14 +00:00
layout . prop ( vd , " smoke_data_type " )
2010-01-15 07:26:38 +00:00
elif vd . file_format == ' IMAGE_SEQUENCE ' :
2010-01-31 14:46:28 +00:00
layout . template_image ( tex , " image " , tex . image_user )
2009-10-31 19:31:45 +00:00
2009-11-23 00:27:30 +00:00
layout . prop ( vd , " still " )
2009-10-31 19:31:45 +00:00
row = layout . row ( )
row . active = vd . still
2009-11-23 00:27:30 +00:00
row . prop ( vd , " still_frame_number " )
2009-10-31 19:31:45 +00:00
2009-11-23 00:27:30 +00:00
layout . prop ( vd , " interpolation " )
layout . prop ( vd , " extension " )
layout . prop ( vd , " intensity " )
2009-10-31 19:31:45 +00:00
2009-10-31 23:35:56 +00:00
2009-08-13 05:21:25 +00:00
class TEXTURE_PT_pointdensity ( TextureButtonsPanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Point Density "
def poll ( self , context ) :
tex = context . texture
return ( tex and tex . type == ' POINT_DENSITY ' )
def draw ( self , context ) :
layout = self . layout
tex = context . texture
pd = tex . pointdensity
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-10-31 19:31:45 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-23 00:27:30 +00:00
layout . prop ( pd , " point_source " , expand = True )
2009-11-12 15:41:44 +00:00
else :
2009-11-23 00:27:30 +00:00
layout . prop ( pd , " point_source " , text = " " )
2009-10-31 19:31:45 +00:00
split = layout . split ( )
col = split . column ( )
if pd . point_source == ' PARTICLE_SYSTEM ' :
2009-11-23 00:27:30 +00:00
col . label ( text = " Object: " )
col . prop ( pd , " object " , text = " " )
2009-10-31 19:31:45 +00:00
sub = col . column ( )
2009-11-22 22:09:06 +00:00
sub . enabled = bool ( pd . object )
2009-10-31 19:31:45 +00:00
if pd . object :
2009-11-23 00:27:30 +00:00
sub . label ( text = " System: " )
2009-11-23 11:43:38 +00:00
sub . prop_object ( pd , " particle_system " , pd . object , " particle_systems " , text = " " )
2009-11-23 00:27:30 +00:00
sub . label ( text = " Cache: " )
sub . prop ( pd , " particle_cache " , text = " " )
2009-10-31 19:31:45 +00:00
else :
2009-11-23 00:27:30 +00:00
col . label ( text = " Object: " )
col . prop ( pd , " object " , text = " " )
col . label ( text = " Cache: " )
col . prop ( pd , " vertices_cache " , text = " " )
2009-10-31 19:31:45 +00:00
2009-11-23 00:27:30 +00:00
col . separator ( )
2009-10-31 19:31:45 +00:00
2009-11-23 00:27:30 +00:00
col . label ( text = " Color Source: " )
col . prop ( pd , " color_source " , text = " " )
2009-10-31 19:31:45 +00:00
if pd . color_source in ( ' PARTICLE_SPEED ' , ' PARTICLE_VELOCITY ' ) :
2009-11-23 00:27:30 +00:00
col . prop ( pd , " speed_scale " )
2009-10-31 19:31:45 +00:00
if pd . color_source in ( ' PARTICLE_SPEED ' , ' PARTICLE_AGE ' ) :
layout . template_color_ramp ( pd , " color_ramp " , expand = True )
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . label ( )
col . prop ( pd , " radius " )
col . label ( text = " Falloff: " )
col . prop ( pd , " falloff " , text = " " )
2009-10-31 19:31:45 +00:00
if pd . falloff == ' SOFT ' :
2009-11-23 00:27:30 +00:00
col . prop ( pd , " falloff_softness " )
2009-09-01 14:59:50 +00:00
2009-10-31 23:35:56 +00:00
2009-08-27 19:10:53 +00:00
class TEXTURE_PT_pointdensity_turbulence ( TextureButtonsPanel ) :
2009-10-31 19:31:45 +00:00
bl_label = " Turbulence "
def poll ( self , context ) :
tex = context . texture
return ( tex and tex . type == ' POINT_DENSITY ' )
def draw_header ( self , context ) :
layout = self . layout
tex = context . texture
pd = tex . pointdensity
2009-11-14 13:35:44 +00:00
2009-11-23 00:27:30 +00:00
layout . prop ( pd , " turbulence " , text = " " )
2009-10-31 19:31:45 +00:00
def draw ( self , context ) :
layout = self . layout
tex = context . texture
pd = tex . pointdensity
layout . active = pd . turbulence
2009-11-19 13:26:51 +00:00
wide_ui = context . region . width > narrowui
2009-10-31 19:31:45 +00:00
split = layout . split ( )
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . label ( text = " Influence: " )
col . prop ( pd , " turbulence_influence " , text = " " )
col . label ( text = " Noise Basis: " )
col . prop ( pd , " noise_basis " , text = " " )
2009-10-31 19:31:45 +00:00
2009-11-19 13:26:51 +00:00
if wide_ui :
2009-11-12 15:41:44 +00:00
col = split . column ( )
2009-11-23 00:27:30 +00:00
col . label ( )
col . prop ( pd , " turbulence_size " )
col . prop ( pd , " turbulence_depth " )
col . prop ( pd , " turbulence_strength " )
2009-08-27 19:10:53 +00:00
2010-02-14 11:21:21 +00:00
classes = [
2010-03-09 09:17:45 +00:00
TEXTURE_MT_specials ,
2010-03-11 07:43:49 +00:00
TEXTURE_MT_envmap_specials ,
2010-03-09 09:17:45 +00:00
2010-02-14 11:21:21 +00:00
TEXTURE_PT_context_texture ,
TEXTURE_PT_preview ,
TEXTURE_PT_clouds , # Texture Type Panels
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_plugin ,
TEXTURE_PT_envmap ,
2010-03-11 07:43:49 +00:00
TEXTURE_PT_envmap_sampling ,
2010-02-14 11:21:21 +00:00
TEXTURE_PT_musgrave ,
TEXTURE_PT_voronoi ,
TEXTURE_PT_distortednoise ,
TEXTURE_PT_voxeldata ,
TEXTURE_PT_pointdensity ,
TEXTURE_PT_pointdensity_turbulence ,
TEXTURE_PT_colors ,
TEXTURE_PT_mapping ,
TEXTURE_PT_influence ,
TEXTURE_PT_custom_props ]
def register ( ) :
register = bpy . types . register
for cls in classes :
register ( cls )
2010-02-22 23:32:58 +00:00
2010-02-14 11:21:21 +00:00
def unregister ( ) :
unregister = bpy . types . unregister
for cls in classes :
unregister ( cls )
2010-02-16 09:55:07 +00:00
if __name__ == " __main__ " :
register ( )