Zylann / godot_voxel

Voxel module for Godot Engine
MIT License
2.59k stars 244 forks source link

What are these errors? #281

Open Favkis opened 3 years ago

Favkis commented 3 years ago

image

That's if I don't have steram, generator is VoxelGeneratorScript

And if I add any stream it says

image

I do have mesher and it works with VoxelGeneratorNoise

I don't get what these errors mean

Zylann commented 3 years ago

They are not errors, just warnings.

So I'm assuming you have a generator based on a script. If the script is not tool, then you won't be able to preview the generator inside the editor, and it won't be able to do some of the usual checks.

If the script is tool, you will also get a warning because if for any reason Godot reloads the script while it is being used by a thread, Godot can potentially crash, and there is currently no way to avoid this. So sadly there will always be a warning, although we could consider removing it if the generator is turned off in editor (although you'd still have to know that it does get turned off automatically in the first place, it's a very easy mistake to leave it on and edit the script at the same time).

However your second screenshot does not mention the generator, it mentions a stream. The warning means what it says: The stream you have setup provides voxel data which does not correspond to what your mesher expects. For example, a Blocky mesher cannot do anything with a stream that only contains SDF data. Or a Transvoxel mesher cannot use a stream that only provides minecraft-like data (using the TYPE channel).

Does the warning go away if you close and reopen the scene?

Despite this, if you say it works but you still see these warnings, then please explain precisely which steps you are following to make it happen.

EDIT: if the stream is VoxelStreamSQLite then perhaps it should override get_used_channels_mask (in C++) and return them all, because that stream can store anything. Downside is, if the database happens to not contain anything in other channels, it cannot tell.

Zylann commented 3 years ago

I pushed da8dc36590cf95e0297dedcb99fc900c0da27aa3 to solve the warning related to the stream.

Zylann commented 3 years ago

I also pushed 614fc8b9ddbe3d6dd69067068bb88651c50e939b to solve the warning that would appear in case the generator is a non-tool script. That warning was not really helpful.