29-01-2019, 12:48 PM
Can I create a mesh of the created rope to use it as a simple model?
Mesh creating
|
29-01-2019, 12:48 PM
Can I create a mesh of the created rope to use it as a simple model?
29-01-2019, 01:25 PM
(29-01-2019, 12:48 PM)Evgenius Wrote: Can I create a mesh of the created rope to use it as a simple model? Nope, as far as I know Unity does not allow to serialize assets created at runtime. You cannot use AssetDatabase.CreateAsset to save something created at runtime, I might be wrong about this though.
29-01-2019, 01:40 PM
(29-01-2019, 01:25 PM)josemendez Wrote: Nope, as far as I know Unity does not allow to serialize assets created at runtime. You cannot use AssetDatabase.CreateAsset to save something created at runtime, I might be wrong about this though. Not necessary in runtime. It's just much easier to make a static rope coil using ObiRope, than modeling it from scratch.
29-01-2019, 01:55 PM
29-01-2019, 02:21 PM
29-01-2019, 03:30 PM
07-02-2019, 09:52 AM
07-02-2019, 10:43 AM
(07-02-2019, 09:52 AM)Evgenius Wrote: Hello again! Did you find any solution? Hi there! We ended up implementing something similar not in ObiRope, but in our trail renderer (Ara). You can now select an arbitrary shape to be extruded along the trail. Still, this is not quite the use case you wanted (create a completely static mesh from the cable in editor, for using it like a regular mesh), as this recomputes the mesh every frame. We are looking into your specific use case, expect an answer very soon.
07-02-2019, 11:31 AM
(This post was last modified: 07-02-2019, 11:31 AM by josemendez.)
Here's it, turned out to be simpler than expected.
Replace ObiEditorUtils.cs and ObiRopeEditor.cs with the ones I'm providing. Then, a new button "Bake Mesh" in the ObiRope inspector will appear below the "Initialize" button. Upon clicking it, Unity will ask you for a folder to save the mesh to. Then you can use this mesh in any scene as a regular static mesh. Only works with ObiRopeExtrudedMeshRenderer and ObiRopeMeshRenderer (since ObiRopeLineRenderer is view-dependent and ObiRopeChainRenderer is made up of static meshes). This functionality will be included in ObiRope,ObiCloth and ObiSoftbody in the next update.
07-02-2019, 12:13 PM
(07-02-2019, 11:31 AM)josemendez Wrote: Here's it, turned out to be simpler than expected. Works like a charm, thanks a lot! Is there a possibility for the same feature for chains in the future? |
« Next Oldest | Next Newest »
|