Fix extract_filename

This commit is contained in:
Lubos Lenco 2017-02-27 22:14:46 +01:00
parent 03e2873e16
commit 257608499b
8 changed files with 17 additions and 6 deletions

View file

@ -38,7 +38,8 @@ uniform float aspectRatio;
#ifdef _CFXAA
uniform vec2 texStep;
#elif _CDOF
#endif
#ifdef _CDOF
uniform vec2 texStep;
#endif
@ -274,7 +275,7 @@ void main() {
// #endif
#ifdef _CLensTex
col.rgb *= texture(lensTexture, texCo).rgb;
col.rgb += texture(lensTexture, texCo).rgb;
#endif
#ifdef _CLetterbox

View file

@ -144,7 +144,7 @@ def safe_assetpath(s):
return s[2:] if s[:2] == '//' else s # Remove leading '//'
def extract_filename(s):
return os.path.basename(s)
return os.path.basename(safe_assetpath(s))
def get_render_resolution(scene):
render = scene.render

View file

@ -260,6 +260,12 @@ def make_draw_compositor(stage, node_group, node, with_fxaa=False):
compositor_defs += '_CLensTex'
assets.add_embedded_data('lenstexture.jpg')
if wrd.generate_fisheye:
compositor_defs += '_CFishEye'
if wrd.generate_vignette:
compositor_defs += '_CVignette'
wrd.compo_defs = compositor_defs
defs = world_defs + compositor_defs

View file

@ -171,7 +171,7 @@ def parse_color(world, node, context, envmap_strength_const):
tex['v_addressing'] = 'clamp'
# Reference image name
tex['file'] = armutils.extract_filename(armutils.safe_assetpath(image.filepath))
tex['file'] = armutils.extract_filename(image.filepath)
tex['file'] = armutils.safe_filename(tex['file'])
base = tex['file'].rsplit('.', 1)
ext = base[1].lower()

View file

@ -23,7 +23,7 @@ def make_texture(image_node, tex_name, matname=None):
return None
# Reference image name
tex['file'] = armutils.extract_filename(armutils.safe_assetpath(image.filepath))
tex['file'] = armutils.extract_filename(image.filepath)
tex['file'] = armutils.safefilename(tex['file'])
s = tex['file'].rsplit('.', 1)

View file

@ -427,6 +427,8 @@ def init_properties():
name='Tonemap', description='Tonemapping operator', default='Filmic', update=assets.invalidate_shader_cache)
bpy.types.World.generate_lamp_texture = bpy.props.StringProperty(name="Lamp Texture", default="")
bpy.types.World.generate_lens_texture = bpy.props.StringProperty(name="Lens Texture", default="")
bpy.types.World.generate_fisheye = bpy.props.BoolProperty(name="Fish Eye", default=False, update=assets.invalidate_shader_cache)
bpy.types.World.generate_vignette = bpy.props.BoolProperty(name="Vignette", default=False, update=assets.invalidate_shader_cache)
# Skin
bpy.types.World.generate_gpu_skin = bpy.props.BoolProperty(name="GPU Skinning", description="Calculate skinning on GPU", default=True, update=assets.invalidate_shader_cache)
bpy.types.World.generate_gpu_skin_max_bones = bpy.props.IntProperty(name="Max Bones", default=50, min=1, max=84, update=assets.invalidate_shader_cache)

View file

@ -356,6 +356,8 @@ class WorldPropsPanel(bpy.types.Panel):
layout.prop(wrd, 'generate_fog_color')
layout.prop(wrd, 'generate_fog_amounta')
layout.prop(wrd, 'generate_fog_amountb')
layout.prop(wrd, 'generate_fisheye')
layout.prop(wrd, 'generate_vignette')
layout.prop(wrd, 'generate_lamp_texture')
layout.prop(wrd, 'generate_lens_texture')

View file

@ -22,7 +22,7 @@ def write_probes(image_filepath, disable_hdr, cached_num_mips, generate_radiance
if not os.path.exists(envpath):
os.makedirs(envpath)
base_name = armutils.extract_filename(armutils.safe_assetpath(image_filepath)).rsplit('.', 1)[0]
base_name = armutils.extract_filename(image_filepath).rsplit('.', 1)[0]
# Assets to be generated
output_file_irr = envpath + '/' + base_name + '_irradiance'