blender.git
3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Sun, 28 May 2017 15:48:59 +0000 (17:48 +0200)]
Merge branch 'master' into blender2.8

3 years agoMake 'set offset from cursor' group operator internal.
Bastien Montagne [Sun, 28 May 2017 15:35:24 +0000 (17:35 +0200)]
Make 'set offset from cursor' group operator internal.

This operator relies on a rather specific context setup, so it shall not
be exposed to user in 'operator search' menu etc.

Based on D2528 by Vuk Gardašević (lijenstina).

3 years agoRemove MinGW support
Aaron Carlisle [Sat, 27 May 2017 19:34:55 +0000 (15:34 -0400)]
Remove MinGW support

The Issue
=======

For a long time now MinGW has been unsupported and unmaintained and at this point,
it looks like something that we should just leave behind and move on.

Why Remove
==========

One of the big motivations for MinGW back in the day is that it was free compared to MSVC which was licensed based.
However, now that this is no longer true we have basically stopped updating the need CMake files.
Along with the CMake files, there are several patches to the extern libs needed to make this work.  For example, see:
https://developer.blender.org/diffusion/B/browse/master/extern/carve/patches/mingw_w64.patch

If we wanted to keep MinGW then we would need to make more custom patches to the external libs and
this is not something our platform maintainers are willing to do.

For example, here is the patches needed to build python: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-python3

Fixes T51301

Differential Revision: https://developer.blender.org/D2648

3 years agoFix T51637: Mesh Tools - Noise Button Crashes.
Bastien Montagne [Sat, 27 May 2017 12:46:14 +0000 (14:46 +0200)]
Fix T51637: Mesh Tools - Noise Button Crashes.

Logic behind which mtext to use from material was broken here... Though
ultimately that whole tool could probably be deprecated or reworked!

3 years agoRelease wasn't building, limit debug scope
Campbell Barton [Sat, 27 May 2017 10:47:41 +0000 (20:47 +1000)]
Release wasn't building, limit debug scope

3 years agoCustomData: assert on bad arguments to free
Campbell Barton [Sat, 27 May 2017 04:03:15 +0000 (14:03 +1000)]
CustomData: assert on bad arguments to free

Assert the index is in-range for the layer type.

3 years agoAdd automated ctest for complex merge in Array modifier.
Bastien Montagne [Fri, 26 May 2017 19:57:45 +0000 (21:57 +0200)]
Add automated ctest for complex merge in Array modifier.

See also T50851.

3 years agoFix T50851: Array modifier generating invalid geometry.
Bastien Montagne [Fri, 26 May 2017 19:48:18 +0000 (21:48 +0200)]
Fix T50851: Array modifier generating invalid geometry.

We had handling of fully duplicated polygons already, but... absolutely
nothing to sanitize partially merged polygons! This were giving us
totally invalid geometry, with duplicated vertices in single poly,
invalid edges, etc.

Now we do check for invalid loops inside polys, and generate new edges
as needed to get only valid polys.

For some reason this was a nightmare to get running fully OK, playing
with old and new indices is really, really mind breaking.

3 years agoSilence warning in draw manager
Dalai Felinto [Fri, 26 May 2017 15:51:08 +0000 (17:51 +0200)]
Silence warning in draw manager

3 years agoRename: FILE_ACTIVELAY > FILE_ACTIVE_COLLECTION
Dalai Felinto [Fri, 26 May 2017 15:41:50 +0000 (17:41 +0200)]
Rename: FILE_ACTIVELAY > FILE_ACTIVE_COLLECTION

3 years agoImplement support for Append objects in Blender 2.8
Dalai Felinto [Fri, 19 May 2017 17:34:15 +0000 (19:34 +0200)]
Implement support for Append objects in Blender 2.8

Note for users
==============

The active_layer option used for the filebrowser operators is now called
active_collection.

If there is no collections in the scenelayer or if this option is not selected
we automatically create a new collection for the new objects.

This is the same behaviour of trying to add a new object when there is
no collection.

Note for developers
===================

For those cases I moved the object user count handling from readfile to
the scene collection system. It's working fine for those, but we still
need to re-visit this for Add objects, and Duplicate - In those cases
the usercount is 2 when it should be 1.

Reviewers: mont29, sergey

Differential Revision: https://developer.blender.org/D2686

3 years agoRename BKE_layer_collection_active > BKE_layer_collection_get_active
Dalai Felinto [Fri, 26 May 2017 13:32:07 +0000 (15:32 +0200)]
Rename BKE_layer_collection_active > BKE_layer_collection_get_active

3 years agoMove util function to add new scene collection when active is not available from...
Dalai Felinto [Fri, 26 May 2017 13:10:35 +0000 (15:10 +0200)]
Move util function to add new scene collection when active is not available from object to layer

3 years agoDepsgraph iterator: Add assert for bases not yet evaluated
Dalai Felinto [Wed, 24 May 2017 17:07:07 +0000 (19:07 +0200)]
Depsgraph iterator: Add assert for bases not yet evaluated

3 years agoGawain: move convert_prim_type_to_gl to private API
Mike Erwin [Fri, 26 May 2017 15:23:23 +0000 (11:23 -0400)]
Gawain: move convert_prim_type_to_gl to private API

3 years agoFix removing texface layer
Campbell Barton [Fri, 26 May 2017 13:37:10 +0000 (23:37 +1000)]
Fix removing texface layer

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 26 May 2017 13:32:42 +0000 (23:32 +1000)]
Merge branch 'master' into blender2.8

3 years agoFix freeing all custom-data layers
Campbell Barton [Fri, 26 May 2017 13:19:33 +0000 (23:19 +1000)]
Fix freeing all custom-data layers

Would crash when the active index was out of range,
since there is no reason to use the active layer when freeing all,
free the first instead.

3 years agoFix T50908: Motion Tracker ignored grease pencil mask
Sergey Sharybin [Fri, 26 May 2017 13:21:15 +0000 (15:21 +0200)]
Fix T50908: Motion Tracker ignored grease pencil mask

This feature got lost with new auto-track API,

Added it back by extending frame accessor class. This isn't really
a frame thing, but we don't have other type of accessor here.

Surely, we can use old-style API here and pass mask via region
tracker options for this particular case, but then it becomes much
less obvious how real auto-tracker will access this mask with old
style API.

So seems we do need an accessor for such data, just matter of
finding better place than frame accessor.

3 years agoFix integer overflows in meshcache modifier.
lazydodo [Fri, 26 May 2017 12:26:21 +0000 (06:26 -0600)]
Fix integer overflows in meshcache modifier.

Differential Revision: https://developer.blender.org/D2688

3 years agoFix uninit shading group in object mode particles
Luca Rood [Fri, 26 May 2017 11:35:45 +0000 (13:35 +0200)]
Fix uninit shading group in object mode particles

3 years agoRemove MTexPoly layers
Campbell Barton [Fri, 26 May 2017 10:58:57 +0000 (20:58 +1000)]
Remove MTexPoly layers

3 years agoRemove default shading groups from eevee
Luca Rood [Wed, 24 May 2017 14:49:56 +0000 (16:49 +0200)]
Remove default shading groups from eevee

3 years agoFix indentation in clay_engine.c
Luca Rood [Wed, 24 May 2017 14:47:00 +0000 (16:47 +0200)]
Fix indentation in clay_engine.c

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 26 May 2017 09:57:28 +0000 (19:57 +1000)]
Merge branch 'master' into blender2.8

3 years agoFix T51609: Bake Texture, Margin crashing Blender
Sergey Sharybin [Fri, 26 May 2017 09:27:27 +0000 (11:27 +0200)]
Fix T51609: Bake Texture, Margin crashing Blender

Integer overflow in margin filter code.

3 years agoDepsgraph: Rename DAG > DEG functions from depsgraph_query.cc
Dalai Felinto [Fri, 26 May 2017 09:23:10 +0000 (11:23 +0200)]
Depsgraph: Rename DAG > DEG functions from depsgraph_query.cc

3 years agoFix T51350: 2D curve normals flip when deformed
Campbell Barton [Fri, 26 May 2017 09:03:30 +0000 (19:03 +1000)]
Fix T51350: 2D curve normals flip when deformed

Deforming 2D curves & text with modifiers/shape-keys
could flip the normals.

Now check the back-facing flag instead of `z < 0`.

3 years agoFix T51287: Matrix.lerp fails w/ shear
Brecht Van Lommel [Fri, 26 May 2017 07:00:20 +0000 (17:00 +1000)]
Fix T51287: Matrix.lerp fails w/ shear

Use interp_m4_m4m4 (wraps Eigen),
`MATH_STANDALONE` will need to be updated to support this.

3 years agoFix GPencil depth checks
Campbell Barton [Fri, 26 May 2017 06:16:33 +0000 (16:16 +1000)]
Fix GPencil depth checks

Regression in 195d0fba

3 years agoFix T51629: Select w/ object lock fails
Campbell Barton [Fri, 26 May 2017 06:11:32 +0000 (16:11 +1000)]
Fix T51629: Select w/ object lock fails

Regression in 195d0fba

3 years agoCleanup: warning
Campbell Barton [Fri, 26 May 2017 04:24:39 +0000 (14:24 +1000)]
Cleanup: warning

3 years agoCycles: Cleanup: Remove semicolons from line endings in Python code
Lukas Stockner [Fri, 26 May 2017 00:15:09 +0000 (02:15 +0200)]
Cycles: Cleanup: Remove semicolons from line endings in Python code

3 years agoCycles: Update compositor when debug or denoising passes are changed
Lukas Stockner [Fri, 26 May 2017 00:13:21 +0000 (02:13 +0200)]
Cycles: Update compositor when debug or denoising passes are changed

3 years agoCycles: Cleanup: b_srlay is always used now, no more need to silence warning
Lukas Stockner [Thu, 25 May 2017 23:55:32 +0000 (01:55 +0200)]
Cycles: Cleanup: b_srlay is always used now, no more need to silence warning

3 years agoCleanup: Typo in colormanagement (ColormnaageCacheData -> ColormanageCacheData)
Lukas Stockner [Thu, 25 May 2017 23:52:43 +0000 (01:52 +0200)]
Cleanup: Typo in colormanagement (ColormnaageCacheData -> ColormanageCacheData)

3 years ago[MSVC] Fix build error. linker was searching for a mangled version of versionstr
lazydodo [Thu, 25 May 2017 21:23:45 +0000 (15:23 -0600)]
[MSVC] Fix build error. linker was searching for a mangled version of versionstr

3 years agoFix blender player python installation on macOS after recent changes.
Brecht Van Lommel [Thu, 25 May 2017 19:42:52 +0000 (21:42 +0200)]
Fix blender player python installation on macOS after recent changes.

3 years agoFix T50112: Sequencer crash w/ missing proxy data
Campbell Barton [Thu, 25 May 2017 10:23:31 +0000 (20:23 +1000)]
Fix T50112: Sequencer crash w/ missing proxy data

3 years agoDocs: Image.has_data clarification
Campbell Barton [Thu, 25 May 2017 09:54:54 +0000 (19:54 +1000)]
Docs: Image.has_data clarification

Resolves T51615

3 years agoFix T51444: Unit tests don't run on Windows
Campbell Barton [Thu, 25 May 2017 08:56:00 +0000 (18:56 +1000)]
Fix T51444: Unit tests don't run on Windows

3 years agoTexFace removal part 3
Campbell Barton [Thu, 25 May 2017 05:11:00 +0000 (15:11 +1000)]
TexFace removal part 3

- MTexPoly structure & layer type.
- The 'Mesh.uv_textures' layers.
- DerivedMesh TexFace drawing.
- Scripts & UI.

3 years agoMerge branch 'master' into blender2.8
Brecht Van Lommel [Thu, 25 May 2017 00:48:14 +0000 (02:48 +0200)]
Merge branch 'master' into blender2.8

3 years agoFix macOS python cmake install to work when switching lib directories.
Brecht Van Lommel [Thu, 25 May 2017 00:34:39 +0000 (02:34 +0200)]
Fix macOS python cmake install to work when switching lib directories.

It's a bit ugly but I couldn't find a better way to keep fast installs and
correct handling of switching between master and blender2.8 with different
lib directories.

3 years agoMerge branch 'master' into blender2.8
Julian Eisel [Wed, 24 May 2017 22:43:01 +0000 (00:43 +0200)]
Merge branch 'master' into blender2.8

3 years agoFix compiler error for VS2017
Antonio Vazquez [Wed, 24 May 2017 18:13:45 +0000 (20:13 +0200)]
Fix compiler error for VS2017

a void function cannot return a value.

3 years agoFix error accessing tessface color in edit-mode
Campbell Barton [Wed, 24 May 2017 16:44:58 +0000 (02:44 +1000)]
Fix error accessing tessface color in edit-mode

Was checking for loop-color in poly-layer.

3 years agoOnly calc split normals when auto-smooth is enabled
Campbell Barton [Wed, 24 May 2017 16:31:39 +0000 (02:31 +1000)]
Only calc split normals when auto-smooth is enabled

This matches cycles & derived-mesh

3 years agoFix/Workaround T51561: Disable split normals
Campbell Barton [Wed, 24 May 2017 15:15:29 +0000 (01:15 +1000)]
Fix/Workaround T51561: Disable split normals

3 years agoTexFace removal part 2
Campbell Barton [Wed, 24 May 2017 14:34:14 +0000 (00:34 +1000)]
TexFace removal part 2

- Derived-mesh drawing.
- All non UV members of TexFace structs.

MTexPoly is now redundant but keeping with a dummy member,
will check on complete removal later.

3 years agoCycles: Use falltrhough attribute to help catching missing break statements
Sergey Sharybin [Wed, 24 May 2017 15:23:54 +0000 (17:23 +0200)]
Cycles: Use falltrhough attribute to help catching missing break statements

3 years agoProper fix for crash loading old files with compositor
Sergey Sharybin [Wed, 24 May 2017 13:39:15 +0000 (15:39 +0200)]
Proper fix for crash loading old files with compositor

Now we keep all links around, even for sockets which were
implicitly renamed. And also ensuring new sockets have proper
storage.

3 years agoRemove TexFace, per-face images
Campbell Barton [Wed, 24 May 2017 13:14:32 +0000 (23:14 +1000)]
Remove TexFace, per-face images

TexFace complicates the now more popular shading pipeline by having
per-face images, see: T51382 for details.

To keep the ability to select a per-material edit-image
(used with UV-mapping workflow), the material now stores an image
which will be set when changing images in edit-mode.

This is used as a bake-target when not using Cycles too.

3 years agoRevert "Fix crash opening really old files with compositor"
Sergey Sharybin [Wed, 24 May 2017 13:29:14 +0000 (15:29 +0200)]
Revert "Fix crash opening really old files with compositor"

This commit broke compatibility with newer files: due to rename
of Speed to Vector the links got lost.

This reverts commit 0e46da76b70a42bab2268942cba0e0d3e4ba47e8.

3 years agoCleanup: minor de-duplicate from last commit
Campbell Barton [Wed, 24 May 2017 12:47:18 +0000 (22:47 +1000)]
Cleanup: minor de-duplicate from last commit

3 years agoFix T51561: Normal maps fail w/ quad + eevee
Campbell Barton [Wed, 24 May 2017 12:33:21 +0000 (22:33 +1000)]
Fix T51561: Normal maps fail w/ quad + eevee

Generalize derived-mesh tangent calculation so
it can be used by Batch cache creation too.

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 24 May 2017 11:16:54 +0000 (21:16 +1000)]
Merge branch 'master' into blender2.8

3 years agoFix possible invalid normal use w/ tangent calc
Campbell Barton [Wed, 24 May 2017 11:13:32 +0000 (21:13 +1000)]
Fix possible invalid normal use w/ tangent calc

Was using MFace normals, not MPoly

3 years agoAlembic: Export mesh as mesh, even when it has no vertices.
Sybren A. Stüvel [Wed, 24 May 2017 10:39:37 +0000 (12:39 +0200)]
Alembic: Export mesh as mesh, even when it has no vertices.

This makes it possible to have an animated / procedurally generated mesh
that starts empty and obtains data in later frames.

Fixes the export of an empty mesh with an Ocean Modifier, as described in
issue T51351.

3 years agoAlembic export: consider mesh with animation data as "animated"
Sybren A. Stüvel [Wed, 24 May 2017 10:38:17 +0000 (12:38 +0200)]
Alembic export: consider mesh with animation data as "animated"

This allows you to put any kind of animation data on the mesh, and its
shape will be exported on each timekey. Note that this timekey is unrelated
to the animation data (so we don't export on each keyframe, for example).

A practical example is the addition of an animated custom property to
trigger the export of animated mesh data. The mesh data can then be created
from any source, like Python scripts.

Not only is this useful in itself, it also provides a workaround for one
of the two issues described in T51351.

3 years agoAlembic export: write Blender version to Alembic file
Sybren A. Stüvel [Wed, 24 May 2017 09:45:14 +0000 (11:45 +0200)]
Alembic export: write Blender version to Alembic file

This is written in a custom metadata key, so it isn't shown by utilities
like abcecho or abcls. However, it's still something that's useful to
have available.

3 years agoCMake: document that WITH_FFTW3 is also used for the ocean sim.
Sybren A. Stüvel [Wed, 24 May 2017 09:36:41 +0000 (11:36 +0200)]
CMake: document that WITH_FFTW3 is also used for the ocean sim.

3 years agoFix T51586: Regression: Alembic containing animated curves / hair no longer working
Sybren A. Stüvel [Wed, 24 May 2017 08:24:25 +0000 (10:24 +0200)]
Fix T51586: Regression: Alembic containing animated curves / hair no longer working

Also fixed the same type of error when reading points.

3 years agoFix T51589: Principled Subsurface Scattering, wrong shadow color
Pascal Schoen [Wed, 24 May 2017 05:34:11 +0000 (07:34 +0200)]
Fix T51589: Principled Subsurface Scattering, wrong shadow color

Apply mix of subsurface and base color (wrt subsurface) for rays that
have transmitted the surface.

3 years agoMove empty image drawing into its own pass
Campbell Barton [Wed, 24 May 2017 04:28:48 +0000 (14:28 +1000)]
Move empty image drawing into its own pass

3 years agoCleanup: bmesh var naming
Campbell Barton [Wed, 24 May 2017 03:33:48 +0000 (13:33 +1000)]
Cleanup: bmesh var naming

3 years agoDwM: avoid indirect edit-mesh conversion
Campbell Barton [Wed, 24 May 2017 01:43:55 +0000 (11:43 +1000)]
DwM: avoid indirect edit-mesh conversion

Storing edit-mesh data as indices for passing
only to get back edit-mesh data.

This also complicated checks for real edges in tessellation tris.

Simpler to pass data directly.

3 years agoFix leak in particle velocity global ramp
Campbell Barton [Wed, 24 May 2017 03:26:06 +0000 (13:26 +1000)]
Fix leak in particle velocity global ramp

3 years agoOptimize particle primitive shader
Luca Rood [Tue, 23 May 2017 16:13:41 +0000 (18:13 +0200)]
Optimize particle primitive shader

3 years agoTemp fix for vertex format with batch instancing
Luca Rood [Tue, 23 May 2017 16:11:50 +0000 (18:11 +0200)]
Temp fix for vertex format with batch instancing

This prevents memory alignment from being screwed up when attributes are
optimized out in shader.

3 years agoImplement particle velocity and acceleration visualization
Luca Rood [Tue, 23 May 2017 14:56:53 +0000 (16:56 +0200)]
Implement particle velocity and acceleration visualization

3 years agoMerge branch 'master' into blender2.8
Sybren A. Stüvel [Tue, 23 May 2017 15:35:45 +0000 (17:35 +0200)]
Merge branch 'master' into blender2.8

3 years agoFix T51534: Alembic: added support for face-varying vertex colours
Sybren A. Stüvel [Tue, 23 May 2017 15:27:09 +0000 (17:27 +0200)]
Fix T51534: Alembic: added support for face-varying vertex colours

Houdini writes vertex data in a different format than Blender does; Houdini
uses "face-varying scope", which means that the vertex colours are indexed
by an ever-increasing number over all vertices of all faces instead of the
vertex index.

I've also merged the read_custom_data_mcols() and read_mcols() functions,
because the latter was only called from the former, and the changes in this
commit would add yet more function parameters to pass.

3 years agoAlembic: reduced code duplication in read_mcols()
Sybren A. Stüvel [Tue, 23 May 2017 12:19:38 +0000 (14:19 +0200)]
Alembic: reduced code duplication in read_mcols()

A big chunk of code was copied between the if and else bodies. By using
a boolean to store whether the c3f_ptr or c4f_ptr should be used, the
in-loop condition is kept as simple as possible.

3 years agoAlembic: split up read_custom_data_ex() into read_custom_data_{mcols,uvs}()
Sybren A. Stüvel [Tue, 23 May 2017 11:28:38 +0000 (13:28 +0200)]
Alembic: split up read_custom_data_ex() into read_custom_data_{mcols,uvs}()

The read_custom_data_ex() function was basically two functions inside
if/else bodies.

3 years agoAdd PovRay file extensions to our 'textual' file filtering.
Bastien Montagne [Tue, 23 May 2017 15:09:19 +0000 (17:09 +0200)]
Add PovRay file extensions to our 'textual' file filtering.

3 years agoFix some POV keywords not colored correctly.
Bastien Montagne [Tue, 23 May 2017 14:41:48 +0000 (16:41 +0200)]
Fix some POV keywords not colored correctly.

We need to ensure longer keywords are catched first, when there are
shorter subsets of them in keywords list as well!

3 years agoEevee: Disable directionnal lamps shadows
Clément Foucault [Tue, 23 May 2017 13:12:24 +0000 (15:12 +0200)]
Eevee: Disable directionnal lamps shadows

3 years agoUse pointers to actual data for particle uniforms
Luca Rood [Tue, 23 May 2017 12:37:01 +0000 (14:37 +0200)]
Use pointers to actual data for particle uniforms

This makes particle color uniforms point directly to material color, and
particle size uniforms point directly to ParticleSettings size.

3 years agoUse custom shader for dot particles
Luca Rood [Tue, 23 May 2017 12:25:12 +0000 (14:25 +0200)]
Use custom shader for dot particles

3 years agoRename/move particle shaders
Luca Rood [Tue, 23 May 2017 12:13:25 +0000 (14:13 +0200)]
Rename/move particle shaders

3 years agoFix T48668, bevel mistake on presumed reflex angle.
Howard Trickey [Tue, 23 May 2017 11:55:14 +0000 (07:55 -0400)]
Fix T48668, bevel mistake on presumed reflex angle.

Note: the angle in bug isn't really reflex - using the vertex normal
for this test isn't always right, but usually is. At any rate,
shouldn't try to put vertex on edge between if a reflex angle.

3 years agoCreate new shading group for each psys
Luca Rood [Tue, 23 May 2017 10:32:15 +0000 (12:32 +0200)]
Create new shading group for each psys

3 years agoRevert "Implement UBOs for particles"
Luca Rood [Tue, 23 May 2017 09:24:03 +0000 (11:24 +0200)]
Revert "Implement UBOs for particles"

This reverts commit 845732652fa7a3d3a053006d30a76ea39fdc3c47.

3 years agoDWM: Add short to float / int uniform function.
Clément Foucault [Tue, 23 May 2017 11:59:44 +0000 (13:59 +0200)]
DWM: Add short to float / int uniform function.

Short values are common in DNA, this enables using them directly without storing temporary float somewhere.

3 years agoDraw Manager: Prevent errors when overwritting the instance batch.
Clément Foucault [Tue, 23 May 2017 08:38:52 +0000 (10:38 +0200)]
Draw Manager: Prevent errors when overwritting the instance batch.

3 years agoStupid mistake in material access optimization
Campbell Barton [Tue, 23 May 2017 11:52:18 +0000 (21:52 +1000)]
Stupid mistake in material access optimization

3 years agoMake msvc2015 happy again.
Bastien Montagne [Tue, 23 May 2017 10:40:12 +0000 (12:40 +0200)]
Make msvc2015 happy again.

Looks like that wanabe compiler does not support more than a few tens of
if/else conditions...

3 years agoFix T51319: Alembic export crash w/simple child particles if Display value < 100%
Sybren A. Stüvel [Tue, 23 May 2017 10:29:58 +0000 (12:29 +0200)]
Fix T51319: Alembic export crash w/simple child particles if Display value < 100%

This was two-fold.

1) The export used viewport settings to obtain the particle cache, rather
   than render settings.
2) The child hair writer tried to obtain UV-coordinates from the parent
   chair, without checking whether those were available in the first place.

3 years agoCleanup: Make Gawain code style more consistent
Sergey Sharybin [Tue, 23 May 2017 09:53:47 +0000 (11:53 +0200)]
Cleanup: Make Gawain code style more consistent

Not as if i'm totally fine with such style, but i'd better be consistent
with whatever the project is using.

3 years agoFix T51592: Simplify AO Cycles setting remains active while Simplify is disabled
Sergey Sharybin [Tue, 23 May 2017 08:34:03 +0000 (10:34 +0200)]
Fix T51592: Simplify AO Cycles setting remains active while Simplify is disabled

3 years agoDwM: optimize material access
Campbell Barton [Tue, 23 May 2017 08:23:18 +0000 (18:23 +1000)]
DwM: optimize material access

- Split BMesh/Mesh loops.
- Loop over faces instead of tris.
- Add out-of-bounds check for material index (rare but can happen).

3 years agoCleanup: use more generic naming
Campbell Barton [Tue, 23 May 2017 07:48:05 +0000 (17:48 +1000)]
Cleanup: use more generic naming

Can be used by any user that needs faces split by materials.

3 years agoDwM: texture paint support & mask mode
Campbell Barton [Mon, 22 May 2017 13:31:46 +0000 (23:31 +1000)]
DwM: texture paint support & mask mode

Uses workaround so material slots are used when neither blender-internal
or cycles are enabled.

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Mon, 22 May 2017 20:49:02 +0000 (22:49 +0200)]
Merge branch 'master' into blender2.8

Conflicts:
source/blender/blenloader/intern/versioning_270.c

3 years agoGawain: replace switch with lookup table
Mike Erwin [Mon, 22 May 2017 20:43:33 +0000 (16:43 -0400)]
Gawain: replace switch with lookup table

This function is not performance critical, but I prefer the branch-free code and no hack needed to appease gcc.

Follow-up to recent 23035cf46fb4dd6a0bf7e688b0f15128030c77d1 and f637145450010d14660fcb029d41560a138eae14.

3 years agoAdd PovRay syntax hilghting.
Bastien Montagne [Mon, 22 May 2017 19:53:32 +0000 (21:53 +0200)]
Add PovRay syntax hilghting.

Since we already have a rather advanced PovRay exporter, makes sense to
also nicely display generated 'code'.

Patch by Maurice Raybaud (@mauriceraybaud), thanks!
Cleanup (mostly styling) by @mont29.

3 years agoFix T51308: Bright/Contrast Doesn't respect Pre-multiplied Alpha
Sergey Sharybin [Mon, 22 May 2017 15:12:13 +0000 (17:12 +0200)]
Fix T51308: Bright/Contrast Doesn't respect Pre-multiplied Alpha

Brightness/contrast node was changing color but did not modify alpha
or ensured colors are premultiplied on the output. This was giving
artifacts later on unless alpha was manually converted.

Compositor is supposed to work in premultiplied alpha (except of
some really corner cases) so it makes sense to ensure premultiplied
alpha after brightness/contrast node.

This is now done as an option enabled by default, so we:

(a) Keep compatibility with old files.
(b) Have correct behavior for newly created files.

Later on we can get rid of this option.

3 years agoFix T51318: Non-update of preview when switching from world to lamp panel.
Bastien Montagne [Mon, 22 May 2017 15:11:55 +0000 (17:11 +0200)]
Fix T51318: Non-update of preview when switching from world to lamp panel.

Lamp preview panel is in DATA buttons context...

3 years agoEnhance vgroup handling when merging meshes.
Bastien Montagne [Mon, 22 May 2017 14:17:37 +0000 (16:17 +0200)]
Enhance vgroup handling when merging meshes.

We were looping over all vgroups in destination mesh and making string
comparison, for every vgroup of every vertex of merged mesh! Crazy!

Now we simply create a temp mapping of vgroup indices, seriously
simplifies things (and gives significant speedup when merging huge meshes
with lots of vgroups, here with quick stupid test went from 120ms in
vgroup merging to less than 5ms, 25 times quicker!).