godotengine / godot-blender-exporter

Addon for Blender to directly export to a Godot Scene
GNU General Public License v2.0
1.15k stars 123 forks source link

Exporting Godot Scene Instances and Meshes with Scripts #323

Open jackhumbert opened 4 years ago

jackhumbert commented 4 years ago

I made some quick changes that allow you to export Godot scene instances with empties named like Tree.tscn for doing some level design inside of Blender, and automatic association of scripts if the script custom property is set to something like Tree.gd on meshes (it's probably applicable to other types as well). You can see the changes on my branch here: https://github.com/godotengine/godot-blender-exporter/compare/master...jackhumbert:f/scenes_and_scripts

Is this something that would be useful? I'd love any feeback on it before opening a PR.

rcorre commented 4 years ago

@jackhumbert nice work, I would use this. Some thoughts:

  1. Should the custom property be named godot.script, to avoid colliding with other blender plugins? I'm also imagining we could use custom properties for more in the future, and could "namespace" them all with a godot prefix (godot.metadata would be cool in the future).
  2. I don't love the idea of searching the project directory. I feel like the result of the export should depend entirely on the state of the blender file, and a re-export shouldn't change because your godot project changed. That extra coupling seems like it could create difficult bugs. I was envisioning that "godot.script=Foo.gd" uses Foo.tscn in the export dir, or "godot.script=res://Foo/Bar.gd" uses a script at an absolute path. That being said, materials already work like this, so maybe we just go with the flow :shrug:
  3. If we do search the project directory, we should rename "Material Search Path" to "Resource Search Path" (or have separate settings, but that seems like overkill).