1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

three.meshlineを使うときにaddAttributeが更新されていなかった

Posted at

困ったこと

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 );
1
1
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?