Community
Maya Shading, Lighting and Rendering
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya materials topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Texture in png

10 REPLIES 10
Reply
Message 1 of 11
mishranitish1301
792 Views, 10 Replies

Texture in png

I Applied an Ai standard surface on a mesh in the scene.

I use ramp shader in basecolor.

i want ramp  shader as an .png map images, how do i export the shader in png image map?Screenshot (323).png 

10 REPLIES 10
Message 2 of 11
Kahylan
in reply to: mishranitish1301

Hi!

 

You can use the "Convert to File Texture" command.

 

https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2022/ENU/Maya-Lig...

 

This command is geometry based, if you want the ramp texture the same way you see it in the preview image you would first need to assign it to a square plane. But if you just want the result to look like what you have, you can just use the designated geometry and it will create a texture specific to those UV's instead.

 

I hope it helps!

Message 3 of 11
mishranitish1301
in reply to: Kahylan

it shows error
"// Error: file: D:/AUTODESK/MAYA/Maya2019/scripts/others/copyConvertSolidTx.mel line 826: No surfaces selected, unable to continue // "
Message 4 of 11
Kahylan
in reply to: mishranitish1301

As I said. It's geometry specific, so the geometry you want to convert your shader from needs to be selected.

Message 5 of 11
mishranitish1301
in reply to: Kahylan

can you please guide me how do this ?
Message 6 of 11
Kahylan
in reply to: mishranitish1301

Sure thing. I attached a video of how I do it.
I don't have software on my computer that displays keys when they are pressed. So in order to get to the "Assign new Material" Menu, I used Rightclick. And in order to add the shader to the selection in the Hypershade I held down Shift when I clicked it.

But if you already have an existing Ramp, you can use the Hypershade or the Node Editor to connect it to the shader you create.

 

I hope it helps!

Message 7 of 11
mishranitish1301
in reply to: Kahylan

No its not working
Message 8 of 11
Kahylan
in reply to: mishranitish1301

Did you have both the object that the shader is applied to and the shader (the shader not the ramp texture) selected when you ran the command?

Message 9 of 11
mishranitish1301
in reply to: Kahylan

Yes but still same error is showing
Message 10 of 11
Kahylan
in reply to: mishranitish1301

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")
Message 11 of 11
mishranitish1301
in reply to: Kahylan

It's work
Before i only selected shader not mesh.

Thanks for the help

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report