Skip to content
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 Blend Import #54886

Merged
merged 1 commit into from Mar 29, 2022
Merged

Add Blend Import #54886

merged 1 commit into from Mar 29, 2022

Conversation

fire
Copy link
Member

@fire fire commented Nov 11, 2021

Fixes godotengine/godot-proposals#3529

Discussed with the Godot Discord community and with Reduz.

@lyuma
Copy link
Contributor

lyuma commented Nov 11, 2021

Just chatted with @fire and I think it would make more sense to move the blender path into EditorSettings, since I do not want to input my blender executable path in every single project on windows, and also would not want to check it into version control by mistake.

I am also apprehensive about the settings for the blender python scripts being per-project. There was an idea of some use-case where a user customizes the blender export to hack in additional features, but my opinion is that level of customization would be best left to custom GDScript addons.

Hardcoding the python strings would be easiest. I'd also be ok with having the scripts as an editor setting.

@fire fire force-pushed the blend-io branch 5 times, most recently from 7f73fe1 to 5156331 Compare November 12, 2021 01:59
@fire
Copy link
Member Author

fire commented Nov 12, 2021

QA tested reports

  • skeletons sometimes loses mesh
  • exporting godot uses the default cube, light and camera.

Checked means there is a bugfix in for the issues.

@fire fire force-pushed the blend-io branch 5 times, most recently from a4751c4 to 7fb7e07 Compare November 12, 2021 08:07
@akien-mga
Copy link
Member

akien-mga commented Mar 29, 2022

I pushed updates (for now as a separate commit) to https://github.com/akien-mga/godot/tree/blend-io to move the class in modules/gltf/editor/ as discussed, and I did some cleanup, adding comments and improving overall code quality and settings validation. I couldn't force push to the V-Sekai fork to update this PR as it seems maintainer pushes have been disabled.

It's still not perfect though, whether the import can be done is validated on editor init, so enabling Blend import requires first setting the Blender path, and then enabling the option. Otherwise before my changes you would enter import hell since it would fail repeatedly until you kill Godot, and now after my changes it will just not register the importer. But that's part of what @reduz is going to improve in a follow-up.

Otherwise, I tested the version check and it doesn't seem to work. Picking a Blender 2.93 binary, I did not see Blender is 3.0 or higher is required., and instead it proceeded to run the script and fail (also repeatedly since Godot always retries after failing, but that's a separate issue).

I renamed the blender section in the settings to blend as that's what the format is called.

@fire
Copy link
Member Author

fire commented Mar 29, 2022

I saw your message. I'll update the V-Sekai fork promptly.

@fire
Copy link
Member Author

fire commented Mar 29, 2022

Can leave the version check and the validation on editor initialization to future commits.

Thanks!

@akien-mga
Copy link
Member

Seems like I broke the editor with a last minute change, will fix.

@akien-mga
Copy link
Member

@fire I updated my branch if you can push to this PR again: https://github.com/akien-mga/godot/tree/blend-io

Lets you drag or place .blend files in the project folder and it will import the files.

Checks for Blender 3.0's gltf2 `export_keep_originals` option.

Add basepath support to GLTFDocument append_from_file.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
@akien-mga akien-mga merged commit ed67d8f into godotengine:master Mar 29, 2022
@akien-mga
Copy link
Member

Thanks!

@fire fire deleted the blend-io branch March 29, 2022 23:45
@rcorre
Copy link
Contributor

rcorre commented Mar 30, 2022

When I start the editor, I only see "Blender Path" in EditorSettings, not "Import Enabled", and just setting "Blender Path" does not seem to enable blend imports.

Edit: NVM, it is a project setting, and you have to check "advanced settings" to see it

reduz added a commit to reduz/godot that referenced this pull request Mar 31, 2022
This PR is a continuation to godotengine#54886

* Changed Blender path editor setting from binary to installation.
* Add a class to query whether the format is supported.
* This class allows to create proper editors to configure support.

**NOTE**: This PR only provides autodetection on Linux. Code needs to be added for Windows and MacOS to autodetect the Blender installation.
reduz added a commit to reduz/godot that referenced this pull request Mar 31, 2022
This PR is a continuation to godotengine#54886

* Changed Blender path editor setting from binary to installation.
* Add a class to query whether the format is supported.
* This class allows to create proper editors to configure support.

**NOTE**: This PR only provides autodetection on Linux. Code needs to be added for Windows and MacOS to autodetect the Blender installation.
reduz added a commit to reduz/godot that referenced this pull request Apr 1, 2022
This PR is a continuation to godotengine#54886

* Changed Blender path editor setting from binary to installation.
* Add a class to query whether the format is supported.
* This class allows to create proper editors to configure support.

**NOTE**: This PR only provides autodetection on Linux. Code needs to be added for Windows and MacOS to autodetect the Blender installation.

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
Co-authored-by: Pedro J. Estébanez <pedrojrulez@gmail.com>
gaudecker pushed a commit to gaudecker/godot that referenced this pull request Apr 3, 2022
This PR is a continuation to godotengine#54886

* Changed Blender path editor setting from binary to installation.
* Add a class to query whether the format is supported.
* This class allows to create proper editors to configure support.

**NOTE**: This PR only provides autodetection on Linux. Code needs to be added for Windows and MacOS to autodetect the Blender installation.

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
Co-authored-by: Pedro J. Estébanez <pedrojrulez@gmail.com>
@Zireael07
Copy link
Contributor

Where do I find the docs on this? Does this support geometry nodes?

@rcorre
Copy link
Contributor

rcorre commented Apr 15, 2022

@Zireael07 it just exports to gltf behind-the-scenes, so feature-wise it is the same as https://docs.godotengine.org/en/3.4/tutorials/assets_pipeline/importing_scenes.html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for importing and exporting .blend files
9 participants