25-08-2020, 07:41 AM
(This post was last modified: 25-08-2020, 07:46 AM by josemendez.)
(25-08-2020, 07:09 AM)nexar Wrote: Dear Jose,
Again, thank you very much for your help.
Finally what we decided to do next:
1) We manually made a copy of the original Blueprint ("blueprintCopy").
2) We generated a temporary blueprint ("blendShapeTemporal"), based on the bakedMesh obtained from the mesh with the blensdhapes applied.
3) We only copy the attributes "positions" and "restPositions" from the blueprintTemporal to the blueprintCopy.
Code:for (int i = 0; i < blueprintCopy.particleCount; ++i)
{
blueprintCopy.positions[i] = blueprintTemporal.positions[i];
blueprintCopy.restPositions[i] = blueprintTemporal.restPositions[i];
}
4) we assign the blueprintCopy to the cloth.
Code:vestidoCloth.skinnedClothBlueprint = blueprintCopy;
This way we get a blueprint with the positions of the particles based on the mesh with the blendshapes applied, and keeping the other attributes according to the original blendshape.
With that we get the following result:
Regarding this, we have the following questions:
- Why does the dress not fall in a linear way from the border when the "skin radius" is greater than zero (following the location of the particles defined in the blueprint), but rather falls into the shape of the dress?
- How can we make the dress fall linearly downwards when the "skin radius" is greater than zero, preventing the dress from going inside?
- What is the correct way to copy a blendshape using the Instantiate() method? Could you please give us an example of its use?
- If we only want to change the location of the particles (according to the mesh with the blenshapes applied) and keep the rest of the attributes of the blueprint, is it correct to only copy the "positions" and "restPositions" attributes, or should we copy something else?
Thank you in advance for your help!
PD: Le enviamos por e-mail esta misma consulta en español. Desde ya le agradeceremos su ayuda, pues estamos entrampados con esto.
1) 2) As stated in the manual, simulation is performed in the solver's local space:http://obi.virtualmethodstudio.com/tutorials/obisolver.html This means that if your solver has non-zero rotation, gravity will not point downwards. Either ensure your solver has the intended orientation, or manually pass a custom gravity vector expressed in world space.
3) Blendshapes are not supported. If you meant how to copy a blueprint, Instantiate() is the way to go. This is a generic method in Unity that works with any objects, including scriptable objects such as blueprints.
4) If you want to create a copy of the blueprint, where only particle positions have changed, you need to copy particle positions and rest positions. However make sure that the mesh used for skinning also has its vertices in the same positions, otherwise skin constraints will constrain the particles back into the vicinity of the vertices during simulation, ignoring any initial positions you set.