Commit Graph

386 Commits

Author SHA1 Message Date
Campbell Barton
7a24e0d175 Cleanup: typos 2018-01-19 15:34:54 +11:00
27dff3fbc1 Merge branch 'master' into blender2.8 2018-01-18 01:01:17 +01:00
a6700362c7 Memory: add MEM_malloc_arrayN() function to protect against overflow.
Differential Revision: https://developer.blender.org/D3002
2018-01-17 19:59:47 +01:00
Dalai Felinto
1e9bc60777 Fix collection visibility evaluation
Collection       A [disabled]
 -> Collection   B
   -> Collection C
     -> object

Object should be invisible, but it is not. Reported by Antonio Vazquez.

Bug introduced on: 1f5106de610b
2018-01-15 20:19:12 -02:00
Campbell Barton
7fc1f42aae tests: limit public API in view_layer_common 2018-01-04 11:57:45 +11:00
Campbell Barton
ea55af2163 tests: replace boiler-plate with util function
This crept back in somehow!
2018-01-04 11:28:46 +11:00
Dalai Felinto
e1cbac715a Fix FOREACH_SCENE_COLLECTION/FOREACH_SCENE_OBJECT for nested collections
This fixes any function that relied on these iterators such as:
* Outliner Same Type
* Metaballs
* scene.objects

We were not considering the collections when there was collections nested
to the collections nested to the master collection.

It includes a unittest.
2018-01-03 19:33:00 -02:00
Dalai Felinto
07de8eff77 Layers/Collections: Fix crash when deleting collection
If the collection to be deleted has a nested collection that is directly linked
to a view layer, we were getting a crash.
2018-01-02 18:19:26 -02:00
Dalai Felinto
8300b5e539 Layers: Fix operator_context unittest
This was broken since 70cdc8412c478b when we changed the requirement for context
scene collection to be part of context view layer.
2018-01-02 17:42:23 -02:00
Dalai Felinto
f3566235ca Layers: Fix collection_rename unittest
This was broken since c9cb5dc3dab0af when we supported same name for
non-sibling collections.
2018-01-02 16:59:30 -02:00
Dalai Felinto
110373de6a Fix T53638: View layer renaming crashes 2/2
This fixes renaming the view layer via Python.

This bug was introduced originally in 3a95bdfc65d. Although I suspect it was
around for longer, since this commit didn't touch this part of the code.

But basically we need the id of the RNA property to be the one that owns
the data (view layer).
2017-12-27 13:39:28 -02:00
Sergey Sharybin
0ebf69287a Merge branch 'master' into blender2.8 2017-12-19 10:05:04 +01:00
Sergey Sharybin
a130c82f0a Cycles tests: Enable texture space tests 2017-12-19 09:54:23 +01:00
Dalai Felinto
1f5106de61 Group collection viewport/render options and remove collection visibility
Users can change the group collection visibility in the outliner
when looking at groups.

Regular collections on the other hand don't have any special visibility control,
if you need a collection to be invisible during render, either don't link it
into the view layer used for F12, or disable it.

This includes:
* Updated unittests - update your lib/tests/layers folder.
* Subversion bump - branches be aware of that.

Note:
Although we are using eval_ctx to determine the visibility of a group collection
when rendering, the depsgraph is still using the same depsgraph for the viewport
and the render engine, so at the moment the render visibility is ignored.

Following next is a workaround for this separately to tag the groups before and
after rendering to tackle that.
2017-12-15 08:56:48 -02:00
Dalai Felinto
aa0c9867b2 unittests: Update (fix) unittests after workspace API change
Tests were broken since e8c15e0ed15f8369d.

We now get view_layer from window, not workspace, since the same workspace can
have a different view_layer depending on the window scene.
2017-12-01 16:08:52 -02:00
Dalai Felinto
aeaf87bbeb Groups and collection: create group from collection
You could still create groups as before, with Ctl + G. This will create a group
with a single visible collection.

However you can also create a group from an existing collection. Just go to
the menu you get in the outliner when clicking in a collection and pick
"Create Group".

Remember to instance the group afterwards, or link it into a new scene or file.

The group and the collection are not kept in sync afterwards. You need to manually
edit the group for further changes.
2017-12-01 14:15:54 -02:00
Dalai Felinto
14c3ef8253 Fixing alembic unittest after render layer purge 2017-11-27 14:52:21 -02:00
Sergey Sharybin
f591060856 Backgroudn set tests: Correct evaluation order
All depsgraphs are sharing same object state for now, which means doing set
scene evaluation after main scene evaluation will override all modifications
done by the main scene.
2017-11-24 16:55:41 +01:00
Dalai Felinto
dc2ae8fdf2 Unittest: Update background set test to test for proper flag
This test will fail until depsgraph is fixed.
But introduced on 87c821ff26be.
2017-11-24 11:42:28 -02:00
Dalai Felinto
1971dd2976 Layers Unittest: Background set
This is an incomplete test since we cannot check for the
depsgraph selection value with the current API, nor can we
see if the relationship lines are being drawn.
2017-11-24 10:54:13 -02:00
Bastien Montagne
a786baa193 Merge branch 'master' into blender2.8 2017-11-23 21:36:27 +01:00
Bastien Montagne
efb86b712d Add a new parallel looper for MemPool items to BLI_task.
It merely uses the new thread-safe iterators system of mempool, quite
straight forward.

Note that to avoid possible confusion with two void pointers as
parameters of the callback, a dummy opaque struct pointer is used
instead for the second parameter (pointer generated by iteration over
mempool), callback functions must explicitely convert it to expected
real type.

Also added a basic gtest for this new feature.
2017-11-23 21:14:43 +01:00
Dalai Felinto
3abe8b3292 Rename any instance of scene layer or render layer in code with view layer
The RenderResult struct still has a listbase of RenderLayer, but that's ok
since this is strictly for rendering.

* Subversion bump (to 2.80.2)
* DNA low level doversion (renames) - only for .blend created since 2.80 started

Note: We can't use DNA_struct_elem_find or get file version in init_structDNA,
so we are manually iterating over the array of the SDNA elements instead.

Note 2: This doversion change with renames can be reverted in a few months. But
so far it's required for 2.8 files created between October 2016 and now.

Reviewers: campbellbarton, sergey

Differential Revision: https://developer.blender.org/D2927
2017-11-23 07:48:23 -02:00
Dalai Felinto
58a3057099 Layers Unittest: Hidden flag to quckly update diffs
This is not the commit you are looking for ...

This is not to be used lightly. But sometimes we change the name of the collections,
the initial value they have, ... and this helps to quickly update the tests.
2017-11-10 13:01:05 -02:00
Dalai Felinto
1122a401b0 Unittest: Layers - include is_disabled for LayerCollection
And remove is_folder since it is not being used.
2017-11-10 12:39:43 -02:00
Sergey Sharybin
d325e6f0e8 Depsgraph: Make dependency graph to be built from scene layer
This is a final step of having proper ownership. Now selecting different
layers in the "top bar" will actually do what this is expected to do.

Surely, there are still things to be done under the hood, that will happen
in a less intrusive way.
2017-11-09 11:20:17 +01:00
Sergey Sharybin
e72dfee66f Depsgraph: Use explicit depsgraph in alembic module 2017-11-03 12:02:39 +01:00
Sybren A. Stüvel
f7d59fbc46 Merge branch 'master' into blender2.8
# Conflicts:
#	tests/gtests/alembic/abc_export_test.cc
2017-11-02 14:37:10 +01:00
Sybren A. Stüvel
8a3728800c Alembic: not using global in unit test.
Thanks @sergey for pointing out this fix.
2017-11-02 14:33:21 +01:00
Dalai Felinto
3a72f02d80 Layers: unittest update after workspace > engine changes
All tests working again now.
Remember to update the svn lib/tests/layers folder.
2017-10-31 12:45:41 -02:00
Sybren A. Stüvel
405980b1fa Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/alembic/intern/abc_exporter.cc
#	source/blender/alembic/intern/abc_exporter.h
#	source/blender/alembic/intern/alembic_capi.cc
#	tests/gtests/alembic/abc_export_test.cc
2017-10-29 15:38:55 +01:00
Sybren A. Stüvel
89eb05a890 Alembic: exporting MetaBalls as mesh
- Only basis balls are exported, as they represent the resulting mesh.
  As a result the mesh is written to Alembic using the name of the basis
  ball.
- MetaBalls are converted to a mesh on every frame, then an
  AbcMeshWriter is used to write that mesh to Alembic.
2017-10-29 15:21:36 +01:00
Sybren A. Stüvel
7530c54c3c Merge branch 'master' into blender2.8 2017-10-29 15:14:04 +01:00
Campbell Barton
512b879241 BLI_heap: add validation check, improve tests
Also minor readability changes, avoid running both heap_up/down
gives minor speedup too.
2017-10-29 18:23:33 +11:00
Campbell Barton
3425732926 BLI_heap: minor changes to the API
Recent addition of 'reinsert' didn't match logic for ghash API.

Rename to BLI_heap_node_value_update,
also add BLI_heap_insert_or_update since it's a common operation.
2017-10-29 15:47:06 +11:00
Campbell Barton
4af1af70ad BLI_hash: add BLI_heap_reinsert
Allows avoiding remove/insert calls.
2017-10-29 04:42:58 +11:00
Campbell Barton
b84e3dc7f3 GTest: initial BLI_heap test 2017-10-29 00:56:56 +11:00
Sergey Sharybin
654ee398ff Merge branch 'master' into blender2.8 2017-10-26 12:49:57 +02:00
Sybren A. Stüvel
03a582ceeb Using gtest fixtures in Alembic export tests 2017-10-26 12:43:59 +02:00
Campbell Barton
c8edac617f Merge branch 'master' into blender2.8 2017-10-23 14:38:22 +11:00
Campbell Barton
af067f2305 Correct gtest error in recent beautify change 2017-10-23 14:20:35 +11:00
Julian Eisel
147f9585db Merge branch 'master' into blender2.8 2017-10-23 00:04:20 +02:00
Campbell Barton
6dfe4cbc6b Polyfill Beautify: half-edge optimization
Was using an edge hash for triangle -> edge lookups,
updating triangle indices for each edge-rotation.

Replace this with half-edge which can rotate edges much more simply,
writing triangles back once the solution has been calculated.

Gives ~33% speedup in own tests.
2017-10-23 01:40:03 +11:00
Campbell Barton
54f9a6e5da Merge branch 'master' into blender2.8 2017-10-18 16:40:31 +11:00
Sybren A. Stüvel
b53918be39 Added alpha channel check to Alembic unit test
It was broken due to 823bcf1689a3dbd44dd77b2c8ea46b9b54073c46, which added
alpha information and thus changed tuple size from 3 to 4 items.
2017-10-17 10:59:02 +02:00
Sergey Sharybin
dc95c79971 Merge branch 'master' into blender2.8 2017-10-11 13:14:16 +05:00
Sergey Sharybin
d83bcf7071 Cycles tests: Don't proint braces for empty status 2017-10-11 12:36:18 +05:00
Sergey Sharybin
128c7c3ba1 Merge branch 'master' into blender2.8 2017-09-22 13:26:49 +05:00
8289b47e3a Fix Cycles test report not closing files properly. 2017-09-20 19:12:26 +02:00
Campbell Barton
851228766e Merge branch 'master' into blender2.8 2017-09-20 16:10:40 +10:00
Campbell Barton
a2d246c5c0 BLI_polyfill2d_test: script to generate test data 2017-09-20 13:40:30 +10:00
Campbell Barton
16355d545b Fix T52834: Polyfill2D fails with co-linear edges 2017-09-20 04:29:04 +10:00
Campbell Barton
c4235356c9 BLI_polyfill2d_test: add test for T52834
Commented since it currently fails.
2017-09-20 03:40:13 +10:00
Campbell Barton
e00bb4d22c BLI_polyfill2d_test: Try flipped x/y axis
In T52834 this makes a difference.
2017-09-20 03:35:06 +10:00
Sergey Sharybin
af170839af Merge branch 'master' into blender2.8 2017-09-19 21:08:14 +05:00
Campbell Barton
60956397ca Cleanup: BLI_utildefines prefix for header-only libs
This allows to have different macro headers without them sharing
similar names to regular C modules.
2017-09-19 20:16:05 +10:00
Campbell Barton
37d8d4787c Merge branch 'master' into blender2.8 2017-09-13 23:44:13 +10:00
Sergey Sharybin
e7b5bbae6a Cycles tests: Add baking features tests 2017-09-12 16:22:02 +05:00
28532f1867 Cycles tests: add environment variable to update references renders.
This will copy new renders over references renders:
CYCLESTEST_UPDATE=1 ctest -R cycles
2017-09-12 12:50:44 +02:00
Campbell Barton
323a7ab944 Merge branch 'master' into blender2.8 2017-08-31 21:57:38 +10:00
Sergey Sharybin
4f1b510d75 Cycles: Add tangent attribute tests 2017-08-30 17:42:00 +02:00
Campbell Barton
ca9801bd42 Merge branch 'master' into blender2.8 2017-08-27 16:35:51 +10:00
Campbell Barton
b1f2b69884 Missing from last commit 2017-08-27 15:24:41 +10:00
Campbell Barton
6178cf8353 Cleanup: use stubs for eigen gtest 2017-08-27 15:21:09 +10:00
Campbell Barton
79111f9246 Merge branch 'master' into blender2.8 2017-08-27 00:51:54 +10:00
Ray Molenkamp
58d92cefbd [cycles/ctest] fix failing tests when output folder doesn't exist yet. 2017-08-25 17:17:49 -06:00
Campbell Barton
58a4c767a1 Merge branch 'master' into blender2.8 2017-08-23 16:10:45 +10:00
Campbell Barton
46b9f89f5e Tests: fix incorrect check for hidden dir
Copy-pasted mistake in tests and tools.
2017-08-23 15:36:39 +10:00
Campbell Barton
7497488149 Merge branch 'master' into blender2.8 2017-08-20 15:50:15 +10:00
4218b9367e Cycles tests: pass Blender custom arguments from CYCLESTEST_ARGS.
This is useful for testing with different devices, split kernel, OSL,
impact of integrator settings, etc.
2017-08-19 18:14:16 +02:00
Campbell Barton
2332051419 Merge branch 'master' into blender2.8 2017-08-19 21:54:05 +10:00
d282dc04ef Cycles tests: add light type tests. 2017-08-18 17:09:12 +02:00
5cf36c0f05 Cycles tests: make page less wide, use relative URLs for serving through http. 2017-08-18 17:09:08 +02:00
Dalai Felinto
18ce2bfac6 Depsgraph/Layers: Keep original visibility when doing full scene copy
Originally we were not respecting the original visibility flags of the
collections. However this is required for Copy-on-write (CoW).

Remember to update the svn lib tests folder. I had to update some of the
json files there.

Also adding a new unittest for this particular issue:
Test render_layer_scene_copy_f
2017-08-16 10:35:26 +02:00
Campbell Barton
9567529b8f Merge branch 'master' into blender2.8 2017-08-12 00:23:49 +10:00
Sergey Sharybin
596ee4b505 Cycles tests: Draw images on top of checkerboard
This way it's easier to see alpha-channel only images, such as shadow catcher
images on transparent film.
2017-08-11 13:49:50 +02:00
Campbell Barton
d1328feeb1 Merge branch 'master' into blender2.8 2017-08-11 10:33:39 +10:00
977e7b68cb Cycles: add denoising tests, keep new image even if no reference exists. 2017-08-11 01:09:35 +02:00
Sybren A. Stüvel
b4d44b98e8 Alembic: Adjusted unit test for Blender 2.8 to use scene layers. 2017-08-09 15:08:19 +02:00
Sybren A. Stüvel
6883f10f14 Merge branch 'master' into blender2.8 2017-08-09 15:08:06 +02:00
Sybren A. Stüvel
8cfb9b9535 Fixed Alembic unit test
Commit b6d7cdd3cee9312156e20783248a3b12420b7a53 changed how the mesh data
is deformed, which wasn't taken into account yet in this unit test.

Instead of directly reading the mesh vertices (which aren't animated any
more), we convert the modified mesh to a new one, and inspect those
vertices instead.
2017-08-09 13:59:58 +02:00
Sergey Sharybin
2190c0c7e5 Modules test: Don't print backtrace for files which are ignored
This could make output really polluted, where it'll be hard to see actual
issues.

It is still possible to have all backtraces printed using BLENDER_VERBOSE
environment variable.
2017-08-09 09:42:03 +02:00
Bastien Montagne
e8b6bcd65c Merge branch 'master' into blender2.8
Conflicts:
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
	source/blender/editors/object/object_add.c
	source/blender/python/intern/bpy_app_handlers.c
2017-08-08 16:43:25 +02:00
Sergey Sharybin
b53e35c655 Fix compilation error when building without Blender
Simply disabled python tests, they can't be run anyway (since blender target is
not enabled) and we don't have any player-related tests in that folder.
2017-08-08 11:32:33 +02:00
Bastien Montagne
b282716c3a Merge branch 'master' into blender2.8 2017-08-07 16:16:43 +02:00
Sergey Sharybin
771e6120c8 Cycles tests: CMake side changes to support recent files split in the SVN repo 2017-08-07 14:33:47 +02:00
0f3f093d3b Cycles: add HTML report to inspect failed test images.
Shows new, reference and diff renders, with mouse hover to flip between
new and ref for easy comparison. This generates a report.html in
build_dir/tests/cycles, stored along with the new and diff images.

Differential Revision: https://developer.blender.org/D2770
2017-08-07 14:01:24 +02:00
Campbell Barton
e16e96433f Merge branch 'master' into blender2.8 2017-08-04 08:26:05 +10:00
Campbell Barton
696599edac CMake: test build configuration support
D2765 by @akitula
2017-08-04 08:11:42 +10:00
Campbell Barton
ca67cdb73c Merge branch 'master' into blender2.8 2017-08-03 07:14:02 +10:00
Bastien Montagne
13d324f26b Tweak multi-units tests to match new precision handling in conversion from raw value to prety-printed one.
Note that new code allows to enable again the '1 million miles' tests.
2017-08-01 16:43:40 +02:00
Campbell Barton
913d8ec608 BLI_memiter: Small API for many small allocations
- Each allocation can be a different size
  (but should be smaller than the chunk size).
- Result can be looped over in order of allocation.
- Allocations are aligned to pointer size to avoid unaligned reads.
2017-07-30 00:08:17 +10:00
Campbell Barton
b97bf844b3 Merge branch 'master' into blender2.8 2017-07-25 20:53:10 +10:00
Sergey Sharybin
35d9f68121 Python module test: Don't cfail the test when import failure happens in preset 2017-07-25 11:39:10 +02:00
Sergey Sharybin
35d044e40d Fix compilation error of alembic test after recent eval_ctx changes 2017-07-24 16:50:47 +02:00
Dalai Felinto
f04c06498b Fix layers unittest - we cannot use nestted get_pointer calls
Remember to update your //lib/tests folder as well.

Patch by Bastien Montagne(mont29)
2017-07-17 18:46:00 +02:00
Dalai Felinto
0e49d5376c Revert "Unittests: Workaround for basact->object.id.name written as DATA"
This reverts commit aa578fba534d7d7cab215d8f57c478d641b05db7.
2017-07-17 18:06:49 +02:00
Dalai Felinto
aa578fba53 Unittests: Workaround for basact->object.id.name written as DATA
This was introduced on e7fb013a60dd. Although I would love to investigate the
issue I'm mostly concerned with gettings the tests working again.
2017-07-17 16:22:42 +02:00
Dalai Felinto
a258c5d325 Unittests: Make sure layer tests pass with or without workspace 2017-07-17 16:22:07 +02:00
Dalai Felinto
9d318acfa7 Merge remote-tracking branch 'origin/master' into blender2.8 2017-07-14 14:34:46 +02:00