Hi all,

I'd like to confirm if the paths written in maya (on windows) has the 
correct character case. In otherwords I need to verify the path is good for 
use on Linux.

I have the following solution, but glob is ... not very fast. 

Would like to know if anyone here has come accross an effective/fast 
solution for this problem.

import glob
import re
import os

def fix_path_case( path ):
   case_on_disk_path = glob.glob( re.sub( r'([^:])(?=[/\\]|$)', r'[\1]' , 
path ) )[0]
   slash_fixed_path =  os.path.realpath(case_on_disk_path )
   return slash_fixed_path
   
# Real path on disk is      ''W:/Shows/Proj/Pub/TEX/Proj_skin_DIF.1001.TIF'
bad_case_texture_path = 'W:/shOws/PRoj/PUB/tex/proj_skin_DIF.1001.tif' 
#path in maya

fixed_path = fix_path_case( path = bad_case_texture_path )



Thanks!

Chad

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/11dfb149-d63d-4f1b-88d0-c02de401e86e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to