Commit Graph

57453 Commits

Author SHA1 Message Date
Bastien Montagne
aca329ba64 Cleanup: add missing MovieClip entry in RNA's id_type_items, and respect alphabetical sorting (on UI names for enums, on ID codes otherwise). 2015-01-12 19:56:18 +01:00
Campbell Barton
d47804cb06 correct last commit: less cryptic camera check 2015-01-13 05:55:10 +11:00
Campbell Barton
a4366497db Fix T43206: region_2d_to_origin_3d has no ortho offset
With ortho views the value would be aligned to the 'rv3d->ofs'
Now it works in camera ortho & regular ortho views.
2015-01-13 05:41:56 +11:00
Campbell Barton
dcd662c695 BMesh: Tweak behavior for select more/less
Stepping over faces gives overall nice results but it stopped wire edges from working.
Now step over wire too.
2015-01-13 02:36:51 +11:00
Campbell Barton
0996ee3bb8 Fix: Don't show filesel buttons when no operators running 2015-01-13 02:08:26 +11:00
Campbell Barton
c6d28a94be Fix T42754: File-Selector lost on fullscreen exit
There  was a hard-coded check to exit the fileselector when restoring a view.

Now, when space types differ, flag areas as temporary and switch back to the previous type only in this case.
This means you can select a file while having a file-selector space type open, and not loose it every time.
2015-01-13 01:44:40 +11:00
Campbell Barton
301433fe9d Fix OpenGL Context freeing 2015-01-13 01:44:40 +11:00
Bastien Montagne
3027ff8b13 Second try to fix missing previews of mat/tex/etc. in .blend files.
This time, it's a dedicated operator user has to run before saving the file.

And it recursively check all IDs linked from each scene, therefore rendering
materials etc. previews using a scene they are used in.

Note the renderengine issue is not completely addressed this way
(existing code for icon previews seems to ignore completely other engines,
and IDs not linked anywhere (fake-user ones) will be rendered with current scene's engine
as fallback, also you can get a material linked to an hidden object in a scene, etc.).

Reviewers: sergey, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D980
2015-01-12 15:13:46 +01:00
Sergey Sharybin
51779d9407 Cycles: Fix crash after recent BVH changes on empty BVH trees
It's apparently not nice to access 0th element of zero-size vector in C++.
2015-01-12 19:11:32 +05:00
Bastien Montagne
f9a4f8ada4 BLI linkstack macros: do not prepend the 'anti-namespace-collision' to var name.
Issue was, in case of using such stack within a structure, the '_' underscore
would be added in front of struct variable
(e.g. `my_struct.my_stack` would lead to (try to) using `_my_struct.my_var_pool` ...).

Now underscore is appended to var names, ugly but working.

Note did not touch to the alloca variants of those macros, since in this case enforcing
a pure local use is best I think.
2015-01-12 14:37:59 +01:00
Sergey Sharybin
e8730af87f Cycles: Fix compilation error on platforms without SSE support
Overview this in one of the previous BVH commits.
2015-01-12 17:14:40 +05:00
Bastien Montagne
a3bfaa481f Cleanup: rename BKE's 'object_data_transfer' to 'data_transfer' to avoid same file names with ED_object's one. 2015-01-12 12:05:47 +01:00
Sergey Sharybin
47e47e6760 Avoid type re-definition for as long C11 is explicitly enabled in compilers 2015-01-12 15:36:18 +05:00
Sebastian Koenig
9d02e2626b Fix typo in OCIO configuration file 2015-01-12 15:06:03 +05:00
Sergey Sharybin
5719ed1225 Cycles: Add leaf primitives sanity check asserts to the kernel
This way we'll notice that leaf splitting didn't happen correct pretty easily
in debug builds.

There'll be absolutely no impact on release builds.
2015-01-12 15:05:14 +05:00
Sergey Sharybin
bc7ff3c2b4 Cycles: Enable leaf split by primitive type and adopt BVH traversal for this
This commit enables BVH leaf nodes split by the primitive type and makes it
so BVH traversal code is now aware and benefits from this.

As was mentioned in original commit, this change is crucial to be able to do
single ray to multiple triangle intersection. But it also appears to give
barely visible speedup in some scene.

In any case there should be no noticeable slowdown, and this change is what
we need to have anyway.
2015-01-12 15:04:52 +05:00
Sergey Sharybin
c707b91ce6 Cycles: Optimize leaf splitting code by avoid vector allocation
Use variables allocated in the stack and avoid heap allocation which should make
leaf splitting code a bit faster.
2015-01-12 14:49:59 +05:00
Sergey Sharybin
b56f5900dc Cycles: BVH params option to split leaf node by primitive types
The idea of this change is make it possible to split leaf nodes by primitive
type, making leaf containing primitives of the same type.

This would become handy when working on a single ray to multiple triangles
intersection code, plus with careful implementation it might give some extra
benefits on BVH traversal code by avoiding primitive type fetch and check for
each primitive in the node. But that's a bit tricky to have benefits on this
change only because depth of BVH increases.

This option is not exposed to the interface at all and not used even secretly,
the commit is only needed to help working further in this direction without
messing around with local patches and worrying of them running out of date.
2015-01-12 14:49:56 +05:00
Campbell Barton
d8fc404415 Cleanup: style 2015-01-12 18:56:36 +11:00
Campbell Barton
bae5826b65 Fix T42069: Fonts /w non-ascii paths fail in win32
Workaround freetype's use of fopen by swapping FT_New_Face for our own version which uses BLI_fopen.
2015-01-12 18:30:11 +11:00
Campbell Barton
f9c7cbd989 revert part of 7a1dc20
These warnings are false positives & confuses intended logic to set dummy values.
2015-01-12 11:46:44 +11:00
Antony Riakiotakis
1864253db0 Fix T43208 material flickering in edit mode.
Happens because material setting now occurs in the derived mesh drawing
routine as it should. However that means that it also happens during
selection and that influenced the drawing state somehow.

In 2.72 this did not occur because material setting happened during draw
setting (skip or draw) instead of after the draw setting passed (so
selection would skip it by use another draw setting function). Of course
this violated design but worked.

Made it now so backbuffer selection does not enable materials (it's
redundant in those cases anyway).

This could be ported to a possible 'a' release but as is classic with
display code there may be some other places that it could backfire.

Tested fix with texture/vertex painting and selection which use
backbuffer for both subsurf and regular meshes and it seems to work OK.
2015-01-11 21:29:51 +01:00
Bastien Montagne
0a5ad65512 Modifiers shall be listed in alphabetical order in UI... 2015-01-11 21:23:43 +01:00
Bastien Montagne
7a1dc20560 Cleanup: quite some harmless but noisy warnings from gcc... 2015-01-11 21:14:39 +01:00
Bastien Montagne
1b3b011354 Transfer data: cleanup: Remove 'vertex_group_transfer_weight' operator.
We can now use 'generic' data transfer instead.

Note new one is not an exact replacement, it should be able to do
everyting old op could do though, and more.
2015-01-11 18:33:12 +01:00
Bastien Montagne
a628a8240e Data transfer: make operator able to work 'reversed' (i.e. transfer from selected objects to active).
Needed to replace weight transfer modifier in WeightPaint mode...

Note this is not exposed to users in UI, shall remain technical intern
parameter imho. Esp. since behavior when several sources is a bit 'random'
(merely uses each source in selection order...).

Also, this correct a bug, where 'lib' linked objects/meshes could not be used
as source...
2015-01-11 18:32:25 +01:00
Bastien Montagne
599c8a2c8e Fix T43204: Shrinkwrap constraint, project mode: Space ignored in bone case.
Own fault in rBb154aa8c060a60d to fix T42447... Reverted that commit, and added
kind of not-so-nice hack instead.

Note root of the issue comes from the special case we are doing here re 'Local'
space of parent-less objects. In that case, local space should be the same as
world one, but instead we apply the object rotation to it... This is inconsistent
with all other cases and could very well lead to other issues as T42447, but afraid
fixing that properly would be rather hairy - not to mention it would likely break
all existing riggings etc. :(

Should be safe for a 2.73a, shall we need it.
2015-01-11 14:59:11 +01:00
Bastien Montagne
cd2d84d91c Fix three issues reported by coverity in own recent code. Including two potential crashers. 2015-01-10 22:54:32 +01:00
Bastien Montagne
5357474ad8 Fix building with very strict flags, use size_t rather than int for string length.
Reported on bf-committers.
2015-01-10 19:15:49 +01:00
Joshua Leung
ab3f037ccc GPencil Editing: FKEY now controls the eraser size when in Stroke Edit Mode 2015-01-11 02:15:18 +13:00
Campbell Barton
9590e77a59 cleanup: style & warnings 2015-01-10 12:40:09 +11:00
Campbell Barton
dec523da87 Fix for regression in bmesh connect-pair
T42563 fix wasn't right, fortunately this doesn't fail in most cases.
2015-01-10 12:32:14 +11:00
Bastien Montagne
79d8617424 Transfer data: add modifier.
Not much to add, modifier uses same code as operator basically, only key difference
is that modifier will never create data layers itself, you have to use dedicated operator
for that.
2015-01-10 00:04:43 +01:00
Joshua Leung
8615977624 Fix: Delkey didn't activate the Grease Pencil strokes delete operator like XKEY does 2015-01-10 11:20:11 +13:00
Bastien Montagne
ee4453f083 Transfer Data: add main core code and operators.
This add code needed to map a CD data layout from source mesh towards destination one,
and code needed to actually transfer data, using BKE's mesh remap generated data.

This allows to transfer most CD layers (vgroups, vcols, uvs...) as well as fake, boolean ones
(like smooth/sharp edges/faces, etc.). Some types are not yet transferable, mainly
shape keys, this is known TODO.

Data transfer can also use some advanced mixing in some cases (mostly, vgroups and vcols).

Notes:
* New transfer operators transfer data from active object towards selected ones.
* Modifier will be committed separately.
* Old weight transfer code (for vgroups) is kept for now, mostly because it is the only
  usable one in weightpaint mode (it transfers from selected object to active one,
  this is not sensible in Object mode, but needed in WeightPaint one). This will be addressed soon.

Again, heavily reviewed and enhanced by Campbell, thanks!
2015-01-09 19:32:44 +01:00
Antony Riakiotakis
67b1412bc9 Radial operator number angle input should use angles.
Much more lenient if you are a human.
2015-01-09 19:23:27 +01:00
Bastien Montagne
58d7153c6c BKE: Add 'mesh remap' code.
This is the (big!) core of mesh transfer data, it defines a set of structures
to represent a mapping of mesh elements (verts, edges, polys of loops) between
two arbitrary meshes, and code to compute such mappings.

No similarity is required between source and destination meshes (though results
when using complete different meshes are rather unlikely to be useful!).

This code is not bound to data transfer, it is defined to be as generic as possible,
and easy to reuse or extend as needs arise.

Several methods of mapping generation are defined for each element type,
we probably will have to adjust that in future (remove useless ones, add
new ones...).

For loops, you can also define islands (for UVs e.g.) so that loops of a same
destination polygon do not 'spread' across several source islands.

Heavily reviewed and enhanced by Campbell, thanks a lot!
2015-01-09 18:35:32 +01:00
Antony Riakiotakis
b99687169d Fix texture sampling with generative modifiers - sample backbuffer
returns indices in mesh face range
2015-01-09 18:06:15 +01:00
Bastien Montagne
1187b98d48 Fix T43174: "Record animation" does not update fcurve handles
`INSERT_FAST` implies you call `calchandles_fcurve()` at the end...
For now, since we do not store edited FCurves nor can we get them easily
(requires RNA...), just update handles of all fcurves, it's much more
performant than removing usage of `INSERT_FAST` anyway.
2015-01-09 15:29:47 +01:00
Campbell Barton
ac619aaf38 BLI_string: BLI_str_ends_with -> BLI_str_endswith
Loosely following Python str convention.
2015-01-09 23:47:17 +11:00
Campbell Barton
73955e2566 Fix for GTest 2015-01-09 23:33:02 +11:00
Antony Riakiotakis
ca9bdf3f28 Fix rotate around selection only working if object is at origin for
texpaint
2015-01-09 13:27:49 +01:00
Bastien Montagne
62cc4bab08 BKE bvhutils: cleanup and refactor to make it more flexible.
You can now use lower-level '_ex' versions of bvh creators to only use part of
the mesh's elements in the BVH, and/or create bvh from non-DM sources.

Needed for transfer data.

Note edges extend version of bvh creator is not added here, not needed so far.
2015-01-09 13:03:55 +01:00
Bastien Montagne
1794186053 BLI_math: add vector's dot_v3v3v3() func, for when you have three points instead of two vectors. 2015-01-09 13:03:55 +01:00
Bastien Montagne
2e72d756c4 BLI_rand: add a function returning a random point whithin given 2D triangle.
Needed by transfer data.
2015-01-09 13:03:55 +01:00
Bastien Montagne
88ee44a9ac BLI: add 'A*' (AStar) shortest path solver algorithm.
Needed for transfer data.
2015-01-09 13:03:55 +01:00
Antony Riakiotakis
2f16098d20 Gooseberry animation request: Paste flipped pose in action
and graph editor.

This was a tricky commit that was not so straightforward to make work.
The information for bones is not easy to come by in the animation curves,
however we do have some string manipulation tricks to make it happen.

Testing in gooseberry worked for the rigs there, commiting to master now
2015-01-09 12:16:58 +01:00
Bastien Montagne
95847f6ac7 Fix T43159: Copying of linked datablocks using relpath leads to invalid paths in new copies.
Propper fix reverting most of rB60e70c0c6014e5, which was only partial specific fix.
This code uses generic `BKE_id_lib_local_paths()` func to handle all possible paths.

Reviewers: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D977
2015-01-09 09:53:58 +01:00
Campbell Barton
1b8240f5af Fix T43154: Extrude edges ignored isolated verts
Also cleanup extrude code.

- remove normal calculation.
- remove return values for transform type.
- use enums.

Thanks to Psy-fi for finding the initial fix.
2015-01-09 07:31:05 +11:00
Campbell Barton
db0b8017cb DDS missed newline printing errors. 2015-01-09 04:23:43 +11:00