Viewport Canvas                                

Viewport Canvas is a set of easy to use tools for painting and cloning on an objects texture directly in the 3ds max viewport! It turns the active viewport into a 2d canvas that you can use to paint on and then apply the result to the objects texture. There is also an option to export the current view, so you can take it into Photoshop and use all the tools that Photoshop offers, and then save the file and update the texture in 3ds max.

The system works by letting you activate one of the painting tools to paint on the screen and when you are happy with the results you right-click to step out of the tool. The system then calculates the resulting texture, which can take a few seconds depending on how large part of the screen you have painted on. The system only updates the parts of the texture that has been painted on, so you won't loose any resolution in other parts of the texture. To cancel the calculation of the texture you can hold the ESC key for a short while. For maximum accuracy you should use the .tif format for the textures you use with Viewport Canvas since that will ensure lossless savefiles and the viewport display of textures should be set to the highest resolution possible. You can do that by going into Customize/Preferences/Viewport/Configure driver and check the "Match bitmap size as close as possible" option. It is also recommended to use Direct3D as a viewport driver for the most accurate results when painting. When using the clone tool you can pick clonepoints from anywhere in the viewport so you could also as an example have a background image set in the viewport that you can clone from or clone from the textures of another model! 
You can make custom brushes to work with Viewport canvas, and if you do these brushfiles should be in .tif format. Read more about creating custom brushes below. One important thing about working with Viewport Canvas is that you should try to paint at a distance to the object so that the screen pixels and texturepixels are roughly the same size. If the screenpixels are much larger the result could become pixalated and if you are zoomed in to close you might loose some of the painted detail since there is not enough pixels in the texture to represent the painted detail. If the screenpixels are very much larger than the texturepixels you will get gaps in the paint. The general rule is that there can only be 10 texturepixels for every screenpixel, but painting at such a distance will produce very pixelated paint anyway so that is not a good idea. When painting over UV seams the difference between screenpixels and the pixels of the texture is extra important since if you are too far away the seams might not get filled so zoom in a bit extra when painting or cloning over seams.

Note: The UVW mapping must be inside the boundaries of the UVW limits(0.0 to 1.0) to successfully be painted on.

Important: When using the clone tool to pick up paint from the canvas it is recommended to have the viewport driver configured to have Texel lookup set to "Nearest", since this will give you the sharpest representation of the texture in the viewport and will therefore produce more accurate results when the paint is projected. This is because you can only clone from what is visible in the viewport. You adjust this in Customize/Preferences/Viewport/Configure driver...

Tip: While the clone tool is active you can clone from anywhere in the viewport, including any background image you have set up or from another objects texture!

Also check here how to setup your system to get the most out of Viewport Canvas.

Lets take a look at the interface and see what the buttons do:

Paint:

At the top you see an image of the brush you are currently using. In the Size spinner you can set the size in pixels for the current brush. To select another brush click the "Select brush " button which brings up the brush selection window below:

At the top of the brush selection interface are the standard brushes included with Viewport Canvas. Set the size in the spinner and click the brush image to select that brush. Below the standard brushes is an area where the custom brushes are collected. Here you can put your own brushes that you have defined. To create a custom brush you make a black and white image(white is opac, shades of grey is transparency and black completely transparent) in Photoshop as an example and save it as a .tif image in the folder: 3dsmax/Scripts/PolyBoost/ViewportCanvas/Brushes/Custom/. The brushes will then show up the next time you open the interface. The brush images you make should have the same width as height.

Back to the main interface:

Brushtype: Here you select the type of brush to use. Available is airbrush and layer brush. With the airbrush the paint will be continuously added to the screen while with the layer brush you will get a solid layer of paint with the current opacity value set.

Blendingmode: These modes are Photoshop type blendingmodes that determine how the paint is applied to the canvas. Available is Normal(regular color), Multiply, Screen, Overlay, Hard Light, Darken, Lighten, Hue, Saturation, Color, Luminosity, Dodge and Burn. The dodge and burn tools works on the existing color on the canvas and does not add color from the currently set color.

Paint: The button with the brush starts the painting tool. You need to have only one object selected when activating this tool. The object needs to have a standard material applied to it with a texturemap in the diffuse slot. It also needs to have UVW coordinates. On startup this tool will setup the viewport so that it is ready to draw on. What you get then is a fullbrighted model where you see only the texture without any shading. Now you can start painting anywhere on the model, changing the color, opacity, brushes and so on. You can have edges faces turned on for the model as reference but those edges will be painted over unless you have the "Draw Wireframe" option checked. While this tool is active you can not navigate the viewport.
There are some special options for which keyboard key is pressed. Here is how it works:

Normal: Paint strokes with the current color.

Shift: Eraser. Erase parts of what you have drawn within the current activation of the tool. The opacity for the eraser can be set independent of the brush opacity.

Ctrl: Sample color from the canvas.

Ctrl+Shift: Hold and drag up and down to interactively resize the current brush.

Right-Click: Exit the tool and apply the paint to the models texture. A progressbar will update in the interface during calculations. If you do not want to apply the paint to the model you should uncheck the "Apply paint" checkbox in the interface. This will then just exit the tool.

Clone: The button with the stamp image starts the clone tool. With this tool you select a point on the screen and then paint on another. The paint will then be sampled from the point you first selected. You need to have only one object selected when activating this tool. The object needs to have a standard material applied to it with a texturemap in the diffuse slot. It also needs to have UVW coordinates. On startup this tool will setup the viewport so that it is ready to draw on. What you get then is a fullbrighted model where you see only the texture without any shading. Now you can start painting anywhere on the model, changing the opacity, brushes and so on. You can have edges faces turned on for the model as reference but those edges will be painted over unless you have the "Draw Wireframe" option checked. While this tool is active you can not navigate the viewport.

There are some special options for which keyboard key is pressed. Here is how it works:

Alt: Pick a place on the canvas to sample from. This place can be redefined whenever you want by picking another point.

Normal: Clone parts of the image by painting on the canvas.

Shift: Eraser. Erase parts of what you have drawn within the current activation of the tool. The opacity for the eraser can be set independent of the brush opacity.

Ctrl+Shift: Hold and drag up and down to interactively resize the current brush.

Right-Click: Exit the tool and apply the paint to the models texture. A progressbar will update in the interface during calculations. If you do not want to apply the paint to the model you should uncheck the "Apply paint" checkbox in the interface. This will then just exit the tool.

Interface Settings:

Color: In the color selector you select which color to paint with. To the side is a black and a white button for fast access to the colors black and white. You can also sample color from the canvas in the paint tool by holding the ctrl key while clicking. The color dialog can be left open while painting to quickly change colors.

Colorpicker: The button with the small image next to the color and the white/black buttons lets you sample a color from the active view. Activate the tool and click in the viewport to pick a color. Hold and drag to interactively choose a color while the color is updated in the interface. Right-click to end the tool. The viewport should not be rotated or changed between activating the tool and clicking in the view

Opacity: Sets the opacity for the current brush, both for the paint tool and the clone tool. A value of 100 is fully opac.

Eraser Opacity: Sets the opacity for the eraser, both for the paint tool and the clone tool. The eraser is activated by holding shift while painting. A value of 100 is fully opac.

Apply Paint: If this checkbox is checked when exiting a tool the parts you have painted will be applied to the models texture. If it is not the tool will just exit.

Undo/Redo: Undoes and redoes the last projection to the model. Not available while a painting tool is active

Export View:

With the tools in the "Export view" section you can capture the current viewport and save it as a file that you can open in another program like Photoshop and paint on. After the file is saved with the changes, you press the Update Bitmap button to apply the paint to the models texture. Edged faces should be turned off when using this tool, otherwise the edges might show up in the texture.

Capture view: Capture the current view as an image and save it as an imagefile.

Update Bitmap: Apply the changes made to the saved image to the models texture.

Options:

Various options for working with Viewport Canvas.

Generate Alphamask: If this checkbox is checked there will be a black and white image generated where the white parts are the parts that have been changed in the models texture and the black parts are untouched. This image could then be used to mask out a layer in Photoshop containing the painted texture, if you as an example have cloned away some seams and only want the cloned parts visible in a layer.
The maskfile will have the same location on disk as the models texturemap and the same filename, but with "_mask" added to the end of the filename.

Draw Wireframe: If this option is on when using the painting tools the wireframe of the object will be drawn. The wireframe can be good reference for where you are paintning on the model. If this option is off you can still have the wireframe showing when you enter a painting tool but the wireframe will be painted over.

File handling: Here you can choose how the generated texture is handled. If the radiobuttons are set to "Auto update diffusemap" the models current texturemap will be automatically updated and shown on the model in the viewport. If it is set to "Show in Frame buffer" the models texture will not be overwritten and the new texture will only be shown in the virtual frame buffer, from where you can save it.

Setup: Opens up a dialog for setting up a selected object for painting. The setup will assign a standard material to the object with a texturemap in the diffuse slot that you can either define yourself or use an existing texture. If you already have an object with a standard material and diffusemap this step is not necessary.
The Setup dialog:

If you want to create a new texture for the object adjust the settings for the texture you wish to use in the top of the dialog, set the filename for that texture by pressing the "..." button besides the textfield, then press the "Setup" button. If you have an existing texture you want to use choose alternative 2 "Use existing texture" at the top then press the "Pick texture..." button to choose a texturefile, then press "Setup".

Setting up your system to get the most out of Viewport Canvas

A few recommendations for working with Viewport Canvas. The settings below can be set in Customize/Preferences/Viewport/Configure driver...or Choose driver...

·        Set the viewport graphics driver to Direct3D

·        Set the viewport texture resolution to the highest setting and check the "Match bitmap size as close as possible" option

·        Set the Texel lookup to "Nearest" for the sharpest pixel display possible.(Important when cloning)


CGplusplus.com