Commit Graph

54843 Commits

Author SHA1 Message Date
Sergey Sharybin
93e8a045df Depsgraph: Introduce explicit method which finds operation or returns NULL 2017-11-24 15:24:33 +01:00
Sergey Sharybin
68654c0be5 Depsgraph: Make more clear what find_operation() is doing for component 2017-11-24 15:21:50 +01:00
Bastien Montagne
8db63c6a1c Cleanup leftover timing debug prints from own recent commits.
Sorry about that...
2017-11-24 10:43:29 +01:00
Campbell Barton
c62e3a05b0 Cleanup: -Wnonnull-compare GCC warning 2017-11-24 14:29:17 +11:00
Bastien Montagne
b63442e0b6 Minor cleanup for own recent commits. 2017-11-23 22:43:11 +01:00
Bastien Montagne
43ddf0e9a7 Getting rid of OMP: first usage of new parallel BMesh items iteration instead.
`BM_mesh_normals_update` was converted from OMP to new parallel iterator code,
basic test with heavily subdivided cube (24.5k faces) gives:
    - old OMP code: average 10ms per run.
    - new BLI_task code: average 6ms per run.

So new code seems to be easily 40% quicker, in addition to getting rid of OMP. ;)

Reviewers: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D2930
2017-11-23 21:21:32 +01:00
Bastien Montagne
bc3f0cfd14 BMesh: add limited support for parallelization over some basic iterators.
This merely uses new memloop/task looper over vertex/edge/face mempools.

Quite obviously, only BM_VERTS/EDGES/FACES_OF_MESH iterators are
supported.
2017-11-23 21:19:54 +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
Bastien Montagne
b84e6dfee4 Add ability to use more than one mempool iterator simultaneously.
This will allow threaded tasks to 'consume' all mempool items in
parallel tasks, each one working on a whole chunk at once (to reduce
concurrency managing overhead).
2017-11-23 21:12:00 +01:00
Bastien Montagne
d423e66d34 Add non-gcc variant of static assert macro.
Adapted from http://www.pixelbeat.org/programming/gcc/static_assert.html.

Note that this macro just discards error message, so error when building
is much less nice than with gcc's _Static_assert... But error log will
point to right place in code, so should still be OK.
2017-11-23 20:25:55 +01:00
Brecht Van Lommel
5e13097dc3 Fix T53145: bevel tool fails when used a second time.
Pixel size was not initial early enough. For first time this was not a problem
because the bevel amount starts at 0 then, and after the mouse moves the pixel
size is initialized. For the second time the bevel amount starts at a non-zero
value, and it failed then.
2017-11-23 20:17:31 +01:00
Brecht Van Lommel
56da112ae0 Fix T53360: crash with GLSL bump mapping and missing group output node. 2017-11-23 18:12:32 +01:00
Brecht Van Lommel
f218e6d4da Fix T53276: encoding output quality UI clarification. 2017-11-23 17:55:25 +01:00
Brecht Van Lommel
dd04f54e84 Fix inaccuracy when storing material ID pass in half float multilayer EXR.
These and other non-RGB passes should always be stored as full float, the
precision loss is too unpredictable.

Related to T53381, but that one is about file output nodes where we don't
know the type of data being saved currently.
2017-11-23 17:14:04 +01:00
Brecht Van Lommel
e50ed90e4d Fix T53348: Cycles difference between gradient texture on CPU and GPU. 2017-11-23 17:14:04 +01:00
Bastien Montagne
580b34e52b atomic_ops: add char versions of uint8_t atomic primitives. 2017-11-23 16:24:34 +01:00
Bastien Montagne
497e2b3dfa Cleanup: use signed atomic ops when needed. 2017-11-23 16:24:34 +01:00
Sergey Sharybin
75a87abdc9 Depsgraph: Cleanup, deduplicate code around component registration 2017-11-23 15:23:19 +01:00
Sergey Sharybin
f2842ac65e Depsgraph: Cleanup, split build_object() a bit 2017-11-23 12:01:31 +01:00
Sergey Sharybin
f3fa5c1258 Depsgraph: Cleanup, always call full object 2017-11-23 11:39:28 +01:00
Campbell Barton
434ed96dd2 Revert "BLI_utildefines: Support SWAP macro with two args"
This reverts commit d749320e3b.

It's possible the container struct is larger,
we could do sizeof checks that falls back to memmove
but rather avoid complicating things.
2017-11-23 15:21:50 +11:00
Campbell Barton
3bec70ca60 Use custom SWAP macro for swapping userdef data
Avoids complicating the common case
2017-11-23 15:18:22 +11:00
Campbell Barton
326efb4319 Fix T53274: Saving template prefs overwrites default prefs 2017-11-23 03:12:00 +11:00
Campbell Barton
d749320e3b BLI_utildefines: Support SWAP macro with two args 2017-11-23 03:11:48 +11:00
Campbell Barton
69b5165902 WM: minor correction to user-pref writing
When saving templates had wrong return value.
2017-11-22 17:11:03 +11:00
Bastien Montagne
5f4058ddbc Removing OMP: get rid of usages in /bmesh/ area.
Just removing it, such cases are not bottlenecks and not worth the
complication of doing real threading with own BLI_task.

Other (remaining) usages may be relevant, need case-by-case check.
2017-11-21 22:25:22 +01:00
Bastien Montagne
7770c2ef87 Removing OMP: get rid of last bit in /editors/ area.
Just removing it, such cases are not bottlenecks and not worth the
complication of doing real threading with own BLI_task.
2017-11-21 22:25:22 +01:00
Sergey Sharybin
6c372530b4 Cleanup: We do not use camel case in Blender code
At least not for variables.
2017-11-21 17:34:44 +01:00
Sergey Sharybin
6785a2bd66 Fix T53371: Keying Node fails with values above 1
This was expected behavior for over-exposured lamps when the mode was originally
created for Tears of Steel. Turns out, there could be really bad green screen in
real production which will only have green (or rather screen) channel over
exposured.

Tweaked condition now so we use least bright channel to see if the area has
proper exposure or not.

Seems to work fine in tests, but further tweaks are possible.
2017-11-21 17:31:45 +01:00
Campbell Barton
175e8fdc1e Disable adding scene sequence strips into themselves
D2923 by @spockTheGray w/ edits, see T52586 for details
2017-11-21 16:46:27 +11:00
Campbell Barton
a591bd203e Cleanup: redundant ELEM use 2017-11-21 16:15:19 +11:00
Brecht Van Lommel
96415cb52a Code cleanup: fix harmless compiler warning. 2017-11-20 23:32:06 +01:00
Bastien Montagne
f34e03d34d Fix (unreported) Crash: broken RNA accessors to tesselated MCol data.
Regression from rB823bcf1689a3 (VPaint 2017 GSoC, this is not in 2.79 release).

Also cleanup, using fake-array-ification to access struct members is
generally not a great idea, but when we already have a totally confusing
broken struct layout, this is pure evil, as demonstrated here!

Found while investigating T53341.
2017-11-20 10:16:50 +01:00
Campbell Barton
65af15ad88 UV Cube Project: improve default behavior
- initialize the cube-size from the bounding box when it's not set.
- no longer wrap faces to keep in 0-1 bounds,
  other projection methods don't do this and calculating the scale
  prevents the UV's from being too far outside the view.
2017-11-20 19:51:19 +11:00
Campbell Barton
ed3b7a5cd4 Fix T53342: Outliner 'select hierarchy' broken
Was using cursor position from within menu,
clicking on the same position for every selected item (toggling).

Now operate on each selected outliner element, without toggling.
2017-11-20 16:02:37 +11:00
Bastien Montagne
784614655f Fix T53343: Custom Normal Data Transfer Crashes when some vertexes have no faces.
Odd nobody noticed this earlier, was obvious bug in code logic here... :/

To be backported to 2.79a.
2017-11-19 20:43:59 +01:00
Campbell Barton
0a69e3b307 Option not to select with un-hide
D1518 from @mba105 w/ edits
2017-11-20 02:28:07 +11:00
Campbell Barton
92ea281017 Cleanup: remove BKE_utildefines
This was meant to be used for less general macros but was never used.

Rename BKE_BIT_TEST_SET to SET_FLAG_FROM_TEST
2017-11-20 01:47:31 +11:00
Joshua Leung
d2b03d2364 Fix: Undo pushes were missing for Add/Remove Driver Variable buttons, and Remove Driver button 2017-11-20 03:06:13 +13:00
Joshua Leung
2317fa6dcc Cleanup - Style 2017-11-20 02:56:40 +13:00
Joshua Leung
6f578740ef Fix T53300: Bone Extrude via Ctrl + Click is not done from active bone tail 2017-11-20 02:55:17 +13:00
Joshua Leung
e2585c2342 Fix compiler warning
--> render_result.c:832 - formal parameter 6 different from declaration
2017-11-20 02:08:55 +13:00
Joshua Leung
cc1253a5d9 Fix: "Lock Markers" option was not being obeyed by the "Sync Markers (when transforming)" option 2017-11-20 01:57:22 +13:00
Joshua Leung
c5f59f5854 Tweaks to make it easier to update bone motion paths (without the active bone needing to have any paths itself)
This commit introduces the following changes:
* Modified the poll callback on the "Update Paths" operator for bones
  so that it only checks if there are bones that have motion paths
  (instead of checking whether the active bone has paths).

  This makes it easier to update paths without having to first select one
  that has them - useful when the paths are all on hidden/hard-to-select bones.

* Add a readonly property, "has_motion_paths" to the animviz.motion_path
  RNA struct, providing easier access to the internal flag used above.
  This makes it possible for the UI to display the "Update" button without
  having to check various bones for motion paths.


Notes:
* The flag being used in these changes already existed, and was only really
  intended for internal use. However, since it was already used in many places
  for determining if auto-update of all bone paths was needed (e.g. after certain
  editing ops), it should be safe to use here too.

* The update_paths operator currently bakes all paths when activated, so there's
  currently no loss of functionality with changing to not checking if the active
  bone has any paths (e.g. we couldn't only update the active bone only either).
  That is still listed as a todo in the code.
2017-11-20 01:57:21 +13:00
Joshua Leung
c01ffefb68 Pasting poses now updates motion paths 2017-11-20 01:57:20 +13:00
Joshua Leung
cda05639df Fix T53229: "Sample Keyframes" errors with multiple pairs of keyframes selected
There were 2 issues here (first was the one reported):
1) Curve shape changes if multiple consecutive pairs of keyframes
   are selected. The problem is that after the first pair is handled,
   subsequent pairs get sampled on the basis of the modified curve.

2) With multiple separate "islands" selected, unselected points in between
   would get ignored, causing the entire curve to get sampled.
2017-11-20 01:57:20 +13:00
Julian Eisel
3133d2d58c Swap priority of system path overrides for dev builds
Suggested by Campbell, thanks!

Also moved the exception into own function and improved comments.

Fixes T53008.
2017-11-19 13:13:37 +01:00
Campbell Barton
a151b46627 Fix T53347: Vertex paint crash on undo/exit 2017-11-19 16:45:27 +11:00
Campbell Barton
83e4e65074 Cleanup: outdated comment 2017-11-19 03:25:52 +11:00
Campbell Barton
40c8a18229 Cleanup: style 2017-11-18 17:22:54 +11:00