困ったこと
yarnを使ってthree.meshline
をインポートしたときに、下記エラーがでてきて困った。
three.js内でつかわれているaddAttribute()
が.setAttribute()
に変更されたが,meshlineの方で更新されていなかったため起こったようだ。
使っているライブラリのバージョンメモ
"three": "^0.110.0",
"three.meshline": "^1.2.0"
エラー内容
.addAttribute() has been renamed to .setAttribute()
対策
すでにPRは立てられているが、これがマージされるまでは
https://github.com/spite/THREE.MeshLine/pull/92/files
node_modules/three.meshline/src/THREE.MeshLine.js
のなかで下記のように書き直せば使える。
this.geometry.setAttribute( 'position', this.attributes.position );
this.geometry.setAttribute( 'previous', this.attributes.previous );
this.geometry.setAttribute( 'next', this.attributes.next );
this.geometry.setAttribute( 'side', this.attributes.side );
this.geometry.setAttribute( 'width', this.attributes.width );
this.geometry.setAttribute( 'uv', this.attributes.uv );
this.geometry.setAttribute( 'counters', this.attributes.counters );