Fix T38815

For AVX support we need to check both OS support and CPU support.
Fix T38811: Cycles particle ids are inconsistent when using multiple particle systems.

Problem is that the particle systems in the cycles database are not
stored in a well-defined order. This means the particle_id for dupli
objects can not simply be assigned using a global running index during
sync.

Now the particle index is assigned locally for each particle system.
When transferring particle data to the device as a single texture, the
particle indices are offset based on the final order of particle systems
in the database.

Reviewers: brecht

Reviewed By: brecht

CC: Andreas80

Differential Revision: https://developer.blender.org/D352
Fix missing brackets in cpuid bitfield check.
concern raised by lukas_t (rBef73d547cc7c663ad180721094c81b3c81482ac3)
Further work for fix T38804: unnecessary empty space in the modifier UI.
Fix T38836: change screencast timer limits so you can record with higher FPS.

Note that the screencast implementation is quite poor and that you may not even
get the requested FPS, the timing system here is not reliable.
Fix T38548: Edit externally always uses first frame only
Fix for constraint poll function succeeding when no constraint exists
Fix for sequencer add operators showing up in spacebar search.
WM: hide screen management and ndof operators from seach popup
Sculpt: allow to select objects when in sculpt mode

This was disabled with circle select (which makes sense), but all other
paint modes allow this and sculpt isnt using select mouse.
Paint API: add BKE_paint_select_elem_test: to check on paint selection
Fix T38837: Ctrl+RMB can't select posemode

This used to work (unintentionally), now check for paint-select
modes as well as editmode for ctrl+rmb to force object selection.
Ignore zero weighted markers in keyframe selection

It doesn't make sense to use zero-weighted tracks as a correspondences
in keyframe selection.

Such tracks are not guaranteed to be tracked accurately because their
purpose is to add reference points in 3D space without affecting the
solution.
BMesh: add overwrite option to BM_mesh_elem_hflag_enable/disable_test
Fix for own regression: remove doubles deselected faces
Fix 3D tracks to mesh not aligning mesh properly

Also fixed wrong frame number used for reconstructed object
visualization in 3D viewport.
Fix crash happening when drawing GP for a track which doesn't have visible marker
Fix T38846: Render layer checkbox is not refreshed.

The render operator invoke checks render layers, which can force the
render layer to be activated. This requires a notifier, which has to be
done in the operator itself (can't do this inside pipeline code).
Nicer solution to T38846: Split off the render layer forcing from the
validity check for render operator.

This way scene DNA can stay read-only there, cleaner and we don't have
to pass an awkward bool pointer around.
Fix T38831: blender internal enabling shadow pass changes material node diffuse.

It would include/exclude shadow depending on the pass being disabled/enabled,
but that should have no influence on the combined render result. Now it always
includes shadow.