Jab Posted February 15, 2015 Share Posted February 15, 2015 Blender 3D Model Import / Export Scripts are a WIP (Work in Progress). Right now the scripts can do the following:Import:Import all modelsImport rigsExport:Export non-weighted models (Weapons)Export weighted models (Clothes, hair, etc)Export Animations These features are planned on being added:Export Skeletons To use these scripts, you will need to open the 'Text Editor' in Blender, and paste the scripts in the editor and hit the 'Run Script' button on the window bar. Scripts:ImportExportExportAnimation [Tutorial by WolfeArt] Footmuffin, Aardman55, Kitt Frostpaws and 20 others 23 Link to comment Share on other sites More sharing options...
Jab Posted February 20, 2015 Author Share Posted February 20, 2015 If you want to go ahead and just load models right now, this script will work for all models in the game. https://github.com/JabJabJab/BlenderZomboidIO/blob/master/ZomboidImport.py raw file:https://raw.githubusercontent.com/JabJabJab/BlenderZomboidIO/master/ZomboidImport.py just paste this into your script editor, and load a model from one of the txt files located in your zomboid install directory/media/models. The textures are not loaded because they are hard-code-loaded in the actual game. the textures are located in media/textures. The Texture UV map is loaded. Happy Blending! Atoxwarrior and nasKo 2 Link to comment Share on other sites More sharing options...
mads232 Posted February 20, 2015 Share Posted February 20, 2015 Wow! Nice man! So can you actually import stuff, and see them ingame, or you haven't made any progress on that? If you have, then you've just helped a lot of modders, I guess. Link to comment Share on other sites More sharing options...
Jab Posted February 20, 2015 Author Share Posted February 20, 2015 Wow! Nice man! So can you actually import stuff, and see them ingame, or you haven't made any progress on that? If you have, then you've just helped a lot of modders, I guess. Right now this is just a import script. The next finishing step would be to also import the animation data (rig, keyframes, etc.). The next step after that would be to export to the same format used to import, which is where things like modding would be a thing. Link to comment Share on other sites More sharing options...
lemmy101 Posted February 21, 2015 Share Posted February 21, 2015 this is awesome! <3 would love to see this complete. We'll get to official support at some point but there are considerations first Kitt Frostpaws, Elliohow, SpaceJunk and 2 others 5 Link to comment Share on other sites More sharing options...
Jab Posted February 21, 2015 Author Share Posted February 21, 2015 this is awesome! <3 would love to see this complete. We'll get to official support at some point but there are considerations first Glad to know this kind of utility is welcomed. I would strongly suggest the Quake MD5 model format, due to its use of vertex weights, quaternions, and everything your format uses, however, separating the animations into separate files. This would be a plus for modding & adding animation support, plus it's a well known format. mads232 and EnigmaGrey 2 Link to comment Share on other sites More sharing options...
lemmy101 Posted February 22, 2015 Share Posted February 22, 2015 Thanks We'll look into it for sure. Jab 1 Link to comment Share on other sites More sharing options...
Jab Posted February 22, 2015 Author Share Posted February 22, 2015 Been having so much trouble loading the rig for the male / female models. The model data uses 4x4 matrices with a bind_pose, a inverse_bind_pose, and a bone_offset matrix, and the only thing I can get out of this data is an akward rig that barely resembles a bind pose. I've been scratching my head at this for the past few days. I'm not sure what to do really. Link to comment Share on other sites More sharing options...
Jab Posted February 23, 2015 Author Share Posted February 23, 2015 Progress on loading the rig. EnigmaGrey 1 Link to comment Share on other sites More sharing options...
Jab Posted February 23, 2015 Author Share Posted February 23, 2015 It's interesting to see the clothes pointing to an armature that is not defined in the file. Kind of odd, and will complicate the way imports will work (This is not an issue. I want to have Blender detect the armature before making one, as well as making one if one does not exist. I might have to do some hard-coded stuff, and no-one likes that. ). Anyways, I went ahead and pushed the code that loads the armature to the repository (the links update), however, the mesh is not bound to the rig yet. That will be the next step forward. Jack Bower 1 Link to comment Share on other sites More sharing options...
Fortport Posted February 23, 2015 Share Posted February 23, 2015 Interesting. I am keeping tabs on this. Link to comment Share on other sites More sharing options...
Jab Posted February 24, 2015 Author Share Posted February 24, 2015 I think I have rigs working at this point. I had to revise the bone generation for now because the previous one didn't work, so no IK on import for now Next: Animation import. Gammlernoob and Jack Bower 2 Link to comment Share on other sites More sharing options...
Jab Posted February 24, 2015 Author Share Posted February 24, 2015 Worked more on the rig generation today. I had to hard-code certain situations for the rig (like removing junk bones in the file, an exception for linking certain bones to specific children, etc.) this is my generated solution: Jack Bower and Gammlernoob 2 Link to comment Share on other sites More sharing options...
Jab Posted February 27, 2015 Author Share Posted February 27, 2015 Pushing code that allows objects worn "Auto-attach" to the rig if the rig is loaded (with male or kate) before the object is loaded. (Weapons don't auto-attach (maybe later)). Animations right now are still a headache, and I'll look into getting this up and ready when i find out what I need to do to properly load them in. Here's a picture. EnigmaGrey, Kitt Frostpaws and Gammlernoob 3 Link to comment Share on other sites More sharing options...
Jab Posted March 3, 2015 Author Share Posted March 3, 2015 So Right now I'm looking at building a export script for the most basic things like weapons, shirts, etc, until I can get this animation thing nailed down properly. What a headache. Oh well. Link to comment Share on other sites More sharing options...
Jab Posted March 6, 2015 Author Share Posted March 6, 2015 So weapons are moddable now. proof? here you go. Soooo yeah. The export script will be in the repository, and I'll modify the OP when i can. Kitt Frostpaws, Suomiboi, Svarog and 2 others 5 Link to comment Share on other sites More sharing options...
lemmy101 Posted March 6, 2015 Share Posted March 6, 2015 This is awesome <3 Jab 1 Link to comment Share on other sites More sharing options...
CaptainBinky Posted March 6, 2015 Share Posted March 6, 2015 This is great! (Just don't load the golf club - it's by far the worst 3D model I have ever made in my life ) mads232, Jab, WolfeClaw and 1 other 4 Link to comment Share on other sites More sharing options...
RobertJohnson Posted March 6, 2015 Share Posted March 6, 2015 This is great! (Just don't load the golf club - it's by far the worst 3D model I have ever made in my life ) Please do it Jab and PintLasher 2 Link to comment Share on other sites More sharing options...
Aardman55 Posted March 6, 2015 Share Posted March 6, 2015 I shall break the chain of Developer posts to stay true to my member title!Also, great work man I bet many modders will appreciate this. Personally, I was unable to load anything as it all just kept being a cube but then again, I'm a noob in blender and don't know anything about it lol. Jab 1 Link to comment Share on other sites More sharing options...
Suomiboi Posted March 6, 2015 Share Posted March 6, 2015 I shall break the chain of Developer posts to stay true to my member title!Also, great work man I bet many modders will appreciate this. Personally, I was unable to load anything as it all just kept being a cube but then again, I'm a noob in blender and don't know anything about it lol.Delete the cube. Most of the imported stuff is so small that they appear inside the cube. This is so cool! I succesfully made an import and used it as a template, but I'm still having difficulties getting the game to read my exported model. I'm guessing that the modding and scripting system doesn't yet cover models? Or does anyone know a way to create a new item with a newly exported model? Here's my quick code if anyone has time to take a look.I've added the model under mods/stick/media/models/weapons_stick.txt and I've changed the model name to weapons_stick. I have the recipe as follows:stick.txtmodule Base{ item TreeBranch { MaxRange = 1, WeaponSprite = weapons_stick, /************Also tried 'Stick' as with other weapons...**********/ MinAngle = 0, Type = Weapon, MinimumSwingTime = 2, KnockBackOnNoDeath = FALSE, SwingAmountBeforeImpact = 0.02, Categories = Blade, ConditionLowerChanceOneIn = 5, Weight = 0.3, SplatNumber = 0, PushBackMod = 0.1, MaxDamage = 0.1, SubCategory = Stab, AimingMod = 0.8, CloseKillMove = Jaw_Stab, ConditionMax = 5, MaxHitCount = 1, IsAimedHandWeapon = TRUE, DoorDamage = 1, SwingAnim = Stab, WeaponWeight = 0.3, DisplayName = testbranch, MinRange = 0.61, SwingTime = 2, MinDamage = 0.1, KnockdownMod = 0, SplatBloodOnNoDeath = FALSE, Icon = KnifeButter, RunAnim = Run_Weapon2, IdleAnim = Idle_Weapon2, BreakSound = PZ_MetalSnap, TreeDamage = 0, EnduranceMod = 0.5, }}and here's the model:https://www.dropbox.com/s/up1en7r65bcuvl7/weapons_stick.txt?dl=0The item loads just fine, but the model doesn't appear/is invisible. Also the model is using the existing plank texture so it shouldn't be a problem with that...?Would I need to write lua to load the model into game? I did try to search the javadocs with no avail... Another newb trying to learn with too steep of a learning curve. Jab and Aardman55 2 Link to comment Share on other sites More sharing options...
Rathlord Posted March 6, 2015 Share Posted March 6, 2015 This is awesome and a half. Geras and Jab 2 Link to comment Share on other sites More sharing options...
EnigmaGrey Posted March 6, 2015 Share Posted March 6, 2015 This is awesome and a half.I must agree with HelpCat.Have been waiting a very long time for something like this. RoboMat and Jab 2 Link to comment Share on other sites More sharing options...
Jab Posted March 6, 2015 Author Share Posted March 6, 2015 This is great! (Just don't load the golf club - it's by far the worst 3D model I have ever made in my life ) What program did you use to export your models? I'd like to take a look at it for research purposes. Link to comment Share on other sites More sharing options...
Jab Posted March 7, 2015 Author Share Posted March 7, 2015 Added support for exporting weights. (Hint: This means clothes and hair are now moddable. ) Aardman55 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now