@threlte/gltf 1.0.0-next.10 → 1.0.0-next.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/utils/parser.js +14 -10
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/utils/parser.js
CHANGED
|
@@ -149,24 +149,24 @@ function parse(fileName, gltf, options = {}) {
|
|
|
149
149
|
|
|
150
150
|
// Write out geometry first
|
|
151
151
|
if (obj.geometry) {
|
|
152
|
-
result += `geometry={
|
|
152
|
+
result += `geometry={gltf.${node}.geometry} `
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
// Write out materials
|
|
156
156
|
if (obj.material) {
|
|
157
157
|
if (obj.material.name)
|
|
158
|
-
result += `material={
|
|
159
|
-
else result += `material={
|
|
158
|
+
result += `material={gltf.materials${sanitizeName(obj.material.name)}} `
|
|
159
|
+
else result += `material={gltf.${node}.material} `
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
if (obj.skeleton) result += `skeleton={
|
|
162
|
+
if (obj.skeleton) result += `skeleton={gltf.${node}.skeleton} `
|
|
163
163
|
if (obj.visible === false) result += `visible={false} `
|
|
164
164
|
if (obj.castShadow === true) result += `castShadow `
|
|
165
165
|
if (obj.receiveShadow === true) result += `receiveShadow `
|
|
166
166
|
if (obj.morphTargetDictionary)
|
|
167
|
-
result += `morphTargetDictionary={
|
|
167
|
+
result += `morphTargetDictionary={gltf.${node}.morphTargetDictionary} `
|
|
168
168
|
if (obj.morphTargetInfluences)
|
|
169
|
-
result += `morphTargetInfluences={
|
|
169
|
+
result += `morphTargetInfluences={gltf.${node}.morphTargetInfluences} `
|
|
170
170
|
if (obj.intensity && rNbr(obj.intensity)) result += `intensity={${rNbr(obj.intensity)}} `
|
|
171
171
|
//if (obj.power && obj.power !== 4 * Math.PI) result += `power={${rNbr(obj.power)}} `
|
|
172
172
|
if (obj.angle && obj.angle !== Math.PI / 3) result += `angle={${rDeg(obj.angle)}} `
|
|
@@ -378,7 +378,7 @@ function parse(fileName, gltf, options = {}) {
|
|
|
378
378
|
|
|
379
379
|
// Bail out on lights and bones
|
|
380
380
|
if (type === 'bone') {
|
|
381
|
-
return `<T is={
|
|
381
|
+
return `<T is={gltf.${node}} />\n`
|
|
382
382
|
}
|
|
383
383
|
|
|
384
384
|
// Collect children
|
|
@@ -556,9 +556,13 @@ ${
|
|
|
556
556
|
</script>
|
|
557
557
|
|
|
558
558
|
<T is={ref} dispose={false} ${!options.isolated ? '{...$$restProps} bind:this={$component}' : ''}>
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
{
|
|
559
|
+
{#await gltf}
|
|
560
|
+
<slot name="fallback" />
|
|
561
|
+
{:then gltf}
|
|
562
|
+
${scene}
|
|
563
|
+
{:catch error}
|
|
564
|
+
<slot name="error" {error} />
|
|
565
|
+
{/await}
|
|
562
566
|
|
|
563
567
|
<slot {ref} />
|
|
564
568
|
</T>
|