Gradient Background

#1
Sup!

This is barely about 'Modeling', but i didnt know where else to put it! Some ppl. were curious about how to get the gradient background (known from Maya) into the 3ds max viewport!

bwxc0kx52tdxyj93d.jpg

Its actually fairly simple. Place the 001.png from the attachment into your 3ds max root directory (i.e. "C:\Programs\Autodesk\3ds Max 20**") and execute the following MAXScript (or use .ms file in attachment - remove .txt):

Code:
bgImgPath = symbolicPaths.getPathValue "$max"+"\001.png"
bgImg = openBitmap bgImgPath
setAsBackground bgImg
viewport.DispBkgImage = true
completeRedraw()
(actually $max points to the root dir, so you could define any path you want!)

To turn the background off, execute the following MAXScript (or use .ms file in attachment - remove .txt):

Code:
viewport.DispBkgImage = false
completeRedraw()
Simple as that!

---

The script activates the background for the active viewport. To get it into all 4 default viewports, hit Alt+B and under "Apply Source and Display to" set it to "All views".

Once you've set up the background, you can "save" it as default using the following technique:
Save the file as "maxstart.max" and place it into the default "scenes" folder (you'll find that folder, or are able to change it to a custom location by clicking onto "Customize", "Customize User Paths..." in the main menu bar. In that dialog is the "MaxStart" entry.)

Good luck! :D
 

Attachments

#7
Oh there! I see it... I suppose Its not possible to change BG color I wanted?
You could use any background image file you want! The uploaded .png is just a sample, to mimic the Maya style. If you want, just make a gradient with any colors of your choice, save it - and point it to the script. Voila!
 
#8
- nvm it works on 2011. But only 1 viewport has the gradient. How to fix it?
Hmm, i was searching the MAXScript documentation but didn't find anything to apply background to all viewports (just the active one!). Didnt bother me too much yet, as i'm mainly using 1 viewport all the time - and use keyboard shortcuts to get the different views...

So you'd have to do it manually, hit Alt+B and under "Apply Source and Display to" set it to "All views".

Edited the original post with some further information, to set the settings as default.