x


editing mesh inside unity via bones

hello, I'm not sure myself exactly what I'm talking about, I know little about animation.

Basically what I'm thinking about doing is: say I have cylinder or box. now ordinary box has 4 vertexes or points that make its side, a Polygon.

now say I have box with 3 rows of such vertexes, and I want to be able to say move middle vertexes and make upside down V. I move some object or handle in unity and those 4 poly-s follow.

now lets say I have box with 200 rows of such vertexes and handles, and I want to make road within unity by moving handles and altering the mesh.

is there any way to accomplish thing like this? I know vertexes can be assigned to some object (or is it only bones?) in 3d applications and when you move this objects vertexes follow. but will this kind of thing work in unity ?

I'm pretty sure this won't work, but if its possible this would help me a lot, eliminating need to export road 3244223 times from 3d software.

more ▼

asked Apr 19 '10 at 12:43 PM

Hellwalker gravatar image

Hellwalker
35 7 7 13

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

2 answers: sort voted first

I guess it would be possible to write an editor script that lets you select vertices and move them around to modify your mesh. I haven't tried this, but you do have access to the vertices inside a mesh, and it should be possible to select a certain vertex of a mesh using raycasts, so it would be possible.

You could also take a look at AngryAnt's Sketch. http://angryant.com/ I haven't tinkered with it (yet), but from the description it looks very much like what you need.

more ▼

answered Apr 19 '10 at 03:04 PM

StephanK gravatar image

StephanK
6k 39 53 93

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

Yes, it will work. There are several things you need to do in your 3D modelling software:

First, create Bones - Unity imports Bones as a Transform object, which you can manipulate in the Editor. Unity does not support certain other types of animation, such as lattice or mesh-based deforms.

Second, attach your Vertices to the Bones - depending on your software, there are several ways, such as vertex-painting, vertex groups, etc. Make sure every Vertex is attached to a Bone, or you get weirdness.

Then either export a .FBX file yourself, or use Unity to do it. The model will have a Transform object for each Bone, which you just move as desired. Minor warning - when you import a new model Asset, the Scale is set to 0.01, which might make it nearly invisible. Change the Scale larger.

Here are some links that might help:

3D Tools FAQ and Importing Blender Animations

Although the second link is about Blender, some of the issues are generic to all 3D software (such as the need to attach all Vertices to a Bone).

more ▼

answered Apr 19 '10 at 06:15 PM

Cyclops gravatar image

Cyclops
7.1k 33 63 115

Thank You, I'll try this out ! do you know if lots of bones will be perfomance hit?

Apr 20 '10 at 06:49 AM Hellwalker
(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:

x1364
x37

asked: Apr 19 '10 at 12:43 PM

Seen: 2313 times

Last Updated: Apr 19 '10 at 12:43 PM