Padding 0s for file names

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

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
Attachments
FileNameDev03.RsObj
(39.16 KiB) Downloaded 8 times
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
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: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Padding 0s for file names

Post by clintonman »

This adds the number to your file name.
This change has not been tested.
Attachments
Vray Render to File.RsObj
(107.13 KiB) Downloaded 7 times
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
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
User avatar
trueBlue
Captain
Posts: 5548
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
Vray Render to File.png (6.13 KiB) Viewed 55 times
.
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:
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

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: 5548
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
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

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: 5548
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: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Padding 0s for file names

Post by clintonman »

This does it.
Attachments
Vray Render to File5a44.RsObj
(107.04 KiB) Downloaded 6 times
Clinton Reese

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

Re: Padding 0s for file names

Post by trueBlue »

Would have never figured out that one :bananathumb:
Thank you again for the millionth time! :bananacool2:
This opens up unlimited possibilities for Workspace's Render to File
Running Scripts while rendering
Brings tga file format
Sequence of Images in the Background, Ray Cast, Caustics, Reflections, Depth of Feild, etc...
Mix and match D3D and Vray materials

Have to say, this is better then the other Render to File(s) :D

Return to “Scripts and SDK”