Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
72f94e88
T
three.js
项目概览
Ablesons
/
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,体验更适合开发者的 AI 搜索 >>
提交
72f94e88
编写于
7月 11, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Reverted to uint vased ids. Added uuid property.
Pheww... Glad that I figured this out in time.
上级
e9a07c9e
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
56 addition
and
53 deletion
+56
-53
editor/js/Sidebar.Object3D.js
editor/js/Sidebar.Object3D.js
+11
-11
editor/js/Sidebar.Scene.js
editor/js/Sidebar.Scene.js
+1
-1
editor/js/libs/ui.js
editor/js/libs/ui.js
+9
-21
examples/js/exporters/MaterialExporter.js
examples/js/exporters/MaterialExporter.js
+1
-1
examples/js/exporters/ObjectExporter.js
examples/js/exporters/ObjectExporter.js
+8
-8
src/core/BufferGeometry.js
src/core/BufferGeometry.js
+2
-1
src/core/Geometry.js
src/core/Geometry.js
+4
-1
src/core/Object3D.js
src/core/Object3D.js
+3
-1
src/loaders/ObjectLoader.js
src/loaders/ObjectLoader.js
+9
-6
src/materials/Material.js
src/materials/Material.js
+4
-1
src/textures/Texture.js
src/textures/Texture.js
+4
-1
未找到文件。
editor/js/Sidebar.Object3D.js
浏览文件 @
72f94e88
...
...
@@ -11,20 +11,20 @@ Sidebar.Object3D = function ( signals ) {
// id
var
object
Id
Row
=
new
UI
.
Panel
();
var
object
Id
=
new
UI
.
Input
().
setWidth
(
'
115px
'
).
setColor
(
'
#444
'
).
setFontSize
(
'
12px
'
).
setDisabled
(
true
);
var
object
Id
Renew
=
new
UI
.
Button
(
'
⟳
'
).
setMarginLeft
(
'
7px
'
).
onClick
(
function
()
{
var
object
UUID
Row
=
new
UI
.
Panel
();
var
object
UUID
=
new
UI
.
Input
().
setWidth
(
'
115px
'
).
setColor
(
'
#444
'
).
setFontSize
(
'
12px
'
).
setDisabled
(
true
);
var
object
UUID
Renew
=
new
UI
.
Button
(
'
⟳
'
).
setMarginLeft
(
'
7px
'
).
onClick
(
function
()
{
object
Id
.
setValue
(
THREE
.
Math
.
generateUUID
()
);
object
UUID
.
setValue
(
THREE
.
Math
.
generateUUID
()
);
update
();
}
);
object
Id
Row
.
add
(
new
UI
.
Text
(
'
Id
'
).
setWidth
(
'
90px
'
).
setColor
(
'
#666
'
)
);
object
IdRow
.
add
(
objectId
);
object
IdRow
.
add
(
objectId
Renew
);
object
UUID
Row
.
add
(
new
UI
.
Text
(
'
Id
'
).
setWidth
(
'
90px
'
).
setColor
(
'
#666
'
)
);
object
UUIDRow
.
add
(
objectUUID
);
object
UUIDRow
.
add
(
objectUUID
Renew
);
container
.
add
(
object
Id
Row
);
container
.
add
(
object
UUID
Row
);
// name
...
...
@@ -266,12 +266,12 @@ Sidebar.Object3D = function ( signals ) {
if
(
selected
)
{
selected
.
id
=
objectId
.
getValue
();
selected
.
uuid
=
objectUUID
.
getValue
();
selected
.
name
=
objectName
.
getValue
();
if
(
selected
.
parent
!==
undefined
)
{
var
newParentId
=
objectParent
.
getValue
(
);
var
newParentId
=
parseInt
(
objectParent
.
getValue
()
);
if
(
selected
.
parent
.
id
!==
newParentId
&&
selected
.
id
!==
newParentId
)
{
...
...
@@ -488,7 +488,7 @@ Sidebar.Object3D = function ( signals ) {
objectType
.
setValue
(
getObjectInstanceName
(
object
)
);
object
Id
.
setValue
(
object
.
id
);
object
UUID
.
setValue
(
object
.
uu
id
);
objectName
.
setValue
(
object
.
name
);
if
(
object
.
parent
!==
undefined
)
{
...
...
editor/js/Sidebar.Scene.js
浏览文件 @
72f94e88
...
...
@@ -107,7 +107,7 @@ Sidebar.Scene = function ( signals ) {
function
updateOutliner
()
{
var
id
=
outliner
.
getValue
(
);
var
id
=
parseInt
(
outliner
.
getValue
()
);
scene
.
traverse
(
function
(
node
)
{
...
...
editor/js/libs/ui.js
浏览文件 @
72f94e88
...
...
@@ -355,26 +355,6 @@ UI.FancySelect.prototype.setOptions = function ( options ) {
scope
.
options
=
[];
var
generateOptionCallback
=
function
(
element
,
value
)
{
return
function
(
event
)
{
for
(
var
i
=
0
;
i
<
scope
.
options
.
length
;
i
++
)
{
scope
.
options
[
i
].
style
.
backgroundColor
=
'
#f0f0f0
'
;
}
element
.
style
.
backgroundColor
=
'
#f0f0f0
'
;
scope
.
selectedValue
=
value
;
scope
.
dom
.
dispatchEvent
(
changeEvent
);
}
};
for
(
var
key
in
options
)
{
var
option
=
document
.
createElement
(
'
div
'
);
...
...
@@ -385,7 +365,13 @@ UI.FancySelect.prototype.setOptions = function ( options ) {
scope
.
dom
.
appendChild
(
option
);
scope
.
options
.
push
(
option
);
option
.
addEventListener
(
'
click
'
,
generateOptionCallback
(
option
,
key
),
false
);
option
.
addEventListener
(
'
click
'
,
function
(
event
)
{
scope
.
setValue
(
this
.
value
);
scope
.
dom
.
dispatchEvent
(
changeEvent
);
},
false
);
}
...
...
@@ -401,6 +387,8 @@ UI.FancySelect.prototype.getValue = function () {
UI
.
FancySelect
.
prototype
.
setValue
=
function
(
value
)
{
if
(
typeof
value
===
'
number
'
)
value
=
value
.
toString
();
for
(
var
i
=
0
;
i
<
this
.
options
.
length
;
i
++
)
{
var
element
=
this
.
options
[
i
];
...
...
examples/js/exporters/MaterialExporter.js
浏览文件 @
72f94e88
...
...
@@ -18,7 +18,7 @@ THREE.MaterialExporter.prototype = {
}
};
output
.
id
=
material
.
id
;
output
.
uuid
=
material
.
uu
id
;
if
(
material
.
name
!==
""
)
output
.
name
=
material
.
name
;
...
...
examples/js/exporters/ObjectExporter.js
浏览文件 @
72f94e88
...
...
@@ -33,11 +33,11 @@ THREE.ObjectExporter.prototype = {
}
if
(
geometries
[
geometry
.
id
]
===
undefined
)
{
if
(
geometries
[
geometry
.
uu
id
]
===
undefined
)
{
var
data
=
{};
data
.
id
=
geometry
.
id
;
data
.
uuid
=
geometry
.
uu
id
;
if
(
geometry
.
name
!==
""
)
data
.
name
=
geometry
.
name
;
...
...
@@ -115,13 +115,13 @@ THREE.ObjectExporter.prototype = {
}
geometries
[
geometry
.
id
]
=
data
;
geometries
[
geometry
.
uu
id
]
=
data
;
output
.
geometries
.
push
(
data
);
}
return
geometry
.
id
;
return
geometry
.
uu
id
;
};
...
...
@@ -138,19 +138,19 @@ THREE.ObjectExporter.prototype = {
}
if
(
materials
[
material
.
id
]
===
undefined
)
{
if
(
materials
[
material
.
uu
id
]
===
undefined
)
{
var
data
=
materialExporter
.
parse
(
material
);
delete
data
.
metadata
;
materials
[
material
.
id
]
=
data
;
materials
[
material
.
uu
id
]
=
data
;
output
.
materials
.
push
(
data
);
}
return
material
.
id
;
return
material
.
uu
id
;
};
...
...
@@ -160,7 +160,7 @@ THREE.ObjectExporter.prototype = {
var
data
=
{};
data
.
id
=
object
.
id
;
data
.
uuid
=
object
.
uu
id
;
if
(
object
.
name
!==
''
)
data
.
name
=
object
.
name
;
if
(
JSON
.
stringify
(
object
.
userData
)
!==
'
{}
'
)
data
.
userData
=
object
.
userData
;
...
...
src/core/BufferGeometry.js
浏览文件 @
72f94e88
...
...
@@ -4,7 +4,8 @@
THREE
.
BufferGeometry
=
function
()
{
this
.
id
=
THREE
.
Math
.
generateUUID
();
this
.
id
=
THREE
.
GeometryIdCount
++
;
this
.
uuid
=
THREE
.
Math
.
generateUUID
();
// attributes
...
...
src/core/Geometry.js
浏览文件 @
72f94e88
...
...
@@ -9,7 +9,8 @@
THREE
.
Geometry
=
function
()
{
this
.
id
=
THREE
.
Math
.
generateUUID
();
this
.
id
=
THREE
.
GeometryIdCount
++
;
this
.
uuid
=
THREE
.
Math
.
generateUUID
();
this
.
name
=
''
;
...
...
@@ -814,3 +815,5 @@ THREE.Geometry.prototype = {
}
};
THREE
.
GeometryIdCount
=
0
;
src/core/Object3D.js
浏览文件 @
72f94e88
...
...
@@ -7,7 +7,8 @@
THREE
.
Object3D
=
function
()
{
this
.
id
=
THREE
.
Math
.
generateUUID
();
this
.
id
=
THREE
.
Object3DIdCount
++
;
this
.
uuid
=
THREE
.
Math
.
generateUUID
();
this
.
name
=
''
;
...
...
@@ -542,3 +543,4 @@ THREE.Object3D.prototype = {
};
THREE
.
Object3D
.
defaultEulerOrder
=
'
XYZ
'
;
THREE
.
Object3DIdCount
=
0
;
src/loaders/ObjectLoader.js
浏览文件 @
72f94e88
...
...
@@ -151,10 +151,11 @@ THREE.ObjectLoader.prototype = {
}
if
(
data
.
id
!==
undefined
)
geometry
.
id
=
data
.
id
;
geometry
.
uuid
=
data
.
uuid
;
if
(
data
.
name
!==
undefined
)
geometry
.
name
=
data
.
name
;
geometries
[
data
.
id
]
=
geometry
;
geometries
[
data
.
uu
id
]
=
geometry
;
}
...
...
@@ -177,10 +178,11 @@ THREE.ObjectLoader.prototype = {
var
data
=
json
[
i
];
var
material
=
loader
.
parse
(
data
);
if
(
data
.
id
!==
undefined
)
material
.
id
=
data
.
id
;
material
.
uuid
=
data
.
uuid
;
if
(
data
.
name
!==
undefined
)
material
.
name
=
data
.
name
;
materials
[
data
.
id
]
=
material
;
materials
[
data
.
uu
id
]
=
material
;
}
...
...
@@ -275,6 +277,9 @@ THREE.ObjectLoader.prototype = {
}
object
.
uuid
=
data
.
uuid
;
if
(
data
.
name
!==
undefined
)
object
.
name
=
data
.
name
;
if
(
data
.
matrix
!==
undefined
)
{
matrix
.
fromArray
(
data
.
matrix
);
...
...
@@ -288,8 +293,6 @@ THREE.ObjectLoader.prototype = {
}
if
(
data
.
id
!==
undefined
)
object
.
id
=
data
.
id
;
if
(
data
.
name
!==
undefined
)
object
.
name
=
data
.
name
;
if
(
data
.
visible
!==
undefined
)
object
.
visible
=
data
.
visible
;
if
(
data
.
userData
!==
undefined
)
object
.
userData
=
data
.
userData
;
...
...
src/materials/Material.js
浏览文件 @
72f94e88
...
...
@@ -5,7 +5,8 @@
THREE
.
Material
=
function
()
{
this
.
id
=
THREE
.
Math
.
generateUUID
();
this
.
id
=
THREE
.
MaterialIdCount
++
;
this
.
uuid
=
THREE
.
Math
.
generateUUID
();
this
.
name
=
''
;
...
...
@@ -131,3 +132,5 @@ THREE.Material.prototype = {
}
};
THREE
.
MaterialIdCount
=
0
;
src/textures/Texture.js
浏览文件 @
72f94e88
...
...
@@ -6,7 +6,8 @@
THREE
.
Texture
=
function
(
image
,
mapping
,
wrapS
,
wrapT
,
magFilter
,
minFilter
,
format
,
type
,
anisotropy
)
{
this
.
id
=
THREE
.
Math
.
generateUUID
();
this
.
id
=
THREE
.
TextureIdCount
++
;
this
.
uuid
=
THREE
.
Math
.
generateUUID
();
this
.
name
=
''
;
...
...
@@ -87,3 +88,5 @@ THREE.Texture.prototype = {
}
};
THREE
.
TextureIdCount
=
0
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录