Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Managing dynamic constraints
#5
(02-02-2026, 01:34 PM)josemendez Wrote: What is it exactly that you're to trying to do? I assume it's some kind of pin constraint/stitch constraint creation at runtime? could you give a few more details so I can recommend the best approach to it in Obi 7?

Overal I tried to create custom component to manage some constraints, pin or maybe stitch in different way. For example component that does exactly the same thing as pin/attachment constraint, but I can define and modify pinned position and orientation for each particle.

However:

(02-02-2026, 01:34 PM)josemendez Wrote: Unity may call OnDestroy, OnEnable or OnDisable() at any time. Removing an actor doesn't really touch any memory that threads read/write from during simulation, so removing an actor has no ill effect: it just pushes the indices of particles belonging to the actor to a free list so that they can be reused by actors added afterwards (adding an actor to the solver is a buffered operation, guaranteed to not happen during simulation).

This is true for actors, but I am not sure it is for stitch constraint. I didn't do deep dive into whole pathway of calls from solver, but unloading actor triggers dispose of arrays mentioned before, but you said that stitch constraint has no actor copy, and those arrays are pushed directly into batch, so for example when component is disabled during simulation it throws exception, because data used directly in simulation is disposed. And this is not coming from my component, but the original stitcher itself, you can see stack trace here.

I try to write my code inspired on existing Obi components, but this component simply does not work properly and I am not sure what to do.

Thank you for the reply, have a great day!
Reply


Messages In This Thread
Managing dynamic constraints - by Qriva0 - 23-12-2025, 10:40 AM
RE: Managing dynamic constraints - by josemendez - 09-01-2026, 09:54 AM
RE: Managing dynamic constraints - by Qriva0 - 02-02-2026, 11:56 AM
RE: Managing dynamic constraints - by josemendez - 02-02-2026, 01:34 PM
RE: Managing dynamic constraints - by Qriva0 - 03-02-2026, 11:40 AM