#375 More advanced selection/editing of skeleton, including support for 0-length bones

None
open
nobody
None
5
2015-02-19
2009-03-02
Saar Korren
No

I encountered the problem following an unintended double-click while creating bones (Some USB mice tend to send double signals, and Windows has no "minimal double click delay" option).
Along with the desired bone, a 0-length child was created. Attempting to select the child kept selecting the parent. And since length is locked by default (why? ctrl+click rarely hits the right point on first try...) all the forward and inverse kinematics did nothing to separate the child from its parent.
Even after duplicating the parent, and completely detaching the original from the rest of the skeleton, there was still no way to remove the unwanted child since parents can't be deleted.
Even trying to select and hide the parent didn't help, since joints can't be hidden.
What more, there's no way to move a parent without moving the child, it can only be detached from the mesh's vertices, but not from its children.

Eventually, I've managed to delete the unwanted bone using the following script:

scene = window.getScene\(\);
choice = new BList\(\);
for \(i = 0; i < scene.getNumObjects\(\); i++\)
choice.add\(scene.getObject\(i\).getName\(\)\);
dlg = new PanelDialog\(window, "Select Object", choice\);
if \(\!dlg.clickedOk\(\)\)
return;
obj = scene.getObject\(choice.getSelectedIndex\(\)\);
skel = obj.getSkeleton\(\);
if \(skel == null\) \{
new MessageDialog\(window, "Object is without a skeleton."\);
return;
\}

joints = skel.getJoints\(\);
choice = new BList\(\);
for \(i = 0; i < joints.length; i++\)
choice.add\(joints\[i\].name\);
dlg = new PanelDialog\(window, "Select Joint", choice\);
if \(\!dlg.clickedOk\(\)\)
return;
joint = joints\[choice.getSelectedIndex\(\)\];
skel.deleteJoint\(joint.id\);

Incidentally, that would have gone smoother if scripts could be used from within the mesh editor, instead of only from the scene editor.

The problem has several possible solutions:

Solution 1: Skeleton tree control
Just like objects in the scene are easy to select using the tree, a skeleton tree control inside the mesh editor would really help easily selecting bones, without having to rotate the view for a good angle all the time.
In fact, a vertex list may also be nice for the same purpose, although given the average vertex count on an object, that may be less practical then the above.

Solution 2: Hide bones
Hiding is a number one method for "select behind". Think about it, you select the wrong object, hide it, then the object behind it is revealed. You can even do this progressively, hiding until only what you want to select remains.
This already works fairly well for vertices, faces, and edges. Bones, however, are unhideable. Allowing bones to be hidden (separate from children bones, of course) would make "selecting through" possible.

Solution 3: Allow delete parent bones
Okay, this only works for deleting the bone, and creates extra work in detaching the parent, so it's not exactly an optimal solution. Whether this detaches the children or deletes them, this does provide a solution either way.

Solution 4: Command to detach children
Similar to the above, but less destructive.
It should be noted that the above two solutions only help if you have a 0-length bone by accident, and just want to remove it. If you're using it as part of a skeleton shape animation, and want to stretch it in a specific keyframe, you've got a problem.

Solution 5: Temporary detach children
This may actually be helpful in other scenarios, if you're not particularly happy with the IK engine.

Solution 6: Highlight and cycle
This is an alternate selection method which may be generally useful throughout the program. Basically, when you hover over a selectable item, it is highlighted in a different color from the selection color (e.g. green instead of red). This lets you know exactly what you're about to select.
Then, if you move the mouse a few pixels "in place", that is, back and forth without leaving some predetermined tolerance (bounding box wouldn't work, since a single vertex may be obscured by two in a way that only one or two pixels are inside the overlap, leaving no room for "shaking"), it cycles to the next selectable object behind it.
So, if you see the wrong object selected, you just shake the mouse a bit until you get to the object you want. Then, a simple click selects it. Works for both coinciding objects, and depth-obscured objects, no rotation necessary.
In the case of vertices, it might be useful to also highlight connected edges, so the vertex's identity is more clear.

Solution 7: Command delete/edit bone with list selection
Much like what my script does, but from within the mesh editor, for convenience. Inferior to #1.

Discussion

  • Luke S

    Luke S - 2014-12-27
    • labels: --> Feature
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -5,6 +5,8 @@
     What more, there's no way to move a parent without moving the child, it can only be detached from the mesh's vertices, but not from its children.
    
     Eventually, I've managed to delete the unwanted bone using the following script:
    +
    +~~~~~
     scene = window.getScene\(\);
     choice = new BList\(\);
     for \(i = 0; i < scene.getNumObjects\(\); i++\)
    @@ -28,6 +30,7 @@
     return;
     joint = joints\[choice.getSelectedIndex\(\)\];
     skel.deleteJoint\(joint.id\);
    +~~~~~
    
     Incidentally, that would have gone smoother if scripts could be used from within the mesh editor, instead of only from the scene editor.
    
    • Group: -->
     
  • Luke S

    Luke S - 2014-12-27

    This is more of a feature request, and should probably be moved to the feature tracker. Peter, was that something I was supposed to be able to do? I've looked, and don't think I have the permissions...

     
  • Peter Eastman

    Peter Eastman - 2014-12-29

    Ticket moved from /p/aoi/bugs/383/

     
  • Peter Eastman

    Peter Eastman - 2014-12-29

    I just moved it. Do you have a "Move" button at the top, right next to the "Edit" button?

     
  • Luke S

    Luke S - 2014-12-29

    I do not. Just the subscription and .rss icons.

     
  • Luke S

    Luke S - 2015-02-19
    • labels: Feature -->
    • summary: 0-length bone cannot be edited or deleted --> More advanced selection/editing of skeleton, including support for 0-length bones
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks