Thats weird, because this error should only be showing if there is no geometry selected...
Anyways, try selecting your ramp and then running this script from a python tab in the Script Editor:
import maya.cmds as mc
def exportRamp(name = ""):
ramp = mc.ls(sl = True)[0]
pl = mc.polyPlane(n = "standinPlane")[0]
shader = applyMaterial(pl)
mc.connectAttr('{}.outColor'.format(ramp),'{}.color'.format(shader) )
mc.convertSolidTx( ramp,pl,sp = True,fur = True, rx=1024, ry=1024, fil = 'png', fin = name, f = True )
mc.delete(pl)
mc. delete(shader)
def applyMaterial(node):
if mc.objExists(node):
shd = mc.shadingNode('lambert', name="%s_lambert" % node, asShader=True)
shdSG = mc.sets(name='%sSG' % shd, empty=True, renderable=True, noSurfaceShader=True)
mc.connectAttr('%s.outColor' % shd, '%s.surfaceShader' % shdSG)
mc.sets(node, e=True, forceElement=shdSG)
return shd
exportRamp(name = "exportedRamp.png")