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

Is it possible to extrude equally in both directions?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
MayaNZ01
503 Views, 2 Replies

Is it possible to extrude equally in both directions?

MayaNZ01
Enthusiast
Enthusiast

Is it possible to extrude equally in both directions? Or is there a script that can already do this? Would be very useful in a lot of scenarios when modeling, and particularly when bringing in garments from MD

0 Likes

Is it possible to extrude equally in both directions?

Is it possible to extrude equally in both directions? Or is there a script that can already do this? Would be very useful in a lot of scenarios when modeling, and particularly when bringing in garments from MD

Tags (1)
Labels (1)
2 REPLIES 2
Message 2 of 3
Kahylan
in reply to: MayaNZ01

Kahylan
Advisor
Advisor
Accepted solution

Hi!

 

I don't think there is a standart tool to do that in Maya.

 

If this is only about giving clothing from MD some thickness, I wrote a script for that a while back.

But it was only for my own workflow, so it is pretty limited and only works if you select all the faces of the object at the same time.

import maya.cmds as mc

def extrudeFlatObjBothDirections(thick = 0, tz = 0):
    """
    Extrudes selected faces in both directions.
    WARNING: only works properly if all polygons of object are selected
    """
    sl = mc.ls(selection = True) or []
    l = mc.ls(selection = True, fl = True) or []
    
    ext = mc.polyExtrudeFacet(sl[0], kft = True, thickness = thick, ltz = tz, sma = 30, taper = 1, d = 1, ws = True)
    mc.setAttr('{0}.reverseAllFaces'.format(ext[0]),1)
    ext = mc.polyExtrudeFacet("{0}[{1}:{2}]".format(sl[0].split("[")[0],len(l), 2*len(l)-1), kft = True, thickness = thick, ltz =tz, sma = 30, taper = 1, d = 1, ws = True)
    mc.setAttr('{0}.reverseAllFaces'.format(ext[0]),1)

    
extrudeFlatObjBothDirections(thick = 0, tz = 0.1)  

the arg "thick" defines thickness and "tz" defines Translate Z, depending on the mesh one or the other will give you better results.

 

I hope this helps!

0 Likes

Hi!

 

I don't think there is a standart tool to do that in Maya.

 

If this is only about giving clothing from MD some thickness, I wrote a script for that a while back.

But it was only for my own workflow, so it is pretty limited and only works if you select all the faces of the object at the same time.

import maya.cmds as mc

def extrudeFlatObjBothDirections(thick = 0, tz = 0):
    """
    Extrudes selected faces in both directions.
    WARNING: only works properly if all polygons of object are selected
    """
    sl = mc.ls(selection = True) or []
    l = mc.ls(selection = True, fl = True) or []
    
    ext = mc.polyExtrudeFacet(sl[0], kft = True, thickness = thick, ltz = tz, sma = 30, taper = 1, d = 1, ws = True)
    mc.setAttr('{0}.reverseAllFaces'.format(ext[0]),1)
    ext = mc.polyExtrudeFacet("{0}[{1}:{2}]".format(sl[0].split("[")[0],len(l), 2*len(l)-1), kft = True, thickness = thick, ltz =tz, sma = 30, taper = 1, d = 1, ws = True)
    mc.setAttr('{0}.reverseAllFaces'.format(ext[0]),1)

    
extrudeFlatObjBothDirections(thick = 0, tz = 0.1)  

the arg "thick" defines thickness and "tz" defines Translate Z, depending on the mesh one or the other will give you better results.

 

I hope this helps!

Message 3 of 3
MayaNZ01
in reply to: Kahylan

MayaNZ01
Enthusiast
Enthusiast

This works amazing, thank you so much for sharing 🙂

0 Likes

This works amazing, thank you so much for sharing 🙂

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

Post to forums  

Autodesk Design & Make Report