-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamically load assets from point data with pre-defined meshes #215
Comments
In da9e3cc, a node was added which can load different assets based on the value of an attribute in GeoPoints from a Shapefile. This was implemented for power poles: The same can be done for other shapefiles pretty easily - you just need to set an attribute and map its possible values to PackedScenes. It would theoretically be nice to expose this even further, to something like a config json. However, we have to implement the Asset in the editor anyways (to allow additional functionality and because of the challenge of importing meshes at runtime), so I'm not sure if that's feasible... |
This is on hold since it will be largely solved by the layer rewrite. Keeping the issue open to ensure that this functionality will be fully included. |
The implementation of this as an ObjectLayer needs to be finished. |
The ObjectLayer functionality for rendering objects is now finished. Leaving this open until the UI is adapted as well. |
Since i don't really find any example/documentation on how to use it, I am going to request a bit of help here @kb173. I will clasically obtain metadata via EDIT: Just found a snippet of this - sorry. |
For future reference I'll just post the example here as well: # Test Point Data
var windmill_layer = FeatureLayer.new()
var windmill_dataset = Geodot.get_dataset("/home/karl/Downloads/ooe_point_test.shp")
windmill_layer.geo_feature_layer = windmill_dataset.get_feature_layer("ooe_point_test")
windmill_layer.render_type = Layer.RenderType.OBJECT
windmill_layer.render_info = Layer.ObjectRenderInfo.new()
windmill_layer.render_info.object = preload("res://Objects/WindTurbine/GenericWindTurbine.tscn")
windmill_layer.render_info.ground_height_layer = height_layer.clone()
windmill_layer.name = "Windmills" |
Functionality for this is here - marking it as needs-testing. |
This has been tested for a while now, and it was even extended to work with dynamically loaded OBJ meshes in 681d5f4. Both methods seem stable and the result looks as expected. |
Once boku-ilen/geodot-plugin#21 is done, we can easily retrieve point data from e.g. a shapefile. We want to be able to load assets (meshes) based on such point data. Which specific mesh is used often depends on an attribute of the point.
The text was updated successfully, but these errors were encountered: