Jump to content

[SOLVED] Armature animation import weirdness.


Recommended Posts

My Skylon cargo bay had to be animated with bones. Besides that I followed the same steps as I did when exporting and importing the gear animation fbx.

When I placed the thing in the scene, it gave me these Skinned Mesh Renderer components on many of the objects in the hierarchy.

Could someone please explain the indicated things?

What does that component do?

What are those bounds and why are they so huge? The one in the image for example is for a tiny part of the bay door mechanism indicated by the arrow in the middle. They don't even move that far.

dqVGGQt.png

Edited by Cpt. Kipard
Link to comment
Share on other sites

cast/receive shadows work just like standard mesh renderer; same for Materials list.

KSP doesn't use Light Probes far as I know. I don't know exactly what it does or how it works.

Quality is vertex weights and bones. Unity supports maximum of 4 bone influences per vertex. the setting that controls how many bones you want to influence a vertex in a mesh.

Update when Offscreen will keep the mesh from being culled from rendering when bounds box is outside of camera's view cone. The bounds box is used to estimate whether a skinned mesh object is in view or not. if the bounds box is not in view, the entire mesh is not rendered, even if parts of it are still in view of camera. If some bit of the bounds box is inside the camera view cone, then the entire mesh is rendered and updated with whatever bone animation there is. I don't know how much of a performance hit it is to always render a skinned mesh object, but probably not a big deal for simple things. Bac9 did mention Kerbals are expensive to render because of skinned mesh.

mesh and root bone are not really changed much, assigning wrong mesh to bones not intended for it is pointless.

Link to comment
Share on other sites

Update when Offscreen will keep the mesh from being culled from rendering when bounds box is outside of camera's view cone. The bounds box is used to estimate whether a skinned mesh object is in view or not. if the bounds box is not in view, the entire mesh is not rendered, even if parts of it are still in view of camera. If some bit of the bounds box is inside the camera view cone, then the entire mesh is rendered and updated with whatever bone animation there is.

So i guess it's safe to make some of those slightly smaller.

I don't know how much of a performance hit it is to always render a skinned mesh object, but probably not a big deal for simple things. Bac9 did mention Kerbals are expensive to render because of skinned mesh.

What do you consider simple?

qAF03PM.gif

mesh and root bone are not really changed much, assigning wrong mesh to bones not intended for it is pointless.

I don't understand. What do I do here?

Also, how do you know so much about these things?

Link to comment
Share on other sites

I'd consdier skinned mesh for a procedural Wing simple. the mesh is maybe 2 dozen vertices and whole rig is 3 bones.

What you have is kind of complex. the amount of mesh being driven by bones probably affects performance more than anything else. I'd try just childing the armature pieces to the bone rig instead of skinning them, they are rigid parts anyway. it's just that it was easier to setup the constraints and animation in Blender and bake the animation instead of fiddling around with KSP's constraints no? unless the whole armature is a single piece of mesh?

mesh and skeletons are tied together by the vertex numbers associated bone influences. essentially a big spreadsheet: vertex #222 is influenced by bone A @ 0.4; bone B @ 0.1; bone C @ 0.5. etc etc. For each frame the whole spreadsheet has to be processed to update the skinned mesh; reasonable to figure more vertex and more bones = bigger performance cost.

so in relation to mesh and root bone; not much you need to do. unless the object in the scene lost it's link to the import file, then you just go back and reassign the mesh and root bone back to what it's supposed to be. for a mesh to be interchangable for skinned mesh render; the vertex order of the meshes have to be exactly the same or you get bits stretch off into odd places.

I'm guessing most of the stuff, lot of people here know a lot more. :D I just happened to be messing with skinned mesh render last night because I noticed my pWings were being culled in SPH and in flight.

and yeah you can make those bounding boxes much smaller, bigger bounding boxes just means they are less likely to disappear when near the edge of camera view cone. for something small it's usually not a big deal.

Edited by nli2work
Link to comment
Share on other sites

it's just that it was easier to setup the constraints and animation in Blender and bake the animation instead of fiddling around with KSP's constraints no?

Yeah. It's also easier to work with bones, instead of creating your own hierarchy in blender out of mesh objects and empties. But I guess I'll have to do it now.

Link to comment
Share on other sites

back to the original question. the skinned mesh renderer component is added when you import mesh objects skinned to other objects (bone, mesh, dummies, etc), Blender calls it "Armature modifier"; max calls it "Skin Modifier". I'd just child the mesh to the bones in blender, exactly like how you'd do it in Unity. or you can child them after import. If the meshes don't bend or stretch or whatever, childing/linking/parenting is the best way to do it.

Link to comment
Share on other sites

I'd just child the mesh to the bones in blender, exactly like how you'd do it in Unity

That would be ideal but attempts to do so have resulted in the objects being transformed because the "Child of" modifier makes them inherit bone transforms immediately.

There is another way to parent things in blender which allows you to keep the object in the same relative place, but it doesn't work with individual bones afaik.

Link to comment
Share on other sites

can't just drag/drop it under the bone like in Unity? non-inverse-mode? I guess bones are special type of objects and doesn't work exactly the same as regular object.

Not in Blender afaik. The armature is the object. Edit mode allows you do edit the individual bones, like you do with individual vertices on a mesh.

I'll try exporting just the armature and drag/dropping the meshes in Unity.

Edited by Cpt. Kipard
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...