LWO Importer on the Unity Asset Store

escape_artist

New member
Hi, I've just released a really useful tool for any Unity/Lightwave users out there: LWO Importer. Link here.

Here's a link to the YouTube trailer.

And some screenshots:
View attachment 143174 View attachment 143175 View attachment 143176

Unity's support for Lightwave files is... how to put this tactfully... lacking. So in order to get meshes into Unity the general process is to copy all your layers into a new object file, strip out any unwanted geometry like splines etc, triple your polygons, then export the file as an .fbx before finally importing into Unity. Then you'll find your mesh is 180 degrees rotated, so you need to add a parent GameObject to rotate it back. Things are generally pretty tedious and messy.

Not any more!
LWO Importer allows Unity to handle .lwo files directly. Any .lwo files within a Unity project will be automatically imported once this assert is installed. This means:
- Immediate feedback. Save your object in Lightwave, switch to Unity and the mesh will update instantly
- Support for NGons and Quads - so no need to keep triangulating your mesh.
- Converts all Lightwave surfaces to Unity materials.
- Layer names, hierarchy and pivot-points are retained. The model will be organised in Unity exactly as it is in Lightwave.

Plus a bunch more features. For full details check out the Unity Asset Store

Development is ongoing: I'm currently working on supporting Catmull-Clarke subdivision surfaces. After that, automatic vertex splitting over Lightwaves surface smoothing threshold.

The feedback I've got so far has been overwhelmingly positive and I hope that if you should use it, then you find it very helpful.

Also, if you have any other feature requests then please let me know.

- Chris
 

Attachments

  • Screenshot1.png
    Screenshot1.png
    709.2 KB · Views: 443
  • Screenshot2.png
    Screenshot2.png
    868.4 KB · Views: 421
  • Screenshot3.png
    Screenshot3.png
    608.5 KB · Views: 393
Last edited:
- Converts all Lightwave surfaces to Unity materials.

Can you clarify what your approach is for converting materials, are only direct-attached nodes of the supported types migrated?

What happens when it encounters a node it doesn't understand? Can it handle basic logic/math/invert nodes as well?
 
Last edited:
i already posted this for you here, if you look in this forum right below this thread :p

https://forums.newtek.com/showthread.php?158198-Unity-Lightwave-6-gt-2015-amp-2108-LWO-Importer

Actually, I read that before posting, it didn't answer my main question -- what happens when it encounters a node it cannot convert?

Does the whole export fail, does it just skip that channel/surface, or try to wire it up ignoring that node, or...?

When it does fail for whatever reason(s), does it provide the user with a report of what object(s)/surfaces/etc. failed and why?

Also, does it convert any UV or other maps present? If so, is it same limits as FBX or do its limitations/behaviors differ from FBX*?

Thanks!

*: Reason I ask is because we have various export options to control how LW exports certain aspects of objects. I'm just trying to understand whether those controls still apply, or do you provide equivalent settings?
 
Last edited:
Can you clarify what your approach is for converting materials, are only direct-attached nodes of the supported types migrated?

What happens when it encounters a node it doesn't understand? Can it handle basic logic/math/invert nodes as well?

Hi. Those are good questions:
Yes, only directly connected nodes to the material are used - so nodes any deeper than the first connection will not have any affect.
Node types supported are:
  • 2D Textures>Image
  • 2D Textures>NormalMap
  • Layers>Color Layer
  • Constant>Scalar
  • Constant>Color
It converts all this data to build a Standard Shader material in Unity. A Lightwave 'BSDF Material' will be converted to a 'Standard (Roughness Setup)' material in Unity, and a Lightwave 'Standard' material will be converted to a Unity 'Standard (Specular Setup)' material. Also, you don't need to use nodes - LWO Importer is happy to keep it simple and convert Lightwave's old-style (no nodes) materials, even if using LW2018.

When it encounters a node it doesn't understand it will ignore it and convert as best it can without emitting any errors.
No, it can't handle any math, as this would require it to convert the material into a bespoke shader - a huge task and something beyond the remit of the software.
Obviously there are some tight limitations in converting Lightwave materials to work with Unity by using Unity's Standard Shader - but for any game-engine specific shader needs you have, it's a fairly simple process to replace the materials on any imported objects with your own hand-crafted ones.
 
When it does fail for whatever reason(s), does it provide the user with a report of what object(s)/surfaces/etc. failed and why?

Also, does it convert any UV or other maps present? If so, is it same limits as FBX or do its limitations/behaviors differ from FBX*?

If it does fail to import your mesh it should spit out an error in the Unity console, however I've tried to make it robust so it won't fail on little things like finding non-polygons (splines, skelegons etc).
It doesn't require you to triple the mesh either - it does that for you.
I've tried the importer with a wide variety of meshes downloaded from TurboSquid, as well as my own of course, and it seems stable. But any meshes that do fail I would be eager to get my hands on them, chances are good that I'll be able to get them working and improve the software in the process.

Yes it imports UV maps, and Vertex Color maps. It does differ quite a lot from exporting as an fbx, in too many ways to list really. Is there some specific unwanted behaviour you've encountered when exporting as fbx? If so I can give you an idea on how LWO Importer deals with it.
 
Hi, I've just released a really useful tool for any Unity/Lightwave users out there: LWO Importer. Link here.
...
Hey Chris, great tool, once installed it magically does its thing and .lwo conversion (mostly) is as simple as copying the models and textures into the relevant Unity3D project folders (either via Explorer or via drag & drop directly onto the Unity3D project hierarchy).

I've been pushing hard into getting Unity3D's HDRP "High Definition Render Pipeline" working for me, and in this realm sometimes your tool struggles a little (Unity3D 2018.2.0b9)
- sometimes if I save a model straight out of Modeler, all of my materials are smoked in Unity3D and turn into an ugly hot pink :D
- … what I mean is the LWO model has already been successfully imported into Unity, but I've gone back and made some changes and saved …
- … thereafter even if I use the magic "convert selected materials" in Unity there is no change: same hot pink …
- … but if I save the file in Modeler, switch to Layout and save the model again, I am able to recover from the dreaded hot pink to default surfaces via the magic "convert selected materials" button in Unity …
- … the only problem being all of the previous material settings for the model in Unity have now been lost

Bear in mind the above is happening under the Unity3D HD Render Pipeline. I'm on LW 2018.5.

Still happy with the tool! Keep going, great job so far.
 
- sometimes if I save a model straight out of Modeler, all of my materials are smoked in Unity3D and turn into an ugly hot pink :D

Ah ha you've found a bug. Yes it does the same thing on mine too with the latest version of Unity. Seems the HDR setup in Unity isn't playing nicely with the material shader setup I'm using. I have an idea on how to fix this... I'll look into it and hopefully get it working better for the next version. Thanks!
 
Hey Chris - a few more things ...

1. Your conversion materials come across as type "Specular Colour" in Unity 3D
- I'm more comfortable / am getting better end results by selecting "Standard" as the type
- but this is not a biggie as the ability to bulk change that material setting in Unity3D is easy

2. Currently, bump maps are coming in as height maps?
- this is tearing up textures across a given model (sorry no examples to show)
- I get around this by discarding the references to height maps in Unity (or deleting them from the LWO)

3. Materials reset
- if I get "pink materials" in Unity (meaning a disconnect between model and textures/materials) ...
- ... when that connection is re-established, any and all Unity3D materials settings are lost, reset to default
- question: how possible is it for materials changes to be noted in Unity and have the option not to be over-written?
- ... or maybe some means of saving out the current state of materials from within Unity which can then be restored to?

SO, JUST IN CASE anyone is querying why I'm asking these things here, every bit of what I'm asking about is to benefit a smooth/speedy workflow between Lightwave 3D and Unity ... just sayin' :)
 
THANK you again and again ! It is so awesome that it works flawlessly with 2017 unity .. (thanks for checking)

How about :) hmmm ... "exporting unity object" to LWO in next update!??? :))
 
Hey Chris - a few more things ...

1. Your conversion materials come across as type "Specular Colour" in Unity 3D

2. Currently, bump maps are coming in as height maps?
- this is tearing up textures across a given model (sorry no examples to show)

3. Materials reset
- if I get "pink materials" in Unity (meaning a disconnect between model and textures/materials) ...

1. In a low-dynamic range Unity project, Lightwave BSDF materials convert to the Standard (Roughness setup) material, and Lightwave's Standard Materials are converted to the Standard (Specular setup). For HDR conversion I will need to look into it and try and figure out the most natural mapping.

2. I decided that the closest thing to a bump map in Lightwave were height maps in Unity. If there are tearing artifacts then perhaps the height map value is too large? This can be changed in Lightwave -here's a screenshot showing that in the Materials example that comes with LWO Importer, the Bump Height is at just 5%. Generally, low values are best here.
View attachment 143208

3. Yeah this is a limitation I'd like to fix but I'm not sure exactly the best way to do it right now. As you have noticed, the materials are 'locked' - greyed-out - when they come into Unity. Converting them to HDR I think makes copies of all the materials, just as you can do manually be selecting the material in the Project view by finding it under the imported model and duplicating it (cmd/ctrl - D), then re-assigning this duplicate material to the mesh in the scene. But this change doesn't survive importing the model again, as doing so will overwrite this.
I think the fix is likely to be similar to Unity's .fbx import option where imported materials can be remapped to pre-existing materials in the assets import options. However this isn't a small job to implement so I'll need some time to determine how best to do it, and if it's definitely worth it.


And I'm very happy to get feedback, thanks, so keep it coming!
 

Attachments

  • Screenshot 2018-10-25 at 10.04.19.png
    Screenshot 2018-10-25 at 10.04.19.png
    197.9 KB · Views: 355
1. In a low-dynamic range Unity project, Lightwave BSDF materials convert to the Standard (Roughness setup) material, and Lightwave's Standard Materials are converted to the Standard (Specular setup). For HDR conversion I will need to look into it and try and figure out the most natural mapping.

2. I decided that the closest thing to a bump map in Lightwave were height maps in Unity. If there are tearing artifacts then perhaps the height map value is too large? This can be changed in Lightwave -here's a screenshot showing that in the Materials example that comes with LWO Importer, the Bump Height is at just 5%. Generally, low values are best here.


3. Yeah this is a limitation I'd like to fix but I'm not sure exactly the best way to do it right now. As you have noticed, the materials are 'locked' - greyed-out - when they come into Unity. Converting them to HDR I think makes copies of all the materials, just as you can do manually be selecting the material in the Project view by finding it under the imported model and duplicating it (cmd/ctrl - D), then re-assigning this duplicate material to the mesh in the scene. But this change doesn't survive importing the model again, as doing so will overwrite this.
I think the fix is likely to be similar to Unity's .fbx import option where imported materials can be remapped to pre-existing materials in the assets import options. However this isn't a small job to implement so I'll need some time to determine how best to do it, and if it's definitely worth it.


And I'm very happy to get feedback, thanks, so keep it coming!

Hey Chris

#1. is not a biggie, as remapping in Unity is mostly a piece of cake. It's would be super lazy of me to insist on everything being made super perfect your end in this regard.
#2. I think I might explore the use of normal maps instead of height maps - I need to check out if via "height maps" Unity is actually trying to displace geometry ...
#3. I didn't realise remapping to pre-existing materials was possible via Unity .fbx import … thanks!
 
LWO Importer version 1.3 has gone live today on the asset store (link)

Quite a big update which also addresses some of the feedback I received.
Highlights:
- Subdivision surfaces. This is a big one and I think it's very cool. Model in SubPatch or Catmull-Clarke surfaces and LWO Importer will read it and convert it into a Unity model. Supports (almost) all the different UV texture interpolation modes too. Oh and, unlike Lightwave, the interpolation modes work with Catmull-Clarke surfaces.
LWO Importer lets you specify the number of iterations to use so you can basically turn a cube into a smooth sphere.
Also, Lightwave Morph targets work in combination with SubPatch surfaces, meaning its possible to create some very cool subdivision surface animation for Unity. I'm working on a demo video at the moment to properly show it off.

In the meantime here's a screenshot from Unity, showing the same lightwave model imported with 0, 1 and 2 iterations. It also shows off the subdiv/blendshape functionality.
View attachment 143345

- Smoothing Angles in materials are now used to create hard edges in the imported models.

- Option to smooth normals over varying surfaces.

- Ability to remap imported materials to pre-existing ones. So if you're not happy with the imported materials you can easily swap them out. And whenever you import the model again these remapped materials will be remembered and restored automatically.

Any feedback is always welcome.
Cheers
-Chris
 

Attachments

  • Screen Shot 2018-11-12 at 20.29.13.png
    Screen Shot 2018-11-12 at 20.29.13.png
    1.2 MB · Views: 402
Last edited:
did you have any luck with the hdr issue? I find the materials keep getting lost, when I use the remap materials option. is this related?

also of note, when you change the name of a material and save the LWO, in LW 2018 (not sure of 2017), unity object will not reflect the change, even with RMB click on the object and selecting re-import.
 
Last edited:
Hi, yes I built the new 'remap materials' functionality to fix the HDR issue and in my limited tests it does. But I'd be interested in understanding what's going wrong for you.
Just to make sure we are both on the same page, here are the steps I use when testing HDR:
1. In a HDR Unity project, add a .lwo file and drag the asset into a scene so you can see it. The materials will all draw as bright pink in the scene preview.
2. In the project hierarchy view, expand the imported .lwo file to reveal its materials.
3. Select the materials.
4. Duplicate the materials (CMD D/Ctrl D) and drag them into a folder called HDR materials.
5. Select these new materials and go to Edit>Render Pipeline>Upgrade Selected Materials To High Definition Materials
6. With the .lwo file selected, drag each of these newly upgraded materials onto each remapped material slot.
7. Hit Apply.
The object will render correctly, with the remapped materials. Subsequent re-imports do not override the remapped materials. Can you try recreating these steps exactly and see if it matches what you are doing and if it goes wrong, where?

Also, I have had no luck recreating the material name bug you describe, using LW2018. Frustratingly, when I rename a material in LW and save the object, the material is renamed in Unity too. Are you able to provide more details in your process so I can recreate the bug? Thanks
 
Back
Top