View Full Version : how to render out Overscan like seen in the viewports ?
maxwater 09-06-2008, 02:03 PM Hi Everyone.
id like to render a part of my renderview as a "fullscreen".
lets say i have a small object adjusted to an imageplane in the
lower left corner, id like to render that object in my
render-resolution.
i cant zoom in to that object, because that will destroy my needed
perspective etc.
best would be to have a marquee window which i could drag over that
part of my renderview and render it out.
i already tried overscan parameter of my camera... which basically works in
viewports but when i hit render the scene just renders out without overscan.
also tried Cameras Prescale, what is annoying with that, that the Imageplane
remains small while the objects zooms in... thats very bad for exact adjustments in
the viewport....BUT it renders the way i need it.
basically i just need an Overscan in Viewports which also renders out
like seen in the viewports.
is there a good way to manage it ?
help would be great...
thx in advance,
max
| |
AtrusDni
11-20-2008, 07:34 PM
Hi, try this. It is a script I wrote that calculates overscan based on a percentage. So say you want your camera 25% overscanned. This will modify your camera and rendersettings values to accommodate the new overscan.
Copy and paste this in the script editor:
global proc overscan()
{
// Check that a camera is selected
string $sel[] = `ls -sl -fl`;
if(size($sel) == 1)
{
string $children[] = `listRelatives -c -type camera $sel[0]`;
if(size($children)>0)
{
overscanGUI();
}
else
{
warning "Please select a camera!";
}
}
else
{
warning "Please select just 1 camera!";
}
}
global proc overscanGUI()
{
if (`window -exists overscan`)
deleteUI overscan;
window -widthHeight 210 130 -title "Overscan Calculator" -sizeable false overscan;
columnLayout -rowSpacing 0;
rowLayout -numberOfColumns 2 -cw 1 100 -cw 2 110;
columnLayout -rowSpacing 0;
text -label "Render Width:" -h 20;
text -label "Render Height:" -h 20;
text -label "Camera Angle:" -h 20;
text -label "Overscan By %:" -h 20;
setParent ..;
columnLayout -rowSpacing 0;
textField -w 100 -h 20 txtRenderWidth;
textField -w 100 -h 20 txtRenderHeight;
textField -w 100 -h 20 txtCameraAngle;
textField -w 100 -h 20 txtOverscan;
setParent ..;
setParent ..;
button -l "Calculate Overscan" -w 200 -h 22 -c "calculateOverscan()";
setParent ..;
// Show GUI
showWindow overscan;
// Refresh GUI
refreshGUI();
}
global proc refreshGUI()
{
// Store Render Width and Height
int $width = `getAttr "defaultResolution.width"`;
int $height = `getAttr "defaultResolution.height"`;
// If camera is selected, store camera angle
float $cameraAngle = 0;
string $sel[] = `ls -sl -fl`;
if(size($sel) == 1)
{
string $children[] = `listRelatives -c -type camera $sel[0]`;
if(size($children)>0)
{
$cameraAngle = `getAttr ($sel[0]+".focalLength")`;
}
}
// Populate GUI with values
textField -e -text $width txtRenderWidth;
textField -e -text $height txtRenderHeight;
textField -e -text $cameraAngle txtCameraAngle;
}
global proc calculateOverscan()
{
string $sel[] = `ls -sl -fl`;
if(size($sel) == 1)
{
string $children[] = `listRelatives -c -type camera $sel[0]`;
if(size($children)>0)
{
// Gather settings from GUI
int $width = `textField -q -text txtRenderWidth`;
int $height = `textField -q -text txtRenderHeight`;
float $cameraAngle = `textField -q -text txtCameraAngle`;
float $overscan = `textField -q -text txtOverscan`;
// If all fields are entered, continue
if(($width != 0) &&($height != 0) && ($cameraAngle !=0) && ($overscan !=0))
{
// Calculate Width and Height
int $newWidth = ((($overscan * 0.01) * $width) + $width);
int $newHeight = ((($overscan * 0.01) * $height) + $height);
// Calculate New Camera Anlge
float $tempValue = (($overscan * 0.01) + 1);
float $newAngle = ((1 / $tempValue) * $cameraAngle);
// Set Render Settings Attributes
setAttr "defaultResolution.width" $newWidth;
setAttr "defaultResolution.height" $newHeight;
// Set Camera Angle
setAttr ($sel[0]+".focalLength") $newAngle;
confirmDialog -title "Overscan Results:" -p overscan -message ("Render Settings Changed To:\nNew Render Width: " + $newWidth + "\nNew Render Height: " + $newHeight + "\n\nCamera Angle Set To:\nNew Camera Angle: " + $newAngle + "\n") -button "Ok" -defaultButton "Yes" -cancelButton "Ok" -dismissString "Ok";
}
else
{
warning "All fields have not been entered!";
}
}
else
{
warning "Please select just 1 camera!";
}
}
else
{
warning "Please select just 1 camera!";
}
}
overscan();
Emil3d
11-21-2008, 12:21 AM
I haven't had the need to do this but I remember bookmarking somthing like that just in case. Check if it is helpful for you.
http://forums.cgsociety.org/showpost.php?p=2180673&postcount=4
CGTalk Moderation
11-21-2008, 12:21 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2009, Jelsoft Enterprises Ltd.