-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add functionality to export 3D models from an exported project #341
Comments
If it can be implemented as an add-on, there's no reason to open a proposal here 🙂 There are a few OBJ loaders written in GDScript out there (1, 2). An exporter could likely also be written. |
I have a pr for exporting scenes to gltf2. I have been able to convert imported gltf2 scenes to export gltf2 scenes. However, I haven't done complete matching of all the animation properties. My goal is to prepare this for Godot 4.0, but it has not been merged in and it's waiting for a new public api to be created. |
Is it possible to do this from the compiled project? Any node that allows you to do this? |
That's the new public api! |
Possibly might help, look in the ObjExport folder for a small export script I wrote a few weeks ago. It might do what you are after (or put you on the right track, so you can modify it for your needs), just create an ObjExport object and call
https://github.com/lawnjelly/GodotTweaks You might need to alter it a little if you want UVs too, I'll probably try and make it more robust when I have time. I've also made a DAE exporter as part of LPortal but that's probably overkill for what you need and might be more tricky to use. I've also got a simple addon which does mesh merging which may or may not be of use: |
Ok, I will experiment with this tool .... Is it possible to export from a compiled project? |
Yes, however you may possibly run into problems on non-desktop builds: these afaik don't retain some of the geometry data to save memory, and don't allow reading from the GPU, so reading back the geometry (to export) may not be possible. I haven't tested this. You can quite easily modify the Godot build to retain this data, but it isn't available in vanilla Godot on mobile (and hence there are quite a few issues reporting crashes trying to use this data). If this is indeed a problem it may also affect fire's gltf2 exporter. |
Ok, thanks I'm going to try it and then I'll tell you. |
Link video test youtube |
It seems that what is failing is the location, that would have to be in the same place where the project was exported, but it does not appear ... First we would have to solve that problem and then create a folder in the same directory that says exported objects. .. |
Although the location can be a problem on some platforms (particularly with permissions) I don't think it should be a problem on linux. That obj export code is not battle tested. In particular it aborts if the vertex count is 0, which is what I was fearing might occur on mobile. This same problem may also be occurring in non-tools builds on desktop... I will try and put in a printerr in ObjExport.gd to catch this case (you can also add it to your source as follows, just add a printerr or print statement before the return, and it should appear in the console):
However in amazing synchronicity, to fix another similar bug, clayjohn has just added a PR to retain the geometry data in all builds. So if you grab the latest nightly build from Calinou (or perhaps the one built within the next day) this may magically work again!! 😄 https://hugo.pro/projects/godot-builds/ Another alternative may be to ship the tools build of Godot with your .pck file (I'm not sure on the size difference). |
Fixed by gltf exporting https://godotengine.org/article/introducing-the-godot-gltf-2-0-scene-exporter, godotengine/godot#52541 exporting buffers. See also #3273. |
Describe the project you are working on:
An application where 3D models are chosen and then can be exported
Describe the problem or limitation you are having in your project:
I can't find a way to export 3D models of a compiled project
Describe how this feature / enhancement will help you overcome this problem or limitation:
It would help me to create an application completely with godot engine
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
Describe implementation detail for your proposal (in code), if possible:
you choose a 3D model and then it is exported from the compiled project to be able to print it in 3D
If this enhancement will not be used often, can it be worked around with a few lines of script?:
they told me that if I connect it with a json it may be, but I have no idea how to implement it
Is there a reason why this should be core and not an add-on in the asset library?:
It could be a complement, the important thing is the functionality of being able to export 3D models once the project is compiled.
The text was updated successfully, but these errors were encountered: