ifts.mapping=='SPHERE':image_map='map_type 1 '# map_type 7 in megapov
ifts.mapping=='TUBE':image_map='map_type 2 '
ifts.mapping=='FLAT':image_map='map_type 0 '
ifts.mapping=='SPHERE':image_map='map_type 1 '# map_type 7 in megapov
ifts.mapping=='TUBE':image_map='map_type 2 '
#if ts.mapping=='?':image_map= ' map_type 3 '# map_type 3 and 4 in development (?) for POV-Ray, currently they just seem to default back to Flat (type 0)
#if ts.mapping=='?':image_map= ' map_type 4 '# map_type 3 and 4 in development (?) for POV-Ray, currently they just seem to default back to Flat (type 0)
# if t and t.texture.type == 'IMAGE' and t.use and t.texture.image and (t.use_map_specular or t.use_map_raymir or t.use_map_normal or t.use_map_alpha):
################################Second index for mapping specular max value##################################################################################################
tabWrite('[1 \n')
iftexturesSpec!='':
tabWrite('finish {%s}\n'%(safety(material_finish,Level=1)))# Level 1 is no specular
else:
tabWrite('finish {%s}\n'%(safety(material_finish,Level=2)))# Level 2 is translated specular
################################Second index for mapping specular max value##################################################################################################
# POV-Ray "scale" is not a number of repetitions factor, but its inverse, a standard scale factor.
# Offset seems needed relatively to scale so probably center of the scale is not the same in blender and POV
mappingDif=('translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>\n'%(-t_dif.offset.x,t_dif.offset.y,t_dif.offset.z,1/t_dif.scale.x,1/t_dif.scale.y,1/t_dif.scale.z))#strange that the translation factor for scale is not the same as for translate. ToDo: verify both matches with blender internal.
mappingDif=('translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>'%(-t_dif.offset.x,t_dif.offset.y,t_dif.offset.z,1/t_dif.scale.x,1/t_dif.scale.y,1/t_dif.scale.z))#strange that the translation factor for scale is not the same as for translate. ToDo: verify both matches with blender internal.
iftexturesAlpha!='':
mappingAlpha=('translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>\n'%(-t_alpha.offset.x,t_alpha.offset.y,t_alpha.offset.z,1/t_alpha.scale.x,1/t_alpha.scale.y,1/t_alpha.scale.z))#strange that the translation factor for scale is not the same as for translate. ToDo: verify both matches with blender internal.
mappingAlpha=('translate <%.4g,%.4g,%.4g> scale <%.4g,%.4g,%.4g>'%(-t_alpha.offset.x,t_alpha.offset.y,t_alpha.offset.z,1/t_alpha.scale.x,1/t_alpha.scale.y,1/t_alpha.scale.z))#strange that the translation factor for scale is not the same as for translate. ToDo: verify both matches with blender internal.