This patch adds number formatting (thousands separator) to the baking panel. It also adds a new funciton to format memory sizes (KB/GB/etc) and applies it to the baking panel and scene stats.
Details
Diff Detail
- Repository
- rB Blender
- Branch
- thousands
Event Timeline
First part of the patch seems nice, but there's some feedback about memory usage.
| source/blender/blenkernel/intern/pointcache.c | ||
|---|---|---|
| 3735–3738 | It makes more sense to have an utility function which will give you human readable size in megabytes, gigabytes, terabytes and so on. So you don't have ridiculous reports about "100,000,000 Mb" which is not really informative. | |
| release/scripts/startup/bl_ui/properties_data_modifier.py | ||
|---|---|---|
| 296–297 | Why is this changed?, currently Blender scripts use C-style formatting everywhere. | |
| source/blender/blenkernel/intern/pointcache.c | ||
| 3735–3738 | In this particular case I'd rather have a utiliy function to display filesize. Most likely it can be reused elsewhere too. (then it can do GiB etc too). | |
| release/scripts/startup/bl_ui/properties_data_modifier.py | ||
|---|---|---|
| 296–297 | Left this reply in by accident, C style formatting doesnt do this. | |
| source/blender/blenkernel/intern/pointcache.c | ||
|---|---|---|
| 3735–3738 | Note that this change is for frame count only, not the mem. I agree that it'd be nice to have a function to display filesize properly. | |
Rebased
I didn't include the MB/GB code since this patch doesn't affect any ram number. I think that should go in another patch.
- Add a function to format a size in bytes
- Add unit tests for BLI_str_format_bytes
- Format memory stats in the physics panel
- Format memory info in scene stats
I've added the memory formatting idea to this patch. Let me know if you guys want to split it.
Tested this with scenes and bakes from KBs to GBs. The only thing I didn't test was the mmap and gpu mem things in info_stats.c because I can't figure out how :)
Rebase. Also friendly ping before this patch rots too much (considering the topbar changes coming in 2.8)
Stumbled over this today and made some changes (updating patch in a minute). Should be ready to go now.
Improvements to BLI_str_format_bytes:
- Rename to BLI_str_format_byte_unit
- Use long long int as argument, not double. Floating point byte-count doesn't make much sense, it's only needed for internal purposes.
- Strip trailing zeroes.
- Support passing negative values - not sure if that's useful even, but simple to support.
- Improve test coverage, esp. for corner-cases.
- General cleanup (codestyle, naming, comments, etc.)