![]() |
New Blender addon to import wad objects and animation
Hi guys,
this is a Blender addon that I'm using to export Lara animations in FBX format so that I can import them into Unity. It may be useful also for other stuff, so I'm sharing the code. I didn't test it very well, so I need some feedback. Maybe I can implement more features if they do not require too much time. Here is the github link where you can download the addon: https://github.com/veeti512/wadblender and here is a small video to show how to display the animations if you are not used to Blender: https://www.youtube.com/watch?v=b9EMGA7lkiI PS: I tested it on Blender 2.9 |
This is amazing! thank you so much for this :jmp:
|
I've been looking for something like this! Thank you so much!! :D
|
https://i.imgur.com/IYr2nDU.gif ... I don't know how I missed this thread but this is incredible news! I'm speechless. You just made all the fiddling with different versions of Blender for importing and the need for at least two different MQO plugins obsolete. Not even going to mention the problems of getting the original animations into Blender.
I need a few moments to process this. A million thanks, this is amazing! :hug: :D |
Thank you again for this awesome addon, it works great!
There has been one small inconvenience that I have encountered so far that I wanted to ask about: the textures show up fine in Blender but when exporting as OBJ the texture.png does not get written into the .mtl file. I have to re-assign/reload the texture manually in Blender for it to get added to the mtl. I realize the addon was optimized for fbx, it's just that for Tomb Editor the .obj file format works best when a model is supposed to have shininess. Re-assigning the texture is a small extra step and nothing to complain about, just thought I mention in case it's something that can be fixed easily. edit: after spending a bit more time importing and exporting things, I think having to reassign textures is perfectly fine. It's probably best to manually rename the automatically created texture.png and give it a custom name so the texture doesn't get accidentally overwritten when exporting several models into the same folder and then you have to reassign textures in any case, so it's all good the way it is. :) |
Thank you guys, I'm glad that the tool is useful!
I see the problem with exporting, sometimes it also happens that the uvmap completely disappear. This update should fix it by re-importing the uvmap image: https://drive.google.com/file/d/15xd...ew?usp=sharing If it works I'll update in github, maybe I can also change the texture.png filename with the name of the wad? This should avoid confusion. By the way, speaking of shine, I was not able to render this effect on blender. I got the data from the wad but I don't know how to apply it to the model since it is applied to each face. Since obj files preserve this information, can you please send me a sample obj file with shine effect so I can see how is it applied? |
I was also trying to import mixamo animations to TRLE using tomb editor. The LARA.fbx file generated using the export FBX option seems to be correctly recognized by mixamo.com. I'm able to import the animations back to blender but not in tomb editor :confused: It says "wrong number of bones". Do you guys know any easy way to import them? otherwise I can spend some time and make a script.
|
Thank you once again very much, Bergus! :D
Quote:
https://www.mediafire.com/file/afind...tatue.zip/file Quote:
Lwmte explained it here (I bolded the important bit): Quote:
00 - pelvis 01 - left thigh 02 - left shin 03 - left foot 04 - right thigh 05 - right shin 06 - right foot 07 - torso 08 - right upper arm 09 - right lower arm 10 - right hand 11 - left upper arm 12 - left lower arm 13 - left hand 14 - head edit: on further thought I probably should have linked the entire discussion for context and not just the quote by Lwmte; it's from the WadTool thread: https://www.tombraiderforums.com/sho...=223525&page=5 edit 2: additional info (from the same discussion) Quote:
|
I'm sorry, but if we export into fbx, can we import back using wadtool? or what? what am I missing?
|
^^ Yes, with this addon you can import objects and animations from a Wad into Blender, edit them and then re-import into your Wad using WadTool (importing animations into the Wad / WadTool is being worked on as mentioned above).
edit: Quote:
Quote:
|
Thanks not Again!
It seems to me that the shine is stored using different materials. Since the same texture can be applied with multiple shine values to different faces of the same mesh, it is like having 32 different materials that differ only by some glossy parameter. I'll see how to manage that. I think that applying different materials to different faces is quite painful to the object designer, I would rather have some friendly way to edit this property. EDIT: I think it is the only way: when you open the wad, blender creates 32 materials with the the same uvs but different shine values. If some face needs shine, the proper material is applied. |
Quote:
|
Ah, apologies, I think I worded my initial comment about OBJ being best for shininess confusingly. What I meant was that the Blender export script for OBJ is so far the only one that exports the new Principled BSDF shader in way that will give a model imported into WadTool glossiness.
Models exported as FBX or COLLADA appear matte in game no matter what shader settings are used. So basically if you want to have a model exported from Blender to have glossiness ingame you need to export as OBJ. Personally I don't find it a problem if the shine attribute is not imported from the Wad, since it can be re-applied in Blender. |
Quote:
I'm thinking of adding a simple entry in the panel that you get pressing N, where you can select the shine when faces are selected. In this way there's no need for the user to mess with materials. Quote:
|
^^ Oh, good - I'm relieved to hear I did not accidentally waste your time.
Some more feedback and a potential bug report: the option to batch export models is truly a wild luxury after being used to the old time consuming workflows! :p Batch exporting Statics seems buggy on my end though: a FBX file for each static object is created, but the files all have 4kb and are seemingly empty when trying to import them into Blender. Everything else (Lara and Moveables) exports fine, I tested with several of the original Core wads. |
Quote:
I almost finished with the shine. I wanted to ask, if you know, whether tomb editor is also able to import opacity/transparency. I think that the way to do in blender is to use the bsdf shader alpha parameter. For the shine I'm using the roughness (shine = 0 => roughness = max). |
Yes, it's possible to import models into Tomb Editor / WadTool with transparency. Vertex colors also import fine into WadTool & Tomb Editor when the model is in either .fbx or .dae* file format.
Both transparency and shine work exactly as you described: by adjusting the Alpha and the Roughness slider of the BSDF shader. Though as mentioned the Roughness value of the BSDF shader only carries over into the game as shininess when exporting as .obj When exporting as .fbx (or .dae) the export scripts for those file formats apparently interpret the Roughness setting in a way that doesn't translate into in-game glossiness. None of the BSDF shader sliders that control specularity, sheen and reflectiveness have any effect in game when exporting as anything other than .obj Transparency on the other hand does work with all three file formats. * from the file formats that Blender can export without additional plugins OBJ, FBX and COLLADA are the three best supported for import into WadTool / Tomb Editor. And thank you again for your amazing work! :) |
There is a new release (0.2) on Github :jmp:
You can now import shine and opacity information. To edit their values, you need to go into edit mode and it will appear a Wad Blender tab into the panel that you get by pressing N. By selecting a face of the active mesh, it will appear a form where you can edit shine (0-31) and opacity (ON OFF). There is also the possibility to batch export in obj format plus probably many bugs. When I'm sure that everything works, I'll make some tutorials, maybe :D |
This keeps getting better and better, and it was already amazing to begin with! :D
Export of statics works now perfectly on my end and I'm a big fan of the way applying shine and transparency has been integrated into the addon. Many thanks for adding the option to batch export to OBJ as well! Having the option to adjust rotation on import is also greatly appreciated. One thing I noticed is that Moveables without rig (like inventory items and puzzle pieces) are not affected by the rotation-transform though when ticking "rotate objects upright". Again, not really a problem since objects can easily be rotated manually - just mentioning in case that's the sort of thing you'd like people to report. I think having the option "rotate upright" ticked by default is probably going to be more convenient - I suspect that it's going to be used way more often than it's not going to be used. Thank you for this great update! |
Thanks for the feedback, please report everything! The code is fresh and I can correct it very easily. Later will be hard because coding for Blender is quite nasty :hea:
|
Nice work! :tmb:
This seems like a life saver in many ways! |
Coming soon a script to export blender animations as Wad Tool anim files. Here is a Adobe Mixamo animation:
|
Unbelievable! :cln:
Itīs time for me to learn animation :D |
WAIT, so it could be possible to import animations from other games to TRLE?????? :eek:
|
This is such incredibly amazing news, I don't even know what to say! :D :jmp:
|
Quote:
|
0.3b is out, please check the github page!
There are some problems with Lara feet animations. Probably it's because Lara has only one bone for each foot instead of two. However, they can be edited using blender's graph editor. You can also combine multiple animations using the the blender nla editor. This may be useful to create cutscenes, see this video for an example: https://youtu.be/NIP8QibQ7XU Wad blender will export the active action associated with the LARA_RIG. Note that the hips location and rotation datapath is "Location" and "Rotation Euler". |
A million thanks for the update Bergus, I can't wait to try it out! :admles:
|
Sorry i didnt find the information
Is Wadblender a wad or a wad2 importer ? Does the addon work with Blender 2.83 ? |
Quote:
|
Really fantastic work, Bergus. :tiphat: I'm having tons of fun going through animations on Mixamo, laughing at Lara clumsily dancing Rumba. Thank you again for this wonderful addon.
I also tried exporting both an original animation and a new animation I quickly made in Blender to .anim format, but both arrived as mangled mess when trying to import them into WadTool. I don't really know what I'm doing though (I'm just a beginner at making animations), and I was wondering if the export to .anim file format is for Mixamo animations only? |
Ops, sorry, I didn't specify it. I tested the anim export only with Mixamo animations! I think that TRLE animations get wrong because Mixamo rotations are imported as quaternions while TRLE animations are yaw pitch roll. I will add an option for that :hea:
Maybe if you start from the file you downloaded from Mixamo, delete the keyframes and then make your own from scratch it would work. Maybe... but better that I add the option, it should be few lines of code. BTW Lara dancing is so funny, but a smile in her face would make it more believable :D Edit: I was bored and coded a little, but didn't want to remake the tutorial, so at this moment I share here the update: https://drive.google.com/file/d/15xd...ew?usp=sharing I added a mixamo option, also now Lara should be facing correctly |
Quote:
I completely missed that there are tutorials. Thank you for those as well - I'll put the links in the first post of the Blender workflow thread. I see you used the Thriller dance animation for the tutorial - truly the best choice. |
Re-importing the original animations works splendidly now. :D
I have big hopes that this will make it possible to easily fix the old issue of Lara's joints collapsing during some of the original animations. A question regarding making completely new animations, since you mentioned Mixamo animations use quaternion and classic TR use yaw pitch roll and you addon now lets us export animations with both types of rotation to the .anim file format: it is okay to use quaternions (which is superior to roll pitch yaw) when making new animations - do I have that correctly? For exporting to .anim we can then use the Mixamo setting (since that is for animations using quaternion rotation)? |
I know that quaternions are better since they avoid gimbal lock problems while animating. However, I'm not sure whether the final conversion into Euler angles (yaw pitch roll) may cause problems. Probably not :confused:
I also need to investigate why the Mixamo pelvis bone is in Euler angles instead of quaternions :confused: |
I did not mention that quaternion is better because I assumed you do not know that (that would be absurd given your knowledge about animations :p) - I was just trying to explain why I'm interested in whether we can use quaternion rotation when making new animations.
|
In reality, I don't know anything about animations! I just wanted to say that I know just that gimbal problem, but I'm not sure whether you will run into it, even with quaternions. Sorry if I sounded nasty :( I just converted the angles so they can be imported/exported from Blender into the TRLE, but I don't know how to do an animation from scratch.
Anyway, the answer is yes, you can choose to create new animation from the RIG that you get from Mixamo and then export using the Mixamo checkbox. It makes sense, I don't know in practice if anything will change. |
No worries, your comment sounded perfectly friendly and polite! :) I was just worried mine had sounded unintentionally patronizing and wanted to clear that up, sorry for the confusion. :p
Thank you, I'll use the Mixamo rig then. |
Probably I'll convert also TRLE animations to quaternions so that they can be mixed with Mixamo anims. I would like also to export non Lara animations if I'm able to discover in what order are the mesh rotation in tomb editor.
|
Quote:
Would animations in FBX format from other sources (for instance ripped from other games) also work as long as they are similar to Mixamo's? Quote:
I'm trying to modify one of the original animations using the NLA editor, and then baking everything into a new action, but have not managed to import that modified animation into WadTool successfully so far. If I use the default export setting (for the original animations) then Lara will show up completely mangled and not move at all, but funnily enough if I use the Mixamo settings then she will show up less mangled and move, but with the wrong limbs (instead of the legs performing a running animation the arms will flail around wildly, etc) But as mentioned, I don't really know what I'm doing here yet - I'm still at the stage of watching YouTube tutorials how to use Blenders various animation editing tools correctly :p |
All times are GMT. The time now is 21:26. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.