I came back to an old project with pythreejs which I’ve last run about 6 months ago on a different machine (the other machine is dead). I just installed the latest versions of everything (pythreejs 2.4.2, jupyterlab 4.2.2).
This code snippet works as it used to, and renders just fine:
t = ImageTexture(imageUri='rainbowBunny.jpg')#DataTexture(data=rgba_im, format='RGBAFormat', width=size, height=size)
ah = AxesHelper(size=3)
material = MeshLambertMaterial(map=t)
width, height, depth = 1, .5, .25
geometry = BoxGeometry(
width = width,
height = height,
depth = depth,
widthSegments=10,
heightSegments=10,
depthSegments=10)
myobject = Mesh(geometry=geometry, material=material, position=[1,1,1])
myobject
Whereas this one fails, as if the latest jupyter notebook / lab has stopped supporting the ArrowHelper object (I’ve tried installing a few other versions of pythreejs like 2.0.0 2.2.0 2.3.0 with no success)
arrowHelper = ArrowHelper( dir=[1,0,0], origin=[0,0,0], length=1, color='#000000' )
arrowHelper
I get error:
Failed to create view for 'PreviewView' from module 'jupyter-threejs' with model 'PreviewModel' from module 'jupyter-threejs'
TypeError: Cannot read properties of undefined (reading 'x')
at $e.copy (http://localhost:8888/lab/extensions/jupyter-threejs/static/212.54b17c6468a2f163735e.js?v=54b17c6468a2f163735e:2:32988)
at new Wh (http://localhost:8888/lab/extensions/jupyter-threejs/static/212.54b17c6468a2f163735e.js?v=54b17c6468a2f163735e:2:491463)
at Wh.clone (http://localhost:8888/lab/extensions/jupyter-threejs/static/212.54b17c6468a2f163735e.js?v=54b17c6468a2f163735e:2:184564)
at PreviewView.constructScene (http://localhost:8888/lab/extensions/jupyter-threejs/static/jupyter-threejs-chunk.4a408134e56e3be12acc.js?v=4a408134e56e3be12acc:1:1489)
at PreviewView.renderScene (http://localhost:8888/lab/extensions/jupyter-threejs/static/jupyter-threejs-chunk.4a408134e56e3be12acc.js?v=4a408134e56e3be12acc:1:3601)
at PreviewView.lazyRendererSetup (http://localhost:8888/lab/extensions/jupyter-threejs/static/jupyter-threejs-chunk.4a408134e56e3be12acc.js?v=4a408134e56e3be12acc:1:3437)
at PreviewView.doRender (http://localhost:8888/lab/extensions/jupyter-threejs/static/jupyter-threejs-chunk.4a408134e56e3be12acc.js?v=4a408134e56e3be12acc:1:8043)
at PreviewView.u (http://localhost:8888/lab/extensions/jupyter-threejs/static/624.b3031617d7af0c66cf08.js?v=b3031617d7af0c66cf08:2:74107)
at A._settlePromiseFromHandler (http://localhost:8888/lab/extensions/jupyter-threejs/static/624.b3031617d7af0c66cf08.js?v=b3031617d7af0c66cf08:2:47093)
at A._settlePromise (http://localhost:8888/lab/extensions/jupyter-threejs/static/624.b3031617d7af0c66cf08.js?v=b3031617d7af0c66cf08:2:47893)
at A._settlePromiseCtx (http://localhost:8888/lab/extensions/jupyter-threejs/static/624.b3031617d7af0c66cf08.js?v=b3031617d7af0c66cf08:2:48399)
at l (http://localhost:8888/lab/extensions/jupyter-threejs/static/624.b3031617d7af0c66cf08.js?v=b3031617d7af0c66cf08:2:1287)
at c (http://localhost:8888/lab/extensions/jupyter-threejs/static/624.b3031617d7af0c66cf08.js?v=b3031617d7af0c66cf08:2:1173)
at a._drainQueues (http://localhost:8888/lab/extensions/jupyter-threejs/static/624.b3031617d7af0c66cf08.js?v=b3031617d7af0c66cf08:2:2287)
at drainQueues (http://localhost:8888/lab/extensions/jupyter-threejs/static/624.b3031617d7af0c66cf08.js?v=b3031617d7af0c66cf08:2:1107)
From previous event:
at A.B [as _captureStackTrace] (http://localhost:8888/lab/extensions/jupyter-threejs/static/624.b3031617d7af0c66cf08.js?v=b3031617d7af0c66cf08:2:16275)
at A._then (http://localhost:8888/lab/extensions/jupyter-threejs/static/624.b3031617d7af0c66cf08.js?v=b3031617d7af0c66cf08:2:42492)
at A.then (http://localhost:8888/lab/extensions/jupyter-threejs/static/624.b3031617d7af0c66cf08.js?v=b3031617d7af0c66cf08:2:40848)
at PreviewView.render (http://localhost:8888/lab/extensions/jupyter-threejs/static/jupyter-threejs-chunk.4a408134e56e3be12acc.js?v=4a408134e56e3be12acc:1:1061)
at http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/327.68dbf8491690b3aff1e7.js?v=68dbf8491690b3aff1e7:1:2959
at async w.renderModel (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/446.fdf8b1b233cb8c1783f6.js?v=fdf8b1b233cb8c1783f6:1:72328)
Looking at the browser console …
Could not create a view for model id d8825dcd409d4af4ad093594188b5a5e
Any idea how I can fix this?