show texture size in asset preview
This commit is contained in:
@@ -13,6 +13,9 @@
|
|||||||
</v-btn>
|
</v-btn>
|
||||||
</v-slide-group-item>
|
</v-slide-group-item>
|
||||||
</v-slide-group>
|
</v-slide-group>
|
||||||
|
<div v-if="textureSize">
|
||||||
|
{{ textureSize.w }} x {{ textureSize.h }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<img v-if="obj && !forRendering && obj.type == 'object2d'" :src="`/asset/default/${obj.asset?.name}`" />
|
<img v-if="obj && !forRendering && obj.type == 'object2d'" :src="`/asset/default/${obj.asset?.name}`" />
|
||||||
<video v-if="obj && !forRendering && obj.type == 'video'" controls :autoplay="autoplay ? 'autoplay' : ''"
|
<video v-if="obj && !forRendering && obj.type == 'video'" controls :autoplay="autoplay ? 'autoplay' : ''"
|
||||||
@@ -38,7 +41,8 @@ export default{
|
|||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
animations: [],
|
animations: [],
|
||||||
obj: null
|
obj: null,
|
||||||
|
textureSize: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async mounted(){
|
async mounted(){
|
||||||
@@ -101,6 +105,12 @@ export default{
|
|||||||
this.placeCamera(gltf.scene)
|
this.placeCamera(gltf.scene)
|
||||||
engine.activeObjects.add(gltf.scene);
|
engine.activeObjects.add(gltf.scene);
|
||||||
}
|
}
|
||||||
|
if (engine.scene.background?.isTexture){
|
||||||
|
this.textureSize = {
|
||||||
|
w: engine.scene.background.image.width,
|
||||||
|
h: engine.scene.background.image.height
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user