Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

procedural pattern with MASH and projecting that pattern onto a shape.

procedural pattern with MASH and projecting that pattern onto a shape.

Anonymous
Not applicable
1,639 Views
9 Replies
Message 1 of 10

procedural pattern with MASH and projecting that pattern onto a shape.

Anonymous
Not applicable

Dear people of greater Maya-wisdom.

I am struggling with the creation of a procedural pattern with MASH and projecting that pattern onto a shape.

 

Here is what I like to do:

  1. Creating a grid of cubes with let’s say 4 x 5 elements in x and z direction with the MASH-Distribution note (that is the easy part)
  2. Placing these cubes onto a poly-shape or a bend poly plane by offsetting the cubes only in one direction (for example the y-direction). Maybe rotating the cubes to face to the input mesh

I am aware of the options in the MASH-distribution note where one can place stuff using the face center or vertexes of an input-mesh. But that’s not what I am aiming for. I would like to project any pattern onto something without being dependent of the input mesh topology.

 

Any ideas how that can be done? Thanks in advance.

 

Capture.PNG

0 Likes
Accepted solutions (2)
1,640 Views
9 Replies
Replies (9)
Message 2 of 10

mspeer
Consultant
Consultant

Hi!

 

I'm not sure what you mean with projecting.

It sounds like you want individual MASH "objects/instances" to move in one direction until they got blocked by an other object.

 

Do do this use the MASH Dynamics Node (since Maya 2018) or Bake MASH Instances to objects and use any Maya Dynamics node you want.

 

An other approach would be to use a second Mesh with "special" topology for distribution and wrap this onto your input mesh, this way you are not dependent on topology of your input mesh.

0 Likes
Message 3 of 10

joostkonemann
Advocate
Advocate
Accepted solution

You can do this with the Python node. I adjusted a script of Ian Waters (see http://ianwaters.co.uk/wp/uncategorized/mash-python-meshes-part-2-colour-sets/) for this purpose.

 

Steps:

 

  1. Add a python node to your MASH network
  2. Plug the mesh you wish to project on into the distribute inputMesh attribute (you can keep the distribution on grid, just using the connection to find the mesh
  3. Paste the attached python code in the python node.
  4. Adjust the script to project in the correct direction (lines 40 to 42)

 

--
MacBook Pro 13,3 - 2.7GHz - 16GB - Radeon Pro 460 - macOS Catalina 10.15
Message 4 of 10

mspeer
Consultant
Consultant

Hi!

 

Scripting is of course also a good option (the best here).

The example of @joostkonemann has the big advantage of being fast and you still can work with the MASH network.

0 Likes
Message 5 of 10

Anonymous
Not applicable

Thanks for your reply.

Somehow I cant get it to work. This is the error message that pops up:

Error: AttributeError: file <maya console> line 20: 'module' object has no attribute 'getWaiterFromNode'

 

I suppose this is due to my Maya Version? I am using 2017.

0 Likes
Message 6 of 10

Anonymous
Not applicable

I also can't find a "getWaiterFromNode" method in the mash api docs..

0 Likes
Message 7 of 10

joostkonemann
Advocate
Advocate

I tried this in 2018.1, so I guess it's indeed a version issue... Can you update to 2018?

In my experience 2018 is way more stable, so only for that it's already interesting to update...

--
MacBook Pro 13,3 - 2.7GHz - 16GB - Radeon Pro 460 - macOS Catalina 10.15
Message 8 of 10

Anonymous
Not applicable

I can update. I have tried not to though. My experience with stability and errors was actually the opposite to your experience. I saw a colleague working with 2018 and switch to back to 2017 because of weird stuff going on when trying to model with the newer version. That scared me of.

0 Likes
Message 9 of 10

mspeer
Consultant
Consultant
Accepted solution

Hi!

 

To make it work in Maya 2017 just disable the waiter-line and insert your MASH name manual.

(I just marked the waiter-line as comment instead of removing it and then entered as MASH name "MASH1"):

 

# waiter = mapi.getWaiterFromNode(thisNode)
network = mapi.Network("MASH1")

 

 

Message 10 of 10

Anonymous
Not applicable

Thanks. Now it is working like a charm.

0 Likes