Update leenkx/Sources/iron/object/Animation.hx
This commit is contained in:
		| @ -411,12 +411,23 @@ class ActionSampler { | |||||||
| 	 */ | 	 */ | ||||||
| 	public inline function setBoneAction(actionData: Array<TObj>) { | 	public inline function setBoneAction(actionData: Array<TObj>) { | ||||||
| 		this.actionData = actionData; | 		this.actionData = actionData; | ||||||
| 		this.totalFrames = actionData[0].anim.tracks[0].frames.length; | 		if (actionData != null && actionData.length > 0 && actionData[0] != null && actionData[0].anim != null) { | ||||||
| 		if(actionData[0].anim.root_motion_pos) this.rootMotionPos = true; | 			if (actionData[0].anim.tracks != null && actionData[0].anim.tracks.length > 0) { | ||||||
| 		if(actionData[0].anim.root_motion_rot) this.rootMotionRot = true; | 				this.totalFrames = actionData[0].anim.tracks[0].frames.length; | ||||||
|  | 			} | ||||||
|  | 			else { | ||||||
|  | 				this.totalFrames = 0; | ||||||
|  | 			} | ||||||
|  | 			if(actionData[0].anim.root_motion_pos) this.rootMotionPos = true; | ||||||
|  | 			if(actionData[0].anim.root_motion_rot) this.rootMotionRot = true; | ||||||
|  | 		} | ||||||
|  | 		else { | ||||||
|  | 			this.totalFrames = 0; | ||||||
|  | 		} | ||||||
| 		actionDataInit = true; | 		actionDataInit = true; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  |  | ||||||
| 	/** | 	/** | ||||||
| 	 * Cache raw object data for object animation. | 	 * Cache raw object data for object animation. | ||||||
| 	 * @param actionData Raw object data. | 	 * @param actionData Raw object data. | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user