I was wondering if anyone has a good technique for using dupliverts for modling caviar or grapes, or something similar. I’m looking for a way to do this but keep them from intersecting and causing ugly geometry. Any thoughts? It would be very cumbersome to model by hand 1000s of caviar.
It’s probably possible to create a python script which would keep a uniform distance between verts… Though I’m not sure how exactly to do that… Just a thought
This is a shame we don’t have a way to do this. It would make making objects like rocks, caviar, Jello, etc. Has anyone tried to make these kind of things?
One way would be to start with a simplified emitter that you could check for distance, then use an array modifier to duplicate this emitter - make it follow the pattern you want with the object assignment to an empty, then go about making your array real and then you will be able to use the dupliverts across the complex mesh. Proportional edit to manipulate the verts of the complex mesh, and that could come up with an interesting result. You could then use a texture for displacement like a flag of beads, or just use the wave modifier.:eyebrowlift2:
Edit : Do what BeBraw says below, he’s got more experience than me. I might have a go at it as well.
Basically you want to generate a point cloud for example in following way:
It is presumed that start location is already known. Start situation has one vertex in place (at start location).
Attributes given:
- startLoc
- dist (distance between vertices)
- amountOfPointsLocal variables:
- pointsFound
- points (contains vertices)
- vector
- (noPointFound (optional part which keeps sure loop is breaked at some point. More information below.))Returns point cloud.
Pseudocode:
- Generate vector that is pointing at random direction.
- Pick point using dist and vector.
- Check distance to previously added vertices. If distance to all previously added vertices is bigger than dist, add vertex to point cloud.
- if amountOfPoints == pointsFound: break loop (This could be on loop declaration on code level.)
- Back to 1. (Implicit. Not really needed on code level.)This is a naive and simple method. It might be a good idea to add a check for amount of loops in which point was not added (reset at add) and use it to break the loop in case it goes on too long. There might be some cases in which this might be possible.
The results of this approach are somewhat random. One way to further enhance the idea would be to use concept of domain (could be a mesh object) in which the point cloud would be created. This would just add an additional check to the script.
Give it a go.
This looks like it’s worth pursuing. I’ll have to learn Blender’s Python API since I’ve unfamiliar (C/C++ and Java are my expertise vs Python.)
Hi!
I have applied duplivert on a mesh created by the fluid simulator. You can pour caviar using this method !
Not sure what you mean but I had considered making some kind of softbody collision simulation then bake but it’s a long process.
roubal means that he ran a fluid simulation, (you can set an object to act as fluid, then use a one frame bake I guess).
The fluid simulator uses implicit surfaces (voxels I believe, or maybe level sets?).
This surface is sampled to create a mesh (probably marching cubes algorithm, again, I don’t know for sure). This produces a regularly sampled mesh (close anyways).
I guess that might work.
grapes are more complex than that though and would need quite some tweaking to look good with most methods.
sorry, don’t have anything of my own to add.
You can use the physics engine for this. Ok, with thousands of objects this will not be very fast.
Just model the object, make it an actor with the mesh as bounding box, duplicate it, position it around or above the position the objects should lie, switch on IPO recording and start playing until the objects settle. Use that frame for further work.
When positioning, the objects can even intersect.
I wish you could forcefield a duplivert object to keep them from touching. I’m going to try the softbody idea you mention and see.
masterhoshi: Did you try the script idea?
Not yet, not something I can do quickly.
i see an issue with the pseudocode, in that you don’t change the starting location of the vector…and it is not closed-ended and may run forever. As is, I think it would produce something like an Icosphere. Caviar and Grapes and Bubbles are arranged differently. Caviar and Bubbles are a gloop, which I think Roubal’s approach would be best, or use the GE to drop them into a gloop-shaped container.
Grapes have a few more functions that would have to be pseudocoded; first some are older and bigger toward the top of the bunch, and then smaller toward the bottom (younger). So the bunch overall forms a V shape. They also grow along a vine, so the vector has to travel linearly, while shortening and spinning around the Z axis.
i see an issue with the pseudocode, in that you don’t change the starting location of the vector…and it is not closed-ended and may run forever.
Whoops. It was kind of implicit to expect that the vector would be generated from the location of currently active point.
There’s not much point otherwise. The vector just makes it sure that distance to generated points is enough. It takes like five minutes to write a script like that anyway…
I’m going to try the physics approach. You are right, caviar is a ‘gloop’ of objects.