Bulk map section loading#421
Open
jgooderham wants to merge 12 commits into
Open
Conversation
UI update to support bulk loading. Small change to previous property for naming consistency
Implements bulk loading of map sections based off a supplied case-insensitive prefix
Avoid using an operator call to create collision empties. Possible speed up
Firstly, collisions no longer have their .col filename prepended to their name in the original collection. They were named as such previously so that users could identify the original .col file from an in-place instance. The instance still carries this prefix, but it was unnecessary to have it in the original name. Secondly, a terrible oversight in a loop filled with countless unnecessary object instantiations was found and corrected. The loop itself is a little smarter and comments were added for clarity.
Changed collision loading progress logic. Since a full collision file is loaded at once it really can't report progress the same way as the model instance loading so just go one by one and show progress over the collision file set, then reset progress for model instances. Kind of a user fake out but at least Blender feels less dead during the load. A label for each stage of the load would be nice but that isn't possible currently. Bulk loading of map chunks with collision is still painful, probably because of scene updates from collection linking? Also a small change to check if we can skip looking up collision files for in-place instancing, if the top-level collision collection isn't found
Just prints a small message in the system console with the elapsed time of the map load
The bulk load prefix shows a preview of which sections will be loaded. This preview has a dynamic size which pushes the load button down on the UI so the button was moved above. Added number of sections to label. Game folder settings were also moved, but eventually these should probably be moved to the addon's global settings
Just changed the import label to acknowledge that multiple sections are possibly loaded at a time. Also removed an explicit call to the update the dependency graph which doesn't do anything
This adds a small utility operator to adjust the viewport to better see imported map sections. The far clipping plane is set to 10000m and object shading is set to texture. A button is placed on top of the map import menu
The map import button didn't have a tooltip so this gives it one and includes a small warning to inform about possible sluggishness when loading multiple sections at once
Changed some of the tooltips for clarity/harmony. Changed display of import section options depending on selection. Now typing a prefix will hide the other import options and checking custom map section will hide the prefix box.
Added some logic to track the centroid of map sections to be loaded. The viewport camera is then focused at this point just before load starts. As some map sections could be far off from the current view, this avoids the user not seeing anything being loaded.
|
cool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello again. I worked on the map importer a while back and I'm back at it again. I'm looking at working with the importer on a project so I've tried to address some pain points with its use.
I added some options to improve the map import process. Mainly, you can load multiple parts of a map at once by entering a prefix. I've also made some adjustments to the UI, as well as the presentation of the map loading process. The camera will now focus on what's about to be loaded, and the viewport can be quickly adapted to better view map geometry over the default settings. I've also cleaned up the naming of collision objects. I tried to investigate ways to improve the performance of loading so many objects into the scene, but so far it seems this is still just a limitation of Blender. Let me know what you think
This shows multiple map sections being loaded in one go. Sadly, this is not the the actual speed, it's just a gif with duplicate frames removed. But it loads up eventually. If you don't load collision, you can usually load up an entire city from SA in a couple minutes.