You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes while moving RoadPoints, there is a bad state where geometry doesn't update, and we get errors like:
res://addons/road-generator/road_network.gd:142 - Invalid set index 'low_poly' (on base: 'null instance') with value of type 'bool'.
My hunch is this is something to do with how the scene-tree initializes, but that would need further verification. When I faced this in the demo project and I opened a new scene and created a network from scratch (using spatials), I did not run into this issue.
Also unsure if related, but occasionally get the error:
res://addons/road-generator/plugin.gd:33 - Attempt to call function 'hide_gizmo' in base 'null instance' on a null instance.
Which again points towards a reference / initialization error, or at least an issue with the plugin's ability to correctly pick up the current state when being triggered to make a change.
The text was updated successfully, but these errors were encountered:
Reframing this task to be more about addressing startup issues, such as warnings and errors on open.
On further exploration, it seems to be happening due to a variety of reasons:
Warnings on open:
At surface value, the warnings are of no concern because they point out valid, impossible auto-texture scenarios. The question is more about the frequency and number of times they are called.
Can be eliminated by commenting out all calls to on_transform in the RoadPoint class.
On further reading, seems to be due to setget necessarily being called (possibly twice) on scene load. See https://github.com/godotengine/godot/issues/17436 for more details).
Thus, scene startup has the risk of being very slow if these set-get functions each lead to generation geometry.
The fix here in progress: wait until the network node is ready, since all children are added to the scene first before the parent-most node. Then do one generation at the parent level.
Errors on open
Can be traced to references of transform (basically anywhere in road_segment where global_transform is called).
However, this may be more root-caused by the above warnings actually. Ideally we do one single generation once all children are ready.
This really does, however, necessitate that users of the road network make both the roadpoints and segments be children of the network itself, and not place elsewhere.
While working on resolving the warnings, I may have actually eliminated the issue referenced here: #3
Once I added flags of:
if not is_instance_valid(network):
return # might not be initialized yet
to the RoadPoint class, it seemed to resolve point number 3.
Sometimes while moving RoadPoints, there is a bad state where geometry doesn't update, and we get errors like:
res://addons/road-generator/road_network.gd:142 - Invalid set index 'low_poly' (on base: 'null instance') with value of type 'bool'.
My hunch is this is something to do with how the scene-tree initializes, but that would need further verification. When I faced this in the demo project and I opened a new scene and created a network from scratch (using spatials), I did not run into this issue.
Also unsure if related, but occasionally get the error:
res://addons/road-generator/plugin.gd:33 - Attempt to call function 'hide_gizmo' in base 'null instance' on a null instance.
Which again points towards a reference / initialization error, or at least an issue with the plugin's ability to correctly pick up the current state when being triggered to make a change.
The text was updated successfully, but these errors were encountered: