瀏覽代碼

export json honors material array (#28431)

ycw 1 年之前
父節點
當前提交
312b7ee9c0
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      editor/js/Sidebar.Material.js

+ 1 - 1
editor/js/Sidebar.Material.js

@@ -430,7 +430,7 @@ function SidebarMaterial( editor ) {
 	exportJson.onClick( function () {
 	exportJson.onClick( function () {
 
 
 		const object = editor.selected;
 		const object = editor.selected;
-		const material = object.material;
+		const material = Array.isArray( object.material ) ? object.material[ currentMaterialSlot ] : object.material;
 
 
 		let output = material.toJSON();
 		let output = material.toJSON();