From: Stefan Andersson <sanders3d@(email surpressed)> Subject: Title as scene name Date: Thu, 02 Feb 2006 07:12:04 -0500 |
Msg# 1213 View Complete Thread (3 articles) | All Threads Last Next |
Hello all, I'm trying to figure out how to automate that Rush takes the file name as the title when rendering. the $in{Database} lists the hole string. Anyone knows what command to use to remove everything except the file name with out suffix? I would like to modify this so that it reflects only the filename without suffix. $in{JobTitle} ||= "SOFTIMAGE"; anyone knows? regards stefan andersson -- ________________________________________________________________________ http://stefan.sanders3d.com/ http://os3d.blogspot.com/ |
From: Stefan Andersson <sanders3d@(email surpressed)> Subject: Re: Title as scene name Date: Thu, 02 Feb 2006 08:12:05 -0500 |
Msg# 1214 View Complete Thread (3 articles) | All Threads Last Next |
never mind, it was just a matter of adjusting the submit script. here is what made it work for me (from the default xsi submit script) if ( $in{JobTitle} eq "" ) { # PARSE TITLE FROM FIRST 25 CHARACTERS OF MAX FILENAME if ( $in{Database} =~ m%/([^/]*)\.scn$%i ) { $in{JobTitle} = substr($1, 0, 25); # first 25 chars $in{JobTitle} =~ s/\..*//; # "foo.db" -> "foo" } } > On 2 Feb 2006 12:12:04 -0000, Stefan Andersson <sanders3d@(email surpressed)> wrote: > > [posted to rush.general] > > > > Hello all, > > > > I'm trying to figure out how to automate that Rush takes the file name > > as the title when rendering. > > > > the $in{Database} lists the hole string. Anyone knows what command to > > use to remove everything except the file name with out suffix? > > > > I would like to modify this so that it reflects only the filename > > without suffix. > > > > $in{JobTitle} ||=3D "SOFTIMAGE"; > > > > anyone knows? > > > > regards > > stefan andersson > > > > > > -- > > ________________________________________________________________________ > > http://stefan.sanders3d.com/ > > http://os3d.blogspot.com/ > > > > > -- > ________________________________________________________________________ > http://stefan.sanders3d.com/ > http://os3d.blogspot.com/ > -- ________________________________________________________________________ http://stefan.sanders3d.com/ http://os3d.blogspot.com/ |
From: Greg Ercolano <erco@(email surpressed)> Subject: Re: Title as scene name Date: Tue, 07 Feb 2006 21:26:08 -0500 |
Msg# 1217 View Complete Thread (3 articles) | All Threads Last Next |
Stefan Andersson wrote: never mind, it was just a matter of adjusting the submit script. here is what made it work for me (from the default xsi submit script) if ( $in{JobTitle} eq "" ) { # PARSE TITLE FROM FIRST 25 CHARACTERS OF MAX FILENAME if ( $in{Database} =~ m%/([^/]*)\.scn$%i ) { $in{JobTitle} = substr($1, 0, 25); # first 25 chars $in{JobTitle} =~ s/\..*//; # "foo.db" -> "foo" } } Yes, it's a regex bug that's apparently been in that script for a while now, and I never noticed it. That should work fine. FWIW, here's the 'fix' I applied recently which is in "102.42a1"; the regex (db|scn) is used so it can handle both db or scn files: if ( $in{JobTitle} eq "-" || $in{JobTitle} eq "" ) { # PARSE TITLE FROM FIRST 25 CHARACTERS OF MAX FILENAME if ( $in{Database} =~ m%/([^/]*)\.(db|scn)$%i ) # <-- CHANGE IS HERE { $in{JobTitle} = substr($1, 0, 25); # first 25 chars $in{JobTitle} =~ tr/[a-z]/[A-Z]/; # uppercase } } |