Commit Graph

40 Commits

Author SHA1 Message Date
Campbell Barton
998ace3463 Cleanup: use lowercase function calls & macros in for CMake
This is already the case for most CMake usage.
Although some find modules are an exception to this, as they were
originally maintained externally they use some different conventions.

Also corrected bad indentation in: intern/cycles/CMakeLists.txt
2022-09-23 14:33:44 +10:00
Campbell Barton
f7bbec290d File headers: add license to Python scripts 2022-02-11 14:30:21 +11:00
Campbell Barton
c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
Jacques Lucke
8a9912eaf8 Tests: fail automated tests on memory leaks and other internal errors
This adds a new `--debug-exit-on-error` flag. When it is set, Blender
will abort with a non-zero exit code when there are internal errors.
Currently, "internal errors" includes memory leaks detected by
guardedalloc and error/fatal log entries in clog.

The new flag is passed to Blender in various places where automated
tests are run. Furthermore, the `--debug-memory` flag is used in tests,
because that makes the verbose output more useful, when dealing
with memory leaks.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D8665
2020-08-26 22:02:02 +02:00
Campbell Barton
312075e688 CMake: add missing headers, use space before comments 2019-10-29 01:33:44 +11:00
c553b790fc macOS: rename blender.app to Blender.app
Using a capitalized app name fits the platform guidelines. Since macOS file
systems are case insensitive by default this should not break scripts that
assume lowercase.
2019-06-21 23:37:40 +02:00
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
Campbell Barton
3076d95ba4 Cleanup: use 2 space indentation for CMake 2019-04-17 06:35:54 +02: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
Bastien Montagne
394b086b9c Fix T58556: Some remaining 'dupli_types' in pycode after renaming. 2018-12-03 10:39:54 +01: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
Campbell Barton
646f8bdb48 Cleanup: pep8 2018-07-03 07:12:24 +02:00
Jeroen Bakker
b6b1e0f56c T55454: removal of clay engine
The ClayEngine was introduced to test the blender2.8 architecture during
development. As currently we have the wanted features implemented with
matcaps we are going to remove the clay engine as it was never intended
to be an official releasable engine

Note: The test cases are never run. But when enabled will be skipped as
they were implemented over the Clay Engine
2018-06-12 15:32:31 +02:00
Campbell Barton
da53c3f020 Merge branch 'master' into blender2.8 2018-06-04 18:50:14 +02:00
Dalai Felinto
d8dca3c3b0 Layer unittest: Disable the override tests
They are failing for some time now, and they will be obsolete soon anyways.
2018-05-16 23:13:28 +02:00
67b014af48 Workspaces: active view layer now always comes from workspace, not scene.
Both the scene and workspace had an active view layer, and it was confusing
which settings were being used or displayed where. Now we always have one,
so there is no mismatch.

The "View Layers" tab in the properties editor is now "View Layer", no longer
showing a list of layers. Instead view layers can be added and removed with
the workspace view layer selector. They are also listed and selectable in the
outliner.

Single layer rendering uses the active view layer from the workspace.

This fixes bugs where the wrong active view layer was used, but more places
remain that are wrong and are now using the first view layer in the scene.
These are all marked with BKE_view_layer_context_active_PLACEHOLDER.
2018-04-26 17:06:14 +02:00
11995c5a6e Fix reversed diff output order in view layer tests. 2018-04-26 16:37:59 +02:00
Dalai Felinto
422f939f95 Fix layer unittests after scene/workspace engine changes
Note: view_layer_background_set and view_layer_object_copy still fail.
But they were failing before.
2018-04-18 17:06:57 +02:00
Dalai Felinto
e7c3c46e89 Fix make single user crash
How to reproduce the crash:
* Factory startup
* 'u'key (make single user)

It comes with a simple unittest to reproduce the original issue.
2018-03-14 08:13:27 -03:00
Dalai Felinto
d7ba1ada82 Fix T54136: Crash when deleting an object that is in an instanced group
We were not cleaning up groups after deleting objects, leaving groups with
Bases that had no object.

It includes a unittest.

Reviewers: mont29
2018-02-22 17:16:39 -03:00
Dalai Felinto
25074be697 Fix collection syncing when creating new collections from the outliner
We were not passing a scene collection parent to the BKE_collection_add
function, which in turn made syncing not work.

Right now we:
* Explicitly pass the master collection in this case
* Fallback to the master collection in other cases

With unittest.
2018-02-09 09:05:27 -02:00
Dalai Felinto
d8059a5f11 Make layers unittest pass after filter cleanup
Update your svn lib.

Unittests broken since 76289613910073.
2018-01-30 19:06:23 -02:00
Dalai Felinto
e969ac6413 Fix collections names no longer unique when moved around
We were not checking for uniqueness after moving. And in some cases the new
siblings of our collection may have conflicting names.
2018-01-19 18:44:11 -02: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
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
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
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