Home Technical Talk

3dsmax scripts - progress capture

Hey peeps,

I'm kind of new here so go easy on me ;)

Over the past couple of months as I've been developing my portfolio, both art and code, I started playing around with max script to make some simple scripts and help take the monkey work out of Max. Basically make my way towards becoming more of a technical artist in the industry, rather than an artist with technical ability :)

Recently Adam (I'm sure you guys know him) gave me the idea of making a max script that will take a progress shot of your max scene with a simple press of a button. Good idea! So I took the idea and expanded it a bit more.

Capture tool script

Installation:
  1. Open the rar file
  2. Place the MCR file into "..\3dsmax2008\Scripts"
  3. Run the macro script (Nothing will actually show up) MAXScript -> Run Script...
  4. Assign the macro script as a button... Customize -> Customize User Interface... -> Group = Main UI, Category = Ren Tools
  5. Click and drag "Ren's Progress Capture Tool" onto a toolbar
  6. Click the new button to open up the floater window
  7. Read usage below :)
Progress Capture:
  1. The list box contains the names of all cameras in the scene, you can select the desired angle you want to capture. If there is nothing listed (IE, there are no cameras), the tool will use the perspective view.
  2. You can create a new camera with the “Create Camera” button. If you have a camera selected, the selected camera will be reoriented to the current view.
  3. Checking the “Free Camera” check box will make the camera a free camera instead of a targeted camera.
  4. “Capture on autosave” will attempt to capture a progress shot based on the autosave timer. CAUTION: if your scene takes a LONG time to render, you may either want to turn this off, or lower the render settings.
  5. “Quiet, no virtual buffer” will not display the rendered image in a window, but will still save it out.
  6. Pressing the “Capture Progress” button will automatically render and save your scene based on your current render settings. The file will be saved to the same directory as the max file, and it will be incremented up to 100.

There isn’t a lot of functionality that I will be adding to this tool as I would like to keep it simple. At most the listbox could auto update, or at least have a manual refresh, not just when a new camera is added.
Additionally a more robust file management system might be handy.
There may be unforeseen bugs left over, so I just let me know if you find any!

-Ren

Replies

  • Renalicious
    Fixed a bug caused by bad syntax. It should work without a problem now :)
  • renderhjs
    Offline / Send Message
    renderhjs sublime tool
    some screenshot might be nice to get me more in the mood testing the script

    You could also use the preview render to make snapshots of the view port as that might be more interesting to modeling people. A mix of zoom extends for auto camera on a selection of objects could be nice (like if one works on details in a model and only wants to capture that detail).

    I see some nice potential for this script idea, keep it up
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    I like the idea of using a static camera, so you kinda get a time-lapse WIP video for free!

    I definitely think that renderhj's suggestion of just grabbing the viewport is a good one, personally I don't want to wait for a render every time (especially if I have settings set up for high-quality light tracing etc.), usually a viewport screengrab will do the job for WIP and time-lapse purposes.

    Maybe add an option to choose between render or screengrab? That'd be really cool.

    Also, will you have to have the window open all the time in order for it to work? Or will it sit quietly in the background, writing out images without cluttering the interface? And why does it only increment to 100? :)
  • adam
    Offline / Send Message
    adam polycounter lvl 20
    Ah, yes yes. This certainly should be a screenshot of your active viewport and not a render. Essentially doing what alt-prnt-scrn does with the additional functionality already in the script.
  • Renalicious
    Hmm, I'll look into grabbing the viewport, though it may end up being a Windows thing and outside of Max's capabilities.

    But here is an image of the progress tool
    progress-tool.gif
  • Renalicious
    After a bit of digging there is definitely a roundabout way to capture the viewport :)

    I'll release a new version of the tool once I have it coded in. Shouldn't be more than a new button and checkbox ;)
  • LEViATHAN
    Offline / Send Message
    LEViATHAN polycounter lvl 11
    Looks coolies, always wanted this. :)
    Thanks.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Hey R I don't know if this what you are looking into already, but animation>preview should give you exactly that : a viewport capture taken from within Max. Only thing is that you might want to force in 'shaded mode' to avoid taking wireframe shots now and then..,
  • Szark
    Offline / Send Message
    Szark polycounter lvl 12
    There's also 'Tools > Grab Viewport' for getting a still image. I'm not sure if you can access that with scripting or not, though.
  • renderhjs
    Offline / Send Message
    renderhjs sublime tool
    you can, there is something called
    gw.getViewportDib()
    
    that returns the current active viewport as bitmap object which you can dump on the hard driveas an image.
    more info can be read here:
    http://www.cgplusplus.com/online-reference/maxscript-reference/source/viewport_drawing_methods.htm
  • Renalicious
    Ok I have the script basically where I want it, but I have to work on the timing a bit. Apparently viewports don't like to switch from one view to another instantly.

    With that said, I think some people might be opposed to having controls cut and their viewport move around for a split second. Although it would take longer for more complex scenes.

    So what I may do is just simplify the script so that it will only capture the current viewport as is... while the rendered capture will use selected cameras etc.

    EDIT:
    Ok, here is the new maxscript. I also changed the file numbering to include a timestamp instead of a number, it makes things faster as it doesn't have to go through and check for existing files, and it's not limited to some arbitrary limit either.

    I should also point out that the way this scrpit captures the viewport (using "gw.getViewportDib()") is for max versions 2008 and newer! I'm not sure how it will react with older versions of max, and I don't have time to test it out at the moment.
    Capture Tool

    progress-tool.gif
Sign In or Register to comment.