- Home /
How to make Bones visible in Editor Mode ?
How can I make the Bones of rigged .fbx character visible in the editor mode so I can properly use em
Answer by robert · Nov 24, 2009 at 08:35 AM
Bones are represented as plain transforms in the hierarchy view as children of the object the animation is on. You'll see the bone's pivot when you selected it's transform in the hierarchy view.
How would you like to "use them"? If you mean modifying the poses/animations, then you should do it in your animation application. If you mean playing animations, then you don't need to access individual bones. If you would like to attach an external object to a bone, so that it follows the animation, you can attach it in the hierarchy view, as described above.
To make a generic rig ragdoll or ragdoll from scratch by adding colliders would be one example where it would be useful to see the bones.
This is not the best answer. Best answer is not why you want to do it. Never been. Don't write these kind of answers if you don't know. He just want to do, there's no problem.
Answer by MaDDoX · Jul 23, 2010 at 04:17 PM
Best chance here to get some editor feedback for the placement of your bone is to add a gizmo to your joint transforms: http://unity3d.com/support/documentation/ScriptReference/Gizmos.html
You can even have a 3D shape as a gizmo, for instance a cube, and have a script automatically calculate the gizmo size and orientation by comparing the current joint with the child one(s).
It would probably take some time to tweak it all to perfection, so I'd only do it if you really need to check the "bones" in-editor for some very fine tuning. If you go for it, please consider sharing the script(s) with the community in Unitywiki. Good luck!
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class ViewSkeleton : $$anonymous$$onoBehaviour
{
public Transform rootNode;
public Transform[] childNodes;
void OnDrawGizmosSelected()
{
if (rootNode != null)
{
if(childNodes == null)
{
//get all joints to draw
PopulateChildren();
}
foreach (Transform child in childNodes)
{
if (child == rootNode)
{
//list includes the root, if root then larger, green cube
Gizmos.color = Color.green;
Gizmos.DrawCube(child.position, new Vector3(.1f, .1f, .1f));
}
else
{
Gizmos.color = Color.blue;
Gizmos.DrawLine(child.position, child.parent.position);
Gizmos.DrawCube(child.position, new Vector3(.01f, .01f, .01f));
}
}
}
}
public void PopulateChildren()
{
childNodes = rootNode.GetComponentsInChildren<Transform>();
}
}
usage: add script to something, add in a root node and it will draw connections with the children essentially.
I needed this more than you know, thanks so much!!! :)
Thanks for the script, I've just had to make a small fix in one if to make it working. if( childNodes == null || childNodes.Length == 0 )
.
Thanks a lot for the reply and the code guys. That works perfectly. It's nice to see people actually helping solving issues, ins$$anonymous$$d of discussing "why do you need to do that...." hahahaha
Really helpful to check how the animation works in a test phase, when you need to see JUST a skeleton, because you don't have a geo in that asset.
Thanks $$anonymous$$aDDoX/$$anonymous$$olenda! :D
Answer by Muskar · Dec 30, 2019 at 03:53 PM
Not the answer that the OP was looking for, but I pressed hide all gizmos to hide the bones of a Sprite Skin (2D bones), so I could see the details of my animation better - and then I couldn't figure out how to show the bones again. Turns out I just had to open one of my Sprite Skin components on one of my Game Objects.
Writing this in the hope that this will help others with a similar problem, coming here from a search engine.
Answer by originalhappiness1 · Apr 18 at 10:19 PM
If you want to see the bones in the scene view you can 1.Select your character in the hierarchy 2.Click Animation Rigging on the top, next to component and game object 3.Select Bone Renderer Setup
This should show your bones for your character
Answer by jrodiles · Nov 21, 2018 at 04:30 PM
it just works!! thank you I also try the Visible Skeleton script, that comes in the Adam Character Pack