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

MASH - Scattering group node works - Bake instancer to Objects fails

Message 1 of 3
496 Views, 2 Replies

MASH - Scattering group node works - Bake instancer to Objects fails

I created a simple MASH 3 x 3 grid of DESK_GRP below.

As you see, all the elements of the desk are contained under this group node.


Source Geo: DESK_GRP



MASH works great, and I can quickly make 3 x 3 grid from the DESK_GRP above.

But when I run 'Bake instancer to objects' commands,
all the group nodes gets removed, and I only get the children of the DESK_GRP node like this

Is there any way to keep the group node after running the "Bake Instancer to Objects" command?

Any info would be very helpful. Thank you so much!!


Message 2 of 3
in reply to: SDG-153

I'm going to give an answer I'm not certain is correct. So maybe someone who knows more mash can hop in and giving you a definitive answer.

But I'm going to say no. Only because I think instancing looks at groups as not being a real thing. Instancing happens on the geo level and is just visual until baking.


As an alternative:

1 - Combine your objects before mashing them then separate them later. This is obviously not a great idea if each item contains many separate parts.


2 - Set up a different mash network for each item. This can be fun because you can add randomness to each piece independently of the whole. For example, rotating each chair a little bit differently but leaving the desks as they are.


Hope you or someone else can find the correct answer to this one, and that this helps in the meantime.

Message 3 of 3
in reply to: SDG-153

Hi! You are the only one who ever asked that question. Great question! I'm sorry that you had to wait for your answer for such a long time. I have the same right at the moment.


All the groups are deleted by MASH, so you'd better use nurbCurves instead, but there should be only one, otherway script won't work correctly.


Then after baking you'll get a group with all that stuff, select all of it from the first element to the last and use that python script - it will parent back all your elements.


list = = True)
parent_curve = None
mesh_objects = []
for element in list:
    shape = cmds.listRelatives(element, shapes=True)
    type = cmds.objectType(shape[0])
    if type == 'mesh':
    if type == 'nurbsCurve':
        if parent_curve == None:
            parent_curve = element
            print("Parent: " + parent_curve)
            for obj in mesh_objects:
                print(obj + " -> " + parent_curve)
                cmds.parent(obj, parent_curve)
            mesh_objects = []
            parent_curve = element
for obj in mesh_objects:
    print(obj + " -> " + parent_curve)
    cmds.parent(obj, parent_curve)
print("All done")


And by the way as far as I see in your situation, you could use null geometry (only 1 vertex in a center) as a group handler.


Don't know if A#todesk handled this moment in their future releases. But their work is really s#cks, they don't care about their customers and even their soft, owned 20 years ago and remained the same. Think soon no one is going to use it, if they won't update source code and make it more userfriendly.

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

Post to forums