Padding 0s for file names

Smart people ~ Great Scripts
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Padding 0s for file names

Post by clintonman »

Usage:

open a log view/output console
load into the scene

script will count through a range of numbers and add the number with 0 padding for the file names
it will convert something like C:\trueSpace761\tS\Image Folder\Image.png into C:\trueSpace761\tS\Image Folder\Image0001.png when number is 1
or C:\trueSpace761\tS\Image Folder\Image.png into C:\trueSpace761\tS\Image Folder\Image0015.png when number is 15
You do not have the required permissions to view the files attached to this post.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5206
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Padding 0s for file names

Post by trueBlue »

Thank you!
Not sure how to add this to my Vray Render to File
See the notes in the Frame script
Removed due to update
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Padding 0s for file names

Post by clintonman »

This adds the number to your file name.
This change has not been tested.
You do not have the required permissions to view the files attached to this post.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5206
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Padding 0s for file names

Post by trueBlue »

Yay, it works!
Thank you!!!
It is not typical, in that the first frame rendered is named untitled0001
Normally it would be untitled0000 since the sequence's Start Frame is 0 and render 31 frames
Currently, it renders 30 frames
30 frames.png
You do not have the required permissions to view the files attached to this post.
User avatar
trueBlue
Captain
Posts: 5206
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Padding 0s for file names

Post by trueBlue »

I was able to add png, jpg, bmp, hdr, and tga file format choices
File name choice as well
Vray Render to File.png
.
Render Animation icon
LMB - Use to Set the Render to File's render folder and Output Frames
RMB - Opens Folder

File name - Image name
File format - Image format
Frames - Number of Frames to Render
Period - Speed of which Frames are Rendered
Frames - Current Frame being Rendered
Render Frames - Starts the process
Note: Frame 0 will be appended with _0001, Frame 1 with 0002, etc...

This process supports Rendering while scripts,
Activities, and Timers are running

Required: Set the Render to File's render Folder and Output Frames first!
This sets the path to render to on the Vray panel's Output File attribute
Warning: If you do not set it, it will still render to an undefined area!

Set the number of Frames to render, Image name and format from the Vray panel
Set R2F Current Frame Only.png
.
Thanks again, Clinton! :bananathumb:
You do not have the required permissions to view the files attached to this post.
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Padding 0s for file names

Post by clintonman »

You could subtract 1 from the number to start at 0.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5206
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Padding 0s for file names

Post by trueBlue »

Was not sure (I tried) how to do that

Code: Select all

//		strnum = '0' + strnum
		strnum = '0' + strnum -1;
I like this without all the zeroes
padding.png
You do not have the required permissions to view the files attached to this post.
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Padding 0s for file names

Post by clintonman »

trueBlue wrote: 15 May 2022, 03:59 Was not sure (I tried) how to do that

Code: Select all

//		strnum = '0' + strnum
		strnum = '0' + strnum -1;
I like this without all the zeroes
padding.png
No zeros is ok as long as whatever program you use it with doesn't put 10 before 2 through 9.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5206
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Padding 0s for file names

Post by trueBlue »

How would you, subtract 1 from the number to start at 0?
Removed due to update
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Padding 0s for file names

Post by clintonman »

This does it.
You do not have the required permissions to view the files attached to this post.
Clinton Reese

http://clintons3d.com
Post Reply