Replace Shape Geometry
#1
Hi. I stuck with a Problem.
I want to replace low res particle geometry shapes with hires geometry without changing the simulation.
To do so, I am using Birth Flow an Flow Update and replace the shapes in the Shape Operator. But the distribution of the shapes is not the same.
Do I miss something or is there another way to replace geometry without changing the simulation?
  Reply
#2
The Shape operator has settings (at the bottom) to define which index in the list should be used for each particle. You can use that setting to specifically control which shape will be assigned to which particle.
  Reply
#3
Hey Tyson. Thanks for your answer.

I´ve tried to store the Shape ID and use it in the Birth Flow shape operator. It didn´t work. Shape distribution was not the same.
Figured out that there is an "off by 1" bug.

With this script it is working.

public void simulationStep()
{    
    

    for (int i = 0; i < eventParticleCount; i++) //this for-loop iterates through all particles in this event                
    {
        int sInx = tf.GetSimIndex(i); //for each event particle, we fetch its simulation index
        var shapeID = tf.GetCustomFloat(sInx, "shape");
        shapeID = shapeID +1;
        tf.SetCustomFloat(sInx, "shape",shapeID);
    }    
    

Is there a way to store the Shape ID in TyCache and use it later with BirthFlow?

Thank you.
  Reply
#4
Hi Hamsel,

ShapeID and Shape operator shape-index-from-custom-float are not compatible. ShapeID is a global ID assigned to shapes that has nothing to do with the index of the shape in a particular shape operator.

Currently there is no way to save which index is chosen in a Shape operator to a custom data channel. There is also no way to save custom float values to a tyCache. I will make a note to amend this in the future.
  Reply


Forum Jump: