Campbell Barton [Mon, 18 Jul 2016 09:28:45 +0000 (19:28 +1000)]
CMake: correct py-module on OSX
Sergey Sharybin [Fri, 15 Jul 2016 12:55:37 +0000 (14:55 +0200)]
Fix T48860: Cycles SSS artifacts with spatially split BVH
The issue was caused by SSS intersection code gathering all
intersections without check for duplicated ones. This caused
situations when same intersection will be recorded twice in
the case if triangle is shared by several BVH nodes.
Usually this is handled by checking intersection distance
after sorting intersections (in shadow_blocked for example)
but for SSS we don't do such sorting and using number of
intersections to calculate various things.
Didn't find anything smarter than to check intersection
distance in triangle_intersect_subsurface().
This solves render artifacts in the cost of 1.5% slowdown
of extreme case rendering (SSS object filling in whole
FullHD screen).
Reviewers: brecht
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D2105
Lukas Stockner [Sun, 17 Jul 2016 17:24:53 +0000 (19:24 +0200)]
Cycles: Fix OpenCL compilation after the recent numerical fixes
Campbell Barton [Sun, 17 Jul 2016 09:02:01 +0000 (19:02 +1000)]
BLI_heap: replace memarena w/ local allocator
- Since element size its known it's less work to do inline.
- In test with high-poly model, gave ~9% overall speedup for decimate modifier.
Campbell Barton [Sun, 17 Jul 2016 07:31:27 +0000 (17:31 +1000)]
Cleanup: minor edits to BLI_heap
Lukas Stockner [Sat, 16 Jul 2016 18:48:12 +0000 (20:48 +0200)]
Cycles: Fix three numerical issues in the fresnel, normal map and Beckmann code
- In fresnel_dielectric, the differentials calculation sometimes divided by zero.
- When the normal map was (0.5, 0.5, 0.5), the code would try to normalize a zero vector. Now, it just uses the regular normal as a fallback.
- The approximate error function used in Beckmann sampling sometimes overflowed to inf while calculating r^16. The final value is 1 - 1/r^16, however,
so now it just returns 1 if the computation would overflow otherwise.
Lukas Stockner [Sat, 16 Jul 2016 18:44:28 +0000 (20:44 +0200)]
Cycles: Deduplicate geometric factor calculation in the Beckmann distribution
Also, this fixes a numerical issue where A would be inf.
Since later G is set to 1 if A is larger than 1.6, the code now checks the reciprocal of A for being smaller than 1/1.6 - same effect, but no inf involved.
Campbell Barton [Sat, 16 Jul 2016 17:03:22 +0000 (03:03 +1000)]
Fix use after free error from
ab993e37
Campbell Barton [Sat, 16 Jul 2016 07:48:57 +0000 (17:48 +1000)]
Cleanup: spelling
Campbell Barton [Sat, 16 Jul 2016 06:36:30 +0000 (16:36 +1000)]
Cleanup: line length
Germano Cavalcante [Sat, 16 Jul 2016 00:25:44 +0000 (21:25 -0300)]
Use the value `VIEW_PROJ_PERSP` in the remaining places
also changes the name of the callbacks:
- walk_parent_snap_project_cb to cb_walk_parent_snap_project;
- cb_leaf_snap_vert to cb_walk_leaf_snap_vert;
- cb_leaf_snap_edge to cb_walk_leaf_snap_edge;
- test_vert_depth_cb to test_vert_ray_dist_cb;
- test_edge_depth_cb to test_edge_ray_dist_cb;
and cleanup:
Sergey Sharybin [Fri, 15 Jul 2016 16:12:05 +0000 (18:12 +0200)]
Cycles: Fix refitting of regular BVH
Was causing CUDA issues on viewport edits.
Campbell Barton [Fri, 15 Jul 2016 11:54:38 +0000 (21:54 +1000)]
UI: modifier keys now trigger number button updates
Number buttons & sliders weren't updating when shift/ctrl were pressed.
Note that this is a regression in 2.77 but hard to track down since it worked unreliably for some time.
Sergey Sharybin [Sun, 7 Jun 2015 20:48:51 +0000 (22:48 +0200)]
Bump maximum threads number to 1024
This commit contains all the changes required for most optimal maximum threads
number bump. This is needed to avoid possibly unneeded initialization or data
allocation on systems with lower threads count.
TODO: Still need to review arrays in render data structures from render_types.h,
P.S. We might remove actual bump of max threads from this patch, so when we'll
be applying the patch we can do all the preparation work and then do actual
bump of max threads.
Reviewers: mont29, campbellbarton
Reviewed By: mont29, campbellbarton
Maniphest Tasks: T43306
Differential Revision: https://developer.blender.org/D1343
Sergey Sharybin [Thu, 7 Jul 2016 16:04:16 +0000 (18:04 +0200)]
Cycles: Add option to disable new Hair BVH
While it's an extra option added to the interface which might not be
fully obvious for artists, it allows to save up to 20% of memory in
hairy scenes.
This is high enough memory saver in my opinion which might become
handy for some production files where it's more important to make
scene to fit into memory rather than trying to use more optimal BVH
structure but go into swap or crash.
Reviewers: dingto, brecht
Reviewed By: dingto, brecht
Differential Revision: https://developer.blender.org/D2090
Sandy Carter [Fri, 15 Jul 2016 14:14:32 +0000 (16:14 +0200)]
fix T48857: Improved the handling of Material Alpha, based on patch D1949 with some small modifications
Gaia Clary [Fri, 15 Jul 2016 14:12:39 +0000 (16:12 +0200)]
Collada: changed specification of material alpha from using transparency to using transparent with opaque=A_ONE
Sergey Sharybin [Fri, 15 Jul 2016 13:12:28 +0000 (15:12 +0200)]
Re-initialize source/tools submodule
Campbell Barton [Fri, 15 Jul 2016 10:00:18 +0000 (20:00 +1000)]
missed from last commit
Campbell Barton [Fri, 15 Jul 2016 09:46:59 +0000 (19:46 +1000)]
Object Snap: make normal argument optional
Often its not needed, setting correctly takes some extra calculation - so allow for it to be left unset.
Campbell Barton [Fri, 15 Jul 2016 09:22:00 +0000 (19:22 +1000)]
Fix T48855: Ruler thickness broken in ortho view
Don't do ray-casts from the view unless cursor coords are passed.
Campbell Barton [Fri, 15 Jul 2016 09:14:46 +0000 (19:14 +1000)]
Object Snap: replace perspective bool with enum
Allows to set the projection as none,
to make it more obvious when we don't want to handle viewport projections in some cases.
Campbell Barton [Fri, 15 Jul 2016 08:40:16 +0000 (18:40 +1000)]
Correct error in snap commit
Campbell Barton [Fri, 15 Jul 2016 07:17:42 +0000 (17:17 +1000)]
Cleanup: use BLI_math for paint smooth-stroke
Campbell Barton [Fri, 15 Jul 2016 07:12:43 +0000 (17:12 +1000)]
Cleanup: rename snap vars
Campbell Barton [Fri, 15 Jul 2016 07:07:18 +0000 (17:07 +1000)]
Add "Snap Selection to Active" option in menu
D1963 by @wisaac, re-worked to de-duplicate logic
Campbell Barton [Fri, 15 Jul 2016 06:02:46 +0000 (16:02 +1000)]
Support for loading multiple images from the file selector
D2035 by @jside, extended to support mixing single images and sequences in the one selection.
Campbell Barton [Fri, 15 Jul 2016 05:56:28 +0000 (15:56 +1000)]
Fix select grouped parent, extend option was ignored
D2067 by @mangostaniko
Campbell Barton [Fri, 15 Jul 2016 05:50:42 +0000 (15:50 +1000)]
UI: Remove spaces around '/'
D2093 by @Blendify
Campbell Barton [Fri, 15 Jul 2016 05:45:45 +0000 (15:45 +1000)]
Sequencer: Remove add effect strip filesel properties
D2096 by @chadf
Unused, copy-paste error.
Campbell Barton [Fri, 15 Jul 2016 05:29:27 +0000 (15:29 +1000)]
Fix py-driver in startup.blend crash in background mode
Obscure regression in own commit from
b34929786.
While this could be considered correct, it introduces a crash so disable the update call.
Brecht Van Lommel [Thu, 14 Jul 2016 20:48:41 +0000 (22:48 +0200)]
Code cleanup: show unused arguments names for ShaderNode::constant_fold.
Gaia Clary [Thu, 14 Jul 2016 19:42:44 +0000 (21:42 +0200)]
fix T48857: Added support for transparency (used Patch D1949 from bwrsandman with some slight changes)
Campbell Barton [Thu, 14 Jul 2016 16:46:04 +0000 (02:46 +1000)]
Use BMesh solver for new boolean modifiers
Campbell Barton [Thu, 14 Jul 2016 16:36:21 +0000 (02:36 +1000)]
Cleanup: comment blocks
Bastien Montagne [Thu, 14 Jul 2016 16:18:54 +0000 (18:18 +0200)]
Fix T48844: Nodetrees of appended materials/textures/etc. were not correctly made local.
Previous commits now allow to use id_make_local() here, as one would expect.
Note that I also checked T36003 case, working fine as well with new code.
Bastien Montagne [Thu, 14 Jul 2016 16:16:05 +0000 (18:16 +0200)]
Correct recent own fix to id_clear_lib_data_ex().
Datablocks' nodetree are *never* in main, while shapekeys are...
Bastien Montagne [Thu, 14 Jul 2016 13:38:41 +0000 (15:38 +0200)]
Cleanup/refactor: handle shapekeys exactly like 'owned' nodetrees in make_local process.
Bastien Montagne [Thu, 14 Jul 2016 13:32:25 +0000 (15:32 +0200)]
Cleanup: use BKE's ntreeFromID in readfile instead of local same function.
Also, no need to set ntree->id.lib to NULL after BKE_libblock_copy_nolib(),
generic datablock copy function always make copy local.
Bastien Montagne [Thu, 14 Jul 2016 13:23:53 +0000 (15:23 +0200)]
Fix bad handling of datablock's nodetree id_clear_lib_data_ex().
Those data blocks are never shared, exactly as with shapekeys, much simpler
to also clear their lib_data (especially since they have no user!).
Bastien Montagne [Thu, 14 Jul 2016 11:07:45 +0000 (13:07 +0200)]
Get rid of BKE_key_make_local().
This function was only a wrapper around id_clear_lib_data(), and shapekeys
are not linkable nor shareable anyway, no point keeping this currently,
was only adding confusion about shapekey 'status' as a datatblock.
Bastien Montagne [Thu, 14 Jul 2016 11:03:22 +0000 (13:03 +0200)]
Add option to id_make_local to force localization of datablock, even if not used locally.
Will be used by link/append code.
Campbell Barton [Thu, 14 Jul 2016 16:30:37 +0000 (02:30 +1000)]
Fix T48843: Sequencer crash with many effects
Switch from a fixed stack to a linked list,
since guessing the maximum possible size may fail with invalid/overlapping strips.
Campbell Barton [Thu, 14 Jul 2016 15:26:40 +0000 (01:26 +1000)]
Add developer tools submodule
This is intended for utilities to help with development,
which aren't needed for building.
See https://wiki.blender.org/index.php/Dev:Doc/Tools/Blender_Tools_Repo for details
Campbell Barton [Thu, 14 Jul 2016 15:26:04 +0000 (01:26 +1000)]
Cleanup: line length
Campbell Barton [Thu, 14 Jul 2016 11:00:05 +0000 (21:00 +1000)]
PyAPI: minor cleanup with library linking
Chad Fraleigh [Thu, 14 Jul 2016 12:15:43 +0000 (14:15 +0200)]
Consolidate multiple checks for out->rect_float in prepare_effect_imbufs()
Many checks for out->rect_float being [non-]NULL are done back-to-back.
Combining them into a single check for slightly more efficient code and
less code clutter for easier readability/understanding.
Differential Revision: https://developer.blender.org/D2097
Julian Eisel [Thu, 14 Jul 2016 11:58:40 +0000 (13:58 +0200)]
Cleanup: Use BKE_scene_base_add for creating bases
And use __func__ macro.
Sergey Sharybin [Thu, 14 Jul 2016 10:49:20 +0000 (12:49 +0200)]
Cycles: Give better idea which OpenCL kernel is currently compiling
Sergey Sharybin [Thu, 14 Jul 2016 10:44:51 +0000 (12:44 +0200)]
Cycles: Avoid strings passed by value in OpenCL device
Also use more const qualifiers in the code.
Sergey Sharybin [Thu, 14 Jul 2016 10:14:55 +0000 (12:14 +0200)]
Make --debug-all include --debug-cycles and --debug-libmv
Sergey Sharybin [Thu, 14 Jul 2016 09:49:38 +0000 (11:49 +0200)]
Libmv: Fix some strict compiler warnings
One of them was a real bug!
Sergey Sharybin [Thu, 14 Jul 2016 09:11:23 +0000 (11:11 +0200)]
Cycles: Fix wrong size of sobol texture
After reformulation of SSS indirect rays it became possible to
try accessing dimension higher than was pre-calculated on scene
preparation.
This is because we're traversing rays backwards, which means we
are using higher dimensions first now.
Sergey Sharybin [Thu, 14 Jul 2016 09:08:24 +0000 (11:08 +0200)]
Cycles: Fix wrong termination criteria in intersect_all functions
It was possible to miss bounces termination criteria in this functions,
mainly when max_hits was set to 0.
Made the check more robust in traversal functions (which should not
affect performance, it's an operation of same complexity AFAIK).
Also avoid doing ray-scene intersection from shadow_blocked when
limit of transparent bounces was already reached.
Campbell Barton [Thu, 14 Jul 2016 09:11:33 +0000 (19:11 +1000)]
CMake: per-target CFLAG & CXXFLAG support
Applying cflags globally can be problematic especially with extern, intern libs.
Now flags from target named will be used when defined,
allowing for developers to define flags for modules they maintain.
Convention is CMAKE_CFLAGS_${UPPERCASE_TARGET_NAME}, (CXXFLAGS for C++).
eg: CMAKE_CFLAGS_BF_BLENDER, CMAKE_CFLAGS_MAKESDNA, CMAKE_CXXFLAGS_CYCLES_KERNEL
On Linux run `make help` for full list of names, MSVC shows these in the solution.
Campbell Barton [Thu, 14 Jul 2016 08:27:20 +0000 (18:27 +1000)]
PyAPI: Leak fix caused crash w/ attr swap trick
Accessing `bpy.app.binary_path_python does search, then swaps its getset with the string it finds.
This caused a freed pointer to be stored in bpy.app's dictionary.
Fix by using the same string for get/set access.
Campbell Barton [Thu, 14 Jul 2016 07:38:22 +0000 (17:38 +1000)]
PyAPI: fix leak linking library data
Campbell Barton [Thu, 14 Jul 2016 07:28:28 +0000 (17:28 +1000)]
PyAPI: fix memory leaks in dictionary assignment
Thanks to Kévin Dietrich for spotting driver leak,
checked other uses of PyDict_SetItem and found more.
Campbell Barton [Thu, 14 Jul 2016 05:51:56 +0000 (15:51 +1000)]
PyAPI: Use module names on initializaton
No need to re-convert from C strings to PyUnicode.
Germano Cavalcante [Thu, 14 Jul 2016 03:47:32 +0000 (00:47 -0300)]
Improves the accuracy of snap to edges
Recently the snap to edges has been changed to work with coordinates 2d. Thus, the lambda of the snap pointon on edge becomes different from the actual lambda in a 3d edge.
The solution to correct the lambda was this:
```
if (is_persp) {
const float fac = depth_a / (depth_a + depth_b);
lambda *= (1.0f + (fac - 0.5f) * (1.0f - lambda));
````
...
But the lambda was still not very accurate.
Now the function uses the `dist_squared_ray_to_seg_v3` to get the coordinate of the snap point on the edge. And then tests that point.
The accuracy returned to normal values.
Campbell Barton [Thu, 14 Jul 2016 03:37:49 +0000 (13:37 +1000)]
Cleanup: style
Campbell Barton [Thu, 14 Jul 2016 01:52:53 +0000 (11:52 +1000)]
Use BLI_endian_switch in dna_genfile
Germano Cavalcante [Thu, 14 Jul 2016 03:02:21 +0000 (00:02 -0300)]
Simplify snapping functions
from D2104: reference all repeated (and strange) equations (example: mul_m4_m4m4(pmat_local, pmat, obmat)) in the function `precalc_project.
This is useful for maintenance.
Campbell Barton [Thu, 14 Jul 2016 01:06:40 +0000 (11:06 +1000)]
Fix T48846: Ruler/Protractor crash in ortho mode
Error in recent snap changes.
Kévin Dietrich [Wed, 13 Jul 2016 22:24:31 +0000 (00:24 +0200)]
Fix T48845: Crash when right-clicking on a curve property
Caused by typo in rBd2312602125a452e6562a76ab91779943c67396d
Sergey Sharybin [Wed, 13 Jul 2016 13:00:29 +0000 (15:00 +0200)]
Fix T48734: Driver not updating when using Single From Driver within same object
Campbell Barton [Wed, 13 Jul 2016 12:22:37 +0000 (22:22 +1000)]
Fix T48839: Selection from pose mode gives wrong snap results
Current code changes the selection then then runs ED_armature_sync_selection
to copy to the bones rootsel flag from the parents tipsel.
Use this logic for entering edit-mode too.
Campbell Barton [Wed, 13 Jul 2016 07:45:55 +0000 (17:45 +1000)]
Boolean Modifier: Add back BMesh option
There are still issues with overlapping geometry,
however some of the issues reported are are causing problems,
or fail entirely with Carve too.
Sergey Sharybin [Wed, 13 Jul 2016 08:55:35 +0000 (10:55 +0200)]
Depsgraph: Make proxy behavior closer to old depsgraph
Fixes possible missing update of proxy_from pointer before using
it in relations builder.
Sergey Sharybin [Wed, 13 Jul 2016 08:39:55 +0000 (10:39 +0200)]
Revert "Depsgraph: Russian electric tape bodge to have multiple proxies work"
This reverts commit
47d0d9cca4d0c3ccbdc368e97fc24652379fd368.
Reverting the commit. Not only it did not solve all the cases of proxy popping,
but also broke real cases with single proxy involved.
Sergey Sharybin [Wed, 13 Jul 2016 08:07:09 +0000 (10:07 +0200)]
Depsgraph: Accumulate object layers from all bases
This solves bug when same object is instanced from multiple bases.
Campbell Barton [Wed, 13 Jul 2016 04:42:00 +0000 (14:42 +1000)]
Use BLI_bvhtree_walk_dfs for snapping
The snapping functions when performed in the perspective view,
have some problems in the threshold (a distortion) and in the clip plane (the normal is incorrect).
These problems can be only observed when making the snap to edges or to vertices (nearest to ray function).
This patch propose a totally different solution.
The idea is to project the edges of bvh nodes and test the 2d projection of the snap element.
For this it used the BLI_bvhtree_walk_dfs function.
It is important to pay particular attention also to the changes in `ED_transform_snap_object_project_view3d_ex`
Campbell Barton [Wed, 13 Jul 2016 03:57:46 +0000 (13:57 +1000)]
Vertex/Weight Paint: Support view-selected on last-stroke
D1875 by @lichtwerk
Bastien Montagne [Tue, 12 Jul 2016 19:08:38 +0000 (21:08 +0200)]
Fix 48831, Step II: UI icon code was not able to update/generate 'auto ID icon' from non-ID icon draw code.
Now using generic icon rendering system in that case too, instead of custom code
which was only handling 'deferred' custom file-loaded icons.
Bastien Montagne [Tue, 12 Jul 2016 15:49:30 +0000 (17:49 +0200)]
Fix 48831, Step I: Mismatch issues bewteen ID icon and preview system.
- icon_id from ID and PreviewImage were not guaranteed to be in sync.
- PreviewImage one was not reset on file read.
- Through RNA e.g., it was possible to ensure an ID icon via its preview image,
which was running code designed for custom previews/icons system, instead
of generating correct 'auto ID icon'.
Sergey Sharybin [Tue, 12 Jul 2016 15:38:26 +0000 (17:38 +0200)]
Revert "OpenJPEG: update to 2.1 from 1.5"
This reverts commit
f12204196fb1ee985ab9745cf9c70877601145f9.
Campbell, sorry. have to revert this for the time being.
We've missed some very important bits, such as:
- FFmpeg is usually linked against OpenJPEG
- OIIO needs OpenJPEG as well.
For FFmpeg issues we can either disable OpenJPEG there (since
we don't really use it), or bump FFmpeg to version 3.1.1 which
can use either of OpenJPEG 1.5 or 2.1.
For OIIO we do need OpenJPEG support (otherwise Cycles will
not be able to use j2k/j2c textures) and currently there is
NO solution to make OIIO working with OpenJPEG 2.1.
According to Matthias Fauconneau (aka mfv) Larry is working
on the patch to get OIIO work with OpenJPEG 2.1, but it'll
take some time still.
I've tried to look into support of some sort of build system
flag and do ifdefs, but it all becomes quite nasty, especially
with bundled OpenJPEG bumped to 2.1.
Surely such an update is something we'll have to apply to
but at this exact moment it causes quite some pain for all
developers.
Suggest to wait for until OIIO supports OpenJPEG 2.1 and then
go with the updates for real.
Sergey Sharybin [Tue, 12 Jul 2016 13:40:40 +0000 (15:40 +0200)]
Fix T48818: Objects with alpha maps cast wrong ray shadows in BI
Campbell Barton [Thu, 9 Jun 2016 11:56:29 +0000 (21:56 +1000)]
OpenJPEG: update to 2.1 from 1.5
Stream handling has changed so this required changes to how files & memory are accessed.
Campbell Barton [Tue, 12 Jul 2016 10:35:02 +0000 (20:35 +1000)]
Fix saving jpeg2k images from Python
Quality was defaulting to lowest and no codec was set.
Campbell Barton [Tue, 12 Jul 2016 07:59:25 +0000 (17:59 +1000)]
Cleanup: remove redundant check
Campbell Barton [Tue, 12 Jul 2016 04:39:39 +0000 (14:39 +1000)]
Fix T48830: Outliner draw crash, missing NULL check
Fix from @cheleb
Campbell Barton [Tue, 12 Jul 2016 02:53:49 +0000 (12:53 +1000)]
writefile: reuse SDNA between writes
Avoids decoding the SDNA string every undo step.
Campbell Barton [Tue, 12 Jul 2016 02:23:48 +0000 (12:23 +1000)]
readfile: report SDNA decoding errors on file read
This was printed to the stdout, however the error case wasn't checked or well supported.
Also, errors decoding SDNA would sometimes call exit(1).
Campbell Barton [Tue, 12 Jul 2016 01:48:04 +0000 (11:48 +1000)]
writefile: remove SDNA last-hit, optimize DNA reconstruct
- Move last-hit index out of SDNA struct
(allows for access by multiple threads).
- Replace O(n^2) search with hash lookup in DNA reconstruction.
Bastien Montagne [Mon, 11 Jul 2016 19:27:15 +0000 (21:27 +0200)]
Remove usercount handling from BKE_id_expand_local.
Idea looked good, but we have too much custom situations here (some half-fake-sub-ID
being copied with their 'owner', animdata, etc.), let's let datablock copy functions
handle that themselves.
Also allows to safely call BKE_id_expand_local from all copy functions now (only when
copying linked data).
Bastien Montagne [Mon, 11 Jul 2016 19:03:02 +0000 (21:03 +0200)]
Cleanup: remove call to BKE_id_lib_local_paths() in make_local functions.
This one is already called by matching copy functions, no need to call it twice!
Bastien Montagne [Mon, 11 Jul 2016 18:56:28 +0000 (20:56 +0200)]
Use new generic BKE_id_expand_local() for make_local() for object.
Bastien Montagne [Mon, 11 Jul 2016 18:45:57 +0000 (20:45 +0200)]
Use new generic BKE_id_expand_local() for make_local() for image/material/texture/world.
As said in previous commits, did not touch to copy functions for now, due to ntree issues...
Bastien Montagne [Mon, 11 Jul 2016 18:16:22 +0000 (20:16 +0200)]
Revert 'use new BKE_id_expand_local()' change for Lamp's copy function.
ntree is once more time a PITA - actually, all sub-IDs that get copied together with the 'main' one are
(shapekey was workedaround, as was animdata/action issue, but nodes are more touchy).
For now, better not to touch that, needs careful check & rethink.
Bastien Montagne [Mon, 11 Jul 2016 17:44:14 +0000 (19:44 +0200)]
Use new generic BKE_id_expand_local() for make_local() for nodetree.
Did not changed ntree copy for now, this func is a mess of expand/non-expand/bmain/non-bmain cases...
Keep it for later!
Bastien Montagne [Mon, 11 Jul 2016 17:39:34 +0000 (19:39 +0200)]
Use new generic BKE_id_expand_local() for both make_local() and copy() functions of actions, brushes and particles.
This greatly simplifies said code, once again no change expected from user PoV.
Bastien Montagne [Mon, 11 Jul 2016 17:13:42 +0000 (19:13 +0200)]
Use new generic BKE_id_expand_local() for both make_local() and copy() functions of obdata
(armature, mesh, curve, mball, lattice, lamp, camera, and speaker).
This greatly simplifies said code, once again no change expected from user PoV.
Bastien Montagne [Mon, 11 Jul 2016 17:09:46 +0000 (19:09 +0200)]
Add an exception/hack to new BKE_id_expand_local(), to ignore actions datablock in its usercount handling.
Reason is, typically those actions datablock usercounts have already been adjusted in BKE_animdata_copy()
(called by generic iddata copy function).
Think this needs to be reworked a bit too, there are way too much ways to copy animdata currently,
it's rather confusing. But not the goal here, so for now we'll live with the hack!
Bastien Montagne [Mon, 11 Jul 2016 14:50:59 +0000 (16:50 +0200)]
Fix (unreported) memory leak when making local linked databock which has a preview image.
Also cleaned-up/synchronized code across al ID types that support preview.
Bastien Montagne [Mon, 11 Jul 2016 14:41:59 +0000 (16:41 +0200)]
Add generic 'BKE_id_expand_local' to BKE_library,
will be used by both make_local() and copy() datablock functions.
Note that this new func make 'extern' all IDs used by localized datablock,
not only refcounted ones as it used to be in each type's functions (with a few exceptions).
Sergey Sharybin [Mon, 11 Jul 2016 16:15:51 +0000 (18:15 +0200)]
Cycles: Fix compilation error on Windows with OSL enabled
Seems there's some conflict around `near` identifier in that configuration.
Sergey Sharybin [Mon, 11 Jul 2016 16:01:40 +0000 (18:01 +0200)]
Cycles: Fix typo
Sergey Sharybin [Mon, 11 Jul 2016 15:58:42 +0000 (17:58 +0200)]
Fix T48824: Crash when having too many ray-to-volume intersections
Code might have writing past the array boundaries.
Campbell Barton [Mon, 11 Jul 2016 15:15:54 +0000 (01:15 +1000)]
Fix T48812: Brush size invalid with HIDPI
Missed from
c5b2f12b
Sergey Sharybin [Mon, 11 Jul 2016 13:15:09 +0000 (15:15 +0200)]
Depsgraph: Fix crash in Weight VG modifier