x


Store a mesh's geometry at runtime for later retrieval

What is the best way to save or store a mesh's geometry - for a usage case, such as using it to restore an earlier mesh state at a later time?

Right now, my workaround is to use ObjExporter to convert it to a String, and then to reconvert it back.

more ▼

asked Jan 03 '11 at 04:57 PM

ina gravatar image

ina
3.3k 492 551 602

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Easiest way would be to instantiate a clone:

var m = Instantiate(originalMesh) as Mesh;
more ▼

answered Jan 03 '11 at 05:03 PM

Mike 3 gravatar image

Mike 3
30.5k 10 65 253

if you were to rewrite it with another mesh ("save a new state as previous"), can you rewrite it to the same global variable m ?

Jan 03 '11 at 05:33 PM ina

Sure, shouldn't be an issue. Just make sure you call Destroy(m) first to destroy the old one, otherwise you'll end up with a memory leak

Jan 03 '11 at 05:36 PM Mike 3

hmm any advice on saving at runtime for later retrieval (after termination) http://answers.unity3d.com/questions/34828/save-meshfilter-for-retrieval-even-after-app-termination-iphone-android

Jan 11 '11 at 12:04 AM ina
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1366
x301
x54
x3

asked: Jan 03 '11 at 04:57 PM

Seen: 1317 times

Last Updated: Jan 03 '11 at 04:57 PM