Hi there,
Is there a way to delete particles from a prt loader by volume selecting them? If not, is there a way to delete by selection or age?
Cheers
Hi there,
Is there a way to delete particles from a prt loader by volume selecting them? If not, is there a way to delete by selection or age?
Cheers
Add a Krakatoa Delete Modifier. Use a magmamodofier or volume select to select the particles.
The PRT Loader itself has a build in “Culling by Volume”. You can create one or more geometry objects, make a Selection Set, and pick the Selection Set in the Culling part of the UI, with options to cull inside or outside, steal Normals from the surfaces etc.
thinkboxsoftware.com/krak-particle-culling/
That being said, what Oatz said is also valid and much more flexible. You can set the Selection channel of the particles using Magma using ANY logic and perform both hard and soft selection, then delete the particles using a Krakatoa Delete modifier. If you want to delete by age, all you need to do is compare the Age to LifeSpan or a hard-coded threshold and a Greater operator. Then connect the output of the Greater operator to the Selection channel and drop a Krakatoa Delete modifier on top of the stack.
Note that the Age channel in Krakatoa v2.3 is a Floating point number in seconds, while in older versions of Krakatoa it was in Integer Ticks (4800 per second). So your threshold value in the second input of the Greater operator must match that type - Float in v2.3, Integer in 2.1 and earlier.
Thanks again for your great support!
Cheers,
Hi Bobo,
I’ve used culling by volume and it worked great… maybe you can think on adding soft selection to it for future version
Cheers!
I’ve used culling by volume and it worked great… maybe you can think on adding soft selection to it for future version
Won’t happen.
What could happen is Culling going away for good.
We added the Culling in Krakatoa MX 1.0 and once Magma was added in v1.5, it felt redundant and limiting.
But we left it for compatibility and because some users are intimidated by Magma.
But we really don’t like it and it has been on the chopping block for a while…
Hi, I need delete particles by animated object. I use inVolume to select and delete it, but it works only when particles inside object.
Is there any possibility mark particles intersected object and delete it And when object change position this particles stay deleted?
Hi, I need delete particles by animated object. I use inVolume to select and delete it, but it works only when particles inside object.
Is there any possibility mark particles intersected object and delete it And when object change position this particles stay deleted?
The History-Independent nature of Magma makes this non-trivial.
I know exactly how it would work, unfortunately a safety feature of the Krakatoa Renderer prevents that approach from working in the current version. Basically the renderer refuses to write over a sequence that is being used as input by a PRT Loader. The same approach works great in XMesh already
I had logged a wish for an option to allow recursive saving over an existing PRT sequence back in 2012, but somehow it never got implemented under the hood. The corresponding property is actually part of the current build, it is just not hooked up internally
I am going to talk to the current developers tomorrow and see if we can finally add this in the next build.
A solution could probably be scripted using the MAXScript interfaces exposed by Krakatoa, however I don’t consider that a trivial solution either, and it would be a lot slower, too.
OK, 30 seconds after posting my reply, I found a way to work around that limitation!
However, you must understand that
Here is how you can do it, in a very simple example:
Create a Plane or any other geometry
Create a PRT Surface or PRT Volume from the geometry
Open the Krakatoa UI and set it to “Save Particles To File Sequence”, set an output filename and select the channels you want to save.
Set the Render Setup dialog to the frame range you want to save
Save the PRT sequence - each frame will contain the SAME particles.
Create a sub-folder where you saved your particles, and copy the PRT sequence into it as a BACKUP so you don’t have to save it again.
Create a PRT Loader and select the saved sequence to load, then hide the original PRT Surface or Volume.
Set the PRT Loader to Frame Offset -1 (on frame 0 it will load frame -1, on frame 1 it will load 0, etc.)
Enable “Limit To Custom Range” and make sure it is set to the range of the PRT sequence by clicking the “Range” button.
Animate some geometry to use as the selection volume, for example some sphere moving through the point cloud
Add a Magma to the PRT Loader object and set Selection channel using InVolume, picking the animated volume as the InputGeometry.
Add a Krakatoa Delete modifier to the stack - the particles inside the volume will be deleted on the current frame only.
Now create a PRT Source object (from the Create>Geometry>Krakatoa category in the Command Panel)
Pick the PRT Loader as the source object - the PRT Source will duplicate the PRT Loader’s particles!
Align the PRT Source to the PRT Loader (the [>] menu in the PRT Source even has an option for that).
In the Krakatoa UI, uncheck all sources for saving except for PRT Source. This will make sure neither the PRT Loader nor the PRT Surface will be saved, only the PRT Source.
Resave to the SAME sequence using the same range.
As result,
This could be expanded of course further by saving the Selection channel to disk, and not deleting anything.This way, the Selection could be accumulated over time, even as a soft-selection, and then the deletion could be done on the resulting sequence.
In the following example, I used a Switch controlled by the InVolume to increase the Selection by 1.0 when inside, and decrease by 0.05 when outside, then Clamp between 0.0 and 1.0. The Krakatoa Delete was set to Soft Selection. I also generated an ID channel from the Index channel of the PRT Surface when I saved my base sequence to produce a consistent deletion pattern.
Once the sequence was saved with Selection channel, I even tweaked the falloff by setting Selection to Selection to the power of 0.5:
Now if you want to do the same with an animated particle sequence, you would have to go through Particle Flow and use its history dependent simulation capabilities, combined with Krakatoa PRT Birth/Update, and possibly the Krakatoa Geometry Test.
Thanks Bobo, I understand that I need use PF for it )))