Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  particle properties at Runtime
#3
(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];
Reply


Messages In This Thread
particle properties at Runtime - by Nightfall - 26-03-2024, 08:12 AM
RE: particle properties at Runtime - by Nightfall - 28-03-2024, 04:42 AM