Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
bf794d63
T
three.js
项目概览
车家大少爷
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
bf794d63
编写于
10月 11, 2019
作者:
M
Mr.doob
提交者:
GitHub
10月 11, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17711 from kaisalmen/OBJLoader2_17615
ObjLoader2Parser materials are not applied in worker
上级
e699c32a
33198861
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
21 addition
and
16 deletion
+21
-16
examples/jsm/loaders/OBJLoader2.d.ts
examples/jsm/loaders/OBJLoader2.d.ts
+1
-1
examples/jsm/loaders/OBJLoader2.js
examples/jsm/loaders/OBJLoader2.js
+4
-3
examples/jsm/loaders/OBJLoader2Parallel.js
examples/jsm/loaders/OBJLoader2Parallel.js
+3
-3
examples/jsm/loaders/obj2/shared/MaterialHandler.d.ts
examples/jsm/loaders/obj2/shared/MaterialHandler.d.ts
+1
-1
examples/jsm/loaders/obj2/worker/parallel/WorkerRunner.js
examples/jsm/loaders/obj2/worker/parallel/WorkerRunner.js
+2
-3
examples/webgl_loader_obj2.html
examples/webgl_loader_obj2.html
+1
-1
examples/webgl_loader_obj2_options.html
examples/webgl_loader_obj2_options.html
+9
-4
未找到文件。
examples/jsm/loaders/OBJLoader2.d.ts
浏览文件 @
bf794d63
...
...
@@ -30,7 +30,7 @@ export class OBJLoader2 extends Loader {
setPath
(
path
:
string
):
this
;
setResourcePath
(
path
:
string
):
this
;
setBaseObject3d
(
baseObject3d
:
Object3D
):
this
;
addMaterials
(
materials
:
object
):
this
;
addMaterials
(
materials
:
object
,
overrideExisting
:
boolean
):
this
;
setCallbackOnAssetAvailable
(
onAssetAvailable
:
Function
):
this
;
setCallbackOnProgress
(
onProgress
:
Function
):
this
;
...
...
examples/jsm/loaders/OBJLoader2.js
浏览文件 @
bf794d63
...
...
@@ -43,7 +43,7 @@ const OBJLoader2 = function ( manager ) {
};
OBJLoader2
.
OBJLOADER2_VERSION
=
'
3.1.
0
'
;
OBJLoader2
.
OBJLOADER2_VERSION
=
'
3.1.
1
'
;
console
.
info
(
'
Using OBJLoader2 version:
'
+
OBJLoader2
.
OBJLOADER2_VERSION
);
...
...
@@ -136,11 +136,12 @@ OBJLoader2.prototype = Object.assign( Object.create( Loader.prototype ), {
* Add materials as associated array.
*
* @param {Object} materials Object with named {@link Material}
* @param overrideExisting boolean Override existing material
* @return {OBJLoader2}
*/
addMaterials
:
function
(
materials
)
{
addMaterials
:
function
(
materials
,
overrideExisting
)
{
this
.
materialHandler
.
addMaterials
(
materials
);
this
.
materialHandler
.
addMaterials
(
materials
,
overrideExisting
);
return
this
;
},
...
...
examples/jsm/loaders/OBJLoader2Parallel.js
浏览文件 @
bf794d63
...
...
@@ -40,7 +40,7 @@ const OBJLoader2Parallel = function ( manager ) {
};
OBJLoader2Parallel
.
OBJLOADER2_PARALLEL_VERSION
=
'
3.1.
0
'
;
OBJLoader2Parallel
.
OBJLOADER2_PARALLEL_VERSION
=
'
3.1.
1
'
;
console
.
info
(
'
Using OBJLoader2Parallel version:
'
+
OBJLoader2Parallel
.
OBJLOADER2_PARALLEL_VERSION
);
...
...
@@ -92,7 +92,7 @@ OBJLoader2Parallel.prototype = Object.assign( Object.create( OBJLoader2.prototyp
let
codeBuilderInstructions
=
new
CodeBuilderInstructions
(
true
,
true
,
this
.
preferJsmWorker
);
if
(
codeBuilderInstructions
.
isSupportsJsmWorker
()
)
{
codeBuilderInstructions
.
setJsmWorkerFile
(
'
../
../src/loaders
/worker/parallel/jsm/OBJLoader2Worker.js
'
);
codeBuilderInstructions
.
setJsmWorkerFile
(
'
../
examples/loaders/jsm/obj2
/worker/parallel/jsm/OBJLoader2Worker.js
'
);
}
if
(
codeBuilderInstructions
.
isSupportsStandardWorker
()
)
{
...
...
@@ -189,8 +189,8 @@ OBJLoader2Parallel.prototype = Object.assign( Object.create( OBJLoader2.prototyp
disregardNormals
:
this
.
parser
.
disregardNormals
,
materialPerSmoothingGroup
:
this
.
parser
.
materialPerSmoothingGroup
,
useOAsMesh
:
this
.
parser
.
useOAsMesh
,
materials
:
this
.
materialHandler
.
getMaterialsJSON
()
},
materials
:
this
.
materialHandler
.
getMaterialsJSON
(),
data
:
{
input
:
content
,
options
:
null
...
...
examples/jsm/loaders/obj2/shared/MaterialHandler.d.ts
浏览文件 @
bf794d63
...
...
@@ -15,7 +15,7 @@ export class MaterialHandler {
materials
:
object
;
createDefaultMaterials
(
overrideExisting
:
boolean
):
void
;
addMaterials
(
materials
:
object
,
overrideExisting
:
boolean
,
newMaterials
:
object
):
object
;
addMaterials
(
materials
:
object
,
overrideExisting
:
boolean
,
newMaterials
?
:
object
):
object
;
addPayloadMaterials
(
materialPayload
:
object
):
object
;
setLogging
(
enabled
:
boolean
,
debug
:
boolean
):
void
;
getMaterials
():
object
;
...
...
examples/jsm/loaders/obj2/worker/parallel/WorkerRunner.js
浏览文件 @
bf794d63
...
...
@@ -49,9 +49,8 @@ DefaultWorkerPayloadHandler.prototype = {
parser
.
setLogging
(
this
.
logging
.
enabled
,
this
.
logging
.
debug
);
}
ObjectManipulator
.
applyProperties
(
parser
,
payload
.
params
);
ObjectManipulator
.
applyProperties
(
parser
,
payload
.
materials
);
ObjectManipulator
.
applyProperties
(
parser
,
callbacks
);
ObjectManipulator
.
applyProperties
(
parser
,
payload
.
params
,
false
);
ObjectManipulator
.
applyProperties
(
parser
,
callbacks
,
false
);
let
arraybuffer
;
if
(
payload
.
params
&&
payload
.
params
.
index
!==
undefined
&&
payload
.
params
.
index
!==
null
)
{
...
...
examples/webgl_loader_obj2.html
浏览文件 @
bf794d63
...
...
@@ -130,7 +130,7 @@
let
onLoadMtl
=
function
(
mtlParseResult
)
{
objLoader2
.
setModelName
(
modelName
);
objLoader2
.
setLogging
(
true
,
true
);
objLoader2
.
addMaterials
(
MtlObjBridge
.
addMaterialsFromMtlLoader
(
mtlParseResult
)
);
objLoader2
.
addMaterials
(
MtlObjBridge
.
addMaterialsFromMtlLoader
(
mtlParseResult
)
,
true
);
objLoader2
.
load
(
'
models/obj/female02/female02.obj
'
,
callbackOnLoad
,
null
,
null
,
null
);
};
let
mtlLoader
=
new
MTLLoader
();
...
...
examples/webgl_loader_obj2_options.html
浏览文件 @
bf794d63
...
...
@@ -141,7 +141,7 @@
let
scope
=
this
;
function
onLoadMtl
(
mtlParseResult
)
{
objLoader2
.
addMaterials
(
MtlObjBridge
.
addMaterialsFromMtlLoader
(
mtlParseResult
)
);
objLoader2
.
addMaterials
(
MtlObjBridge
.
addMaterialsFromMtlLoader
(
mtlParseResult
)
,
true
);
let
fileLoader
=
new
THREE
.
FileLoader
();
fileLoader
.
setPath
(
''
);
...
...
@@ -173,9 +173,14 @@
scope
.
_reportProgress
(
{
detail
:
{
text
:
'
Loading of
'
+
modelName
+
'
completed:
'
+
message
}
}
);
}
let
materials
=
{
tester
:
new
THREE
.
MeshStandardMaterial
();
};
let
objLoader2Parallel
=
new
OBJLoader2Parallel
()
.
setModelName
(
modelName
)
.
setCallbackOnLoad
(
callbackOnLoad
);
.
setCallbackOnLoad
(
callbackOnLoad
)
.
addMaterials
(
materials
,
true
);
let
fileLoader
=
new
THREE
.
FileLoader
();
fileLoader
.
setPath
(
''
);
...
...
@@ -207,7 +212,7 @@
}
function
onLoadMtl
(
mtlParseResult
)
{
objLoader2
.
addMaterials
(
MtlObjBridge
.
addMaterialsFromMtlLoader
(
mtlParseResult
)
);
objLoader2
.
addMaterials
(
MtlObjBridge
.
addMaterialsFromMtlLoader
(
mtlParseResult
)
,
true
);
objLoader2
.
load
(
'
models/obj/male02/male02.obj
'
,
callbackOnLoad
,
null
,
null
,
null
);
}
...
...
@@ -235,7 +240,7 @@
scope
.
_reportProgress
(
{
detail
:
{
text
:
'
Loading of
'
+
modelName
+
'
completed:
'
+
message
}
}
);
}
function
onLoadMtl
(
mtlParseResult
)
{
objLoader2Parallel
.
addMaterials
(
MtlObjBridge
.
addMaterialsFromMtlLoader
(
mtlParseResult
)
);
objLoader2Parallel
.
addMaterials
(
MtlObjBridge
.
addMaterialsFromMtlLoader
(
mtlParseResult
)
,
true
);
objLoader2Parallel
.
load
(
'
models/obj/walt/WaltHead.obj
'
,
callbackOnLoad
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录