6 years agoQuite compiler warnings.
Tamito Kajiyama [Fri, 18 Apr 2014 00:25:36 +0000 (09:25 +0900)]
Quite compiler warnings.

6 years agoFreestyle: Fix ImportError in
IRIE Shinsuke [Thu, 17 Apr 2014 23:48:03 +0000 (08:48 +0900)]
Freestyle: Fix ImportError in

6 years agoCycles Standalone: Use progressive refine in background mode too.
Thomas Dinges [Thu, 17 Apr 2014 21:16:12 +0000 (23:16 +0200)]
Cycles Standalone: Use progressive refine in background mode too.

This is only a workaround, with tiled rendering the image output has a wrong aspect ratio. (squashed image)

6 years agoDyntopo: Solve issue with test file by Jens.
Antony Riakiotakis [Thu, 17 Apr 2014 21:11:05 +0000 (00:11 +0300)]
Dyntopo: Solve issue with test file by Jens.

Seems like custom data indices can be mangled when many layers are
present in the mesh, so use more strict calculation of offset (copied
over from BM_CD_LAYER_ID).

I was under the impression that all custom data would be deleted on
entering dyntopo, it seems this is not the case though.

6 years agoMake sure we invalidate the node ID layer each time the PBVH is reset.
Antony Riakiotakis [Thu, 17 Apr 2014 17:53:20 +0000 (20:53 +0300)]
Make sure we invalidate the node ID layer each time the PBVH is reset.

It makes code more tidy (avoids having to call invalidation on a myriad
places). Also makes sure other invalidation cases (some mesh change,
e.g.) work as expected.

6 years agoRe-bundle Libmv to be sure it's all fine
Sergey Sharybin [Thu, 17 Apr 2014 17:31:57 +0000 (23:31 +0600)]
Re-bundle Libmv to be sure it's all fine

6 years agoFix for 771a9dd: libmv build files are automatically generated
Sergey Sharybin [Thu, 17 Apr 2014 16:36:07 +0000 (22:36 +0600)]
Fix for 771a9dd: libmv build files are automatically generated

This means if one makes change to either SConscript or CMakeLists.txt
there he MUST update

Also made it so *.cc files from intern/libmv are matching which would
make it easier to add more .cc files there if needed.

And one more thing is removing 'simple_pipeline/'
which doesn't match any of the files.

6 years agoRevised freestyle.predicates.pyZBP1D so that the constructor accepts an integration...
Tamito Kajiyama [Thu, 17 Apr 2014 16:24:11 +0000 (01:24 +0900)]
Revised freestyle.predicates.pyZBP1D so that the constructor accepts an integration type.

6 years agoBI: cleanup in autosmooth area.
Bastien Montagne [Thu, 17 Apr 2014 14:22:25 +0000 (16:22 +0200)]
BI: cleanup in autosmooth area.

6 years agoOptimize and symmetrize operators missed reset of node layer.
Antony Riakiotakis [Thu, 17 Apr 2014 16:12:05 +0000 (19:12 +0300)]
Optimize and symmetrize operators missed reset of node layer.

6 years agoRefactor to Dyntopo node customdata commit.
Antony Riakiotakis [Thu, 17 Apr 2014 16:02:55 +0000 (19:02 +0300)]
Refactor to Dyntopo node customdata commit.

Don't use a dedicated node layer but use temporary int layer instead.
Works like a charm as long as we are careful resetting the layer when
needed (after pbvh clearing and always after bmesh has been filled in

Tip by Campbell, thanks!

6 years agoRecreating a bmesh log did not account for modified faces.
Antony Riakiotakis [Thu, 17 Apr 2014 15:55:53 +0000 (18:55 +0300)]
Recreating a bmesh log did not account for modified faces.

It shouldn't create issues in practice because modified face ids should
have been reclaimed from an added face on a previous entry, but add for

6 years agoLbmv: fix scons compile after ed2ddc9
Jens Verwiebe [Thu, 17 Apr 2014 15:00:29 +0000 (17:00 +0200)]
Lbmv: fix scons compile after ed2ddc9

6 years agoView3D: use smoothview for localview switching
Campbell Barton [Thu, 17 Apr 2014 12:54:10 +0000 (22:54 +1000)]
View3D: use smoothview for localview switching

6 years agoCode cleanup: use const for array args
Campbell Barton [Thu, 17 Apr 2014 11:14:34 +0000 (21:14 +1000)]
Code cleanup: use const for array args

6 years agoView3D: no need to mask mask out localview for each object
Campbell Barton [Thu, 17 Apr 2014 10:38:21 +0000 (20:38 +1000)]
View3D: no need to mask mask out localview for each object

6 years agoAdd missing node update in dyntopo flood fill.
Antony Riakiotakis [Thu, 17 Apr 2014 13:03:14 +0000 (16:03 +0300)]
Add missing node update in dyntopo flood fill.

6 years agoFix T39765 crash on text with generative modifiers.
Antony Riakiotakis [Thu, 17 Apr 2014 12:58:40 +0000 (15:58 +0300)]
Fix T39765 crash on text with generative modifiers.

6 years agoFix compilation issue.
Antony Riakiotakis [Thu, 17 Apr 2014 12:53:11 +0000 (15:53 +0300)]
Fix compilation issue.

6 years agoFix T39771: Armature Tools and Options Panel appears in other TABs.
Bastien Montagne [Thu, 17 Apr 2014 12:50:06 +0000 (14:50 +0200)]
Fix T39771: Armature Tools and Options Panel appears in other TABs.

6 years agoFix another Freestyle building glitch.
Bastien Montagne [Thu, 17 Apr 2014 12:39:13 +0000 (14:39 +0200)]
Fix another Freestyle building glitch.

6 years agoAttempt to fix one more issue with Freestyle compilation
Sergey Sharybin [Thu, 17 Apr 2014 12:46:19 +0000 (18:46 +0600)]
Attempt to fix one more issue with Freestyle compilation

6 years agoFix crash when enabling undistorted display in MCE
Sergey Sharybin [Thu, 17 Apr 2014 12:01:45 +0000 (18:01 +0600)]
Fix crash when enabling undistorted display in MCE

6 years agoSupport multiple distortion models, including a new division model
Sergey Sharybin [Thu, 20 Feb 2014 13:41:05 +0000 (19:41 +0600)]
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

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.

6 years agoCycles CUDA: don't use cuLaunchGridAsync at all for display devices.
Brecht Van Lommel [Thu, 17 Apr 2014 10:18:49 +0000 (12:18 +0200)]
Cycles CUDA: don't use cuLaunchGridAsync at all for display devices.

As suggested by Martijn, this is slower than cuLaunchGrid.

6 years agoCycles CUDA: only do async execution for GPUs not used for display.
Brecht Van Lommel [Thu, 17 Apr 2014 09:59:05 +0000 (11:59 +0200)]
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

6 years agoFix compilation error of Freestyle
Sergey Sharybin [Thu, 17 Apr 2014 10:04:01 +0000 (16:04 +0600)]
Fix compilation error of Freestyle

Seems to be some sort of namespace conflict or so which is
solved by reshuffling the includes a bit.

6 years agoStyle cleanup
Campbell Barton [Thu, 17 Apr 2014 10:00:49 +0000 (20:00 +1000)]
Style cleanup

6 years agoCode cleanup: use bools for DM
Campbell Barton [Thu, 17 Apr 2014 09:33:54 +0000 (19:33 +1000)]
Code cleanup: use bools for DM

6 years agoFix error in last commit
Campbell Barton [Thu, 17 Apr 2014 10:02:56 +0000 (20:02 +1000)]
Fix error in last commit

6 years agoFix T39758: Blender Crash when removing pinned Scene.
Bastien Montagne [Thu, 17 Apr 2014 08:48:32 +0000 (10:48 +0200)]
Fix T39758: Blender Crash when removing pinned Scene.

6 years agoFix T39766: bone calculation from edit mode goes wrong
Bastien Montagne [Thu, 17 Apr 2014 08:19:32 +0000 (10:19 +0200)]
Fix T39766: bone calculation from edit mode goes wrong

Own logic error in previous commit...

6 years agoFix mistake in recent DM material changes
Campbell Barton [Thu, 17 Apr 2014 08:05:57 +0000 (18:05 +1000)]
Fix mistake in recent DM material changes

6 years agoViewport Text Drawing: replace single allocs with a memarena
Campbell Barton [Thu, 17 Apr 2014 05:14:07 +0000 (15:14 +1000)]
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.

6 years agoCode cleanup: use bools
Campbell Barton [Thu, 17 Apr 2014 03:46:34 +0000 (13:46 +1000)]
Code cleanup: use bools

also rename BLI_omp_thread_count -> BLI_system_thread_count_omp

6 years agoFreestyle: removed unnecessary #include "FreestyleConfig.h".
Tamito Kajiyama [Thu, 17 Apr 2014 05:31:35 +0000 (14:31 +0900)]
Freestyle: removed unnecessary #include "FreestyleConfig.h".

6 years agoFreestyle: removed unused *_EXPORT qualifiers for building Windows DLLs.
Tamito Kajiyama [Thu, 17 Apr 2014 05:19:10 +0000 (14:19 +0900)]
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.

6 years agoFix for missing changes in commit 6b0b6f876a4d68acd5c9252270a5135d0308d782.
Tamito Kajiyama [Thu, 17 Apr 2014 03:57:39 +0000 (12:57 +0900)]
Fix for missing changes in commit 6b0b6f876a4d68acd5c9252270a5135d0308d782.

6 years agoReplaced assert() with BLI_assert().
Tamito Kajiyama [Thu, 17 Apr 2014 03:55:17 +0000 (12:55 +0900)]
Replaced assert() with BLI_assert().

6 years agoFreestyle: removed unnecessary #include files and made minor code cleanup.
Tamito Kajiyama [Thu, 17 Apr 2014 03:45:22 +0000 (12:45 +0900)]
Freestyle: removed unnecessary #include files and made minor code cleanup.

6 years agoFreestyle: Fix for VC++ warnings about 'hypot' macro redefinitions (Part 4).
Tamito Kajiyama [Thu, 17 Apr 2014 03:43:11 +0000 (12:43 +0900)]
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.

6 years agoFreestyle: Fix for VC++ warnings about 'hypot' macro redefinitions (Part 3).
Tamito Kajiyama [Thu, 17 Apr 2014 03:37:08 +0000 (12:37 +0900)]
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.

6 years agoFreestyle: Fix for VC++ warnings about 'hypot' macro redefinitions (Part 2).
Tamito Kajiyama [Thu, 17 Apr 2014 03:25:41 +0000 (12:25 +0900)]
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.

6 years agoFreestyle: Fix for VC++ warnings about 'hypot' macro redefinitions (Part 1).
Tamito Kajiyama [Thu, 17 Apr 2014 03:01:10 +0000 (12:01 +0900)]
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

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.

6 years agoFix T39767: Parent in Mask mode crashes
Campbell Barton [Thu, 17 Apr 2014 03:23:16 +0000 (13:23 +1000)]
Fix T39767: Parent in Mask mode crashes

6 years agoFix T39768: GLOBAL_X/Y/Z don't exist for bpy.ops.armature.calculate_roll type enum
Joshua Leung [Thu, 17 Apr 2014 03:02:03 +0000 (15:02 +1200)]
Fix T39768: GLOBAL_X/Y/Z don't exist for bpy.ops.armature.calculate_roll type enum

6 years agoBGE - button for deactivate sensors, controllers and actuators
Jorge Bernal [Thu, 17 Apr 2014 01:23:29 +0000 (22:23 -0300)]
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.


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

Reviewed By: moguri

CC: billrey
Differential Revision:

6 years agoBullet: better workaround for failing friction with clang 3.4, remove the obsolete...
Jens Verwiebe [Wed, 16 Apr 2014 22:25:15 +0000 (00:25 +0200)]
Bullet: better workaround for failing friction with clang 3.4, remove the obsolete compileflag magic

6 years agoFix another compile error with recent commit on visual studio.
Brecht Van Lommel [Wed, 16 Apr 2014 19:36:19 +0000 (21:36 +0200)]
Fix another compile error with recent commit on visual studio.

6 years agoFix for scons/CUDA build after recent commit.
Brecht Van Lommel [Wed, 16 Apr 2014 19:23:37 +0000 (21:23 +0200)]
Fix for scons/CUDA build after recent commit.

6 years agoCycles CUDA: enabled branched path kernel again, with more registers.
Brecht Van Lommel [Wed, 16 Apr 2014 17:08:37 +0000 (19:08 +0200)]
Cycles CUDA: enabled branched path kernel again, with more registers.

6 years agoCycles code refactor: use __launch_bounds__ instead of -maxrregcount for CUDA.
Brecht Van Lommel [Wed, 16 Apr 2014 17:04:58 +0000 (19:04 +0200)]
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, rather than spread over cmake,
scons and device_cuda.cpp.

6 years agoFix Knife bug T39617: midpoint snap should affect intermediate points.
Howard Trickey [Wed, 16 Apr 2014 18:17:30 +0000 (14:17 -0400)]
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.

6 years agoFix T39756: Extrude, immediate scale
Campbell Barton [Wed, 16 Apr 2014 18:02:42 +0000 (04:02 +1000)]
Fix T39756: Extrude, immediate scale

While not exactly a bug, switching to scale isnt generally useful to keep normal constraint.

6 years agoCode cleanup: use bools & const args
Campbell Barton [Wed, 16 Apr 2014 16:53:11 +0000 (02:53 +1000)]
Code cleanup: use bools & const args

6 years agoFix T39750: Bones disappearing with strange transforms.
Bastien Montagne [Wed, 16 Apr 2014 16:20:27 +0000 (18:20 +0200)]
Fix T39750: Bones disappearing with strange transforms.

Fixed this issue and another similar one, and some minor optimizations.

6 years agoFix related to new split normals draw code.
Bastien Montagne [Wed, 16 Apr 2014 14:51:49 +0000 (16:51 +0200)]
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.

6 years agoFix cycles standalone file saving not taking number of samples into account properly.
Brecht Van Lommel [Wed, 16 Apr 2014 11:49:39 +0000 (13:49 +0200)]
Fix cycles standalone file saving not taking number of samples into account properly.

6 years agoAdd Edge sharp/smooth to 3DView shading panel, as well as new Vert sharp/smooth.
Bastien Montagne [Wed, 16 Apr 2014 13:18:14 +0000 (15:18 +0200)]
Add Edge sharp/smooth to 3DView shading panel, as well as new Vert sharp/smooth.

6 years agoFix for half pixel offset rasterizing masks
Campbell Barton [Wed, 16 Apr 2014 13:25:10 +0000 (23:25 +1000)]
Fix for half pixel offset rasterizing masks

6 years agoMath Lib: optimize axis_dominant_v3_to_m3, approx 6x speedup
Campbell Barton [Wed, 16 Apr 2014 11:04:17 +0000 (21:04 +1000)]
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

6 years agoMath Lib: increase epsilon for ortho_basis_v3v3_v3
Campbell Barton [Wed, 16 Apr 2014 07:24:27 +0000 (17:24 +1000)]
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.

6 years agoFix T39445: Async LibLoad Crash
Mitchell Stokes [Wed, 16 Apr 2014 08:15:40 +0000 (01:15 -0700)]
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.

6 years agoFix T39745: "Origin to geometry" not working with Text objects. (regression)
Campbell Barton [Wed, 16 Apr 2014 03:18:42 +0000 (13:18 +1000)]
Fix T39745: "Origin to geometry" not working with Text objects. (regression)

6 years agoFix T39509: Crash when assign an empty as a LoD
Daniel Stokes [Tue, 15 Apr 2014 19:44:49 +0000 (19:44 +0000)]
Fix T39509: Crash when assign an empty as a LoD

Missing check when looking for appropriate LoD

6 years agoDyntopo:
Antony Riakiotakis [Wed, 16 Apr 2014 02:31:02 +0000 (05:31 +0300)]

Store PBVH node ID in CustomData. This avoids a number of hash deletions
and checks/insertions on big hashes.

6 years agoDyntopo: slightly change node invalidation, only vertices can change BB
Antony Riakiotakis [Tue, 15 Apr 2014 23:10:24 +0000 (02:10 +0300)]
Dyntopo: slightly change node invalidation, only vertices can change BB
recalculation, only faces can change normal invalidation.

6 years agoFix T39607: Audio not in synch when the blend file loads.
Jörg Müller [Tue, 15 Apr 2014 17:17:50 +0000 (19:17 +0200)]
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.

6 years agoFix regression, sculpting on mesh with matcaps (without multires/
Antony Riakiotakis [Tue, 15 Apr 2014 17:12:35 +0000 (20:12 +0300)]
Fix regression, sculpting on mesh with matcaps (without multires/

6 years agoBuilding with C++ guarded alloc works again
Campbell Barton [Tue, 15 Apr 2014 16:22:49 +0000 (02:22 +1000)]
Building with C++ guarded alloc works again

6 years agoFix T39685: triangulation modifier creates zero-area faces
Campbell Barton [Tue, 15 Apr 2014 15:17:00 +0000 (01:17 +1000)]
Fix T39685: triangulation modifier creates zero-area faces

6 years agoUse binary search threshold when deciding whether to create ActKeyColumns too...
Joshua Leung [Tue, 15 Apr 2014 15:22:02 +0000 (03:22 +1200)]
Use binary search threshold when deciding whether to create ActKeyColumns too...

6 years agoOptimisations for building "Long Keyframes"
Joshua Leung [Tue, 15 Apr 2014 15:21:06 +0000 (03:21 +1200)]
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.

6 years agoMove binary-search threshold used for FCurves to BKE_fcurve.h header
Joshua Leung [Tue, 15 Apr 2014 15:08:01 +0000 (03:08 +1200)]
Move binary-search threshold used for FCurves to BKE_fcurve.h header

Since this is now pretty much the de-facto "minimum distance between keyframes",
we might as well expose this in this header so that other places which need similar
thresholds can perform similar checks (needed for my next commit)

6 years agoFix T39234: popup menus behave poorly when they have not enough width for all their...
Bastien Montagne [Tue, 15 Apr 2014 14:49:49 +0000 (16:49 +0200)]
Fix T39234: popup menus behave poorly when they have not enough width for all their columns.

Issue fixed by:
* Not having constant width for all columns, but adapt each to its content's width;
* Adapting undo's menu height to undo list length (so that we never have more than three columns).

It is still possible to get issues in extreme cases (small screen, high DPI size,
long op names everywhere...), but this should now be rare corner cases.

Also fixes a minor glitch with undo menu (first column had one item less than the others...).

6 years agoStructural cleanup and improvements for the compositor.
Lukas Tönne [Tue, 15 Apr 2014 14:06:12 +0000 (16:06 +0200)]
Structural cleanup and improvements for the compositor.

Many parts of the compositor are unnecessarily complicated. This patch
aims at reducing the complexity of writing nodes and making the code
more transparent.

== Separating Nodes and Operations ==

Currently these are both mixed in the same graph, even though they have
very different purposes and are used at distinct stages in the
compositing process. The patch introduces dedicated graph classes for
nodes and for operations.

This removes the need for a lot of special case checks (isOperation etc.)
and explicit type casts. It simplifies the code since it becomes clear
at every stage what type of node we are dealing with. The compiler can
use static typing to avoid common bugs from mixing up these types and
fewer runtime sanity checks are needed.

== Simplified Node Conversion ==

Converting nodes to operations was previously based on "relinking", i.e.
nodes would start with by mirroring links in the Blender DNA node trees,
then add operations and redirect these links to them. This was very hard
to follow in many cases and required a lot of attention to avoid invalid

Now there is a helper class called the NodeConverter, which is passed to
nodes and implements a much simpler API for this process. Nodes can add
operations and explicit connections as before, but defining "external"
links to the inputs/outputs of the original node now uses mapping
instead of directly modifying link data. Input data (node graph) and
result (operations graph) are cleanly separated.

== Removed Redundant Data Structures ==

A few redundant data structures have been removed, notably the
SocketConnection. These are only needed temporarily during graph
construction. For executing the compositor operations it is perfectly
sufficient to store only the direct input link pointers. A common
pointer indirection is avoided this way (which might also give a little
performance improvement).

== Avoid virtual recursive functions ==

Recursive virtual functions are evil. They are very hard to follow
during debugging. At least in the parts this patch is concerned with
these functions have been replaced by a non-virtual recursive core
function (which might then call virtual non-recursive functions if
needed). See for example NodeOperationBuilder::group_operations.

6 years agoMath Lib: avoid having to pass a pre-calculated normal tot area_poly_v3
Campbell Barton [Tue, 15 Apr 2014 14:27:35 +0000 (00:27 +1000)]
Math Lib: avoid having to pass a pre-calculated normal tot area_poly_v3

add normal_poly_v3

6 years agoVarious fixes/improvements regarding BMesh's elem_index_dirty and BM_LOOP handling.
Bastien Montagne [Tue, 15 Apr 2014 14:18:27 +0000 (16:18 +0200)]
Various fixes/improvements regarding BMesh's elem_index_dirty and BM_LOOP handling.

Most notably, BM_LOOP and BM_FACE index recompute should now be fully decoupled.

6 years agoFix T39743: Crash when deleting faces in with new autosmooth.
Bastien Montagne [Tue, 15 Apr 2014 14:15:43 +0000 (16:15 +0200)]
Fix T39743: Crash when deleting faces in with new autosmooth.

Odd I did not catch this one... :/

6 years agoFix T37675: blender internal viewport render wrong for volumes after rotation.
Brecht Van Lommel [Tue, 15 Apr 2014 13:54:56 +0000 (15:54 +0200)]
Fix T37675: blender internal viewport render wrong for volumes after rotation.

We really should not have Object.imat_ren, that's the wrong place to put render
data. But just update it now on rotation rather than doing a bigger refactor to
remove it.

6 years agoFix cycles standalone not writing images in background mode properly.
Brecht Van Lommel [Tue, 15 Apr 2014 13:19:05 +0000 (15:19 +0200)]
Fix cycles standalone not writing images in background mode properly.

6 years agoFix T39284: clamp cycles volume density to be >= 0, to avoid accidental strange shading.
Brecht Van Lommel [Tue, 15 Apr 2014 12:33:13 +0000 (14:33 +0200)]
Fix T39284: clamp cycles volume density to be >= 0, to avoid accidental strange shading.

6 years agoFix T39610: Shared mesh used for Mesh Deform causes crash
Sergey Sharybin [Tue, 15 Apr 2014 12:36:24 +0000 (18:36 +0600)]
Fix T39610: Shared mesh used for Mesh Deform causes crash

For now disable using linked edit mesh in the meshdeform modifier.

This is because editbmesh_get_derived_cage_and_final() might easily
conflict with the thread which evaluates object which is in the edit
mode for this mesh.

We'll support this case once granular dependency graph is landed.

6 years agoFix T39607: Audio not in synch when the blend file loads.
Bastien Montagne [Tue, 15 Apr 2014 12:23:13 +0000 (14:23 +0200)]
Fix T39607: Audio not in synch when the blend file loads.

Root of issue is probably in AUDASPACE itself (or even in OpenAL?).
Issue not present with SDL backend, only OpenAL afaik.

For now, workaround in Blender is to call seek twice when starting play
(not needed when resuming from pause).

6 years agoSome style cleanup in sound area.
Bastien Montagne [Tue, 15 Apr 2014 08:59:42 +0000 (10:59 +0200)]
Some style cleanup in sound area.

6 years agoOSX/python: update to py 3.4
Jens Verwiebe [Tue, 15 Apr 2014 12:12:06 +0000 (14:12 +0200)]
OSX/python: update to py 3.4

6 years agoCode cleanup: indentation
Campbell Barton [Tue, 15 Apr 2014 09:21:29 +0000 (19:21 +1000)]
Code cleanup: indentation

6 years agoFix compilation (size_t not defined) by including stddef.h in BLI_sys_types.h
Bastien Montagne [Tue, 15 Apr 2014 07:11:45 +0000 (09:11 +0200)]
Fix compilation (size_t not defined) by including stddef.h in BLI_sys_types.h

6 years agoFix T39742: Crash with Cycles + new autosmooth crash
Bastien Montagne [Tue, 15 Apr 2014 06:29:22 +0000 (08:29 +0200)]
Fix T39742: Crash with Cycles + new autosmooth crash

Nice little mistake, since the invalid mem access only happened once (the first time),
was close to valid mem, and was only used to read, it would not crash often...

6 years agoFix my last commit cad4bfe: Added 'use_' prefix to Freestyle edge/face mark properties.
Tamito Kajiyama [Tue, 15 Apr 2014 05:44:08 +0000 (14:44 +0900)]
Fix my last commit cad4bfe: Added 'use_' prefix to Freestyle edge/face mark properties.

6 years agoRevert part of last commit,
Campbell Barton [Tue, 15 Apr 2014 04:44:28 +0000 (14:44 +1000)]
Revert part of last commit,

RNA is low level data access, setting mesh values shouldn't change draw options.

Also its redundant to name attrs Face.freestyle_face_mark,
removed edge/face from attr names

6 years agoGHash: add BLI_ghashutil_uinthash_v4 for hashing 4 ints at once
Campbell Barton [Tue, 15 Apr 2014 04:39:23 +0000 (14:39 +1000)]
GHash: add BLI_ghashutil_uinthash_v4 for hashing 4 ints at once

6 years agoFreestyle: Added missing mesh property definitions for Freestyle Edge/Face marks.
Tamito Kajiyama [Tue, 15 Apr 2014 04:29:03 +0000 (13:29 +0900)]
Freestyle: Added missing mesh property definitions for Freestyle Edge/Face marks.

This revision also addresses the issue of these properties not shown in the Outliner
in the Datablocks display mode.  Now Freestyle edge/face marks can be keyframed
through the Outliner.

6 years agoGHash: add typed hash functions (were all (void *))
Campbell Barton [Tue, 15 Apr 2014 04:17:54 +0000 (14:17 +1000)]
GHash: add typed hash functions (were all (void *))

- BLI_ghashutil_strhash_n takes string length, to avoid terminating the string before hashing.
- BLI_ghashutil_inthash/uinthash take ints, to avoid casting to (void *)

This also showed up incorrect use of inthash, which was using a pointer.

6 years agoStyle cleanup: C & pep8
Campbell Barton [Tue, 15 Apr 2014 03:11:48 +0000 (13:11 +1000)]
Style cleanup: C & pep8

6 years agoFix T39740: New Autosmooth instant crash entering Edit Mode
Bastien Montagne [Mon, 14 Apr 2014 21:42:38 +0000 (23:42 +0200)]
Fix T39740: New Autosmooth instant crash entering Edit Mode

One should always be wary of last minute changes, especially in comples code area... :/

6 years agoFix video FFmpeg nt being able to produce video files due to usage of deprecated...
Sergey Sharybin [Mon, 14 Apr 2014 18:15:09 +0000 (00:15 +0600)]
Fix video FFmpeg nt being able to produce video files due to usage of deprecated settings

6 years agoFix T39700: Plane deform still works forever
Sergey Sharybin [Mon, 14 Apr 2014 17:58:02 +0000 (23:58 +0600)]
Fix T39700: Plane deform still works forever

Clamped the EWA sampling region to buffer size now. Solves the issue,
but needs more tests to be sure weights are correct.

6 years agoFix T39736: Ctrl+V reports "Objects Pasted" regardless if it worked or not.
Bastien Montagne [Mon, 14 Apr 2014 17:49:18 +0000 (19:49 +0200)]
Fix T39736: Ctrl+V reports "Objects Pasted" regardless if it worked or not.

6 years agoFix cycles standalone not saving renders in background mode.
Brecht Van Lommel [Mon, 14 Apr 2014 12:08:32 +0000 (14:08 +0200)]
Fix cycles standalone not saving renders in background mode.