omigroup / omi-blender-gltf

MIT License
5 stars 2 forks source link

Absolute paths being saved in packaged glb #8

Open antpb opened 2 years ago

antpb commented 2 years ago

When saving a file from the blender exporter to glb, the audio files are saved as expected in the file. I am noticing that the file paths though remain the same absolute paths as in blender. Heres the example output from using an exported glb with audio in a basic threejs implementation of omi audio using three-omi package:

fetch for "https://xp3d.io/Users/myusername/Downloads/synth.mp3" responded with 404: Not Found

Notice the Users/myusername/Downloads path.

Still digging but something seems off on the export. I think we should strip the paths to their last level where the file name is defined but I've not yet been able to make the parser happy that way.

antpb commented 2 years ago

Here are some comparisions on an omi object created in blender vs with the hubs transform tool

// made with blender extension
{
    "OMI_audio_emitter": {
        "audioSources": [
            {
                "name": "",
                "uri": "//../Desktop/click.mp3",
                "mimeType": "audio/mpeg"
            }
        ],
        "audioEmitters": [
            {
                "type": "positional",
                "gain": 0,
                "loop": false,
                "playing": false,
                "source": 0,
                "coneInnerAngle": 6.2831854820251465,
                "coneOuterAngle": 1.3962633609771729,
                "coneOuterGain": 0,
                "distanceModel": "inverse",
                "maxDistance": 0.5,
                "refDistance": 2,
                "rolloffFactor": 1,
                "name": "click"
            }
        ]
    }
},
// made with gltf transform
{
    "OMI_audio_emitter": {
        "audioSources": [
            {
                "bufferView": 8,
                "mimeType": "audio/mpeg"
            }
        ],
        "audioEmitters": [
            {
                "type": "global",
                "gain": 0.28999999165534973,
                "loop": true,
                "autoPlay": true,
                "source": 0
            }
        ]
    }
}