I just did a super quick test of 4 shapes under one transform. each one had
it's own shader.

 I selected the transform and ran "combine"
and the result was one mesh object, and the shaders end up a face
assignments.

 is there something more you need this to be?



On Mon, Aug 22, 2016 at 3:16 PM, likage <dissidia....@gmail.com> wrote:

> dfdsf
>
> I somewhat managed to get it working in my following code but was met with
> another problem...
> def fix_multi_shapes_nodes():
>     all_geos = cmds.ls(sl = True)
>     for geo in all_geos:
>         shapes = cmds.listRelatives(geo, fullPath=True, shapes=True)
>         print len(shapes)
>
>
>         # if it has only 1 shape, no fixing required
>         if len(shapes) == 1:
>             continue
>
>
>         # pop out the first shape, since we don't have to fix it
>         shapes = shapes[1:]
>         for shape in shapes:
>             new_transform = cmds.duplicate(shape, parentOnly=True)
>             cmds.parent(shape, new_transform, addObject=True, shape=True)
>             cmds.parent(shape, removeObject=True, shape=True)
>
> fix_multi_shapes()
>
>
> Now while I am able to have the shapes nodes to be a individual geometry
> pieces, however I am getting issues with the naming, in which I am getting
> 'googleEarth_3342_1_geo', 'googleEarth_3342_1_geo2', ...,
> 'googleEarth_3342_1_geo22', 'googleEarth_3342_1_geo35' etc..
>
> I am trying to get the suffix to be just '_geo' by using .rstrip which is
> not helping because of the '3342'..
>
> This is the command where I do for the renaming:
> sel_list = cmds.ls(sl=True)
>
> for ind in sel_list:
>     new = re.sub(r'\d*$','', ind)
>     cmds.rename(ind, new)
>
> --
> 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 python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/python_inside_maya/b93873a2-3e84-49cf-87db-
> 1440f65cbde0%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/b93873a2-3e84-49cf-87db-1440f65cbde0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
stephenkm...@gmail.com
http://smannimation.blogspot.com/
http://nymayausersgroup.blogspot.com/
http://smann3d.blogspot.com/

-- 
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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAASZO1d0ipbeW4V6WJkLEF0m159pgPVSoWGSNWtUpUuBwaxp6g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to