5 years agoOpenSubdiv: Add extra checks whether GPU compute available or not
Sergey Sharybin [Wed, 26 Aug 2015 07:16:10 +0000 (09:16 +0200)]
OpenSubdiv: Add extra checks whether GPU compute available or not

5 years agoFix T45793: ChromaMatte incorrect output
Campbell Barton [Wed, 26 Aug 2015 06:45:37 +0000 (16:45 +1000)]
Fix T45793: ChromaMatte incorrect output

Port to new node system missed important step.

5 years agoSmooth-view: Ignored camera-viewpoint on exit to user-view
Campbell Barton [Wed, 26 Aug 2015 05:13:19 +0000 (15:13 +1000)]
Smooth-view: Ignored camera-viewpoint on exit to user-view

5 years agoDelete could assign a temp screen
Campbell Barton [Wed, 26 Aug 2015 04:14:50 +0000 (14:14 +1000)]
Delete could assign a temp screen

5 years agoFix T45369: Temp screen locks UI
Campbell Barton [Wed, 26 Aug 2015 03:59:46 +0000 (13:59 +1000)]
Fix T45369: Temp screen locks UI

It was possible to navigate into an unused temp screen
(using Ctrl+Arrow keys), but there was no way to navigate back out.

Now Ctrl+Arrows skips temp screens, and remove the ability to navigate away from a temp screen from RNA.

5 years agoDisallow navigating away from a full-temp screen
Campbell Barton [Wed, 26 Aug 2015 03:51:41 +0000 (13:51 +1000)]
Disallow navigating away from a full-temp screen

5 years agoReturn success when a screen was added/removed
Campbell Barton [Wed, 26 Aug 2015 03:49:58 +0000 (13:49 +1000)]
Return success when a screen was added/removed

Currently unused, but useful for screen-operators.

5 years agoFix for deleting screen w/ temp screens in list
Campbell Barton [Wed, 26 Aug 2015 02:41:23 +0000 (12:41 +1000)]
Fix for deleting screen w/ temp screens in list

If the next screen to use was temporary, deleting the screen would fail.

5 years agoFix crash setting the screen when one is maximized
Campbell Barton [Wed, 26 Aug 2015 01:27:13 +0000 (11:27 +1000)]
Fix crash setting the screen when one is maximized

5 years agoFix T45901: Smooth-view w/ bg-image glitch
Campbell Barton [Wed, 26 Aug 2015 00:12:36 +0000 (10:12 +1000)]
Fix T45901: Smooth-view w/ bg-image glitch

It was possible to rotate the view while the view was already moving
causing background images to show when they shouldn't.

5 years agoRevert "Increase Smooth_View limit to 10.000"
Campbell Barton [Tue, 25 Aug 2015 23:35:33 +0000 (09:35 +1000)]
Revert "Increase Smooth_View limit to 10.000"

This reverts commit 1ed1f2f3abd6cdb9134ca3f70c1d504c3fb66c50.

Waiting 10 seconds to change view isn't practical.
Further it expose issues where users can attempt to activate tools during view motion,
Some work, others give issues, this just isn't going to be properly supported.

View animation features are fine, but this isn't the purpose of the smooth-view option.

5 years agoUsual i18n messages fixes. Also had to update i18n scripts to new BLT module...
Bastien Montagne [Tue, 25 Aug 2015 19:12:36 +0000 (21:12 +0200)]
Usual i18n messages fixes. Also had to update i18n scripts to new BLT module...

5 years agoFileBrowser: Fix broken 'extend' behavior of walk select mode.
Bastien Montagne [Tue, 25 Aug 2015 17:32:30 +0000 (19:32 +0200)]
FileBrowser: Fix broken 'extend' behavior of walk select mode.

Glitch when I merged new walk code in asset-experiments most likely...
Thanks to Dalai (dfelinto) who notified that on IRC.

5 years agoFix T45904: Cycles bug after recent triangle intersect changes
Sergey Sharybin [Tue, 25 Aug 2015 16:19:03 +0000 (18:19 +0200)]
Fix T45904: Cycles bug after recent triangle intersect changes

Calculated cross product from wrong vectors by accident.

5 years agoFix walk navigation: scene unit used even when unit not set
Dalai Felinto [Tue, 25 Aug 2015 16:29:54 +0000 (13:29 -0300)]
Fix walk navigation: scene unit used even when unit not set

5 years agoFix T45789: Materials with transparency not properly rendered in viewport in Material...
Sergey Sharybin [Tue, 25 Aug 2015 16:10:01 +0000 (18:10 +0200)]
Fix T45789: Materials with transparency not properly rendered in viewport in Material Render mode

This is a bit tricky one -- ideally viewport should detect whether alpha is used
in the shader tree and if so do separate viewport pass for that objects. But in
practice it's really tricky to detect whether alpha is affected by shader or not
without evaluating the tree for all possible input values. We also can't assume
that alpha might always be affected because it'll slow viewport drawing down.

For until some smart solution is found simply expose alpha blending mode used
by the viewport. It could be found below the Viewport Color settings.

5 years agoAction Management Feature Request/Regression T45535
Joshua Leung [Tue, 25 Aug 2015 14:13:17 +0000 (02:13 +1200)]
Action Management Feature Request/Regression T45535

By popular request, restored the ability to shift-click on the X (unlink) button
to unlink the action (from the active action slot), clear the Fake User, and
also remove the NLA-stashed copy (only works for the current object/NLA stack though).

5 years agoPreemptive fix for search-buffer size issues
Joshua Leung [Tue, 25 Aug 2015 11:27:04 +0000 (23:27 +1200)]
Preemptive fix for search-buffer size issues

Forgot to increase the size of the string buffer in b88d8916e44f998c4f0bc397b29b0d6ff0f011e9
While this wouldn't have caused problems in most cases (since most modifier names
are short), in the rare event that a long modifier name exists, the buffer may have
ended up being truncated prematurely, causing the wrong FCurves to get matched.

5 years agoFix T45776: Rotate around selected fails in texture-paint mode w/ armature
Campbell Barton [Tue, 25 Aug 2015 13:25:05 +0000 (23:25 +1000)]
Fix T45776: Rotate around selected fails in texture-paint mode w/ armature

Only rotate around the active pose bone when in weight-paint mode too.

5 years agoOpenSubdiv: Fix/workaround shader compilation when going to GLSL mode
Sergey Sharybin [Tue, 25 Aug 2015 13:34:34 +0000 (15:34 +0200)]
OpenSubdiv: Fix/workaround shader compilation when going to GLSL mode

5 years agoOpenSubdiv: Support multiple materials for GLSL view
Sergey Sharybin [Tue, 25 Aug 2015 13:22:26 +0000 (15:22 +0200)]
OpenSubdiv: Support multiple materials for GLSL view

5 years agoOpenSubdiv: Remove partitioned mesh interface
Sergey Sharybin [Tue, 25 Aug 2015 13:10:06 +0000 (15:10 +0200)]
OpenSubdiv: Remove partitioned mesh interface

It's hopefully no longer needed, at least not needed for as long as
single ptex face corresponds to a single patch which should be always
correct for uniform subdivisions as far as i know.

5 years agoOpenSubdiv: Support for multiple materials in solid shading mode
Sergey Sharybin [Tue, 25 Aug 2015 13:05:28 +0000 (15:05 +0200)]
OpenSubdiv: Support for multiple materials in solid shading mode

Implementation is less optimal compared to non-opensubdiv drawing but
it is now as good as we can do it without affecting on how patches are
being created by OpenSubdiv.

5 years agoFix T45853: Edge-slide UV-correct jitter
Campbell Barton [Tue, 25 Aug 2015 12:45:09 +0000 (22:45 +1000)]
Fix T45853: Edge-slide UV-correct jitter

5 years agoBGE: added bge.logic.{get,set}AnimRecordFrame functions
Sybren A. Stüvel [Tue, 25 Aug 2015 11:42:09 +0000 (13:42 +0200)]
BGE: added bge.logic.{get,set}AnimRecordFrame functions

By using getAnimRecordFrame(), game developers have access to the frame
number used by the "Record animation" feature. This enables them to
record additional information in Blender's F-Curves and ensuring perfect
synchronization with the information already recorded by Blender.

The setAnimRecordFrame() can be used to change the frame number at which
animations are recorded, for example to introduce delays the recording that
do not require delays in the actual game/simulation run.

The getter/setter functions in KX_KetsjiEngine are not directly named after
property they access (m_currentFrame). I found "current frame" to be too
vague for a public interface, hence chose a more descriptive name.

Reviewers: moguri, hg1, campbellbarton, panzergame, aligorith

Reviewed By: panzergame, aligorith

Differential Revision:

5 years agoAvoid include header from previous commit when building without OpenSubdiv
Sergey Sharybin [Tue, 25 Aug 2015 11:24:02 +0000 (13:24 +0200)]
Avoid include header from previous commit when building without OpenSubdiv

5 years agoOpenSubdiv: Make it more obvious that None compute type actually disables OpenSubdiv
Sergey Sharybin [Tue, 25 Aug 2015 11:23:06 +0000 (13:23 +0200)]
OpenSubdiv: Make it more obvious that None compute type actually disables OpenSubdiv

5 years agoOpenSubdiv: Fill in some missing drawing callbacks of CCGDM
Sergey Sharybin [Tue, 25 Aug 2015 11:16:24 +0000 (13:16 +0200)]
OpenSubdiv: Fill in some missing drawing callbacks of CCGDM

5 years agoOpenSubdiv: Better approximation of vertex normals
Sergey Sharybin [Tue, 25 Aug 2015 10:40:50 +0000 (12:40 +0200)]
OpenSubdiv: Better approximation of vertex normals

Use vertex varying data which gives better approximation of normals.
Still not ideal but should be closer for higher poly meshes to correct

The only way to have proper smooth normals seems to be to implement
patch evaluation in tessellation shader, but that's a bit PITA with
current GLSL usage in our draw code.

5 years agoFix T45891: Crash generating previews
Campbell Barton [Tue, 25 Aug 2015 08:33:04 +0000 (18:33 +1000)]
Fix T45891: Crash generating previews

5 years agoFix T45729: Cycles Bake break when building a special mesh
Sergey Sharybin [Tue, 25 Aug 2015 08:29:40 +0000 (10:29 +0200)]
Fix T45729: Cycles Bake break when building a special mesh

The issue was caused by CD_SHAPEKEY_INDEX layer being added to edge data,
now we make sure all the layers are nicely re-allocated.

5 years agoQuiet warning with arg types
Campbell Barton [Tue, 25 Aug 2015 07:27:18 +0000 (17:27 +1000)]
Quiet warning with arg types

5 years agoFix T45814: Writing MP4, h.264 not supported
Campbell Barton [Mon, 24 Aug 2015 22:51:04 +0000 (08:51 +1000)]
Fix T45814: Writing MP4, h.264 not supported

5 years agoCleanup: style
Campbell Barton [Mon, 24 Aug 2015 22:50:53 +0000 (08:50 +1000)]
Cleanup: style

5 years agoFix for previous commit
Sergey Sharybin [Mon, 24 Aug 2015 21:11:11 +0000 (23:11 +0200)]
Fix for previous commit

uint is only used in Cycles, Blender is not really ready for this.

Pointed out by Thomas Szepe, thanks!

5 years agoBLI_fileops: Some fixes and cleanup.
Bastien Montagne [Mon, 24 Aug 2015 20:09:01 +0000 (22:09 +0200)]
BLI_fileops: Some fixes and cleanup.

* Fix BLI_file_touch, used to add one dummy byte ((unsigned char)EOF) to empty files!
* Get rid of static global temp string in WIN32 area (very bad, and useless!).
* Get rid of paranoid NULL checks in WIN32's BLI_gzopen().
* Add non-relative filename asserts to WIN32 file operations too.
* ifdef-out BLI_move and BLI_create_symlink, unused (and the later is not even implemented for windows).

Partly based on patch and points raised by Jason Wilkins (jwilkins) in T32870, thanks!

5 years agoFix T45833: Light group instances are not rendered in the 3D viewport
Sergey Sharybin [Mon, 24 Aug 2015 20:02:41 +0000 (22:02 +0200)]
Fix T45833: Light group instances are not rendered in the 3D viewport

The issue was introduced in c9ac51e by trying to use original's objects layers
for light visibility check instead of using duplicator's layers.

5 years agoFix T45778: Objects scaled to 0 cause black artifacts with Static BVH
Sergey Sharybin [Mon, 24 Aug 2015 19:21:30 +0000 (21:21 +0200)]
Fix T45778: Objects scaled to 0 cause black artifacts with Static BVH

The issue was caused by some numeric instability in triangle intersection which
was visible on avx2 CPUs and GPUs (at least sm_20 here) but maybe some others

Committing rather a workaround for now to be safe for the release, still need
some investigation.

From tests with grass field from Gooseberry project didn't see measurable

5 years agoFix T45737: Vertex colors show washed-out
Campbell Barton [Mon, 24 Aug 2015 15:02:28 +0000 (01:02 +1000)]
Fix T45737: Vertex colors show washed-out

Blender-Internal and GLSL-nodes missed converting sRGB to linear color.

5 years agoFix DM_get_loop_array, was checking edge-data
Campbell Barton [Mon, 24 Aug 2015 14:43:13 +0000 (00:43 +1000)]
Fix DM_get_loop_array, was checking edge-data

Fixes T45728

5 years agoFix T45084 correcting bending_damping for cloth stiffness, by Martin Norris.
Lukas Tönne [Mon, 24 Aug 2015 12:09:01 +0000 (14:09 +0200)]
Fix T45084 correcting bending_damping for cloth stiffness, by Martin Norris.

5 years agoFix T45823: PSD files save as JPG without warning
Campbell Barton [Mon, 24 Aug 2015 11:31:41 +0000 (21:31 +1000)]
Fix T45823: PSD files save as JPG without warning

Don't allow image save (which overwrites without asking),
unless the input format can be written to.

5 years agoFix T45885: Cycles coordinate extension modes not working as expected
Sergey Sharybin [Mon, 24 Aug 2015 08:37:59 +0000 (10:37 +0200)]
Fix T45885: Cycles coordinate extension modes not working as expected
Fix T45769: Image Texture Node clipping bug

Simple mistakes in the normalized/pixel-space coordinates handling.

Render tests for this feature are coming.

5 years agoFix some issues from lates coverity scan.
Bastien Montagne [Mon, 24 Aug 2015 07:59:04 +0000 (09:59 +0200)]
Fix some issues from lates coverity scan.

Unlikely, but still valid.

5 years agoTests: Ignore preview render script in module loading tests
Sergey Sharybin [Sun, 23 Aug 2015 16:55:40 +0000 (18:55 +0200)]
Tests: Ignore preview render script in module loading tests

5 years agoCycles: Use better policy for primitive array resize for spatial split
Sergey Sharybin [Sun, 23 Aug 2015 13:57:41 +0000 (15:57 +0200)]
Cycles: Use better policy for primitive array resize for spatial split

Gives around 50% of spatial split BVH build speedup with grass field from
cassette player shot from Gooseberry.

5 years agoCycles: Implement reseve() for aligned array class
Sergey Sharybin [Sun, 23 Aug 2015 13:50:31 +0000 (15:50 +0200)]
Cycles: Implement reseve() for aligned array class

The title says it all actually, just support reserving memory in the array class.

5 years agoCycles: Speedup of Spatial BVH split code
Sergey Sharybin [Sun, 23 Aug 2015 13:03:00 +0000 (15:03 +0200)]
Cycles: Speedup of Spatial BVH split code

Avoid memmove() happening on every insert of duplicated node to the references
list. Temporary pre-allocated vector is used for new references which is then
being inserted into actual array in one go later.

Gives around 4x speedup building spatially split BVH for the grass field in the
cassette player shot from Gooseberry.

5 years agoCycles: Implementation of object reference nodes spatial split
Sergey Sharybin [Sat, 22 Aug 2015 19:19:00 +0000 (21:19 +0200)]
Cycles: Implementation of object reference nodes spatial split

This commit implements object reference node spatial split making it possible
to use spatial split for top-level BVH.

The code is not in use yet because enabling spatial split on top level BVH is
not coming for free and it needs to be investigated if it's worth in terms of
improved render times.

5 years agoCycles: Make primitive split code easier for re-use by reference splitting function
Sergey Sharybin [Fri, 21 Aug 2015 17:40:14 +0000 (19:40 +0200)]
Cycles: Make primitive split code easier for re-use by reference splitting function

5 years agoCycles: Move primitive splitting into own functions
Sergey Sharybin [Fri, 21 Aug 2015 15:49:41 +0000 (17:49 +0200)]
Cycles: Move primitive splitting into own functions

This way it's easy to add more reference types allowed for splitting to the
BVH reference split function without making this function too much big. This
way it's possible to experiment with such features as splitting object instance

So far should not be any functional changes.

5 years agoCycles: BVH statistics print was missing for spatially split BVH tree
Sergey Sharybin [Fri, 21 Aug 2015 01:42:25 +0000 (03:42 +0200)]
Cycles: BVH statistics print was missing for spatially split BVH tree

5 years agoFix editmesh GLSL tangent drawing
Campbell Barton [Mon, 24 Aug 2015 05:14:34 +0000 (15:14 +1000)]
Fix editmesh GLSL tangent drawing

The generic tangent calculation relied on CDDM arrays which aren't available in edit-mode.

Add a tangent calculation callback, which has its own implementation for editmesh data.

5 years agoFix T45884: Crash copying keyframes
Campbell Barton [Sun, 23 Aug 2015 23:23:24 +0000 (09:23 +1000)]
Fix T45884: Crash copying keyframes

BLI_str_quoted_substrN could crash if the prefix wasn't found

5 years agomathutils.BVHTree: support overlap self-intersect
Campbell Barton [Sun, 23 Aug 2015 22:13:58 +0000 (08:13 +1000)]
mathutils.BVHTree: support overlap self-intersect

Use same logic as BKE_bmbvh_overlap

5 years agoBVHTree.FromBMesh() missed epsilon arg
Campbell Barton [Sun, 23 Aug 2015 22:12:59 +0000 (08:12 +1000)]
BVHTree.FromBMesh() missed epsilon arg

5 years agoFix T45882: Sudden shutdown if the filebrowser is part of the area layout.
Bastien Montagne [Sun, 23 Aug 2015 18:27:59 +0000 (20:27 +0200)]
Fix T45882: Sudden shutdown if the filebrowser is part of the area layout.

There is no guarantee in sfile's listener that FileList has already been created...

5 years agoFix T45860, missing extension in GLSL after recent own fix.
Antony Riakiotakis [Sun, 23 Aug 2015 15:20:08 +0000 (18:20 +0300)]
Fix T45860, missing extension in GLSL after recent own fix.

5 years agoBGE: Fix T42679: Python physics environment not setted for python control script.
Porteries Tristan [Sun, 23 Aug 2015 12:30:44 +0000 (14:30 +0200)]
BGE: Fix T42679: Python physics environment not setted for python control script.

5 years agoCleanup: spelling/style
Campbell Barton [Sun, 23 Aug 2015 11:12:48 +0000 (21:12 +1000)]
Cleanup: spelling/style

5 years agoThis commit makes it possible to select the sort mode whenever we invoke an operator.
Thomas Beck [Sun, 23 Aug 2015 10:40:21 +0000 (12:40 +0200)]
This commit makes it possible to select the sort mode whenever we invoke an operator.

It's needed especially for the menu entry "recover auto save" where you'd like to have the files sorted by date most of the time but it could be useful in other places too.
There should be no functional change in other areas, I just added the missing parameter (FILE_SORT_ALPHA).

Was a request from @sebastian_k at #BCon13, so at least one guy needs it ;)

Reviewers: mont29

Reviewed By: mont29

Subscribers: sebastian_k

Differential Revision:

5 years agoFix T45633 - Animated modifiers don't update in new depsgraph
Joshua Leung [Sun, 23 Aug 2015 10:12:25 +0000 (22:12 +1200)]
Fix T45633 - Animated modifiers don't update in new depsgraph

* Resolved some todo's where FModifier paths were getting identified using the
  wrong pattern.
* Added the missing animation -> modifier link. The "hacky" part here is just
  to do with how we check if that link is needed; the link though should exist
  in the graph.

5 years agoMath Lib: Use same logic for 2d/3d functions
Campbell Barton [Sun, 23 Aug 2015 09:10:37 +0000 (19:10 +1000)]
Math Lib: Use same logic for 2d/3d functions

dist_squared_to_line_v2, dist_to_line_v2

5 years agoMath Lib: minor optimization interp_weights_poly
Campbell Barton [Sun, 23 Aug 2015 07:07:35 +0000 (17:07 +1000)]
Math Lib: minor optimization interp_weights_poly

5 years agoCleanup: spelling
Campbell Barton [Sat, 22 Aug 2015 11:17:32 +0000 (21:17 +1000)]
Cleanup: spelling

5 years agoUse epsilon for line-intersect collinear test
Campbell Barton [Sat, 22 Aug 2015 11:03:12 +0000 (21:03 +1000)]
Use epsilon for line-intersect collinear test

Also remove 2x vector normalize since other parts of the code already check this.

Fixes T45849

5 years agoFileBrowser: Tweak display of size/time of entries.
Bastien Montagne [Sat, 22 Aug 2015 09:02:12 +0000 (11:02 +0200)]
FileBrowser: Tweak display of size/time of entries.

We have no size for blenlib entries, nor do we have time for those and 'parent' entry.

Thanks to Sergey for notifying this on IRC.

5 years agooutliner: tweak GPLayer color button overlap
Campbell Barton [Sat, 22 Aug 2015 06:48:41 +0000 (16:48 +1000)]
outliner: tweak GPLayer color button overlap

5 years agoFix outliner grease pencil color button
Campbell Barton [Sat, 22 Aug 2015 06:37:35 +0000 (16:37 +1000)]
Fix outliner grease pencil color button

5 years agoFix T45689: Pose Libraries cannot be used when using lib-linked actions as poselibs
Joshua Leung [Sat, 22 Aug 2015 06:16:55 +0000 (18:16 +1200)]
Fix T45689: Pose Libraries cannot be used when using lib-linked actions as poselibs

This commit makes some tweaks that make it at least possible to use lib-linked
actions as Pose Libraries. Specifically:
* The apply poses button is no longer greyed out

* It is possible to select different poses from the list of poses

* All pose library operators which edit the poses stored in the poselib
  now have improved poll callbacks which perform extra checks for lib-linked
  actions (which cannot be edited, as all those changes will be lost)

* Due to the way the UI list template works, it doesn't seem to be possible to
  make it not grey out the items in the list. (While the double-click to rename
  thing shouldn't be allowed, items should at least look like they can be clicked on)

* The difference between clickable vs not-clickable isn't too great, making it hard
  to tell that that while the Add/Remove/Sanitise toggles are not usable,
  the Apply Poses is actually functional. But, this is a more of a  UI-toolbox
  level issue

5 years agoTypo fix
Joshua Leung [Fri, 21 Aug 2015 15:30:09 +0000 (03:30 +1200)]
Typo fix

5 years agoBGE: Fix constraint free crash in RemoveConstraint.
Porteries Tristan [Fri, 21 Aug 2015 20:17:35 +0000 (22:17 +0200)]
BGE: Fix constraint free crash in RemoveConstraint.

Fix silly error getRigidBodyA() instead of getRigidBodyB()

5 years agoFix T45658: linked library object loses particle settings.
Bastien Montagne [Fri, 21 Aug 2015 16:27:14 +0000 (18:27 +0200)]
Fix T45658: linked library object loses particle settings.

Simply make ParticleSettings datablock linkable, see absolutely no reason why those
were the only 'real data' ID type not linkable so far...

5 years agoAnim Editors: All keyframe selection operators now perform undo pushes
Joshua Leung [Fri, 21 Aug 2015 14:47:32 +0000 (02:47 +1200)]
Anim Editors: All keyframe selection operators now perform undo pushes

This brings them into line with other editing tools (e.g. object/mesh selection),
and should help fix bugs like T45374 and T45846

5 years agoFix T45864: Wrong NLA Control Curves keyed when using the Graph Editor sliders
Joshua Leung [Fri, 21 Aug 2015 14:33:31 +0000 (02:33 +1200)]
Fix T45864: Wrong NLA Control Curves keyed when using the Graph Editor sliders

This commit simplifies the logic for finding the control curves for NLA strips,
thus eliminating a whole bunch of weird errors that were happening here. It should
also fix a number of other related issues here.

5 years agoFix T45865: Auto Blend is not recalculated when adjusting start/end/scale etc. of...
Bastien Montagne [Fri, 21 Aug 2015 14:18:20 +0000 (16:18 +0200)]
Fix T45865: Auto Blend is not recalculated when adjusting start/end/scale etc. of strip through RNA.

5 years agoBVH-raycast: Use watertight intersections
Campbell Barton [Fri, 21 Aug 2015 07:46:23 +0000 (17:46 +1000)]
BVH-raycast: Use watertight intersections

By default watertight intersections are used,
For callbacks where its not needed,
BLI_bvhtree_ray_cast_ex can be called without the BVH_RAYCAST_WATERTIGHT flag.

Fixes T45286

5 years agoMath Lib: watertight intersection function
Campbell Barton [Fri, 21 Aug 2015 07:45:04 +0000 (17:45 +1000)]
Math Lib: watertight intersection function

From Cycles with some very minor differences.

5 years agoMath Lib: Add float/int conversion functions
Campbell Barton [Fri, 21 Aug 2015 07:42:40 +0000 (17:42 +1000)]
Math Lib: Add float/int conversion functions

5 years agoBVH-raycast: ensure input direction is unit-length
Campbell Barton [Fri, 21 Aug 2015 07:05:48 +0000 (17:05 +1000)]
BVH-raycast: ensure input direction is unit-length

This was already the case for most users of ray-cast.
Doing this avoids 2x normalize calls per ray-cast in many places.

5 years agoFix uninitialized var use
Campbell Barton [Fri, 21 Aug 2015 04:46:30 +0000 (14:46 +1000)]
Fix uninitialized var use

5 years agoDocs: correct some comments
Campbell Barton [Thu, 20 Aug 2015 23:07:52 +0000 (09:07 +1000)]
Docs: correct some comments

5 years agoFix ATI part of T45708, crash when enabling opensubdiv.
Antony Riakiotakis [Thu, 20 Aug 2015 13:23:33 +0000 (16:23 +0300)]
Fix ATI part of T45708, crash when enabling opensubdiv.

In fact exit was getting called because we
had an error in shader compilation:

Uniform buffer objects are in fact required.

Since it looks like original intent was to
write the shader against older GLSL version,
I will be adding an extension here instead
of a version.

Thanks to Anshu Arya for letting me borrow his machine through
VPN to do the debugging :)

5 years agoFix T45491 not all GPUs support those extensions, use check for
Antony Riakiotakis [Thu, 20 Aug 2015 13:05:24 +0000 (16:05 +0300)]
Fix T45491 not all GPUs support those extensions, use check for
opensubdiv to enable.

5 years agoMinor cleanup (BLI_cleanup_dir already adds trailing slash, and correct a false-posit...
Bastien Montagne [Thu, 20 Aug 2015 10:44:03 +0000 (12:44 +0200)]
Minor cleanup (BLI_cleanup_dir already adds trailing slash, and correct a false-positive assert).

5 years agoBGE: Fix T44557 GameLogic module memory leak.
Porteries Tristan [Thu, 20 Aug 2015 09:53:09 +0000 (11:53 +0200)]
BGE: Fix T44557 GameLogic module memory leak.

This reverts commit 7a28ca4398465be1d6d57079e4b27c3a03418745.

5 years agoFix T43654: Radial distance for force fields was computed using the `vec_to_point`
Lukas Tönne [Thu, 20 Aug 2015 09:57:03 +0000 (11:57 +0200)]
Fix T43654: Radial distance for force fields was computed using the `vec_to_point`
vector, which already has the radial component removed.

5 years agoResolve MSVC/OpenMP compat issue
Campbell Barton [Thu, 20 Aug 2015 09:22:09 +0000 (19:22 +1000)]
Resolve MSVC/OpenMP compat issue

5 years agoUse BVH-overlap for mesh self-intersection display
Campbell Barton [Thu, 20 Aug 2015 09:09:20 +0000 (19:09 +1000)]
Use BVH-overlap for mesh self-intersection display

Add BKE_bmbvh_overlap, remove BKE_bmbvh_find_face_segment

5 years agoHopefully fix mingw building after filebrowser rewrite.
Bastien Montagne [Thu, 20 Aug 2015 08:15:08 +0000 (10:15 +0200)]
Hopefully fix mingw building after filebrowser rewrite.

The mystery here is, how MSVC could not break on such error? :(

5 years agoBVH-overlap: add callback to BLI_bvhtree_overlap
Campbell Barton [Thu, 20 Aug 2015 07:32:25 +0000 (17:32 +1000)]
BVH-overlap: add callback to BLI_bvhtree_overlap

The callback checks if 2 nodes intersect (not just their AABB).

- theres no need to allocate overlaps which are later ignored.
- expensive intersection tests will run multi-threaded.

Currently only used for Python API.

5 years agoFix T45514 crash entering texpaint mode.
Antony Riakiotakis [Thu, 20 Aug 2015 07:35:14 +0000 (10:35 +0300)]
Fix T45514 crash entering texpaint mode.

In the file of the report, stencil and clone indices
have fallen out of synch with the uv/mtexpoly layers.

Looks like the file has a long history, coming from 2.49
even. Unfortunately reporter cannot recall exact steps
to reproduce, so "fix" is to patch mesh.validate to
fix those indices.

5 years agoBVH-overlap: use stack for overlap data array
Campbell Barton [Thu, 20 Aug 2015 05:56:33 +0000 (15:56 +1000)]
BVH-overlap: use stack for overlap data array

This is known to be <32, so no need to malloc every item.

5 years agoAvoid redundant normal calculation in heat-weight
Campbell Barton [Thu, 20 Aug 2015 05:09:25 +0000 (15:09 +1000)]
Avoid redundant normal calculation in heat-weight

5 years agoCleanup: de-duplicate ray-cast initialization
Campbell Barton [Thu, 20 Aug 2015 03:25:21 +0000 (13:25 +1000)]
Cleanup: de-duplicate ray-cast initialization

5 years agoCleanup: comment out isect_ray_tri_threshold_v3
Campbell Barton [Thu, 20 Aug 2015 02:36:21 +0000 (12:36 +1000)]
Cleanup: comment out isect_ray_tri_threshold_v3

Also define epsilon var for ray-cast functions.

5 years agoTransform: Use BVH for volume-snap (optimization)
Campbell Barton [Thu, 20 Aug 2015 02:14:02 +0000 (12:14 +1000)]
Transform: Use BVH for volume-snap (optimization)

Was performing ray-tri intersection checks on all faces.

Note, this isn't using isect_ray_tri_threshold_v3
which was used to prevent ray-casts slipping through between faces.

Instead we'll move to using watertight intersections by default.

5 years agoCleanup: remove unused BVH_ONQUAD flag
Campbell Barton [Thu, 20 Aug 2015 01:03:34 +0000 (11:03 +1000)]
Cleanup: remove unused BVH_ONQUAD flag

5 years agoFix drawing subsurf & auto-smooth
Campbell Barton [Wed, 19 Aug 2015 23:20:41 +0000 (09:20 +1000)]
Fix drawing subsurf & auto-smooth

Error caused by recent MFace removal from subsurf.

5 years agoCleanup: unused vars
Campbell Barton [Wed, 19 Aug 2015 23:19:50 +0000 (09:19 +1000)]
Cleanup: unused vars