Obi Official Forum
Help Creating obi rope prefab - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help Creating obi rope prefab (/thread-2607.html)

Pages: 1 2


Creating obi rope prefab - amismail - 02-12-2020

Hi there,
I tried to search the forum for solution to my issue but the forum is huge so I am posting this
I am facing an issue with creating unity prefab that include obi rope with 'obi rope mesh renderer' component, the problem is that each time I try to apply the 'deformedMesh' in the 'Mesh Filter' component to the prefab I get the following message:
"a reference to an object in the scene can't be applied to the prefab asset", and as a result when I try to instantiate the prefab in runtime the rope doesn't appear, I have tried to search for the deformedMesh asset but I didn't find it in the project or the scene please help me to resolve this issue as this is essential for my project, thanks in advance


RE: Creating obi rope prefab - josemendez - 02-12-2020

(02-12-2020, 08:17 PM)amismail Wrote: Hi there,
I tried to search the forum for solution to my issue but the forum is huge so I am posting this
I am facing an issue with creating unity prefab that include obi rope with 'obi rope mesh renderer' component, the problem is that each time I try to apply the 'deformedMesh' in the 'Mesh Filter' component to the prefab I get the following message:
"a reference to an object in the scene can't be applied to the prefab asset", and as a result when I try to instantiate the prefab in runtime the rope doesn't appear, I have tried to search for the deformedMesh asset but I didn't find it in the project or the scene please help me to resolve this issue as this is essential for my project, thanks in advance

The rope’s “deformableMesh” is created entirely at runtime. Its not an asset or part of a scene, so it can’t be applied to a prefab or replaced by another mesh.

What’s your use case? If you want to use a custom mesh for the rope, you should use ObiRopeMeshRenderer instead. The extruded renderer generates its own mesh by extruding a rope section, as explained in the manual.


RE: Creating obi rope prefab - amismail - 04-12-2020

(02-12-2020, 09:02 PM)josemendez Wrote: The rope’s “deformableMesh” is created entirely at runtime. Its not an asset or part of a scene, so it can’t be applied to a prefab or replaced by another mesh.

What’s your use case? If you want to use a custom mesh for the rope, you should use ObiRopeMeshRenderer instead. The extruded renderer generates its own mesh by extruding a rope section, as explained in the manual.
I am actually using ObiRopeMeshRenderer as you mentioned but it also create the deformableMesh also so it is the same problem, Is there a way to use the ObiRopeMeshRenderer in a prefab and if not what is the alternative


RE: Creating obi rope prefab - josemendez - 04-12-2020

(04-12-2020, 06:35 PM)amismail Wrote: I am actually using ObiRopeMeshRenderer as you mentioned but it also create the deformableMesh also so it is the same problem, Is there a way to use the ObiRopeMeshRenderer in a prefab and if not what is the alternative

Hi,

It should work with prefabs out of the box with either renderer. Can you give more details about you ise case, or some steps that lead to error you describe?


RE: Creating obi rope prefab - josemendez - 04-12-2020

(04-12-2020, 09:42 PM)josemendez Wrote: Hi,

It should work with prefabs out of the box with either renderer. Can you give more details about you use case, or some steps that lead to error you describe?



RE: Creating obi rope prefab - amismail - 07-12-2020

I will try to create a sample scene and upload it to demonstrate the issue


RE: Creating obi rope prefab - amismail - 07-12-2020

The project is large I couldn't upload, but I have taken a snapshot showing the issue, it shows 2 prefabs, the first is added before runtime and the other is instantiated at runtime, the first shows the rope mesh as intended but the second (the one instantiated at runtime) doesn't show the rope mesh, please advice 

[attachment=831]The project is large I couldn't upload, but I have taken a snapshot showing the issue, it shows 2 prefabs, the first is added before runtime and the other is instantiated at runtime, the first shows the rope mesh as intended but the second (the one instantiated at runtime) doesn't show the rope mesh, please advice 


RE: Creating obi rope prefab - amismail - 10-12-2020

Hi there,
Any help I am Stuck in this issue


RE: Creating obi rope prefab - josemendez - 10-12-2020

(10-12-2020, 11:37 AM)amismail Wrote: Hi there,
Any help I am Stuck in this issue

Hi,

I'm still unable to reproduce this. Tried in a variety of Unity versions, instantiating both at runtime and from editor, but it works perfectly for me. The rope prefab is simulated and rendered fine.

Just a sanity check: you're instantiating the rope under a solver component, right? If you are instantiating it anywhere else in the scene, simulation and rendering won't be updated. It is required for all actors to have a parent solver as explained in the manual:

http://obi.virtualmethodstudio.com/tutorials/bigpicture.html
http://obi.virtualmethodstudio.com/tutorials/actors.html


RE: Creating obi rope prefab - amismail - 10-12-2020

(10-12-2020, 12:55 PM)josemendez Wrote: Hi,

I'm still unable to reproduce this. Tried in a variety of Unity versions, instantiating both at runtime and from editor, but it works perfectly for me. The rope prefab is simulated and rendered fine.

Just a sanity check: you're instantiating the rope under a solver component, right? If you are instantiating it anywhere else in the scene, simulation and rendering won't be updated. It is required for all actors to have a parent solver as explained in the manual:

http://obi.virtualmethodstudio.com/tutorials/bigpicture.html
http://obi.virtualmethodstudio.com/tutorials/actors.html
I am Uploading the sample project to dropbox and will share the link with you as soon as it finishes

https://www.dropbox.com/s/ul02ztrm32rkb9p/New%20Unity%20Project.zip?dl=0

Here is the link, I hope it is solved quickly thanks in advance