Search Forums

(Advanced Search)

Latest Threads
ObiRope Mesh Renderer
Forum: Obi Rope
Last Post: quent_1982
Yesterday, 11:27 AM
» Replies: 4
» Views: 76
How to dynamically change...
Forum: Obi Rope
Last Post: quent_1982
Yesterday, 06:34 AM
» Replies: 6
» Views: 190
Pipeline that bends
Forum: Obi Softbody
Last Post: josemendez
04-07-2025, 09:52 AM
» Replies: 13
» Views: 855
How to implement/sync Obi...
Forum: Obi Rope
Last Post: quent_1982
01-07-2025, 01:48 PM
» Replies: 2
» Views: 208
Collisions don't work con...
Forum: Obi Rope
Last Post: chenji
27-06-2025, 03:05 AM
» Replies: 3
» Views: 272
Force Zone apply differen...
Forum: Obi Rope
Last Post: chenji
26-06-2025, 11:41 AM
» Replies: 11
» Views: 793
Can I blend in and out of...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 04:42 PM
» Replies: 3
» Views: 263
Using a rigidbody/collide...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 09:29 AM
» Replies: 1
» Views: 160
Solver is too performance...
Forum: Obi Rope
Last Post: quent_1982
20-06-2025, 08:09 AM
» Replies: 40
» Views: 4,306
Obi 7 Model Scaling
Forum: Obi Cloth
Last Post: alkis
19-06-2025, 02:37 PM
» Replies: 2
» Views: 271

 
  Performance again
Posted by: lacasrac - 22-10-2021, 10:34 AM - Forum: Obi Rope - Replies (1)

In debug mode I get a massive 17 FPS in fullscreen when I use 5 solvers/1 rope/chain with 8 subsets
So basically I have 5 solvers with 3 chains and 2 ropes

Is it normal?

Jobs/Leak detection is off
Burst-> Enable compilation on, Synchronous compilation on, others off
Jobsdebugger off

Any other thing that I can do to increase the FPS?

One more question:

If I have 5 solvers with 1 ropes -> basically 5 ropes with 5 solvers invidiudally that is good or bad for performance?
It will be better 1 solvers with 5 ropes?

Print this item

  Animate physics Lags my other animations
Posted by: jeremy2132 - 20-10-2021, 08:42 PM - Forum: Obi Cloth - Replies (7)

In order to make the cloth simulation not lag behind the animation I need the Update Mode in the animator be set to animate physics. This makes all my character animations choppy and laggy as a result. Is there any that my character animations can be smooth like they are in the normal update mode wiithout making the physics lag one frame behind the animation simulation?

Print this item

  How to give a tension to rope...
Posted by: sangku2000 - 20-10-2021, 03:27 AM - Forum: Obi Rope - Replies (7)

Hi!
I wanna give a rope tense.

No longer give a length to rope

but when i move a rope's X transform, it getting more longger.....

What can i do...?


this is now. no tension, and draw is my expectaition.



Attached Files Thumbnail(s)
       
Print this item

  ObiRope Points
Posted by: Matbee - 19-10-2021, 10:26 AM - Forum: Obi Rope - Replies (36)

Hello everyone, I want to know if my ropes are crossing, for that I want to check the position of the leftmost and rightmost points of my rope, how can I access all the points of my rope? I tried to get them through ObiRopeBlueprints points array, but nothing came of it, it displays the length of 0. Thanks Sonrojado



Attached Files
.png   unknown-1.png (Size: 43.16 KB / Downloads: 60)
Print this item

  Unable to generate blueprint
Posted by: dswigger - 17-10-2021, 12:18 AM - Forum: Obi Cloth - Replies (3)

I am trying to generate a blueprint using the attached fbx mesh.  I have several others from the same model which generate correctly.

For some reason this one makes the generator hang(it never finishes), all the others took just a few seconds.  I let it sit for 40 minutes and it never finished.

Any help would be greatly appreciated.  I looked all over the mesh for weirdness in blender, did cleanups.  Maybe I missed something.  I have been fighting this for hours.

Blender snapshot: https://photos.app.goo.gl/k2exTre76D2ku5UG6
Fbx: https://drive.google.com/file/d/12EkVmDD...sp=sharing

Print this item

  Any tutorial for stitcher?
Posted by: Snail921 - 16-10-2021, 11:23 AM - Forum: Obi Softbody - Replies (7)

Hi.
I have been struggling to figure out how to use stitch constraints properly to connect multiple softbodies.
Is there any video or tutorial of stitch constraints?

[EDIT]
Here are some more info regarding the problem I am struggling with.
The obi stitcher has been set as you see in the image below. Each stitch has been set by AutoStitcher.cs which helps me to find indices of particle pairs and set all stitches in the Editor. (For better visualization of each stitch, I set each cube apart along X axis but they were located right next to each other when I set their stitches and hit play.)
[Image: gs9zU7V.png]
They looks ok to me but when I hit play, I get the result like the image below (Shown in wireframe mode). As you can see, the stitched particles are not lined up smoothly and they seem they are fighting (colliding) each other.

[Image: 1wETs54.png]Their softbody surface blueprint's Shape Smoothing and Anisotropy Neighborhood have been set to 0 so that I get all particles right on the mesh vertices.
[Image: USV1hlX.png]What else I should look into to make connect them seamlessly?

By the way, this is the code I use to set stitches. It figure out all pairs and export them to a xml file in the play mode, then use the xml file to set stitches in the Editor. I know the workflow is a bit too cumbersome but I could not figure out how to get particle positions without running it. Is there any better way?

Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Obi;
using UnityEditor;

public class AutoStitcher : MonoBehaviour
{
    [System.Serializable]
    public struct STITCH_PAIR
    {
        public int index1;
        public int index2;
    }

    public List<STITCH_PAIR> stitchPairList = new List<STITCH_PAIR>();

    [SerializeField]
    ObiActor actor1;
    [SerializeField]
    ObiActor actor2;

    [SerializeField]
    float stitchMergin = 0.001f;

    private Mesh mesh1;
    private Mesh mesh2;

    // Start is called before the first frame update
    void Start()
    {
        FindPairs();
    }

    public void FindPairs()
    {
        stitchPairList.Clear();

        for (int i = 0; i < actor1.particleCount; i++)
        {
         
            int index1 = actor1.GetParticleRuntimeIndex(i);
            Vector3 pos1 = actor1.GetParticlePosition(index1);

            for ( int l = 0; l < actor2.particleCount; l++)
            {
                int index2 = actor2.GetParticleRuntimeIndex(l);
                Vector3 pos2 = actor2.GetParticlePosition(index2);
                float distance = Vector3.Distance(pos1, pos2);
                if (distance < stitchMergin)
                {
                    //obiStitcher.AddStitch(i, l);

                    STITCH_PAIR newPair;
                    newPair.index1 = i;
                    newPair.index2 = l;
                    stitchPairList.Add(newPair);

                    Debug.Log($"Index1: {i}, Index2: {l} Distance: {distance}");
                }
            }
        }
    }

    public void SaveStitchData()
    {
        string name = actor1.name + "_" + actor2.name;
        XmlUtil.Seialize<List<AutoStitcher.STITCH_PAIR>>("./Assets/" + name + ".xml", stitchPairList);
    }

    public void StitchActors()
    {
        string name = actor1.name + "_" + actor2.name;
        stitchPairList.Clear();
        stitchPairList = XmlUtil.Deserialize<List<AutoStitcher.STITCH_PAIR>>("./Assets/" + name + ".xml");
        ObiStitcher obiStitcher = gameObject.AddComponent<ObiStitcher>();
        obiStitcher.Actor1 = actor1;
        obiStitcher.Actor2 = actor2;

        foreach(STITCH_PAIR pair in stitchPairList)
        {
            obiStitcher.AddStitch(pair.index1, pair.index2);
        }
    }
}

[CustomEditor(typeof(AutoStitcher))]
public class AutoStitcherEditor : Editor
{
    AutoStitcher obj;

    public void OnEnable()
    {
        obj = (AutoStitcher)target;
    }
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        if (GUILayout.Button("Save Stitches(Only in Play Mode"))
        {
            if (!Application.isPlaying)
            {
                Debug.LogError("Only works when editor is playing.");
                return;
            }

            bool go = EditorUtility.DisplayDialog(
                "Save Stitches to xml file.",
                    "This will save particle pairs data to .xml file. " +
                    "Do you wish to continue?",
                    "Go Ahead",
                    "Cancel"
                );

            if (!go)
            {
                return;
            }

            obj.SaveStitchData();
        }

        if (GUILayout.Button("Bake Stitches(Only in Editor Mode"))
        {
            if (Application.isPlaying)
            {
                Debug.LogError("Only works when editor is not playing.");
                return;
            }

            bool go = EditorUtility.DisplayDialog(
                "Bake Stitches from xml file.",
                    "This will add obiStitch constraints to obi actors. " +
                    "Do you wish to continue?",
                    "Go Ahead",
                    "Cancel"
                );

            if (!go)
            {
                return;
            }

            obj.StitchActors();
        }
    }
}

Print this item

  How to tune/set constraints of a particle group from an obiActor during runtime
Posted by: Jschol - 15-10-2021, 01:07 PM - Forum: General - Replies (4)

Hi all,

I am trying to write a script, that allows me to tune/set the constraints of a selected obi particle group at runtime.

If I understood correctly, I should know the offset of that actor's particle group constraints, inside the solver batch, to set the constraints.

The problem that I am facing, is that I am not able to locate the constraints from the particle group in the solver.
My idea was to loop through the constraints of the actor, and if the constraint is also present in the particle group, set the constraints.
Is this the way to go? (As I cannot seem to figure that part out).

Any help would be greatly appreciated.
- Jasper

My current implementation on setting a softbody ShapeMatchingConstraints  look something like this, where I still need to fill in the "ConstraintIsInParticleGroup()" function:

Code:
using Obi;
using System.Collections.Generic;
using UnityEngine;

public class ParticleGroupTest : MonoBehaviour
{
    [SerializeField] private ObiActor obiActor = null;
    [SerializeField] private ObiParticleGroup obiParticleGroup = null;
    private ObiSoftbody obiSoftbody = null;


    bool ConstraintIsInParticleGroup()
    {
        // ???
        return true;
    }

    void Start()
    {
        obiSoftbody = obiActor.GetComponent<ObiSoftbody>();
    }

    void Update()
    {
        // get constraints stored in the actor:
        var actorConstraints = obiSoftbody.GetConstraintsByType(Oni.ConstraintType.ShapeMatching)
                    as ObiConstraints<ObiShapeMatchingConstraintsBatch>;
        // get runtime constraints in the solver:
        var solverConstraints = obiSoftbody.solver.GetConstraintsByType(Oni.ConstraintType.ShapeMatching)
                    as ObiConstraints<ObiShapeMatchingConstraintsBatch>;

        // get batches and offsets
        List<ObiShapeMatchingConstraintsBatch> actorSoftBodyBatches = actorConstraints.batches;
        List<ObiShapeMatchingConstraintsBatch> solverSoftBodyBatches = solverConstraints.batches;
        List<int> offsets = obiSoftbody.solverBatchOffsets[(int)Oni.ConstraintType.ShapeMatching];


        for (int i_batch = 0; i_batch < actorConstraints.batches.Count; ++i_batch) // loop over batches
            for (int i_constraint = 0; i_constraint < actorSoftBodyBatches[i_batch].activeConstraintCount; ++i_constraint) // loop over constraints
                if (ConstraintIsInParticleGroup())
                {
                    int index = i_constraint + offsets[i_batch]; //apply offset to constraint index per batch

                    solverSoftBodyBatches[i_batch].materialParameters[index * 5] = 0.0f; // deformation resistance
                    solverSoftBodyBatches[i_batch].materialParameters[index * 5 + 1] = 1.0f; // plasticYield
                    solverSoftBodyBatches[i_batch].materialParameters[index * 5 + 2] = 1.0f; // plasticCreep;
                    solverSoftBodyBatches[i_batch].materialParameters[index * 5 + 3] = 1.0f; // plasticRecovery
                    solverSoftBodyBatches[i_batch].materialParameters[index * 5 + 4] = 1.0f; // maxDeformation
                }
    }

Print this item

  Rope goes inside collider when stretched
Posted by: davidsedrakyan - 14-10-2021, 12:55 AM - Forum: Obi Rope - Replies (6)

Hello, I'm using Obi Rope for simulating wrapping around pins, gameplay and the problem is that my rope goes inside collider, I will attach screenshots of settings and also a video of the problem!

I'm pretty sure that I need to activate some setting to have maybe more "stretchy" or more "Wrappy" rope but I can't exactly understand shat should I activate for that

https://www.youtube.com/watch?v=5HnJi0pdI0I

Here is a link for the problem in the video, also I'm attaching my settings.


I tried moving my sphere with rigid body and with transform in both cases it's same, I assume that there is some setting to turn on on the rope.

Print this item

  Internal Collision Detection?
Posted by: Dave LeDev - 13-10-2021, 09:19 AM - Forum: Obi Softbody - Replies (2)

I've not yet purchased to find out-- does this asset only support external collisions or can it also handle internal? 

Example use cases:

  • A creature trying to get out of a closed, deformable container
  • Bubble Boy
  • Realistic skin deformation caused by internals

Print this item

  How to know the rope is torn?
Posted by: sangku2000 - 13-10-2021, 05:03 AM - Forum: Obi Rope - Replies (1)

I wanna know the state of rope. Because I make a decision of rope state!

So I wonder when the rope is torn, Is there any value the rope state?

Print this item