├── .gitignore ├── LICENSE ├── README.md ├── addons └── blender_importer │ ├── LICENSE │ ├── README.md │ ├── import_plugin.gd │ ├── plugin.cfg │ └── plugin.gd ├── default_env.tres ├── icon.png ├── icon.png.import └── project.godot /.gitignore: -------------------------------------------------------------------------------- 1 | # Godot 4+ specific ignores 2 | .godot/ 3 | 4 | # Godot-specific ignores 5 | .import/ 6 | export.cfg 7 | export_presets.cfg 8 | 9 | # Imported translations (automatically generated from CSV files) 10 | *.translation 11 | 12 | # Mono-specific ignores 13 | .mono/ 14 | data_*/ 15 | mono_crash.*.json 16 | 17 | # Blender ignores 18 | *.blend 19 | *.blend1 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021 Ryan Roden-Corrent (rcorre) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Deprecated 2 | 3 | See https://github.com/V-Sekai/godot-blender instead. These somehow both released at the same time. 4 | Also note that this may be a feature built-in to Godot4: https://github.com/godotengine/godot/pull/54886#pullrequestreview-805381255. 5 | 6 | # Godot Blender Importer 7 | 8 | This is a plugin for Godot 3.4 to directly import [blender](https://www.blender.org/) source files without needing to (manually) export to an intermediate format. 9 | Just save a `.blend` file, and open it as a scene in Godot! 10 | The `blender` executable must be on your `PATH`. 11 | 12 | ## Pros: 13 | 14 | - Allows for faster iteration, which is especially useful during game jams 15 | - No more forgetting to export from Blender 16 | - No need to commit intermediate files to version control 17 | 18 | ## Cons: 19 | 20 | - Everyone working on the project must have Blender installed 21 | - CI build nodes must have Blender installed if you're using a CI build 22 | 23 | ## Project Status 24 | 25 | This project is currently in an experimental state. 26 | However, I have [used it successfully](https://git.sr.ht/~rcorre/jamcraft) in one recent game jam. 27 | Please [open an issue](https://github.com/rcorre/godot_blender_importer/issues/new) if you encounter any problems! 28 | -------------------------------------------------------------------------------- /addons/blender_importer/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021 Ryan Roden-Corrent (rcorre) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /addons/blender_importer/README.md: -------------------------------------------------------------------------------- 1 | # Godot Blender Importer 2 | 3 | This is a plugin for Godot 3.4 to directly import [blender](https://www.blender.org/) source files without needing to (manually) export to an intermediate format. 4 | Just save a `.blend` file, and open it as a scene in Godot! 5 | The `blender` executable must be on your `PATH`. 6 | 7 | ## Pros: 8 | 9 | - Allows for faster iteration, which is especially useful during game jams 10 | - No more forgetting to export from Blender 11 | - No need to commit intermediate files to version control 12 | 13 | ## Cons: 14 | 15 | - Everyone working on the project must have Blender installed 16 | - CI build nodes must have Blender installed if you're using a CI build 17 | 18 | ## Project Status 19 | 20 | This project is currently in an experimental state. 21 | However, I have [used it successfully](https://git.sr.ht/~rcorre/jamcraft) in one recent game jam. 22 | Please [open an issue](https://github.com/rcorre/godot_blender_importer/issues/new) if you encounter any problems! 23 | -------------------------------------------------------------------------------- /addons/blender_importer/import_plugin.gd: -------------------------------------------------------------------------------- 1 | extends EditorSceneImporter 2 | 3 | func _get_extensions() -> Array: 4 | return ["blend"] 5 | 6 | func _get_import_flags() -> int: 7 | return IMPORT_SCENE 8 | 9 | func _import_animation(path: String, flags: int, bake_fs: int) -> Animation: 10 | return null 11 | 12 | func _import_scene(path: String, flags: int, bake_fs: int) -> Node: 13 | var blend_path := ProjectSettings.globalize_path(path) 14 | var tmp := blend_path + ".glb" 15 | var cmdline := [ 16 | blend_path, 17 | "-b", 18 | "--python-expr", 19 | "import bpy; bpy.ops.export_scene.gltf(filepath='%s')" % tmp, 20 | ] 21 | print("Running ", cmdline) 22 | var err := OS.execute("blender", cmdline) 23 | if err != 0: 24 | push_error("Command `%s` failed with code: %d" % [cmdline, err]) 25 | return null 26 | 27 | print("Importing ", tmp) 28 | var node := import_scene_from_other_importer(tmp, flags, bake_fs, 0) 29 | err = Directory.new().remove(tmp) 30 | if err != 0: 31 | push_error("Failed to remove temp file '%s', error: %d" % [tmp, err]) 32 | return node 33 | -------------------------------------------------------------------------------- /addons/blender_importer/plugin.cfg: -------------------------------------------------------------------------------- 1 | [plugin] 2 | 3 | name="BlenderImporter" 4 | description="Directly import .blend files." 5 | author="Ryan Roden-Corrent" 6 | version="0.1" 7 | script="plugin.gd" 8 | -------------------------------------------------------------------------------- /addons/blender_importer/plugin.gd: -------------------------------------------------------------------------------- 1 | tool 2 | extends EditorPlugin 3 | 4 | var import_plugin 5 | 6 | func _enter_tree(): 7 | import_plugin = preload("import_plugin.gd").new() 8 | add_scene_import_plugin(import_plugin) 9 | 10 | 11 | func _exit_tree(): 12 | remove_scene_import_plugin(import_plugin) 13 | import_plugin = null 14 | -------------------------------------------------------------------------------- /default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | [resource] 6 | background_mode = 2 7 | background_sky = SubResource( 1 ) 8 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcorre/godot_blender_importer/207a9acecfd032aeb9df76a8e731e99d8dbbd0cb/icon.png -------------------------------------------------------------------------------- /icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | [application] 12 | 13 | config/name="BlenderImporter" 14 | config/icon="res://icon.png" 15 | 16 | [editor_plugins] 17 | 18 | enabled=PoolStringArray( "res://addons/blender_importer/plugin.cfg" ) 19 | 20 | [physics] 21 | 22 | common/enable_pause_aware_picking=true 23 | 24 | [rendering] 25 | 26 | environment/default_environment="res://default_env.tres" 27 | --------------------------------------------------------------------------------