@@ -199,6 +199,7 @@ async function main() {
199199 }
200200 createMeshBtn . onclick = function ( ) {
201201 if ( nv1 . meshes . length > 0 ) nv1 . removeMesh ( nv1 . meshes [ 0 ] )
202+ saveMeshBtn . disabled = true
202203 if ( nv1 . volumes . length < 1 ) {
203204 window . alert ( "Image not loaded. Drag and drop an image." )
204205 } else {
@@ -283,7 +284,6 @@ async function main() {
283284 file : outFile ,
284285 name : outFile . name
285286 } )
286-
287287 hdr = outVol . hdr
288288 img = outVol . img
289289 }
@@ -303,7 +303,6 @@ async function main() {
303303 const initialNiiMesh = iwm2meshCore ( largestOnly )
304304 const initialNiiMeshBuffer = NVMeshUtilities . createMZ3 ( initialNiiMesh . positions , initialNiiMesh . indices , false )
305305 await nv1 . loadFromArrayBuffer ( initialNiiMeshBuffer , 'trefoil.mz3' )
306- saveMeshBtn . disabled = false
307306 meshProcessingMsg . textContent = "Smoothing and remeshing"
308307 const smooth = parseInt ( smoothSlide . value )
309308 const shrink = parseFloat ( shrinkPct . value )
@@ -358,6 +357,9 @@ async function main() {
358357 }
359358 qualitySelect . onchange ( )
360359 nv1 . onImageLoaded = doLoadImage
360+ nv1 . onMeshLoaded = ( volume ) => {
361+ saveMeshBtn . disabled = false
362+ }
361363 modelSelect . selectedIndex = - 1
362364 workerCheck . checked = await isChrome ( ) //TODO: Safari does not yet support WebGL TFJS webworkers, test FireFox
363365 console . log ( 'brain2print 20241218' )
0 commit comments