Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  The skin backstop changes made through the script are not reflected on the screen.
#1
Hello,
I changed the skin backstop value in the blueprint to -0.05 and then back to 0 after 3 seconds.

After running the script, I checked with blueprint edit and the value has changed, but it is not reflected on the screen.
Do I need to run the updater separately?

Code:
        var skinnedCloth = clothInstance.GetComponent<ObiSkinnedCloth>();
        var constraints = skinnedCloth.GetConstraintsByType(Oni.ConstraintType.Skin)
            as ObiConstraints<ObiSkinConstraintsBatch>;
        var skinBatch = constraints.batches[0];
        for (var i = 0; i < skinBatch.activeConstraintCount; ++i)
        {
            skinBatch.skinRadiiBackstop[i * 3 + 2] = -0.05f; // backstop sphere distance
        }
        await Task.Delay(3000);
        for (var i = 0; i < skinBatch.activeConstraintCount; ++i)
        {
            skinBatch.skinRadiiBackstop[i * 3 + 2] = 0;    // backstop sphere distance
        }
Reply
#2
Hi,

You're changing the blueprint, this will only affect actors that instantiate that blueprint's data from that point on. It will not affect actors that have already been instantiated into a solver. For details on how Obi's architecture works, see:
http://obi.virtualmethodstudio.com/manua...cture.html

Quote:Whenever a new actor is added to a solver, these steps take place:

[...]The actor makes a copy of all constraints found in the blueprint, and updates their particle references so that they point to the correct solver array positions.[...]

If you want the changes made to constraints to affect an already existing actor, you must modify the solver's constraints directly. See the manual for details and sample code:
http://obi.virtualmethodstudio.com/manua...aints.html

kind regards,
Reply