Editor icon indicating copy to clipboard operation
Editor copied to clipboard

Run in Editor is not the same as Run in Integrated Browser

Open eherozhao opened this issue 3 years ago • 13 comments

I found the animation in the script added into the asset didn't work well when running in Editor but it worked well in Integrated Browser and even Run In My Browser (HTTP). I didn't find differences between these run after diving deep into the codebase. Is there anything I missed?

eherozhao avatar May 05 '22 05:05 eherozhao

Meanwhile, after building the project, the imported assets was not fully copied/pasted into scenes/_assets path. All animation file were not pasted. Is this intended? How should I make it work programmatically? Thank you!

eherozhao avatar May 05 '22 05:05 eherozhao

Hi @eherozhao ! This not intended ! What is the format of the animation file? JSON?

julien-moreau avatar May 05 '22 16:05 julien-moreau

@julien-moreau Nope. glb. The asset we used is this one. I was hosting the scene by uploading the scenes, dist and index.html file to remote server and the result is the same as Run in Editor which the animation was failing to work.

eherozhao avatar May 05 '22 16:05 eherozhao

@eherozhao if I understand correctly, you'd like to have all files available in the assets folder available in the _assets folder. Do you confirm?

julien-moreau avatar May 05 '22 17:05 julien-moreau

@julien-moreau Yes! I am not sure why Run in Integrated Browser works well but Run in Editor fails with the broken link to assets path.

eherozhao avatar May 05 '22 17:05 eherozhao

It works in editor because the browsed assets folder is the assets folder at the root instead of the scenes/_assets. I'm working on a solution right now

julien-moreau avatar May 05 '22 17:05 julien-moreau

If I upload the whole project with the assets folder into remote server, the animation works well. However, based on my understanding, the smallest scope of making a scene work in a server is only scenes, dist and index.html so if I can only upload these folders and file and make it work, that will be the most efficient way.

eherozhao avatar May 05 '22 18:05 eherozhao

I agree, the goal is to keep the assets folder only in the development project

julien-moreau avatar May 05 '22 18:05 julien-moreau

Yep! Do you have any idea about how to optimize the process? Probably need to do some changes to the asset management?

eherozhao avatar May 05 '22 18:05 eherozhao

Exact, but the philosophy here was to not copy the entire assets folder, only assets that are used in the project and only re-usable assets like textures, sounds, etc.

We should find a way to say "I want this asset to be available as-is in my project"

julien-moreau avatar May 05 '22 18:05 julien-moreau

You are right! That's what I am thinking about. How should we let Editor know which assets are available? Using a cache once saving?

eherozhao avatar May 05 '22 18:05 eherozhao

It works in editor because the browsed assets folder is the assets folder at the root instead of the scenes/_assets. I'm working on a solution right now

To clarify, what issue was this solution aimed at? The Run in Editor is not the same as Run in Integrated Browser one? Will this solution include any fix about only assets that are used in the project and only re-usable assets like textures, sounds, etc. you mentioned?

eherozhao avatar May 05 '22 20:05 eherozhao

@eherozhao all gltf/glb files are now copied in the assets output folder. I still have to add a way to tag assets "I want it to be copied"

julien-moreau avatar Aug 15 '22 20:08 julien-moreau