I want to convert dummies (acting as bones) into actual bones (so BoneTools’
mirroring will work on them). I searched google but found no solution.
I’d do all I could to encourage you NOT to use bones. But if you really must (or want to experience the absurdity that is max bones, or are working on a quickie project), you’ll have to build something yourself. You’ll find it isn’t as easy as it should be (ie, if bones were regular objects), but conceptually it is simple.
function convertDummyToBone d =
(
local b = Bone()
b.transform = d.transform
b.name = d.name
b.parent = d.parent
local children = d.children
if children.count > 0 then
b.length = distance d children[1]
else
b.length = 1 --or some default
delete d
for c in children do
(
c.parent = b
convertDummyToBone c
)
return b
)
I’m not sure if that’ll work exactly how you want it to (or at all) but that’s the idea- replace the dummy with a bone. You just need to pass the root into the method and it should call itself recursively.
Thanks Rob!
Indeed, I was wondering why Epic used dummies instead of real bones…
Okay here is what happened: I was going with the flow and using what I was
given. All went well until I had to adjust the skeleton to fit the updated
geometry. At that point I started to have problems:
- I found now ways to symmetrically edit the skeleton.
- Mirroring the dummy hierarchy created inside-out bones which didn’t sit well
with UDK. - “Bone Tools mirror” doesn’t work.
But then again I doubt that I’m the first person facing this problem so I’m
probably missing something…
Apparently the “Reset scale” feature of the Bone Tools panel works on dummies
too and fixes the insideoutness.
The reset scale feature of bone tools works on any object. Its a nice cheap way to reset the xform of an object without losing the pivot point and no need to collapse the stack. Select all the objects, click the bone on checkbox, reset the scale, uncheck the checkbox.
If you have time, I’d suggest toying around with your own object ‘mirroring’ tool. True mirroring involves an inverse scale, and we never want non-default scaling when rigging, so using the Mirror tool doesn’t work, as you found out. What you really want to do are a set of rotations about a pivot (the origin, probably), which you can do with some matrix multiplication. There are plenty of examples around cgtalk that you can port to suit yourself (I’ve found some of them of dubious quality, though).