2 years agoBMesh: match BM_vert_find_first_loop with iterator logic
Campbell Barton [Mon, 14 Nov 2016 20:55:55 +0000 (07:55 +1100)]
BMesh: match BM_vert_find_first_loop with iterator logic

Use changes from previous commit for BM_vert_find_first_loop.

2 years agoBMesh: avoid extra calls per faces-of-vert iterator
Campbell Barton [Mon, 14 Nov 2016 20:30:36 +0000 (07:30 +1100)]
BMesh: avoid extra calls per faces-of-vert iterator

- `bmesh_radial_faceloop_find_first` & `bmesh_disk_faceedge_find_first`
  can be replaced with a single call to a new function:

- `bmesh_disk_faceedge_find_first` called `bmesh_radial_facevert_check`
  which isn't needed, since either the current or next loop in the
  cycle is attached to the edge we're looking for.

2 years agoBMesh: use const for BM_vert_face_check
Campbell Barton [Mon, 14 Nov 2016 20:30:18 +0000 (07:30 +1100)]
BMesh: use const for BM_vert_face_check

2 years agoBMesh: minor improvement to BM_vert_face_check
Campbell Barton [Mon, 14 Nov 2016 19:50:33 +0000 (06:50 +1100)]
BMesh: minor improvement to BM_vert_face_check

No need to perform edge-of-vert then loop-of-edge check.

Any vertex that has an edge with a face will be connected to a face.

2 years agoBMesh: fix edge-rotate with w/ flipped faces
Campbell Barton [Mon, 14 Nov 2016 16:57:44 +0000 (03:57 +1100)]
BMesh: fix edge-rotate with w/ flipped faces

Edge-rotate would randomly flip one of the faces to match the other.

Also maintain active-face when rotating the edge.

2 years agoBMesh: fix edge-rotation selection state bug
Campbell Barton [Mon, 14 Nov 2016 16:26:19 +0000 (03:26 +1100)]
BMesh: fix edge-rotation selection state bug

Failed edge rotation could leave unselected edge between selected faces,
also report warning when edges fail to be rotated.

2 years agoBMesh: replace iterator with BM_face_vert_share_loop
Campbell Barton [Mon, 14 Nov 2016 15:41:23 +0000 (02:41 +1100)]
BMesh: replace iterator with BM_face_vert_share_loop

2 years agoBMesh: remove redundant argument
Campbell Barton [Mon, 14 Nov 2016 03:21:15 +0000 (14:21 +1100)]
BMesh: remove redundant argument

2 years agoCycles: De-duplicate image loading functions
Sergey Sharybin [Mon, 14 Nov 2016 13:03:17 +0000 (14:03 +0100)]
Cycles: De-duplicate image loading functions

The code was templated already, so don't see big reason to have
3 versions of templated functions. It was giving some extra code
to maintain and in fact already had divergency for support of huge
image resolution (missing size_t cast in byte image loading).

There should be no changes visible by artists.

2 years agointsall_deps / OSL use c++11 ABI when install_deps is asking for c++11
Martijn Berger [Mon, 14 Nov 2016 08:59:30 +0000 (09:59 +0100)]
intsall_deps / OSL use c++11 ABI when install_deps is asking for c++11

2 years agoOpenGL: use packed normals for fancy wireframes
Mike Erwin [Mon, 14 Nov 2016 02:27:50 +0000 (20:27 -0600)]
OpenGL: use packed normals for fancy wireframes

Consumes much less memory (1/3 for both normals = 32 bytes less per edge). Same visual result.

We can pack normals for other draw modes to get similar savings.

Part of T49165

2 years agoGawain: add support for 10_10_10 vertex format
Mike Erwin [Mon, 14 Nov 2016 02:18:51 +0000 (20:18 -0600)]
Gawain: add support for 10_10_10 vertex format

Most useful for packed normals, which take 1/3 the space of float32 normals.

2-bit alpha|w component is ignored for now.

Batch API can use these now, will add support to immediate mode API if desired.

Enabling on Windows first. Will enable on all platforms after we switch Blender to core profile.

2 years agoBMesh: BM_face_exists no longer uses return arg
Campbell Barton [Sun, 13 Nov 2016 17:10:47 +0000 (04:10 +1100)]
BMesh: BM_face_exists no longer uses return arg

Just return the face or NULL, like BM_edge_exists(),
Also for BM_face_exists_overlap & bm_face_exists_tri_from_loop_vert.
No functional changes.

Old code did some partial overlap checks where this made some sense,
but it's since been removed.

2 years agoFix T50013: Blender 2.78a Link/Append Crash.
Bastien Montagne [Sun, 13 Nov 2016 14:49:41 +0000 (15:49 +0100)]
Fix T50013: Blender 2.78a Link/Append Crash.

Object freeing may in some kind access its obdata (in case it has some
caches e.g.), since here obdata may have already been freed, let's set
object's data pointer to NULL (probably not ideal solution, but we don't
care much, those form archipelagos of unused linked datablocks,
we nuke'em all anyway).

Also fix stupid mistake in one of own recent commits (using ID we just
freed, tsst...).

2 years agoFix T50007: blender offline python documentation in zipped HTML files, not shown...
Bastien Montagne [Sun, 13 Nov 2016 11:03:28 +0000 (12:03 +0100)]
Fix T50007: blender offline python documentation in zipped HTML files, not shown correctly.

Stupid mistake, os.scandir is not recursive... Patch by @brecht, thanks.

2 years agoFix T49997: don't flip texture users menu in texture properties.
Brecht Van Lommel [Sun, 13 Nov 2016 01:27:45 +0000 (02:27 +0100)]
Fix T49997: don't flip texture users menu in texture properties.

2 years agoOpenGL: simplify debug, use only newer features
Mike Erwin [Sat, 12 Nov 2016 23:18:13 +0000 (17:18 -0600)]
OpenGL: simplify debug, use only newer features

Drop SciTech support & workarounds for WinCE and OpenGL ES.

AMD_debug_output is still in the code but disabled. Once I verify the newer extensions are available on all the GPU + OS combos we support we can delete this disabled code.

2 years agoFix T50008: camera DOF Distance picking from W key menu not working.
Brecht Van Lommel [Sat, 12 Nov 2016 21:29:49 +0000 (22:29 +0100)]
Fix T50008: camera DOF Distance picking from W key menu not working.

2 years agofix T50004: Removed check for empty mesh and adjusted the vertex import function...
Gaia Clary [Sat, 12 Nov 2016 21:20:07 +0000 (22:20 +0100)]
fix T50004: Removed check for empty mesh and adjusted the vertex import function to accept meshes without vertices as well

2 years agoFix Make Vertex Parent operator missing from vertex/curve/lattice menus.
Geoffroy Krantz [Sat, 12 Nov 2016 17:57:40 +0000 (18:57 +0100)]
Fix Make Vertex Parent operator missing from vertex/curve/lattice menus.

Reviewed By: brecht

Differential Revision:

2 years agoFix T49904: Cycles standalone missing default generated texture coordinates.
Brecht Van Lommel [Sat, 12 Nov 2016 16:21:21 +0000 (17:21 +0100)]
Fix T49904: Cycles standalone missing default generated texture coordinates.

2 years agoFix Cycles OSL compilation based on modified time not working.
Brecht Van Lommel [Sat, 12 Nov 2016 16:20:40 +0000 (17:20 +0100)]
Fix Cycles OSL compilation based on modified time not working.

2 years agoFix Cycles standalone not finding CPU device after recent changes.
Brecht Van Lommel [Sat, 12 Nov 2016 14:41:42 +0000 (15:41 +0100)]
Fix Cycles standalone not finding CPU device after recent changes.

2 years agoFix T49985: cycles standalone XML missing distant lights.
Brecht Van Lommel [Sat, 12 Nov 2016 14:26:51 +0000 (15:26 +0100)]
Fix T49985: cycles standalone XML missing distant lights.

2 years agoFix T49985: cycles standalone using wrong socket names for XML reading.
Brecht Van Lommel [Sat, 12 Nov 2016 14:26:24 +0000 (15:26 +0100)]
Fix T49985: cycles standalone using wrong socket names for XML reading.

2 years agoSculpt UI: Make DynTopo constant detail a resolution value
Julian Eisel [Sat, 12 Nov 2016 15:14:09 +0000 (16:14 +0100)]
Sculpt UI: Make DynTopo constant detail a resolution value

This should make it easier to sculpt in high resolutions, downside is that the new way to calculate maximum edge length is a bit less intuitive. Maximum edge length used to be calculated as blender_unit * percentage_value, now it's blender_unit / value.

Reused old DNA struct member, but had to bump subversion to ensure correct compatibility conversion. Also changed default value slightly (would have had to set to 3.333... otherwise).

Was Requested by @monio (see and I think it's worth testing.

2 years agoBMesh: update comments, ifdef'd code
Campbell Barton [Sat, 12 Nov 2016 14:35:22 +0000 (01:35 +1100)]
BMesh: update comments, ifdef'd code

2 years agoGawain: strict error checking in debug builds
Mike Erwin [Sat, 12 Nov 2016 05:53:58 +0000 (23:53 -0600)]
Gawain: strict error checking in debug builds

Not release builds. Fix 66d7f01eccdd9f82a4929f2873639e4012362090 to match what I meant to do.

2 years agoGawain: new enum type for vertex attrib components
Mike Erwin [Sat, 12 Nov 2016 01:39:56 +0000 (19:39 -0600)]
Gawain: new enum type for vertex attrib components

1) GLenum is too broad; tightly-defined enum just for this is safer.
2) enable a Vulkan future

New code should use these instead of GL_FLOAT etc. When all existing code has been updated to use new enum, we can drop compatibility with GLenum values.

Early work towards 10_10_10 format, more to come soon.

2 years agoBMesh: Minor improvement to face-join
Campbell Barton [Fri, 11 Nov 2016 23:06:53 +0000 (10:06 +1100)]
BMesh: Minor improvement to face-join

Pass in loops instead of edge & faces.
Nearly all callers have the loop-pairs to pass in.

2 years agoFix renaming error in last commit
Campbell Barton [Fri, 11 Nov 2016 23:29:38 +0000 (10:29 +1100)]
Fix renaming error in last commit

2 years agoBKE_library_make_local(): some minor improvements.
Bastien Montagne [Fri, 11 Nov 2016 22:15:55 +0000 (23:15 +0100)]
BKE_library_make_local(): some minor improvements.

Do not set 'real user' to groups every time we run the first clearing loop.

And do fully clear properly LIB_TAG_DOIT (this is not yet enforced in
existing code, but would love to get to that stage in future, so let's
do it at least with new code!).

2 years agoMinor naming cleanup.
Bastien Montagne [Fri, 11 Nov 2016 21:56:47 +0000 (22:56 +0100)]
Minor naming cleanup.

2 years agoEnhance BKE_library_make_local() to make it much quicker in complex cases.
Bastien Montagne [Fri, 11 Nov 2016 21:29:54 +0000 (22:29 +0100)]
Enhance BKE_library_make_local() to make it much quicker in complex cases.

Basic idea is to split first loop in two, and run checks before making
anything actually local, to detect data-blocks that we can directly make
local (because we are sure they are only used by already/future local

This allows to avoid a lot of overhead in later 'cleanup' steps of this
function, here with barbershop shot it's four times quicker (from 190s to 48s).

We are still far from the instantaneous results of MakeLocal in 2.77,
but in that version main characters lose their connection to their
armature and remain static after makelocal, so guess new code is still
better. ;)

There are probably more optimizations possible here, but would rather
polish this area of code once we get rid of proxies, those really
make it a nightmare to work on.

2 years agoMinor optimization to BKE_library_tag_unused_linked_data().
Bastien Montagne [Fri, 11 Nov 2016 18:32:59 +0000 (19:32 +0100)]
Minor optimization to BKE_library_tag_unused_linked_data().

2 years agoSwitch to unsafe but quick freeing of archipelagos of linked data.
Bastien Montagne [Fri, 11 Nov 2016 17:58:00 +0000 (18:58 +0100)]
Switch to unsafe but quick freeing of archipelagos of linked data.

This *should* work, but do not hesitate to revert in case it creates new
crashes in append or makelocal processes.

2 years agoFix T49996: VSE opengl render crash with grease pencil if current frame is empty
Antonioya [Fri, 11 Nov 2016 21:27:10 +0000 (22:27 +0100)]
Fix T49996: VSE  opengl render crash with grease pencil if current frame is empty

If the opengl render with grease pencil is run from VSE with the current
frame outside visible frames, the render pass is wrong and the render
must be canceled because nothing to render. Related to #T49975

2 years agoGPencil: Create brush set when create new datablock or layer
Antonioya [Fri, 11 Nov 2016 19:04:30 +0000 (20:04 +0100)]
GPencil: Create brush set when create new datablock or layer

Before this commit, the brush set was created with the first stroke
drawing, but if the user creates the datablock or the layer manually
(not drawing) the brush list was empty.

This commit complement the python fix by Sergey:

2 years agoFix crash happening in some cases with MakeLocal operator.
Bastien Montagne [Fri, 11 Nov 2016 17:05:01 +0000 (18:05 +0100)]
Fix crash happening in some cases with MakeLocal operator.

Culprit here was once more proxies. Think what was happening here was:
1) Both proxy and proxified armatures' PoseChannels were cleared
   (needed after remapping due to Bone pointers being stored in pchans).
2) Proxy PoseChannels got rebuilt in `BKE_pose_rebuild_ex()`, which ends,
   in proxy cases, by actually replacing rebuilt pchans by those from
   the proxified object... which has not yet been rebuilt.

Fixed the issue by merely adding bone pointer to data copied from
original pchan into new 'from proxy' one... Sounds much, much safer and
sanier anyway, that way we can be sure bone pointer is actually pointing
to a bone of the object's armature (this is supposed to be the same
Armature datablock between proxy and proxified objects, but that may not
be always true especially during makelocal process).

2 years agoFix T49994: Setting dupligroup which uses indirect relation will crash
Sergey Sharybin [Fri, 11 Nov 2016 15:15:34 +0000 (16:15 +0100)]
Fix T49994: Setting dupligroup which uses indirect relation will crash

Did similar trick to old dependency graph: tag invisible relations for update.

Might need some re-consideration, see the comment.

This should solve our issues with powerlib addon here in the studio.

2 years agoDepsgraph: Add missing NULL pointer check
Sergey Sharybin [Fri, 11 Nov 2016 14:28:34 +0000 (15:28 +0100)]
Depsgraph: Add missing NULL pointer check

2 years agoDepsgraph: Fix missing DONE flag in relations builder
Sergey Sharybin [Fri, 11 Nov 2016 14:20:17 +0000 (15:20 +0100)]
Depsgraph: Fix missing DONE flag in relations builder

Was causing relations be build twice in certain cases.

2 years agoFix T49993: Indirectly used taper/bevel crashes new dependency graph
Sergey Sharybin [Fri, 11 Nov 2016 13:46:19 +0000 (14:46 +0100)]
Fix T49993: Indirectly used taper/bevel crashes new dependency graph

New dependency graph expects strict separation between nodes and relations builder,
meaning, if we try to create relation with an object which is not in the graph yet
we'll have an error in depsgraph.

Now, so far object nodes were created from bases of the current scene, which caused
missing objects in graph in certain cases.

Didn't find better approach than to simply ensure object nodes exists when we know
they'll be used by relation builder.

2 years agoDepsgraph: Fix typo in text on curve relation builder
Sergey Sharybin [Fri, 11 Nov 2016 13:41:02 +0000 (14:41 +0100)]
Depsgraph: Fix typo in text on curve relation builder

2 years agoDepsgraph: Fix missing ID node tag
Sergey Sharybin [Fri, 11 Nov 2016 13:25:26 +0000 (14:25 +0100)]
Depsgraph: Fix missing ID node tag

Might have caused nodes created multiple times for the same object.

2 years agoDepsgraph: Add some data builder logic to corresponding function
Sergey Sharybin [Fri, 11 Nov 2016 13:24:47 +0000 (14:24 +0100)]
Depsgraph: Add some data builder logic to corresponding function

2 years agoGrease Pencil: Fix python errors opening N panel -> GP with empty VSE
Sergey Sharybin [Fri, 11 Nov 2016 13:04:04 +0000 (14:04 +0100)]
Grease Pencil: Fix python errors opening N panel -> GP with empty VSE

Solves errors, but not sure interface is indeed what users will expect.

Will ask GP team to check on this.

2 years agoDepsgraph: cleanup, no functional changes
Sergey Sharybin [Fri, 11 Nov 2016 12:52:22 +0000 (13:52 +0100)]
Depsgraph: cleanup, no functional changes

2 years agoDepsgraph: Fix wrong relation names
Sergey Sharybin [Fri, 11 Nov 2016 10:42:43 +0000 (11:42 +0100)]
Depsgraph: Fix wrong relation names

2 years agoDepsgraph: Fix wrong relations in array modifier
Sergey Sharybin [Fri, 11 Nov 2016 10:41:33 +0000 (11:41 +0100)]
Depsgraph: Fix wrong relations in array modifier

2 years agoCycles: Add comments to endif directives
Mai Lavelle [Thu, 6 Oct 2016 12:55:56 +0000 (14:55 +0200)]
Cycles: Add comments to endif directives

`kernel_path.h` and `kernel_path_branched.h` have a lot of conditional code and
it was kind of hard to tell what code belonged to which directive. Should be
easier to read now.

2 years agoFix T49961: Blender 2.8 Crashes on saving an image
Julian Eisel [Thu, 10 Nov 2016 18:56:52 +0000 (19:56 +0100)]
Fix T49961: Blender 2.8 Crashes on saving an image

Caused by 4811b2d3565cf which caused the event handler hack that is used to fire up the file browser from other operators to fail. Basically the context from before the file browser is opened gets stored and used later for executing the actual file read/write operation (in this case, saving image). This context storage is cleared when exiting an editor since 4811b2d3565cf, which is technically correct, but causes usage of NULLed context data in this case, because the file browser is exited before the file read/write operation is executed.

For now I solved this by moving the fileselect handler to list of normal handlers, instead of modal ones. 4811b2d3565cf only touches list of modal handlers so we avoid the crash. Ideally we'd completely refactor how the file browser opening works to get rid of these event handler hacks.

Note that I wouldn't be suprised if this causes other regressions, but I couldn't find one so worth a try.

2 years agoConsider Numpad Enter in pose slide operators
Sergey Sharybin [Thu, 10 Nov 2016 16:18:57 +0000 (17:18 +0100)]
Consider Numpad Enter in pose slide operators

It was annoying to only have regular Enter confirming input there.

2 years agoFix `BKE_library_make_local()` trying to also make local proxified objects.
Bastien Montagne [Thu, 10 Nov 2016 16:05:36 +0000 (17:05 +0100)]
Fix `BKE_library_make_local()` trying to also make local proxified objects.

Proxified objects can never be local, we can totally ignore them here.

This 'fixes' the asserts related to usercount when trying to remap poselib
of localized proxified objects (not sure what exactly was going on wrong here,
but proxies are a giant can of worms for sane data-blocks handling anyway :/).

2 years agoDepsgraph: Fix another issue which seems to be a bug
Sergey Sharybin [Thu, 10 Nov 2016 14:49:33 +0000 (15:49 +0100)]
Depsgraph: Fix another issue which seems to be a bug

Similar to a previous commit.

Doing separately for an easy of bisect.

2 years agoDepsgraph: Fix wrong relation from IK solver to pole target
Sergey Sharybin [Thu, 10 Nov 2016 14:46:22 +0000 (15:46 +0100)]
Depsgraph: Fix wrong relation from IK solver to pole target

Copy paste error...

How to avoid those?

2 years agoFix Grease Pencil render in VSE crashes when no strips (#T49975)
Dalai Felinto [Thu, 10 Nov 2016 11:23:09 +0000 (12:23 +0100)]
Fix Grease Pencil render in VSE crashes when no strips (#T49975)

Solution as suggested by Sergey Sharybin. Initial debugging by
Antonio Vazquez.

2 years agobuidlbot, msbuild is slightly different in that is wants to build debug anyway even...
Martijn Berger [Thu, 10 Nov 2016 10:00:04 +0000 (11:00 +0100)]
buidlbot, msbuild is slightly different in that is wants to build debug anyway even if we told cmake we want release

2 years agobuidlbot, msbuild is slightly different in that is wants to build debug anyway even...
Martijn Berger [Thu, 10 Nov 2016 09:55:46 +0000 (10:55 +0100)]
buidlbot, msbuild is slightly different in that is wants to build debug anyway even if we told cmake we want release

2 years agoAdded bpy.types.ID.make_local() that can make a single ID block local.
Sybren A. Stüvel [Thu, 10 Nov 2016 09:42:28 +0000 (10:42 +0100)]
Added bpy.types.ID.make_local() that can make a single ID block local.

This new `bpy.types.ID.make_local(clear_proxies=True)` allows Python
code to press the "Make Local" button on any ID block. I chose
`clear_proxies=True` as the default, since it's the default behaviour
of `id_make_local()` (defined in `library.c`).

The caller does need to take care of ensuring that linked-in objects
don't refer to local data, and that proxies aren't broken.

Reviewers: sergey, mont29

Reviewed By: mont29

Subscribers: dfelinto

Differential Revision:

2 years agolet cmake handle calling msbuild for windows buildbots
Martijn Berger [Thu, 10 Nov 2016 09:48:54 +0000 (10:48 +0100)]
let cmake handle calling msbuild for windows buildbots

2 years agoFix UI message.
Bastien Montagne [Wed, 9 Nov 2016 18:27:43 +0000 (19:27 +0100)]
Fix UI message.

2 years agoBMesh: face-join, remove redundant face assignment
Campbell Barton [Wed, 9 Nov 2016 16:19:44 +0000 (03:19 +1100)]
BMesh: face-join, remove redundant face assignment

Keep ifdef'd out for holes, this isn't needed currently.

2 years agoDepsgraph: Fix crash deleting bones in armature edit mode
Sergey Sharybin [Wed, 9 Nov 2016 15:59:29 +0000 (16:59 +0100)]
Depsgraph: Fix crash deleting bones in armature edit mode

For the new dependency graph we have to rebuild graph when
bones "topology" are changing.

2 years agoFix some assert when making local (due to infamous PITA ShapeKey ID).
Bastien Montagne [Wed, 9 Nov 2016 15:42:28 +0000 (16:42 +0100)]
Fix some assert when making local (due to infamous PITA ShapeKey ID).

2 years agoBMesh: Cleanup, remove hole ifdef
Campbell Barton [Wed, 9 Nov 2016 14:08:12 +0000 (01:08 +1100)]
BMesh: Cleanup, remove hole ifdef

2 years agoMerge remote-tracking branch 'origin/master' into blender2.8
Dalai Felinto [Wed, 9 Nov 2016 13:36:59 +0000 (14:36 +0100)]
Merge remote-tracking branch 'origin/master' into blender2.8

2 years agoBMesh: face-flip, no need for temporary edge-array
Campbell Barton [Wed, 9 Nov 2016 11:25:31 +0000 (22:25 +1100)]
BMesh: face-flip, no need for temporary edge-array

Reverse loops in-place.

2 years agoOpenGL: manage built-in shaders better
Mike Erwin [Wed, 9 Nov 2016 04:53:59 +0000 (22:53 -0600)]
OpenGL: manage built-in shaders better

As our library of built-in shaders grows, it's important to create, access, and discard them efficiently.

Lookup via GPU_shader_get_builtin is now constant time instead of linear (# of built-in shaders). This is called very often with our new immediate mode.

Creation and discard are unified.

Adding a new shader requires fewer steps.

365 lines shorter  :D

2 years agoFix: setting an audio callback before audio device initialization.
Jörg Müller [Tue, 8 Nov 2016 23:06:49 +0000 (00:06 +0100)]
Fix: setting an audio callback before audio device initialization.

2 years agoDepsgraph: Use atomics to tag ID when evaluating driver
Sergey Sharybin [Tue, 8 Nov 2016 16:54:14 +0000 (17:54 +0100)]
Depsgraph: Use atomics to tag ID when evaluating driver

This is required since new dependency graph evaluates drivers in threads
so it was possible to have some partially written ID tag there.

2 years agoblender 2.8: OpenGL immediate mode: node_draw_preview_background
Mike Erwin [Tue, 8 Nov 2016 16:10:47 +0000 (11:10 -0500)]
blender 2.8: OpenGL immediate mode: node_draw_preview_background

all is in the title.

Reviewers: merwin

Tags: #bf_blender_2.8, #opengl_gfx

Maniphest Tasks: T49043

Differential Revision:

2 years agoAtomics: Add 32 bit version of fetch and AND/OR
Sergey Sharybin [Tue, 8 Nov 2016 16:11:35 +0000 (17:11 +0100)]
Atomics: Add 32 bit version of fetch and AND/OR

2 years agoBlender 2.8: OpenGL: new immediate mode for paint_image.c
Mike Erwin [Tue, 8 Nov 2016 16:06:30 +0000 (11:06 -0500)]
Blender 2.8: OpenGL: new immediate mode for paint_image.c

This one is for the straight line (white with width 2.0 over a black with width 4.0) drawn when you use the gradient tool.

To test: Image editor, create / open an image, choose image paint mode and on the tool shelf: choose the Fill brush and enable "Use Gradient" for it. Then click and drag on the image.

From what I checked, calls to glLineWidth are not being removed yet, so I kept them.

Reviewers: dfelinto, Severin, merwin

Reviewed By: merwin

Tags: #bf_blender_2.8, #opengl_gfx

Maniphest Tasks: T49043

Differential Revision:

2 years agoOpenGL: wm_operators.c uses new immediate mode
Mike Erwin [Tue, 8 Nov 2016 15:51:42 +0000 (10:51 -0500)]
OpenGL: wm_operators.c uses new immediate mode

D2311 by @ianwill

This is the radial control that appears when we change the size of a brush in sculpt and vertex and texture painting modes, by pressing "f".

Also includes a new built-in shader that can be useful in other places.

Part of T49043

2 years agoBlender 2.8: OpenGL: new immediate mode API for screendump.c
Mike Erwin [Tue, 8 Nov 2016 15:04:41 +0000 (10:04 -0500)]
Blender 2.8: OpenGL: new immediate mode API for screendump.c

It's the screencast cursor, tested here, compared to original, seems to be working fine.

Reviewers: dfelinto, Severin, merwin

Reviewed By: merwin

Tags: #bf_blender_2.8, #opengl_gfx

Maniphest Tasks: T49043

Differential Revision:

2 years agoBMesh: remove edge search when flipping faces
Campbell Barton [Tue, 8 Nov 2016 13:04:58 +0000 (00:04 +1100)]
BMesh: remove edge search when flipping faces

Replace search with direct lookup.

2 years agoFix memory leak when Blender is build without Bullet and files with RB is opened
Sergey Sharybin [Tue, 8 Nov 2016 10:54:04 +0000 (11:54 +0100)]
Fix memory leak when Blender is build without Bullet and files with RB is opened

2 years agoFix T49838: Noise randomization for frame should be done per interframes as well
Sergey Sharybin [Tue, 8 Nov 2016 10:16:37 +0000 (11:16 +0100)]
Fix T49838: Noise randomization for frame should be done per interframes as well

Add subframe to the animated seed hash calculation.

Should be no difference for the regular files, only for cases when scene is
rendered from sequencer with a speed effect, which is not really a common thing.

2 years agoCycles: Only use new light sample threshold for new files
Sergey Sharybin [Tue, 8 Nov 2016 09:54:38 +0000 (10:54 +0100)]
Cycles: Only use new light sample threshold for new files

This is a late follow-up commit to the light sample threshold changes which
caused difference in rendering all existing .blend files which is not something
we are happy about: it is fine to use new optimized defaults for new files, but
existing ones should always be rendering in the same way as they used to be.

Sorry for the inconveniece, but such thing should have been done to begin with.
If this setting was modified it will not be reset to zero.

Now all render tests should be passing again.

P.S. Also really annoying to bump subversion for such reasons, but currently we
don't have better way to achieve what we want.

2 years agoFix T49937: Blender is crashing because of Lamp Data Node
Sergey Sharybin [Tue, 8 Nov 2016 09:40:21 +0000 (10:40 +0100)]
Fix T49937: Blender is crashing because of Lamp Data Node

Lamp Data node requires shadow sample array which is only enabled when
Shadows are enabled in the shading settings.

This commit prevents crash but might not give expected render results
in such a configuration.

2 years agoGawain: less error checking in release builds
Mike Erwin [Tue, 8 Nov 2016 04:28:40 +0000 (05:28 +0100)]
Gawain: less error checking in release builds

Gawain does very strict runtime checking to help us catch coding errors. Final release should disable most of these checks, so I'm disabling now for all non-debug builds.

When writing Blender code that uses Gawain, always make debug builds and test there! "make lite debug" is my favorite.

2 years agoOpenGL: mesh edit mode uses edge overlays
Mike Erwin [Tue, 8 Nov 2016 04:22:17 +0000 (05:22 +0100)]
OpenGL: mesh edit mode uses edge overlays

Legacy GL uses GL_LINES, modern GL uses the good stuff.

Edit mode still has a long way to go...

2 years agoOpenGL: support for edge overlays
Mike Erwin [Tue, 8 Nov 2016 04:06:09 +0000 (05:06 +0100)]
OpenGL: support for edge overlays

Has some obvious opportunities for improvement. This is my second attempt. First attempt used MLoopTri and sort of worked...

2 years agoBMesh: remove redundant edge-split loop initialize
Campbell Barton [Mon, 7 Nov 2016 20:05:29 +0000 (07:05 +1100)]
BMesh: remove redundant edge-split loop initialize

Would always set both first1 and first2.

2 years agoForgot this in last commit. (Brick GLSL).
Thomas Dinges [Mon, 7 Nov 2016 19:59:09 +0000 (20:59 +0100)]
Forgot this in last commit. (Brick GLSL).

2 years agoFix Brick Texture GLSL, broken after Mortar Smooth addition.
Thomas Dinges [Mon, 7 Nov 2016 19:55:12 +0000 (20:55 +0100)]
Fix Brick Texture GLSL, broken after Mortar Smooth addition.

2 years agoBMesh: remove redundant array size
Campbell Barton [Fri, 4 Nov 2016 20:05:20 +0000 (07:05 +1100)]
BMesh: remove redundant array size

Correct unhelpful comment & some comment edits.

Rename 'disk_is_flagged' -> 'bm_vert_is_manifold_flagged',
since the check is quite specific.

2 years agoBMesh: minor improvement to edge-split assignment
Campbell Barton [Mon, 7 Nov 2016 17:12:10 +0000 (04:12 +1100)]
BMesh: minor improvement to edge-split assignment

2 years agoOpenGL: fade other objects during edit mode
Mike Erwin [Mon, 7 Nov 2016 19:32:27 +0000 (20:32 +0100)]
OpenGL: fade other objects during edit mode

Right now this only affects other objects in wireframe. The idea is to do something similar for other draw modes, and keep focus on the edit object.

As seen at #bcon16

2 years agoOpenGL: simple mesh edit mode for new viewport
Mike Erwin [Mon, 7 Nov 2016 19:24:03 +0000 (20:24 +0100)]
OpenGL: simple mesh edit mode for new viewport

Very very simple. Needs a lot of work to reach "legacy viewport" capabilities.

2 years agoOpenGL: enable fancy wireframes
Mike Erwin [Mon, 7 Nov 2016 19:03:51 +0000 (20:03 +0100)]
OpenGL: enable fancy wireframes

Most of this was already in place, just enabling & adding comments.

One fix was needed to make batch uniforms stick between multiple draws.

Added comments to selection outline; no functional changes there.

2 years agoOpenGL: simple batch of all mesh triangles
Mike Erwin [Sun, 6 Nov 2016 20:51:49 +0000 (21:51 +0100)]
OpenGL: simple batch of all mesh triangles

Can be used for drawing basic surfaces, hit testing, depth pre-pass, ...

2 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Mon, 7 Nov 2016 14:46:27 +0000 (15:46 +0100)]
Merge branch 'master' into blender2.8


2 years agoFix compilation error when CUDA toolkit is not installed
Sergey Sharybin [Thu, 11 Feb 2016 12:51:47 +0000 (13:51 +0100)]
Fix compilation error when CUDA toolkit is not installed

After CUDA dynload changes having CUDA toolkit became required
in order to compile Cycles. This only happened due to wrong
default value to the option.

2 years agoBuildbot: Update copy of buildbot master configuration
Sergey Sharybin [Mon, 7 Nov 2016 13:29:11 +0000 (14:29 +0100)]
Buildbot: Update copy of buildbot master configuration

2 years agoCycles: Remove device settings from performance tab
Lukas Stockner [Mon, 7 Nov 2016 12:22:53 +0000 (13:22 +0100)]
Cycles: Remove device settings from performance tab

This was included in the commit by accident, it doesn't belong there.

2 years agoDepsgraph: Disable timing profile
Sergey Sharybin [Mon, 7 Nov 2016 11:50:45 +0000 (12:50 +0100)]
Depsgraph: Disable timing profile

2 years agofix building depsgraph after recent changes
Martijn Berger [Mon, 7 Nov 2016 11:32:00 +0000 (12:32 +0100)]
fix building depsgraph after recent changes

2 years agoDepsgraph: Do not rely on indirectly included cstring
Sergey Sharybin [Mon, 7 Nov 2016 11:09:42 +0000 (12:09 +0100)]
Depsgraph: Do not rely on indirectly included cstring

Also add comment why exactly cstring is needed.