Campbell Barton [Fri, 8 Jul 2016 00:14:49 +0000 (10:14 +1000)]
Cleanup: use normalize_v#_length
Campbell Barton [Thu, 7 Jul 2016 23:52:29 +0000 (09:52 +1000)]
BLI_math: add normalize functions which fit to a length
Convenient since its common to normalize then scale,
since these are inlined, use for regular normalize w/ 1.0 length.
Campbell Barton [Thu, 7 Jul 2016 23:46:12 +0000 (09:46 +1000)]
Cleanup: spelling
Bastien Montagne [Thu, 7 Jul 2016 19:18:04 +0000 (21:18 +0200)]
Make use of new 'idtype can use idtype' check (in ID usages code, and ID remapping one too).
Reduces calls to BKE_library_foreach_ID_link() from 312 to 105 when relocating a library in a
rather simple lib reload test...
Bastien Montagne [Thu, 7 Jul 2016 18:51:21 +0000 (20:51 +0200)]
libquery: add new 'BKE_library_idtype_can_use_idtype()' helper.
This should allow us to avoid a lot of useless processing when iterating over the
whole main database (unlink/remap/usages checks/etc.).
Note that some ID types report they can use any type for now, due to
fuzzyness/indefined nature of some usages (like constraints/modifiers/game logic,
or ID pointer of nodes...). Maybe we could address this (like e.g. adding defines
in relevant headers to restrict ID types used by constraints, by modifiers, etc.).
But don’t think this is top priority for now.
Bastien Montagne [Thu, 7 Jul 2016 18:48:33 +0000 (20:48 +0200)]
Cleanup/fix animsys 'id_type_can_have_animdata()'.
This func now actually takes an ID type as argument, added new 'id_can_have_animdata()'
to check whether a datablock may be animated or not.
Bastien Montagne [Thu, 7 Jul 2016 17:39:14 +0000 (19:39 +0200)]
Extend libquery checks to test wether an ID is used locally and/or indirectly.
Campbell Barton [Thu, 7 Jul 2016 16:14:54 +0000 (02:14 +1000)]
Fix T48793: Bilinear filter clamps at edge pixels
Campbell Barton [Thu, 7 Jul 2016 15:38:22 +0000 (01:38 +1000)]
Fix single threaded compositor define
Sergey Sharybin [Thu, 7 Jul 2016 10:41:45 +0000 (12:41 +0200)]
Cycles: Enable unaligned BVH builder for scenes with hair
This commit enables new unaligned BVH builder and traversal for scenes
with hair. This happens automatically, no need of manual control over
this.
There are some possible optimization still to happen here and there,
but overall there's already nice speedup:
Master Hair BVH
bunny.blend 8:06.54 5:57.14
victor.blend 16:07.44 15:37.35
Unfortunately, such more complexity is not really coming for free,
so there's some downsides, but those are within acceptable range:
Master Hair BVH
classroom.blend 5:31.79 5:35.11
barcelona.blend 4:38.58 4:44.51
Memory usage is also somewhat bigger for hairy scenes, but speed
benefit pays well for that. Additionally as was mentioned in one
of previous commits we can add an option to disable hair BVH and
have similar render time but have memory saving.
Reviewers: brecht, dingto, lukasstockner97, juicyfruit, maiself
Differential Revision: https://developer.blender.org/D2086
Sergey Sharybin [Thu, 7 Jul 2016 10:23:13 +0000 (12:23 +0200)]
Cycles: Implement unaligned nodes BVH traversal
This commit implements traversal of unaligned BVH nodes.
QBVH traversal is fully SIMD optimized and calculates orientation
for all 4 children at a time, regular BVH might probably be optimized
a bit more.
Sergey Sharybin [Thu, 7 Jul 2016 10:18:57 +0000 (12:18 +0200)]
Cycles: Implement unaligned nodes BVH builder
This is a special builder type which is allowed to orient nodes to
strands direction, hence minimizing their surface area in comparison
with axis-aligned nodes. Such nodes are much more efficient for hair
rendering.
Implementation of BVH builder is based on Embree, and generally idea
there is to calculate axis-aligned SAH and oriented SAH and if SAH
of oriented node is smaller than axis-aligned SAH we create unaligned
node.
We store both aligned and unaligned nodes in the same tree (which
seems to be different from what Embree is doing) so we don't have
any any extra calculations needed to set up hair ray for BVH
traversal, hence avoiding any possible negative effect of this new
BVH nodes type.
This new builder is currently not in use, still need to make BVH
traversal code aware of unaligned nodes.
Sergey Sharybin [Tue, 14 Jun 2016 12:29:09 +0000 (14:29 +0200)]
Cycles: Switch node address to absolute values in BVH tree
This seems to be straightforward way to support heterogeneous nodes
in the same tree.
There is some penalty related on 4gig limit of the address space now,
but here's are the thing:
Traversal code was already using ints to store final offset, so
there can't be regressions really.
This is a required commit to make it possible to encode both aligned
and unaligned nodes in the same array. Also, in the future we can use
this to get rid of __leaf_nodes array (which is a bit tricky to do since
trickery in pack_instances().
Sergey Sharybin [Fri, 10 Jun 2016 14:13:50 +0000 (16:13 +0200)]
Cycles: Reduce memory usage by de-duplicating triangle storage
There are several internal changes for this:
First idea is to make __tri_verts to behave similar to __tri_storage,
meaning, __tri_verts array now contains all vertices of all triangles
instead of just mesh vertices. This saves some lookup when reading
triangle coordinates in functions like triangle_normal().
In order to make it efficient needed to store global triangle offset
somewhere. So no __tri_vindex.w contains a global triangle index which
can be used to read triangle vertices.
Additionally, the order of vertices in that array is aligned with
primitives from BVH. This is needed to keep cache as much coherent as
possible for BVH traversal. This causes some extra tricks needed to
fill the array in and deal with True Displacement but those trickery
is fully required to prevent noticeable slowdown.
Next idea was to use this __tri_verts instead of __tri_storage in
intersection code. Unfortunately, this is quite tricky to do without
noticeable speed loss. Mainly this loss is caused by extra lookup
happening to access vertex coordinate.
Fortunately, tricks here and there (i,e, some types changes to avoid
casts which are not really coming for free) reduces those losses to
an acceptable level. So now they are within couple of percent only,
On a positive site we've achieved:
- Few percent of memory save with triangle-only scenes. Actual save
in this case is close to size of all vertices.
On a more fine-subdivided scenes this benefit might become more
obvious.
- Huge memory save of hairy scenes. For example, on koro.blend
there is about 20% memory save. Similar figure for bunny.blend.
This memory save was the main goal of this commit to move forward
with Hair BVH which required more memory per BVH node. So while
this sounds exciting, this memory optimization will become invisible
by upcoming Hair BVH work.
But again on a positive side, we can add an option to NOT use Hair
BVH and then we'll have same-ish render times as we've got currently
but will have this 20% memory benefit on hairy scenes.
Sergey Sharybin [Fri, 10 Jun 2016 08:14:05 +0000 (10:14 +0200)]
Cycles: Support visibility check for inner nodes of QBVH
It was initially unsupported because initial idea of checking visibility
of all children was slowing scenes down a lot. Now the idea has changed
and we only perform visibility check of current node. This avoids huge
slowdown (from tests here it seems to be withing 1-2%, but more tests
would never hurt) and gives nice speedup of ray traversal for complex
scenes which utilized ray visibility.
Here's timing of koro.blend:
Without visibility check With visibility check
Original file 4min 20sec 4min 23sec
Camera rays only 1min 43 sec 55sec
Unfortunately, this doesn't come for free and requires extra data in
BVH node, which increases memory usage of BVH nodes by 15%. This we
can solve with some future trickery of avoiding __tri_storage created
for curve segments.
Bastien Montagne [Thu, 7 Jul 2016 15:23:12 +0000 (17:23 +0200)]
Quiet gcc warning-as-error about non-const pointer passed to const parameter.
Bastien Montagne [Thu, 7 Jul 2016 15:03:30 +0000 (17:03 +0200)]
Fix T48802 Unwrap buttons, can't add hotkey in 3DView's UV Unwrap menu.
Those unwrap operators are a bit tricky, some are available from both 3DView and UVEditor, others only from 3DView...
Hacked around this by returning Mesh keymap for UV_OT ops for specific 3DView/MeshEditMode context.
Campbell Barton [Thu, 7 Jul 2016 14:56:01 +0000 (00:56 +1000)]
RNA: rename sorting -> sort
Shorter and consistent with other RNA.
Campbell Barton [Thu, 7 Jul 2016 14:49:44 +0000 (00:49 +1000)]
Skip the ID part of object names when comparing
Also no need to calloc arrays which are immediately filled
Campbell Barton [Thu, 7 Jul 2016 14:48:03 +0000 (00:48 +1000)]
Cleanup: spelling, style
Campbell Barton [Thu, 7 Jul 2016 14:28:41 +0000 (00:28 +1000)]
Cleanup: use static sets, remove redundant copy
Joshua Leung [Thu, 7 Jul 2016 13:59:43 +0000 (01:59 +1200)]
Revert "ChildOf Constraint: Hide the Loc/Rot/Scale toggles"
This reverts commit
4fd78bb06faa31f265af6a5f247cf4255b5ac479.
After further testing, it turns out that these options are less-broken than
I remember them being (and have been hearing about). Specifically, as long
as you disable all 3-axes of a transform component (i.e. all location, all
rotation, all scale) you're not likely to have problems, whereas if you only
disabled one axis (i.e. y-rotation), you may have problems in some cases.
So, restoring these to the UI.
Joshua Leung [Thu, 7 Jul 2016 13:37:41 +0000 (01:37 +1200)]
Code Cleanup - Split out the FCurve auto-color code into a separate function
Joshua Leung [Thu, 7 Jul 2016 13:24:47 +0000 (01:24 +1200)]
Fix T48747: Stuck in edit mode after selecting another object in the animation editors
Joshua Leung [Thu, 7 Jul 2016 12:32:05 +0000 (00:32 +1200)]
Fix: Keyframe click-selection threshold in Dopesheet was still hardcoded to 7px
Joshua Leung [Thu, 7 Jul 2016 11:37:15 +0000 (23:37 +1200)]
Dopesheet: Added "Moving Hold" as a keyframe type
Currently "long keyframes" are only useful for indicating where stationary
holds occur. If however you try to create a "moving hold" (where the values
are slightly different, but in terms of overall effect, it's still a hold)
then it could get tricky to keep track of where these occur.
Now it's possible to tag such keyframes (using the keyframe types - RKEY)
as being part of a moving hold. These will not only be drawn differently
from normal keyframes, but they will also result in a "long keyframe"
being drawn between each pair of them, just like if they had been completely
stationary instead.
Currently the theming/styling of these is a bit rough. They reuse the existing
theme colours for long keyframes.
Joshua Leung [Mon, 4 Jul 2016 00:52:51 +0000 (12:52 +1200)]
Transforms to Delta Transforms
* Added new operators to take the current transform value (loc/rot/scale or all 3)
and convert/apply that transform to a corresponding delta transform value. By default,
the transform value will be zeroed out again afterwards, so you don't end up with a
double transform.
* These operators can be found in the "Apply" menu (Ctrl-A)
* The "Animated Transforms to Deltas" (which does a similar job, except it adjusts all
existing animation data instead of the current transform) has also been moved to the
Apply menu (it was in the Transform menu instead)
Joshua Leung [Sun, 3 Jul 2016 14:50:10 +0000 (02:50 +1200)]
Animation Editors: Object datablocks are now sorted alphabetically by default
A long requested feature has been to have objects appear in alphabetical order
in the animation editors, so that it is easier to find where they occur. This
commit implements support for this.
The main sticking point has been the performance impact of having this sorting
happening all the time (as the actual list of "bases" cannot be modified, as the
old depsgraph still needs random-looking unsorted order of objects for scheduling
updates). However, it recently occurred to me that perhaps by restricting it to
the one case where the ordering actually matters (i.e. when we're getting the channel
list for drawing all channels, vs operating on them), and adding a toggle to turn the
sorting off in heavy scenes when it might bog down things, that it will probably
be acceptable enough in general. Furthermore, if things get really bad, we can investigate
putting in place some sort of caching scheme for this too - though hopefully the
new depsgraph will make that unnecessary (i.e. it doesn't sort the bases directly anymore).
Joshua Leung [Sun, 3 Jul 2016 07:25:09 +0000 (19:25 +1200)]
Code Cleanup: Move out logic for checking if an object can be included in the dopesheet
Joshua Leung [Sat, 2 Jul 2016 15:42:28 +0000 (03:42 +1200)]
Dopesheet: Keyframe size can be adjusted as part of theme settings
This commit introduces a scale factor setting for scaling all keyframe indicators
in the Dopesheet Editor up/down, in order to make them easier to select. It is perhaps
most useful for keyframe types which are usually indicated using smaller keyframes
(e.g. breakdown), which may get tricky to quickly select.
Joshua Leung [Tue, 28 Jun 2016 15:16:07 +0000 (03:16 +1200)]
NLA: Indicate position of action-local markers on strips
To make it easier to synchronise timing across multiple strips, if you add
markers locally to an action, these will show up in the NLA strip in the
NLA Editor. These markings can then be used to line up the start/end of
another strip, or even to make sure that the markers from two different
strips end up lining up.
By default, this is turned on, but it can be disabled (via the View menu)
if it adds too much visual noise.
Bastien Montagne [Thu, 7 Jul 2016 12:52:39 +0000 (14:52 +0200)]
Fix (unreported) crash when remapping armatures.
Objects' Pose holds references to the armature bones, so we have to force POSE_RECALC in those cases...
Campbell Barton [Thu, 7 Jul 2016 06:36:25 +0000 (16:36 +1000)]
Outliner: Match search length w/ id name length
Campbell Barton [Thu, 7 Jul 2016 06:27:33 +0000 (16:27 +1000)]
writefile: call undo flush after writing the windowmanager
Data here is constantly changing, avoids outliner data being included in those changes for undo.
Campbell Barton [Thu, 7 Jul 2016 06:02:45 +0000 (16:02 +1000)]
Cleanup: move write flush into its own function
No point passing dummy args to existing function, split out logic instead.
Also add flush after writing mesh data too.
Campbell Barton [Thu, 7 Jul 2016 05:48:25 +0000 (15:48 +1000)]
Fix memory leak switching sculpt mode + dyntopo
Auto-enabling dyntopo w/ mode switching leaked memory when undo was used.
Germano Cavalcante [Thu, 7 Jul 2016 05:16:27 +0000 (15:16 +1000)]
Transform Snap: fix vert & edit object in ortho view
The callback used in `BLI_bvhtree_find_nearest_to_ray` was wrong and could result in crash.
Also de-duplicate vert/edge logic.
Brecht Van Lommel [Wed, 6 Jul 2016 19:43:55 +0000 (21:43 +0200)]
Fix failing script_load_addons test after recent code cleanup.
Sergey Sharybin [Wed, 6 Jul 2016 15:39:09 +0000 (17:39 +0200)]
Cycles tests: Don't create fail file on idiff warning
Bastien Montagne [Wed, 6 Jul 2016 15:12:35 +0000 (17:12 +0200)]
Revert rB961ebfa8c40b9909 - do not set Main's versions directly in do_versions().
This breaks any post-versionning (like IPO conversion, python handler, etc.).
rB961ebfa8c40b9909 mentions some Main being do_versionned several times (which is not desired for sure),
will try to reproduce again and find another fix.
Dalai Felinto [Wed, 6 Jul 2016 14:32:46 +0000 (11:32 -0300)]
Fix Python API error message (do_unlink, instead of unlink)
Campbell Barton [Wed, 6 Jul 2016 13:27:22 +0000 (23:27 +1000)]
writefile: add flushes
Flush on grease pencil and data with image preview or packed data.
Campbell Barton [Wed, 6 Jul 2016 12:23:50 +0000 (22:23 +1000)]
writefile: avoid adding SDNA to every undo step
Since SDNA was allocated for each undo step,
the new address meant it was considered different and included again.
Add an option not to duplicate the DNA string when calling DNA_sdna_from_data,
as well as avoiding a redundant copy, it writes the same address each time.
Bastien Montagne [Wed, 6 Jul 2016 12:45:06 +0000 (14:45 +0200)]
Fix memleak with recent Outliner writefile changes.
Bastien Montagne [Wed, 6 Jul 2016 12:37:03 +0000 (14:37 +0200)]
Cleanup/simplify/fixes BKE_object_is_libdata and BKE_object_obdata_is_libdata.
Removed checks for ob->proxy from the equation, you can totally have proxy objects
linked into another .blend file!
Bastien Montagne [Wed, 6 Jul 2016 12:11:01 +0000 (14:11 +0200)]
Replace of (id->lib != NULL) check by meaningful macro.
Idea is to replace hard-to-track (id->lib != NULL) 'is linked datablock' check everywhere in Blender
by a macro doing the same thing. This will allow to easily spot those checks in future, and more importantly,
to easily change it (see work done in asset-engine branch).
Note: did not touch to readfile.c, since there most of the time 'id->lib' check actually concerns the pointer,
and not a check whether ID is linked or not. Will have a closer look at it later.
Reviewers: campbellbarton, brecht, sergey
Differential Revision: https://developer.blender.org/D2082
Campbell Barton [Wed, 6 Jul 2016 11:58:47 +0000 (21:58 +1000)]
writefile: simplify outliner treestore workaround
Instead of keeping a list of allocations, write to unique addresses
based on the BLI_mempool address since we know this is unique.
Campbell Barton [Wed, 6 Jul 2016 09:15:47 +0000 (19:15 +1000)]
Cleanup: redundant 4th index in sculpt PBVH
Since moving to MLoopTri this is no longer needed.
Campbell Barton [Wed, 6 Jul 2016 06:33:47 +0000 (16:33 +1000)]
Dyntopo: optimize edge collapsing
Checking if faces exist was a bottleneck,
use a simpler version of this function for triangles.
Gives approx 1.6x overall speedup (when many edges are being collapsed).
Campbell Barton [Wed, 6 Jul 2016 06:32:17 +0000 (16:32 +1000)]
Cleanup: group dyntopo utility functions
Germano Cavalcante [Wed, 6 Jul 2016 01:34:28 +0000 (11:34 +1000)]
Transform Snap: Replace pixel limit w/ 'dist_to_ray_sq'
When snapping to edge/vert, check the distance to the ray
instead of the screen-space pixel projection.
This also corrects the conversion of `dist_to_ray_sq` to `dist_px` which was being done incorrectly.
While this change was planned, it fixes T48791, caused by error in
b01a56ee.
Brecht Van Lommel [Tue, 5 Jul 2016 20:26:15 +0000 (22:26 +0200)]
Code cleanup: for Cycles compatible panels, use exclusion rather than inclusion list.
This shortens the list, and Blender render specific panels are added less often
than other panels anyway, so less chance to miss things.
Brecht Van Lommel [Mon, 4 Jul 2016 23:40:20 +0000 (01:40 +0200)]
Render border: don't disable when drawing around the entire camera.
Differential Revision: https://developer.blender.org/D712
Brecht Van Lommel [Mon, 4 Jul 2016 23:39:13 +0000 (01:39 +0200)]
Render border: skip unnecessary uncropping if the border covers the entire image.
Brecht Van Lommel [Sat, 2 Jul 2016 12:22:25 +0000 (14:22 +0200)]
Render border: make it work together with with cache result / save buffers / full sample.
Differential Revision: https://developer.blender.org/D2080
Campbell Barton [Tue, 5 Jul 2016 08:45:16 +0000 (18:45 +1000)]
Dyntopo: missing PBVH update collapsing an edge
PBVH-nodes attached to the vertex to be deleted were updated,
but not nodes attached to the other vertex in the edge.
Campbell Barton [Tue, 5 Jul 2016 08:55:06 +0000 (18:55 +1000)]
Dyntopo: avoid redundant vector copy
Campbell Barton [Tue, 5 Jul 2016 08:43:16 +0000 (18:43 +1000)]
Dyntopo: inline lookups, remove type check
This was checking vert/face for every lookup,
so far the type is always known, do a direct lookup instead.
Campbell Barton [Tue, 5 Jul 2016 07:23:03 +0000 (17:23 +1000)]
Dyntopo: use inline iterators
Gives small performance boost.
Campbell Barton [Tue, 5 Jul 2016 06:21:58 +0000 (16:21 +1000)]
Dyntopo: compare masks when collapsing
Was just checking the value of the first
Campbell Barton [Tue, 5 Jul 2016 06:19:19 +0000 (16:19 +1000)]
Dyntopo: verify had over zealous asserts
Brecht Van Lommel [Mon, 4 Jul 2016 14:43:32 +0000 (16:43 +0200)]
Cycles: remove extended precision hacks, no longer needed with SSE2 requirement.
Differential Revision: https://developer.blender.org/D2079
Brecht Van Lommel [Mon, 4 Jul 2016 15:30:05 +0000 (17:30 +0200)]
Fix a few compiler warnings on OS X / clang.
Two were actual bugs, though they existed only in unused code:
* In Freestyle it was unintentionally copying a scene rather than referencing it.
* In BLI_array_store_is_valid there was use of uninitialized memory.
Brecht Van Lommel [Mon, 4 Jul 2016 15:29:52 +0000 (17:29 +0200)]
Fix use of uninitialized variable introduced in fix for T48755.
Bastien Montagne [Mon, 4 Jul 2016 14:10:40 +0000 (16:10 +0200)]
And one more fix to particle distribution!
As pointed by Brecht, previous fix in rB61b49de44940 was actually incomplete,
we could still hit float rounding issue and hence same value in more than one consecutive
items of element_sum.
New solution is a bit different, we remove the 'minimal weight' check, and rather simply
ignores an item when the sum of its normalized weight to previous item's sum does not add
anything. Shall be safe and 100% effective this time!
Bastien Montagne [Sat, 2 Jul 2016 17:11:13 +0000 (19:11 +0200)]
Fix bmesh test after recent refactor.
Alexander Romanov [Mon, 4 Jul 2016 08:19:13 +0000 (11:19 +0300)]
BI Viewport(GLSL): support for envmap in Texture node
This patch is another step to achieve BI and it's Viewport consistency for cubemap textures.
{
F318879}
To test world_space_shading flag D2072 is required.
Alexander (Blend4Web Team)
Reviewers: campbellbarton, brecht
Subscribers: homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov
Differential Revision: https://developer.blender.org/D2074
Alexander Romanov [Mon, 4 Jul 2016 08:08:48 +0000 (11:08 +0300)]
Fix input for Texture node (envmap+world_space_shading)
This patch fixes shortcoming of D2046.
The original behavior without world_space_shading flag is that Texture node expects the reflected vector in view space. But with world_space_shading it should be in world space.
In attached file you will see a simple material setup and a node material analogue.
Simple material must have the same behavior regardless world_space_shading flag.
{
F318866}
Alexander (Blend4Web Team)
Reviewers: brecht
Reviewed By: brecht
Subscribers: campbellbarton, homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov
Differential Revision: https://developer.blender.org/D2072
Alexander Romanov [Mon, 4 Jul 2016 08:01:32 +0000 (11:01 +0300)]
Environment lighting for the GLSL mode
Environment lighting (aka ambient) is a key component of any renderer.
It's implemented like the Environment lighting of BI render for Approximate Gather mode. It support "Sky Color" and "White" Environment lighting modes.
It would be great if the user could see actual lighting conditions right in the Blender viewport instead of waiting for the renderer to complete the final image, exporting for external renderer or for a game engine.
Before:
{
F113921}
After:
{
F113922}
Example file: {
F319013}
Original author: valentin_b4w
Alexander (Blend4Web Team)
Reviewers: valentin_b4w, campbellbarton, merwin, brecht
Reviewed By: brecht
Subscribers: panzergame, youle, duarteframos, AlexKowel, yurikovelenov, dingto, Evgeny_Rodygin
Projects: #rendering, #opengl_gfx
Differential Revision: https://developer.blender.org/D810
Campbell Barton [Mon, 4 Jul 2016 04:55:29 +0000 (14:55 +1000)]
Quiet warnings w/ USE_VERIFY define
Campbell Barton [Sun, 3 Jul 2016 13:20:53 +0000 (23:20 +1000)]
Curve: utility to evaluate entire curve
Campbell Barton [Sun, 3 Jul 2016 11:13:43 +0000 (21:13 +1000)]
Update pacman pkgbuild
Brecht Van Lommel [Sun, 3 Jul 2016 11:08:21 +0000 (13:08 +0200)]
Fix T48783: OSL render errors after recent refactoring.
Brecht Van Lommel [Sat, 2 Jul 2016 12:11:11 +0000 (14:11 +0200)]
Fix use of uninitialized variable in Cycles OpenCL image textures.
Thomas Szepe [Sat, 2 Jul 2016 16:38:05 +0000 (18:38 +0200)]
Fix typo in bgl.Buffer report function
A GL_INT buffer was reported as GL_BYTE.
Thomas Dinges [Sat, 2 Jul 2016 16:07:20 +0000 (18:07 +0200)]
Install Deps: Use OSL 1.7.3, latest bugfix release.
Campbell Barton [Sat, 2 Jul 2016 10:21:39 +0000 (20:21 +1000)]
Correction for MSVC
Campbell Barton [Sat, 2 Jul 2016 08:07:58 +0000 (18:07 +1000)]
BMesh: utility function to resize bmesh elements
This can be used to re-allocate bmesh data with/without tool flags.
Needed for Symmetrize since it uses bmesh operators from dyntopo.
Campbell Barton [Sat, 2 Jul 2016 00:02:04 +0000 (10:02 +1000)]
Cleanup: comment blocks
Campbell Barton [Sat, 2 Jul 2016 00:00:30 +0000 (10:00 +1000)]
Cleanup: style
Thomas Dinges [Fri, 1 Jul 2016 21:48:31 +0000 (23:48 +0200)]
Fix Cycles OpenCL not taking Extend and Clip extension types into account.
(See T48720).
Bastien Montagne [Fri, 1 Jul 2016 15:51:08 +0000 (17:51 +0200)]
"Fix" crash when deleting linked object which has indirect usages.
This is in fact very hairy situation here... Objects are only refcounted by scenes,
any other usage is 'free', which means once all object instanciations are gone Blender
considers it can delete it.
There is a trap here though: indirect usages. Typically, we should never modify linked data
(because it is essencially useless, changes would be ignored and ost on next reload or
even undo/redo). This means indirect usages are not affected by default 'safe' remapping/unlinking.
For unlinking preceeding deletion however, this is not acceptable - we are likely to end with
a zero-user ID (aka deletable one) which is still actually used by other linked data.
Solution choosen here is double:
I) From 'user-space' (i.e. outliner, operators...), we check for cases where deleting datablocks
should not be allowed (indirect data or indirectly used data), and abort (with report) if needed.
II) From 'lower' level (BKE_library_remap and RNA), we also unlink from linked data,
which makes actual deletion possible and safe.
Note that with previous behavior (2.77 one), linked object would be deleted, including from linked data -
but then, once file is saved and reloaded, indirect usage would link back the deleted object,
without any instanciation in scene, which made it somehow virtual and unreachable...
With new behavior, this is no more possible, but on the other hand it means that in situations of dependency cycles
(two linked objects using each other), linked objects become impossible to delete (from user space).
Not sure what's best here, behavior with those corner cases of library linking is very poorly defined... :(
Bastien Montagne [Fri, 1 Jul 2016 15:16:39 +0000 (17:16 +0200)]
Outliner: pass operator's reports to all operation callbacks.
Also define single callback func typedef, cleaner this way!
Note: maybe we want to do that for the other callbacks too (data, etc.), but will be enough for now.
Sergey Sharybin [Fri, 1 Jul 2016 12:19:47 +0000 (14:19 +0200)]
Fix T48666: Segfault on boolean operation when exiting edit mode of instanced operand
This is quite tricky situation which combined:
- Boolean modifier which accesses other object's derived mesh
(in fact, it's nothing to do with boolean modifier, any other
modifier which uses other's DM will have same bug).
- Dependency cycles in the scene which is rather russian-roulette
from the cycle solver point of view.
- Multiple instanced objects used as boolean operand.
With all this things combined boolean modifier was accessing operand's derived
mesh which was referencing data from Mesh datablock. The issue is that those
references are becoming invalid after EDBM_mesh_load().
This function already had code to make sure object itself does not end up with
dangling pointers from derived mesh. Make it now so no possible instanced objects
are left with dangling pointers.
And who said it's a good idea to reference something from derived mesh..
Alexander Gavrilov [Fri, 1 Jul 2016 12:11:43 +0000 (22:11 +1000)]
UI: take zoom into account w/ curves widget
The Curves widget has buttons to zoom in on the curve. However the
click detection code doesn't take it into account, and at full zoom
in click on curve is detected very far from the actual visible curve.
Change it to compare the position to the actual line segments
in the UI coordinate space, i.e. with curve zoom applied.
Campbell Barton [Fri, 1 Jul 2016 11:50:53 +0000 (21:50 +1000)]
Add wait cursor toggling dyntopo
Campbell Barton [Fri, 1 Jul 2016 11:40:59 +0000 (21:40 +1000)]
UI: move dyntopo button to header
This looks a bit odd, but being able to see if dyntopo is enabled
when the panel is collapsed is handy.
Campbell Barton [Fri, 1 Jul 2016 11:13:12 +0000 (21:13 +1000)]
Sculpt: skip normal calculation entering dyntopo
When no triangulation runs we can skip re-calculating normals.
Ulysse Martin [Fri, 1 Jul 2016 11:53:09 +0000 (11:53 +0000)]
BGE: Display Hardware infos only in standalone.
This patch moves the PrintHardwareInfo() function in standalone only, not in embedded. Why? Because you can need this infos for debugging
purpose in "compiled" blender files but it was boring to have it displayed each time you launched embedded. So you can have this infos when you
click standalone or when you run your executable app from a console.
Reviewers: moguri, kupoman, panzergame.
Campbell Barton [Fri, 1 Jul 2016 09:47:00 +0000 (19:47 +1000)]
Enable dyntopo re-entering sculpt mode
Campbell Barton [Fri, 1 Jul 2016 09:07:11 +0000 (19:07 +1000)]
BMesh: make toolflags optional
Saves 8 bytes per vert/edge/face.
Gives overall ~20-25% memory saving for dyntopo sculpting
and modifiers that use BMesh.
Alexander Romanov [Thu, 30 Jun 2016 09:40:10 +0000 (12:40 +0300)]
Fix T48757: Broken in D1120 normal baking
Sergey Sharybin [Thu, 30 Jun 2016 09:20:20 +0000 (14:20 +0500)]
Fix T48728, part 2: Vertex colors not shown in texture mode
Germano Cavalcante [Thu, 30 Jun 2016 05:43:47 +0000 (15:43 +1000)]
Transform Snap: Optimize edge-snap using BVH tree
changes in BLI_kdopbvh:
- `BLI_bvhtree_find_nearest_to_ray` now takes is_ray_normalized and scale argument.
- `BLI_bvhtree_find_nearest_to_ray_angle` has been added (use for perspective view).
changes in BLI_bvhutils:
- `bvhtree_from_editmesh_edges_ex` was added.
changes in math_geom:
- `dist_squared_ray_to_seg_v3` was added.
other changes:
- `do_ray_start_correction` is no longer necessary to snap to verts.
- the way in which the test of depth was done before is being simulated in callbacks.
Campbell Barton [Wed, 29 Jun 2016 22:49:50 +0000 (08:49 +1000)]
CMake: list buildinfo.h as buildinfo.cmake's output
Keep the fake header to ensure we always run.
Campbell Barton [Wed, 29 Jun 2016 22:10:49 +0000 (08:10 +1000)]
Correct fix for MSVC
Bastien Montagne [Wed, 29 Jun 2016 15:57:41 +0000 (17:57 +0200)]
Fix bplayer (c)
Campbell Barton [Wed, 29 Jun 2016 13:22:54 +0000 (23:22 +1000)]
Cleanup: use const
Campbell Barton [Wed, 29 Jun 2016 10:37:54 +0000 (20:37 +1000)]
Cleanup: spelling, indentation
Germano Cavalcante [Wed, 29 Jun 2016 09:31:57 +0000 (19:31 +1000)]
Fix T48695: Slowdown w/ edit-mesh & shrinkwrap
0b5a0d84 caused regression since edit-mesh BVH wasn't cached,
each shrink-wrap modifier created its own BVH.