def mapImage(imgMesh, mesh, leftTop, rightBottom): if mh.hasRenderSkin(): return mapImageGL(imgMesh.mesh.object3d.textureTex, mesh, leftTop, rightBottom) else: return mapImageSoft(mh.Image(imgMesh.getTexture()), mesh, leftTop, rightBottom)
def mapImage(imgMesh, mesh, leftTop, rightBottom): if mh.hasRenderSkin(): try: return mapImageGL(imgMesh.mesh.object3d.textureTex, mesh, leftTop, rightBottom) except Exception, e: log.debug(e) log.debug("Hardware skin rendering failed, falling back to software render.") return mapImageSoft(mh.Image(imgMesh.getTexture()), mesh, leftTop, rightBottom)
def mapUV(): """ Project the UV map topology of the selected human mesh onto a texture. Uses OpenGL hardware acceleration if the necessary OGL features are available, otherwise uses a slower software rasterizer. """ if mh.hasRenderSkin(): return mapUVGL() else: return mapUVSoft()
def mapLighting(lightpos=(-10.99, 20.0, 20.0), progressCallback=None): """ Bake lightmap for human from one light. Uses OpenGL hardware acceleration if the necessary OGL features are available, otherwise uses a slower software rasterizer. """ if mh.hasRenderSkin(): return mapLightingGL(lightpos) else: return mapLightingSoft(lightpos, progressCallback)
def mapLighting(lightpos = (-10.99, 20.0, 20.0), progressCallback = None): """ Bake lightmap for human from one light. Uses OpenGL hardware acceleration if the necessary OGL features are available, otherwise uses a slower software rasterizer. """ if mh.hasRenderSkin(): return mapLightingGL(lightpos) else: return mapLightingSoft(lightpos, progressCallback)
def mapUV(): """ Project the UV map topology of the selected human mesh onto a texture. Uses OpenGL hardware acceleration if the necessary OGL features are available, otherwise uses a slower software rasterizer. """ if mh.hasRenderSkin(): try: return mapUVGL() except Exception, e: log.debug(e) log.debug("Hardware skin rendering failed, falling back to software render.") return mapUVSoft()
def mapLighting(lightpos = (-10.99, 20.0, 20.0), mesh = None, res = (1024, 1024), border = 1): """ Bake lightmap for human from one light. Uses OpenGL hardware acceleration if the necessary OGL features are available, otherwise uses a slower software rasterizer. """ if mh.hasRenderSkin(): try: return mapLightingGL(lightpos, mesh, res, border) except Exception, e: log.debug(e) log.debug("Hardware skin rendering failed, falling back to software render.") return mapLightingSoft(lightpos, mesh, res, border)
def mapMask(dimensions = (1024, 1024), mesh = None): """ Create a texture map mask, for finding the texture map borders. """ if mh.hasRenderSkin(): try: if mesh is None: mesh = G.app.selectedHuman.mesh return mh.renderSkin(dimensions, mesh.vertsPerPrimitive, mesh.r_texco, index = mesh.index, clearColor = (0, 0, 0, 0)) except Exception, e: log.debug(e) log.debug("Hardware skin rendering failed, falling back to software render.") return mapMaskSoft(dimensions, mesh)
def mapUV(): if mh.hasRenderSkin(): return mapUVGL() else: return mapUVSoft()
def mapLighting(progressCallback=None): if mh.hasRenderSkin(): return mapLightingGL() else: return mapLightingSoft(progressCallback)
def mapLighting(progressCallback = None): if mh.hasRenderSkin(): return mapLightingGL() else: return mapLightingSoft(progressCallback)