Page 1 of 1

env_sprite's model

Posted: Sun Dec 27, 2015 11:26 pm
by iPlayer

Posted: Sun Dec 27, 2015 11:34 pm
by iPlayer
I can think of Hammer's logic though.

1. Remove all characters past the last dot in file name (if there are any dots) including the dot itself;
2. If there's no trailing '.spr' already, add one

Syntax: Select all

index = filename.rfind('.')
if index > 0:
filename = filename[:index]

if not filename.endswith('.spr'):
filename += '.spr'