blender.git
4 years agoCorrect function name in argument parsing
Campbell Barton [Thu, 7 Sep 2017 14:59:27 +0000 (00:59 +1000)]
Correct function name in argument parsing

4 years agoPyAPI: use bl_rna_get_subclass for node API
Campbell Barton [Thu, 7 Sep 2017 14:03:01 +0000 (00:03 +1000)]
PyAPI: use bl_rna_get_subclass for node API

Returns a default value instead of an error when the type isn't defined.

4 years agoPyAPI: add function to get an RNA subclass
Campbell Barton [Thu, 7 Sep 2017 13:53:02 +0000 (23:53 +1000)]
PyAPI: add function to get an RNA subclass

This is inconvenient in regular Python, add a class-method
to perform the operation, eg:

bpy.types.Node.bl_rna_find_subclass("CustomNodeType")

4 years agoCleanup: remove goto's
Campbell Barton [Thu, 7 Sep 2017 12:53:46 +0000 (22:53 +1000)]
Cleanup: remove goto's

4 years agoUI: fix memory leak when copy-to-selected failed
Campbell Barton [Thu, 7 Sep 2017 12:13:28 +0000 (22:13 +1000)]
UI: fix memory leak when copy-to-selected failed

4 years agoWeight Smooth: remove source option
Campbell Barton [Thu, 7 Sep 2017 04:12:11 +0000 (14:12 +1000)]
Weight Smooth: remove source option

Use current selection mode instead of an operator option.

4 years agoFix T52639: Weight paint smooth tool crash
Campbell Barton [Thu, 7 Sep 2017 03:20:39 +0000 (13:20 +1000)]
Fix T52639: Weight paint smooth tool crash

4 years agoCleanup: custom nodes template
Campbell Barton [Wed, 6 Sep 2017 19:18:44 +0000 (05:18 +1000)]
Cleanup: custom nodes template

- Use conventional (pep8) prop names
- Simplify class registration

4 years agoWorkaround node types not being exposed
Campbell Barton [Wed, 6 Sep 2017 19:17:02 +0000 (05:17 +1000)]
Workaround node types not being exposed

We might want to have a utility function for this,
for now just keep it working.

4 years agoNode UI: Add square and diamond socked draw styles
Campbell Barton [Wed, 6 Sep 2017 18:45:38 +0000 (04:45 +1000)]
Node UI: Add square and diamond socked draw styles

Currently not used by Blender's node trees

D2814 by @charlie

4 years agoFix T52660: CUDA volume texture rendering not working on Fermi GPUs.
Brecht Van Lommel [Wed, 6 Sep 2017 16:12:45 +0000 (18:12 +0200)]
Fix T52660: CUDA volume texture rendering not working on Fermi GPUs.

4 years agoFix mistake in previous fix for T52640.
Brecht Van Lommel [Wed, 6 Sep 2017 15:21:58 +0000 (17:21 +0200)]
Fix mistake in previous fix for T52640.

4 years agoUse normalized project functions
Campbell Barton [Wed, 6 Sep 2017 15:19:37 +0000 (01:19 +1000)]
Use normalized project functions

4 years agoFix T52640: crash when opening image file browser in some cases.
Brecht Van Lommel [Wed, 6 Sep 2017 13:56:01 +0000 (15:56 +0200)]
Fix T52640: crash when opening image file browser in some cases.

There was some invalid state in the screen here, some areas had
sa->full set even though no screen was maximized, which then caused
a restore from the wrong (empty) area, which then led to spacedata
being empty and a crash.

This fix properly clears the sa->full after restore, and also fixes
existing .blend files in such an invalid state.

4 years agoScrew Modifier: remove doubles option
Campbell Barton [Wed, 6 Sep 2017 14:10:13 +0000 (00:10 +1000)]
Screw Modifier: remove doubles option

Vertices on the axis can be optionally merged,
nice for creating objects which close at the end-points.

4 years agoMath Lib: normalized vector project functions
Campbell Barton [Wed, 6 Sep 2017 14:09:56 +0000 (00:09 +1000)]
Math Lib: normalized vector project functions

4 years agoFix T52661: mesh light shader using backfacing not working, after new sampling.
Brecht Van Lommel [Wed, 6 Sep 2017 11:46:27 +0000 (13:46 +0200)]
Fix T52661: mesh light shader using backfacing not working, after new sampling.

4 years agoFix T52652: Cycles image box mapping has flipped textures.
Brecht Van Lommel [Tue, 5 Sep 2017 16:11:13 +0000 (18:11 +0200)]
Fix T52652: Cycles image box mapping has flipped textures.

This breaks backwards compatibility some in that 3 sides will be mapped
differently now, but difficult to avoid and can be considered a bugfix.

4 years agoView3D Remap: skip defmaterial
Campbell Barton [Wed, 6 Sep 2017 10:57:25 +0000 (20:57 +1000)]
View3D Remap: skip defmaterial

This isn't library data.

4 years agoFix T52663: Remap used invalid local-view data
Campbell Barton [Wed, 6 Sep 2017 10:52:49 +0000 (20:52 +1000)]
Fix T52663: Remap used invalid local-view data

Only the camera from View3D.localvd is used,
other pointers may be invalid.

Longer term we should probably clear these to ensure no accidents.
For now just follow the rest of Blender's code and don't access.

4 years agoFix error in high bit-depth image tile drawing
Campbell Barton [Wed, 6 Sep 2017 06:08:01 +0000 (16:08 +1000)]
Fix error in high bit-depth image tile drawing

From @1xundoredo in D2824

4 years agoRigidbody: Fix regression introduced in ee3fadd
Sergej Reich [Tue, 5 Sep 2017 17:53:32 +0000 (19:53 +0200)]
Rigidbody: Fix regression introduced in ee3fadd

Baking rigid body cache was broken if some cached frames already
existed.

This is just a band aid for release, the logic need to be looked into
further.

4 years agoFix T52374: Changes of rigid body related settings during simulation will break the...
Sergej Reich [Tue, 5 Sep 2017 05:12:30 +0000 (07:12 +0200)]
Fix T52374: Changes of rigid body related settings during simulation will break the simulation

Revert 9cd6b033edc8c1b87d10d and do a better fix for T50230.

4 years agoFix T52251: Knife cur displaces surface
Campbell Barton [Tue, 5 Sep 2017 15:50:36 +0000 (01:50 +1000)]
Fix T52251: Knife cur displaces surface

4 years agoCycles: Fix compilation error with CUDA after recent changes
Sergey Sharybin [Tue, 5 Sep 2017 14:52:45 +0000 (16:52 +0200)]
Cycles: Fix compilation error with CUDA after recent changes

4 years agoBuildbot: Fix paths to sndfile and flac
Sergey Sharybin [Tue, 5 Sep 2017 14:17:48 +0000 (16:17 +0200)]
Buildbot: Fix paths to sndfile and flac

Need this in 2.79 branch as well, since build rules are based on this files.

4 years agoFix T52433: Volume Absorption color tint
Sergey Sharybin [Tue, 5 Sep 2017 13:38:11 +0000 (15:38 +0200)]
Fix T52433: Volume Absorption color tint

Need to exit the volume stack when shadow ray laves the medium.

Thanks Brecht for review and help in troubleshooting!

4 years agoCleanup: use const
Campbell Barton [Tue, 5 Sep 2017 12:39:00 +0000 (22:39 +1000)]
Cleanup: use const

Also use assert w/ rotate_m4.

4 years agoCycles: Cleanup, style
Sergey Sharybin [Tue, 5 Sep 2017 10:42:45 +0000 (12:42 +0200)]
Cycles: Cleanup, style

4 years agoFix T52649: missing custom (split) normals from FBX exporter.
Bastien Montagne [Mon, 4 Sep 2017 19:02:46 +0000 (21:02 +0200)]
Fix T52649: missing custom (split) normals from FBX exporter.

Own mistake in recent rB25c5928b2b6 (this DOES NOT affect 2.79 release).

4 years agoFix T52531: Blender 2D stabilisation node issue when autoscale is selected
Sergey Sharybin [Mon, 4 Sep 2017 14:40:55 +0000 (16:40 +0200)]
Fix T52531: Blender 2D stabilisation node issue when autoscale is selected

Threading conflict, should be safe for 2.79.

4 years agoPyAPI: Add bpy.utils.register_classes_factory
Campbell Barton [Mon, 4 Sep 2017 14:22:31 +0000 (00:22 +1000)]
PyAPI: Add bpy.utils.register_classes_factory

Avoids having boiler plate register/unregister functions.

4 years agoFix T52522: VSE renders with alpha transparent PNG image incorrectly
Sergey Sharybin [Mon, 4 Sep 2017 12:46:17 +0000 (14:46 +0200)]
Fix T52522: VSE renders with alpha transparent PNG image incorrectly

Need some extra checks and should be probably end up in 2.79 since that's a regression.

4 years agoCycles: Fix compilation warning
Sergey Sharybin [Mon, 4 Sep 2017 11:28:15 +0000 (13:28 +0200)]
Cycles: Fix compilation warning

4 years agoFix T52533: Blender shuts down when rendering duplicated smoke domain
Sergey Sharybin [Mon, 4 Sep 2017 11:14:54 +0000 (13:14 +0200)]
Fix T52533: Blender shuts down when rendering duplicated smoke domain

4 years agoPyAPI: fix rna_info for changes in type access
Campbell Barton [Mon, 4 Sep 2017 06:39:13 +0000 (16:39 +1000)]
PyAPI: fix rna_info for changes in type access

4 years agoPyDoc: update context_type_map
Campbell Barton [Mon, 4 Sep 2017 06:19:27 +0000 (16:19 +1000)]
PyDoc: update context_type_map

4 years agoRNA/PyAPI: Expose Py classes in bpy.types
Campbell Barton [Mon, 4 Sep 2017 04:49:27 +0000 (14:49 +1000)]
RNA/PyAPI: Expose Py classes in bpy.types

Operators and their properties are two different types

Previously both operators and their properties are added
causing C operators to access the properties, Python the classes.

Favor consistency in this case so only Python classes are added.

4 years agoCleanup: avoid confusing assignment
Campbell Barton [Mon, 4 Sep 2017 04:23:39 +0000 (14:23 +1000)]
Cleanup: avoid confusing assignment

4 years agoT52534: Compositor artifacts when scaling
Jeroen Bakker [Sun, 3 Sep 2017 14:47:39 +0000 (16:47 +0200)]
T52534: Compositor artifacts when scaling

Increased the maxx and maxy area of interest when scaling in this case.

4 years agoFix T52634: EditMesh Remove doubles could hang
Campbell Barton [Sun, 3 Sep 2017 13:13:20 +0000 (23:13 +1000)]
Fix T52634: EditMesh Remove doubles could hang

A single diagonal axis was used for sorting coordinates,
the algorithm relied on users not having vertices axis aligned.

Use BLI_kdtree to remove doubles instead.

Overall speed varies, it's more predictable than the previous method.
Some typical tests gave speedup of ~1.4x - 1.7x.

4 years agoBLI_kdtree: utility function to remove doubles
Campbell Barton [Sun, 3 Sep 2017 12:34:49 +0000 (22:34 +1000)]
BLI_kdtree: utility function to remove doubles

4 years agoCMake: use Blender's glew by default
Campbell Barton [Sun, 3 Sep 2017 06:34:10 +0000 (16:34 +1000)]
CMake: use Blender's glew by default

Use since it's always bundled to avoid any issues caused
by version mis-match.

4 years agoFix: Deleting GPencil keyframes in DopeSheet didn't redraw the view
Joshua Leung [Sun, 3 Sep 2017 00:46:01 +0000 (12:46 +1200)]
Fix: Deleting GPencil keyframes in DopeSheet didn't redraw the view

4 years agoFix: Border select for GPencil keyframes was including those in the "datablock" chann...
Joshua Leung [Sun, 3 Sep 2017 00:40:49 +0000 (12:40 +1200)]
Fix: Border select for GPencil keyframes was including those in the "datablock" channels even though those weren't visible

This meant that it was easy to accidentally select too many keyframes

4 years agoFix: GPencil Sequence Interpolation for thickness/strength was inverted
Joshua Leung [Sat, 2 Sep 2017 15:38:44 +0000 (03:38 +1200)]
Fix: GPencil Sequence Interpolation for thickness/strength was inverted

For example, if you have two keyframes:
  k1 = 1px, k2 = 10px

it was doing:
  1px, 9px, 8px, ..., 3px, 2px, 10px
instead of:
  1px, 2px, 3px, ..., 8px, 9px, 10px

4 years agoFix T52227: Time Slide tool doesn't take NLA mapping into account
Joshua Leung [Sat, 2 Sep 2017 15:35:27 +0000 (03:35 +1200)]
Fix T52227: Time Slide tool doesn't take NLA mapping into account

To be backported to 2.79

4 years ago[deps/msvc] Debug flags for optimized debug libs were inverted for cxx.
Ray Molenkamp [Sat, 2 Sep 2017 23:14:42 +0000 (17:14 -0600)]
[deps/msvc] Debug flags for optimized debug libs were inverted for cxx.

4 years agoCorrect own error simplifying matrix checks
Campbell Barton [Sat, 2 Sep 2017 14:05:11 +0000 (00:05 +1000)]
Correct own error simplifying matrix checks

4 years agoCleanup: use title caps for labels
Campbell Barton [Sat, 2 Sep 2017 05:42:29 +0000 (15:42 +1000)]
Cleanup: use title caps for labels

Also consistent quoting (single quotes for enums, text uses double).

4 years agoBMesh: use predictable order for remove-doubles
Campbell Barton [Fri, 1 Sep 2017 17:27:55 +0000 (03:27 +1000)]
BMesh: use predictable order for remove-doubles

Each qsort implementation may give different results when values match.

Now fallback to sorting by index.

4 years agoFix T52472: VSE Audio Volume not set immediately
Joerg Mueller [Fri, 1 Sep 2017 10:27:21 +0000 (12:27 +0200)]
Fix T52472: VSE Audio Volume not set immediately

Audio mixing is done with volume interpolation. A new handle started at
volume 1, now starting at volume 0 for a smooth fade in.

4 years agoRNA: demote non-strict class naming to warning
Campbell Barton [Fri, 1 Sep 2017 07:06:14 +0000 (17:06 +1000)]
RNA: demote non-strict class naming to warning

This stops a lot of add-ons from registering,
while this must be resolved but there no need to force error just now.

4 years agoCycles: follow strict class naming convention
Campbell Barton [Fri, 1 Sep 2017 06:08:25 +0000 (16:08 +1000)]
Cycles: follow strict class naming convention

4 years agoRNA: strict naming for types in bpy.types
Campbell Barton [Thu, 31 Aug 2017 14:58:18 +0000 (00:58 +1000)]
RNA: strict naming for types in bpy.types

Blender scripts already do this, some addons will need updating.

4 years agoCleanup: strict naming conventions
Campbell Barton [Thu, 31 Aug 2017 14:57:36 +0000 (00:57 +1000)]
Cleanup: strict naming conventions

4 years agoIncrease max/min frame range to over a million
Dalai Felinto [Thu, 31 Aug 2017 14:06:08 +0000 (16:06 +0200)]
Increase max/min frame range to over a million

For some specific pipelines (e.g., holographic rendering) you can easily
need over a million frames (1k * 1k view angles).

It seems a corner case, but there is no real reason not to allow users
doing that.

That said we do loose subframe precision in the highest frame range. Which can
affect motionblur. The current maximum sub-frame precision we have is 16.
While the previous limit of 500k frames has a precision of 32.

Thanks to Campbell Barton for the help here.

To be backported to 2.79

4 years agoRNA: Limit which classes struct-map contains
Campbell Barton [Thu, 31 Aug 2017 13:32:21 +0000 (23:32 +1000)]
RNA: Limit which classes struct-map contains

Only add subclasses of: Menu, Panel, Header, UIList, Operator

This helps avoid unnecessary naming collisions,

See T52599 for details

4 years agoCycles: Cleanup, indentation and trailing whitespace
Sergey Sharybin [Thu, 31 Aug 2017 12:47:49 +0000 (14:47 +0200)]
Cycles: Cleanup, indentation and trailing whitespace

4 years agoCycles: Fix typo in comment
Sergey Sharybin [Thu, 31 Aug 2017 11:24:32 +0000 (13:24 +0200)]
Cycles: Fix typo in comment

4 years agoCorrect last commit
Campbell Barton [Thu, 31 Aug 2017 09:12:45 +0000 (19:12 +1000)]
Correct last commit

4 years agoRNA: existing type check used wrong identifier
Campbell Barton [Thu, 31 Aug 2017 08:42:48 +0000 (18:42 +1000)]
RNA: existing type check used wrong identifier

Own error in recent type checks, in many cases the 'idname'
is used for the struct identifier, not the 'identifier'
which is the Python class name in this context.

4 years agoCycles: Add tangent attribute tests
Sergey Sharybin [Wed, 30 Aug 2017 15:42:00 +0000 (17:42 +0200)]
Cycles: Add tangent attribute tests

4 years agoFix T52588: Shape key value driver variables of duplicated object sets refer to old...
Bastien Montagne [Wed, 30 Aug 2017 15:24:06 +0000 (17:24 +0200)]
Fix T52588: Shape key value driver variables of duplicated object sets refer to old objects.

Regression since 2.78, to be backported to 2.79.

4 years agoRefactor 'split faces' mesh code.
Bastien Montagne [Wed, 30 Aug 2017 14:42:53 +0000 (16:42 +0200)]
Refactor 'split faces' mesh code.

Previous version was trying to do a quick and simple process in the case
we were only considering smooth/flat status of faces.

Thing is, even then, the algorithm was not actually working in all
possible situations, e.g. two smooth faces having a single vertex in
common, but no common edges, would not have split that vertex, leading
to incorrect shading etc.

So now, tweaked slightly our split normals code to be able to generate
lnor spaces even when autosmooth is disabled, and we always go that way
when splitting faces.

Using smooth fans from clnor spaces is not only the only way to get 100%
correct results, it also makes face split code simpler.

4 years agoFixing T52477 - switching from custom ray/triangle intersection code to the one from...
Stefan Werner [Wed, 30 Aug 2017 09:47:33 +0000 (11:47 +0200)]
Fixing T52477 - switching from custom ray/triangle intersection code to the one from util_intersection.h. This fixes the bug and makes the code more readable and maintainable.

4 years agoCycles: Fix build with networking enabled
Mai Lavelle [Wed, 30 Aug 2017 04:19:44 +0000 (00:19 -0400)]
Cycles: Fix build with networking enabled

4 years agoFix Cycles Windows render errors with BVH2 CPU rendering.
Brecht Van Lommel [Tue, 29 Aug 2017 19:11:47 +0000 (21:11 +0200)]
Fix Cycles Windows render errors with BVH2 CPU rendering.

One problem is that it was always using __mm_blendv_ps emulation even if the
instruction was supported. The other that the emulation function was wrong.

Thanks a lot to Ray Molenkamp for tracking this one down.

4 years agoAlembic: Fix T52579: crash when replacing slightly different alembic files
Sybren A. Stüvel [Tue, 29 Aug 2017 14:58:13 +0000 (16:58 +0200)]
Alembic: Fix T52579: crash when replacing slightly different alembic files

Apparently with Maya in a certain configuration, it's possible to have an
Alembic object without schema in the Alembic file. This is now handled
properly, instead of crashing on a null pointer.

4 years agoFix T48079: Maintain Volume constraint overcompensates.
Alexander Gavrilov [Tue, 29 Aug 2017 12:23:47 +0000 (15:23 +0300)]
Fix T48079: Maintain Volume constraint overcompensates.

The coefficient has been wrong since introduction for some reason.

Not backwards compatible, should not be merged to 2.7*.

4 years agoSupport Copy To Selected and Alt-Click for F-Curves in the curve editor.
Alexander Gavrilov [Sat, 19 Aug 2017 16:58:39 +0000 (19:58 +0300)]
Support Copy To Selected and Alt-Click for F-Curves in the curve editor.

This affects the curve display color setting, but is really intended
for future per-curve options.

The id_data reference in the created rna pointers refers to the object
even if the curve is actually owned by its action, which is somewhat
inconsistent, but the same problem can be found in existing code.
Fixing it requires changes in animdata filter API.

4 years agoView2D: function to get view to region matrix
Campbell Barton [Tue, 29 Aug 2017 09:36:06 +0000 (19:36 +1000)]
View2D: function to get view to region matrix

4 years agoTransform: scale center override by aspect
Campbell Barton [Tue, 29 Aug 2017 06:01:16 +0000 (16:01 +1000)]
Transform: scale center override by aspect

Needed for image space.

4 years agoDepsgraph: Don't cast ID_Type to short
Sergey Sharybin [Mon, 28 Aug 2017 09:43:36 +0000 (11:43 +0200)]
Depsgraph: Don't cast ID_Type to short

4 years agoMake GS macro return proper IDType type
Sergey Sharybin [Mon, 28 Aug 2017 09:19:58 +0000 (11:19 +0200)]
Make GS macro return proper IDType type

Previously it was returning short, which was really easy to (a) compare against
non-ID type value (b) forget to handle some specific value in switch statement.

Both issues happened in the nearest past, so it's time to tighten some nuts
here.

Most of the change related on silencing strict compiler warning now, but there
is also one tricky aspect: ID_NLA is not in the IDType enum. So there is still
cast to short to handle that switch. If someone has better ideas how to deal
with this please go ahead :)

4 years agoAtomics: Use system headers directly, without bad level dependency to BLI
Sergey Sharybin [Mon, 28 Aug 2017 09:06:15 +0000 (11:06 +0200)]
Atomics: Use system headers directly, without bad level dependency to BLI

This will make it easier to re-use library as-is in other projects,
such as Cycles standalone repo for example.

4 years agoBuildbot: Tweak nightly schedule of builds
Sergey Sharybin [Mon, 28 Aug 2017 07:12:53 +0000 (09:12 +0200)]
Buildbot: Tweak nightly schedule of builds

Basically, schedule linux 64 earlier on, so builds are ready for nightly benchmarks.

4 years agoTransform: center override
Campbell Barton [Mon, 28 Aug 2017 06:00:28 +0000 (16:00 +1000)]
Transform: center override

Hidden option to override transform center.
Needed for manipulators that define their own center.

4 years agoEditMesh: set edge-rin subdiv minimum to 1
Campbell Barton [Mon, 28 Aug 2017 03:01:11 +0000 (13:01 +1000)]
EditMesh: set edge-rin subdiv minimum to 1

This only made sense for bridge tool.

D2785 by @mbjorkegren

4 years agoDocs: BMesh.from_mesh behavior w/ multiple calls
Campbell Barton [Mon, 28 Aug 2017 02:40:36 +0000 (12:40 +1000)]
Docs: BMesh.from_mesh behavior w/ multiple calls

4 years agoFix T51400: Pasting hex code fails
Campbell Barton [Mon, 28 Aug 2017 02:18:39 +0000 (12:18 +1000)]
Fix T51400: Pasting hex code fails

The # prefix is supported,
the button didn't give enough space to paste it.

D2812 by @candreacchio

4 years agoFix T52498: Deleting force field doesn't remove "Surface" from modifier stack.
Bastien Montagne [Sun, 27 Aug 2017 10:20:21 +0000 (12:20 +0200)]
Fix T52498: Deleting force field doesn't remove "Surface" from modifier stack.

Logic in `ED_object_check_force_modifiers` was inconsistent between add
and remove modifier cases.

Should be safe enough for 2.79.

4 years agoBLI_rect: Function to calculate a matrix from 2 rctf's
Campbell Barton [Sun, 27 Aug 2017 06:01:06 +0000 (16:01 +1000)]
BLI_rect: Function to calculate a matrix from 2 rctf's

4 years agoMissing from last commit
Campbell Barton [Sun, 27 Aug 2017 05:24:41 +0000 (15:24 +1000)]
Missing from last commit

4 years agoCleanup: use stubs for eigen gtest
Campbell Barton [Sun, 27 Aug 2017 05:19:25 +0000 (15:19 +1000)]
Cleanup: use stubs for eigen gtest

4 years agoMissed last commit
Campbell Barton [Sat, 26 Aug 2017 17:48:18 +0000 (03:48 +1000)]
Missed last commit

4 years agoFix T52515: Crash on BMesh.to_mesh()
Campbell Barton [Sat, 26 Aug 2017 16:38:19 +0000 (02:38 +1000)]
Fix T52515: Crash on BMesh.to_mesh()

4 years agoWM: move theme check out of ED_view3d_draw_select_loop
Campbell Barton [Sat, 26 Aug 2017 14:48:52 +0000 (00:48 +1000)]
WM: move theme check out of ED_view3d_draw_select_loop

In 2.8x this needs to be in view3d_opengl_select,
so simplest to make in master too.

4 years agoFix minor Mesh -> BMesh conversion issues
Campbell Barton [Sat, 26 Aug 2017 11:59:54 +0000 (21:59 +1000)]
Fix minor Mesh -> BMesh conversion issues

- Vertex only meshes never restored their selection history.
- Select history was cleared on the source instead of the target.

Simple Optimizations:
- Avoid O(n^2) linked list looping that checked the entire list before
  adding elements (NULL values in the source array to prevent dupes).
- Re-use vert & edge lookup tables instead of allocating new ones.

4 years agoFix T52478: Error report "Shrinkwrap: out of memory" on invisible target.
Bastien Montagne [Sat, 26 Aug 2017 12:46:59 +0000 (14:46 +0200)]
Fix T52478: Error report "Shrinkwrap: out of memory" on invisible target.

Shrinkwrap must check it does have valid target data.

Safe for 2.79 release.

4 years agoFix T52538: Outliner crash when displaying groups and using Show Active on editmode...
Bastien Montagne [Sat, 26 Aug 2017 10:27:37 +0000 (12:27 +0200)]
Fix T52538: Outliner crash when displaying groups and using Show Active on editmode bone not in any groups

There's no guaranty that given ID is found in current outliner tree...

Safe for 2.79, though not a regression.

4 years ago[cycles/ctest] fix failing tests when output folder doesn't exist yet.
Ray Molenkamp [Fri, 25 Aug 2017 23:17:49 +0000 (17:17 -0600)]
[cycles/ctest] fix failing tests when output folder doesn't exist yet.

4 years agoFix for fix (tm): Residue of the debug code
Sergey Sharybin [Fri, 25 Aug 2017 19:33:44 +0000 (21:33 +0200)]
Fix for fix (tm): Residue of the debug code

4 years agoFix mistake in previous tangent space optimization
Sergey Sharybin [Fri, 25 Aug 2017 19:29:59 +0000 (21:29 +0200)]
Fix mistake in previous tangent space optimization

4 years agoCycles: Cleanup, naming of variable
Sergey Sharybin [Fri, 25 Aug 2017 19:03:50 +0000 (21:03 +0200)]
Cycles: Cleanup, naming of variable

Always use b_ prefix for C++ RNA data.

4 years agoCycles: Add assert to catch possibly wrong logic
Sergey Sharybin [Fri, 25 Aug 2017 19:02:27 +0000 (21:02 +0200)]
Cycles: Add assert to catch possibly wrong logic

4 years agoCycles: Mark pixels with negative values as outliers
Lukas Stockner [Thu, 24 Aug 2017 21:15:30 +0000 (23:15 +0200)]
Cycles: Mark pixels with negative values as outliers

If a pixel has negative components, something already went wrong, so the best option is to just ignore it.

Should be good for 2.79.

4 years agoFix T52481: After making all local, local proxies of linked data get broken after...
Bastien Montagne [Fri, 25 Aug 2017 14:11:35 +0000 (16:11 +0200)]
Fix T52481: After making all local, local proxies of linked data get broken after file save and reload.

Issue was nasty hidden one, the dual status (mix of local and linked)
of proxies striking again.

Here, remapping process was considering obdata pointer of proxies as
indirect usage, hence clearing the 'LIB_TAG_EXTERN' of obdata pointer.
That would make savetoblend code not store any 'lib placeholder' for
obdata data-block, which was hence lost on next file read.

Another (probably better) solution here would be to actually consider
obdata of proxies are fully indirect usage, and simply reassign proxies
from their linked object's obdata on file read...

However, that change shall be safer for now, probably good for 2.79 too.

4 years agoAnother optimization of tangent space calculation
Sergey Sharybin [Fri, 25 Aug 2017 12:54:44 +0000 (14:54 +0200)]
Another optimization of tangent space calculation

Don't use quick sort for small arrays, bubble sort works way faster for small
arrays due to cache coherency. This is what qsort() from libc is doing actually.
We can also experiment unrolling some extra small arrays, for example 3 and 4
element arrays.

This reduces tangent space calculation for dragon from 3.1sec to 2.9sec.

4 years agoOptimize tangent space calculation by inlining functions
Sergey Sharybin [Fri, 25 Aug 2017 12:50:04 +0000 (14:50 +0200)]
Optimize tangent space calculation by inlining functions

Brings tangent space calculation from 4.6sec to 3.1sec for dragon model in BI.
Cycles is also somewhat faster, but it has other bottlenecks.

Funny thing, using simple `static inline` already gives a lot of speedup here.
That's just answering question whether it's OK to leave decision on what to
inline up to a compiler..