What version of Maya is this? renderer = apiOMR.MRenderer
I don't have MRenderer in the Python API? On Tue, Feb 24, 2015 at 12:59 AM, Bay <[email protected]> wrote: > Well after reading the documentations it appears that writecolorbuffer is > obsolete and it is advised that rendertarget should be used to obtain the > information. This is the solution you just need to substitute the path > variable with your output. > > def create_viewport_render(self, path): > """ > Function that calls the OpenMaya Renderer module to screenshot the > viewport and save it > """ > renderer = apiOMR.MRenderer > tgt_mgm = renderer.getRenderTargetManager() > texture_mgm = renderer.getTextureManager() > > target = tgt_mgm.acquireRenderTargetFromScreen('MTextureTest') > > target_desc = target.targetDescription() > target_data = target.rawData() > # Render Target must be released in order to avoid causing buffer > issues > tgt_mgm.releaseRenderTarget(target) > > # Setting parameters of the file to be output. > texture_desc = apiOMR.MTextureDescription() > texture_desc.fWidth = target_desc.width() > texture_desc.fHeight = target_desc.height() > texture_desc.fDepth = 1 > texture_desc.fBytesPerRow = target_data[1] > texture_desc.fBytesPerSlice = target_data[2] > texture_desc.fMipmaps = 1 > texture_desc.fArraySlices = target_desc.arraySliceCount() > texture_desc.fFormat = target_desc.rasterFormat() > texture_desc.fTextureType = 2 > texture_desc.fEnvMapType = 0 > > texture = texture_mgm.acquireTexture('MTextureTest', texture_desc, > target_data[0]) > texture_mgm.saveTexture(texture, path) > # Texture must be release to avoid causing buffer issues. > texture_mgm.releaseTexture(texture) > > On Tuesday, January 20, 2015 at 8:31:06 AM UTC-8, tomp_blue wrote: >> >> I m running into this issue with a pose library also. *cmds.ogs*Render >> <http://help.autodesk.com/cloudhelp/2015/ENU/Maya-Tech-Docs/CommandsPython/ogsRender.html> >> seems to still work. I had tried getting the QWidget from PySide but this >> always came out garbled. >> >> TomP >> >> twitter.com/blue_zoo <http://www.twitter.com/blue_zoo> | >> facebook.com/bluezooanimation | vimeo.com/bluezoo >> <http://vimeo.com/channels/bluezoo> >> >> >> Blue Zoo Animation | 385 Euston Road, London NW1 3AU | t. 020 7434 >> 4111 >> >> >> -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/52bbc7a9-68c6-4a78-8b1a-756e6b53c16d%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/52bbc7a9-68c6-4a78-8b1a-756e6b53c16d%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- *David Moulder* Technical Animator / Artist [email protected] *Professional Profile <http://uk.linkedin.com/pub/david-moulder/1/b12/b5a>* Mobile: +44 (0)7814033242 See who we know in common <http://www.linkedin.com/e/wwk/5748982/?hs=false&tok=3tztwkse1silw1>Want a signature like this? <http://www.linkedin.com/e/sig/5748982/?hs=false&tok=3pwLU9-mBsilw1> -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CABD4PkRx%3D9-gAYGWZsPj-%2B3ee2OnGExru6AChsxP8pq%3DPzH%3DrA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
