Wing Blender (WCP/SO Blender plugin)

Discussion in 'Fan Projects & Editing' started by Kevin Caccamo, Feb 13, 2010.

  1. Kevin Caccamo

    Kevin Caccamo Rear Admiral

    Messages:
    625
    Likes Received:
    35
    Trophy Points:
    26,785
    Gender:
    Male
    Shades2585 likes this.
  2. Kevin Caccamo

    Kevin Caccamo Rear Admiral

    Messages:
    625
    Likes Received:
    35
    Trophy Points:
    26,785
    Gender:
    Male
    Wing Blender 2.2.0 is out. Now, the importer can search the MAT and PAL directories for textures and palettes, respectively. The MATs no longer need to be in the same folder as the model to be recognized and imported.
     
  3. DefianceIndustries

    DefianceIndustries Commodore

    Messages:
    884
    Likes Received:
    1,117
    Trophy Points:
    14,835
    Gender:
    Male
    Location:
    Colorado
    Hey Kevin - question for you, does Wing Blender read/interpret cntradi empties?
     
  4. Kevin Caccamo

    Kevin Caccamo Rear Admiral

    Messages:
    625
    Likes Received:
    35
    Trophy Points:
    26,785
    Gender:
    Male
  5. DefianceIndustries

    DefianceIndustries Commodore

    Messages:
    884
    Likes Received:
    1,117
    Trophy Points:
    14,835
    Gender:
    Male
    Location:
    Colorado
    Nice! Thanks! I suppose I should've read the docs first...:)
     
  6. Kevin Caccamo

    Kevin Caccamo Rear Admiral

    Messages:
    625
    Likes Received:
    35
    Trophy Points:
    26,785
    Gender:
    Male
    It's been a long time..
    Anyway, if you've tried to use the importer, you'll know that it is sluggish as hell. I've been trying to work on that. I made a few optimizations to the importer recently, which mostly involve using flat typed arrays instead of lists of lists, and it turned out to be MUCH faster than what I had.
    Here are my test results on models from the MUP:
    master: 45.777912414999946 seconds to import SHRIKE.IFF
    optimized importer: 4.5732363529998565 seconds to import SHRIKE.IFF

    master: 1.6189115940001102 seconds to import AST_S_01.IFF
    optimized importer: 1.447341495999808 seconds to import AST_S_01.IFF

    optimized importer: DEVASTAT.IFF took 7.95558235999988 seconds to import
    optimized importer: cruiser.iff took 6.280457260000276 seconds to import
     
    delMar and Shades2585 like this.
  7. Kevin Caccamo

    Kevin Caccamo Rear Admiral

    Messages:
    625
    Likes Received:
    35
    Trophy Points:
    26,785
    Gender:
    Male
    With my most recent optimizations, I was able to cut the import time in half! Well, at least for the more detailed meshes. AST_S_01.IFF hasn't shown much improvement in terms of import time, but that's because the other bottleneck is the MAT reader, and I have no idea how I could optimize the MAT reader any further.
    And now for the numbers:
    SHRIKE.IFF: 2.7380151280012797 seconds
    AST_S_01.IFF: 1.4047294970005169 seconds
    cruiser.iff: 3.3131252189996303 seconds
    DEVASTAT.IFF: 3.978092076999019 seconds
     
  8. DefianceIndustries

    DefianceIndustries Commodore

    Messages:
    884
    Likes Received:
    1,117
    Trophy Points:
    14,835
    Gender:
    Male
    Location:
    Colorado
    Nice! well done sir!
     
  9. Kevin Caccamo

    Kevin Caccamo Rear Admiral

    Messages:
    625
    Likes Received:
    35
    Trophy Points:
    26,785
    Gender:
    Male
    Shades2585 likes this.
  10. Darkmage

    Darkmage Vice Admiral

    Messages:
    918
    Likes Received:
    21
    Trophy Points:
    31,435
    Location:
    Australia
    Arrays are how opengl handles geometry now. Graphics cards will generally only accept arrays which is why the speed up is so dramatic. Display lists are basically a dead design.
     
  11. DefianceIndustries

    DefianceIndustries Commodore

    Messages:
    884
    Likes Received:
    1,117
    Trophy Points:
    14,835
    Gender:
    Male
    Location:
    Colorado
    Hey @Kevin Caccamo , How does Wing Blender currently handle "DOCK" chunks? I think it sort of ignores them? Is that support that could be added assuming it doesn't exist? I think it would be useful in our current remodel project as well as any future mods to be able to define docking points on meshes.

    Thanks!
     
  12. Kevin Caccamo

    Kevin Caccamo Rear Admiral

    Messages:
    625
    Likes Received:
    35
    Trophy Points:
    26,785
    Gender:
    Male
    After taking a quick look through the game files, it looks like DOCK chunks are a feature of the ship files, not the mesh files. I have no idea what DOCK chunks do or how they work, and Wing Blender was designed to export mesh files.

    As for the performance boost, I don't think it has anything to do with OpenGL. After I get the mesh data from the mesh file, I have to construct a mesh for Blender, and it's the construction phase which was taking the most time. The loop on lines 297-305 of import_iff.py became much faster once I started using a dict, with the edges converted to frozensets as keys, and the edges' indices as values. I received another significant speedup once I moved the "bl_mesh.loops.add" line above the second loop that iterates over the face data. ("loops" are corners of a face, consisting of an edge and a vertex)
     
  13. DefianceIndustries

    DefianceIndustries Commodore

    Messages:
    884
    Likes Received:
    1,117
    Trophy Points:
    14,835
    Gender:
    Male
    Location:
    Colorado
    @Kevin Caccamo I have a question on exporting meshes w/LODs. I can't seem to find any documentation on it so maybe you can assist. I've tried two different methods and neither seem to work. The first is I leave the two meshes unparented and try and export the entire scene. I get the following error:
    LODerror1.JPG

    If I parent LOD 1 to LOD 0 I get a giant mega-error:

    LODerror2.JPG

    I have my objects named MARLIN-lod0 and MARLIN-lod1 per (I believe the instructions)

    LOD.JPG

    I'm sure it's probably an ID10T error, but I can't find any full documentation on the process so I thought I'd ping you and see if you had any insight.

    Thanks!
     
  14. Kevin Caccamo

    Kevin Caccamo Rear Admiral

    Messages:
    625
    Likes Received:
    35
    Trophy Points:
    26,785
    Gender:
    Male
    Try writing 'lod' after the dash using lowercase letters instead of uppercase letters, and having one of the 2 LODs selected.
     
  15. DefianceIndustries

    DefianceIndustries Commodore

    Messages:
    884
    Likes Received:
    1,117
    Trophy Points:
    14,835
    Gender:
    Male
    Location:
    Colorado
    Should they be parented or unparented?
     
  16. Kevin Caccamo

    Kevin Caccamo Rear Admiral

    Messages:
    625
    Likes Received:
    35
    Trophy Points:
    26,785
    Gender:
    Male
    All the LOD meshes should be at the same place in the hierarchy, so leave them unparented, unless the mesh is supposed to be a child of another mesh.

    Also, I tried writing LOD in capital letters, but I couldn't reproduce the errors you're getting with Blender 2.79b.
     
  17. DefianceIndustries

    DefianceIndustries Commodore

    Messages:
    884
    Likes Received:
    1,117
    Trophy Points:
    14,835
    Gender:
    Male
    Location:
    Colorado
    I got it figured out - thanks! I rebuilt the file and found two issues, followed the advice above and it works as expected. Thanks for the help!
     

Share This Page