(26-03-2024, 08:34 AM)josemendez Wrote: Hi!
See: http://obi.virtualmethodstudio.com/manua...aints.html
I was writing code based on a link like below
Code:
var obiSkinnedCloth = assetObject.AddComponent<ObiSkinnedCloth>();
var blueprint = ScriptableObject.CreateInstance<ObiSkinnedClothBlueprint>();
blueprint.inputMesh = meshFilter.mesh;
blueprint.GenerateImmediate();
var actorConstraints = obiSkinnedCloth.GetConstraintsByType(Oni.ConstraintType.Skin)
as ObiConstraints<ObiSkinConstraintsBatch>;
var solverConstraints = obiSkinnedCloth.solver.GetConstraintsByType(Oni.ConstraintType.Skin)
as ObiConstraints<ObiSkinConstraintsBatch>;
var actorSkinBatch = actorConstraints.batches[0];
var solverSkinBatch = solverConstraints.batches[0];
but I encountered a NullReferenceException on the line
How can I fix it?
Code:
var actorSkinBatch = actorConstraints.batches[0];