r/Maxscript • u/antonioat8 • Aug 27 '19
Simple Grab Viewport and Save it - HELP
I want a very simple script to grab the viewport and save it on the same opened project folder.
I did it all, select the viewport that I want, change the shading method, but I cannot make up the script line to get the file path and save the image into it.
I tried:
1
print (getBitmapInfo (getDir #maxroot +"\\capture\\+(getFilenameFile)+ ".jpeg"))
--
2
img.filename = MyPath + (getfileNameFile maxFileName) + ".jpg"
save img
--
3
getFilenamePath() + "\\"
--
4
img.filename = getSaveFileName (getfileNameFile + getMAXSaveFileName) + ".jpg"
save img
The last one, works once, but strangely when you run it again, it doesn't. No explanation, just saves once, even if you delete the image, it does not save it again. Only when Max is restarted.
I found in the ScriptSpot this but I just want one button click to run this, no further options.
Thank you.
2
u/lucas_3d Aug 28 '19 edited Aug 28 '19
Sorry this is ugly I just had laying about in my google drive, I haven't tested this lately, I built off it once.And I'm trying to use reddits new style, I don't know how to write replies anymore!
edit: I added some notes, excuse this being very casual! This saved the image into the root of my project...
1
u/[deleted] Jun 21 '24 edited Jun 21 '24
[removed] — view removed comment