R Soul on 2/1/2015 at 20:13
A few of us have mentioned custom motions in the 'What are you working on' thread, so I think it would be best to have a separate thread for that topic.
Download:
Get the LG Toolkit from this page:
(
http://whoopdedo.org/projects.php?dark)
I haven't looked at the other tools but the two .py files are relevant to motions.
Although Blender has its own Python interpreter, I haven't been able to run these scripts from Blender, so I downloaded Python and ran the scripts from a command prompt.
To convert a Thief .mi file to bvh, I wrote this batch file:
set root=c:\motions
python %root%\mi2bvh.py %root%\%1.mi %root%\manbase.cal %root%\biped.map %root%\%1.bvh
pause
manbase.cal and biped.map can be extracted from mesh.crf.
The .bvh can be imported into Blender. The orientation will be wrong if you use the default settings. Select
Y Forward and
Z Up and the orientation will be correct. Different settings may be needed if the bvh file has come from another source.
To begin manipulating joints, switch to Pose mode (the Tab key should allow this). Select a bone and if you're using the default view you will see the timeline at the bottom, and there will be lots of yellow lines. Each of these is a keyframe. The purpose of keyframes is to record value (e.g. joint angles) at specific frames. The program can smoothly interpolate the values between each pair of keyframes. To edit a joint you should delete its keyframes (but leave all others alone).
I'm not sure how much detail is needed, so for now I'll be brief. You need 3 or 4 windows visible. The 3D View (to select joints and see the animation), the Dope Sheet (optional) (which allows you to move keyframes after they've been set), the Graph Editor (where you can move/delete keyframes and modify the interpolation), and the Timeline (for playing/pausing the motion and setting start and end frames).
If you want to modify a motion to have the left arm raised, select the left shoulder, press B and drag a box over the desired frames (or A for all of them). Press X to delete the keyframes. Set the initial rotation, point the mouse at the values (3D view, properties panel (N)) and press I to set the first keyframe. Alt+I removes the keyframe.
Select another frame. Animations play at 30fps. Rotate the shoulder again add another keyframe for rotation.
You can set up multiple keyframes and use the graph editor to modify the curves to make it look more natural.
When finished, export as .bvh. This is the batch file I use to convert to .mi and .mc:
set root=c:\motions
python %root%\bvh2mi.py %1.bvh biped.map 7FFFF %1
[A new motion database will probably be required, but I don't fancy getting into that right now]
So, editing an existing motion is simple enough. You could make a motion from scratch using interpolation, but it might look too smooth. It's worth a try to see if you can get anything good. Motion files can be downloaded, but the skeletons usually have far more joints than a Thief motion requires. I might have looked into deleting unnecessary bones but I cannot remember.
edit:
Here's a Blender file containing a 300 frame IdleGesture 0 motion:
(
http://www.mediafire.com/download/p1py52qtdzj0kcg/bh111005.7z)
nemyax on 2/1/2015 at 21:44
Quote Posted by R Soul
Blender file containing a 300 frame IdleGesture 0 motion
Thanks. Is there a "motion" that does nothing at all? It looks like the original rest pose is not available in this file; the one that is there looks lopsided. Or maybe that's really the way they did it.
R Soul on 2/1/2015 at 22:44
I don't think it matters. The angles of each joint have to be applied to the AI mesh, whose joints are positioned in a round about way. And with their low detail I doubt anyone would notice the difference between perfection and the current set of things.
nemyax on 3/1/2015 at 09:12
I tried to knock together a quick rig from that skeleton, but you can't even set up the IK on the left leg without bending the knee a bit in pose mode. The apparent rest pose probably varies from .mi to .mi. What I'd like to see is the original skeleton without any rotations applied.
But then, the changes could have been caused by the conversion from whatever .mi uses to Euler. The animation is pretty twitchy in Blender. I don't remember it being like that in the game.
PinkDot on 3/1/2015 at 13:27
@nemyax - are you referring to the issue from this picture?
(
http://smg.photobucket.com/user/TodKnip/media/BVH_armsorientation_zpsa55a752b.jpg.html)
Inline Image:
http://img.photobucket.com/albums/v305/TodKnip/BVH_armsorientation_zpsa55a752b.jpgThis is something I noticed when I was importing motions into Blender. Left arm has the bones oriented correctly, while the right one has weird twists applied. Not sure why is that, as there's no info on joints orientation in the CAL file. And it's not significant any way, as all rotations are applied in character's space - not bone's/parent's space.
Quote:
I tried to knock together a quick rig from that skeleton, but you can't even set up the IK on the left leg without bending the knee a bit in pose mode. The apparent rest pose probably varies from .mi to .mi.
I noticed that too - I'm going to force a knee joint correction for my imported characters, to make IK work.
Quote:
What I'd like to see is the original skeleton without any rotations applied.
I don't know much about Blender, but when I imported BVH I could see the skeleton without rotations in a Pose Mode (or Pose View).
If it's not available for some reason, just import any of Shadowspawn's AI in .3ds format - you'll have the joint's positions. In terms of orientation - as mentioned above - there's no info there in the file. In my tools I assumed X axis facing forward, as the forward movement happens along X axis. Then Z the length of the bone and Y facing sideways on the legs and up on the arms when in default position - same as in Motion Editor, I think. But I don't think it's the same convention as in Blender. I guess it doesn't matter as long as the export tools convert the axes back to dark engine's convention.
nemyax on 3/1/2015 at 20:22
PinkDotI was mainly referring to the fact that the supposed rest pose isn't symmetrical. And the fact that it has to be corrected for IK.
Quote Posted by PinkDot
In terms of orientation - as mentioned above - there's no info there in the file.
Interesting. Where is this information?
PinkDot on 4/1/2015 at 11:04
Quote:
Interesting. Where is this information?
Nowhere. BVH file stores only the offsets of joints. So it must be the way Blender importer works. I was having a chat about that with Olfred, who also uses Blender for motions and he had no idea where it comes from.
Quote:
The animation is pretty twitchy in Blender. I don't remember it being like that in the game.
Pretty much all of the motions from Thief are twitchy. It seems to be sort of less noticeable in game environment, but it is there. It hasn't been that much of an issue, when the screen resolutions used to be 2-3 times smaller 15 years ago.
FireMage on 19/1/2015 at 19:41
A little discovery:
The difference between a Humanoid and Human With Sword is just for hardcoded stuff. For exemple to do a Locomote motion, you should split your locomote motion in two motions, one for the left leg and another for the right. If your locomote motions are with the humanoid type, the game will play only one of them, but the human with sword, it will work perfectly!
This is all that I know for the moment about the difference between these two categories.