Trying to make gamedev easier.
teebarjunk / godot-4.0-tool_button Goto Github PK
View Code? Open in Web Editor NEWEase development with an inspector button that's plumb simple.
License: MIT License
Ease development with an inspector button that's plumb simple.
License: MIT License
Trying to make gamedev easier.
Readme says
Editor buttons with
one line of code:zero lines of code.@tool
From 99be2b4
But then:
Add
@tool
to top of your script.
There are some GDScript errors preventing this from working in Godot 4 beta 16. I will submit a PR for this.
In the documentation you seem to imply the show_default_buttons is enabled by default, or maybe the documentation is not up to date about this setting?
Furthermore, when trying to enable it from Project Setting > Global > Show Default Buttons, I get error:
core/config/project_settings.cpp:334 - Property not found: global/show_default_buttons
This is in Godot 4.1
Godot v4.0.beta10.official [d0398f62f]
Error:
res://addons/tool_button/TB_InspectorPlugin.gd:43 - Invalid call. Nonexistent function '_get_tool_buttons' in base 'StaticBody3D ()'.
res://addons/tool_button/TB_InspectorPlugin.gd:85 - Invalid call. Nonexistent function 'new' in base 'GDScript'.
Script:
@tool
extends StaticBody3D
func _get_tool_buttons():
return ["set_materials"]
func set_materials() -> void:
print("Set materials")
I'm testing the tool out using the example and the advanced example is not taking the args and is using the default args in the method definition. In short it's using 1 + 1 + 1 = 3 rather than the other numbers.
Have you tried this in Godot 4.1?
I faced some issues to get it to work, I was getting a bunch of errors like:
TB_InspectorPlugin.gd:43 - Invalid call. Nonexistent function '_get_tool_buttons'
Obviously, the method was there, as there is a has_method check before the call. After trying a few things what worked for me was to disable the plugin, remove the script from my object, then enable the plugin, and finally add the script back (or maybe the last two steps were the other war around).
Maybe it's a Godot issue but it would be nice if you could check what causes this.
EDIT. After working a bit more with it, the error shows up again and couldn't find a way to work-around it this time. Even restarting Godot does not help.
EDIT2. Ok, it seems my mistake was changing the type of my Node in the inspector to the Class of my script. Once I moved it back to type Node it started to work again!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.