Freestyle: fix for crash in the constructor of freestyle.types.StrokeVertexIterator.
Add bone_groups.new() and bone_groups.remove() methods to RNA.

To do so, matching BKE 'API' was also refactored a bit:
* Get Pose data instead of Object, as parameter;
* Removed some sanity checks not needed at such a low level (callers are supposed to do that);
* You can now remove an arbitrary bone group, not only the active one.

Based on patch by pkrime (Paolo Acampora), with own edits.

Reviewers: #python, pkrime, aligorith

Reviewed By: aligorith

Differential Revision: https://developer.blender.org/D522
Fix T40980: Exporting animation in MPEG Matroska using ffv1 and FLAC codecs fails
Fix T40164: Linking a Group of linked Groups don't take Dupli Visibility
correctly.

Problem was that object layers are defined by duplis as the top-level
duplicator layers. This happens //during// the duplilist construction,
which breaks group layer checks for subsequent instances and hides them.
Now the duplilist generators leave Object DNA untouched, the
modification of layers for drawing, rendering, etc. happens afterward
in the duplilist_apply/restore functions, as a kind of second pass.
Fix T40939: Border render and SSS doesn't work correct in rendered viewport

There were some missing updates in the viewport render job which lead to
wrong SSS mapping on the final resolution.

There was also wrong scaling applying when border render is used.

And last but not least(?) strands render was using first level of the
resolution leading to really thick strands in the final viewport.
Cleanup: get rid of magic numbers.
Cleanup: silent C++11 warning (implicit double to float conversion) in Collada code.
Implement Start Resolution for preview render in BI

So now viewport render resolution division works exactly the same as in Cycles.
Fix T41003: Object Info's Random socket produces erratic results when
material is applied to multiple Dupli instances of an object.

One of the random_id initialization lines for cycles objects slipped
into the basic update part in this commit:
rBb98ff5cb5b2c14c33b16e3b129e1e08810e90a6c

This would constantly re-shuffle the random_id ...
Fix T40991, mirrored armatures not restored properly when cancelling.

Issue here is that we force mirroring even if original armature is not
mirrored.

We could be smart and store only unselected mirrored bones here (since
those will get restored from transdata), however not all properties were
getting stored and restored; rolling bones still suffered from the bug
for instance.

To fix this we need to restore all properties that armature mirroring
overrides. Transdata obviously does not offer a lot of space here, so I
used TransInfo->customdata to store an array of initial parameters of
the mirrored bones.
Fix T40997, artifacts when unhiding part of the mesh in dyntopo.

Tagging a face as hidden should not be done only when hiding.
Attempt to mitigate issue T40981

Clipping border causes a software fallback on ATIs. We have disabled it
in that case but from minor digging on the net seems like Intels support
this, so enable.
Buildbot: enable cubins fox OSX

With new buildbot env they should be all fine.
Attempt to fix compilation error on 32bit OSX and SCons
Another attempt to fix issues with 32bit OSX and scons
Further tweaks to SCons's auto tests

We should do autotests only after setting path to sconsign,
otherwise using the same working directory and different
build directories will eventually break.
Cleanup: Always assign num_samples, there is no need for this special define.
Cleanup: Same thing in path trace setup, we can safely always assign the proper value.
Fix T40909: BGE softbodies broken.

Looks like softbody settings got lost in a recent cleanup.
SCons: Hopefully final fix for 32bit linux buildbot

No need to run automated tests for cudakernels target. TThis could
be harmless because CUDA binaries are built in the another chroot.