Partial fix for array modifier vertex merge (bug 30195).

Two fixes:

* The find-doubles operator was overriding the "dirty" element
  indices, so vertices were not being mapped correctly.

* In some cases a vertex can be set to merge with a vertex that is
  also set to be merged, so added a loop to find the first unmerged
  vert in this case.

Not yet working is the "First Last" merge option.

Also made some cleanups and added comments in the array/remove doubles
code.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45248 954f8c5b-7b00-dc11-b283-0030488c597c
fix invalid *= on an un-initialized value when adding primitives.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45249 954f8c5b-7b00-dc11-b283-0030488c597c
fix [#30705] Playing animation in reverse prevents further forward playback


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45250 954f8c5b-7b00-dc11-b283-0030488c597c
fix [#30402] modules dir missing from sys.path


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45251 954f8c5b-7b00-dc11-b283-0030488c597c
Windows Blenderplayer: The console now closes when the Blenderplayer launches (like it does with Blender). To get it back, use the -c flag, which is finally working as described: "-c: keep console window open"

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45252 954f8c5b-7b00-dc11-b283-0030488c597c
skip using bmesh operators for converting to/from undo meshes (gives some speedup)


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45253 954f8c5b-7b00-dc11-b283-0030488c597c
BGE: This fixes a problem where lamps in inactive layers were rendering shadows buffers that never got used, which was a huge performance sink.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45254 954f8c5b-7b00-dc11-b283-0030488c597c
Slight style cleanup for last commit.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45255 954f8c5b-7b00-dc11-b283-0030488c597c
converting a mesh to an undo mesh now skips using bmesh operator.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45256 954f8c5b-7b00-dc11-b283-0030488c597c
Fix uninitialized variable in CustomData_bmesh_merge.

Caused a crash in array modifier with caps.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45257 954f8c5b-7b00-dc11-b283-0030488c597c
More array modifier fixes.

* Skip calculation of merge indices if merging isn't enabled
* Clean up usage of BMesh operators to fix small memory leak
* Fix harmless BLI_assert in CustomData_bmesh_merge
* Another null-initialization fix in CustomData_bmesh_merge

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45258 954f8c5b-7b00-dc11-b283-0030488c597c
fix [#30715] bmesh: select linked not ignoring hidden verts/edges/faces

add optional flag to ignore hidden elements.
also remove loop mask flag - since it wasnt used and vert/edge/face is enough.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45260 954f8c5b-7b00-dc11-b283-0030488c597c
added Mesh.calc_tessface(), needed to update mesh tessface after bmesh edits.

also add py api BMDeformVert.clear()


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45261 954f8c5b-7b00-dc11-b283-0030488c597c
Fix #30719: Align View to Selected has unexpected results on further view change

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45262 954f8c5b-7b00-dc11-b283-0030488c597c
Fix #30716: Clamp To Constraint Locks up Blender after a while.

Issue was caused by object moved really far away (not just actually issue,
it's just about long mouse gesture and X-axis orientation which projects
position to quite large X-axis value) and for this location start offset
from curve length was calculating iteratively which takes plenty of time for
short curves.

Replace iterative search of offset with formula which seems to be working
in the same way and should be a bit more accurate.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45263 954f8c5b-7b00-dc11-b283-0030488c597c
Fix #30717: Bmesh Branch manipulator bug (Maya Keymaps)

Issue was caused by storing operator properties for VIEW3D_OT_enable_manipulator

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45264 954f8c5b-7b00-dc11-b283-0030488c597c
Add stub for ED_mesh_calc_tessface to get blenderplayer compiling again.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45265 954f8c5b-7b00-dc11-b283-0030488c597c
Fix "First Last" merge option in array modifier (partial fix for bug 30195)

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45266 954f8c5b-7b00-dc11-b283-0030488c597c
style cleanup: sequencer


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45267 954f8c5b-7b00-dc11-b283-0030488c597c
style cleanup: minor change and remove redundant casts


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@45268 954f8c5b-7b00-dc11-b283-0030488c597c