提交 79f9dd75 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #11748 from takahirox/FixMMDLoader

Add tracks length check for MMDHelper
......@@ -2304,7 +2304,8 @@ THREE.MMDHelper.prototype = {
// the name of them begins with "_".
mesh.mixer.addEventListener( 'loop', function ( e ) {
if ( e.action._clip.tracks[ 0 ].name.indexOf( '.bones' ) !== 0 ) return;
if ( e.action._clip.tracks.length > 0 &&
e.action._clip.tracks[ 0 ].name.indexOf( '.bones' ) !== 0 ) return;
var mesh = e.target._root;
mesh.looped = true;
......@@ -2320,7 +2321,7 @@ THREE.MMDHelper.prototype = {
var action = mesh.mixer.clipAction( clip );
if ( clip.tracks[ 0 ].name.indexOf( '.morphTargetInfluences' ) === 0 ) {
if ( clip.tracks.length > 0 && clip.tracks[ 0 ].name.indexOf( '.morphTargetInfluences' ) === 0 ) {
if ( ! foundMorphAnimation ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册