Search Forums

(Advanced Search)

Latest Threads
Collisions don't work con...
Forum: Obi Rope
Last Post: goldfire
56 minutes ago
» Replies: 2
» Views: 15
Force Zone apply differen...
Forum: Obi Rope
Last Post: chenji
5 hours ago
» Replies: 11
» Views: 348
Can I blend in and out of...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 04:42 PM
» Replies: 3
» Views: 140
Using a rigidbody/collide...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 09:29 AM
» Replies: 1
» Views: 60
Solver is too performance...
Forum: Obi Rope
Last Post: quent_1982
20-06-2025, 08:09 AM
» Replies: 40
» Views: 3,283
Obi 7 Model Scaling
Forum: Obi Cloth
Last Post: alkis
19-06-2025, 02:37 PM
» Replies: 2
» Views: 206
Obi Softbody instability?
Forum: Obi Softbody
Last Post: Aroosh
18-06-2025, 06:35 PM
» Replies: 0
» Views: 102
Tear Rod
Forum: Obi Rope
Last Post: chenji
18-06-2025, 08:34 AM
» Replies: 2
» Views: 168
Pipeline that bends
Forum: Obi Softbody
Last Post: josemendez
17-06-2025, 02:07 PM
» Replies: 11
» Views: 495
Memory Leaks?
Forum: General
Last Post: josemendez
16-06-2025, 08:45 PM
» Replies: 3
» Views: 286

 
  Help for fluid 7.0 beta demo scene
Posted by: khos85 - 09-06-2024, 03:01 PM - Forum: Obi Fluid - Replies (1)

Hi, in the obi fluid 7.0 beta which I'm playing around with, I do not find this scene:
[Image: upload_2024-5-12_15-19-8-png.1413672]
Would it be possible to share that, I would like to understand how the water/foam is achieved so nicely. Thanks!

Print this item

  Softbody vehicle with many meshes
Posted by: protomor - 08-06-2024, 07:15 AM - Forum: Obi Softbody - Replies (3)

Howdy! I'm aiming to do BeamNG like crash damage and come to the conclusion that the Obi Softbody for Unity is the best option for that kind of deformation. The cars come in FBX files with multiple meshes under it. Is there a way to programatically load all of them in one go or some guidance on how to create all of this at runtime? Ideally, the meshes will deform and things like doors will come off. It might be simpler to create primative objects that bind to the overall meshes. Any guidance is appreciated.

Print this item

  Rope connected 3d object and its weight
Posted by: kripa1415 - 07-06-2024, 09:51 AM - Forum: Obi Rope - Replies (7)

Hi,
 I have a shape with rigidboy attached to it. Rope is holding this shape. You can see the rope is stretching and pulling the shape all over the place. How to avoid the stretchiness and keep the shape stable ?
https://drive.google.com/file/d/1fLpU5D_...sp=sharing

I want something like in cut the rope
https://www.youtube.com/shorts/1kEYuIemwzo

Print this item

  Rope Cut not working
Posted by: kripa1415 - 07-06-2024, 08:04 AM - Forum: Obi Rope - Replies (5)

Hi,
 I've attached video reference here of what happened while trying to cut the rope.
 I've used RopeSweepCut. Its working in the sample scene. But If I use the same script for my Rope which is created dynamically at runtime, it not working.
 When I swipe to cut, I can see the line renderer and on release, there's a shake happening in rope but its not actually cutting the rope.
 I added log inside the below function. Log printed as expected but cut doesn't work

https://drive.google.com/file/d/1EqPp-hm...sp=sharing

Code:
private void ScreenSpaceCut(Vector2 lineStart, Vector2 lineEnd)
{
    // keep track of whether the rope was cut or not.
    bool cut = false;

    // iterate over all elements and test them for intersection with the line:
    for (int i = 0; i < rope.elements.Count; ++i)
    {
        // project the both ends of the element to screen space.
        Vector3 screenPos1 = cam.WorldToScreenPoint(rope.solver.positions[rope.elements[i].particle1]);
        Vector3 screenPos2 = cam.WorldToScreenPoint(rope.solver.positions[rope.elements[i].particle2]);

        // test if there's an intersection:
        if (SegmentSegmentIntersection(screenPos1, screenPos2, lineStart, lineEnd, out float r, out float s))
        {
            cut = true;
            rope.Tear(rope.elements[i]);
            Debug.Log("cut");
        }
    }

    // If the rope was cut at any point, rebuilt constraints:
    if (cut) rope.RebuildConstraintsFromElements();
}

Print this item

  Cannot generate a blueprint asset for a mesh
Posted by: Gustorvo - 06-06-2024, 09:54 PM - Forum: Obi Softbody - Replies (2)

When trying to generate a blueprint on any mesh (read/write checkbox is enabled in import settings) I always get an Null ref error:
NullReferenceException: Object reference not set to an instance of an object
Obi.ObiActorBlueprintEditor.Refresh () (at Assets/Obi/Editor/Common/Blueprints/ObiActorBlueprintEditor.cs:416)
Obi.ObiActorBlueprintEditor.Generate () (at Assets/Obi/Editor/Common/Blueprints/ObiActorBlueprintEditor.cs:143)


Unity 2022.3.29f
Obi Softbody 6.5.4

Print this item

  Obi Fluid 7.0rc - fluids rendering as pink
Posted by: Amael - 06-06-2024, 07:54 PM - Forum: Obi Fluid - Replies (2)

I'm using Unity 2022.3.32f1, a new empty 3D project (built-in render pipeline) and the Obi Fluid 7.0rc Unity Package. Everything seems to be set up and working correctly (Burst compiler etc.) but all of the fluids in the sample scenes are pink:

   


I've had a look through the components & project resources but can't see anything that's obviously wrong?

   

Does anyone have any idea as to what's causing this? Thanks.

Print this item

  Obi Fluid 6.5.4 installation issues
Posted by: Amael - 06-06-2024, 01:08 PM - Forum: Obi Fluid - Replies (2)

I'm using Unity 2022.3.32f1 and a new empty 3D project (built-in render pipeline). I import Obi Fluid 6.5.4 using the project manager and get the following update warnings:

   

I have to choose 'yes' to stop this warning being shown repeatedly.

At this stage, Obi Fluid and the sample scenes seem to work ok, however Force Zones do not work (e.g. in the 'SimpleFluid' demo scene).

If I select a gameobject with an Obi Solver component, I can see the "The Burst backend depends on the following packages: " warning. I install the Mathematics, Collections and Jobs packages (using 'Add packages by git URL...' for com.unity.jobs) - Burst seems to already be in the package list:

   

Upon adding the Collections package, I get the following persistent error and I can't enter play mode anymore:

Code:
Assets/Obi/Scripts/Common/Backends/Burst/DataStructures/NativeMultilevelGrid.cs(74,46): error CS1061: 'UnsafeList<K>' does not contain a definition for 'length' and no accessible extension method 'length' accepting a first argument of type 'UnsafeList<K>' could be found (are you missing a using directive or an assembly reference?)


Are there updated installation instructions or what is the correct sequence for setting up the package properly? Thanks

Print this item

  VR Support - Multiview
Posted by: Yirah - 05-06-2024, 03:32 PM - Forum: Obi Fluid - No Replies

Hi there,

Currently we wanted to make use of obi fluid in our VR application to came to a block when finding/realizing the following:

Does it support VR (Virtual Reality)?

Cloth, Rope and Softbodies support VR. For Obi Fluid, VR is only supported in the built-in pipeline, and it's necessary to use separate cameras for each eye since the renderer does not support single-pass stereo rendering.



Will there be support for this in an URP setup (not the built-in pipeline) with single pass/multiview? We want to simulate non transparent fluids.

Many thanks upfront!
Yirah

Print this item

  Proper way of moving rope end points
Posted by: kripa1415 - 05-06-2024, 02:23 PM - Forum: Obi Rope - Replies (3)

Hi,
 I've added pins on both ends of the rope. I want to know whether I've used the right implementation to move the rope end points. I've created configurable joints on the rope end point node and dragging it using rigidbody MovePosition. I can't use force here as I want the end point knob to move along with my finger. Though I've applied max limit on the knob distance how far player can drag, it still break physics sometimes when I drag fast. Is there any possibility to avoid happening ?


Code:
Vector3 maxDist = otherEnd.transform.position + dir *  Mathf.Clamp(dist, 0, knobDistance);
maxDist.y = -8f;// yPos;
rb.MovePosition(maxDist);


Code:
Transform AttachJoint(Rigidbody rb, Vector3 attachmentPosition)
{
    GameObject go = new GameObject("Attachment Point");
    go.hideFlags = HideFlags.HideInHierarchy;
    go.transform.position = attachmentPosition;

    var newRb = go.AddComponent<Rigidbody>();
    newRb.isKinematic = true;

    var joint = go.AddComponent<ConfigurableJoint>();
    joint.connectedBody = rb;
    joint.configuredInWorldSpace = true;
    joint.xDrive = NewJointDrive(force, damping);
    joint.yDrive = NewJointDrive(force, damping);
    joint.zDrive = NewJointDrive(force, damping);
    joint.slerpDrive = NewJointDrive(force, damping);
    joint.rotationDriveMode = RotationDriveMode.Slerp;

    return go.transform;
}

private JointDrive NewJointDrive(float force, float damping)
{
    JointDrive drive = new JointDrive();
    drive.mode = JointDriveMode.Position;
    drive.positionSpring = force;
    drive.positionDamper = damping;
    drive.maximumForce = Mathf.Infinity;
    return drive;
}

Also, sometimes I see weird behavior after completing cursor.ChangeLength. You can see one or two rope particles at random location still alive in the scene.



Attached Files Thumbnail(s)
                   
Print this item

  Unpin Rope not working
Posted by: kripa1415 - 05-06-2024, 08:27 AM - Forum: Obi Rope - Replies (2)

Hi, 
I've attached pin at both end of the rope. I want to unpin it from one of the ends.
I've tried the below code but nothing seems to be working. Its always pinned even after running the below code.
I've attached reference screenshot of what I am trying to do. 
Created 2 ropes and pinned them on the board. I want to unpin one end of the rope and pull the rope to the other knob using obiropecursor. (ChangeLength function).
Using ObiRopeCursor is the right approach here ?

Code:
var pinConstraints = rope.GetConstraintsByType(Oni.ConstraintType.Pin) as ObiConstraints<ObiPinConstraintsBatch>;
int batches = pinConstraints.batches.Count;
for (int j = 0; j < batches; j++)
{
    int count = pinConstraints.batches[j].constraintCount;
    Debug.Log("count : " + count);
    for (int i = 0; i < count; i++)
    {
        pinConstraints.batches[j].RemoveConstraint(i);
        pinConstraints.batches[j].RemoveFromSolver(null);
    }
    pinConstraints.RemoveBatch(pinConstraints.batches[j]);           
}
pinConstraints.RemoveFromSolver();

To test if cursor changeLength is working I manually disabled one of the pinned gameobject and tried the below code. ChangeLength function is also not working as expected.
Its pulling the rope only to some extent. After that rope got stiff and straightened. Attached screenshot.

Code:
private void Update()
  {
      if (knobDetached)
      {
          cursor.ChangeLength(rope.restLength - 30 * Time.deltaTime);
      }
  }

Note:
If I use ObiParticleAttachment instead of Pin Constraint, cursor changeLength is working as expected

Code:
private void RopeAttachment(ObiRope rope, ObiCollider bodyA, ObiCollider bodyB)
{
    attachment1 = rope.AddComponent<ObiParticleAttachment>();
    attachment1.target = bodyA.transform;
    attachment1.particleGroup = rope.blueprint.groups[0];
    attachment1.attachmentType = ObiParticleAttachment.AttachmentType.Dynamic;

    attachment2 = rope.AddComponent<ObiParticleAttachment>();
    attachment2.target = bodyB.transform;
    attachment2.particleGroup = rope.blueprint.groups[rope.blueprint.groups.Count - 1];
    attachment2.attachmentType = ObiParticleAttachment.AttachmentType.Dynamic;
}



Attached Files Thumbnail(s)
       
Print this item