Search Forums

(Advanced Search)

Latest Threads
Rope Jittering/ Stutterin...
Forum: Obi Rope
Last Post: Nixon
Yesterday, 06:42 PM
» Replies: 2
» Views: 18
Advection but for a mesh.
Forum: Obi Fluid
Last Post: spikebor
Yesterday, 09:28 AM
» Replies: 0
» Views: 16
Tips for optimization usi...
Forum: Obi Softbody
Last Post: spikebor
Yesterday, 09:14 AM
» Replies: 0
» Views: 11
Obi Fluid 6 not render on...
Forum: Obi Fluid
Last Post: spikebor
02-05-2024, 07:41 PM
» Replies: 3
» Views: 76
Question about garment on...
Forum: Obi Cloth
Last Post: josemendez
02-05-2024, 01:03 PM
» Replies: 21
» Views: 637
Attaching a rope and upda...
Forum: Obi Rope
Last Post: Alexander34
02-05-2024, 12:58 PM
» Replies: 5
» Views: 497
I've made a bounce script...
Forum: Obi Softbody
Last Post: spikebor
01-05-2024, 04:39 PM
» Replies: 3
» Views: 82
Prefab Creation & Cable L...
Forum: Obi Rope
Last Post: josemendez
01-05-2024, 01:12 PM
» Replies: 5
» Views: 101
Error: Particle that does...
Forum: Obi Rope
Last Post: josemendez
01-05-2024, 10:39 AM
» Replies: 1
» Views: 43
Setup Ignore Collisions b...
Forum: Obi Softbody
Last Post: spikebor
30-04-2024, 07:15 PM
» Replies: 4
» Views: 102

 
  Obi Rope sticks to the floor
Posted by: Krzysiek - 08-05-2018, 12:53 PM - Forum: Obi Rope - Replies (1)

Hello,

1) I have 2 objects connected with Obi rope (something like Rocker example scene). When both objects fall on the floor sometimes rope sticks to the floor (screenshot attached). How to avoid that issue?

2) Since I'm using Obi Rope in VR user may move controller under floor (intentionally or not) and the same problem exist. Is there any way to automatically (runtime) position rope over floor surface?


Cheers,
Krzysiek

Print this item

  Just bought asset | Errors on import
Posted by: VirtualCucumber - 08-05-2018, 03:34 AM - Forum: Obi Rope - Replies (5)

https://i.gyazo.com/53c88285de4a7838df5f...bcc868.png

Im sure its a simple fix since its a really small project I imported it to.

EDIT [FIXED]:
My "Editor" folder was interfering with Obi's Editor folder.

Print this item

  Change rope path
Posted by: leonrdo - 04-05-2018, 07:14 PM - Forum: Obi Rope - Replies (5)

I changed the curve of my rope and I see the update in the editor when i click to Initialize. Yet, when I press play, the rope start with the shape of the previous curve and once I stop the simulation the rope restore to the previous curve, even I have no record of the old ObiBezierCurve. Any ideia whats going on?

Print this item

  Pull chain through hoop
Posted by: darkcser - 04-05-2018, 05:06 PM - Forum: Obi Rope - Replies (1)

I'm trying to create a chain that can be pulled through a hoop using Obi Rope. I essentially made a 4 objects with obi colliders on them, and arranged them in a square shape for the hoop. After that I tried to shape a spline for the chain so that it can loop through the hoop. Handles were then created for the ends of the rope. The problem is that if I pull very very gently on the chain it stays and slides through the hoop but if I pull a bit faster it just goes through the hoop, and falls to the ground.

Distance constraints is already set to 1, and distance iterations on the solver is set to 10 with the other constraint iterations set to 2 or 3. Is there some sort of settings that will help to make the collision more solid? 

This is a VR project so I want to allow the user to pull on the chain through the hoop with their hands. 

I've looked at the crane example, and it seems like having a larger collider helps but I need a fairly small hoop, and don't want the chain to "float" around it.

Print this item

  libOni.dll caused an Access Violation
Posted by: darkcser - 04-05-2018, 04:53 PM - Forum: Obi Cloth - Replies (2)

I'm experiencing a crash (Obi Cloth, Obi Rope 3.4, Unity 5.6.3p2). I have two Obi Rope objects with their own solvers and 4 Obi Cloth objects pointing to a single solver. If I enable the two solvers for the rope everything is OK. Similarly if I just enable the solver for the cloth, everything is fine. However if I enable the all 3 solvers, I get a hard crash in Unity. This sometimes happens immediately while at other times it takes a few seconds. 

The log file says "libOni.dll caused an Access Violation (0xc0000005) in module libOni.dll at 0033:c017db05."

The exception from the dmp file says "The thread tried to read from or write to a virtual address for which it does not have the appropriate access" . 

I'm using simulation order: fixed update.


This project uses SteamVR if that matters. I basically have a rope attached to a connector which is attached to a chain which is attached to another connector that is attached to a number of straps (using Obi Cloth). I saw the other thread (http://obi.virtualmethodstudio.com/forum...on#pid1061

Print this item

  Errors when migrating to 2018.1
Posted by: khalvr - 04-05-2018, 10:48 AM - Forum: Obi Rope - Replies (3)

After upgrading my project to 2018.1, i get the following errors:

Menu Component/Physics/Obi/Obi Particle Baker can't be checked because doesn't exist
UnityEngine.GUIUtilityLenguarocessEvent(Int32, IntPtr)

Menu Component/Physics/Obi/Obi Particle Renderer can't be checked because doesn't exist
UnityEngine.GUIUtilityLenguarocessEvent(Int32, IntPtr)


I'm sure they're not specifically related to Obi, but rather to Unity removing or changing certain files in the upgrade process. Still, does anyone have an idea on how to get rid of these?

Print this item

  Make it rain
Posted by: Jaydena - 03-05-2018, 08:20 AM - Forum: Obi Fluid - Replies (2)

Hello,

I'm trying to emit particles over a large-ish area and have them drip out, like rain.

The closest i can get is to make the emitter radius cover the area, but the water comes out in bursts regardless of if it's on burst or stream. I'm looking to get a sporadic drip feed over the area. Is this possible?

Thank you!

Print this item

  Bug/Crash when setting timescale to 0 in lateupdate
Posted by: Corjn - 02-05-2018, 03:02 PM - Forum: Obi Cloth - Replies (3)

"Using Unity 2017.3.0p1
Latest version of Unity
Coding with Bolt"

Hey, I just bought Obi Rope and Obi Cloth, the assets are amazing and i'm really happy with it, but I got my editor crash when pausing my game (I mean, my own game pause, with a menu and everything, where in my code I set timescale to 0)

I made some tests on obi because I was not having the issue before importing it. And I noticed an issue, here is a repro : 

Open let's say the benchmark scene. Put playmode. Go to time settings. Set timescale to 0. All the flags will stop (here, it's working)

Now, redo the same but this time put the obi solver to LateUpdate. The flags won't stop and may even glitch (and in my case with my pause menu, crash)

Note that I need lateUpdate, i'm using obi cloth with a puppetmaster character ragdoll. Also, I actually don't really want to pause the cloth in the pause menu (because seing everything stop expect the character's clothing is so cool) But i would like more control over that, an option that would make obi unscaled or not. 

Thanks in advance for your time, 

Jonathan.

Edit 1: the same happens with obi rope (of course, it's the same code, but I just wanted to make sure)

Edit 2: a quick way to fix it is to put the solver to fixed update before pausing the game, or simply disable the solver for the pause. But as said above, there is no options that would make it unscaled or not.

Print this item

  Exception Code 0xc0000409
Posted by: johnnychang - 02-05-2018, 08:32 AM - Forum: Obi Fluid - Replies (3)

HI,My app has crashed.This application is a fluid, published using Unity3D.

Here is the log from Windows' Event Viewer:
Faulting application name: water.exe, version: 5.6.1.24755, time stamp: 0x5910657a
Faulting module name: libOni.dll, version: 0.0.0.0, time stamp: 0x59a32a1d
Exception code: 0xc0000409
Fault offset: 0x0006b926
Faulting process id: 0x41e8
Faulting application start time: 0x01d3e1bd5ddb1cfe
Faulting application path: C:\Users\Administrator\Desktop\water1645\water.exe
Faulting module path: C:\Users\Administrator\Desktop\water1645\water_Data\Plugins\libOni.dll
Report Id: 35857696-b35c-4a2c-b6b5-b6bfacf2aad0
Faulting package full name:
Faulting package-relative application ID:

Print this item

  WaitForAllTasks randomly uses too much CPU, and performance optimization suggestions
Posted by: Devver - 30-04-2018, 07:54 AM - Forum: Obi Rope - Replies (6)

Hello, I'm developing a VR project using the awesome ObiRope and would like to ask some questions and share a few optimizations suggestions that helped lowering CPU usage on my project.  Sonrisa

The main issue: Oni.WaitForAllTasks() usually uses around 0.6ms of CPU time, but at unpredictable intervals (a few or many seconds) it takes an extra long time for a single frame: sometimes 5ms, sometimes 15ms, or even 20ms.

Here are some images from the profiler, using the bundled sample scene "FreightLift", unchanged. The higher peak is 20ms, the smaller ones are around 10ms. (This wasn't in VR)

[Image: p9x6zji.png]

I used the Profiler.BeginSample function around Oni.WaitForAllTasks to show it easier on the profiler, like this in the ObiArbiter's WaitForAllSolvers method, at line 41:

Code:
UnityEngine.Profiling.Profiler.BeginSample("WaitForAllTasks");
Oni.WaitForAllTasks();
UnityEngine.Profiling.Profiler.EndSample();

Otherwise you can just look at the ObiSolver.FixedUpdate() times in the profiler.


This would be (maybe) acceptable for a desktop application, but in VR tracking is totally lost for some frames each time, at random intervals, making it unbearable.

Even if this couldn't be prevented somehow, it would be great if could at least be run asynchronously or split into more frames when it's taking too long. Even if it could delay rope calculations for a few frames when that happens, it would be way better than entirely freezing the game in VR.

I'm using ObiRope 3.4 with Unity 5.6.3f1 on Windows 10.
This happens using any of the 3 simulation order options on Obi Solver.
The tests above were made using a clean project with just ObiRope imported.


Also, for this project I'm currently using kinematicForParticles as true for everything, making the ropes work just as visuals and they don't physically affect anything for now (no pin constraints, just handles). I'm also using a fixed timestep value that matches the drawing update (both at 90fps), so they're synched, and like that it seems that changing the simulation order doesn't change performance. (PS: None of those changes were made to the clean project above for testing)
Do you have any suggestions to increase performance (any settings or maybe disabling anything unnecessary) for this use case?

Thank you in advance!




Performance optimization suggestions

CPU performance is very important for this VR project, so anything I could optimize helps. Here are a few changes that got me a few milliseconds back. I hope this can help someone. (The numbers below are examples taken from my machine)

1. Anisotropy doesn't seem to be needed for only ropes, but this call below still uses 0.9ms each frame, so I commented it out. This breaks the debug particle render shader, so I'll reenable this if I need to do some debugging, but not on the final build.

Location: ObiSolver.cs, line 557.
Code:
// Oni.GetParticleAnisotropies(oniSolver,anisotropies,anisotropies.Length,0);


2. ObiRopeThickRenderMode's Update will keep recreating the rope's mesh every frame even if it's sleeping, not moving. That's around 1.2ms for 6 short ropes in the "RopeShowcase" scene, and will increase with length, resolution, smoothing and more ropes. I check if the rope has actually moved before allowing it to recalculate the mesh, by changing this at line 32 on the ObiRopeThickRenderMode.cs file, just above "rope.SmoothCurvesFromParticles();":

Code:
private Vector3[] previousPositions = new Vector3[0];

public override void Update(Camera camera){

   if (rope.section == null || rope.ropeMesh == null)
       return;

   // Skip mesh recalculation if rope has not changed.
   bool updateMesh = false;
   if(previousPositions.Length != rope.positions.Length)
   {
       updateMesh = true;
       previousPositions = new Vector3[rope.positions.Length];
   }
   else
   {
       for(int i = 0; i < rope.positions.Length; i++)
       {
           Vector3 newPosition = rope.GetParticlePosition(i);

           if(previousPositions[i] != newPosition)
           {
               previousPositions[i] = newPosition;
               updateMesh = true;
           }
       }
   }

   if(!updateMesh)
       return;

   rope.SmoothCurvesFromParticles();
...


It would be easier to just check if the rope is sleeping, but I couldn't find any exposed method to detect this. Also, this may need some higher damping and sleep threshold values on the Obi Solver object to be effective, or the ropes may take too long to sleep.


3. When using ObiRigidbory and pin constraints, the ropes never let Unity rigidbody objects to get to sleep (they keep slightly moving the objects forever). I don't know if this is a bug, but it will force the engine to keep calculating physics for objects that aren't moving anymore, usually set to sleep until touched again, removing them from unnecessary physical calculations.
Replacing the ObiRigidbody's UpdateVelocities() method with this code can fix that. You may need to tweak those thresholds.

Code:
public override void UpdateVelocities(object sender, EventArgs e){

   // kinematic rigidbodies are passed to Obi with zero velocity, so we must ignore the new velocities calculated by the solver:
   if (Application.isPlaying && (unityRigidbody.isKinematic || !kinematicForParticles)){

       Oni.GetRigidbodyVelocity(oniRigidbody,ref oniVelocities);
       Vector3 newVelocity = oniVelocities.linearVelocity - velocity;
       Vector3 newAngularVelocity = oniVelocities.angularVelocity - angularVelocity;

       bool updateVelocity = false;
       bool updateAngularVelocity = false;
       for(int i = 0; i < 3; i++){
           if(Mathf.Abs(newVelocity[i]) > 0.13f)
               updateVelocity = true;
           if(Mathf.Abs(newAngularVelocity[i]) > 2f)
               updateAngularVelocity = true;
       }

       if(updateVelocity)
           unityRigidbody.velocity += oniVelocities.linearVelocity - velocity;
       if(updateAngularVelocity)
           unityRigidbody.angularVelocity += oniVelocities.angularVelocity - angularVelocity;
   }
}



4. Like some people here, I needed to use ObiColliders with objects with multiple colliders, but that wouldn't work anymore. So I made this ObiCompoundCollider class. You can add it to objects in the editor as usual, or programmatically using the static AddCollider method. You don't need to add it specifically to objects with rigidbodies only; just add it to any gameobject, and it will search for children with colliders. Triggers colliders will be ignored.

Code:
using UnityEngine;
using Obi;

public class ObiCompoundCollider : MonoBehaviour
{
    public ObiCollisionMaterial material;
    public int phase = 0;
    public float thickness = 0;
    public bool useDistanceFields = false;

    void Awake()
    {
        foreach(Collider collider in GetComponentsInChildren<Collider>())
            AddCollider(collider, this);

        Destroy(this);
    }

    public static void AddCollider(Collider collider, ObiCompoundCollider obiCompoundCollider)
    {
        AddCollider(collider,
            obiCompoundCollider.material,
            obiCompoundCollider.phase,
            obiCompoundCollider.thickness,
            obiCompoundCollider.useDistanceFields);
    }

    public static void AddCollider(Collider collider, ObiCollisionMaterial material = null, int phase = 0, float thickness = 0, bool useDistanceFields = false)
    {
        if(collider.isTrigger)
            return;

        ObiCollider obiCollider = collider.GetComponent<ObiCollider>();

        if(obiCollider == null || obiCollider.GetCollider() != collider)
        {
            collider.gameObject.SetActive(false);

            obiCollider = collider.gameObject.AddComponent<ObiCollider>();
            obiCollider.SetCollider(collider);
            obiCollider.CollisionMaterial = material;
            obiCollider.phase = phase;
            obiCollider.thickness = thickness;
            obiCollider.UseDistanceFields = useDistanceFields;

            collider.gameObject.SetActive(true);
        }
    }
}

You need to also edit these files below to make it work.

In ObiCollider.cs:

Change the IsUnityColliderEnabled() method to this:

Code:
protected override bool IsUnityColliderEnabled(){
   Collider collider = ((Collider)unityCollider);
   return collider.enabled && !collider.isTrigger;
}

Change the Awake() method to this:

Code:
protected override void Awake(){

   if (unityCollider == null)
       unityCollider = GetComponent<Collider>();

   if (unityCollider == null)
       return;

   base.Awake();
}

Add these new methods:

Code:
public void SetCollider(Collider collider){
   unityCollider = collider;
}

public Collider GetCollider(){
   return (Collider)unityCollider;
}

In ObiColliderBase.cs, add these variables:

Code:
protected static Transform previousTransform = null;
protected static bool previousHasChanged = false;

And change the UpdateIfNeeded() method like this:

Code:
private void UpdateIfNeeded(object sender, EventArgs e){

   if (unityCollider != null){

       // update the collider:
       bool unityColliderEnabled = IsUnityColliderEnabled();

       if(previousTransform == unityCollider.transform)
           unityCollider.transform.hasChanged = previousHasChanged;

       previousTransform = unityCollider.transform;
       previousHasChanged = unityCollider.transform.hasChanged;

       if (unityCollider.transform.hasChanged ||
           phase != oldPhase ||
           thickness != oldThickness ||
           unityColliderEnabled != wasUnityColliderEnabled){
...


With that, if you want you can also do this once at runtime to add Obi colliders to every static collider in the scene.

Code:
foreach(Collider collider in FindObjectsOfType<Collider>())
{
    if(collider.attachedRigidbody == null)
        ObiCompoundCollider.AddCollider(collider);
}


I hope this helps, and thanks again!

Print this item