EDIT: I made one for Python! I call it DefTree and there is forum post about it
I like python and I like Defold, but I don’t like long boring repetitive task that could (read: should) be scripted. Unfortunately because I can’t really parse the file format that Defold uses I find it extremely hard to make small scripts that would help a lot. This also makes it harder to create workflow and pipeline tools.
If I had a genie and could wish wildly, I would wish for a DefoldUtil library! It would maybe work something like these examples below. I have been thinking on it for a while and have done some tests, but unfortunately it is a bit too hard, it would have been easier if the format was json or xml or something that I didn’t have to write a parser for myself. But then if it was json or xml I could have written tools and script for it without this.
# Example how a defold util script could look like
# This would of course include all types of files so you can edit them in scripts
import DefoldUtil as du
my_file = "C:/Repositories/DefoldProject/Assets/lobby.gui"
gui_file = du.parse(my_file)
# Example: Adding forgotten layers
for node in gui_file.nodes:
if node.layer not in gui_file.layers:
gui_file.layers.add(node.layer)
# Example: Adding new layer
for node in gui_file.nodes:
layer_name, _ = node.texture.split("/")
node.layer = layer_name
gui_file.layers.add(layer_name)
# Example: "Random stuff"
if "gui.material" in gui_file.material:
for node in gui_file.nodes:
node.inherit_alpha = False
du.dump(gui_file, my_file)
Is this a feeling only I have? What is the general thoughts about something like this? Is there a easier way to do something like this? Would love to hear peoples thoughts and opinions on this!