Keep 3DLuVr online!
3DLuVr Logo
Sections
Articles
 From the Real World
 Digital Painting Series
 Featuring of...
 On the Bookshelf
Tutorials
 3ds max
 LightWave3D
 Softimage XSI
 Rhinoceros 3D
 Video Tutorials
FunZone menu
 I always wanted to be
 Talk to an employer
 Why Ask "Why"
TechZone menu
 Hardware Reviews
 Software Reviews
 Benchmarking
 Q&A, Tips & Tricks
UserZone menu
 The Artist Sites
 15 Min of Fame
 Request an Account
 Current Assignment
 Sponsors & Prizes
 Make a Submission
 Voting Booth
 Competition Rules
About menu
 Mission Statement
 Policies
 Advertising
 Comments
 Poll Archive
 Links
 How to IRC
 Donations
Login
Log in to be able to post comments to the news items, forum posts, and other facilities.
Username: 
 
Password: 
Not registered? Register!     Lost Password?
Poll
 Your New Year`s Resolution is...
Gain employment
Stop smoking/drinking/etc
Get back in shape
Find the meaning of life
Conquer the World
Absolutely nothing

    Poll Results
Comments
Want to leave us a comment about the site or in general? Click here to access the form.
ArtZone Heading
Creating a simple previewer with MXS
Added on: Sun Jul 23 2000
Page: 1 2 

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

 
1997-2017 3DLuVrTM (Three Dee Lover)
Best viewed in 1024x768 or higher,
using any modern CSS compliant browser.