未验证 提交 f23cb9f6 编写于 作者: M Michael Herzog 提交者: GitHub

Merge pull request #17548 from Mugen87/dev38

Geometry: Better logging in .fromBufferGeometry().
......@@ -189,6 +189,13 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
var indices = geometry.index !== null ? geometry.index.array : undefined;
var attributes = geometry.attributes;
if ( attributes.position === undefined ) {
console.error( 'THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion.' );
return this;
}
var positions = attributes.position.array;
var normals = attributes.normal !== undefined ? attributes.normal.array : undefined;
var colors = attributes.color !== undefined ? attributes.color.array : undefined;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册