godot-rust / gdext

Rust bindings for Godot 4
https://mastodon.gamedev.place/@GodotRust
Mozilla Public License 2.0
3.06k stars 190 forks source link

Properties not showing up in the Godot editor #144

Closed atrefonas closed 1 year ago

atrefonas commented 1 year ago

When I add this code with the #[property] macro, I'm not seeing the property show up in the Godot editor in the sidebar:

#[derive(GodotClass)]
#[class(base=CharacterBody3D)]
pub struct Player3D {
    #[property]
    speed: f32,

I tried this on 2 different classes and don't see it working on either. Is it currently supported?

Bromeon commented 1 year ago

So you tried a random syntax that's nowhere documented and file an issue because it doesn't work? 😉 This is not the gdnative project, the API is completely different. We have a very early-stage #[export] macro, but it will be reworked to its core, so I wouldn't build too much on it.

This is the second time within a few hours that you ask something, which can be found very quickly through publicly available documentation. I also put a lot of effort into a keeping a current overview in https://github.com/godot-rust/gdextension/issues/24, and would appreciate if people take the time to have at least a look at it.

I would recommend you join our Discord, we have a dedicated #help-gdextension channel, where lots of people can guide you towards a solution. Not only would this keep the issue tracker focused on confirmed issues, but you will also get much quicker answers, since a lot of people are active across different time zones. Sounds good? 🙂

atrefonas commented 1 year ago

Hello, thanks for getting back quickly for this and the other issue.

I do not see where it is in the documentation, after having looked for it. I haven't studied the entire source code so I presume it is in there somewhere? I don't see it mentioned in this Github repository, and the GD Rust book doesn't go over this for gdextension. Is there another documentation source I'm not aware of?

Also I would love to join the Discord channel, but I am not sure how to access it. I have already joined the #gdnative-dev channel in the Godot Engine discord. I guess there must be a particular Discord server for Godot Rust? It would also be good to make that more visible and easier to get to (unless I have a blindspot and simply don't see the link).

I have been thoroughly enjoying using Godot and gdextension recently so I am sure I will have many more questions :smile:.

By the way I have been looking through the source and was able to fix some of my own problems. I also made some good progress after setting up the lldb debugger (sidenote - would be nice if this was documented in the Godot Rust book).

atrefonas commented 1 year ago

Ah ok - I see the Discord link now in the Readme. Somehow I missed that even after specifically looking for it! Maybe it could have a Discord icon as well or its own section.

Bromeon commented 1 year ago

Is there another documentation source I'm not aware of?

Yes, cargo doc, but you need to run it locally at the moment. To discover concrete APIs, it's the best we have at the moment.

I want to host it online just like the gdnative one, but it's quite a bit of infrastructure effort, for which I haven't had the time yet. And we don't have crates.io releases yet, either.

atrefonas commented 1 year ago

Is there another documentation source I'm not aware of?

Yes, cargo doc, but you need to run it locally at the moment. To discover concrete APIs, it's the best we have at the moment.

Awesome, didn't realize that was a thing!