Closed GoogleCodeExporter closed 8 years ago
I can't compensate for changes to an skeleton against an unknown other skeleton.
I also can't realistically start doing crazy things with bone rotation. I used
to rotate and connect bones with only one child, but then I realised how bad
doing that was. The fact that rigging requires bones to be pointing in a
certain direction is a flaw in Blender and it can't be overcome with an export
script. :(
If you really want to fix this, your best bet is to keep an unmodified version
of the "real" skeleton alongside your modified one. Then you would write some
code which compensates for the differences, exports via the SMD Tools, and
lastly undoes all of its changes.
Original comment by cont...@steamreview.org
on 12 Sep 2012 at 6:27
In case anyone is wondering what I did:
I have attached a script that adds a panel in the Armature tab of the
Properties Window to copy animation between armatures.
How I set up the animation environment:
I duplicate the armature right after import and set it up with IK
constraints/connected bones/etc. (Just don't change the hierarchy or bone
names) It is important not to change the bone head positions (in edit mode) in
your duplicated armature.
The transfer process is quite slow due to all the matrix multiplication and
scene updates.
It's my first time writing a blender script, so I'm sure it can be improved.
Original comment by invitem...@gmail.com
on 14 Sep 2012 at 6:34
Attachments:
Wow, nice work!
Original comment by cont...@steamreview.org
on 14 Sep 2012 at 7:30
Thanks! :)
Original comment by invitem...@gmail.com
on 14 Sep 2012 at 8:03
My script was going so slow because of all the keyframe_insert calls. I
modified your script (attached) to account for the differences in bone tail
locations.
Workflow:
Import dmx file (e.g. medic_morphs_high.dmx).
Duplicate the armature upon import, and name it whatever the old one was with a
_ref at the end. (e.g. 'pyroInfo' becomes 'pyroInfo_ref') Hide it so it doesn't
interfere with selecting bones.
Select the original armature in object mode and run rig_biped_simple.py
(attached) on it. (You can rig it however you want as long as the hierarchy,
bone names, and bone heads stay the same.)
Animate the armature.
Bake the animation using Blender's "Bake Action" feature.
Export the action on the armature.
This is much faster than using my script.
Perhaps you can add a button in the export panel that says "Reference
armature:" and then a drop down box to select a reference armature. Of course,
this drop down box can be left blank.
Original comment by invitem...@gmail.com
on 16 Sep 2012 at 2:52
Attachments:
Sorry, but I'm still not keen on the idea of implementing this sort of generic
functionality into a format-specific export script.
I've spent a bit of time looking into this problem today and there are already
solutions provided by Blender:
wiki.blender.org/index.php/User:Benjycook/GSOC/Manual
Original comment by cont...@steamreview.org
on 16 Sep 2012 at 10:48
I tried out the motion capture tools, but they seem too specialized for the
simple task of recalculating bone matrices based on tail position. The
animations were warped when I retargeted them. I guess I wasn't using it
correctly.
I know you won't change your script or anything, but I have changed it again so
that the user can edit the bone tails on the imported armature without having
to do any additional work to fix the animation. I add some extra matrix data to
the armature upon import (like this smd.a['ref_matrices'] =
getReferenceMatrices()) I didn't change smd export, just DMX.
This should be useful for people trying to animate dmx characters for source
filmmaker. If there were some faster alternative to keyframe_insert in my
armature transfer script, I wouldn't bother changing your script in the first
place.
This page explains why my armature transfer script was so slow:
http://web.archiveorange.com/archive/v/1bjALe7UdM9tp50ioV9i
aligorith encourages baking to go the other way, so that's what I did.
Thanks for all your suggestions. I understand this change doesn't really fit in
with the smd tools addon, but hopefully someone else will find this version of
it useful.
Original comment by invitem...@gmail.com
on 17 Sep 2012 at 12:35
Attachments:
Original issue reported on code.google.com by
invitem...@gmail.com
on 12 Sep 2012 at 5:56