Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can Ropes be Frozen at Runtime
#1
Hi, I really like the idea of Obi Rope and its versatile uses, I'm after a nice and easy to use rope generation system to create electrical wires in a house coming from various appliances and connecting into wall power outlets and splitter boxes, I don't need the wires to be dynamic at runtime, only static as they don't need to move. Can wires in Obi Rope be set to static so they don't run under physics at runtime but instead have their current physical position baked to save processer hit.
Reply
#2
(16-10-2020, 09:29 AM)RichardM73 Wrote: Hi, I really like the idea of Obi Rope and its versatile uses, I'm after a nice and easy to use rope generation system to create electrical wires in a house coming from various appliances and connecting into wall power outlets and splitter boxes, I don't need the wires to be dynamic at runtime, only static as they don't need to move. Can wires in Obi Rope be set to static so they don't run under physics at runtime but instead have their current physical position baked to save processer hit.

Hi there!

You can either disable the ObiRope component (which will stop simulation, but not rendering), or you can bake a mesh out of them at runtime, and use the mesh instead of the rope.
The first option is easier but will still consume memory and have a slight performance impact. The second one gets rid of the simulation entirely.
Reply
#3
(16-10-2020, 09:40 AM)josemendez Wrote: Hi there!

You can either disable the ObiRope component (which will stop simulation, but not rendering), or you can bake a mesh out of them at runtime, and use the mesh instead of the rope.
The first option is easier but will still consume memory and have a slight performance impact. The second one gets rid of the simulation entirely.
Hi, Thanks for getting back to me quickly, good news on the baking meshes at runtime, is this a feature that works out of the box or would extra scripting be required at our end, also is the mesh detail fixed or can we adjust it for low poly applications?
Reply
#4
(16-10-2020, 10:00 AM)RichardM73 Wrote: Hi, Thanks for getting back to me quickly, good news on the baking meshes at runtime, is this a feature that works out of the box or would extra scripting be required at our end, also is the mesh detail fixed or can we adjust it for low poly applications?

There's several rope renderer components available, the default one (ObiExtrudedRopeRenderer) has a BakeMesh() function (there's a button exposed in the inspector) that saves the current mesh as an asset in your project at edit time.

If doing this at runtime, Unity already lets you create an instance of a mesh using Instantiate() function, so all you'd need to do is instantiate the renderer's mesh and use it in a MeshRenderer component. So yes, you'd need to extra scripting, but it's minimal.

Rope mesh detail can be completely adjusted: the shape extruded along the rope path can be customized, you can adjust the amount of subdivisions along the rope length. You can even tell the rope to dynamically adjust mesh resolution based on local curvature (this feature is called decimation: http://blog.virtualmethodstudio.com/2020...ecimation/). There's more info about all this in the manual:
http://obi.virtualmethodstudio.com/tutor...modes.html
http://obi.virtualmethodstudio.com/tutor...setup.html
Reply
#5
(16-10-2020, 09:40 AM)josemendez Wrote: You can either disable the ObiRope component (which will stop simulation, but not rendering), or you can bake a mesh out of them at runtime, and use the mesh instead of the rope.
The first option is easier but will still consume memory and have a slight performance impact. The second one gets rid of the simulation entirely.

What about the case when I still need to track the particles positions while moving disabled ObiRope component and moving it with the attachments? Is there a way just to disable the obi rope simulation without disabling the component? I tried to toggle off all the constraints in the Solver but it didn't work
Reply
#6
(19-01-2022, 10:49 AM)Romahaaa Wrote: What about the case when I still need to track the particles positions while moving disabled ObiRope component and moving it with the attachments? Is there a way just to disable the obi rope simulation without disabling the component? I tried to toggle off all the constraints in the Solver but it didn't work

When disabling the rope, all its particles and constraints are taken out of the solver. So if you disable the component, there's no longer any particles in there for you to track. However, the mesh used for rendering will still be there and can be transformed as usual which might be enough for your purpose, so it depends on what you need to do.

Another option is to just set all particle's inverse mass to zero. This makes the particle have infinite mass, freezing it in place. This is usually used to manually override particle positions, and is what static attachments do (set the inverse mass to zero, then set the particle position). Note you won't save any performance by doing this, frozen particles are kept in memory and considered during constraint evaluation.

http://obi.virtualmethodstudio.com/manua...icles.html

Quote:Inverse mass: Inverse mass for each particle. An inverse mass of 0 means the particle's mass is infinite, so its position will be unaffected by dynamics (allowing you to override it manually).
Reply