Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Voxel Importer

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

  1. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Version 1.1.11p2 has been released.
    - ADD : Unity2019.3 : support
    - FIX : Fixed the problem that Gizmos is not displayed in the scene in the hidden state in Unity2019.3
    - FIX : Fixed an issue where importing vox with material failed in Russian and other environments
     
  2. sherzhen

    sherzhen

    Joined:
    Jun 28, 2015
    Posts:
    13
    Hey! Is it possible with the help of your asset to make the dismemberment of characters as in paint the town red?
     
  3. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Do you want to paint only voxels and split them into different meshes? There is no such function.
    If you want to separate Mesh, separate it at the editor stage such as MagicaVoxel and Qubicle.
    Then use VoxelChunksObject or select Individual with ScriptedImporter.
    This asset is an importer.
    Loads editor data as is.
    The split state is reflected as it is, but there is no function to change it arbitrarily.
     
  4. sherzhen

    sherzhen

    Joined:
    Jun 28, 2015
    Posts:
    13
    Ok, i got it, thanks
     
  5. Bloxfan

    Bloxfan

    Joined:
    Feb 14, 2020
    Posts:
    12
    Hi AloneSoft,

    Love your asset! Bought it 2 years ago and using it for my game.

    Recently I have problem creating a voxel frame animation Object:
    - Issue when using amultiple sprite file (some work, others dont)
    - Getting below message. Using Unity 2018.4.9f1.

    Hope you can help, thks in advance.

    IndexOutOfRangeException: Index was outside the bounds of the array.
    (wrapper managed-to-managed) System.Object.ElementAddr_1(object,int,int,int)
    VoxelImporter.VoxelData+<>c__DisplayClass6_0.<CreateVoxelTable>b__0 (VoxelImporter.IntVector3 pos) (at Assets/VoxelImporter/Scripts/Data/VoxelData.cs:151)
    VoxelImporter.VoxelData.CreateVoxelTable () (at Assets/VoxelImporter/Scripts/Data/VoxelData.cs:163)
    VoxelImporter.VoxelBaseCore.CreateVoxelTable () (at Assets/VoxelImporter/Scripts/Editor/VoxelBaseCore.cs:1589)
    VoxelImporter.VoxelFrameAnimationObjectCore.CreateMesh () (at Assets/VoxelImporter/Scripts/Editor/VoxelFrameAnimationObjectCore.cs:379)
    VoxelImporter.VoxelBaseCore.Create (System.String path, UnityEngine.Object obj) (at Assets/VoxelImporter/Scripts/Editor/VoxelBaseCore.cs:120)
    VoxelImporter.VoxelBaseEditor.InspectorGUI_Import () (at Assets/VoxelImporter/Scripts/Editor/VoxelBaseEditor.cs:417)
    VoxelImporter.VoxelFrameAnimationObjectEditor.InspectorGUI () (at Assets/VoxelImporter/Scripts/Editor/VoxelFrameAnimationObjectEditor.cs:57)
    VoxelImporter.VoxelBaseEditor.OnInspectorGUI () (at Assets/VoxelImporter/Scripts/Editor/VoxelBaseEditor.cs:218)
    UnityEditor.InspectorWindow.DoOnInspectorGUI (System.Boolean rebuildOptimizedGUIBlock, UnityEditor.Editor editor, System.Boolean wasVisible, UnityEngine.Rect& contentRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1647)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
    Last edited: Feb 14, 2020
  6. Bloxfan

    Bloxfan

    Joined:
    Feb 14, 2020
    Posts:
    12
    If I may also ask:
    - Is there a way to reference by script the different meshes created when using a multiple sprite file?
    - When creating meshes, and not saving assets or not creating prefab, where are the assets kept?

    Thks again!
     
  7. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Hello.
    Sorry for the problem happened.
    Is it possible to provide a vox file that reproduces this problem?
     
  8. Bloxfan

    Bloxfan

    Joined:
    Feb 14, 2020
    Posts:
    12
  9. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    In script, it is possible to refer to mesh in VoxelFrameAnimationObject.frames.
    If you do not save Mesh etc. as assets or make it Prefab, data such as Mesh will be saved in the scene.
    This state is deleted in Build etc. without reference.
    Mesh etc. of the frame which is not displayed will not be displayed.
    Therefore, VoxelFrameAnimationObject needs to save or create Prefab with assets.
     
  10. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Not all project data is required.
    Only vox data is good.
    Please delete this share.

    EDIT:
    I was sorry.
    You don't need to provide png because you received it.
    Please wait for a while to investigate.
     
    Last edited: Feb 14, 2020
  11. Bloxfan

    Bloxfan

    Joined:
    Feb 14, 2020
    Posts:
    12
    Thks, I have delete link.
     
  12. Bloxfan

    Bloxfan

    Joined:
    Feb 14, 2020
    Posts:
    12
    Understood, thks for explanation!
     
  13. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Fixed the problem.
    This fix will be updated next week.
    If I can't wait for it and I want this fix in a hurry, I create a patch.
    Let me know if you want.
     
  14. Bloxfan

    Bloxfan

    Joined:
    Feb 14, 2020
    Posts:
    12
    Wow that was fast, very grateful. No worry, I can wait for the update. Cheers, have a great week-end (and Valentine Day if have anything special planned :)
     
  15. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    There was information from Unity on the Unity Asset Store Publisher Forum, but the asset review has now ceased.
    It is scheduled to resume after 23rd.
    As a result, the asset will not be updated because updates have already been submitted but will not be approved until after 23 days.
     
  16. Bloxfan

    Bloxfan

    Joined:
    Feb 14, 2020
    Posts:
    12
    Hi AloneSoft,

    Thanks for the update. Will wait for the update after 23rd then. Cheers
     
  17. Bloxfan

    Bloxfan

    Joined:
    Feb 14, 2020
    Posts:
    12
    Hi again AloneSoft. Regarding VoxelFrameAnimation, would it be possible to have a simple script that allows to loop between frames without using Unity animator? Kinda like below but with VoxelMesh. This would be useful for quick animations (eg: fire burning). Good weekend to all, Cheers

    upload_2020-2-22_9-56-50.png
     
  18. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315

    It is recommended to use Animation Clip to control animation.
    If you want to easily play simple animations that only play in order, you can create them from the menu.
    Adjusting the base speed changes Samples.
    We have prepared a video. please confirm.
     
  19. Bloxfan

    Bloxfan

    Joined:
    Feb 14, 2020
    Posts:
    12
    I didnt know about export animation curve, very useful! Thnks again!
     
  20. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Version 1.1.11p3 has been released.
    - FIX : Bug fix when png size and texture size are different
     
  21. Bloxfan

    Bloxfan

    Joined:
    Feb 14, 2020
    Posts:
    12
    Just updated, works great! Thks.

    Just to quickly show how your asset is helping build my game.
    Its an action adventure game based in Saigon. I wanted it to have a 2d sketch design, but also be able to have a 1st person point of view. Thats why I needed a voxel asset :)

    upload_2020-2-26_11-6-56.png

    upload_2020-2-26_11-9-29.png

    upload_2020-2-26_11-8-12.png
     
  22. pep_dj

    pep_dj

    Joined:
    Nov 7, 2014
    Posts:
    179
    I'm almost sure to buy Voxel Importer, but I have a question: will mixamo recognize the bones of a character rigged with Voxel Importer?
     
    Last edited: Apr 9, 2020
  23. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Hello.
    I've tried it and it worked without a problem.
    Here are the steps.
    • Rigging with VoxelImporter
    • To avoid blurring of textures in Mixamo, set the Import Mode to Low Texture
    • Export to Dae file
    • Convert to fbx with Fbx Converter
    • Compress fbx and png into one zip file
    • Upload to Mixamo
    Mixamo.png
     
    pep_dj likes this.
  24. pep_dj

    pep_dj

    Joined:
    Nov 7, 2014
    Posts:
    179
    Thank you for your detailed answer. I've just bought Voxel Importer. I'll try the steps you described :)

    EDIT: I've just tried it, and it worked like a charm! Thank you!
     
    Last edited: Apr 10, 2020
  25. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Version 1.1.12 has been released.
    - ADD : Unity2020.1 : support
    - ADD : Optimize : 'Remove unused palettes' flag added
    - FIX : DaeExporter : Update to latest version
     
  26. pep_dj

    pep_dj

    Joined:
    Nov 7, 2014
    Posts:
    179
    Sorry for asking too much, but I'm new in 3D, and also with your plugin: AFAIK each voxel file has its own material. As all my voxel files share the same color palette, can they all share the same material in Unity to optimize rendering?
     
  27. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    By default, all of these assets will be combined into a single material if there is no material information.
    The reason why there are multiple materials in the import stage is because we have set the materials in MagicaVoxel.
    Disable the import of materials to merge them into a single material.
    Disable 'Load From Voxel File'.
    If this information is incorrect, please provide a screenshot or other picture of your situation.
    Load From Voxel File.png

    Edit:
    sorry. I use automatic translation because I am not good at English.
    Therefore it seems that the recognition was wrong.
    Does that mean you want to combine the materials of different voxel files into one?
    That's not possible with this asset alone.
     
    pep_dj likes this.
  28. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315

    I tested it again and found a way to share material across multiple voxel objects that use a common palette.
    You can do that by following the steps in this video.
    We have confirmed that SetPass calls will be reduced, but it may need to be verified as we are not sure if it will definitely speed up.

    There are two settings that are important.
    • Import Mode - Low Texture
    • Remove unused palettes - Disable
     
    pep_dj likes this.
  29. pep_dj

    pep_dj

    Joined:
    Nov 7, 2014
    Posts:
    179
    That's great! thanks!
     
  30. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Version 1.1.12p1 has been released.
    - FIX : ScriptedImporter : Remapped Materials can now be changed with multiple selections.
    - FIX : ScriptedImporter : Fixed loss of references when renaming (if the meta data already exists, you will need to change some settings to update the meta data)

    New tutorial video to share materials.
     
  31. GodlikeAurora

    GodlikeAurora

    Joined:
    Dec 7, 2016
    Posts:
    14
    Hi! Is it supports Magica Voxel 0.99.5?
     
  32. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Hello.
    There is no change in VOX's format, so it works fine.
     
    GodlikeAurora likes this.
  33. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Version 1.1.13 has been released.
    - ADD : Voxel Explosion : Supports URP and HDRP (Unity2019.3 or later, Shader Graph 7.3.1 or later)
    - FIX : URP : Corrected material import errors
    - FIX : VoxelSkinnedAnimationObjectExplosion : Fixed an issue where Mesh could become the initial Pose in Bake.
    - FIX : Voxel Explosion : Fixed the problem that Prefab selected in Project Window repeats updating
    - FIX : Voxel Explosion : Fixed not to be able to select Preview of Prefab selected in Project Window
    - FIX : VoxelFrameAnimationObject : Fixed an error in adding a frame to a vox with a material or invalid face set.
    - FIX : VoxelSkinnedAnimationObject : Fixed an issue where the existing Avatar reference was lost and an error occurred when updating PrefabMode
    - FIX : Material : Fixed Reset behavior
     
  34. BenWilles

    BenWilles

    Joined:
    Mar 9, 2018
    Posts:
    41
    Hi, got two questions about the Voxel Explosion.

    1. Wonder about performance of it, is it using Particles?
    2. In Video it looks as if a prefab is used as voxel file, is this a optimised prefab from a voxelfile or is the original Voxel file needed?
     
  35. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Hello,

    1.
    A separate exploding mesh is created from the first mesh displayed.
    By running the exploding Mesh in a special exploding Shader, the positions of the vertices will change and it will look like an explosion.
    No particles are used.

    2.
    When you import it, it will create an optimized Mesh and a Mesh for explosion.
    After that, the voxel file is not used.
    The explosion is done by deleting the optimized Mesh and showing the explosion Mesh instead.
     
    BenWilles likes this.
  36. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Version 1.1.13p1 has been released.
    - FIX : Change the minimum operation version to Unity2018.4
    - FIX : Undo : Fixed the problem that Undo may not work in Unity 2018 LTS or later
    - FIX : VoxelSkinnedAnimationObject : Edit Bone Weight : Error correction when there are no voxels on the Mirror side
    - FIX : Fixed an issue where an error was displayed on the console in Save processing
     
  37. jinhwan-ahn

    jinhwan-ahn

    Joined:
    Sep 24, 2012
    Posts:
    3
    If I copy with ctrl-d, the result is sharing the voxel model.

    There are other similar voxel files I think you can apply the same bone weight Is there a way to copy the whole bone weight and apply it to another voxel?
     
  38. jinhwan-ahn

    jinhwan-ahn

    Joined:
    Sep 24, 2012
    Posts:
    3
    I can do it in prefab mode... Solved.
     
  39. salsa

    salsa

    Joined:
    Sep 20, 2012
    Posts:
    7
  40. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Hello,
    In this importer, the state of being placed in MagicaVoxel is completely maintained and imported.
    You can also edit the pivot offset from that state.

    If you don't get the results you want, please report a bug or hurry to request a refund.
     
    salsa likes this.
  41. uzisho

    uzisho

    Joined:
    Jul 3, 2019
    Posts:
    14
    Is there a way to change the mesh that is imported into Unity? thx for the great asset!
     
  42. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    There is a sample script method that changes the vertices and normals at the time of import. Check the scene below.
    VoxelImporter\Examples\EditMesh
    It cannot be changed using the Scripted Importer method.
     
  43. uzisho

    uzisho

    Joined:
    Jul 3, 2019
    Posts:
    14
    I figured it out. What I did is to change the VoxelScriptedImporter.cs file so now it is:
    ctx.AddObjectToAsset(voxelObject.mesh.name = "mesh-"+gameObject.name, voxelObject.mesh);

    If I may make a suggestion - I think you should make this a permanent change. Otherwise you end up with dozens of meshes called "mesh" in the project.
     
  44. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Do you want to rename sub-asset names such as 'mesh' or 'mat0'?
    If so, the next update will change the default naming setting from something like 'mesh' to a voxel file name.
    Please wait for a little while.
     
  45. uzisho

    uzisho

    Joined:
    Jul 3, 2019
    Posts:
    14
    I changed the source files to achieve that but I think this will benefit the community.
    Keep up the great work!
     
  46. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    Version 1.2.0 has been released.
    - ADD : Support Assembly Definition (Because the folder structure is changed, it is necessary to install after deleting the existing folder)
    - ADD : Changed the naming convention for asset names such as Mesh and chunk names, and added an option to keep the previous naming convention for compatibility
    - FIX : Changed from Texture2D.SetPixels to use Texture2D.SetPixels32
    - FIX : Warning fix in Unity 2020.2

    Data created in previous versions will have the compatibility flag enabled.
    LegacyAssetNaming.png
     
  47. olszewskim1991

    olszewskim1991

    Joined:
    Jan 4, 2018
    Posts:
    1
    Is it possible to split the model into separate voxels in this plugin? I want to have the possibility to show model voxel by voxel. Something like in the image below.
     
  48. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    It is not possible to directly import everything in the Cube state.
    However, it contains a sample that saves the Voxel Structure on import and creates it in Cube from that information at runtime.
    Voxel.png
     
  49. Bioxx

    Bioxx

    Joined:
    Mar 7, 2014
    Posts:
    6
    I'm having a slight issue with importing a vox asset. When I drag and drop the file into unity, lets call the file Wall01, the resulting prefab is getting renamed to _all01. The first letter is always replaced with an underscore. This doesn't happen if I drop the file in the asset folder via windows explorer, it imports as intended. I'm using Unity 2020.1.11f
     
  50. AloneSoft

    AloneSoft

    Joined:
    Apr 28, 2015
    Posts:
    315
    I also reproduced and confirmed the problem.
    The Issue ID could not be found.
    But this seems to be a Unity bug.
    It also occurs when Voxel Importer is not imported.

    Create a new project in Unity2020.1.14f1 and drop some files: renamed
    Create a new project in Unity2020.2.0b12 and drop some files: not renamed

    Try using Unity 2020.2 or later.