Hi everyone,

I'm trying to search a file path list (split by'/') for the version directory 
and return the index number of that object in that list.  So if my path is:

x:\projects\sequences\shot_01\v003\

i want to search with something like

match = re.search( r'(v|V|_v|_V)\d+', myPath)

then get the index number of the result. 
Right now i'm using match.object() to get the matched value as a string but 
does this result contain the index value as well?

Full disclosure - I'm trying to piece together a set version to latest script 
that accounts for paths with version folders and version string in the file 
name because all the scripts i've found have certain assumptions about the 
folder structure hard-coded into the script.  I've tried the one here:
http://www.nukepedia.com/python/nodegraph/version-to-latest/
...which looks like exactly what i want but I always get a
 "'AttributeError: 'NoneType' object has no attribute 'group'"

Also, the built in version.py (apparently used by DD 'and Weta, apparently')
doesn't seem to do anything at all.

Any help is much appreciated!

Thomas



_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to