Skarn

  Administrators
  • Content Count

    792
  • Joined

  • Last visited

Tutorial Comments posted by Skarn


  1. 8 hours ago, PaulGreen said:

    For possible future internet serach,  this is from 2017,  for an 2017 version of this WMO blender plugin. If plugin has been updated, the below is void, do not break your install or bug author after this then  :3

    Additionally, a few steps can be  enacted to make other parts of import work. NOTE that for my purpose, I only am caring about import,  not export of  .WMO and related, so this only helps importing into blender. It seem that some file types have changed, but the plugin is still done well and working well, just with a few very small edits and steps.

    My goal is to import WMO file with all texture and objects without extra work, since I see that the plugin was designed to do this originally and saves much time instead of doing this manually every time. It turns out this is still possible, by some luck of the way the plugin was happen to be written originally, and some trivial hacking, by the following are done:

    First, is edit as above to fix import of WMO after cataclysm.

    Second, is use CASC extractor to extract all WoW data. I use Cascview by Zezula, additionally using the listfile packaged with Wowmodelviewr for filenames  (not the Zezula download which is old).. Create a working directory for a work space, like C:\MineEdit  then create "Data"  and  "patch-x.mpq'  so directory is like  C:\MineEdit\Data\patch-x.mpq\  . Extract all data into C:\MineEdit\Data\patch-x.mpq\  (Takes a very long time, and ends up with 75GB uncompressed data folder, lol. )

    Create new any type of file ( like as text file) in C:\MineEdit   and rename to "WoW.exe".

    Set "WoW Client Path" in the plugin to "C:\MineEdit"

    In blender plugin, open .\io_scene_wmo\m2\m2.py  and find the class "M2File" and edit the constructor function:
     

    
            f = open(file, "r+b") if type(file) == type("") else io.BytesIO(file[0])
            filename = file[1]

       To instead be:
     

    
            f_TEMP = open(file, "r+b") if type(file) == type("") else io.BytesIO(file[0])
            f_TEMP.seek(8)
            f = io.BytesIO(f_TEMP.read())
            f_TEMP = ""
            filename = file[1]

    (Not programmer, sure there's a better way than holding two copies of file in memory, but this is a hack, not monument to skill)

    Now, should work.  To import a WMO and have textures and doodads be import automatic, it is important to copy WMO file to C:\MineEdit\Data\patch-x.mpq\  location. The WMO to import must be in this 'patch file' root path directory for pathing to find all the files.

     

    It looks like Warcraft no longer uses MPQ files, so auto-import from MPQ does not work,  and all M2 files have had anew 'magic' number and file length integer prepended to the front of every file,  not just new expansion files, but also have not updated offset numbers, so all offsets are off by -8 bytes as specified in the file, even new files. The 8 seek simply moves beyond the version and file length ints. Again,  NOTE that exports will be broken, this only fixes imports.

    This is very useful. Thank you. If you want to help me out on multi-versioning or other development, feel free to find me on Discord or Skype.


  2. 4 hours ago, PaulGreen said:

    Import crashed on many models after cataclysm. I see that after cataclysm, optional  "MOBS"  chunk is added to group files, and a file with this chunk will not be read correctly.

    I modified wmo_group.py with simple test for the chunk that skips it if it exists, and models can now be imported correctly. MOBS function is of course removed, heh.
     

    
            ...
            self.monr.read(f)
            self.motv.read(f)
            self.moba.read(f)
            
            #Check for MOBS
            testMOBS = f.read(4)[0:4].decode('ascii')
            if testMOBS != 'SBOM':
                f.seek(f.tell()-4)
            else:
                testMOBSSize = struct.unpack("I", f.read(4))[0]
                f.seek(f.tell()+testMOBSSize)
    
    
            if self.mogp.Flags & MOGP_FLAG.HasLight:
                self.molr.read(f)
            ....
    

     

       Edit in this way, or add to plugin if it is appropriate.

     

    Thank you. This is a useful contribution. I plan on working for multi-version support.


  3. 6 hours ago, Zaekor said:
    It works also in the opposite direction, Wotlk to Wod ??

    No. Every new expansion introduces new engine functionality. WoD supports stuff like scaled textures, tileset height maps (_h textures), extended number of tilesets per chunk. This information will be lost on conversion which makes the zone look like shit as those new features contribute greatly to the overall look of the zone.


  4. Blizzard is using simplified collision in order to increase FPS. This collision seems to be autogenerated by generating a convex hull around each batch and cropping some parts of it according to the normal direction. I do not recommend you to delete it, especially in big models as it is likely to decrease performance. You can hide it in edit mode by selecting at least one white face, pressing Shift + G, clicking on Select by material in the menu and once all that geometry is selected, clicking on H to hide it. However, it will still appear when you are in object mode. In future versions, collision might get moved to its own separate object. Also I am looking for a way to generate it.


  5. 4 hours ago, Kaklam said:

    Hello, I followed the tutorial but it gives an error when trying to import .wmo's

     

    error.png

    Some files in your MPQs are encrypted. Most likely those from patches with custom content. Repack your patch using a different file archivation ruleset in MPQEditor without any encryption, compression only. 


  6. Useful stuff for beginners. I need add this info to english tutorials. One question though, why do you write about SDL 1.4 at all? There is literally no use in it since beta was released.


  7. A little note from me which you may want to add to the tutorial. Basically, Blender is only required for conversion and I did not manage to do proper sculpting in it. But you can use Mudbox or some other sculpting software you like to get the geometry and then just convert it to Blender for exporting according to our template.


  8. Easy to learn, easy to understand, easy to edit and use for the artistically challenged like myself, and all of that for a really nice and easy to do map.

    Perfect tutorial in my book !

    Will you do something similar for zones & subzones in a near or distant future ?

    Thanks for kind words! I will when I find some time, I am extremely lacking it at the moment.