Skip to content

Error when selecting individual voxels then trying to recombine, no alpha model. #12

@Discipol

Description

@Discipol

Steps to reproduce:
Get latest unity build.
Install this repo.
Load the knight model, without alpha model.
Select the individual voxel option, reimport.
Select the voxels that form the axe, or another voxel set. Try to merge them.
An error pops up here: alphaMax.voxels is null and you try to access it:

int alpha = alphaMask == null ? (byte)0 : alphaMask.voxels[ x, y, z ];

Fixing it like this:

int alpha = alphaMask == null || alphaMask.voxels == null ? (byte)0 : alphaMask.voxels[ x, y, z ];

Creates this error :S help

NullReferenceException: Object reference not set to an instance of an object
(wrapper managed-to-managed) object:ElementAddr_3_1 (object,int,int,int)
MVImporter.GenerateFaces (.MVVoxelChunk voxelChunk, .MVVoxelChunk alphaMask) (at Assets/MagicaVoxel/Scripts/MVImporter.cs:420)
MVVoxModelVoxelInspector.CombineVoxels (.MVVoxModelVoxel[] voxels) (at Assets/MagicaVoxel/Scripts/Editor/MVVoxModelVoxelInspector.cs:43)
MVVoxModelVoxelInspector.OnInspectorGUI () (at Assets/MagicaVoxel/Scripts/Editor/MVVoxModelVoxelInspector.cs:20)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1240)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions