Commit Graph

65984 Commits

Author SHA1 Message Date
Kévin Dietrich
8a1b38f071 Cleanup: avoid using G.main. 2016-10-28 18:26:34 +02:00
Kévin Dietrich
216dec7eb1 Alembic Export: set start and end frame to that of the scene for
convenience.

Users will most likely export an entire animation rather than a single
frame, so it can save a few clicks.
2016-10-28 18:21:43 +02:00
Kévin Dietrich
65c481e145 CacheFile: fix missing depsgraph update. 2016-10-28 18:08:31 +02:00
Kévin Dietrich
194a33ff00 CacheFile: only enable scale property slider if we are editing the cache
through a constraint.

It doesn't make sense and is a bit confusing to have this property
enabled in the modifier context.
2016-10-28 18:08:30 +02:00
Nathan Letwory
03b8531cea Compile fix for Windows.
__inline instead of inline is needed.
2016-10-28 11:54:01 +03:00
Bastien Montagne
216a3a3826 Fix T49743: Adding torus in edit mode local mode shows error
The 'local' layers were not correctly set when redoing 'add object'
addons using object_utils.py helper (we always want to restore layers
from view in local view, even if we set 'real' layers from operator
afterwards).
2016-10-27 13:23:29 +02:00
Bastien Montagne
5f0933f07a Fix T49829: Removal of custom icon previews during add-on unregister crashes Blender.
Issue was happening when removal of custom icons was done while they
were still being rendered by preview job.

Now add a 'deffered deletion' system, to prevent main thread to delete
preview image until loading thread is done with them.

Note that ideally, calling `ED_preview_kill_jobs()` on custom icon
removal would have been simpler, but we don't have easy access to
context here...
2016-10-27 13:06:14 +02:00
Sergey Sharybin
f11298692b Cycles: More workarounds for weird crashes on AVX2
Oh man, is it a compiler bug? Is it something we do stupid?

For now more crap to prevent crashes. During the conference will talk to
Maxyn about how can we troubleshoot such weird issues.
2016-10-27 12:51:03 +02:00
Sergey Sharybin
7e380ad4c0 Cycles: Another attempt to fix crashes on AVX2 processors
Basically don't use rcp() in areas which seems to be critical after
second look. Also disabled some multiplication operators, not sure
yet why they might be a problem.

Tomorrow will be setting up a full test with all cases which were
buggy in our farm to see if this fix is complete.
2016-10-26 22:14:41 +02:00
Sergey Sharybin
de22e55291 Cycles: Fix compilation error of AVX2 kernel without SSE math 2016-10-26 20:49:33 +02:00
Sergey Sharybin
35f152358b Cycles: Completely disable transform SSE for now
Was causing issues on another frame.

On a tight schedule, disabling for now so artists are happy.

Still looking into root of the issue!
2016-10-26 15:23:58 +02:00
Sergey Sharybin
7c7d23691f Cycles: Fix crashes after recent optimization commits
There is some precision issues for big magnitude coordinates which started
to give weird behavior of release builds. Some weird memory usage in BVH
which is tricky to nail down because only happens in release builds and GDB
reports all variables as optimized out when trying to use RelWithDebInfo.

There are two things in this commit:

- Attempt to make vectorized code closer to original one, hoping that it'll
  eliminate precision issue.
  This seems to work for transform_point().
- Similar trick did not work for transform_direction() even tho absolute
  error here is much smaller. For now disabled that function, need a more
  careful look here.
2016-10-26 14:30:25 +02:00
Campbell Barton
72921a1e43 RangeTree API rewrite
Rewrite the current range-tree API used by dyn-topo undo
to avoid inefficiencies from stdc++'s set use.

- every call to `take_any` (called for all verts & faces)
  removed and added to the set.
- further range adjustment also took 2x btree edits.

This patch inlines a btree which is modified in-place,
so common resizing operations don't need to perform a remove & insert.
Ranges are stored in a list so `take_any` can access the first item
without a btree lookup.

Since range-tree isn't a bottleneck in sculpting, this only gives minor speedups.
Measured approx ~15% overall faster calculation for sculpting,
although this number time doesn't include GPU updates and depends on how
much edits fragment the range-tree.
2016-10-26 23:33:41 +11:00
Campbell Barton
44522a5b98 BLI_bitmap_draw_2d: optimize polygon filling
Existing method was fine for basic polygons but didn't scale well
because its was checking all coordinates for every y-pixel.

Heres an optimized version.
Basic logic remains the same this just maintains an ordered list of intersections,
tracking in-out points, to avoid re-computing every row,
this means sorting is only done once when out of order segments are found,
the segments only need to be re-ordered if they cross each other.

Speedup isn't linear, test with full-screen complex lasso gave 11x speedup.
2016-10-26 23:24:58 +11:00
Campbell Barton
8125271ddb Cleanup: rename functions in BLI_bitmap_draw_2d 2016-10-26 23:24:19 +11:00
Campbell Barton
3e36cbb3de Cleanup: move bitmap drawing into its own module
Bitmap drawing is out-of-scope for a general math API,
move to BLI_bitmap_draw_2d.
2016-10-26 20:11:09 +11:00
Campbell Barton
a1f137767f BMesh: edge-net split, edge selection error
In practice I couldn't make this cause a bug,
however it's a logical regression in fix for T48716.

Thanks to Francesc Juhe for finding.
2016-10-26 14:18:44 +11:00
lazydodo
bc71c2bf08 [msvc] make.bat - create a build.log in the build directory 2016-10-25 11:49:08 -06:00
Sergey Sharybin
f523fb43f9 Cycles: Fix for fix (tm)
Sorry guys, for some reason read the expression back-to-front
and did wrong fix :S
2016-10-25 18:29:13 +02:00
Sergey Sharybin
5c4113a3e4 Cycles: Fix typo in previous commit for BVH improvements 2016-10-25 18:06:38 +02:00
Bastien Montagne
a39ab9cfde Fix T49815: Blender always reverts to RGBA when using Save As Image.
`BKE_imformat_defaults()` was doing some weird black magic based on
imbuf's channels, instead of merely copying imbuf's planes here...
2016-10-25 17:59:45 +02:00
Aaron Carlisle
cf9a6b416c API: Fix Links
Self-explanatory. to find broken links run `sphinx-build -b linkcheck sphinx-in sphinx-out`

Reviewers: mont29

Tags: #bf_blender, #python, #infrastructure:_websites

Differential Revision: https://developer.blender.org/D2297
2016-10-25 17:34:01 +02:00
Sergey Sharybin
42a91f7ad8 Partial fix for T49836: Camera DOF properties not updating via graph editor
Do this for the new dependency graph: was missing handle of OB_UPDATE_TIME in tag update.

Hopefully it's all correct still.

Old dependency graph needs work, but i'm tempting to call it unsupported and move on
to 2.8 branch.
2016-10-25 16:53:13 +02:00
Sergey Sharybin
c54381488b Cycles: Enable SSE math optimization for AVX kernels
This gives about 5% speedup for AVX processors.

Benefit of such optimization on other microarchitectures is still
under investigation.
2016-10-25 16:10:47 +02:00
Sergey Sharybin
8c761ff838 Cycles: Use new SSE version of offset calculation for all QBVH flavors
Gives up to ~1% speedup again.

While it seems to be small, still nice since the code now is actually more
clean that it used to be before.
2016-10-25 15:27:50 +02:00
Sergey Sharybin
f7cf2f659a Cycles: Move QBVH near/far offset calculation to an utility function
Just preparing for new optimization to be used in all traversal implementation.

Should be no measurable difference.
2016-10-25 15:08:33 +02:00
Sergey Sharybin
064caae7b2 Cycles: BVH-related SSE optimization
Several ideas here:

- Optimize calculation of near_{x,y,z} in a way that does not require
  3 if() statements per update, which avoids negative effect of wrong
  branch prediction.

- Optimization of direction clamping for BVH.

- Optimization of point/direction transform.

Brings ~1.5% speedup again depending on a scene (unfortunately, this
speedup can't be sum across all previous commits because speedup of
each of the changes varies from scene to scene, but it still seems to
be nice solid speedup of few percent on Linux and bigger speedup was
reported on Windows).

Once again ,thanks Maxym for inspiration!

Still TODO: We have multiple places where we need to calculate near
x,y,z indices in BVH, for now it's only done for main BVH traversal.
Will try to move this calculation to an utility function and see if
that can be easily re-used across all the BVH flavors.
2016-10-25 14:47:34 +02:00
Sergey Sharybin
81c9e0d295 Cycles: Avoid branching in SSE version of intersection pre-calculation
Similar to the previous commit, avoid negative effect of bad branch prediction.

Gives measurable performance up to ~2% in tests here.

Once again, thanks to Maxym Dmytrychenko!
2016-10-25 14:18:32 +02:00
Sergey Sharybin
af411d918e Cycles: Implement SSE-optimized path of util_max_axis()
The idea here is to avoid if statements which could cause wrong
branch prediction.

Gives a bit of measurable speedup up to ~1%. Still nice :)

Inspired by Maxym Dmytrychenko, thanks!
2016-10-25 13:54:17 +02:00
Sergey Sharybin
3e71006448 CMake: Followup to previous commit, try to ensure -ldl is always last
Seems CMake will rearrange and copy libraries which are passed to the linker
when some of the libraries is listed twice (for example, -lz from png libraries
and -l for blender itself). This was causing libopenimageio to be added somewhere
at the end of linking flags without -ldl followed after which was causing linking
issues.
2016-10-25 10:22:03 +02:00
Sergey Sharybin
d2fe875f8c Fix possible compilation error with OIIO enabled
OIIO library has plugin API which uses dlopen()/dlclose() so need to
link OIO libraries against dl library.
2016-10-25 09:28:25 +02:00
Sergey Sharybin
10a25b655a Cycles: Add AVX2 path to subsurface triangle intersection
Similar to regular triangle intersection case. Gives about 3% speedup rendering
SSS object on my desktop,

Question: how to avoid such a code duplication in a nice way without speed loss?
2016-10-24 16:56:41 +02:00
Sergey Sharybin
da8f5d6eac Cycles: Don't use guarded vector for statically initialized data
This will confuse hell of a guarded allocators because it is possible
to have allocation happened prior to Blender's guarded allocator is
fully initialized.

This was causing crashes and assert failures when running blender
with fully guarded memory allocator.
2016-10-24 14:18:22 +02:00
Sergey Sharybin
14a55bc059 Cycles: Fix shadowing variable which also causes use of uninitialized variable
Was causing wrong aperture for panorama cameras.

Seems to be a regression in 371d357.
2016-10-24 14:04:31 +02:00
Sergey Sharybin
cde18cf3b3 Cycles: Fix static initialization order fiasco
Initialization order of global stats and node types was not strictly
defined and it was possible to have node types initialized first and
stats after that. This will zero out memory which was allocated from
the statistics causing assert failure when de-initializing node types.
2016-10-24 13:47:39 +02:00
Sergey Sharybin
963aa7e270 Cycles: Fix uninitialized variable from the previous commit 2016-10-24 12:54:24 +02:00
Sergey Sharybin
80a6e5beb5 Cycles: Remove explicit std:: from types where possible
We have our own abstraction level on top of the STL's implementation.
This commit will guarantee our tweaks are used for all cases.
2016-10-24 12:31:11 +02:00
Sergey Sharybin
48997d2e40 Cycles: Cleanup, style 2016-10-24 12:26:12 +02:00
Sergey Sharybin
3f29259676 Fix T49818: Crash when rendering with motion blur
It was possible to have non-initialized unaligned BVH split
to be used when regular BVH split SAH was inf. Now we ensure
that unaligned splitter is only used when it's really initialized.

It's a regression and should be in 2.78a.
2016-10-24 11:47:32 +02:00
Sergey Sharybin
1e1811357d Cycles: Cleanup, spaces 2016-10-24 11:47:32 +02:00
Bastien Montagne
0b749d57ee Fix unlikely uninitialized pointer usage.
Reported by Coverity.
2016-10-24 10:25:58 +02:00
Sergey Sharybin
89a3b17853 Fix T49827L Crash linking material while in Material viewport shading mode
Material linking might and does change the way how drawObject is calculated
but does not tag drawObject for recalculation in any way.

Now use dependency graph to tag draw object for reclaculation. Currently do
this using OB_RECALC_DATA taq since tagging is not very granular yet. In the
future we can introduce ore granular tagging in the new dependency graph
easily.

Simple and safe for 2.78a.
2016-10-24 10:13:22 +02:00
Bastien Montagne
c013280eec Fix mistake in BKE_mesh_new_from_object handling of materials in MetaBall case.
Typo, spoted by Coverity scan.

To be backported to 2.78a.
2016-10-24 10:06:00 +02:00
Aaron Carlisle
1d13950ae5 API doc: enable 'split index' option. 2016-10-23 17:48:31 +02:00
Quentin Wenger
e0a34e963f Displace modifier: add global/local space option for X/Y/Z/XYZ directions.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2309
2016-10-23 14:35:46 +02:00
Bastien Montagne
35fde5ff7d System info: make it more resiliant to errors.
Using context manager for output file itself, and whole try/except block
to at least catch and print error in file.

Also some minor tweaks to previous 'list add-ons' commit.
2016-10-23 13:12:58 +02:00
Bastien Montagne
5d2620e9c2 System info: also report enabled add-ons.
Based on idea & patch by @lijenstina over IRC (iirc :/ ).
2016-10-23 13:05:47 +02:00
Aaron Carlisle
672e906d49 Add a built-in sphinx extension to allow cross-linking to the blender manual.
This works by downloading the objects.inv file (https://www.blender.org/manual/objects.inv)
and using it to resolve links with blender-manual: before them.
2016-10-23 11:15:52 +02:00
Hristo Gueorguiev
8905c5c874 Cycles: OpenCL 3d textures support.
Note that volume rendering is not supported yet, this is a step towards that.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2299
2016-10-22 23:49:29 +02:00
371d3570e0 Fix Cycles address space OpenCL error after recent fix. 2016-10-22 23:36:30 +02:00