blender.git
17 months agoMerge branch 'master' into blender2.8
Campbell Barton [Thu, 3 May 2018 06:22:00 +0000 (08:22 +0200)]
Merge branch 'master' into blender2.8

17 months agoCleanup: split out extrude spin/screw
Campbell Barton [Thu, 3 May 2018 06:13:17 +0000 (08:13 +0200)]
Cleanup: split out extrude spin/screw

Since these will have their own manipulators,
its more convenient to keep them separate.

17 months agoWM: warn when tool widget not found
Campbell Barton [Thu, 3 May 2018 05:31:55 +0000 (07:31 +0200)]
WM: warn when tool widget not found

This happens when testing adding tools, assert isn't useful.

17 months agoCleanup: trailing space
Campbell Barton [Thu, 3 May 2018 05:22:04 +0000 (07:22 +0200)]
Cleanup: trailing space

17 months agoCleanup: remove axis bounds ifdef
Campbell Barton [Thu, 3 May 2018 05:21:06 +0000 (07:21 +0200)]
Cleanup: remove axis bounds ifdef

This was added for scale-cage manipulator, but seems generally useful.

17 months agoTransform: expose 3D center/axis calculation
Campbell Barton [Thu, 3 May 2018 05:15:34 +0000 (07:15 +0200)]
Transform: expose 3D center/axis calculation

This is needed for other manipulator placement.

17 months agoWM: add function to access last_properties
Campbell Barton [Wed, 2 May 2018 15:59:43 +0000 (17:59 +0200)]
WM: add function to access last_properties

17 months agoMetaball: pointers used in `DRW_shgroup_call_dynamic_add` don't need to hold the...
Germano [Thu, 3 May 2018 00:26:43 +0000 (21:26 -0300)]
Metaball: pointers used in `DRW_shgroup_call_dynamic_add` don't need to hold the reference.

17 months agoArmature: Envelope: Small cleanup + don't smooth the distance display.
Clément Foucault [Wed, 2 May 2018 06:58:29 +0000 (08:58 +0200)]
Armature: Envelope: Small cleanup + don't smooth the distance display.

The actual weighting calculation is not smooth as the bone display.

The bone itself can be smooth for esthetic purpose but the distance display
should match the underlying weighting formula.

17 months agoArmature: Envelope: Optimize outline shader.
Clément Foucault [Wed, 2 May 2018 06:45:06 +0000 (08:45 +0200)]
Armature: Envelope: Optimize outline shader.

17 months agoArmature: Envelope: Revisit envelope drawing again.
Clément Foucault [Wed, 2 May 2018 06:44:24 +0000 (08:44 +0200)]
Armature: Envelope: Revisit envelope drawing again.

Past shader was too slow and had bad artifacts. This method is much simpler
and eficient and only exhibit some popping when the raidus of the head/tail
is changed.

17 months agoGPUShader: Remove unused envelope shaders.
Clément Foucault [Mon, 30 Apr 2018 20:48:12 +0000 (22:48 +0200)]
GPUShader: Remove unused envelope shaders.

17 months agoArmature: More work and cleanup on envelope bones drawing.
Clément Foucault [Mon, 30 Apr 2018 20:47:40 +0000 (22:47 +0200)]
Armature: More work and cleanup on envelope bones drawing.

- Draw tail & head sphere with point shader (no needs for another way).
- Use the same function for issuing the calls for wire and solid envelope.

17 months agoArmature: Add envelope outline shader.
Clément Foucault [Mon, 30 Apr 2018 20:35:30 +0000 (22:35 +0200)]
Armature: Add envelope outline shader.

17 months agoArmature: Envelope Bones: Change drawing method.
Clément Foucault [Sun, 29 Apr 2018 17:39:44 +0000 (19:39 +0200)]
Armature: Envelope Bones: Change drawing method.

We now use a more pleasant and efficient way to display enveloppe bones
and their radius.

For this we use a capsule geometry that is displaced (in the vertex shader)
to a signed distance field that represents the bone shape.

The bone distance radius are now drawn in 3D using a "pseudo-fresnel" effect.
This gives a better understanding of what is inside the radius of influence.

When capsules are not needed, we switch to default raytraced points.
The capsules are not distorded by the bone's matrix (same as their actual
influence radius) and are correctly displayed even with complex scaled
parents hierarchy.

17 months agoArmature: Draw envelope on non MSAA buffer.
Clément Foucault [Sun, 29 Apr 2018 17:28:43 +0000 (19:28 +0200)]
Armature: Draw envelope on non MSAA buffer.

Appart from the performance issue, the MSAA resolve pass is not compatible
with additive passes.

17 months agoArmature: Add multisampling to posemode.
Clément Foucault [Fri, 27 Apr 2018 14:30:03 +0000 (16:30 +0200)]
Armature: Add multisampling to posemode.

17 months agoDRW: Convert DRW_cache_circle_get to use GWN_PRIM_LINE_LOOP
Clément Foucault [Fri, 27 Apr 2018 14:28:49 +0000 (16:28 +0200)]
DRW: Convert DRW_cache_circle_get to use GWN_PRIM_LINE_LOOP

17 months agoArmature: "Raytrace" bones endpoint spheres.
Clément Foucault [Fri, 27 Apr 2018 14:27:47 +0000 (16:27 +0200)]
Armature: "Raytrace" bones endpoint spheres.

Here is how it works:
We render a high poly disc that we orient & scale towards the camera so that
it covers the same pixel of the sphere it's supposed to represent.

Then the pixel shader raytrace the sphere (effectively starting from
the poly disc depth) and outputs the depth to gl_FragDepth.

This approach has many benefit:
- high quality obviously: per pixel accurate depth!
- compatible with MSAA: since the sphere horizon is delimited by polygons,
  we get the coverage computed by the rasterizer. However we still gets
  aliasing if the sphere intersect directly other meshes.
- virtually no overdraw: there is no backface to shade but we still get
  overdraw because by little triangle [gpus rasterize pixel by groups of 4].
- allows early depth test: since the poly disc is set at the nearest depth
  we can output, we can use GL_ARB_conservative_depth to enable early depth
  test and discard pixels that are already behind geometry.
- can draw outline pretty easily without geometry shader.

17 months agoDRW: Make use of new multisample resolve pass.
Clément Foucault [Mon, 23 Apr 2018 21:11:29 +0000 (23:11 +0200)]
DRW: Make use of new multisample resolve pass.

17 months agoDRW: Add DRW_multisamples_resolve function
Clément Foucault [Mon, 23 Apr 2018 21:10:59 +0000 (23:10 +0200)]
DRW: Add DRW_multisamples_resolve function

This manually resolve the content of a multisample FB to a single sample FB.

It resolves color (combine the 2 framebuffers in a logical maner keeping
depth buffer occlusion etc..) instead of a plain glBlitFramebuffer copy.

17 months agoGPUShader: Optimize Multisample resolve shader.
Clément Foucault [Mon, 23 Apr 2018 21:07:58 +0000 (23:07 +0200)]
GPUShader: Optimize Multisample resolve shader.

Group all fetches together without interleived alu to let compiler optimize.

Also do the color samples only if needed.

Went from 3.86ms to [1.11-2.22]ms [min-max] for the 16samples resolve pass
on my nvidia card.

17 months agoDRW: Add DRW_STATE_BLEND_PREMUL blend mode.
Clément Foucault [Mon, 23 Apr 2018 20:58:47 +0000 (22:58 +0200)]
DRW: Add DRW_STATE_BLEND_PREMUL blend mode.

17 months agoGPUShader: Add GPU_SHADER_2D_IMAGE_MULTISAMPLE_2/4/8/16
Clément Foucault [Mon, 23 Apr 2018 19:08:11 +0000 (21:08 +0200)]
GPUShader: Add GPU_SHADER_2D_IMAGE_MULTISAMPLE_2/4/8/16

This shader is used instead of blitting back and forth to a single sample
buffer.

This means it resolves the color and depth samples and outputs a fragment
which can be depth tested and blended on top of an existing framebuffer.

We do static shader variation with manual loop unrolling for performance
reason. In my test I get 25% more perf with intel integrated gpu and 75%
performance gain with dedicated nvidia card compared to a single shader
with a uniform for sample count.

17 months agoGWN: Add GWN_batch_uniform_mat4.
Clément Foucault [Mon, 23 Apr 2018 19:01:16 +0000 (21:01 +0200)]
GWN: Add GWN_batch_uniform_mat4.

17 months agoGPUShader: Fix simple lighting modulating alpha color
Clément Foucault [Mon, 23 Apr 2018 19:00:32 +0000 (21:00 +0200)]
GPUShader: Fix simple lighting modulating alpha color

17 months agoObject Mode: Draw non meshes before outline.
Clément Foucault [Sun, 22 Apr 2018 20:56:07 +0000 (22:56 +0200)]
Object Mode: Draw non meshes before outline.

This makes the outlines occluded by the other objects. This was a problem
before the outline refactor but now there is no need for it.

17 months agoDRW: Armature: New bone outline shader.
Clément Foucault [Sun, 22 Apr 2018 20:49:36 +0000 (22:49 +0200)]
DRW: Armature: New bone outline shader.

This fix the issue with the zfighting we were getting at bones edges.

Moreover, this enables us to render arbitrarly large outline with
varying thickness.

17 months agoDRW: Add Adjacency info for bone shapes.
Clément Foucault [Sun, 22 Apr 2018 19:55:05 +0000 (21:55 +0200)]
DRW: Add Adjacency info for bone shapes.

Only for cube and octahedral shapes for now.

17 months agoGWN: Add GL_TRIANGLES_ADJACENCY to supported primitive types.
Clément Foucault [Sun, 22 Apr 2018 19:33:58 +0000 (21:33 +0200)]
GWN: Add GL_TRIANGLES_ADJACENCY to supported primitive types.

17 months agoGPUTexture: Fix wrong multisample texture size.
Clément Foucault [Sun, 22 Apr 2018 19:20:23 +0000 (21:20 +0200)]
GPUTexture: Fix wrong multisample texture size.

17 months agoPaint Vertex Mode: Fix shader not free.
Clément Foucault [Wed, 2 May 2018 16:39:44 +0000 (18:39 +0200)]
Paint Vertex Mode: Fix shader not free.

17 months agoEevee: Add Lamp Specular multiplier.
Clément Foucault [Wed, 2 May 2018 16:39:17 +0000 (18:39 +0200)]
Eevee: Add Lamp Specular multiplier.

It's usefull in some scenario to tweak the specular intensity of a light
without modifying the diffuse contribution.

Cycles allows it via lamps material which we currently not support in Eevee.

This is a good workaround for now.

17 months agoFix T54864: Assert when changing interface display scale
Dalai Felinto [Wed, 2 May 2018 16:22:09 +0000 (18:22 +0200)]
Fix T54864: Assert when changing interface display scale

The asserts were introduced on rB5f6c45498c92 (top-bar).

Although the asserts are technically correct, they would fail even in master.
And the commit simply added the asserts without fixing the situation itself
(as you can see in the report, it is really simple to reproduce this issue).

I propose we remove the asserts and bring them back only when the situation
itself is fixed. It doesn't make sense to introduce asserts that would fail
with the current state of the code.

17 months agoMerge branch 'blender2.8' of git.blender.org:blender into blender2.8
Jeroen Bakker [Wed, 2 May 2018 15:37:37 +0000 (17:37 +0200)]
Merge branch 'blender2.8' of git.blender.org:blender into blender2.8

17 months agoWorkbench: Linear => srgb conversion
Jeroen Bakker [Wed, 2 May 2018 15:37:11 +0000 (17:37 +0200)]
Workbench: Linear => srgb conversion

17 months agoFix mysterious crash on tooltips
Dalai Felinto [Wed, 2 May 2018 15:35:26 +0000 (17:35 +0200)]
Fix mysterious crash on tooltips

This was a hard to reproduce bug, but it happens often enough.
Basically the tooltip of the active tool was been invoked when
context had no valid ScrArea which would lead to a crash.

We now just return no tooltip in these cases.

17 months agoDepsgraph: Add function to iterate over all original IDs
Sergey Sharybin [Wed, 2 May 2018 14:31:05 +0000 (16:31 +0200)]
Depsgraph: Add function to iterate over all original IDs

17 months agoUse meaningful debug name for render depsgraph
Sergey Sharybin [Wed, 2 May 2018 14:26:12 +0000 (16:26 +0200)]
Use meaningful debug name for render depsgraph

17 months agoDepsgraph: Show log message when tagging specific depsgraph ID
Sergey Sharybin [Wed, 2 May 2018 14:11:50 +0000 (16:11 +0200)]
Depsgraph: Show log message when tagging specific depsgraph ID

17 months agoDepsgraph: Add per-depsgraph debug name which is shown in the logs
Sergey Sharybin [Wed, 2 May 2018 12:55:33 +0000 (14:55 +0200)]
Depsgraph: Add per-depsgraph debug name which is shown in the logs

This way we can see for which depsgraph datablock is being evaluated for.

17 months agoDepsgraph: Cleanup, naming conventions
Sergey Sharybin [Wed, 2 May 2018 12:25:32 +0000 (14:25 +0200)]
Depsgraph: Cleanup, naming conventions

17 months agoDepsgraph: Make all print messages to respect per-depsgraph debug flags
Sergey Sharybin [Wed, 2 May 2018 09:52:49 +0000 (11:52 +0200)]
Depsgraph: Make all print messages to respect per-depsgraph debug flags

17 months agoDepsgraph: Allow per-depsgraph debug flags
Sergey Sharybin [Wed, 2 May 2018 09:46:56 +0000 (11:46 +0200)]
Depsgraph: Allow per-depsgraph debug flags

Currently only affects EVALUATION debug messages, rest are to be
supported on per-depsgraph level.

17 months agoDepsgraph: Use utility function to print CoW update function
Sergey Sharybin [Wed, 2 May 2018 09:20:58 +0000 (11:20 +0200)]
Depsgraph: Use utility function to print CoW update function

17 months agoDepsgraph: Make bAction a part of dependency graph
Sergey Sharybin [Tue, 1 May 2018 15:46:51 +0000 (17:46 +0200)]
Depsgraph: Make bAction a part of dependency graph

There are various values which depends on context in there, for example
current driver value and original DNA value f-curve is applied for.

This partially fixes issue with not being able to tweak keyed values
when material preview is open.

The material preview is not being currently updated against non-keyed
changes since every tweak of material property does full preview scene
depsgraph evaluation.

17 months agoWorkbench: Fix interface change in draw maanger
Jeroen Bakker [Wed, 2 May 2018 15:08:42 +0000 (17:08 +0200)]
Workbench: Fix interface change in draw maanger

17 months agoMerge branch 'blender2.8' of git.blender.org:blender into blender2.8
Jeroen Bakker [Wed, 2 May 2018 14:59:42 +0000 (16:59 +0200)]
Merge branch 'blender2.8' of git.blender.org:blender into blender2.8

17 months agoVertex Paint: Use Linear colors for interpolation.
Clément Foucault [Wed, 2 May 2018 14:17:05 +0000 (16:17 +0200)]
Vertex Paint: Use Linear colors for interpolation.

This matches Cycles and Eevee's behaviour.

17 months agoEevee: Fix vertex color being in srgb space.
Clément Foucault [Wed, 2 May 2018 13:36:09 +0000 (15:36 +0200)]
Eevee: Fix vertex color being in srgb space.

Now they are properly converted to Linear space before interpolation.

Since the only way to get vertex color in eevee and cycles is via the
attribute node with the CD_AUTO_FROM_NAME flag, we have to know at binding
time which type of buffer will be connected to this auto input.

We store this information inside the batch cache (together with the according
uniform name) and pass it as uniform to the shader which does conversion if
needed. The same shader can then be reused to draw another mesh with
different auto layers configuration.

17 months agoModifiers: ported Skin modifier DerivedMesh → Mesh
Sybren A. Stüvel [Wed, 2 May 2018 14:39:17 +0000 (16:39 +0200)]
Modifiers: ported Skin modifier DerivedMesh → Mesh

17 months agoRenamed 1st parameter of BKE_bmesh_to_mesh from `me` to `be`
Sybren A. Stüvel [Wed, 2 May 2018 14:38:35 +0000 (16:38 +0200)]
Renamed 1st parameter of BKE_bmesh_to_mesh from `me` to `be`

It's a BMesh, it shouldn't be called `me`

17 months agoStatic Override: Move 'auto' flag into override struct, expose it to RNA.
Bastien Montagne [Wed, 2 May 2018 14:14:33 +0000 (16:14 +0200)]
Static Override: Move 'auto' flag into override struct, expose it to RNA.

17 months agoModifiers: ported Solidify modifier DerivedMesh → Mesh
Sybren A. Stüvel [Wed, 2 May 2018 13:08:54 +0000 (15:08 +0200)]
Modifiers: ported Solidify modifier DerivedMesh → Mesh

17 months agoMesh: add runtime customdata dirty flags
Campbell Barton [Wed, 2 May 2018 13:52:59 +0000 (15:52 +0200)]
Mesh: add runtime customdata dirty flags

17 months agoMesh: move runtime members to own struct
Campbell Barton [Wed, 2 May 2018 13:47:45 +0000 (15:47 +0200)]
Mesh: move runtime members to own struct

17 months agoWorkbench: update of 3dview
Jeroen Bakker [Wed, 2 May 2018 13:32:59 +0000 (15:32 +0200)]
Workbench: update of 3dview

17 months agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 2 May 2018 12:40:00 +0000 (14:40 +0200)]
Merge branch 'master' into blender2.8

17 months agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 2 May 2018 12:37:32 +0000 (14:37 +0200)]
Merge branch 'master' into blender2.8

17 months agoLattice modifier: take comparison out of loop
Sybren A. Stüvel [Wed, 2 May 2018 11:51:31 +0000 (13:51 +0200)]
Lattice modifier: take comparison out of loop

17 months agoModifiers: ported Lattice modifier DerivedMesh → Mesh
Sybren A. Stüvel [Wed, 2 May 2018 11:42:04 +0000 (13:42 +0200)]
Modifiers: ported Lattice modifier DerivedMesh → Mesh

17 months agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 2 May 2018 10:46:14 +0000 (12:46 +0200)]
Merge branch 'master' into blender2.8

17 months agoUI: open toolbar hold buttons on drag
Campbell Barton [Wed, 2 May 2018 10:18:36 +0000 (12:18 +0200)]
UI: open toolbar hold buttons on drag

Allows for faster tool switching, no need to wait for it to open.

17 months agoModifiers: ported Bevel modifier DerivedMesh → Mesh
Sybren A. Stüvel [Wed, 2 May 2018 09:39:23 +0000 (11:39 +0200)]
Modifiers: ported Bevel modifier DerivedMesh → Mesh

This introduces `BKE_mesh_to_bmesh_ex()`, which exposes all of the
`BMeshFromMeshParams` parameters to the caller. This is required to enable
the `calc_face_normal` flag, which is required for the Bevel modifier.

This also introduces `BKE_bmesh_to_mesh()`, which allocates a new `Mesh`,
converts the `BMesh` to it, and returns it. The returned mesh is owned by
the caller.

17 months agoWorkbench: Single Color Modes
Jeroen Bakker [Wed, 2 May 2018 10:05:40 +0000 (12:05 +0200)]
Workbench: Single Color Modes

 - ability to switch between Single Color, Object Color, Material Color
and Random Color
 - fixed Shading and Lighting popover
 - Renamed Solid -> Single Color

17 months agoUI: don't allow disabled popovers to open w/ drag
Campbell Barton [Wed, 2 May 2018 10:02:50 +0000 (12:02 +0200)]
UI: don't allow disabled popovers to open w/ drag

First dragging over active menu items could be used to open a disabled
popover.

17 months agoUI: run redo poll check in operators context
Campbell Barton [Wed, 2 May 2018 09:33:24 +0000 (11:33 +0200)]
UI: run redo poll check in operators context

17 months agoUI: fix operator redo showing empty popovers
Campbell Barton [Wed, 2 May 2018 08:59:20 +0000 (10:59 +0200)]
UI: fix operator redo showing empty popovers

Many operators have no options,
showing a popover button with no content isn't good.

17 months agoUI: disable popovers when panel poll fails
Campbell Barton [Wed, 2 May 2018 08:58:56 +0000 (10:58 +0200)]
UI: disable popovers when panel poll fails

17 months agoWM: utility to check if an operator will draw a UI
Campbell Barton [Wed, 2 May 2018 08:24:14 +0000 (10:24 +0200)]
WM: utility to check if an operator will draw a UI

Checking if a redo operator will show something is needed
to avoid empty redo popover.

17 months agoEdit Mesh: look-cut copy-on-write support
Dalai Felinto [Wed, 2 May 2018 07:58:31 +0000 (09:58 +0200)]
Edit Mesh: look-cut copy-on-write support

Note: As already commented in the code, the ideal solution would
be to pass select mode as parameter to ED_view3D_backbuf_validate.

Without that we have to resort to the hack solution of writing to
evaluation data.

17 months agoUI: move object selector into 3D view
Campbell Barton [Tue, 1 May 2018 18:12:06 +0000 (20:12 +0200)]
UI: move object selector into 3D view

This matches the new convention for left-handed mode selectors,
however we're still undecided on exactly how this should work.

For now test this out as a convention for all space types.

17 months agoEevee: Don't enable temporal AA when using 1 sample only.
Clément Foucault [Tue, 1 May 2018 17:39:04 +0000 (19:39 +0200)]
Eevee: Don't enable temporal AA when using 1 sample only.

This was producing infinite rendering but wasn't noticeable.

17 months agoEevee: Shadows: Only tag as shadow caster if a shadow is cast.
Clément Foucault [Tue, 1 May 2018 17:32:24 +0000 (19:32 +0200)]
Eevee: Shadows: Only tag as shadow caster if a shadow is cast.

This leads to great improvement if the scene have moving objects without
shadows (shadows disabled in the material panel).

17 months agoUI: move space-mode selectors before menu items
Campbell Barton [Tue, 1 May 2018 16:47:26 +0000 (18:47 +0200)]
UI: move space-mode selectors before menu items

This adds a convention to have a spaces primary mode selector
positioned to at the left of the header.

17 months agoModifiers: Fix crash when entering edit mode on unported modifiers
Sybren A. Stüvel [Tue, 1 May 2018 16:47:20 +0000 (18:47 +0200)]
Modifiers: Fix crash when entering edit mode on unported modifiers

17 months agoFix number sliders for the topbar
Dalai Felinto [Tue, 1 May 2018 16:35:11 +0000 (18:35 +0200)]
Fix number sliders for the topbar

17 months agoExtract common modifier parameters into ModifierEvalContext struct
Sybren A. Stüvel [Tue, 1 May 2018 15:33:04 +0000 (17:33 +0200)]
Extract common modifier parameters into ModifierEvalContext struct

The contents of the ModifierEvalContext struct are constant while iterating
over the modifier stack. The struct thus should be only created once, outside
any loop over the modifiers.

17 months agoFormatting
Sybren A. Stüvel [Tue, 1 May 2018 09:02:58 +0000 (11:02 +0200)]
Formatting

17 months agoModifiers: Array DerivedMesh → Mesh
Sybren A. Stüvel [Wed, 25 Apr 2018 14:47:52 +0000 (16:47 +0200)]
Modifiers: Array DerivedMesh → Mesh

17 months agoIntroduced CDDM_from_mesh_ex() to create a non-referencing CDDM
Sybren A. Stüvel [Wed, 25 Apr 2018 13:38:26 +0000 (15:38 +0200)]
Introduced CDDM_from_mesh_ex() to create a non-referencing CDDM

This allows the mesh to be freed and the CDDM kept.

17 months agoModifiers: Mirror DerivedMesh → Mesh
Sybren A. Stüvel [Wed, 25 Apr 2018 10:21:07 +0000 (12:21 +0200)]
Modifiers: Mirror DerivedMesh → Mesh

17 months agoModifiers: Armature DerivedMesh → Mesh
Sybren A. Stüvel [Wed, 25 Apr 2018 09:04:40 +0000 (11:04 +0200)]
Modifiers: Armature DerivedMesh → Mesh

The mesh parameter of armature_deform_verts() is now const, to indicate
that it's safe to pass ob->data to it directly.

17 months agoModifiers: Simple Deform & Build, DerivedMesh → Mesh
Sybren A. Stüvel [Thu, 19 Apr 2018 09:03:58 +0000 (11:03 +0200)]
Modifiers: Simple Deform & Build, DerivedMesh → Mesh

This commit introduces `EditMeshData`. The fields in this struct are
extracted from `EditDerivedBMesh` into their own struct `EditMeshData`,
which can then also be used by the `Mesh` struct. This allows passing
deformed vertices efficiently to the draw routines.

The modifier code constructs a new Mesh instead of writing to ob->data;
even when ob->data is a CoW copy, it can still be used by different
objects and thus shouldn't be modified by a modifier.

17 months agoModifiers: Add wrapper functions with Mesh / DerivedMesh conversion
Mai Lavelle [Wed, 18 Apr 2018 13:45:54 +0000 (15:45 +0200)]
Modifiers: Add wrapper functions with Mesh / DerivedMesh conversion

Makes the follow changes:

- Add new `deform*` and `apply*` function pointers to `ModifierTypeInfo` that take `Mesh`, and rename the old functions to indicate that they take `DerivedMesh`. These new functions are currently set to `NULL` for all modifiers.
- Add wrapper `modifier_deform*` and `modifier_apply*` functions in two variants: one that works with `Mesh` and the other which works with `DerivedMesh` that is named with `*_DM_depercated`. These functions check which type of data the modifier supports and converts if necessary
- Update the rest of Blender to be aware and make use of these new functions

The goal of these changes is to make it possible to port to using `Mesh` incrementally without ever needing to enter into a state where modifiers don't work. After everything has been ported over the old functions and wrappers could be removed.

Reviewers: campbellbarton, sergey, mont29

Subscribers: sybren

Tags: #bf_blender_2.8

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

17 months agoTypo fix
Sybren A. Stüvel [Wed, 25 Apr 2018 10:09:12 +0000 (12:09 +0200)]
Typo fix

17 months agoAdded note about potential crash in add_orco_dm()
Sybren A. Stüvel [Wed, 25 Apr 2018 07:53:32 +0000 (09:53 +0200)]
Added note about potential crash in add_orco_dm()

17 months agoEevee: Fix crash when using visibility groups with dupli objects.
Clément Foucault [Tue, 1 May 2018 15:59:33 +0000 (17:59 +0200)]
Eevee: Fix crash when using visibility groups with dupli objects.

17 months agoEevee: Contact Shadows: Add slope based bias & fix brightening.
Clément Foucault [Tue, 1 May 2018 15:31:35 +0000 (17:31 +0200)]
Eevee: Contact Shadows: Add slope based bias & fix brightening.

17 months agoEevee: Fix raytracing.
Clément Foucault [Tue, 1 May 2018 15:27:51 +0000 (17:27 +0200)]
Eevee: Fix raytracing.

- Fix the confusing naming in raycast()
- Fix raytrace acne caused by the rays not being correctly centered on
  the texel.

17 months agoFix: Silence |RNA_boolean_get: WM_OT_save_as_mainfile.exit not found." warning on...
Joshua Leung [Tue, 1 May 2018 15:43:05 +0000 (17:43 +0200)]
Fix: Silence |RNA_boolean_get: WM_OT_save_as_mainfile.exit not found." warning on exit

The operator in question doesn't define this property.
I'm commenting out for now in case another operator actually still uses it.

17 months agoFix previous commit, sorry about that :/
Bastien Montagne [Tue, 1 May 2018 15:03:23 +0000 (17:03 +0200)]
Fix previous commit, sorry about that :/

17 months agoStatic override: rename highly confusing var name in apply code.
Bastien Montagne [Tue, 1 May 2018 14:59:48 +0000 (16:59 +0200)]
Static override: rename highly confusing var name in apply code.

We use 'reference' to designate the linked ID which is being overridden
by the local one, so using 'reference' to designate the stored local ID
in apply RNA code was... not a good idea. ;)

17 months agoIcons: updated icons from @billreynish
Campbell Barton [Tue, 1 May 2018 14:44:44 +0000 (16:44 +0200)]
Icons: updated icons from @billreynish

This adds vertex paint & sculpt icons + other minor changes.

17 months agoMerge branch 'blender2.8' of git.blender.org:blender into blender2.8
Jeroen Bakker [Tue, 1 May 2018 14:28:02 +0000 (16:28 +0200)]
Merge branch 'blender2.8' of git.blender.org:blender into blender2.8

17 months agoOverlay: Enabled wireframe drawing for vertex/weight paint
Jeroen Bakker [Tue, 1 May 2018 14:26:31 +0000 (16:26 +0200)]
Overlay: Enabled wireframe drawing for vertex/weight paint

This is a temp hack, so that billrey can use blender 2.8 for
drawing the icons. Hack will be phased out by T54910

17 months agoFix compiler warning: Uninitialised var
Joshua Leung [Tue, 1 May 2018 14:22:29 +0000 (16:22 +0200)]
Fix compiler warning: Uninitialised var

17 months agoAdd/finish rna read-only access to actual override rules.
Bastien Montagne [Tue, 1 May 2018 13:18:30 +0000 (15:18 +0200)]
Add/finish rna read-only access to actual override rules.

For some reasons did not add operations themselves previously...

17 months agoStatic Override: fix 'search matching override operation' function.
Bastien Montagne [Tue, 1 May 2018 13:08:38 +0000 (15:08 +0200)]
Static Override: fix 'search matching override operation' function.

Previous code was waaaayyyy to flacky, returning matches for things that
did not actually have much in common!

17 months agoRefactoring: bvhutils: Use a function that gets the bvhtree through an identifier...
Germano [Tue, 1 May 2018 13:03:28 +0000 (10:03 -0300)]
Refactoring: bvhutils: Use a function that gets the bvhtree through an identifier type.

Reviewed By: @campbellbarton
Differential Revision: https://developer.blender.org/D3192