Commit Graph

53559 Commits

Author SHA1 Message Date
Sergey Sharybin
ed2ddc9f70 Support multiple distortion models, including a new division model
This commit makes it so CameraIntrinsics is no longer hardcoded
to use the traditional polynomial radial distortion model. Currently
the distortion code has generic logic which is shared between
different distortion models, but had no other models until now.

This moves everything specific to the polynomial radial distortion
to a subclass PolynomialDistortionCameraIntrinsics(), and adds a
new division distortion model suitable for cameras such as the
GoPro which have much stronger distortion due to their fisheye lens.

This also cleans up the internal API of CameraIntrinsics to make
it easier to understand and reduces old C-style code.

New distortion model is available in the Lens panel of MCE.

- Polynomial is the old well-known model
- Division is the new one which s intended to deal better with huge
  distortion.

Coefficients of this model works independent from each other
and for division model one probably want to have positive values
to have a barrel distortion.
2014-04-17 17:28:41 +06:00
39bfde674c Cycles CUDA: don't use cuLaunchGridAsync at all for display devices.
As suggested by Martijn, this is slower than cuLaunchGrid.
2014-04-17 12:18:49 +02:00
18da79f471 Cycles CUDA: only do async execution for GPUs not used for display.
Otherwise devices used for display will lock up the UI too much. This means
you might still get 100% CPU for the display device, but for others CPU usage
should be low still.

The check to see if a device is used for display may not be entirely reliable,
it checks if there is a watchdog timeout on the device, but I'm not entirely
sure that always exists for display devices or is disabled for non-display
devices, though some tools like cuda-gdb seem to make the same assumption.

Ref T39559
2014-04-17 12:08:18 +02:00
Sergey Sharybin
ad2064ae88 Fix compilation error of Freestyle
Seems to be some sort of namespace conflict or so which is
solved by reshuffling the includes a bit.
2014-04-17 16:04:47 +06:00
Campbell Barton
a1cab0d38d Style cleanup 2014-04-17 20:03:39 +10:00
Campbell Barton
1c0b6c4f30 Code cleanup: use bools for DM 2014-04-17 20:03:39 +10:00
Campbell Barton
ef365aaa37 Fix error in last commit 2014-04-17 20:02:56 +10:00
Bastien Montagne
88ae0be1c4 Fix T39758: Blender Crash when removing pinned Scene. 2014-04-17 10:48:32 +02:00
Bastien Montagne
bd3231c760 Fix T39766: bone calculation from edit mode goes wrong
Own logic error in previous commit...
2014-04-17 10:20:19 +02:00
Campbell Barton
55c9b352c2 Fix mistake in recent DM material changes 2014-04-17 18:05:57 +10:00
Campbell Barton
3e3efae7e9 Viewport Text Drawing: replace single allocs with a memarena
- pass label strlen since in many cases its already known.
- use single linked list for cached text drawing.
- add BLI_link_utils.h for single linked list macros.

own tests give approx 22% overall speedup.
2014-04-17 16:04:28 +10:00
Campbell Barton
1b9db9911d Code cleanup: use bools
also rename BLI_omp_thread_count -> BLI_system_thread_count_omp
2014-04-17 16:04:28 +10:00
Tamito Kajiyama
4219e44f1d Freestyle: removed unnecessary #include "FreestyleConfig.h". 2014-04-17 14:37:14 +09:00
Tamito Kajiyama
1674a04488 Freestyle: removed unused *_EXPORT qualifiers for building Windows DLLs.
These qualifiers were leftovers of the stand alone Freestyle program and not used
(set to an empty string) in Blender for years.
2014-04-17 14:37:13 +09:00
Tamito Kajiyama
62258d9f30 Fix for missing changes in commit 6b0b6f876a4d68acd5c9252270a5135d0308d782. 2014-04-17 14:37:12 +09:00
Tamito Kajiyama
68aea619f5 Replaced assert() with BLI_assert(). 2014-04-17 14:37:11 +09:00
Tamito Kajiyama
3458bad12d Freestyle: removed unnecessary #include files and made minor code cleanup. 2014-04-17 14:37:10 +09:00
Tamito Kajiyama
01a4a09f29 Freestyle: Fix for VC++ warnings about 'hypot' macro redefinitions (Part 4).
(See commit e1771e72fbbf828dbf5bed871b814288389f3611 for more detail of
the problem).

Fix for a C++ scope issue caused by 'using namespace Freestyle' that was assumed
even within the Freestyle namespace definition.
2014-04-17 14:37:09 +09:00
Tamito Kajiyama
77b37fa461 Freestyle: Fix for VC++ warnings about 'hypot' macro redefinitions (Part 3).
(See commit e1771e72fbbf828dbf5bed871b814288389f3611 for more detail of
the problem).

Made changes to intern/view_map/Interface0D.h and intern/python/Director.h to
avoid #include <Python.h> and keep non-Python header files independent of it.
2014-04-17 14:37:08 +09:00
Tamito Kajiyama
5d4a6a94ef Freestyle: Fix for VC++ warnings about 'hypot' macro redefinitions (Part 2).
(See commit e1771e72fbbf828dbf5bed871b814288389f3611 for more detail of
the problem).

Fixed for #include <Python.h> not properly put in the extern "C" { ... } construct.

Also removed redundant inclusion of the header file in the Freestyle Python API code.
2014-04-17 14:37:07 +09:00
Tamito Kajiyama
5db8da8105 Freestyle: Fix for VC++ warnings about 'hypot' macro redefinitions (Part 1).
The issue was caused by including both Python.h and BLI_math.h.  Since the macro
definition in Python.h was unconditional, it was necessary to include it first and then
BLI_math.h.

Addressing the issue turned out to affect many Freestyle source files.  There were several
other coding flaws that complicated the situation:

1. intern/system/FreestyleConfig.h was abused just to include BLI_math.h which was in
fact unnecessary in FreestyleConfig.h.  While addressing this, inclusion of both math.h
and BLI_math.h had to be duly dealt with to avoid a compiler error about round().

2. #include <Python.h> was not properly put in the extern "C" { ... } construct.

3. intern/view_map/Interface0D.h and intern/python/Director.h, both of which included
Python.h, were included from within Freestyle header files that were almost or completely
independent of Python.  These non-Python header files were used everywhere in the
Freestyle code base, causing many cases of the reported macro redefinitions.

4. The Director.h file was also declaring 'using namespace Freestyle', which was causing
another scope issue in several Freestyle header files.

This commit is intended to address the first problem above.  Subsequent commits will deal
with the other three.
2014-04-17 14:37:05 +09:00
Campbell Barton
ba61992cc3 Fix T39767: Parent in Mask mode crashes 2014-04-17 13:23:53 +10:00
Joshua Leung
64f3774d62 Fix T39768: GLOBAL_X/Y/Z don't exist for bpy.ops.armature.calculate_roll type enum 2014-04-17 15:02:23 +12:00
Jorge Bernal
a5b9f22454 BGE - button for deactivate sensors, controllers and actuators
This change introduces a new checkbox to deactivate the sensors, controllers and/or actuators. It is useful during the development phase to avoid delete sensors, controllers or actuators if you want to test something new.

NOC: The wiki page is being updated (the images mostly), but the feature is already in the 2.71 release log.

{F61628}

Reviewers: moguri, dfelinto, campbellbarton, dingto, #user_interface, billrey

Reviewed By: moguri

CC: billrey

Differential Revision: https://developer.blender.org/D16
2014-04-16 22:40:07 -03:00
Jens Verwiebe
8a4210074c Bullet: better workaround for failing friction with clang 3.4, remove the obsolete compileflag magic 2014-04-17 00:25:25 +02:00
415e10a0ef Fix another compile error with recent commit on visual studio. 2014-04-16 21:36:19 +02:00
fd99b8d4cf Fix for scons/CUDA build after recent commit. 2014-04-16 21:23:37 +02:00
6f1afdbbfc Cycles CUDA: enabled branched path kernel again, with more registers. 2014-04-16 21:05:04 +02:00
2851ed4a55 Cycles code refactor: use __launch_bounds__ instead of -maxrregcount for CUDA.
This makes it easier to have per kernel number of registers. Also, all the
tunable parameters for this are now in kernel.cu, rather than spread over cmake,
scons and device_cuda.cpp.
2014-04-16 21:05:04 +02:00
Howard Trickey
f2f3ef8692 Fix Knife bug T39617: midpoint snap should affect intermediate points.
This reverts to the 2.69 behavior, where the snap-to-midpoint option
affected the intermediate crossed edges as well as the endpoints.
2014-04-16 14:19:36 -04:00
Campbell Barton
53fd22acb4 Fix T39756: Extrude, immediate scale
While not exactly a bug, switching to scale isnt generally useful to keep normal constraint.
2014-04-17 04:02:42 +10:00
Campbell Barton
e6cdce725c Code cleanup: use bools & const args 2014-04-17 02:53:34 +10:00
Bastien Montagne
ee387c6add Fix T39750: Bones disappearing with strange transforms.
Fixed this issue and another similar one, and some minor optimizations.
2014-04-16 18:20:27 +02:00
Bastien Montagne
a7120b9730 Fix related to new split normals draw code.
Tessellated split normals CDlayer had no swap func, hence ugly little test_index_face()
could not rotate its values correctly when rotating tessellated faces...

Extra-reported in T39735.
2014-04-16 16:54:23 +02:00
eecc426d86 Fix cycles standalone file saving not taking number of samples into account properly. 2014-04-16 15:28:24 +02:00
Bastien Montagne
7d45ddae33 Add Edge sharp/smooth to 3DView shading panel, as well as new Vert sharp/smooth. 2014-04-16 15:26:48 +02:00
Campbell Barton
d1b1d194dc Fix for half pixel offset rasterizing masks 2014-04-16 23:25:10 +10:00
Campbell Barton
b3972aeea0 Math Lib: optimize axis_dominant_v3_to_m3, approx 6x speedup
build the matrix directly rather then calculating with axis/angle

also remove unused function calc_poly_plane
2014-04-16 21:07:28 +10:00
Campbell Barton
233dac1494 Math Lib: increase epsilon for ortho_basis_v3v3_v3
passing in a unit length vector wouldn't always compute unit length vectors because the epsilon tested was too small.
2014-04-16 21:07:28 +10:00
Mitchell Stokes
d050577176 Fix T39445: Async LibLoad Crash
There was some deadlock due to trying manage Python's GIL. Instead of
continuing to fight with it, anything needing to call into Python while
conversion during lib loading is just delayed until it can be done in
the main thread.
2014-04-16 01:15:40 -07:00
Campbell Barton
4769b44bdd Fix T39745: "Origin to geometry" not working with Text objects. (regression) 2014-04-16 13:19:31 +10:00
Daniel Stokes
70f089b6f5 Fix T39509: Crash when assign an empty as a LoD
Missing check when looking for appropriate LoD
2014-04-15 20:06:56 +00:00
Antony Riakiotakis
556590fa3a Dyntopo:
Store PBVH node ID in CustomData. This avoids a number of hash deletions
and checks/insertions on big hashes.
2014-04-16 05:31:02 +03:00
Antony Riakiotakis
b179647d52 Dyntopo: slightly change node invalidation, only vertices can change BB
recalculation, only faces can change normal invalidation.
2014-04-16 02:10:24 +03:00
Jörg Müller
9351e872f5 Fix T39607: Audio not in synch when the blend file loads.
The problem here was that animation buffers got initialized with zeros in the beginning for unknown parts. Now it gets initialized with the first known value.
The bug's result was that the animation of the pitch started with 0 on first playback and thus any seeking while the pitch is zero resulted in seeking to the beginning.
2014-04-15 19:19:56 +02:00
Antony Riakiotakis
5d189069a4 Fix regression, sculpting on mesh with matcaps (without multires/ 2014-04-15 20:12:51 +03:00
Campbell Barton
cf01f2c760 Building with C++ guarded alloc works again 2014-04-16 02:24:21 +10:00
Campbell Barton
5c4bb81e49 Fix T39685: triangulation modifier creates zero-area faces 2014-04-16 02:24:21 +10:00
Joshua Leung
43b7dac427 Use binary search threshold when deciding whether to create ActKeyColumns too... 2014-04-16 03:23:53 +12:00
Joshua Leung
d2a5ddb4ec Optimisations for building "Long Keyframes"
For a long time, one of the bottlenecks when drawing summary channels in the dopesheet
(especially with many objects) was how the long keyframes feature (i.e showing holds
between keyframes) got built. Specifically, it was the step where we check on the previous
keyframe to see whether there's a hold between those two.

The old code performed some elaborate checks, which made sense back when we used to handle
certain summary channels (e.g. object-action/ipo, and groups IIRC) differently. However,
nowadays, everything just does it by going over the FCurves one by one, so the offending
code wasn't really providing much benefit. Unless I've forgotten some other reason why
that old method is necessary, this commit should provide a decent speedup here, making
things somewhat interactive now (if still a bit jerky).

Other Tweaks:
1) Introduced float-precision threshold when checking to see whether an existing long
   keyframe could be reused. This should hopefully reduce the number of fp-jitter issues
   when creating summaries for many channels, reducing the number of duplicates created.
2) Precompute colours used for shading the long keyframes, instead of recomputing for
   each block.
2014-04-16 03:23:52 +12:00