Commit Graph

469 Commits

Author SHA1 Message Date
Campbell Barton 41d4a19865 ClangFormat: format '#if 0' code in source/ 2019-04-17 08:24:14 +02:00
Campbell Barton 3076d95ba4 Cleanup: use 2 space indentation for CMake 2019-04-17 06:35:54 +02:00
Campbell Barton e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Campbell Barton 2986bc1d6e ClangFormat: add comments to ignore formatting 2019-04-16 16:57:47 +02:00
Campbell Barton 31c2e69d49 CMake: remove BLENDER_SORTED_LIBS
Use CMake's target_link_libraries instead of manually maintaining
library dependencies in a single list.

In practice adding new libraries often ended up being guess-work,
now each library lists the libraries it uses.

This was used for the game player executable so libraries
could optionally link to stubs.

If we need this functionality it can be done using target-properties
as described in T46725.
2019-04-16 12:36:44 +02:00
Campbell Barton 47adab4f99 CMake: prepare for BLENDER_SORTED_LIBS removal
No functional change, this adds LIB definition and args to cmake files.
Without this it's difficult to migrate away from 'BLENDER_SORTED_LIBS'
since there are many platforms/configurations that could break when
changing linking order.

Manually add and enable WITHOUT_SORTED_LIBS to try building
without sorted libs (currently fails since all variables are empty).
This check will eventually be removed.

See T46725.
2019-04-14 15:37:24 +02:00
Howard Trickey 3c6deb69f7 Fix ply import tests.
The function for clearing out objects in the startup file
needed updating for 2.8 collections api.
2019-04-04 08:50:17 -04:00
Howard Trickey b2d68b53df Fix export_obj_cube test.
Verified that current export files for all_quads.blend are good,
then updated expected MD5 hash to match current files.
2019-04-03 10:05:47 -04:00
Sergey Sharybin f39a4a4a4e Cleanup: More C++ like nature for word split test
While it looks more longer, but also contains more comments
about what's going on.

Surely, this function almost never breaks and investing time
into maintaining its tests is not that important, but we should
have a good, clean, understandable tests so they act as a nice
example of how they are to be written. Especially important to
show correct language usage, without old school macros magic.

Doing this at a lunch breaks, so will be series of some updates
in the area.
2019-03-20 14:14:56 +01:00
Sybren A. Stüvel 0333cf00ba Fix BLI_path_frame_strip
The `BLI_path_frame_strip` function was completely broken, unless the
number of digits in the sequence number was the same as the length of
the extension. In other words, it would work fine for `file.0001.abc` (4
digit `0001` and 4 char `.abc`), but other combinations would truncate
to the shortest (`file.001.abc` would become `file.###.ab` and
`file.00001.a` would become `file.##.a`). The dependency between the
sequence number and the file extension is now removed.

The behaviour has changed a little bit in the case where there are no
numbers in the filename. Previously, `path="filename.abc"` would result
in `path="filename.abc"` and `ext=""`, but now it results in
`path="filename"` and `ext=".abc"`. This way `ext` always contains the
extension, and the behaviour is consistent regardless of whether there
were any numbers found.

Furthermore, I've removed the `bool set_frame_char` parameter, because
it was unclear, probably also buggy, and most importantly, never used.

I've also added a unit test for the `BLI_path_frame_strip` function.
2019-03-20 13:42:45 +01:00
Brecht Van Lommel e691929686 Merge branch 'blender2.7' 2019-03-17 12:54:19 +01:00
Howard Trickey 0af22625c9 Fix bl_pyapi_idprop unit test.
Scenes can now have a 'cycles' key when starting, so account for that.
2019-03-17 07:36:26 -04:00
Campbell Barton 69bf4e5e36 Cleanup: unused variables 2019-03-17 21:14:43 +11:00
Campbell Barton ad9addbf46 Cleanup: unused imports 2019-03-17 21:00:56 +11:00
Brecht Van Lommel 52a7636c29 Tests: remove unnecessary _test postfix on test names. 2019-03-15 19:11:33 +01:00
Ray Molenkamp 55e79d8f36 Tests: BLI_heap_simple test fix build error with MSVC.
BLI_heap_simple.h uses types from BLI_sys_types.h causing a build error on windows.
2019-03-14 11:14:44 -06:00
Brecht Van Lommel 9a9336cb45 Merge branch 'blender2.7' 2019-02-20 19:07:25 +01:00
Brecht Van Lommel 848f589fdf Tests: only run OpenGL draw tests on lib/tests/opengl, support symlinks.
To keep running these tests relatively fast and practical to run often,
running it on all .blend files is a bit much. So now we only run it on
files from this directory.

Additionally this adds supports for following symlinks, so that you can
easily symlinks to other directories if you want to tests extra files
which may have linked libraries.
2019-02-20 17:13:33 +01:00
Brecht Van Lommel d8888b2f48 Merge branch 'blender2.7' 2019-02-11 18:39:31 +01:00
Brecht Van Lommel 2a9c8da709 Cycles: add animation denoising test, fix operator to work with single frames. 2019-02-11 18:37:02 +01:00
Campbell Barton ab5e69e660 Cleanup: remove contributors for CMake files
Following removal from C source code.

See: 8c68ed6df1
2019-02-05 09:10:32 +11:00
Campbell Barton 744f633986 Cleanup: trailing commas
Needed for clan-format not to wrap onto one line.
2019-02-03 14:59:11 +11:00
Campbell Barton d70350403f Cleanup: manually remove header text not handled by automation 2019-02-02 02:41:25 +11:00
Campbell Barton 6cbb4c576a Cleanup: manually remove header text not handled by automation 2019-02-02 01:49:31 +11:00
Sergey Sharybin 9770d071ff Fix T54834: VSE can't import OGG Theora video 2019-01-23 17:16:17 +01:00
Bastien Montagne 6d89337257 Fix/cleanup typos and such in UI messages (and some comments). 2018-12-24 15:03:49 +01:00
Bastien Montagne 1ac311cedc Fix/cleanup another bunch of UI messages issues.
Also (mostly in comments): behaviour -> behavior (we use American English).
2018-12-24 12:32:43 +01:00
Campbell Barton 63fcbfc3a7 RNA: naming, user-preferences -> preferences 2018-12-21 12:55:02 +11:00
Jacques Lucke aa63a87d37 BLI: New Edgehash and EdgeSet implementation
The new data structure uses open addressing instead of chaining to resolve collisions in the hash table.

This new structure was never slower than the old implementation in my tests. Code that first inserts all edges and then iterates through all edges (e.g. to remove duplicates) benefits the most, because the `EdgeHashIterator` becomes a simple for loop over a continuous array.

Reviewer: campbellbarton

Differential Revision: D4050
2018-12-13 11:21:31 +01:00
Bastien Montagne 394b086b9c Fix T58556: Some remaining 'dupli_types' in pycode after renaming. 2018-12-03 10:39:54 +01:00
Bastien Montagne 278d9c8322 Merge branch 'master' into blender2.8
Conflicts:
	source/blenderplayer/CMakeLists.txt
	tests/gtests/blenlib/CMakeLists.txt
2018-11-28 16:52:47 +01:00
Bastien Montagne c16321cb9d Fix building gtests and bplayer after recent NumaAPI addition.
Seriously... like, seriously...
2018-11-28 16:50:02 +01:00
Campbell Barton cb66a28d82 Cleanup: unused vars, imports 2018-11-26 09:26:15 +11:00
Campbell Barton 916446e83f Cleanup: move keymap hierarchy into own file 2018-11-20 11:38:13 +11:00
Campbell Barton c9f24a5690 WM: remove interaction presets
These only exposed a few options, which didn't end up helping
much to make Blender's key-map fit the behavior of other applications.
2018-11-20 08:11:46 +11:00
Campbell Barton 92263b67eb Update test, missed when changing Object.select_set() 2018-11-12 09:05:38 +11:00
Bastien Montagne fd65ebf39a Fix T57776: Error when adding a Torus to the scene.
Not all Object.select_set() cases had been updated to new API... Tsst. ;)
2018-11-11 11:22:38 +01:00
Campbell Barton f12d2adc87 RNA: Object.select_set use boolean, only select
- Was setting active state, making it necessary to backup/restore
  active object in cases where this isn't needed.
  Existing scripts are explicitly setting the active object when needed.

- Use a boolean select arg (toggle selection wasn't used anywhere).

- Add an optional view layer argument since scripts should be able to
  operate outside the user context.
2018-11-08 08:54:55 +11:00
Bastien Montagne 1ff8be24ef Cleanup/Refactor: move Main stuff into BKE's new main.c file (and header).
We already had a BKE_main.h header, no reason not to put there
Main-specific functions, BKE_library has already more than enough to
handle with IDs and library management!
2018-11-07 20:58:53 +01:00
Alexander Gavrilov 84fa806491 BLI_kdopbvh: add an option to use a priority queue in find_nearest.
Simple find_nearest relies on a heuristic for efficient culling of
the BVH tree, which involves a fast callback that always updates the
result, and the caller reusing the result of the previous find_nearest
to prime the process for the next vertex.

If the callback is slow and/or applies significant restrictions on
what kind of nodes can qualify for the result, the heuristic can't
work. Thus for such tasks it is necessary to order and prune nodes
before the callback at BVH tree level using a priority queue.

Since, according to code history, for simple find_nearest the
heuristic approach is faster, this mode has to be an option.
2018-11-06 21:20:16 +03:00
Bastien Montagne aa9912ec04 Proper fix for new 'SimpleHeap' gtests...
This reverts reverting commit rB55324b8a2e6799300, and do proper 'cleanup' (sigh)
in gtest as well.

Sorry for the noise, did not understood what had happened here
immediately. :/
2018-11-06 16:25:00 +01:00
Bastien Montagne 55324b8a2e Revert rBfee6ab18e7e9 in BLI_heap_test.cc
Most certainly commite by mistake, FastHeap is not in BLI yet!
2018-11-06 16:06:53 +01:00
Alexander Gavrilov fee6ab18e7 BLI_heap: implement a limited but faster version of heap.
If the user only needs insertion and removal from top, there is
no need to allocate and manage separate HeapNode objects: the
data can be stored directly in the main tree array.

This measured a 24% FPS increase on a ~50% heap-heavy workload.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D3898
2018-11-05 20:49:17 +03:00
Alexander Gavrilov d3c815bd08 BLI_heap: add an API function to directly read the top node value.
It is very commonly needed in loop conditions to check if
the items in the heap are good enough to continue.
2018-11-04 13:29:17 +03:00
Campbell Barton 733e6c0b1d Merge branch 'master' into blender2.8 2018-10-09 08:46:00 +11:00
Campbell Barton 3bc885e5f4 Cleanup: style 2018-10-09 07:58:06 +11:00
Lukas Stockner 9756475ed6 Tests: Support parallel execution of render tests
Previously, parallel tests would overwrite each others temporary outputs.
2018-10-06 22:12:28 +02:00
Campbell Barton 1c3411ac89 Keymap: expose tool keymaps in the preferences
Currently some modes share tool keymaps, we might want to disable
this since it's confusing editing one thing in multiple places.

However this should be resolved in the tool definitions.
2018-10-03 15:55:57 +10:00
Sergey Sharybin d2d0b4fcd7 Merge branch 'master' into blender2.8 2018-09-28 15:03:03 +02:00
Brecht Van Lommel 6dd047c333 Tests: recurse into directories for finding OpenGL draw test .blends. 2018-09-28 14:09:42 +02:00