Commit Graph

59055 Commits

Author SHA1 Message Date
Campbell Barton
62e149881a Fixes for backbuf selection logic
- Fix ED_view3d_backbuf_sample_rect, r_dist was set completely wrong.
- Avoid duplicate calculations picking the nearest edge.
- Bias against picking selected edges is now optional.
- Remove unused callback reading the backbuf.
- Remove unused strict option picking vertices.
2015-04-21 04:50:39 +10:00
Campbell Barton
aa880bb815 Cleanup: use ED_view3d_backbuf_* prefix 2015-04-21 03:19:27 +10:00
Campbell Barton
d57a93a7cb Fix T44383: Select face fails in some positions
When mixing vert/edge/face with select-visible,
face selection could fail when not close enough to the center.

This also fixes a bug where the bias for verts over edges would
prefer faces over edges too, making edges harder to pick.

Mixing edge with other selection modes works more predictably now.
2015-04-21 03:10:32 +10:00
Campbell Barton
0626d27bf6 Editmesh select nearest fixes
- distance from edge check wasn't clamping 0-1
- vertex bias wasn't taking pixelsize into account.
- index & pass counter were floats

Also some improvements

- use BMesh lookup tables when available.
- use structs to avoid issues getting out of sync.
2015-04-21 01:50:21 +10:00
Campbell Barton
60e8e20132 Cleanup: use macro for common view3d zbuf check 2015-04-21 01:50:20 +10:00
Campbell Barton
57d9badc21 Cleanup: use bool /w flag checks 2015-04-21 01:50:20 +10:00
Sergey Sharybin
6298632bfa Guardedalloc: Don't use aligned blocks to calculate memory sloppyness
Aligned memory is allocated with memalign() and malloc_usable_size() can't be
used to measure this block.
2015-04-20 19:23:25 +05:00
Sergey Sharybin
42e427905c CMake: Move performance tests under the cmake option
This way running full sweep of regression tests does not require
waiting for the performance test to finish.
2015-04-20 18:30:26 +05:00
Bastien Montagne
4d5446cea7 Usual UI messages fixes... 2015-04-20 14:46:09 +02:00
Sergey Sharybin
828abaf11c Cycles: Split BVH nodes storage into inner and leaf nodes
This way we can get rid of inefficient memory usage caused by BVH boundbox
part being unused by leaf nodes but still being allocated for them. Doing
such split allows to save 6 of float4 values for QBVH per leaf node and 3
of float4 values for regular BVH per leaf node.

This translates into following memory save using 01.01.01.G rendered
without hair:

                   Device memory size   Device memory peak   Global memory peak
Before the patch:  4957                 5051                 7668
With the patch:    4467                 4562                 7332

The measurements are done against current master. Still need to run speed tests
and it's hard to predict if it's faster or not: on the one hand leaf nodes are
now much more coherent in cache, on the other hand they're not so much coherent
with regular nodes anymore.

Reviewers: brecht, juicyfruit

Subscribers: venomgfx, eyecandy

Differential Revision: https://developer.blender.org/D1236
2015-04-20 17:29:51 +05:00
Sergey Sharybin
cd44449578 Cycles: Synchronize images after building mesh BVH
This way memory overhead caused by the BVH building is not so visible and peak
memory usage will be reduced.

Implementing this idea is not so straightforward actually, because we need to
synchronize images used for true displacement before meshes. Detecting whether
image is used for true displacement is not so striaghtforward, so for now all
all displacement types will synchronize images used for them.

Such change brings memory usage from 4.1G to 4.0G with the 01_01_01_D scene
from gooseberry. With 01_01_01_G scene it's 7.6G vs. 6.8G (before and after
the patch).

Reviewers: campbellbarton, juicyfruit, brecht

Subscribers: eyecandy

Differential Revision: https://developer.blender.org/D1217
2015-04-20 17:29:51 +05:00
Bastien Montagne
b07c630676 I18n: Add Vietnamese language. 2015-04-20 14:27:20 +02:00
Campbell Barton
6bc26540c2 Fix T44452: Inconsistent gpencil color in prefs 2015-04-20 21:20:39 +10:00
Campbell Barton
fa761dfe6d Fix T44419: extruding when using lasso deselect 2015-04-20 21:10:52 +10:00
Campbell Barton
437f69ab45 Allow Python overrides for materials. 2015-04-20 20:20:33 +10:00
Antony Riakiotakis
9b4c8a2507 Fix T44458 strip modifier mask not copied correctly when doing scene
copy.

What happens is that the strip is copied, but it still refers to the old
scene. Here we need to fix this by referring to the copy of the strip
and also do it after copying to make it order independent.
2015-04-20 11:51:43 +02:00
Sergey Sharybin
0aa2eed0c2 Compilation error fix for MSVC: It does not support expressions in array
declarations
2015-04-20 14:07:26 +05:00
Sybren A. Stüvel
bf6bde232d Fix: BGE crashes when RunPythonCallBackList() is called with maxargcount != minargcount 2015-04-20 13:53:54 +08:00
Joshua Leung
dbb2b29bea Action Stashing: Newly stashed strips now get "sync length" option enabled by default 2015-04-20 17:27:59 +12:00
Joshua Leung
a0e1b6573a Action Editor "Browse" Fix: Stash active action if nothing else uses it
Following the initial action management commits for 2.74, blurrymind pointed out a
problematic workflow involving the "Browse Action" dropdown in the Action Editor
which would lead to actions being accidentally lost. Namely, it turns out that
game animators frequently flip between different actions from the Browse menu while
working.

While the new up/down operators and/or other NLA based tools are better suited to this
without the problems of actions getting lost, some additional precautions were needed
for the Browse menu as well. So now, if the active action will have no users as a result
of the switch (i.e. it was a new action, and the user is checking on a previous action
via the Browse menu), this action will now get stashed. This workflow is not perfect though,
as there is the problem of the stashed action strips not reflecting the actions they reference.
2015-04-20 17:27:58 +12:00
Joshua Leung
689241b6e5 Fix for potential null-pointer-dereference if the new action is NULL 2015-04-20 17:27:57 +12:00
Joshua Leung
e4fbc8fc8d Fix: Changing actions in the Action Editor using the Browse dropdown should happen in tweakmode
When a NLA strip is being tweaked, it should not be possible to use the Action Editor to change
the action that it uses. Instead of changing the action in tweakmode, it now exits tweakmode
first before doing so.
2015-04-20 17:27:56 +12:00
Joshua Leung
5f6b958e96 Fix: "show_points" setting for Grease Pencil drawing didn't work
As reported by zeffi, the "show_points" option was not working in master.
It probably broke recently, after some changes meant that the point sizes
weren't geting set prior to drawing these points anymore. Since this was
originally added as a debugging tool (though it is now somewhat redundant
due to the stroke editing functionality, which uses/exposes the same points),
this option wasn't really that important. I have decided to add back a toggle
for this to the UI though, since it can be used for some interesting effects...
2015-04-20 17:27:55 +12:00
Campbell Barton
79319b3fba Sculpt: remove workaround T25371
It's no longer needed,
and made calc_area_normal different to the normal from calc_area_normal_and_center.
2015-04-20 13:36:51 +10:00
Campbell Barton
436004b6b1 Sculpt: clay-strips was missing accumulate button
Correct & de-duplicate check for accumulate.
2015-04-20 13:23:47 +10:00
Sybren A. Stüvel
07a7d77ec1 Fix: solved BGE compiler error on Linux/gcc 2015-04-20 10:58:25 +08:00
Thomas Dinges
5db143efbb Fix T44449, sm_52 kernel missing in CMake builds. 2015-04-19 22:04:23 +02:00
Porteries Tristan
62f79856e9 BGE : Standardization of callbacks execution.
A new function (RunPythonCallBackList) to call all python functions
contained in a python list was developed.

This function has:
  - first argument is the python list of callbacks
  - second argument is a python list of arguments
  - third argument is the minimum quantity of arguments
  - forth argument is the maximum quantity of arguments

It improves flexibility and supports *args.

Reviewers: moguri, dfelinto, campbellbarton, sybren

Reviewed By: campbellbarton, sybren

Subscribers: sybren

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1102
2015-04-19 20:33:08 +02:00
Campbell Barton
6f0f1dc3be Cleanup: warnings 2015-04-19 22:03:42 +10:00
Campbell Barton
e5048dd4ca Dyntopo: non-topology tool origdata support
Brushes that don't change topology didn't have access to original data.
2015-04-19 19:56:46 +10:00
Campbell Barton
ac73fe5fe0 Cleanup: use meaningful names re: (fc, an, sn) 2015-04-19 18:38:58 +10:00
Campbell Barton
fb6a0d24e1 Dyntopo: support for original normal access
Rename calc_flatten_center to calc_area_center,
since theres no 'flatten' spesific logic there.

Also refactor calc_area_center, calc_area_normal, calc_area_normal_and_center
so they're next to eachother - they're almost the same,
having them scattered about isn't helpful.
2015-04-19 18:24:21 +10:00
Campbell Barton
fe39ebea12 Cleanup: move project code into util function 2015-04-19 17:52:35 +10:00
Campbell Barton
57b020528b Cleanup: calculating sculpt center & normal
also avoid sqrt calculating dyntopo center (only checks for flipping)
2015-04-19 17:03:51 +10:00
Campbell Barton
eb4fb4f4fe disable verify from last commit (too slow) 2015-04-19 16:06:40 +10:00
Campbell Barton
d09a9a9597 Dyntopo: USE_EDGEQUEUE_TAG broke even subdiv
While adding edges to the queue multiple times is redundant,
walking over them is still needed.
2015-04-19 16:03:12 +10:00
Campbell Barton
550c3c2c1e Dyntopo: avoid over-counting /w neighbor average 2015-04-19 14:46:32 +10:00
Campbell Barton
2448c21cb3 Sculpt: avoid CD lookup /w mask smooth 2015-04-19 14:46:32 +10:00
Campbell Barton
9ac618a90e Sculpt: smooth brush, exclude self from average
Was including the vertices own location when accumulating.
2015-04-19 14:46:32 +10:00
Porteries Tristan
3d55859924 BGE: Support for collision group/mask from the api + activated on EndObject.
A Python API for the collision group / mask has been added:
```
KX_GameObject.collisionGroup
KX_GameObject.collisionMask
```
The maximum number of collision groups and masked has been increased from eight to sixteen.
This means that the max value of collisionGroup/Mask is (2 ** 16) - 1

EndObject will now activate objects that were sleeping and colliding with the removed object.
This means that, unlike now, if a rigid body starts sleeping on top of another object, when the latter is removed the rigid body will activate and fall, rather than float midair as before.

Collision groups that do not intersect used to collide on the first frame. Now this has been fixed so that they collide appropriately.

Thanks to agoose77 for his help.

Reviewers: scorpion81, hg1, agoose77, sergof

Reviewed By: agoose77, sergof

Subscribers: sergof, moguri

Projects: #game_physics, #game_engine

Differential Revision: https://developer.blender.org/D1243
2015-04-19 01:04:22 +02:00
Porteries Tristan
a2f9a0cfd9 BGE: Fix T43536 logic.getCurrentScene() returning wrong scene in
pre_draw and post_draw calls

A simple insert of KX_SetActiveScene(scene) before pre_draw and
post_draw calls solves the issue.

Reviewers: dfelinto, sybren, brita_, campbellbarton, moguri, lordloki

Reviewed By: moguri, lordloki

Projects: #game_logic, #game_engine

Differential Revision: https://developer.blender.org/D1129
2015-04-18 21:37:59 +02:00
Campbell Barton
252b0cf5d2 Cleanup: API naming use BKE_undo_ prefix 2015-04-18 18:25:07 +02:00
Campbell Barton
38bea4e86c Cleanup: use BLO_memfile prefix 2015-04-18 18:11:01 +02:00
Antony Riakiotakis
230712e6cb Autosave:
Flush edits only when saving global undo. This will stop freeing of PBVH
in sculpt mode, which introduces some pretty severe freezes, especially
in dyntopo. For global undo we flush the contents of the global undo
buffer which does not include localized edits of sculpt/edit mode, so
those data will not get saved anyway.
2015-04-18 15:50:29 +02:00
Porteries Tristan
4f2657bf47 BGE: New Draw debug shadow box for sun lamp
New Check option "Show Shadow Box" in shadow panel of sun lamp to get
feedback about which objects project shadows.

Minor tweaks by Campbell Barton and Jorge Bernal

Reviewers: moguri, sybren, kupoman, dfelinto, lordloki, campbellbarton

Reviewed By: lordloki, campbellbarton

Subscribers: sergey, lordloki

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1149
2015-04-18 12:30:02 +02:00
Campbell Barton
3a4a2a9427 Fix T44390: Clay brush weirdness part-2
Use the normal of the plane instead of the vertex normal,
since projecting using the vertex normal frequently causes artifacts.
2015-04-18 05:08:14 +10:00
Campbell Barton
05b6de545a Fix T44390: Clay brush weirdness part-1
Clay brush had a feedback loop with dyntopo,
getting the plane from the cursor center didn't support original data.
2015-04-18 05:08:03 +10:00
Campbell Barton
b0c2fdd927 Cleanup: simplify sculpt normal accumulation 2015-04-18 03:09:16 +10:00
Campbell Barton
28b9a0276f Cleanup: simplify sculpt plane accumulation 2015-04-18 02:54:49 +10:00
Porteries Tristan
e0aeafdf0a BGE : Fix light layer check
The layers in Blender are using a bit field for the 20 layers. The light layer value was limited to 20, so the highest usable light layer was five.
The patch modify the range and add layer out of range error messages.

Reviewers: sybren, hg1, moguri

Reviewed By: hg1, moguri

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1238
2015-04-17 18:12:51 +02:00