Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope Save Load
#5
(21-09-2026, 08:17 AM)mechabit Wrote: Thanks for the reply, it works great.

When is it safe to load saved data?

I've tried setting rope positions using OnBlueprintLoaded event but this only works half the time.
I'm guessing some kind of race condition.

What is the correct time to load saved data?

Depends on what you want to do exactly.

If you want to load data mid-simulation, OnSimulationStart should work. This happens every step right before copying CPU data to the GPU.

If you're looking for loading data *only* once at the start, upon a blueprint being loaded, you have two options:
- instantiate and modify the blueprint itself instead of modifying solver data.
- modify solver data right after the blueprint has been loaded, OnBlueprintLoaded should work reliably for this.

Quote:I've added a flag for blueprint loaded and OnSimulationEnd to wait for 1 simulation step after blueprint load and that seems to work, just wondering if there was a less clunky method.

EDIT: actually it's better but still not 100%

This should also work reliably. Could you be more specific about what's not working? do particle positions not accurately reflect what you're loading?

Note that all data in Obi is expressed in the solver's local space. Also note that velocities may cause the particles to move right after loading positions, if you expect the rope to start out with zero inertia after loading you might want to also set the appropriate entries in solver.velocities to zero.
Reply


Messages In This Thread
Rope Save Load - by mechabit - 20-09-2026, 01:24 PM
RE: Rope Save Load - by Skotty - 20-09-2026, 04:47 PM
RE: Rope Save Load - by josemendez - 21-09-2026, 07:24 AM
RE: Rope Save Load - by mechabit - 21-09-2026, 08:17 AM
RE: Rope Save Load - by josemendez - 21-09-2026, 09:32 AM
RE: Rope Save Load - by Skotty - 22-09-2026, 06:39 AM
RE: Rope Save Load - by mechabit - 21-09-2026, 01:09 PM
RE: Rope Save Load - by josemendez - 21-09-2026, 04:11 PM
RE: Rope Save Load - by mechabit - 21-09-2026, 05:35 PM
RE: Rope Save Load - by mechabit - 22-09-2026, 07:11 AM
RE: Rope Save Load - by josemendez - 22-09-2026, 07:36 AM