Search Unity

Voxel Importer

Discussion in 'Assets and Asset Store' started by AloneSoft, May 26, 2018.

  1. Bioxx

    Bioxx

    Joined:
    Mar 7, 2014
    Posts:
    6
    Would it be possible for us to get the import of shader settings from the vox file into the materials for imported objects? Looking at the vox file format, it looks like that information should be able to be imported with relative ease. Even if we have to tweak the materials later to get it perfect for unity, being able to import those settings would be really helpful.
     
  2. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    If there is material information in the vox file, then setting it to some information material already works.
    See the "Import material stored in MagicaVoxel file" entry in the documentation.
    Isn't this what you want?
    What is another feature?
     
  3. Bioxx

    Bioxx

    Joined:
    Mar 7, 2014
    Posts:
    6
    Unless I'm completely missing something, importing the material will generate a texture based off the colors of the object, but it does not generate a mask for instance for emissive properties of each voxel. If we could have a check box to let us import textures for the emissive/roughness/metallic/transparency properties as well, that would be excellent. By default when the material is loaded from the file, it is just using a standard lit shader with the albedo texture set to the generated color texture. Any other information seems to get lost.
     
  4. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    I understand the desire for a mode that supports mask textures for metallics, emissions, etc. when importing materials.
    We are considering this feature in the future, but it has been put on hold because we have not secured the budget for the development of the corresponding new feature.
    I will respond if I have time. At this time, we cannot say when to respond.
    sorry.
     
  5. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Version 1.2.1 has been released.
    - ADD : Unity2020.2 : support
    - FIX : ScriptedImporter : Fixed an error that occurs in the second and subsequent imports when Export is enabled
    - FIX : Changed to be able to use "Remove All Voxel Importer Component" for Prefab instances
    - FIX : Changed to not be able to use "Export COLLADA (dae) File" for Prefab
    - FIX : VoxelFrameAnimationObject : Changed to be able to use "Export Animation Curve (Clip)" for Prefab
    - FIX : Voxel Explosion : Fixed an issue with "Remove All Voxel Importer Component"
     
  6. peanutgallery

    peanutgallery

    Joined:
    Oct 5, 2013
    Posts:
    35
    Hello!
    I'm getting thescriptedimporter errors like:
    "Assets\VoxelImporter\Scripts\Editor\VoxelScriptedImporter.cs(15,42): error CS0246: The type or namespace name 'ScriptedImporter' could not be found (are you missing a using directive or an assembly reference?)" and related errors.

    This is a new project, using: Unity 2020.2.1f1, Voxel Importer 1.2.1, and is using the URP. I feel like I'm missing something obvious, so I'm sorry if I'm overlooking something.
     
  7. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Hello,

    I have tried it in the same environment and no error occurs.

    First, check the ReadMe to make sure the version is 1.2.1.
    The reason for this is that the package manager wasn't aware of the new version when I tried it, so I had to remove the local package once before downloading the new version. The cause is unknown.

    Will this happen if I create a new project and install only Voxel Importer?
    Did you change your project or Unity settings?

    Also, the place where the error is occurring seems to be abnormal.
    The content is not the same as here.
    Can you think of any reason for the source code to be updated?
     
  8. peanutgallery

    peanutgallery

    Joined:
    Oct 5, 2013
    Posts:
    35
    Thank you! The Package Manager did say 1.2.1 but checking the readme (and the download location in AppData\Roaming\Unity\etc) I saw that the package was stuck on 1.1.1 for some reason.

    I deleted it, redownloaded the package, and the errors are gone! Thank you very much for your help.
     
  9. mstevenson70

    mstevenson70

    Joined:
    Jul 28, 2020
    Posts:
    2
    Hi, is there a way to disable the bool behaviour. I want to import a world scene that contains multiple objects that overlap using the individual mesh mode so that it creates a separate mesh for each object. But where the objects overlap the meshes are created using a boolean so they get cut out whereas I'd just like to retain the meshes exactly as they are in MagicaVoxel without then being altered where they overlap
     
  10. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Hello.
    There can only be one overlapping voxel, there is no way to change this.
    This is because the current information is in the form of the Palette ID stored in the coordinates.
    Therefore, if they overlap, they will be overwritten.

    Major changes are required to accommodate overlapping voxels.
    It takes a lot of work and the existing data becomes unusable.
    Therefore, it cannot be changed unless it is a major version upgrade.
    sorry.
     
  11. mstevenson70

    mstevenson70

    Joined:
    Jul 28, 2020
    Posts:
    2
    OK, thanks for the quick response.
     
  12. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    This is a video of the procedure for converting an explosion sample to URP.
     
  13. e6586808

    e6586808

    Joined:
    Jun 3, 2015
    Posts:
    4
    Hello, excuse me, can this asset split the voxels skinned mesh renderer into multiple parts?like this.
    upload_2021-3-7_4-42-29.png
     
  14. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Hello.
    It cannot be divided into multiple parts.
    If you want to do like this example, you will have to make settings for each part.
     
  15. ben-rasooli

    ben-rasooli

    Joined:
    May 1, 2014
    Posts:
    40
    Is it possible to import a .vox file to Unity and have every voxel/cube being individual? I want to have individual voxels so that I can change their color individually in Unity.
     
  16. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    There is no way to make everything individual in the import.
    When creating, create structural information from vox and create a cube from that information at runtime.
    Check "Examples/Create Cubes".
    I think you can change the color individually by making a change that makes all the cube materials different.
     
    ben-rasooli likes this.
  17. JohnWizard

    JohnWizard

    Joined:
    Feb 3, 2017
    Posts:
    11
    Hello! I really like the asset but I would love if it had a feature to create several prefabs at once from the imported objects. For example, selecting 10 imported voxel creature objects, clicking a "Create prefab" button and creating 10 prefabs from them.

    Thanks!
     
    Last edited: Apr 26, 2021
  18. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Hello,
    I'm sorry, I'm not good at English, so I use automatic translation.
    Therefore, it is not possible to read what you want from this explanation alone.
    If possible, I would appreciate it if you could prepare screenshots and explain in detail.
    Detailed information is required because the correspondence is different when using VoxelObject and when using ScriptedImporter.
     
  19. JohnWizard

    JohnWizard

    Joined:
    Feb 3, 2017
    Posts:
    11
    Okay, no problem! I would love a new ability for the asset, to be able to select many imported objects and transform them into prefabs.

    Something like this screenshot, which another voxel asset already does:

    chrome_DzIo66pVWE.png
     
    Last edited: Apr 28, 2021
  20. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    I'm not sure, but when you add vox to your project, you can use it as a Prefab.
    If you want to create more Prefabs from vox assets, you can create them all at once as shown in the image, but is the desired result different?
    I don't own that asset, so could you please show me how it works in the video if possible?
    VoxelImporter CreatePrefab.png
     
  21. JohnWizard

    JohnWizard

    Joined:
    Feb 3, 2017
    Posts:
    11
    Yes that works, but it becomes a problem when I want to do that for more than a hundred assets. Dragging multiple objects and converting them to prefabs only works in the latest 2021.2 alpha.

    I don't own the asset either, sorry.

    Anyway, it was just a suggestion, looks like it won't be a problem in the near future.
     
  22. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    sorry. I didn't realize that creating multiple Prefabs at once was a new feature in Unity 2021.2.
    This is a rather inconvenient part of Unity, and it has been confirmed that it will be improved in future version upgrades.
    There seems to be nothing I can do.
     
    JohnWizard likes this.
  23. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Voxel Importer version 1.2.2 has been released.
    - ADD : Unity2021.1 : support
    - ADD : Optimize : Added "Share same material" flag to control settings to share the same material when importing vox materials
     
    JohnWizard likes this.
  24. sballew7

    sballew7

    Joined:
    Sep 3, 2013
    Posts:
    76
    Just want to say thanks for creating and maintaining Voxel Importer. It has really helped my workflow with MagicaVoxel. :)
     
    AloneSoft likes this.
  25. sballew7

    sballew7

    Joined:
    Sep 3, 2013
    Posts:
    76
    Hi @AloneSoft ,

    I noticed that my models when imported have pivots that are slightly off center. If I toggle my scene view between Center and Pivot, the center position moves slightly.

    Further, I am facing challenges with resizing my models. If I increase the height of a model, I find myself needing to adjust the position of the model everywhere because it has shifted. I don't see any way to set a custom pivot, for example to the bottom of the model. Is this possible? I'm using the models that are generated from the vox file, not via the VoxelObject editor script.

    Thanks for any assistance.
     
  26. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Hello.
    Unless "Legacy Vox Import" is enabled, the position of Pivot will reflect the placement of MagicaVoxel as it is. You can set it freely there.
    If you want the inside to be Pivot instead of the edge of the voxel, set Import Offset to 0.5 etc.
    MagicaVoxel0.png
    Isn't the resizing issue caused by the Pivot being out of alignment as it will change as shown in this image when resizing with MagicaVoxel?
    MagicaVoxel1.png
    I think that it will be solved if you change the position and correct it.
    MagicaVoxel2.png
     
  27. sballew7

    sballew7

    Joined:
    Sep 3, 2013
    Posts:
    76
    Thank you @AloneSoft , I'll give that a try. I didn't realize it would use the MagicaVoxel pivot. I'm actually not sure how to set a pivot in MagicaVoxel, so I'll do some research. I have multiple models in a single .vox file so I can't position them all at the world origin, but I'll see if there is another way.
     
  28. AtennopVer

    AtennopVer

    Joined:
    May 17, 2021
    Posts:
    2
    When I decided to optimize my game by creating generic material, I couldn't do it because 3 different materials were created for 3 different models. My Unity version is 2020.3.12f1 upload_2021-8-3_0-30-1.png
     
  29. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Hello.

    First, check the video by automatically translating the subtitles into your own language.

    I don't know from this one image, but are the Palettes on the Magica Voxel of the three vox exactly the same?
    Otherwise you will not be able to share the material.
    If the Palette is common, you can share it by setting it like a video.

    As far as you can see in the image, Extract Materials has not been done.
    Also, there are no common materials set for Remapped Materials.
    Please provide screenshots of the three Inspector states due to lack of information.

    Sharing materials means that the same material is set in the Remapped Materials of the three files.

    In addition, we are currently fixing problems such as the operation of selecting multiple items.
    If you can wait for a while, please wait for the next update.
     
    Last edited: Aug 3, 2021
  30. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Version 1.2.3 has been released.
    - FIX : ScriptedImporter : Remapped Materials : Fixed an issue that occurred when multiple selections were made in Unity 2019 or later
    - FIX : DaeExporter : Updated to latest

    Fixed the multi-select behavior part of Remapped Materials to be fine with the new Unity.
     
  31. AtennopVer

    AtennopVer

    Joined:
    May 17, 2021
    Posts:
    2
    I set the same palette for all models and everything is displayed correctly, thanks!
     
  32. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
  33. Silenius_

    Silenius_

    Joined:
    Oct 23, 2017
    Posts:
    14
    Hey @AloneSoft! I just purchased the asset and am very happy with it!

    However, when I'm trying to import a .vox file with the next unified material system, I'm getting this warning:
    [Voxel Importer] Unknown material type => _blend


    And it doesn't correctly import the materials because of that. Do you have any plans to support that?

    Some links that I think that would be helpful:
    https://ephtracy.github.io/#:~:text=New Unified Material System
    https://forum.unity.com/threads/disney-principled-brdf-shader.675697/
     
  34. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Hello,

    The warning is that this Asset does not support the Blend Material added in MagicaVoxel 0.99.6.2.
    Currently this type of Material is not available.

    In the next update, we'll be working to reflect it in the Standard Shader as closely as possible to other material types.
    It is not possible to create a new Shader that perfectly reproduces with this Asset.
    If you need it, you need to create a new shader that reproduces from the MagicaVoxel material information stored in this Asset's script.
     
  35. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Due to changes in Material information from MagicaVoxel 0.99.6.2, it turns out that existing materials such as Metal are also failing to import.
    It will be supported in the next update.
     
    Silenius_ likes this.
  36. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Version 1.2.4 has been released.
    - ADD : Load From Vox Material : Supports vox materials created with MagicaVoxel 0.99.6.2 or later
    - FIX : Load From Vox Material : Fixed to set Smoothness even if Metallic is 0
    - FIX : Load From Vox Material : Fixed to set Metallic and Smoothness when translucent
     
    Silenius_ likes this.
  37. Silenius_

    Silenius_

    Joined:
    Oct 23, 2017
    Posts:
    14
    Great update! Do you have any plans of adding exporting unity meshes into .vox files feature?
     
  38. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Do you want to export from Unity to fbx?
    This asset already has the ability to export to Collada (dae).
    dae can be converted to fbx.
     
  39. Silenius_

    Silenius_

    Joined:
    Oct 23, 2017
    Posts:
    14
    No, I'd like to export from Unity to .vox
     
  40. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    It's very difficult.
    It has a different purpose than this asset.
    This asset is an importer. Not within the feasible range.
     
  41. Farresto

    Farresto

    Joined:
    Jan 20, 2016
    Posts:
    9
    Hello,

    Is there any way to test how the low poly optimization would work?

    I have a big vox model (150-160k voxels), and I wanted to see how the asset would handle this before purchasing if possible. Mainly to see how it competes with doing an export in Qubicle or MagicaVoxel, or decimating in Blender.

    Thanks!
     
  42. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Hello,

    This asset cannot be tried before purchase.
    The asset is the source code itself.

    monu1.png
    Provides an example of Monu1 included in MagicaVoxel.
    Please use it as a reference for optimization.

    Thanks.
     
  43. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
  44. Silenius_

    Silenius_

    Joined:
    Oct 23, 2017
    Posts:
    14
    @AloneSoft can you add an option to export as FBX? I imported 2250 .vox assets (5-10mb each) into Unity and made them Addressables. But, I can't build Addressables because it crashes. If the .vox assets that I imported can be exported as FBX, I can make them Addressables and I can build.

    I don't want to use .dae files because they are turning 5mb vox file into 111mb dae file. If I convert them with FBX exporter, they end up 10mb.
     
  45. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    It is not possible to additionally support FBX export.
    It's not easy to support it.
    This asset is an importer.
    The output function is an extra function.
     
  46. Zurkio

    Zurkio

    Joined:
    Nov 9, 2014
    Posts:
    11
    Hey there,

    When I import a .vox file into Unity and then export it as a .dae file and fix the materials and then lightmap my scene, I get ugly black lines across multiple faces of my model. After importing the file into blender I was able to see that every edge has multiple overlapping edges and those are also ripped off and have holes. After trying to fix it for 2 hours I was still not able to merge them together even with the merge by distance tool or decimate modifier.

    Do you have any idea how I could fix this?

    Thanks!
     

    Attached Files:

  47. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    It would really be useful if there were a configurable option to bake ambient occlusion into the vertex colors of the imported mesh. I have a tool that does this as a second step, but that creates yet another mesh asset. It would be great if instead it could be baked into the asset created by the importer.

    Is there a way to write a plugin to the importer that could do a post-process of the mesh after Voxel Importer is finished with it and have it add vertex colors?
     
  48. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    I think it is good to adopt a method of writing color information equivalent to ambient occlusion in the vertex color.
    The reason is that voxel-optimized meshes often don't work well with lightmap.

    Currently there is no way to deal with this.
    I will consider it as a candidate for adding the function of asset update.
     
  49. RemiArturowicz

    RemiArturowicz

    Joined:
    Nov 22, 2018
    Posts:
    9
    Someone asked this but can you elaborate on it a little bit more? I want to have skinned mesh with multiple skinned meshesh inside. This would enable me to swap body parts. If your tool doesn't support it. Is it possible to do this manualy? Could you give a short description how I would start with something like that?
     
  50. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    This asset does not support multiple skinned meshes.
    Creating such a complex structure requires working with a DCC tool such as Blender.
    As an example, you can create it as one skinned mesh with this asset, output it to Dae, and divide it into multiple meshes with Blender.
     
    Brady likes this.