pymel.core.rendering.hwRender

hwRender(*args, **kwargs)

Renders an image or a sequence using the hardware rendering engine

Flags:
Long name (short name) Argument Types Properties
acceleratedMultiSampleSupport (ams) bool ../../../_images/query.gif
 
This flag when used with query will return whether the graphics supports hardware accelerated multi-sampling.
activeTextureCount (atc) bool ../../../_images/query.gif
 
This flag when used with query will return the number of textures that have been bound to the graphics by the hardware renderer.
camera (cam) unicode ../../../_images/create.gif ../../../_images/query.gif
 
Specify the camera to use. Use the first available camera if the camera given is not found.
currentFrame (cf) bool ../../../_images/create.gif ../../../_images/query.gif
 
Render the current frame.
currentView (cv) bool ../../../_images/create.gif ../../../_images/query.gif
 
When turned on, only the current view will be rendered.
edgeAntiAliasing (eaa) int, int ../../../_images/create.gif ../../../_images/query.gif
 

Enables multipass rendering. Controls for the number of exposures rendered per frame are provided in the form of two associated flag arguments. The first specifies the sampling algorithm: 0 - Uniform Weighted Grid Sampling1 - Rotated Grid Super Sampling (RGSS)2 - Gaussian Weighted SamplingUse of a sampling method other than the others listed above, will result in use of the default sample method of Uniform Weighted Grid Sampling. The second argument specifies a number of samples to use. For each sampling algorithm there is a fixed set of sample counts available: 0 - Uniform Weighted Grid Sampling1 Sample3 Samples4 Samples5 Samples7 Samples9 Samples16 Samples25 Samples36 Samples1 - Rotated Grid Super Sampling (RGSS)1 Sample4 Samples5 Samples2 - Gaussian Weighted Sampling1 Sample3 Samples4 Samples5 Samples7 Samples9 Samples16 Samples25 Samples36 SamplesUsing a sampling count other than the allowable options for the given sampling method will result in using the default sample count of 5. The values passed via the command will override settings stored in the hardwareRenderGlobals node.

fixFileNameNumberPattern (fnp) bool ../../../_images/create.gif ../../../_images/query.gif
 

This flag allows the user to take the hardwareRenderGlobals filename as the initial filename pattern, fix the frame number pattern in the filename in a unique way, returns the new filename pattern. This does not change the hardwareRenderGlobals’s filename.

frame (f) float ../../../_images/create.gif
 
Specify the frame to render.
fullRenderSupport (frs) bool ../../../_images/create.gif ../../../_images/query.gif
 

This flag may be used in the create or query context. In the create context, it will force the renderer to abort and not render any frames if the hardware is not fully supported. In the query context, it will return whether full quality rendering is supported on the current graphics system. Please see the graphics card qualification charts for an explanation of limited support.

height (h) int ../../../_images/create.gif ../../../_images/query.gif
 
The height flag pass the height to the hwRender command. If not used, the height is taken from the render globals settings.
imageFileName (ifn) bool ../../../_images/create.gif ../../../_images/query.gif
 

This flag let people query the image name for a specified frame. The frame can be specified using the “-frame” flag. When no “-frame” is used, the current frame number is used.

layer (l) PyNode ../../../_images/create.gif ../../../_images/query.gif
 

Render the specified render layer. Only this render layer will be rendered, regardless of the renderable attribute value of the render layer. The layer name will be appended to the output image file name. The specified render layer becomes the current render layer before rendering, and remains as current render layer after the rendering.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

limitedRenderSupport (lrs) bool ../../../_images/query.gif
 

This flag when used with query will return whether limited rendering is supported on the current graphics system. Please see the graphics card qualification charts for the current definition of limited support.

lowQualityLighting (lql) bool ../../../_images/create.gif ../../../_images/query.gif
 
Disable lighting evaluation per pixel (fragment). Note: The values passed via the command will override settings stored in the hardware render globals node.
noRenderView (nrv) bool ../../../_images/create.gif ../../../_images/query.gif
 
When turned on, the render view is not updated after image computation
notWriteToFile (nwf) bool ../../../_images/create.gif ../../../_images/query.gif
 
This flag is set to true if the user does not want to write the image to a file. It is set to false, otherwise. The default value of the flag is “false”.
printGeometry (pg) bool ../../../_images/create.gif ../../../_images/query.gif
 
Print the geomety objects as they get translated.
renderHardwareName (rhw) bool ../../../_images/query.gif
 

This flag will create a graphics context and return the name of the graphics hardware being used. The graphics hardware is determined by creating an off screen buffer and querying the GL_RENDERER string from OpenGL. If the off screen buffer cannot be created an empty string is returned.

renderRegion (reg) int, int, int, int ../../../_images/create.gif ../../../_images/query.gif
 
The renderRegion flag pass the render region to the hwRender command. The parameters are 4 integers, indicating left right bottom top of the region.
renderSelected (rs) bool ../../../_images/create.gif ../../../_images/query.gif
 
Only renders the selected objects.
textureResolution (res) int ../../../_images/create.gif ../../../_images/query.gif
 
Specify the desired resolution of baked textures.
width (w) int ../../../_images/create.gif ../../../_images/query.gif
 
The width flag pass the width to the hwRender command. If not used, the width is taken from the render globals settings.
writeAlpha (a) bool ../../../_images/create.gif ../../../_images/query.gif
 
Read the alpha channel of color buffer and return as tif file.
writeDepth (d) bool ../../../_images/create.gif ../../../_images/query.gif
 
Read the depth buffer and return as tif file.

Derived from mel command maya.cmds.hwRender

Example:

import pymel.core as pm

# Create a poly sphere.
pm.polySphere()
# Result: [nt.Transform(u'pSphere1'), nt.PolySphere(u'polySphere1')] #
# Render it
pm.hwRender()
# Result: u'/Volumes/newhome/chad/Documents/maya/projects/default/images/tmp/untitled.iff' #
# Render the region where left=20, right=50, bottom=30, top=60.
# And do not write the output to a file.
#
pm.hwRender( renderRegion=(20, 50, 30, 60), notWriteToFile=True )
# Result: u'/Volumes/newhome/chad/Documents/maya/projects/default/images/tmp/untitled.iff' #
# Render with the specified width and height.
#
pm.hwRender( width=100, height=200 )
# Result: u'/Volumes/newhome/chad/Documents/maya/projects/default/images/tmp/untitled.iff' #
# Returns the imageFileName for image frame 11.
#
pm.hwRender( imageFileName=True, frame=11 )
# Returns the imageFileName for current frame.
#
pm.hwRender( imageFileName=True )
# Returns a version of the image file name after its number pattern
# being represented in a unique way.
#
pm.hwRender( query=True, fixFileNameNumberPattern=True )
# Render the specified render layer.
pm.hwRender( layer='layer1' )

Previous topic

pymel.core.rendering.hwReflectionMap

Next topic

pymel.core.rendering.hwRenderLoad

Core

Core Modules

Other Modules

This Page