Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Can I attach particeattachment in script?
#9
Quote:You can just pick the particles with a position.Y value largest than the rest, or larger than a specific threshold. Then you can create the group programmatically, using the indices of these particles.

kind regards



Hello. Thank you for good explanation. I checked all particles in any specific skirt asset obi skinnedcloth blueprint we have. I got the particle positions as array then arranged them by y position so I can get the hightest particles's position at first  and I realized, positions of the particles in the skirt asset are different even if they look like they are located in same y position, so I checked the skirt mesh and realized, waistline's vertices in the skirt mesh are located in all different height with tiny gap. In this situation, I think in obi skinned cloth blueprint generation process, particles are created in same height if the cloth asset's mesh's vertices are located in same height or mesh's triangles are located in same height. Is this right?

And I succeeded making a partical group adding specific particles into the particle group in script, but everytime I try to check the blueprint by clicking "Edit" button, UI of the inspector is messed! Please check a screenshot below. Did i something wrong?
   

this is my code to create a particle group and add specific indices's particles into the particle group


Code:
clothBlueprint.ClearParticleGroups();
Code:
     
Code:
        if (!clothBlueprint.groups.Find(x => x.name == "waist"))
Code:
        {
Code:
       
Code:
            _waistIndices.AddRange(_editedDemin.positions.Select((b, i) => b.y >= 1 ? i : -1).Where(i => i != -1).ToArray());
Code:
            clothBlueprint.InsertNewParticleGroup("waist", 0);
Code:
            clothBlueprint.groups[0].particleIndices.AddRange(_waistIndices);
Code:
         
Code:
        }
Reply


Messages In This Thread
RE: Can I attach particeattachment in script? - by gahyun11 - Yesterday, 03:03 AM