Community
3ds Max Forum
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Script to rename output paths to model name?

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
simon
1288 Views, 7 Replies

Script to rename output paths to model name?

Hi, everyone!

 

I've got a volume job where the client needs about 300 renders of various construction parts they're selling. I'll give you a bit of detail so you can understand my question better:

They're supplying the .igs CAD models that are nice and detailed, to scale, etc - I just need to make them realistic. That part's sorted, I've got a file with my studio lighting setup and I've created the materials, camera and the render settings are set.

So what I have to do is open up my scene I set up, import the igs file, apply materials as per client's sheet, adjust my camera and rename the output files. And do this 300 or so times...

As you can imagine, there isn't really a way to automate the camera adjustments and the material application, as those are going to vary depending on the part in question, but automating the mind-numbing part of renaming all the render outputs is going to help a LOT...and prevent mistakes too - will be quite a task fishing out which files were renamed incorrectly if something gets overwritten 😕

So I'm looking for a script that could automate the file output names for me, depending on the selected object in the scene. Luckily for me, the .igs files retain the file name (which the client wants as the final output name!) - so I'm hoping there could be a script that takes the selected object name and plop it in as the file name for the outputs?

I'm using MAX 2018 and Corona as my rendering engine. The files will be rendered via Backburner. I've got no render elements set up, which helps a lot in simplifying this task (renaming elements can be a pain, me thinks), all I need to save is a PNG file with an alpha channel (attached is a sample of what I'm producing).

Could anyone help me out in finding/writing such a script?

Any help is much appreciated. Thanks!

7 REPLIES 7
Message 2 of 8
simon
in reply to: simon

BUMP

Message 3 of 8
simon
in reply to: simon

Anyone have any ideas? We've got this volume job next week now and manually naming render output for 350 files won't be fun...

Message 4 of 8
raiden_xavier
in reply to: simon

Hi @simon,

 

I hope you are enjoying your stay in the forums so far.

 

Scriptspot is usually the number 1 stop for anything to do with scripts and 3ds max right?

Apologies if this reaches you a little late.

 

Hope you are well.

Message 5 of 8
fla3d
in reply to: simon

To set the output file based on your object selection name you just need to run this line of script:

 

rendOutputFilename = "c:\\test\\" + $.name + ".png"

Just replace the "c:\\test\\" with your output folder and you need to always put double backslash instead of one, maxscript will ignore the first one and translate into a single backslash. And bear in mind that it will work only if you have a single object selected, if you have more than one you can change it to something like this to use the name from the first object selected:

rendOutputFilename = "c:\\test\\" + $[1].name + ".png"

If you want I can give you a code to add it to a shortcut or a button in a floating dialog, it's quite simple.

 

Message 6 of 8
raiden_xavier
in reply to: fla3d

Hi @simon,

 

Any thoughts on the message from @fla3d?

Message 7 of 8
raiden_xavier
in reply to: simon

Hi @simon,

 

I am checking back to see how you are getting on. Please add a post with how you decide to proceed and your results so other Community members may benefit.

 

Please hit the Accept as Solution button if a post solves your issue or answers your question.

Message 8 of 8
raiden_xavier
in reply to: simon

Hi @all,

 

It would appear that no one has posted here for a while.

If no one minds I would like to thank @fla3d and mark that post as the solution.

 

Happy maxing!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report