show texture size in asset preview
This commit is contained in:
@@ -13,6 +13,9 @@
|
||||
</v-btn>
|
||||
</v-slide-group-item>
|
||||
</v-slide-group>
|
||||
<div v-if="textureSize">
|
||||
{{ textureSize.w }} x {{ textureSize.h }}
|
||||
</div>
|
||||
</div>
|
||||
<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' : ''"
|
||||
@@ -38,7 +41,8 @@ export default{
|
||||
data(){
|
||||
return {
|
||||
animations: [],
|
||||
obj: null
|
||||
obj: null,
|
||||
textureSize: null
|
||||
}
|
||||
},
|
||||
async mounted(){
|
||||
@@ -101,6 +105,12 @@ export default{
|
||||
this.placeCamera(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