|
|
Creating a simple previewer with MXS Added on: Sun Jul 23 2000 |
Page: 1 2 3 |
Step 4 - Controller code and Finishing up
OK, here is the fun part of telling the script what to do when you hit the "Render Frame" button. First off here is the code for it.
on SFrame pressed do
(
bm = render frame:StillF.value outputwidth:180 outputheight:120 vfb:off \\ shadows:shad.checked renderatmosphericeffects:atmos.checked \\
objectMotionBlur:blur.checked imageMotionBlur:blur.checked
WPreview.bitmap = bm
)
)
addRollout params cool The first part you will see is self explanatory by saying, "on Sframe pressed do".
The next thing we are going to do is type some instructions for what we want the script to do when we press the render button.
The "bm = " that you see is just a identifier for the command so we can reference it anywhere in the script.
You can use any type of a name for an identifier, but in this case I just put "bm". The rest you will see are just some basic calls for rendering and options we want for speeding up the render.
To explain something that might be confusing, for instance, "shadows:shad.checked",
we are giving the script an option to render shadows or not to by having that checkbox we put in earlier called "shad".
We are referencing that checkbox by telling the renderer not to render shadows unless that checkbox is checked. You will also see a couple of other options for the rendering in this call.
The next thing we put in was "WPreview.bitmap = bm". This we put in to reference the bitmap we put up top. It is saying that the render output is equal to that bitmap, so when it's done rendering it will replace the nothing with the render output.
For the last thing we put at the bottom of the script, besides the double brackets to close all the statements we may have not closed, is the "addRollout params cool". I put this at the end of the script so when it starts the script it will add the rollout where are the interface items are. You can put this at the top of the script, but I always seem to put it at the end, oh well!
And here is the link to finished script, if you wish to download it - previewer.zip
|
|
|
|