Search Forums

(Advanced Search)

Latest Threads
Changing the rope's posit...
Forum: Obi Rope
Last Post: spikebor
5 minutes ago
» Replies: 1
» Views: 23
Obi7 | Fluid granular can...
Forum: Obi Fluid
Last Post: spikebor
11 hours ago
» Replies: 0
» Views: 39
Bigger foam with Alpha di...
Forum: Obi Fluid
Last Post: spikebor
Yesterday, 03:56 PM
» Replies: 10
» Views: 247
Can ObiBone work with Sof...
Forum: Obi Softbody
Last Post: spikebor
Yesterday, 03:36 PM
» Replies: 0
» Views: 23
(7.0) Still confused abou...
Forum: General
Last Post: kodra
07-05-2024, 03:13 PM
» Replies: 4
» Views: 88
question of the ObiRope l...
Forum: Obi Rope
Last Post: rinrin
07-05-2024, 02:33 PM
» Replies: 0
» Views: 84
Obi7 | I made a pool
Forum: Obi Fluid
Last Post: josemendez
07-05-2024, 02:03 PM
» Replies: 5
» Views: 157
Frequent crash after assi...
Forum: Obi Fluid
Last Post: spikebor
07-05-2024, 11:33 AM
» Replies: 2
» Views: 78
[FIXED] Dispose of atomic...
Forum: Obi Cloth
Last Post: imtzo
06-05-2024, 08:28 PM
» Replies: 11
» Views: 2,336
Obi7Beta | Fluid can not ...
Forum: Obi Fluid
Last Post: spikebor
06-05-2024, 06:42 PM
» Replies: 2
» Views: 77

 
  Feedback on improving the blueprint trouble shooting.
Posted by: spikebor - 29-04-2024, 06:07 PM - Forum: Obi Softbody - Replies (2)

Hi, I'm having trouble about floating vertex (not assigned to any particle) for the Softbody blueprint.
This is the Slime in normal play mode.
[Image: MPajWXr.png]

When I turn off deformation resistance, I can see the floating vertices.
[Image: pSrPRsY.png]

Now go to the blueprint, in the Bone mode, I can see very well the spine bone is having affection on which particles.
[Image: 9duoacf.png]

But in the Volume mode, no matter what bone I select, I don't see any feedback that which particle is affected by that bone. Everything is white.
But why is that? 

[Image: hpO3P5K.png]

To sum up, the problem is I have floating vertices, and I don't see any way to control them, to include them to the bone.
I suggest for a feature that list out all the floating vertices on a button click, and isolate them for easy painting, then can assign them to bones by manual painting as always, after done the painting, click a button to exit the isolation.

Print this item

Exclamación Obi Rope not working on OS X Silicon
Posted by: lukej - 29-04-2024, 12:40 AM - Forum: Obi Rope - Replies (1)

I am trying to install into Unity 2022.3.19f1 on my Macbook M1 Max. 

I have tried reimporting the asset and restarting the editor to no avail. 

How can I fix this error?


   

Print this item

  Controlling Particle Thickness at Runtime with Obi Rope
Posted by: wrcampbell1 - 29-04-2024, 12:05 AM - Forum: Obi Rope - Replies (2)

Hey,

I tried looking into both the API and previous posts. It seems that this was possible at one point, but now there's no real information on it.

I want to create a cartoonish "bulge" effect in the an Obi Rope that animates through the rope, similar to old Loony Toon cartoons, as seen below:

[Image: c715f7f7c69b47f591e47f82752e31cb44d3401e_2_1024x524.png]

I've noticed that I can grab the ObiRope Component, access it's ObiPath, then it's thicknesses channel, and then the data itself as a list of floats, and I can modify them directly.

In order to apply the effect I was using the ObiPath's OnPathChanged Unity Event and invoking that.

Code:
[SerializeField]
private float _amplitude = 3f;
[SerializeField]
private float _frequency = 1f;
[SerializeField]
private float _phaseShift = 0f;

// ...etc.

private IEnumerator Pulsate()
{
    while (true)
    {
        if (_pulsating)
        {
            var t = Time.time;
            var pi = Mathf.PI;
            
            for (int i = 0; i < _thicknesses.Count; i++)
            {
                _rope.path.thicknesses.data[i] =
                    Mathf.Sin(1 + _amplitude * Mathf.Sin(2 * pi * _frequency * t - 2 * pi * i + _phaseShift));
            }
            _rope.path.OnPathChanged?.Invoke();
            
            yield return new WaitForSeconds(0.01f);
        }

        yield return new WaitForSeconds(0.5f);
    }
}

I was performing this in a coroutine under an always true while-loop and in a for-loop.

However, the results I'm getting don't appear to be right. It looks like the particles are updating randomly and infrequently. As in, the whole rope changes from thick to thin randomly and no part of it bulges differently. 

Video demo (Giphy Link):
[Image: giphy.gif]

Print this item

Pregunta Please check out this model, I can't generate Full Body data for it
Posted by: spikebor - 28-04-2024, 12:28 PM - Forum: Obi Softbody - Replies (4)

Softbody version 6.5.4
I have test with another character, it can generate just fine.
But this Slime model can not, I have no idea.
This is the error shown:

Code:
IndexOutOfRangeException: Index was outside the bounds of the array.
Obi.ObiSoftbodySurfaceBlueprint+<InsertParticlesIntoVoxels>d__42.MoveNext () (at Assets/Obi/Scripts/Softbody/Blueprints/ObiSoftbodySurfaceBlueprint.cs:323)
Obi.ObiSoftbodySurfaceBlueprint+<Initialize>d__37.MoveNext () (at Assets/Obi/Scripts/Softbody/Blueprints/ObiSoftbodySurfaceBlueprint.cs:168)

Code:
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:132)

I have created a thread like this in a long time, but I think this is new error, since the old error is patched I supposed.

Link https://drive.google.com/file/d/13TqlniB...sp=sharing

Print this item

Pregunta Debug Collisions position and normal
Posted by: spikebor - 28-04-2024, 09:19 AM - Forum: General - Replies (3)

Hi there, I can use this code to collide with the Obi softbody and push my character up,
I just have a problem with debugging the collision position and normal.
In this picture, the yellow line is the debug line, it does not look like it's drawing correct contact position or normal.
From my understanding, using solver.transform.TransformPoint and solver.transform.TransformDirection is the way to convert those local data to world space, but why it's incorrect?

[Image: 3uIgNQo.png]

Code:
[RequireComponent(typeof(ObiSolver))]
    public class ObiCollisionEventHandler : MonoBehaviour
    {
        [SerializeField] UnityEngine.Events.UnityEvent<Collider,Vector3,Vector3> _onCollision;
        [SerializeField] float _minImpulse=0.1f;
        [SerializeField] bool _debug;
        ObiSolver solver;

        void Awake()
        {
            solver = GetComponent<ObiSolver>();
        }

        void OnEnable()
        {
            solver.OnCollision += Solver_OnCollision;
        }

        void OnDisable()
        {
            solver.OnCollision -= Solver_OnCollision;
        }

        void Solver_OnCollision(object sender, ObiSolver.ObiCollisionEventArgs e)
        {
            var world = ObiColliderWorld.GetInstance();

            // just iterate over all contacts in the current frame:
            foreach (Oni.Contact contact in e.contacts)
            {
                // if this one is an actual collision:
                if (contact.distance < 0.01)
                {
                    if (contact.normalImpulse < _minImpulse) continue;

                    Vector3 contactMid = (contact.pointA + contact.pointB) / 2f;
                    contactMid = solver.transform.TransformPoint(contactMid);
                    Vector3 contactNm = contact.normal.normalized;
                    contactNm = solver.transform.TransformDirection(contactNm);

#if UNITY_EDITOR
                    if (_debug) {
                        Debug.DrawLine(contactMid, contactMid + contactNm, Color.yellow, 2f);
                    }
#endif
                    var obiCol = world.colliderHandles[contact.bodyB].owner as ObiCollider;
                    if (obiCol != null)
                    {                       
                        // do something with the collider.
                        _onCollision?.Invoke(obiCol.sourceCollider, contactMid, contactNm);
                    }
                }
            }
        }
    }

Print this item

Triste Compatibility with Fluxy
Posted by: Crystalius - 27-04-2024, 01:05 AM - Forum: Obi Rope - Replies (2)

Hello. My project breaks and opens only in safe mode after installing Obi Rope. I believe it has something to do with Fluxy as I have it in the project too and one of the errors mentioned Fluxy. I've never had this error with Fluxy before. 

I've deleted the Fluxy character controller folder in samples that produced the error, error disappeared, but I still get these 2 other errors, I'm stuck and the project is broken, unfortunately. 

1. 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?)

2. Failed to find entry-points:
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Obi.Editor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.Exception: Failed to resolve assembly 'Obi.Editor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' in directories: C:\Program Files\Unity\Hub\Editor\2022.3.21f1\Editor\Data\MonoBleedingEdge\lib\mono\unityjit-win32

Full error makes flags this message and doesn't let me post it. So I can pm it to you if requested

Unity 2022.3.21

Print this item

  Can Obi bone works with bones with scale?
Posted by: kodra - 26-04-2024, 07:25 PM - Forum: Obi Rope - No Replies

From what I've observed, Obi bone always works very unexpected when the original skeletal animation has scales on bones. Is there any way to make it work? I thought particles have only positions and velocities, so in theory they can just ignore scales, right?

Print this item

  Obi Rope snake "collision".
Posted by: BCC_Gummybear - 23-04-2024, 11:06 PM - Forum: Obi Rope - Replies (1)

Hello, I am trying to find a way to simulate collision or resistance through proximity instead of Obi colliders. I have been working with the snake controller from Obi rope and thought I would attempt to make a snake that can move on the surface of water. This obviously would require my water to be a mesh object and have an Obi collider. I would like to avoid that.

To make objects float/roll with waves I currently search for the height of the water at that position of my object. I generated multiple colliders that float on the water around the snake and it worked but not very well. 

I was wondering if there is a way to use distance fields with transforms instead of colliders. Something that isn't a hard collision but more of an add forcer per rope particle to move towards the transform position I apply. 

Any ideas are helpful! 

Thanks,

Print this item

Exclamación IdentifyMovingColliders.Execute OutOfBound crash
Posted by: Guillaume - 23-04-2024, 05:12 PM - Forum: Obi Rope - Replies (6)

Hi!

We recently had a crash in a obi job "IdentifyMovingColliders.Execute" (see attached picture to have the exact line).
We are using Obi Rope 6.4 but the code I'll talks about remains the same in 6.5

After few investigation, the crash seems to happen when for some reasons we loaded, then unloaded some scenes containing colliders without letting them do the UpdateIfNeeded on the tracker. By doing this, the shapes remaings zeroed (just allocated).

I wanted to check what was the initial cause of the bug by reading a bit more the sourcecode, and there is something I'm missing.


  1. BurstColliderWorld.cellSpans will always grow to at least match the colliderCount (as seen in BurstColliderWorld.SetColliders)
  2. When preparing the IdentifyMovingColliders parralel for job (inside BurstColliderWorld.UpdateWorld), we transfer ObiColliderWorld.colliderShapes into a NativeArray by doing so: 
    shapes = world.colliderShapes.AsNativeArray<BurstColliderShape>(cellSpans.count).
    We then have a shapes native array matching the cellSpans.count... but not world.colliderShapes.count
  3. Then we schedule the parrallel for with cellSpans.count as parameter, so we are iterating on non initialized or removed shapes sometimes (since cellSpans.count >= colliderShapes.count)
  4. Since we loaded/unloaded the shapes without them having time to UpdateIfNeeded, the shape.materialIndex stay at 0 (and the other parameters of the shape are zero-ed too!)
  5. We then test shapes[i].materialIndex >= 0 which is true (since we are not using material, we should have put a -1 in the skipped UpdateIfNeeded)
  6. Then we crash on the line velocityBounds.Expand(collisionMaterials[shapes[i].materialIndex].stickDistance); since collisionMaterials is empty (that make me think we should use materials for our ropes!)
I don't understand why we are basing the parrallel for on cellSpans.count rather than world.colliderShapes.count, because here this parrallel for will always access some "old shape data" and process them while it's not necessary.

But maybe I'm missing something here!

The code I would see in BurstColliderWorld.UpdateWorld:

Code:
            var identifyMoving = new IdentifyMovingColliders
            {
                movingColliders = movingColliders.AsParallelWriter(),
                shapes = world.colliderShapes.AsNativeArray<BurstColliderShape>(), // <--- Match the world.colliderShapes count
                // instead of: shapes = world.colliderShapes.AsNativeArray<BurstColliderShape>(cellSpans.count),
                rigidbodies = world.rigidbodies.AsNativeArray<BurstRigidbody>(),
                collisionMaterials = world.collisionMaterials.AsNativeArray<BurstCollisionMaterial>(),
                bounds = world.colliderAabbs.AsNativeArray<BurstAabb>(), // <--- same here
                // instead of: bounds = world.colliderAabbs.AsNativeArray<BurstAabb>(cellSpans.count),
                cellIndices = cellSpans.AsNativeArray<BurstCellSpan>(),
                colliderCount = colliderCount,
                dt = deltaTime
            };
            JobHandle movingHandle = identifyMoving.Schedule(colliderCount, 128); // <--- instead of (cellSpans.count, 128)

Then in the Execute code I think we will not go out of bounds since "i" is only used on:
  1. bounds[i] which be the size of shapes 
  2. shapes[i] since we matched the size of the initial shapes array
  3. shapes[i].materialIndex >= 0 test will always be relevent since we are not iterating on a "ghost" shape that could have been added to the shapes, then removed before doing the UpdateIfNeeded thing (since UpdateIfNeeded is called in the ObiColliderWorld.GetInstance().UpdateColliders(); during the ObiUpdater.BeginStep)
Code:
        protected void BeginStep(float stepDeltaTime)
        {
            using (m_BeginStepPerfMarker.Auto())
            {
                // Update colliders right before collision detection:
                ObiColliderWorld.GetInstance().UpdateColliders(); // <----- This is where UpdateIfNeeded are call, where shapes are filled with correct values
                ObiColliderWorld.GetInstance().UpdateRigidbodies(solvers,stepDeltaTime);
                ObiColliderWorld.GetInstance().UpdateWorld(stepDeltaTime); // <------ This is where the IdentifyMovingColliders parrallel for takes place



Do you also think that this parrallel for is doing too much loop/work over time?
(maybe there are also other jobbed thing that do the same, but maybe I'm missing why)

Thanks!

Print this item

Pregunta Getting the force acting on a Rod
Posted by: astro.domine - 23-04-2024, 08:52 AM - Forum: Obi Rope - Replies (4)

Hello, pretty simple question I was hoping for some help with.

I have a rod; I want to know how much force is acting on one of its elements/particles. That is, how much total force are the constraints exerting (how deformed the rod is).

I don't know how to approach this, outside of doing a clunky measurement of the particle's position vs its rest position. I imagine it involves something to do with reading the constraint batch data in the solver?

Print this item