Jump to content

snapshot script anyone?


Tommy L
 Share

Recommended Posts

Hi guys,

does any one know if there is a 'snapshot tool for recording the screen?

For instance, is there a screengrab function that will record one frame per minute, but I can also hit a shutter whenever I want? So I could end up with a frame sequence of my workflow but also record vital items that are only onscreen for a couple of seconds.

 

I know its a bit specific, but you never know!

 

Thanks,

Tom.

Link to comment
Share on other sites

ok, so maxscript already has a script that would grab the viewport to save and open the save dialogue. it also automatically sets the name to the max file name and also the location to where the max file is. thats perfect.

 

we can bypass these setting so that it does it automatically.

 

what format do you want? bmp,jpeg,...

 

then we just need to put it in a recurring loop

Link to comment
Share on other sites

Ok, times up, here is what i came up with. its very very dirty but works for now

 

It requires you to save the max file and then generates the bitmap file from this file name and file location.

 

It saves as jpg in an interval of 60 sec but you can change this in the script on line 11 - local time_interval = 60 -- Set how many seconds to wait here

 

and you can change the file type on line 103 - bmp_name = maxFilePath + mfn +"_" +gvn + "_" + gct + "_" + (c as string) + ".jpg"--build the output file name

 

just close the little popup menu showing the time to close the script

if you do this you you'll lose the file name increments but can set again where to start counting on line 12 - local c = 0 -- the file name increments

 

as i said, its a dirty one. If any one feels to put it in a structured menu pls do so, or i'll come back to it later

 

enjoy

 

the script is in the next post

Link to comment
Share on other sites

rollout viewSave "Viewport Auto Save "

 

(

 

timer clock "Time" interval:1000

 

label the_time "1"

 

local a = 0 -- loop counter

local time_interval = 60 -- Set how many seconds to wait here

local c = 0 -- the file name increments

on clock tick do

 

(

a = a + 1

 

 

valUp = (the_time.text as integer)+1

 

the_time.text = valUp as string

 

If a == time_interval then

(

 

a = 0

c = c + 1

Print "viewport saved"

 

 

(

 

---------------------------------------------------------------------

 

--GRABVIEWPORT MACROSCRIPT

 

--Created:3/23/99

 

--Edited:4/28/99

 

--by Borislav Petrov

 

--bobo@email.archlab.tuwien.ac.at

 

---------------------------------------------------------------------

 

--Snapshot Active Viewport to Bitmap

 

--Filename in format:

 

--VPGRAB_MaxFileName_ViewportName_CurentFrame.ImageFormatExtension

 

---------------------------------------------------------------------

 

--

 

--Init Variables

 

local grab_bmp --bitmap to put the snapshot into

 

local bmp_name --name of the bitmap to save

 

local get_viewport_name --viewport name

 

local gac,gct,mfn --variables to hold ActiveCamera, CurrentTime, MaxFileName

 

--

 

--Start Macro

 

grab_bmp = gw.getViewportDib() --get the viewport bitmap into variable

 

get_viewport_name = viewport.GetType() --get viewport name

 

gvn = get_viewport_name as string --convert viewport name to string

 

gvn = substring gvn 6 (gvn.count-5) --cut the string

 

if gvn == "camera" then --if the remaining string is "camera"

 

(

 

gac = getActiveCamera() --get the camera

 

gvn = gac.name --get the name of the camera

 

)

 

mfn = MaxFileName --get max file name

 

if mfn == "" then --if there is no name

 

mfn = "Untitled" --use "Untitled"

 

else

 

mfn = getFileNameFile mfn --use the file name without .MAX extension

 

gct = SliderTime as string --get current frame time

 

--

 

bmp_name = maxFilePath + mfn +"_" +gvn + "_" + gct + "_" + (c as string) + ".jpg"--build the output file name

 

--

 

--Display file save dialog

 

-- bmp_name = getSaveFileName caption:"Save Viewport to:" filename:bmp_name \

 

-- types:"BMP(*.bmp)|*.bmp|TIFF(*.tif)|*.tif|JPG(*.jpg)|*.jpg|TGA(*.tga)|*.tga|"

 

--

 

grab_bmp.filename = bmp_name

save grab_bmp

-- if bmp_name != undefined then --if user has confirmed / entered a valid name

 

-- (

 

-- grab_bmp.filename = bmp_name --set output name to the one entered in the save file dialog

 

-- save grab_bmp --save the bitmap

 

-- display grab_bmp --display the bitmap in a VFB

 

-- )

 

--

 

)--end of script

 

 

)

 

 

)

 

 

 

 

 

 

)

 

createDialog viewSave

Link to comment
Share on other sites

Wow! Koper, you are the bomb. I will give it a go tomorrow. I was actually looking for a windows one, so whatever I was doing would be logged (as in all programs, especially photoshop) but this is a gem anyhow. It will make interesting viewing as a movie after the project.

Link to comment
Share on other sites

oh, right, hehe :D, screen capture, not viewport grab

 

maybe we can incorporate the prt scr button to be pressed automatically, and then opened and saved by the max frame buffer.

 

hehe, got that one wrong but it still makes for a nice little script

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...