Posts: 7
Threads: 1
Joined: Dec 2020
Reputation:
0
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
Posts: 6,321
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
02-12-2020, 09:02 PM
(This post was last modified: 02-12-2020, 09:03 PM by josemendez.)
(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.
Posts: 7
Threads: 1
Joined: Dec 2020
Reputation:
0
(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
Posts: 6,321
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(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?
Posts: 6,321
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(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?
Posts: 7
Threads: 1
Joined: Dec 2020
Reputation:
0
I will try to create a sample scene and upload it to demonstrate the issue
Posts: 7
Threads: 1
Joined: Dec 2020
Reputation:
0
07-12-2020, 10:48 PM
(This post was last modified: 07-12-2020, 10:56 PM by amismail.)
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
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
Posts: 7
Threads: 1
Joined: Dec 2020
Reputation:
0
Hi there,
Any help I am Stuck in this issue
Posts: 6,321
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
10-12-2020, 12:55 PM
(This post was last modified: 10-12-2020, 12:56 PM by josemendez.)
(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/tutor...cture.html
http://obi.virtualmethodstudio.com/tutor...ctors.html
Posts: 7
Threads: 1
Joined: Dec 2020
Reputation:
0
10-12-2020, 06:47 PM
(This post was last modified: 10-12-2020, 07:34 PM by amismail.)
(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/tutor...cture.html
http://obi.virtualmethodstudio.com/tutor...ctors.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/ul02ztrm32rkb9...t.zip?dl=0
Here is the link, I hope it is solved quickly thanks in advance
|