Search Forums

(Advanced Search)

Latest Threads
Broken scripts with updat...
Forum: Obi Rope
Last Post: hariedo
2 hours ago
» Replies: 0
» Views: 11
Garment explodes on Andro...
Forum: Obi Cloth
Last Post: CptnFabulous
19-12-2024, 07:16 AM
» Replies: 4
» Views: 658
Calculating and Reproduci...
Forum: Obi Fluid
Last Post: ZacharyP
18-12-2024, 05:49 PM
» Replies: 2
» Views: 756
Null Reference, actor not...
Forum: Obi Rope
Last Post: josemendez
13-12-2024, 12:39 PM
» Replies: 1
» Views: 135
Issue with Grasping ObiRo...
Forum: Obi Rope
Last Post: josemendez
12-12-2024, 12:00 PM
» Replies: 5
» Views: 417
Changing extruded rendere...
Forum: Obi Rope
Last Post: aderae
10-12-2024, 07:35 PM
» Replies: 2
» Views: 218
Baking a rope is causing ...
Forum: Obi Rope
Last Post: josemendez
10-12-2024, 11:06 AM
» Replies: 6
» Views: 622
Barrier belt - changing l...
Forum: Obi Rope
Last Post: josemendez
10-12-2024, 10:42 AM
» Replies: 1
» Views: 198
Path editor gizmo's appea...
Forum: Obi Rope
Last Post: josemendez
10-12-2024, 09:50 AM
» Replies: 1
» Views: 192
Problems when using multi...
Forum: Obi Cloth
Last Post: Cat3Man
09-12-2024, 03:17 AM
» Replies: 2
» Views: 268

 
  Destroying GameObjects immediately is not permitted during physics trigger/contact
Posted by: Alexander34 - 17-09-2024, 01:14 PM - Forum: Obi Rope - Replies (5)

Code:
public void AttachRope()
        {
            _blueprint = ScriptableObject.CreateInstance<ObiRopeBlueprint>();
            var fatherConnectionPoint = _playersContainer[PlayerCharacter.Father].ConnectionPoint;
            var sonConnectionPoint = _playersContainer[PlayerCharacter.Son].ConnectionPoint;
            Vector3 father = ObiRope.transform.InverseTransformPoint(fatherConnectionPoint.position);
            Vector3 son = ObiRope.transform.InverseTransformPoint(sonConnectionPoint.position);
            lineFromObiRope.SetStartEndPositions(father, son);
            int allLayers = (1 << 16) - 1;
            int excludeLayer15 = ~(1 << 15);
            int finalMask = allLayers & excludeLayer15;

            int filter = ObiUtils.MakeFilter(finalMask,
                1);
            _blueprint.path.Clear();
            _blueprint.groups.Clear();
            _blueprint.path.AddControlPoint(father,
                -father.normalized,
                father.normalized,
                Vector3.zero,
                _controlPointsMass,
                _controlPointsMass,
                1,
                filter,
                Color.white,
                "start");

            _blueprint.path.AddControlPoint(son,
                -son.normalized,
                son.normalized,
                Vector3.zero,
                _controlPointsMass,
                _controlPointsMass,
                1,
                filter,
                Color.white,
                "end");

            _blueprint.path.FlushEvents();
            _blueprint.Generate();
            ObiRope.ropeBlueprint = _blueprint;

            var pinConstraints = ObiRope.GetConstraintsByType(Oni.ConstraintType.Pin) as ObiConstraints<ObiPinConstraintsBatch>;
            pinConstraints.Clear();
            var batch = new ObiPinConstraintsBatch();

            batch.AddConstraint(ObiRope.solverIndices[0],
                _fatherConnectionPointObiCollider,
                Vector3.zero,
                Quaternion.identity,
                0,
                0,
                float.PositiveInfinity);

            batch.AddConstraint(ObiRope.solverIndices[_blueprint.activeParticleCount - 1],
                _sonConnectionPointObiCollider,
                Vector3.zero,
                Quaternion.identity,
                0,
                0,
                float.PositiveInfinity);

            batch.activeConstraintCount = 2;
            pinConstraints.AddBatch(batch);
            ObiRope.SetConstraintsDirty(Oni.ConstraintType.Pin);
        }
I made a rope hitch like in the Hook example. And now every time I get this error in ObiCollisionWorld when I use the above AttachRope method.
Code:
public void DecreaseReferenceCount()
        {
            if (--refCount <= 0 && gameObject != null)
                DestroyImmediate(gameObject); 
        }
Code:
Destroying GameObjects immediately is not permitted during physics trigger/contact, animation event callbacks, rendering callbacks or OnValidate. You must use Destroy instead.
UnityEngine.Object:DestroyImmediate (UnityEngine.Object)
Obi.BurstColliderWorld:DecreaseReferenceCount () (at Assets/Obi/Scripts/Common/Backends/Burst/Collisions/BurstColliderWorld.cs:61)
Obi.BurstSolverImpl:Destroy () (at Assets/Obi/Scripts/Common/Backends/Burst/Solver/BurstSolverImpl.cs:189)
Obi.BurstBackend:DestroySolver (Obi.ISolverImpl) (at Assets/Obi/Scripts/Common/Backends/Burst/BurstBackend.cs:21)
Obi.ObiSolver:Teardown () (at Assets/Obi/Scripts/Common/Solver/ObiSolver.cs:905)
Obi.ObiSolver:RemoveActor (Obi.ObiActor) (at Assets/Obi/Scripts/Common/Solver/ObiSolver.cs:1201)
Obi.ObiActor:RemoveFromSolver () (at Assets/Obi/Scripts/Common/Actors/ObiActor.cs:362)
Obi.ObiRope:set_ropeBlueprint (Obi.ObiRopeBlueprint) (at Assets/Obi/Scripts/RopeAndRod/Actors/ObiRope.cs:152)
_src.Scripts.PlayerFeatures.Connection.ThreadProxy_s.ThreadProxy:AttachRope () (at Assets/_src/Scripts/PlayerFeatures/Connection/ThreadProxy's/ThreadProxy.cs:124)
_src.Scripts.PlayerFeatures.Connection.ConnectionHandler:AttachPhysicalRope () (at Assets/_src/Scripts/PlayerFeatures/Connection/ConnectionHandler.cs:407)
_src.Scripts.PlayerFeatures.Connection.ConnectionHandler:EnablePermanentPhysicalConnection () (at Assets/_src/Scripts/PlayerFeatures/Connection/ConnectionHandler.cs:398)
_src.Scripts.PlayerFeatures.Connection.ConnectionHandler/<ChangeMode>d__46:MoveNext () (at Assets/_src/Scripts/PlayerFeatures/Connection/ConnectionHandler.cs:276)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskMethodBuilder:Start<_src.Scripts.PlayerFeatures.Connection.ConnectionHandler/<ChangeMode>d__46> (_src.Scripts.PlayerFeatures.Connection.ConnectionHandler/<ChangeMode>d__46&) (at Library/PackageCache/com.cysharp.unitask@c170af5642/Runtime/CompilerServices/AsyncUniTaskMethodBuilder.cs:111)
_src.Scripts.PlayerFeatures.Connection.ConnectionHandler:ChangeMode (_src.Scripts.PlayerFeatures.Connection.ConnectionMode,single)
_src.Scripts.Core.PermanentConnectionZone:EnablePermanentMode () (at Assets/_src/Scripts/Core/PermanentConnectionZone.cs:78)
UnityEngine.Events.UnityEvent:Invoke ()
_src.Scripts.Core.TwoPlayersTrigger:CheckPlayersInTrigger () (at Assets/_src/Scripts/Core/TwoPlayersTrigger.cs:69)
_src.Scripts.Core.PermanentConnectionZone:OnTriggerStay (UnityEngine.Collider) (at Assets/_src/Scripts/Core/PermanentConnectionZone.cs:47)

Code:
_src.Scripts.PlayerFeatures.Connection.ThreadProxy_s.ThreadProxy:AttachRope () (at Assets/_src/Scripts/PlayerFeatures/Connection/ThreadProxy's/ThreadProxy.cs:124)
124 point is 
Code:
ObiRope.ropeBlueprint = _blueprint;

in AttachRope method

Iam use [6.5.2] obiRope

Print this item

  Obi Cloth Renderer Layer
Posted by: vrtraining - 16-09-2024, 06:58 PM - Forum: Obi Cloth - Replies (4)

I want to render some specific lighting on cloth through rendering culling mask. I have created a separate special layer for my Obi Cloth and assigned it that special layer. Now my light is only rendering on that specific special layer. It works well in editor because I have assigned that layer to the Obi Cloth which also has Mesh Renderer and Obi Cloth Renderer. But when I enter play mode and Obi Cloth is simulated and its rendered using Obi Cloth Renderer it doesn't work, upon some investigation I came to know that it is only considering that cloth in default layer.

How I can change the layer of Obi Cloth Renderer from default to some other layer?

Print this item

  Streo Rendering mode
Posted by: ugurcamoglu35 - 16-09-2024, 09:47 AM - Forum: Obi Fluid - Replies (3)

Hi,

We are switching from Obi fluid 6 to 7. After switching to 7, obi right and left eye problems started to occur on meta devices. We can solve this by making Streo Rendering mode multiview in 6. However, this problem is not solved in 7. It looks correct if the user closes their left eye. It is not visible when you close your right eye. When you look with both eyes, a double flow appears. Do we need to make extra settings?

It gets fixed when you multipass. However, in our project, we receive different errors like this. We had no problems with the same settings in 6.

Print this item

  Rope "Freezing" after a few seconds
Posted by: TryBios - 14-09-2024, 05:06 PM - Forum: Obi Rope - Replies (1)

Hi everyone,

i have the Problem that my Rope seems to stop simulating after a few seconds if the Start and End Particle stop moving. Also if the Rope isnt moved a lot, some Particles dont react to small movement which also looks kinda wierd. I think thats a Performance measure but my Rope gets stuck in unrealistic Positions which breaks the Immersion in an VR Environment.

Thanks in advance.

Print this item

Pregunta Can I get help?
Posted by: ziziza93 - 13-09-2024, 10:02 AM - Forum: Obi Cloth - Replies (3)

I need to select specific regions in the OBI blueprint to run different cloth simulations, but using Unity’s built-in UI makes it challenging to isolate and configure those parts. Therefore, I would like to pre-select the points I need using tools like Vertex Groups and Vertex Paint in a 3D modeling program such as Blender, and then export this data via an FBX file. My goal is to select this data in the OBI blueprint in Unity. Could you provide a guide for this process?

Print this item

  Simulate clothing in a fixed position
Posted by: Nightfall - 13-09-2024, 06:38 AM - Forum: Obi Cloth - Replies (1)

hello

I'm writing to ask a question while using Obi.

I am testing dynamically dressing a pants object(Obi Skinned Cloth, Obi Skinned Cloth Renderer) on a mannequin object (Obi solver, Obi Fixed Updater, Obi Collider, Distance Field).

I was able to get the pants to initially fall down from the loaded height and stop at the pelvis to become clothed.

Is there any way to get the simulation of the pants' clothing to work without falling down from the initial height?

I tried using Unity Joints but it didn't work the way I wanted it to

I am a beginner in Unity and my English is not very good, so I apologize in advance for any lack of explanation.

Print this item

  contact.stickImpulse always 0, Closed loop ObiRope Collision fails
Posted by: alicecatalano - 12-09-2024, 08:32 AM - Forum: Obi Rope - Replies (4)

Hello, I am running a simulation with a closed loop ObiRope, that should simulate an elastic.
The objective is to grasp the elastic with a tool and hook it on some nails, to create different shapes. The nails are vertical and the elastic should be stretched to be hooked to nails at 10 cm of distance between each other.
I am encountering an issue with the collision, because i am able to grasp and release the object with no issues, and i am able to hook the elastic on one nail, but the when i stretch the elastic and i hook it on another nail, after the release the collision is broken, either for both nails or just for the second one and the elastic passes through them.
I initially thought of increasing the contact.stickImpulse to make the interface between nail and internal part of the elastic more "unbreakable" but it didn't work because of course I can't change that value.
I don't know if inserting some type of attachment can be helpful because i need the elastic to slide over the nail if the movement requires it.
Do you have any suggestion to address this problem?

Print this item

  Can I attach particeattachment in script?
Posted by: gahyun11 - 12-09-2024, 06:18 AM - Forum: Obi Cloth - Replies (28)

Hello! I'm currently trying to add particle attachment component through the script before obi skinnedcloth asset is enabled during play.
The issue that I'm struggling is if I add particle attachment into cloth asset during the play using my script(below), particle attachment doesnt work, just falls until it reaches at pelvis, 
but! if I add particle attachment into same cloth asset before play, particle attachment works well!

both of the cases particle attachment is added into cloth asset well, but the problem is particle attachment doesnt work only if I add it on the cloth asset(object that has obi skinnedcloth component) through the script

<add particle attachment component through inspector before play>
   

<add particle attachment during the play through script>
   

and this is the script I wrote. I tried same part on "OnEnable","Start","Awake" and all of this didnt work.
I tried to add particle attachment component on disabled cloth, then I enable cloth asset, it didnt work. 
Particle attachment worked only I added that component on cloth asset through inspector whether it was play runtime or not. 
 

Code:
  obiSkinnedCloth.gameObject.AddComponent<ObiParticleAttachment>();
            obiSkinnedCloth.GetComponent<ObiParticleAttachment>().target = _clothEnabler._obiSolver.transform.GetChild(1);
//this is the part that I set body as particle attachment's target, and the body has mesh collider and obi collider.
            try
            {
                obiSkinnedCloth.GetComponent<ObiParticleAttachment>().attachmentType = ObiParticleAttachment.AttachmentType.Dynamic;
                obiSkinnedCloth.GetComponent<ObiParticleAttachment>().compliance = _clothEnabler._particleCompliance;

            }


is particle attachment something that I cannot add in script during play runtime? Thank you.

Print this item

  Actors do not render when manually rendering camera
Posted by: nickhudson4 - 09-09-2024, 09:26 PM - Forum: General - Replies (2)

Actors do not render when manually using Camera.Render() and rendering to a texture. Steps to reproduce: 

1. Create actor in scene and place camera.
2. Add RawImage to scene to show camera output
3. Disable camera component.
4. Create script

Code:
public class ObiTester : MonoBehaviour
{
    public Camera Camera;
    public RawImage Screen;
    public RenderTexture SourceTexture;

    private void Awake()
    {
        SourceTexture = new RenderTexture(1920, 1080, 1);
        Camera.targetTexture = SourceTexture;
        Screen.texture = SourceTexture;
    }
    private void Update()
    {
        Camera.Render();
    }
}

Print this item

Bombilla How to Achieve Realistic Specular Reflection in PBD Particle Collisions?
Posted by: GuoliZheng - 09-09-2024, 06:44 AM - Forum: Obi Fluid - Replies (3)

Dear Developers,

I hope this message finds you well. Recently, I have been thoroughly studying the articles on PBD simulations and came across an issue related to the rebound behavior of simulated particles, which I have illustrated in some images.https://www.bilibili.com/opus/975052950303932425

In the first scenario, which reflects real-world physics, when an object collides with a flat surface, the rebound is similar to specular reflection of light. In the second scenario, within PBD, when a high Maxdepenetration value is used, the particles tend to slide along the surface after the collision. In the third scenario, with a low Maxdepenetration value, the particles are ejected perpendicularly from the surface due to the depenetration velocity limitation.

I understand that this behavior is a result of how PBD calculates velocity based on position adjustment and the previous frame’s position. My question is: how can I achieve a rebound that mimics the real-world reflection angle after a collision? Could it be possible to apply impulses to the particles, similar to how Obi rigid body impulses are applied in fluid-solid coupling, to achieve this?

In my research, achieving this type of specular reflection upon collision is crucial, rather than having only the options of surface sliding or vertical rebound. Is there a feasible way to modify the Obi code to implement this?

Thank you very much for your time and assistance!

Best regards.

Print this item