About Voronoi Fracture and Iterations
Posted: 22 January 2018 07:47 AM   [ Ignore ]  
Total Posts:  28
Joined  2016-10-05

Hi,

I would like to fracture an object using Voronoi fracture and link the weight value to the size of the pieces, so the bigger the piece the bigger the weight.

Is possible to do that with XPresso?

Cheers

Profile
 
 
Posted: 22 January 2018 10:18 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
Total Posts:  5516
Joined  2011-03-03

Hi JVerdugo,

The Dynamic Tag does this calculation already (I assume we talk about object weight, not MoGraph “Weight”), otherwise it wouldn’t work in the way it does. However they move in a vacuum. Two ways to overcome this. To fake the “real world” part, as in air/friction, you need to set a Simulate>Particles>Friction object into the scene. Set to Force. Similar to that is the Aerodynamics option, perhaps more precise.

Scene file:
Friction
https://www.amazon.com/clouddrive/share/YK2sAfhlHTVlHWxo2k5pNfYpKdlD9DLvCIaScZecUMZ
Aerodynamics (the XPresso is just an added element, not required for the Aerodynamics!)
https://www.amazon.com/clouddrive/share/Cueu5c2kYOMka5hBd5uFToZdPdy7Ka9uHpy4nOjznqV

To get the “Weight”, this is what Srek wrote a while ago:
“Dynamics can give you the mass of an object via Xpresso. If you set the world density to 1 this is equal to the volume.
Make sure the geometry is non manifold and closed to get a correct result. Also use moving mesh as dynamics mode.”

In other words, use the Rigid Dynamic Tag and read via a Dynamics Body State Tag the mass for each clone.
It might help to have it played forward one frame to do the calculation, in case all mass is given as zero.
Individual Objects must be enabled, otherwise a summery is given.

That the Rigid Dynamic Tag>>Attribute Manager> Collision> Shape is taken for the calculation should be considered while setting up the scene.
One minute clip exploring it:
https://www.amazon.com/clouddrive/share/U4d6NAnvBONQve0ELwwv1Ei7iZoFpEcLHoMvRrmgqCt

All the best

<updated>

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.

Photography For C4D Artists: 200 Free Tutorials: Texture, Panorama, HDRI, Camera Projection, etc.
https://www.youtube.com/user/DrSassiLA/playlists

Profile
 
 
Posted: 23 January 2018 01:53 AM   [ Ignore ]   [ # 2 ]  
Total Posts:  28
Joined  2016-10-05

Hey Dr.Sassi,

really thanks for the reply. I have not understood what you told me about the XPresso setup, if you don’t mind, Could you explain me a little bit about it?

Cheers!

Profile
 
 
Posted: 23 January 2018 09:53 AM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
Total Posts:  5516
Joined  2011-03-03

You’re welcome, JVerdugo.

The Xpresso set up is based on the idea that every clone has an individual ID normally (there are exceptions!) This object ID [index] is used for the dynamic as well for the weight.

To transfer the weight, you need first to get that data. This is done via Dynamic Tag to the Dynamic Body State, with the out put of the “Mass”.

The Weight Tag is read out by the MoGraph Weight Node (not the Vertex Map Node!)

Both need an Iteration node to go through the clones and here the ID counts, starting with zero and ending with the total number minus 1.

Since the Mass is not normalized, as in max =1, we need to set with a Range Mapper the upper input, to reduce the max to 1 and have so a quick normalization. So we have Weigh values always between 0-1.

To get the max mass, you could estimate the largest bounding box of a clone, note that the mass is expressed in cubic meter, hence my example 100cm*100cm*100cm, which resulted in one cubic meter.
Another way is, to disconnect the iteration and dial through the index of the Dynamic Body State node. Based on set the Collision in the Dynamic tag to All and with a density to one, while the scene played at least for a frame.

This Weight Tag can be then used in an Effector for example.

Xpresso: [screen shot]
https://www.amazon.com/clouddrive/share/796ra6LMdp9WhYRZs1QUnQNOosN1jom1kF864ItngtF

… and example that shows a change in color based on mass.
Scene file
https://www.amazon.com/clouddrive/share/cEAPyLtNo8oQCXzaTRrouHBDh8IbpEXbDDPGFx2xCRw

Please let me know if there is any other question, I’m happy to look into it.

You could go even further and change the mass by just painting it into a weight-map:
Scene file
https://www.amazon.com/clouddrive/share/iJNY5Iuofy7wSThjo96yPXEjsjCYPxdjpmAjZWa4UhH
Which hints the idea, to combine, the volume information and the mass into a weight related idea (which would be wrong if the Fracture is seen a one and the same material, but for art direction we might take advantage of the exaggeration.

All the best

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.

Photography For C4D Artists: 200 Free Tutorials: Texture, Panorama, HDRI, Camera Projection, etc.
https://www.youtube.com/user/DrSassiLA/playlists

Profile
 
 
Posted: 24 January 2018 02:00 AM   [ Ignore ]   [ # 4 ]  
Total Posts:  28
Joined  2016-10-05

Edited because repeated post.

Profile
 
 
Posted: 24 January 2018 03:22 AM   [ Ignore ]   [ # 5 ]  
Total Posts:  28
Joined  2016-10-05

Hi Dr. Sassi,

really thanks for this, it was really helpful.

I don’t really understand why about the 2500 in the upper max.

-The cube used in the cloner object is 100x100x100 / 1 m^3
-The step effector is scaling the bigger cube up to 12,7 times higher. So we got a cube of 12,7*100=1270 / 12,7 m^3

- So, where is the 2500 number comes from?

Cheers!

Profile
 
 
Posted: 24 January 2018 08:44 AM   [ Ignore ]   [ # 6 ]  
Moderator
Avatar
Total Posts:  5516
Joined  2011-03-03

Hi JVerdugo,

The 2500 is roughly the highest value from the scene with a little buffer added so nothing gets clipped. As mentioned, one can calculate the Volume of the largest object or just click through the Node to get an idea.

The Range Mapper “normalizes” the value to 0-100% for the Weight Tag.

12.7x12.7x12.7 = 2048.383. We talk about volumes here. XYZ, if you multiply only with 12.7 it scales only in x for example.

All the best

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.

Photography For C4D Artists: 200 Free Tutorials: Texture, Panorama, HDRI, Camera Projection, etc.
https://www.youtube.com/user/DrSassiLA/playlists

Profile
 
 
Posted: 12 February 2018 01:54 AM   [ Ignore ]   [ # 7 ]  
Total Posts:  28
Joined  2016-10-05

Hey Dr. Sassi,

sorry for taking too much time for reply, was very busy.

I really want to thanks the information provide, very clear. I have worked as well on a system that fakes the weight behavior system without the use of Dynamics.

I attach the file, I have tried to avoid the step in which I have to convert into editable the voronoi, but I have no idea how to. Is possible to avoid this process? (maybe with a python node that internally convert into editable the voronoi, save the data and send the iteration)

Cheers!

File Attachments
Weigth_MographEffectors_XPresso.zip  (File Size: 938KB - Downloads: 52)
Profile
 
 
Posted: 12 February 2018 10:08 AM   [ Ignore ]   [ # 8 ]  
Moderator
Avatar
Total Posts:  5516
Joined  2011-03-03

HI JVerdugo,

The Bounding Box creates, as the name suggest, a box around the objects. Which is kind of a rough idea about the volume of an object, if not a cube or box with no rotation

Two problems with that:
This box can have the same volume with very different sized objects.
While an object rotates, except for perfect spheres, it will change the volume of that bounding box.

.

The Veronoi Fracture works with dynamics in its native state, no need to make it editable.
With that, the data can be created as in the example above. (…_21.c4d)
Note that all objects in a scene are given a unique ID, so adding elements before writing the Weightmap, you need to specify the used MoGraph object to sync the IDs.

Screen shot:
https://www.amazon.com/clouddrive/share/Fy3xENyBhdq4g9UGvv9gcjvqNSsWxcN10cjLD974Sqq

Scene file:
https://www.amazon.com/clouddrive/share/26iJ9ywsrVmXYHWQjZ2o6jOBnCYQypJAu3iw8WCrCNI

Since the shapes are not changing, I would run it for a few frames, then switch the XPresso off, to streamline the process. The Weight stays the same after that.

.

The main question is, what do you really want to do? Since the dynamic calculates already the mass based on volume, I can’t find any reason to feed this information back into the set up.
You can however supply any mass to the chunks via XPresso, perhaps via MoGraph Selection already, or painted by weight.
If you have any target, please share that, so we can focus on a solution for your project. Let me know.

My best wishes

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.

Photography For C4D Artists: 200 Free Tutorials: Texture, Panorama, HDRI, Camera Projection, etc.
https://www.youtube.com/user/DrSassiLA/playlists

Profile
 
 
Posted: 12 February 2018 01:49 PM   [ Ignore ]   [ # 9 ]  
Moderator
Avatar
Total Posts:  5516
Joined  2011-03-03

P.S.: I have had set the mass to 200 in file …_33.c4d above.

Since mass is measured in kilo-gram, and with a mass of one that means 10cmx10cmx10cm (one liter or 1,000 cm^3).
So I looked up the largest chunk (ID =0) and rounded it up to 200.

BTW, have a look at this file, and click on the XPresso Tag>Attribute Manager> User Data. ENJOY.
https://www.amazon.com/clouddrive/share/zl8Mtw2ucMhdmt4Q4RouRLdfpHvSJmEvPzdHCG8a3iX

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.

Photography For C4D Artists: 200 Free Tutorials: Texture, Panorama, HDRI, Camera Projection, etc.
https://www.youtube.com/user/DrSassiLA/playlists

Profile
 
 
Posted: 13 February 2018 08:57 PM   [ Ignore ]   [ # 10 ]  
Moderator
Avatar
Total Posts:  5516
Joined  2011-03-03

Paint the Mass on the clones, set the max mass and done.

Here is a file that lets one set the absolute mass for each “chunk” or clone by just painting a weight value on it.

To see the change, just click on the MoGraph Weight tag’s Invert button.

Scene file:
https://www.amazon.com/clouddrive/share/6qqyl8xbmLDNjXs5R4j3YqXUJhtTTF1EWOFhVOSUYzZ

For everyone who is interested in it, here is a one minute clip:
https://www.amazon.com/clouddrive/share/j1yxFobaMLppnVKbH1Y8W2eLsBOjBESYjq5j0hIs2oG


Enjoy

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.

Photography For C4D Artists: 200 Free Tutorials: Texture, Panorama, HDRI, Camera Projection, etc.
https://www.youtube.com/user/DrSassiLA/playlists

Profile
 
 
Posted: 14 February 2018 03:54 AM   [ Ignore ]   [ # 11 ]  
Total Posts:  28
Joined  2016-10-05

Hello Dr Sassi, thanks!

The main question is, what do you really want to do? Since the dynamic calculates already the mass based on volume, I can’t find any reason to feed this information back into the set up.
You can however supply any mass to the chunks via XPresso, perhaps via MoGraph Selection already, or painted by weight.
If you have any target, please share that, so we can focus on a solution for your project. Let me know.

I was looking to be able to get the weight data based on the volume in order to create a selection weight map. To have the ability to select in a thousand of objects just the little ones is very useful. I see that this system is far better than the Bounding Box system.

I was in a project few weeks ago, I had to simulate a fracture in the space, a lot of tiny pieces and big ones… I had the intention to animate this with Dynamics but at the end, because we have a really small deadline I had to animate it without dynamics. I found myself that I have almost 1000 pieces of different sizes:
- How to select by volume in order to create fast selections?-. This is how I started this research, I really appreciate the help Dr. Sassi, I have learnt a lot.

All the best sir. Cheers!

Profile
 
 
Posted: 14 February 2018 10:01 AM   [ Ignore ]   [ # 12 ]  
Moderator
Avatar
Total Posts:  5516
Joined  2011-03-03

You’re very welcome, JVerdugo, and thanks for the nice feedback.

To separate clones/chunks based on their mass [volume perhaps], one has only to set a value where to split those.

I have set up an XPresso for you. Please have a look.

Scene file/screen shot:
https://www.amazon.com/clouddrive/share/MSCeykZDoLccq2wJMBQksX2RtRLLs2H2C94PFp1QhE8

The Plain Effector is there for the visibility of the results, it is not needed to get results.
Please make certain that the Dynamics Body State has the Fracture Object in the Attribute Manager, otherwise the IDs used are from the whole scene, and that might change everything.

Here is aversion with an easier to adjust split point:
https://www.amazon.com/clouddrive/share/W08NnqMtwWwhuFfK8XEwgZCjjbszD2Gyjrwv8jps65V

My best wishes

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.

Photography For C4D Artists: 200 Free Tutorials: Texture, Panorama, HDRI, Camera Projection, etc.
https://www.youtube.com/user/DrSassiLA/playlists

Profile
 
 
   
 
 
‹‹ Q&A_miscellaneous      Dynamics: Rigid Body ››