-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow viewing of models from shared link #4
Comments
When single file is shared, the behaviour of nextcloud/viewer which this app taps into (both MIME handler and currently also MVC part) takes precedence. You can see that stuff behaves differently, try sharing single static image (png/jpg/whateva) for example, observe. For this app to show 3D model when single file is shared either Meanwhile, if you share directory containing 3D model, it should work as expected (try iit, if not already). Moreover, I would always suggest sharing directory that contains 3D file, as one might forget, that many of 3D formats actually consume multiple files (i.e., if you would share Your question is another reason to move to iframe approach, but that opens up issue discussed above - what if actually one needs multiple files to view the model as intended. |
It's an STL that is otherwise working with this app as expected. When I share an image file, the share link will show that image as a preview, of course. That preview is retrieved from the files_sharing app, then... I dug into that and the JS side is what embeds the preview... And it only really checks image/video/text types https://github.com/nextcloud/server/blob/master/apps/files_sharing/js/public.js#L159 to embed the preview. If it's neither of that, that JS code cancels out and just puts the icon for the filetype by mime there. I don't know how NextCloud office does it, it does a fullscreen open of the file in question. I would probably have to dig a bunch more to find that. But that's the iFrame approach you mention if I got that right? But yes, if I share a folder it works as expected. If I don't have any additional files (textures, materials) though this is unnecessary and would necessiate making a folder to put the file into if you only want someone to look at that one file. |
but differently, as different view template is rendered by parent
Sure, currently it is the way though. Long story short - in order to achieve that if single 3D file is shared full preview is loaded one needs to override nextcloud/viewer template, by serving ones own. In order to render that template, one needs controller. In order to address controller one needs routing. I looked at all of this while creating this first version of the app and
...went the fastest way I'd say I will make the necessary changes (rewrite this app using iframe with route + controller + template), but probably will have time for that in a few weeks. |
+1 for this. I'm a fan of the iframe approach because it would also enable entirely custom loader/scenes based on the file being viewed.. i wish i could help make the changes. |
+1 I'm looking forward to this feature. |
so guys, i got some time for this on a coffee break. sharing one file most likely will not work as 3D model usually is comprised of multiple files. to give you idea.
no such mw exists in NC. thus as of now - if your files are not self contained (such as iframe is still on the table though, as that still has benefits, just haven't got time for that yet. |
When a shared link is generated (/s/abcde), would it be possible to run the viewer there to be able to view the file as a user foreign to the Nextcloud instance?
Other plugins like Nextcloud Office are able to do so, too, but I have no idea how that functionality is faciliated.
The text was updated successfully, but these errors were encountered: