Commit Graph

498 Commits

Author SHA1 Message Date
Bastien Montagne
33e8db94b1 Fix (unreported) missing updates in scripts/docs after scene.update() removal.
This should really have been done together with API changes, simple
usage of grep does the trick to catch most places needing updates.
2019-06-04 14:39:51 +02:00
08005802cc Tests: make grease pencil tests part of OpenGL render tests
Otherwise tests fail on machines without OpenGL.
2019-05-28 18:05:31 +02:00
Ray Molenkamp
0fc97dc73d CTest: Fix Bli_task_test failing on windows.
The task_scheduler was not being explicitly freed, leading to
unpredictable behavior when the process was exiting. The test
would pass, but would sometimes segfault at process shutdown.
2019-05-21 06:51:24 -06:00
b9ce1fee42 Fix broken workbench tests after recent changes 2019-05-20 16:35:34 +02:00
Jeroen Bakker
bc3139d792 Cycles/Eevee: unify depth of field settings for cameras
There is now a checkbox to enable/disable depth of field per camera. For Eevee
this replace the scene level setting. For Cycles there is now only an F-Stop
value, no longer a Radius.

Existing files are converted based on Cycles or Eevee being set in the scene.

Differential Revision: https://developer.blender.org/D4882
2019-05-17 17:59:26 +02:00
Clément Foucault
52669dda80 Eevee: Remove the Volumetric Render checkbox
This is to simplify the usage of Volumetrics.

Now it automatically detect if there is any Volumetric material in the
view and allocate the needed buffer if any.
2019-05-17 13:38:42 +02:00
387c1f2e0d Tests: add more descriptive messages when idiff is not available
Based on patch contributed by Diana Picus in D4355.
2019-05-16 20:25:09 +02:00
Sergey Sharybin
32d5d127cb Tweak API to support adding evaluated meshes to main database
One of the usecases is to create mesh from an object is a manner similar to
how Apply Modifiers does it, and have it in the bmain so it can be referenced
by other objects.

This usecase is something what went unnoticed in the previous API changes, so
here is a followup.

Summary of changes:

* bpy.meshes.new_from_object() behaves almost the same as before this change.
  The difference now is that it now ensures all referenced data-blocks are
	original (for example, materials referenced by the mesh).

* object.to_mesh() now creates free-standing Mesh data-block which is outside
  of any bmain. The object owns it, which guarantees the memory never leaks.

  It is possible to force free memory by calling object.to_mesh_clear().

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D4875
2019-05-16 16:42:16 +02:00
3b51260387 Revert "Tests: speed up render tests by running multiple in the same process"
This makes finding the crashing tests harder, reverting until there is a
better solution.

This reverts commit 93901e7f0a05ba471f3b4c0201500d9dfcd68c2c.
2019-05-16 15:50:47 +02:00
Sergey Sharybin
e693918d40 Dependency graph API changes
Main goal here is to make it obvious and predictable about
what is going on.

Summary of changes.

- Access to dependency graph is now only possible to a fully evaluated
  graph. This is now done via context.evaluated_depsgraph_get().

  The call will ensure both relations and datablocks are updated.

  This way we don't allow access to some known bad state of the graph,
  and also making explicit that getting update dependency graph is not
  cheap.

- Access to evaluated ID is now possible via id.evaluated_get().

  It was already possible to get evaluated ID via dependency graph,
  but that was a bit confusing why access to original is done via ID
  and to evaluated via depsgraph.

  If datablock is not covered by dependency graph it will be returned
  as-is.

- Similarly, request for original from an ID which is not evaluated
  will return ID as-is.

- Removed scene.update().

  This is very expensive to update all the view layers.

- Added depsgraph.update().

  Now when temporary changes to objects are to be done, this is to
  happen on original object and then dependency graph is to be
  updated.

- Changed object.to_mesh() to behave the following way:

   * When is used for original object modifiers are ignored.

     For meshes this acts similar to mesh-copy, not very useful but
     allows to keep code paths similar (i.e. for exporter which has
     Apply Modifiers option it's only matter choosing between original
     and evaluated object, the to_mesh() part can stay the same).

     For curves this gives a mesh which is constructed from displist
     without taking own modifiers and modifiers of bevel/taper objects
     into account.

     For metaballs this gives empty mesh.
     Polygonization of metaball is not possible from a single object.

   * When is used for evaluated object modifiers are always applied.

     In fact, no evaluation is happening, the mesh is either copied
     as-is, or constructed from current state of curve cache.

  Arguments to apply modifiers and calculate original coordinates (ORCO,
  aka undeformed coordinates) are removed. The ORCO is to be calculated
  as part of dependency graph evaluation.

File used to regression-test (a packed Python script into .blend):

{F7033464}

Patch to make addons tests to pass:

{F7033466}

NOTE: I've included changes to FBX exporter, and those are addressing
report T63689.

NOTE: All the enabled-by-default addons are to be ported still, but
first want to have agreement on this part of changes.

NOTE: Also need to work on documentation for Python API, but, again,
better be done after having agreement on this work.

Reviewers: brecht, campbellbarton, mont29

Differential Revision: https://developer.blender.org/D4834
2019-05-16 11:49:21 +02:00
Hans Goudey
06fe2a5e0c Objects: new 3D cursor alignment option when adding objects
The choices are now World, View and 3D Cursor.

This breaks Python API compatibility, add-ons that add objects with this
parameter will need to be updated.

Differential Revision: https://developer.blender.org/D4706
2019-05-15 18:10:58 +02:00
e9d2ec46c4 Tests: disable DoF in Eevee tests for now, it adds blurring with default values 2019-05-13 15:56:10 +02:00
93901e7f0a Tests: speed up render tests by running multiple in the same process
Blender startup time and shader compilation is a big factor when running
hundreds of tests, so now all renders in the same ctest run in the same
process. If a test crashes, the remaining tests in the same category will
be marked as skipped.

Benchmarked on a quad core with ctest -j8.

cycles: 118.1s -> 94.3s
eevee: 66.2s -> 29.2s
workbench: 31.7s -> 8.6s
2019-05-11 00:12:05 +02:00
79b9596c66 Tests: fix eevee and workbench using Cycles in a few tests 2019-05-10 23:45:51 +02:00
Ray Molenkamp
243fbf1c4b Tests: Be more explicit about the required location of the tests folder. 2019-05-10 14:19:29 -06:00
259ebdd017 Fix failing tests when Cycles is enabled
The --env-system-scripts hack does not work with it, it can't find the cycles
Python module then when importing add-ons.
2019-05-10 13:29:43 +02:00
39f78413fc Tests: add tests/report.html that links to all HTML test reports
Currently this is for Cycles, Eevee and workbench tests.
2019-05-09 14:09:55 +02:00
f08ee1fc40 Tests: add Cycles image texture colorspace tests 2019-05-07 17:26:27 +02:00
fb3e138cee Tests: add Eevee reference images, and add workbench tests
Being able to compare Eevee reference images is useful for refactoring I'm
working on so might as well add them now, even if we can still improve them.

Workbench tests are just rendering the same files as Cycles and Eevee. This
doesn't really tests many workbench settings until we add tests specifically
for them, but does cover how it it handles the different object types.
2019-05-06 20:10:08 +02:00
8794779a2d Fix error running Eevee render tests 2019-05-06 12:04:08 +02:00
Campbell Barton
bdefce0b21 GTest: BLI_path_util tests
Unit tests for:

- BLI_path_extension_check
- BLI_path_frame_check_chars
- BLI_path_frame_range
- BLI_path_frame_get

D4749 by @zazizizou
2019-04-29 12:51:33 +10:00
Campbell Barton
e17e119a31 Cleanup: comment line length (tests) 2019-04-20 10:08:59 +02:00
Bastien Montagne
bd7d39f0b9 PyTests: do not load addons in load_py_modules test.
It makes no sense to load add-ons here, we already do that (in a more
complete way) in load_addons test, this is only adding overhead and
doubling code to maintain).

Also do not try to load-as-modules add-ons that are not 2.8-ready, and
some other misc fix.

load_py_modules test should be passing again now.

Thanks to @sergey who did part of the work here as well.
2019-04-18 21:14:14 +02:00
Campbell Barton
4439e5d0ba Cleanup: add trailing commas to avoid right shift 2019-04-18 17:19:44 +02:00
Bastien Montagne
098f75897e PyTests: do not try to load non-2.8-ready add-ons. 2019-04-18 17:14:51 +02:00
Bastien Montagne
90b2fceca2 Cleanup: remove last bits of WITH_LEGACY_DEPSGRAPH CMake option.
Legacy depsgraph has been removed from Blender since several months
already...
2019-04-18 11:35:39 +02:00
Sergey Sharybin
5f5a22970b Tests: Fix Alembic regression test 2019-04-17 17:39:17 +02:00
Sergey Sharybin
035b455f6c Tests: Fix ID properties test
Simply adjust to Python API changes done in 2.8.
2019-04-17 17:32:36 +02:00
Ray Molenkamp
12aa9b2108 Fix T63678 Link error of tests with MSVC.
Ideally OCIO removes their log2 implementation from the global namespace
but for now this linker tweak will have to do.
2019-04-17 07:58:48 -06:00
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
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
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
9a9336cb45 Merge branch 'blender2.7' 2019-02-20 19:07:25 +01:00
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
d8888b2f48 Merge branch 'blender2.7' 2019-02-11 18:39:31 +01:00
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: 8c68ed6df16d8893
2019-02-05 09:10:32 +11:00