Commit Graph

64906 Commits

Author SHA1 Message Date
Sergey Sharybin
0f457a3f8d Depsgraph: Fix shape key nodes trying to be added multiple times 2016-07-11 15:07:39 +02:00
Campbell Barton
96dd4cdb9e Cleanup: line length 2016-07-11 23:06:14 +10:00
Sergey Sharybin
b99f7a9b2a Cycles: Fix Extend image extension mode on OpenCL 2016-07-11 14:46:42 +02:00
Sergey Sharybin
cb3b19730c Cycles: Use utility define for restrict pointers
This way restrict can be used for CUDA and OpenCL as well.

From quick tests in areas i've been testing this it might give some
barely measurable %% of speedup, but it increases registers pressure.

So use of this qualifier is still really limited.
2016-07-11 13:58:47 +02:00
Sergey Sharybin
cf82b49a0f Cycles: Cleanup, variables name
Using camel case for variables is something what didn't came from our original
code, but rather from third party libraries. Let's avoid those as much as possible.
2016-07-11 13:58:47 +02:00
Sergey Sharybin
2ecbc3b777 Cycles: Add _all suffix to shadow traversal file
Matches better naming of volume traversal files, where we've got
optimized versions of a single step of volume intersection and
traversal which will gather all volume intersections.
2016-07-11 13:58:47 +02:00
Sergey Sharybin
4355603790 Cycles: Move BVK kernel files to own directory
BVH traversal is not really that much a geometry and we've got
quite some traversals now. Makes sense to keep them separate in
the name of source structure clarity.
2016-07-11 13:58:47 +02:00
Campbell Barton
c58ae20f6c Dyntopo: fix lop-sided edge collapse
When an edge was collapsed, one of the vertices would be removed.
Edges attached to the deleted vertex wouldn't be considered for collapsing again,
making the outcome from collapsing edges depend on the edge-vertex order.

Use a hash to lookup the final vertex when collapsing edges, instead of skipping them.
2016-07-11 21:59:15 +10:00
Campbell Barton
6ea43f9aca Fix sculpting high poly meshes
Attempted to free unallocated memory,
interestingly nobody noticed this for ~7 years (error from 3078c806).
2016-07-11 17:17:08 +10:00
Campbell Barton
0eb61baecc Dyntopo: possible modified option was incorrectly set 2016-07-11 17:17:08 +10:00
Campbell Barton
12d2329d0e Dyntopo: remove redundant existing face check
Gives minor speedup
2016-07-11 17:17:02 +10:00
Campbell Barton
b32408eff8 BLI_math: move interp_*_cubic to its own function 2016-07-11 17:16:35 +10:00
Campbell Barton
e41abdb907 CMake: suppressing indentation warning for extern 2016-07-11 17:16:35 +10:00
Bastien Montagne
47c47c7e78 Fix T48822: Crash when I try to use "Join" (Ctrl Key + J) with two meshes.
Own stupid typo in recent refactor work...
2016-07-10 20:12:58 +02:00
Bastien Montagne
8df92988cf Refactor/enhance BKE_action_make_local().
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-10 17:14:45 +02:00
Bastien Montagne
406309cd8c Refactor/enhance ntreeMakeLocal().
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-10 17:14:45 +02:00
Bastien Montagne
ad5918d278 Refactor/enhance BKE_image_make_local().
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-10 17:14:45 +02:00
Bastien Montagne
f35320bddf Refactor/enhance BKE_material_make_local() and BKE_image_make_local().
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-10 17:14:45 +02:00
Bastien Montagne
8932b5945e Refactor/enhance BKE_lamp_make_local() and BKE_camera_make_local().
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-10 17:14:45 +02:00
Bastien Montagne
0f0eeffece Refactor/enhance BKE_brush_make_local() and BKE_speaker_make_local().
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-10 17:14:45 +02:00
Bastien Montagne
c8c00636bf Refactor/enhance BKE_particlesettings_make_local().
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-10 17:14:45 +02:00
Lukas Stockner
bb8bfdd4b6 Cycles: Fix failed assert with isotropic Ashikhmin-Shirley distribution in the Glossy node
The shader sync code used the anisotropic version of the Ashikhmin-Shirley closure for both
Anisotropic and Glossy BSDF, which caused a failed assert because the anisotropic closure
expects an addiitonal SVM node.
2016-07-10 16:41:21 +02:00
Campbell Barton
e0c163661d Add missing braces 2016-07-11 08:45:16 +10:00
Philipp Oeser
885870be51 Fix T48815: Translate node's 'Relative' checkbox has the same tooltip as blur node's 'Relative' checkbox.
Differential Revision: https://developer.blender.org/D2099
2016-07-10 14:57:31 +02:00
Bastien Montagne
87b974caa1 Cleanup/Refactor: pass Main pointer to all ID copy functions.
Also allows us to get rid of a few _copy_ex() versions...
2016-07-10 14:52:00 +02:00
Bastien Montagne
ae2033aca2 Add BKE_key_copy_ex() that takes a Main as parameter. 2016-07-09 15:44:12 +02:00
Bastien Montagne
429394078b Refactor/enhance BKE_lattice_make_local(), and add BKE_lattice_copy_ex() that takes a Main as parameter.
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-09 15:44:12 +02:00
Bastien Montagne
338121e2a0 Refactor/enhance BKE_mball_make_local(), and add BKE_mball_copy_ex() that takes a Main as parameter.
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-09 15:44:12 +02:00
Bastien Montagne
11f64f494b Refactor/enhance BKE_curve_make_local(), and add BKE_curve_copy_ex() that takes a Main as parameter.
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-09 15:44:12 +02:00
Bastien Montagne
9044ccec5f Cleanup to shapekeys' make_local (and copy) functions.
Mostly pass bmain and do not check for NULL key, keys' make_local is
suspiciously simple in fact, but think until those behave like real
full-featured IDs, it's doing enough!
2016-07-09 15:44:12 +02:00
Bastien Montagne
8bb7a339f7 Minor fix/cleanup to object's make_local. 2016-07-09 15:44:12 +02:00
Joshua Leung
1b45c52734 Fix: Apply Scale to Delta Scale was doubling the effect 2016-07-09 12:00:28 +12:00
Joshua Leung
245f97d7dc Clear Transforms and Deltas
* Alt-G, Alt-R, Alt-S  --> These don't clear delta transforms by default anymore,
  making it possible to use these to properly store a "rest" pose

* Alt-Shift-G, Alt-Shift-R, Alt-Shift-S  --> These WILL clear both the normal
  transform and the delta, should you need to do so.
2016-07-09 12:00:28 +12:00
Bastien Montagne
8662f583da Fix (unreported) broken shapekeys after 'make_local' of datablocks used both directly and directly.
At first thought it was own recent work, but think issue is there since ages actually...

Basically, id_make_local() would always localize mesh/curve/lattice shapekeys, even in case
obdata localization actually made a local copy instead of localizing original datablock.

This was causing shapekeys being localized twice, and other odd nasty effects.
2016-07-08 19:53:57 +02:00
Bastien Montagne
282de867d4 Initial fix for proxy issues regarding new libquery/libremap ID handling code.
libquery now passes an extra flag info to the callback, in case that specific
ID usage is considered as indirect.

In most cases, it's just set from ID_IS_LINKED_DATABLOCK() result on datablock owner,
but in proxy object case we also consider ob->data, materials and pose usages as indirect.

Does not fixes all issues yet, but should already make behavior with proxy object saner.
2016-07-08 19:33:22 +02:00
Bastien Montagne
77680abaf9 Refactor/enhance BKE_mesh_make_local().
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).

Note: this enlightened broken case of proxy objects regarding make_local
(and also whole remapping, in fact). Will be fixed in near future.
2016-07-08 18:19:34 +02:00
Bastien Montagne
db79537dbc Fix own very stupid mistake in BKE_library_idtype_can_use_idtype() usage (inverted arguments). 2016-07-08 18:11:20 +02:00
Bastien Montagne
f34fc60aa4 Libquery: fix missing image pointers from Mesh's UV layers.
Not really happy with this, could lead to a **lot** of callback executions...
But libquery foreach looper must go over **all** ID pointers,
otherwise remapping & co is broken!

A possible fix for future would be to have 'image slots' defined at root of poly/facetex layers,
and just a (short) index in each face/poly item - would also save a reasonable amount of memory...
2016-07-08 18:11:20 +02:00
Bastien Montagne
d1a4ae3f39 Refactor/enhance BKE_object_make_local().
Now using modern features from libquery/libremap areas.

Also, it should handle much better cases where localized ID was also indirectly used by non-refcounting users
(typical case: object used as modifier/constraint/whatever target from another linked object, previous
code would not take those into account and just localize original object instead of making a local copy.
Would result in local object used by linked one, which would be partially 'undone' on next file reload... Crappy behavior).

And it fixes some obvious errors too (nullifying all proxy pointers unconditionnaly,
some missing refcounted usages cases in extern_local_object(), etc.).
2016-07-08 18:11:20 +02:00
Bastien Montagne
f3fe1f9c44 Refactor: pass Main to id_make_local.
Totally stupid to not pass it, and then let (some) BKE_foo_make_local() use G.main!

Note: unused for now, much more refactoring still to come in make_local area!
2016-07-08 18:11:20 +02:00
Bastien Montagne
cf19055236 Fix (unreported) missing special updates in case we are remapping obdata (mesh/curve/metaball at least). 2016-07-08 18:11:20 +02:00
Bastien Montagne
ab993e373c Rework/split test_object_materials().
Now test_object_materials only handles one object. New test_all_objects_materials
checks the whole bmain->object list for cases where it is actually needed.

Should avoid some useless looping over all objects!
2016-07-08 18:11:20 +02:00
Bastien Montagne
71f5df9f44 Refactor remapping's pre/post process of special cases.
Main issue was that BKE_libblock_relink_ex was pretty much ignoring all those...
Also, unlinking of objects was not handling correctly indirect-related flags.

Refactored code into helper functions to avoid too much duplicated code.
2016-07-08 18:11:20 +02:00
Sergey Sharybin
3b7bce42d7 Fix T48799: Particles set as objects cast wrong ray shadows in BI 2016-07-08 18:10:47 +02:00
Campbell Barton
8bb69b6157 BMesh: add decimate edit-mode tool
Support applying decimate to the mesh selection.
2016-07-08 23:38:52 +10:00
Campbell Barton
c206b7cbb6 Correct error in non-uniform scale IK commit
Rename arg to avoid confusion
2016-07-08 21:13:19 +10:00
Sergey Sharybin
a62967787c Fix T48808: Regression: Cycles OpenCL broken after Hair BVH commit 2016-07-08 09:41:36 +02:00
Campbell Barton
d5d26338b5 Mesh/Curve Join: remove edit-mode toggle
Toggling edit-node after joining objects is redundant as far as I can see -
(dates back to first revision).

Also caused all edges to be drawn w/ meshes, redundant undo step w/ curves.
2016-07-08 16:52:10 +10:00
Campbell Barton
83fe139b2b Undo: use system memcmp
`my_memcmp` didn't work properly comparing memory sizes not aligned to 4 bytes,
this worked while we used guarded-alloc (which always wrote a guard at the end of each allocation).
Since moving to lockfree allocator it could read uninitialized memory.

It also consistently performed ~10-30% worse then glibc's.
This is typically well optimized, no need to do ourselves.
2016-07-08 15:54:34 +10:00
Campbell Barton
dda96e3472 Fix T48807: Each stroke halves brush size
Missed from c5b2f12b
2016-07-08 14:51:12 +10:00