4
$\begingroup$

Someone asked me if we can do what the Skin Modifier does, but in reverse. For example, you started with some Edges and then create an Armature based on those Edges.

If I started with Human Meta Rig or my own bone hierarchy, I would like to be able to traverse down using Python script and draw edges.

I am trying to write script that does this. Can someone point out a way to get me started? Cheers.

$\endgroup$
2
  • 2
    $\begingroup$ traverse down using Python script and draw edges. - this isn't a very clear question, are you asking how to draw data? or how to convert data? You also need to ask a better defined question then How do I get started. $\endgroup$
    – ideasman42
    Jun 24, 2013 at 1:27
  • $\begingroup$ Thanks for all the answers. I guess I was not very clear, but Fweeb is right, this is should be reasonably simple. I ended up creating a script that simple "convert" and draw an edge from every single bones (head and tail). I later take care of the Joining of Edges and "Remove Doubles" manually. It still works. I think a nicer script would be a setup that understand the hierarchy of bones and create edges based on every separate armature. $\endgroup$ Jul 2, 2013 at 5:14

1 Answer 1

2
$\begingroup$

On the face of it (no pun intended), this should be reasonably simple to do. Your script would basically go through the following steps:

  1. Create an empty mesh object
  2. Loop through every bone in the armature. For each bone:
    1. Place a vertex at the bone tip and one at the bone root
    2. Connect an edge between those two vertices
  3. Execute a Remove Doubles operator to remove any vertices that are in the same location as one another (thereby also chaining your edges together.

Wrap that process in its own operator and you're good to go. That's pretty much it. Is there a specific part of that process that you're having difficulty with?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.