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

MASH on a rigged character (mesh) - dealing with scatter recalculation

14 REPLIES 14
SOLVED
Reply
Message 1 of 15
Anonymous
3510 Views, 14 Replies

MASH on a rigged character (mesh) - dealing with scatter recalculation

Anonymous
Not applicable

Hello,

Trying to scatter objects on a mesh. Randomly. I do not want to do by vertices or polygon centers. I cannot use XGen archives for the task, only MASH.

The mesh is skinned. It's part of a dynamic character and it undergoes deformation.

The problem is, MASH recalculates position for the generated instances as the mesh deforms. What can be done without having to covert instances (and whole network) to geometry? As far as I understood, MASH cache will apply the recalculations.

0 Likes

MASH on a rigged character (mesh) - dealing with scatter recalculation

Hello,

Trying to scatter objects on a mesh. Randomly. I do not want to do by vertices or polygon centers. I cannot use XGen archives for the task, only MASH.

The mesh is skinned. It's part of a dynamic character and it undergoes deformation.

The problem is, MASH recalculates position for the generated instances as the mesh deforms. What can be done without having to covert instances (and whole network) to geometry? As far as I understood, MASH cache will apply the recalculations.

14 REPLIES 14
Message 2 of 15
djonesuk
in reply to: Anonymous

djonesuk
Advocate
Advocate
Accepted solution

This happens when you scatter points in a MASH network using the face area option.

e3d4bc20-3f5d-402e-a965-075ab1f2e883

If the face area changes during deformation then the distribution updates to accommodate the new area.

 

To get around this I was able to create a distribution I was happy with on a deforming mesh, then convert the MASH points to follicles, which stick to the same point on the mesh through deformations. 

 

I then took those follicles as input points to the original MASH network and the result is a network that sticks to its original distribution even through deformations.

 

I have attached the script to this post. I hope it's of use to you.

 

 

 

 

This happens when you scatter points in a MASH network using the face area option.

e3d4bc20-3f5d-402e-a965-075ab1f2e883

If the face area changes during deformation then the distribution updates to accommodate the new area.

 

To get around this I was able to create a distribution I was happy with on a deforming mesh, then convert the MASH points to follicles, which stick to the same point on the mesh through deformations. 

 

I then took those follicles as input points to the original MASH network and the result is a network that sticks to its original distribution even through deformations.

 

I have attached the script to this post. I hope it's of use to you.

 

 

 

 

Message 3 of 15
Anonymous
in reply to: djonesuk

Anonymous
Not applicable

Thank you! You are very generous with the effort you make to explain things, with a video tutorial. Yep, that makes sense.

0 Likes

Thank you! You are very generous with the effort you make to explain things, with a video tutorial. Yep, that makes sense.

Message 4 of 15
Anonymous
in reply to: Anonymous

Anonymous
Not applicable

I found this thread while searching for a solution to the same issue.  It gave me another idea for a similar solution so I thought I'd throw it out there incase anyone else is stumbles across this thread.  

1.  Get desired random distribution with maya mash by  scattering in a single poly plane across your mesh. 

2.  Duplicate the created reproMesh and wrap it to your original animation

3. Use new duplicated and wrapped mesh to create a mash network using face centers.

 

Ideally though, Maya would add a pref feature that would allow us to use a stationary reference mesh to determine the "Use face area" scatter distribution.

 

I found this thread while searching for a solution to the same issue.  It gave me another idea for a similar solution so I thought I'd throw it out there incase anyone else is stumbles across this thread.  

1.  Get desired random distribution with maya mash by  scattering in a single poly plane across your mesh. 

2.  Duplicate the created reproMesh and wrap it to your original animation

3. Use new duplicated and wrapped mesh to create a mash network using face centers.

 

Ideally though, Maya would add a pref feature that would allow us to use a stationary reference mesh to determine the "Use face area" scatter distribution.

 

Message 5 of 15
maja.divjakW2VMQ
in reply to: djonesuk

maja.divjakW2VMQ
Advocate
Advocate

Hi David Jones,

Hope you're well!

I'm trying to attach MASH polys to a deforming sphere (actually a smoothed cube to avoid pole pinching). I have a squash deformer applied to it and then I've converted it to a soft body and applied a radial field to it to give some random jiggle. I can apply the MASH objects to the sphere as you outlined and they follow the deformation nicely, but as you note, there is some popping of the MASH meshes as the surface recalculates (see attached movie). So, I tried to use your follicle script, which gave a result, except the follicles are all offset weirdly from the sphere and no longer follow the animation, they just sit stationary in space, as per the attached image. I'm wondering if you know what might be happening please? Could it be the softbody particles causing the problem? I'm working with Maya 2020

Thanks so much for your help and best wishes,

Maja

 

 

0 Likes

Hi David Jones,

Hope you're well!

I'm trying to attach MASH polys to a deforming sphere (actually a smoothed cube to avoid pole pinching). I have a squash deformer applied to it and then I've converted it to a soft body and applied a radial field to it to give some random jiggle. I can apply the MASH objects to the sphere as you outlined and they follow the deformation nicely, but as you note, there is some popping of the MASH meshes as the surface recalculates (see attached movie). So, I tried to use your follicle script, which gave a result, except the follicles are all offset weirdly from the sphere and no longer follow the animation, they just sit stationary in space, as per the attached image. I'm wondering if you know what might be happening please? Could it be the softbody particles causing the problem? I'm working with Maya 2020

Thanks so much for your help and best wishes,

Maja

 

 

Message 6 of 15
maja.divjakW2VMQ
in reply to: Anonymous

maja.divjakW2VMQ
Advocate
Advocate

Hi David,

I hope you're well!

I'm trying to attach MASH polys to a deforming sphere (actually a smoothed cube to avoid pole pinching). I have a squash deformer applied to it and then I've converted it to a soft body and applied a radial field to it to give some random jiggle. I can apply the MASH objects to the sphere to begin with, but they pop as the surface recalculates, as expected.

To get round this, I've been trying djonesuk's method above with the follicles and not having much luck- they are offsetting weirdly from my sphere and losing their animation.

So, I'm also interested in trying your method, but I don't understand what you mean by 'wrap the repromesh to the original animation' I've tried using a wrap deformer to do this and it kind of works, except the MASH meshes stretch and deform as the sphere animates, which I don't want. If you could please give some more detail as to how to achieve this, I would very much appreciate it. Similarly, if you could please elaborate on how to 'Use new duplicated and wrapped mesh to create a mash network using face centers'  that would be fantastic. I'm working with Maya 2020.

Thanks so much for your help and best wishes,

Maja

Hi David,

I hope you're well!

I'm trying to attach MASH polys to a deforming sphere (actually a smoothed cube to avoid pole pinching). I have a squash deformer applied to it and then I've converted it to a soft body and applied a radial field to it to give some random jiggle. I can apply the MASH objects to the sphere to begin with, but they pop as the surface recalculates, as expected.

To get round this, I've been trying djonesuk's method above with the follicles and not having much luck- they are offsetting weirdly from my sphere and losing their animation.

So, I'm also interested in trying your method, but I don't understand what you mean by 'wrap the repromesh to the original animation' I've tried using a wrap deformer to do this and it kind of works, except the MASH meshes stretch and deform as the sphere animates, which I don't want. If you could please give some more detail as to how to achieve this, I would very much appreciate it. Similarly, if you could please elaborate on how to 'Use new duplicated and wrapped mesh to create a mash network using face centers'  that would be fantastic. I'm working with Maya 2020.

Thanks so much for your help and best wishes,

Maja

Message 7 of 15
dinofiguera
in reply to: Anonymous

dinofiguera
Collaborator
Collaborator

There is another and simpler way to do this, it is a MASH workflow made on purpose. 

1. you create the initial Mesh distribution of your MASH objects onto the geometry where you temporarily deactivate the deformation.

 

2. now you go to MASH utilities and choose generate Mesh from mash points.
this will create a weird mesh that connects all mash points.

 

3.  in the distribute node, change the mesh target to this newly generated mesh and the distribution method to vertices.

 

4. add this new mesh to the deformers so that it deforms the same way of your original mesh

 

done.

 

you can even orient the mash objects to the original surface by using an Orient node putting your original mesh as an orientation target.

 

cheers,

D

 

There is another and simpler way to do this, it is a MASH workflow made on purpose. 

1. you create the initial Mesh distribution of your MASH objects onto the geometry where you temporarily deactivate the deformation.

 

2. now you go to MASH utilities and choose generate Mesh from mash points.
this will create a weird mesh that connects all mash points.

 

3.  in the distribute node, change the mesh target to this newly generated mesh and the distribution method to vertices.

 

4. add this new mesh to the deformers so that it deforms the same way of your original mesh

 

done.

 

you can even orient the mash objects to the original surface by using an Orient node putting your original mesh as an orientation target.

 

cheers,

D

 

Message 8 of 15

maja.divjakW2VMQ
Advocate
Advocate

Hi Dino,

Thanks so much for that workflow, it was extremely helpful. I did get it to work, although I'm not sure in the way you intended. This is how I did it:

1. you create the initial Mesh distribution of your MASH objects onto the geometry where you temporarily deactivate the deformation.

So, I deformed my sphere with an animated squash deformer and then converted it to soft body particles to give jiggle. I'm not sure what you mean by 'temporarily deactivate the deformation', so I just did everything on frame 1. I then distributed the MASH objects on this deforming sphere.

 

2. now you go to MASH utilities and choose generate Mesh from mash points.
this will create a weird mesh that connects all mash points.

Did this, all good

 

3.  in the distribute node, change the mesh target to this newly generated mesh and the distribution method to vertices.

Again, all good.

 

4add this new mesh to the deformers so that it deforms the same way of your original mesh

As explained above, I'm not really sure what you mean by this. What I did was go into the node editor, select input and output connections on the squash deformer, disconnect the original animated sphere from the particleShape node and connected the newly generated mesh to the particleShape node. The MASH objects then followed the animated deformation and also jiggled nicely. On the MASH distribute node, I changed the distribution method to random vertex, so the MASH objects were randomly distributed, instead of symmetrical.

 

If you could please confirm whether this is the correct approach, I would very much appreciate it.

 

Thanks so much and best wishes,

 

Maja

0 Likes

Hi Dino,

Thanks so much for that workflow, it was extremely helpful. I did get it to work, although I'm not sure in the way you intended. This is how I did it:

1. you create the initial Mesh distribution of your MASH objects onto the geometry where you temporarily deactivate the deformation.

So, I deformed my sphere with an animated squash deformer and then converted it to soft body particles to give jiggle. I'm not sure what you mean by 'temporarily deactivate the deformation', so I just did everything on frame 1. I then distributed the MASH objects on this deforming sphere.

 

2. now you go to MASH utilities and choose generate Mesh from mash points.
this will create a weird mesh that connects all mash points.

Did this, all good

 

3.  in the distribute node, change the mesh target to this newly generated mesh and the distribution method to vertices.

Again, all good.

 

4add this new mesh to the deformers so that it deforms the same way of your original mesh

As explained above, I'm not really sure what you mean by this. What I did was go into the node editor, select input and output connections on the squash deformer, disconnect the original animated sphere from the particleShape node and connected the newly generated mesh to the particleShape node. The MASH objects then followed the animated deformation and also jiggled nicely. On the MASH distribute node, I changed the distribution method to random vertex, so the MASH objects were randomly distributed, instead of symmetrical.

 

If you could please confirm whether this is the correct approach, I would very much appreciate it.

 

Thanks so much and best wishes,

 

Maja

Message 9 of 15

dinofiguera
Collaborator
Collaborator

You nailed it, 

this is the right approach but you can avoid a few things:

you can connect /disconnect geometry from the deformers by simply using the relationship editor/deformer sets window (window ---> relationship editor --->deformer sets)

you select your deformer on the left pane and link or unlink geometry on the right pane with a simple click.

There is a superpowerful jiggle deformer that comes directly from Mash, if you start using this you will forget

soft bodies or Maya native jiggle deformer.

you select your geometry, go to Mash utilities ---> jiggle deformer. 

Now your object jiggles in a nice way already, with one click.

Plus, this jiggle deformer is a MASH node, and you can control it with other mash nodes and falloff objects.

 

P:S when I said deactivate temporarily the deformers I meant that when you create your first Mash distribution and the consequent MASH geometry from points, the geometry must be undeformed, so you go to frame 1 like you did or you zero out each envelope attribute of each deformer acting on the geometry...

 

hope this helps,

D

 

 

 

 

You nailed it, 

this is the right approach but you can avoid a few things:

you can connect /disconnect geometry from the deformers by simply using the relationship editor/deformer sets window (window ---> relationship editor --->deformer sets)

you select your deformer on the left pane and link or unlink geometry on the right pane with a simple click.

There is a superpowerful jiggle deformer that comes directly from Mash, if you start using this you will forget

soft bodies or Maya native jiggle deformer.

you select your geometry, go to Mash utilities ---> jiggle deformer. 

Now your object jiggles in a nice way already, with one click.

Plus, this jiggle deformer is a MASH node, and you can control it with other mash nodes and falloff objects.

 

P:S when I said deactivate temporarily the deformers I meant that when you create your first Mash distribution and the consequent MASH geometry from points, the geometry must be undeformed, so you go to frame 1 like you did or you zero out each envelope attribute of each deformer acting on the geometry...

 

hope this helps,

D

 

 

 

 

Message 10 of 15

maja.divjakW2VMQ
Advocate
Advocate

Thanks so much Dino, very helpful information yet again.

 

Re the MASH jiggle deformer, correct me if I'm wrong, but it looks like the jiggle occurs in response to animation/deformation and once this stops, the jiggle ceases? What I need is constant jiggling movement that occurs in addition to the squash effect, which is what the soft body particles with a turbulence field provides. 

However, I do like the idea of everything being connected under the one MASH system, so I had a very brief play with MASH jiggle, but couldn't really get it to give any movement? I would appreciate your thoughts on whether this will be useful in my situation.

 

Ah yes, the relationship editor! I use this so rarely I forget about it. Thanks for bringing this to my attention, I will take a closer look. However, I think I will have to disconnect from the squash deformer and then the nParticles and then reconnect to both? When doing this in the node editor, it's just one click.

 

Finally, I was wondering whether it is actually possible to distribute nParticleSytems as MASH objects onto the deforming geometry, so that they follow the animated deformation? If so, how would I go about doing this please?

 

Thanks so much for your wonderful help,

 

Maja

0 Likes

Thanks so much Dino, very helpful information yet again.

 

Re the MASH jiggle deformer, correct me if I'm wrong, but it looks like the jiggle occurs in response to animation/deformation and once this stops, the jiggle ceases? What I need is constant jiggling movement that occurs in addition to the squash effect, which is what the soft body particles with a turbulence field provides. 

However, I do like the idea of everything being connected under the one MASH system, so I had a very brief play with MASH jiggle, but couldn't really get it to give any movement? I would appreciate your thoughts on whether this will be useful in my situation.

 

Ah yes, the relationship editor! I use this so rarely I forget about it. Thanks for bringing this to my attention, I will take a closer look. However, I think I will have to disconnect from the squash deformer and then the nParticles and then reconnect to both? When doing this in the node editor, it's just one click.

 

Finally, I was wondering whether it is actually possible to distribute nParticleSytems as MASH objects onto the deforming geometry, so that they follow the animated deformation? If so, how would I go about doing this please?

 

Thanks so much for your wonderful help,

 

Maja

Message 11 of 15

dinofiguera
Collaborator
Collaborator

Hello,

ok, I did not get you wanted a constant jiggle, I thought was a jiggle only connected to motion.
in that case, if your setup works, go for it.

The answer to your question about particles is again hidden in the great MASH utilities.
close to the MASH jiggle deformer, you have two options concerning the particles.
You can create a particle setup and then attach MASH points to follow those particles, 

for example, you can attach MASH points to your soft body particles
 (use nParticles to distribute MASH points in the menu)

or you can create a mash setup and then attach nParticles to it
(setup nParticles with an initial state from MASH in the menu)

 

mashUtilities.png

 

cheers

Hello,

ok, I did not get you wanted a constant jiggle, I thought was a jiggle only connected to motion.
in that case, if your setup works, go for it.

The answer to your question about particles is again hidden in the great MASH utilities.
close to the MASH jiggle deformer, you have two options concerning the particles.
You can create a particle setup and then attach MASH points to follow those particles, 

for example, you can attach MASH points to your soft body particles
 (use nParticles to distribute MASH points in the menu)

or you can create a mash setup and then attach nParticles to it
(setup nParticles with an initial state from MASH in the menu)

 

mashUtilities.png

 

cheers

Message 12 of 15

maja.divjakW2VMQ
Advocate
Advocate

Hi Dino,

 

Thanks for your helpful reply.

I tried the set up nParticles with an initial state from MASH and was pleased to see they follow the MASH repromesh, which follows the deforming sphere. I might try connecting an emitter to these particles to emit another particle object. One problem I'm having is if I try to animate the sphere translates and rotates, the particles fling away from the MASH repromesh until the sphere returns to world centre, when they align with the repromesh correctly once again. Is there any way to prevent this please? I've grouped everything under one node and then translated translated and keyed this top node. Please see attached video for reference.

 

Thanks so much and best wishes,

 

Maja

0 Likes

Hi Dino,

 

Thanks for your helpful reply.

I tried the set up nParticles with an initial state from MASH and was pleased to see they follow the MASH repromesh, which follows the deforming sphere. I might try connecting an emitter to these particles to emit another particle object. One problem I'm having is if I try to animate the sphere translates and rotates, the particles fling away from the MASH repromesh until the sphere returns to world centre, when they align with the repromesh correctly once again. Is there any way to prevent this please? I've grouped everything under one node and then translated translated and keyed this top node. Please see attached video for reference.

 

Thanks so much and best wishes,

 

Maja

Message 13 of 15
dinofiguera
in reply to: Anonymous

dinofiguera
Collaborator
Collaborator

Hey Maja,

You are getting some double transformation there. Grouping everything under one node is not always the way to go in Maya.  As a general rule, trying to explain it in a non-technical way, if some object is following already another object, there is no need to group it and move it, if you do, the two different transformations will be added together and your object will get an offset.

So try to leave out from your animated group, all the objects that already move by themselves. 

For example, if the mash points follow your sphere and its deformation, put the reproMesh out of the group.

If your soft body particles follow your geometry, leave the particle object out of the group.

The non-linear deformers like the squash, need to be added to the group because they need to follow your sphere.
Try to change your hierarchy keeping this in mind...

Cheers

Hey Maja,

You are getting some double transformation there. Grouping everything under one node is not always the way to go in Maya.  As a general rule, trying to explain it in a non-technical way, if some object is following already another object, there is no need to group it and move it, if you do, the two different transformations will be added together and your object will get an offset.

So try to leave out from your animated group, all the objects that already move by themselves. 

For example, if the mash points follow your sphere and its deformation, put the reproMesh out of the group.

If your soft body particles follow your geometry, leave the particle object out of the group.

The non-linear deformers like the squash, need to be added to the group because they need to follow your sphere.
Try to change your hierarchy keeping this in mind...

Cheers

Message 14 of 15

maja.divjakW2VMQ
Advocate
Advocate

Hi Dino,

 

Yes, I thought this was what might be going on and I did try moving the repromesh and nParticle with inital state from MASH nodes out from under the animated hierarchy. This definitely improved things, however, the particles still don't exactly follow the repromesh as the sphere moves through space. I think I will just stick with the mesh from points repromesh as it is working nicely and does the job cleanly.

Thanks so much for all your wonderful help, you've been amazing.

 

Best wishes,

 

Maja

 

Oh, btw, is it possible to also accept your post as a solution to this problem?

Hi Dino,

 

Yes, I thought this was what might be going on and I did try moving the repromesh and nParticle with inital state from MASH nodes out from under the animated hierarchy. This definitely improved things, however, the particles still don't exactly follow the repromesh as the sphere moves through space. I think I will just stick with the mesh from points repromesh as it is working nicely and does the job cleanly.

Thanks so much for all your wonderful help, you've been amazing.

 

Best wishes,

 

Maja

 

Oh, btw, is it possible to also accept your post as a solution to this problem?

Message 15 of 15

maja.divjakW2VMQ
Advocate
Advocate

Hi Dino,

 

Hope you're well!

I'm almost ready to render my scene and I have a question re caching this type of MASH set up. I presume you you create an alembic cache, but I'm not sure if you include the MASH repromesh node AND the meshFromPoints node or just the repromesh by itself?  I tried caching with both repromesh and meshFromPoints selected and found the cache was about 14GB after only 30 or so frames! I decided to abort at this stage.

 

Would be very grateful for your insight!

 

Thanks so much and best wishes,

 

Maja

0 Likes

Hi Dino,

 

Hope you're well!

I'm almost ready to render my scene and I have a question re caching this type of MASH set up. I presume you you create an alembic cache, but I'm not sure if you include the MASH repromesh node AND the meshFromPoints node or just the repromesh by itself?  I tried caching with both repromesh and meshFromPoints selected and found the cache was about 14GB after only 30 or so frames! I decided to abort at this stage.

 

Would be very grateful for your insight!

 

Thanks so much and best wishes,

 

Maja

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

Post to forums  

Autodesk Design & Make Report