I published a new version of the tool, hopefully it should work for you now!
Winterdust
Creator of
Recent community posts
I've not tested using CreateAsset() and SaveAssets() with the returned AnimationClip since the tool is not intended to create regular assets (it's for loading BVH files every time the game runs). Currently I don't have a setup to perform testing on, but seems like you need to use SetDirty() to mark assets to be flushed with SaveAssets()?
However it's possible that the dynamically created AnimationClip is lacking something internally that Unity is expecting for assets imported the normal way, if that's the case the AnimationClip needs to be modified in some manner (outside the scope of the tool) before being saved. If the AnimationClip can't be fixed you could use prepareAnimationClip() to get a more raw version of the clip data in order to somehow put together and write a regular unity asset (using the PreparedAnimationClip.CurveBlock struct).
Sounds something like ParseSingle() expecting numbers to use comma instead of period as the decimal point. Try specifically setting C#'s culture info to en-US before doing the BVH calls. ParseSingle() should then recognize the format as being correct.
System.Globalization.CultureInfo timeCultureUS = new System.Globalization.CultureInfo("en-US"); Thread.CurrentThread.CurrentCulture = timeCultureUS; Thread.CurrentThread.CurrentUICulture = timeCultureUS; //BVH related things here
Depending on how well you fit the skeleton inside the model you might want to instruct MeshSkinner to not "ignoreJointsUntilInsideMesh". Below is a version of my example code with makeSkeleton() instead of makeDebugSkeleton(). I had to set ignoreJointsUntilInsideMesh=false because when makeDebugSkeleton() is called with a jointSize!=0 meshes are created to visualize the joints, causing makeSkeleton() to look different. I've made a note to try to fix this if I update MeshSkinner (will make the work routine not take meshes on the skeleton GameObjects into account).
BVH bvh = new BVH("C:/temp/notch-format.bvh", -10); bvh.scale(100); GameObject skeleton = bvh.makeSkeleton(); //changed line MeshSkinner.DESTROY_ORIGINAL_MESH_RENDERER = 1; //new line MeshSkinner ms = new MeshSkinner(GameObject.Find("dummy_obj"), skeleton); ms.workAndFinish(ignoreJointsUntilInsideMesh:false); //changed line Animation a = BVH.animateSkeleton(skeleton, bvh.makeAnimationClip(-36, -10, true));
While testing with Unity 2019.1 it seems like an old quirk have been fixed in Unity now, creating "SkinnedVersion" GameObjects is no longer needed. That's why I'm setting DESTROY_ORIGINAL_MESH_RENDERER to 1 above, it's not needed but should free up some resources while the game's running.
Another issue I noticed with Unity 2019.1 is that system locale matters now (coutry number formats, "comma instead of period"). Thanks to this BVH could throw FormatException when parsing numbers. Hopefully this is just something Unity has overlooked and will revert, I don't see it as a good thing when code don't run the same on different computers simply because comma is expected instead of a period. I'll take the possibility into account if I update BVH but in the meantime this can be fixed by defining the desired culture in your code (only needs to be done once, before the BVH class is used):
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo("en-US");
You need to use BVH to create a skeleton in the rest position, then you move the skeleton GameObject to align with the rest position of the model, then you use MeshSkinner to apply the skeleton to the model. The problem here is that the BVH rest position has the arms straight down but the model rest position is in T-pose.
In the example below I rearranged the arms of the model you linked to so they became a child of the shoulder GameObject and then I rotated and repositioned the shoulders so the model was no longer in T-pose. This was done in Unity with "dummy_obj.obj" (didn't use Blender or something else). Now the rest pose of the BVH was roughly the same as the rest pose of the model and I could align the skeleton with the model.
The arrangements was made in Unity's play mode with a debug BVH skeleton (xray turned on). After everything looked good I copied the root "dummy_obj" and stopped play mode. The model was reset, I deleted it and then pasted the arranged version. Now when I enter play mode the model is aligned with the skeleton created by BVH.
Finally I call BVH's static animateSkeleton() helper method to animate the thing. I used "Full-body Walking" from the page you linked to (notch-format.bvh), it was tiny so I scaled it up by 100 to fit the model. I imported the BVH at 10 fps and looping between frame -36 and -10 with an extra loop keyframe added produced a seamless walking animation. However, due to the rest pose of the BVH the MeshSkinner incorrectly thinks part of the model's hip is part of the hand bone. It might be possible to tweak this issue away in MeshSkinner before the work call, but best would be to find .bvh files that have the skeleton rest positions in T-pose or A-pose.
BVH bvh = new BVH("C:/temp/notch-format.bvh", -10);
bvh.scale(100);
GameObject skeleton = bvh.makeDebugSkeleton(animate:false, xray:true);
MeshSkinner ms = new MeshSkinner(GameObject.Find("dummy_obj"), skeleton);
ms.workAndFinish();
Animation a = BVH.animateSkeleton(skeleton, bvh.makeAnimationClip(-36, -10, true));
It's been a few years since I wrote the code but localFrameRotations should be the rotation of the bone's beginning so that it points towards its end, in other words it's a look rotation. You could try setting localFrameRotations using Quaternion.LookRotation(<the bone's worldspace forward Vector3>, <the bone's worldspace up Vector3>);
Hi, glad you like it! The only documentation available are the descriptions for the methods. For creating brand new BVH animations it might be easiest to put them together using something like Blender, although it could be possible to puzzle it together in Unity as well through the methods. It's been a while since I experimented with the tool myself. Frames could also be copied manually between .bvh files by opening them in for example WordPad, if it's just a matter of combining some parts.
I can guarantee 100% that there's nothing fishy in this game and that Norton made a mistake. As they say on their own website WS.Reputation.1 isn't an actual identified threat, it's an AI guess based on analytical data. The main executable launches "JBC.prg", which Norton probably think is suspicious behaviour. Why I made it like that is because otherwise the program's icon was stuck in low resolution, a strange limitation of Adobe AIR at the time I created the game. I can't stress enough that there's nothing malicious with my game, the reason why nobody have reported any problems even though it has been for sale for years is because there aren't any.
The tool can adjust the animation in different ways but it doesn't have anything that automatically places the skeleton in a T-pose. Although it can be used to edit a BVH in detail directly via script it wasn't built with that purpose in mind. Unfortunately there aren't any videos available at this time.
Hi, terribly sorry for the late reply. Perhaps you've been able to move on by now? All I can really think of from what you've written is to make sure the paths are correct by modifying pathToSkeletonGO in the makeAnimationClip() method and make sure the joint names match in the BVH file. As I previously mentioned before in a different thread BVHImporterExporter was never really intended for Mecanim, though it should work with a bit of extra work. I can't really help with Blender though if that's giving you trouble. Hope you succeed with your goal! Btw you're not making a tool that repackage my tool and give people access to its features, right?
I mainly made the plugin to go with https://winterdust.itch.io/bvhimporterexporter in order to make modding games easier. Basically you wouldn't need to bake everything into your game but can simply read files from a folder and apply the skeleton and mesh during runtime. So modders just need to modify files in the folder without needing to use specific modding tools for your game. But it can have other uses too, for example say that you randomize a mesh in your game and afterwards want to modify it simply by moving a few points. Simply let those points act like a skeleton and use MeshSkinner to connect them with the mesh. You could also modify a mesh, for example make a character's nose bigger due to some spell cast in the game or something, and then refresh the model afterwards using the MeshSkinner.
Didn't mean that itch.io should provide a tracker or seed the torrent, an open tracker can be used for this method and the developer will do the initial seeding themselves.
If however itch.io provides a private tracker, generates a torrent file for each uploaded file and then start seeding it automatically (when the go-ahead is given by the account owner) that would of course be even better! It would be a bit of an undertaking to set it all up.
Right now I myself don't have a game that is several GiB in size but I'd like to share one way of providing an alternative download option. So here's a simple way you can do large content distribution on itch.io:
1. Archive your product with 7zip. Split it into several files and encrypt with a password. Tick the option to make a self-extracting archive.
2. Put the self-extracting archive ("YourNameHere.exe") as well as a random 5% of the other created files into folder "PAID". Put the rest into folder "DIST".
3. Make an empty text file named "! this is the official distribution torrent, note that some data of the full release is missing here.txt" inside the DIST folder. This will prevent some misunderstandings and help reduce potential annoyed comments.
4. Create a torrent-file of DIST, use a couple of open trackers. Note: You can put an actual demo in the DIST folder to distribute that here as well if you want to. People who has bought the game can just instruct their BitTorrent client to not download the demo.
5. Make the torrent available for free on itch.io by marking it as a "demo". If the torrent does not actually contain a demo make sure to name the file something like "Warning, this is actually not a demo, this is the data distribution for release X.torrent".
6. Archive the PAID folder. Encrypt with the same password as the first step. Tick the option to make a self-extracting archive, but don't split it into several files this time. Name it "run_me_first.exe" or something like that.
7. Make "run_me_first.exe" available for those who have paid on itch.io.
8. Also make a text file named "password.txt" available for those who have paid. Put the encryption password in there, as well as some more detailed instructions on how to use the distribution torrent (you can for example mention that they can delete the files downloaded via BitTorrent after unpacking the game). Even more alternative options for downloads can be put here, FTP servers or links to dedicated web servers that hand out your content.
9. Explain on the itch.io page how this works: They download the main amount of data via BitTorrent. Then place "run_me_first.exe" with the other files and run it. Finally they should run the now-available "YourNameHere.exe". Afterwards the product is ready to be used!
By using this method people only need to download a small percentage of the actual game size from itch.io, the rest comes via BitTorrent and can download at very decent speeds. If there's any pirates around chances are they will help seed the torrent as well, giving paying customers higher speed (note that this method of distribution doesn't increase the piracy threat, they would have pirated it anyway. Now you're at least getting some bandwidth from them).
I hope someone finds this feasible and useful!
Please check out my tools for the Unity Engine at https://winterdust.itch.io/ as well as the game JezzBall Classic.
Ever wanted to bind a skeleton to a mesh during runtime in your game?
With MeshSkinner you can! Simply provide a GameObject containing one or more meshes and another GameObject containing your skeleton hierarcy and the needed SkinnedMeshRenderer component(s) are added.
Features:
+ Creation of fully working SkinnedMeshRenderers that affect the mesh depending on joint movement.
+ Automatic weights through heat, up to four influences per vertex (max in Unity).
+ Several methods that allows you to modify the end result, such as how "bendy" a joint should be (rubber effect).
+ You can paint weights manually if you want to.
+ Skin any mesh, not just humanoids (animals or objects work just fine).
+ Optimized to be very fast, despite all the calculations.
+ Supports multi-threading for most of its work.
If you want to have easy-to-use mod support in your game this is a great way to enable it!
Check it out: https://winterdust.itch.io/meshskinner
1) There might be a way but right now I haven't implemented such a feature. I can see how it would be useful though and will be looking into it if I make an update! It's likely it will be an editor-only feature though and not not available in the demo.
2) Using the Mecanim system is possible but not simple. You have to create an Animator Controller in Unity and set it up with dummy animations, which means no previews (make blank states, set their motion to any AnimationClip you've got in your project). You also prepare an Animator Override Controller (AOC). Then during runtime you replace the original dummy clips in the AOC with the real ones created using BvhImporterExporter ("bvh.makeAnimationClip(pathToSkeletonGO:"MySkeletonGOName", legacy:false);"). Finally you instruct the Animator to use the override ("myAnimator.runtimeAnimatorController = AOC;").
Sticking with legacy might be just as simple or even simpler unless you intend to do some advanced stuff. The legacy Animation system is not deprecated even though Mecanim has been around since 2012 when Unity 4.0 was released. After trying to work with Mecanim from code I understand why, the Animation system has better access from code so Mecanim isn't a replacement (yet at least). I haven't for example found a way to create an Animator Controller from scratch via code during runtime, it seems to be an impossible task outside the editor.
Did a little test just now to make sure it works. Here's the code I used:
BVH bvh = new BVH("dance.bvh");
BVH.animateSkeleton(GameObject.Find("MySkeletonGOName"), bvh.makeAnimationClip());
1) I used MakeHuman ( http://www.makehuman.org/ ) to make a model. I exported in mesh format "Collada (dae)" and made sure to select the Bone Orientation Option "Local = Global" (important/required since it makes sure no joints are rotated).
2) I imported the .dae file into Blender ( https://www.blender.org/ ) and made a little animation. I exported it to format "Motion Capture (.bvh)" and checked the "Root Transform Only" option (it isn't required but I really recommend it since it makes the BVH file smaller by removing positional data usually not used).
3) Made a new scene in Unity, it imported the .dae file automatically. I dragged it into the scene, opened up the model GameObject in the Hierarchy and renamed the skeleton GameObject to "MySkeletonGOName" (just so I can use GameObject.Find()). The skeleton is the one that only contains a bunch of transforms.
4) Made a new MonoBehaviour script and put my two lines of code in its Start() method. Could have been one line of code btw, the bvh variable isn't really needed in this case.
5) Pressed play and the model made by MakeHuman danced via the BVH animation made in Blender. It works!
Blender Tip: If you go "Export > Collada (Default) (.dae)" you need to check "Export for OpenSim" under Armature Options. It removes bone rotations so that the skeleton joints become compatible with BVH. So you can create models from scratch or modify the mesh of existing ones if you want to.
Yes you can! If the imported model has exactly the same skeleton structure and joint rotation as the BVH it should work just fine.
In BVH all joints are always Quaternion.identity in the resting pose, in other words, not rotated. If the model imported by Unity has a skeleton with rotated joints the animation will appear incorrect since BVH base all rotations in the AnimationClip from Quaternion.identity. I tried to make a method that adapted a BVH to an already existing skeleton but it was tricky to make it work without some rotations being flipped the wrong way so I couldn't include it in the final version of the product.
I'm currently working on a different product that skins a mesh from a skeleton during runtime, it'll ensure that the joints have the correct rotation. I'm making good progress but I don't know when it's finished. I recommend that you download the demo of BvhImporterExporter and see if you can achieve what you need. The most important thing is that the model's mesh was skinned to the skeleton when the joints wasn't rotated, then the AnimationClip created from BVH will move the skeleton correctly!
Check your model in Unity (make sure it's in its rest pose - you can uncheck "import animation" for the model in the inspector). If all the GameObjects that make up the skeleton have Transform rotation [0,0,0] you're good to go! Assuming that the skeleton has the same structure as the BVH of course (matching bone names).
Ever wanted to dynamically import a skeleton during runtime in your game?
With BvhImporterExporter you can! Simply give the path to a .bvh file to the BVH class' constructor and the skeleton and its animation will be imported into the game.
Features:
+ Import skeleton rest pose and animation into Unity during runtime.
+ Several methods to help you modify the imported data to for example change the frame rate, rename bones or make a skeleton "run in the same spot".
+ Export the modified BVH back to a new .bvh file if you want to fine-tune it in for example Blender.
+ Create AnimationClips that works with both the legacy system and the Mecanim system.
+ Extremely fast, most animations will only take a few milliseconds to import.
+ Able to not import every single frame in an animation for even faster import time and lighter resource demand (useful if you have 120 FPS .bvh files but don't need that much in-game).
+ Supports multi-threading for most of its work.
A showcase "BVH Viewer" is available (with C# source code).
If you want to have easy-to-use mod support in your game this is a great way to enable it!
Check it out: https://winterdust.itch.io/bvhimporterexporter
The Android and iOS versions of the game have now been updated to 2.0.0 as well:
The game was created to be exactly like the original JezzBall from 1992, just with a lot of extra game modes and optional better graphics.
https://winterdust.itch.io/jezzball-classic
Gameplay: A bunch of Jezz atoms is bouncing around in a capture chamber. It is your job to deploy wallbuilders until over 75% of the chamber has been filled with walls. Time your deployments correctly - if pending walls are hit by an atom they are destroyed and you lose a life!
Also available for Android and iOS.
Please take a look at https://winterdust.itch.io/jezzball-classic for more screenshots and information.