Notifications
Clear all

[Closed] how to change render imagefile squencefile prefix?

sample
default d:\ est0000.bmp
i want to
d:\ est000.bmp

thanks

2 Replies
originalText = "d:\	est0000.bmp" as string -- sets your text string as a variable
newTextPart = substring originalText (originalText.count-14)10 --counts back 14 characters from the end, uses the first 10 characters
newText = newText + ".bmp" -- puts the ".bmp" back on the end of the text string

Here, this should give you the information that you need. Using substring commands you can edit your strings of text, change parts and assemble them later.

Hope this is useful.

Hi,

I suggest you to use some batch file rename with some external program. Also, mayby this threadwill help. I had to do something like that but it’s dirty solution, so if :

  1. The output is set to folder which is empty
  2. You render on one machine (not net render)
  3. You don’t put output of render elements in the same folder

then you can evaluate this script before you press render button:


  (
  	global changeOutputNames
  	
  	fn changeOutputNames = (
  		
  		fn pad inp ln ch:"0" = (
  			inp = inp as string
  			while inp.count < ln do inp = ch + inp
  			inp
  		) 
  		
  		local digits = 3
  		local outPath = ""
  		
  		if rendoutputFilename != undefined then
  		(
  			local outPath = getFilenamePath rendoutputFilename
  			local outFile = getFilenameFile rendoutputFilename
  			local files = getFiles (outPath + "*")
  			local counter = 0
  			for f in files do
  			(
  					local oldName = (outPath + ( getFilenameFile f ) + ( getFilenameType f ) )
  					local newName = ( outPath + outFile + ( (pad counter digits) as string) + ( getFilenameType f ) )
  					renameFile oldName newName
  					counter += 1
  			)
  		)
  		
  		callbacks.removeScripts id:#postRenderHandler
  		
  	)
  	
  	try (
  		callbacks.removeScripts id:#postRenderHandler
  		callbacks.addScript #postRender "changeOutputNames()" id:#postRenderHandler
  	) catch ()
  )
  

This script simply adds post render callback. After render, it get ALL files in output directory, changing names using rendoutputFilename and padded file counter – you can specify the number of digits changing “digits” variable. At the end it removes callback.

jk