4 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Sat, 19 Nov 2016 15:28:39 +0000 (16:28 +0100)]
Merge branch 'master' into blender2.8


4 years agobgl do not bind parts of OpenGL that are not exposed in core profiles
Martijn Berger [Sat, 19 Nov 2016 14:07:01 +0000 (15:07 +0100)]
bgl do not bind parts of OpenGL that are not exposed in core profiles

4 years agoFix T49991: reloading librairies doesn't update node groups.
Bastien Montagne [Sat, 19 Nov 2016 11:20:29 +0000 (12:20 +0100)]
Fix T49991: reloading librairies doesn't update node groups.

We need to check node tree links are still valid, after we remapped
some NodeGroup.

Note: In fact, we have to run that for *all* ID types, since nodes may
use any kind of data-block (in theory)... :/

4 years agoFix NodeGroup generic verify function crashing if node's ID pointer is NULL.
Bastien Montagne [Sat, 19 Nov 2016 11:18:32 +0000 (12:18 +0100)]
Fix NodeGroup generic verify function crashing if node's ID pointer is NULL.

Another nice crasher - in this case, we just want to nuke all sockets...

Related to T49991.

4 years agoFix (unreported) nodeRemoveAllSockets() not clearing inputs/outputs sockets lists.
Bastien Montagne [Sat, 19 Nov 2016 11:16:14 +0000 (12:16 +0100)]
Fix (unreported) nodeRemoveAllSockets() not clearing inputs/outputs sockets lists.

Nice crasher (though seems to not be much used so far)!

Related to T49991.

4 years agoFix forward-compat Nodes write code being executed also for undo steps writing.
Bastien Montagne [Fri, 18 Nov 2016 21:41:56 +0000 (22:41 +0100)]
Fix forward-compat Nodes write code being executed also for undo steps writing.

Forward compatibility code should never, ever be run during undo saving.

Note: related to T49991 (but does not fix it either, crash now happens
when doing a real file save...).

4 years agoFix Node space ID remap callback not handling node trees.
Bastien Montagne [Fri, 18 Nov 2016 21:36:52 +0000 (22:36 +0100)]
Fix Node space ID remap callback not handling node trees.

Yep. Kinda ridiculous, but forgot to handle the very node trees
data-blocks in that editor!

Related (but not fixing) to T49991.

4 years agoFix T50071: Radience HDR fomat does not support alpha at all.
Bastien Montagne [Fri, 18 Nov 2016 21:34:04 +0000 (22:34 +0100)]
Fix T50071: Radience HDR fomat does not support alpha at all.

4 years agoFix UV layer bug in object_utils.object_data_add()
Campbell Barton [Fri, 18 Nov 2016 19:57:55 +0000 (06:57 +1100)]
Fix UV layer bug in object_utils.object_data_add()

Adding a torus in edit-mode, with 'Generate UVs'
for example would either create another UV layer with the default name or
switch to the default UV layer name if it exists.

Now use the existing UV layer if present.

4 years agoAdd Torus: avoid excessive attr access
Campbell Barton [Fri, 18 Nov 2016 19:57:13 +0000 (06:57 +1100)]
Add Torus: avoid excessive attr access

4 years agoBMesh: invalid return from BM_mesh_validate
Campbell Barton [Fri, 18 Nov 2016 19:26:25 +0000 (06:26 +1100)]
BMesh: invalid return from BM_mesh_validate

Returned value was always false, even for valid meshes,
note that this is a debug-only function.

Also set internal-tag cleared.

4 years agoMinor debug-report tweak to autosave code.
Bastien Montagne [Fri, 18 Nov 2016 17:46:10 +0000 (18:46 +0100)]
Minor debug-report tweak to autosave code.

Print in cosole a warning when we skip autosave due to runnning modal op.

Related to T49974.

4 years agoCycles: Different noise seed for stereoscopic rendering (Fix #T50024)
Dalai Felinto [Fri, 18 Nov 2016 17:23:45 +0000 (18:23 +0100)]
Cycles: Different noise seed for stereoscopic rendering (Fix #T50024)

Patch by Sergey Sharybin.

4 years agoDepsgraph: Fix residue of debug-only code
Sergey Sharybin [Fri, 18 Nov 2016 16:47:17 +0000 (17:47 +0100)]
Depsgraph: Fix residue of debug-only code

4 years agoconvert icon_draw_texture to gawain imm mode replacements
Martijn Berger [Fri, 18 Nov 2016 15:04:25 +0000 (16:04 +0100)]
convert icon_draw_texture to gawain imm mode replacements

4 years agoFix T50035: Minor interface bug: UV/ImageEditor - Paint Mode - Fill Brush
Bastien Montagne [Fri, 18 Nov 2016 14:49:41 +0000 (15:49 +0100)]
Fix T50035: Minor interface bug: UV/ImageEditor - Paint Mode - Fill Brush

Patch by @LucaRood, added some cleanup of DRAW/FILL conditions in this
code too...

4 years agoFix (unreported) bad handling of brush's fill threshold value.
Bastien Montagne [Fri, 18 Nov 2016 14:32:50 +0000 (15:32 +0100)]
Fix (unreported) bad handling of brush's fill threshold value.

'1' threshold value would only allow to access a third of the basic
'color space' (from black to white, from 0.0 to 1.0 component values),
when you expect it to access the whole range.

Unfortunately, this needs a subversion bump to allow already defined
brushes to keep exact same behavior!

Also, did not change default value (0.2) for new brushes, think here
keeping current one makes more sense.

Thanks to @LucaRood for confirming the issue.

4 years agoFix T50052: bpy.utils.unregister_module doesn't unregister classes of submodules...
Bastien Montagne [Fri, 18 Nov 2016 14:14:22 +0000 (15:14 +0100)]
Fix T50052: bpy.utils.unregister_module doesn't unregister classes of submodules in reload scenario.

reload case would clear TypeMap before unregistering addons, which made
all calls to unregister_module() to do absolutely nothing.

4 years agoFix T50063: Editing driver's expression eliminates "Zero" number
Julian Eisel [Fri, 18 Nov 2016 12:37:04 +0000 (13:37 +0100)]
Fix T50063: Editing driver's expression eliminates "Zero" number

Disables trimming of trailing zeros in case button contains an expression.

4 years agoImplement multi-view stereo support for image empties
Dalai Felinto [Fri, 18 Nov 2016 11:37:39 +0000 (12:37 +0100)]
Implement multi-view stereo support for image empties

Empty images were implemented to expand (and eventually replace)
the background images functionalities. If we are ever to drop
background images "image empties" should support stereo/multi-view as well.

4 years agoFix potential NULL dereference in mesh sequence cache modifier.
Bastien Montagne [Fri, 18 Nov 2016 11:03:12 +0000 (12:03 +0100)]
Fix potential NULL dereference in mesh sequence cache modifier.

Reported by coverity.

4 years agoFix copy/paste typo in new depsgraph object geometry builder (found by coverity).
Bastien Montagne [Fri, 18 Nov 2016 10:55:28 +0000 (11:55 +0100)]
Fix copy/paste typo in new depsgraph object geometry builder (found by coverity).

4 years agofix problem from D2360
Mike Erwin [Fri, 18 Nov 2016 05:40:40 +0000 (00:40 -0500)]
fix problem from D2360

I was too eager to get patch in after a last-minute change. My bad!

4 years agoMoved UI_view2d_grid_draw() to immediate functions
Benjamin N. Summerton [Fri, 18 Nov 2016 03:45:51 +0000 (22:45 -0500)]
Moved UI_view2d_grid_draw() to immediate functions

Part of T49043

Reviewers: krash, merwin

Reviewed By: krash, merwin

Differential Revision:

4 years agoOpenGL: textview port to immediate mode -> T49043
Mike Erwin [Fri, 18 Nov 2016 03:02:12 +0000 (22:02 -0500)]
OpenGL: textview port to immediate mode -> T49043

Updated the GL calls to the new immediate mode.
I left some glcolor calls which I'm not sure wether thats right?
Part of T49043

warm regards,
Sebastian Witt

Reviewers: merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Maniphest Tasks: T49043

Differential Revision:

4 years agouse new enum types in glutil & imm_util
Mike Erwin [Thu, 17 Nov 2016 21:10:53 +0000 (16:10 -0500)]
use new enum types in glutil & imm_util

4 years agodelete deprecated fdrawXORcirc function
Mike Erwin [Thu, 17 Nov 2016 20:03:55 +0000 (15:03 -0500)]
delete deprecated fdrawXORcirc function

Only one place used it, and that place was dead code already.

4 years agomark certain glutil functions as deprecated
Mike Erwin [Thu, 17 Nov 2016 19:43:58 +0000 (14:43 -0500)]
mark certain glutil functions as deprecated

These will be removed before we ship 2.8

4 years agoBMesh: avoid using temp array for face-area
Campbell Barton [Thu, 17 Nov 2016 18:55:37 +0000 (05:55 +1100)]
BMesh: avoid using temp array for face-area

4 years agoBMesh: minor cleanup
Campbell Barton [Tue, 15 Nov 2016 16:22:49 +0000 (03:22 +1100)]
BMesh: minor cleanup

Comment & don't use dummy pointer.

4 years agoCleanup: redundant index loop for monkey-create
Campbell Barton [Thu, 17 Nov 2016 19:08:51 +0000 (06:08 +1100)]
Cleanup: redundant index loop for monkey-create

Also rename face vars (the faces aren't temp),
and quiet old-style-definition warning.

4 years agoDepsgrpah: Fix missing animation update in movie clips
Sergey Sharybin [Thu, 17 Nov 2016 15:37:25 +0000 (16:37 +0100)]
Depsgrpah: Fix missing animation update in movie clips

4 years agoDepsgraph: Move scene builder function to own file
Sergey Sharybin [Thu, 17 Nov 2016 14:38:03 +0000 (15:38 +0100)]
Depsgraph: Move scene builder function to own file

This way it's much easier to grasp what the graph actually contains.

4 years agoFix T50060: New depsgraph does not update mask animation
Sergey Sharybin [Thu, 17 Nov 2016 14:29:22 +0000 (15:29 +0100)]
Fix T50060: New depsgraph does not update mask animation

4 years agoDepsgraph: Use utility macro to iterate over linked list
Sergey Sharybin [Thu, 17 Nov 2016 14:11:55 +0000 (15:11 +0100)]
Depsgraph: Use utility macro to iterate over linked list

This will be compiled into same exact code, just saves us from
doing annoying type casts all over the place.

4 years agoDepsgraph: Move rig builder functions to own files
Sergey Sharybin [Thu, 17 Nov 2016 13:34:46 +0000 (14:34 +0100)]
Depsgraph: Move rig builder functions to own files

Those routines are rather big and started to be annoying to have
one big file.

Should be no functional changes.

4 years ago[MSVC] Preliminary VS2017 support.
lazydodo [Thu, 17 Nov 2016 03:13:58 +0000 (20:13 -0700)]
[MSVC] Preliminary VS2017 support.

4 years agoFix T50001: auto tile size addon broken after Cycles GPU device changes.
Brecht Van Lommel [Thu, 17 Nov 2016 01:16:21 +0000 (02:16 +0100)]
Fix T50001: auto tile size addon broken after Cycles GPU device changes.

Adds a get_num_gpu_devices() utility function for the addon to use.

4 years agoGawain: small note for future Vulkan work
Mike Erwin [Wed, 16 Nov 2016 23:25:11 +0000 (18:25 -0500)]
Gawain: small note for future Vulkan work

4 years agoConvert console_draw.c to Gawain
Martijn Berger [Wed, 16 Nov 2016 21:56:39 +0000 (22:56 +0100)]
Convert console_draw.c to Gawain

Reviewers: merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Differential Revision:

4 years agoGawain: use PRIM_ and INDEX_ enums instead of GLenum
Mike Erwin [Wed, 16 Nov 2016 21:03:15 +0000 (16:03 -0500)]
Gawain: use PRIM_ and INDEX_ enums instead of GLenum

For a few reasons:
- separate enum sets for separate concepts
- debug with symbolic names instead of 0x4e72
- prepare for a Vulkan future

4 years agoFix T50051: Avoid crash when render grease pencil from VSE
Antonioya [Wed, 16 Nov 2016 20:33:47 +0000 (21:33 +0100)]
Fix T50051: Avoid crash when render grease pencil from VSE

The renderpasses for grease pencil are not necessary when render from

This fix solves the GPF but we need to rethink the complete render
process for grease pencil and integrate better in the render and
composition workflow.

Thanks to Dalai Felinto por helping in the debug and fixing of the

4 years agoGawain: use COMP_ instead of GL_ internally
Mike Erwin [Wed, 16 Nov 2016 20:18:06 +0000 (15:18 -0500)]
Gawain: use COMP_ instead of GL_ internally

Because GLenum could be ANYTHING. We use our own enum type for components.

4 years agoGawain: re-enable strict error checking in release builds
Mike Erwin [Wed, 16 Nov 2016 17:14:55 +0000 (12:14 -0500)]
Gawain: re-enable strict error checking in release builds

Makes it easier for new volunteers to catch errors early.

4 years agoBlender 2.8: Added immVertex2s() and immAttrib2s()
Mike Erwin [Wed, 16 Nov 2016 16:52:02 +0000 (11:52 -0500)]
Blender 2.8: Added immVertex2s() and immAttrib2s()

Just as mentioned in title. Need new functions for calls found in `transform.c`


Reviewers: merwin

Tags: #bf_blender_2.8

Differential Revision:

4 years agoMerge remote-tracking branch 'origin/master' into blender2.8
Dalai Felinto [Wed, 16 Nov 2016 16:01:19 +0000 (17:01 +0100)]
Merge remote-tracking branch 'origin/master' into blender2.8

4 years agoCycles: Fix different noise pattern from fix in T49838:
Sergey Sharybin [Wed, 16 Nov 2016 14:12:31 +0000 (15:12 +0100)]
Cycles: Fix different noise pattern from fix in T49838:

No need to hash subframe == 0.

4 years agoFix T50046: Segmentation fault due to out-of-range VertexGroup.weight() call.
Bastien Montagne [Wed, 16 Nov 2016 11:38:57 +0000 (12:38 +0100)]
Fix T50046: Segmentation fault due to out-of-range VertexGroup.weight() call.

`get_vert_def_nr()` was not checking vert index in bmesh case (aka Edit mode).

4 years agoRemove unused vector icons
Martijn Berger [Wed, 16 Nov 2016 09:03:11 +0000 (10:03 +0100)]
Remove unused vector icons

it seems to me the icons are unused:


Since their code contains immediate mode GL calls and they seem to be unused i thought we could remove them.

Reviewers: mont29

Reviewed By: mont29

Subscribers: merwin

Tags: #bf_blender_2.8

Differential Revision:

4 years agoPart of T49043: Convert drawsimdebug.c to use the new Gawain API.
Lukas Tönne [Wed, 16 Nov 2016 11:18:12 +0000 (12:18 +0100)]
Part of T49043: Convert drawsimdebug.c to use the new Gawain API.

This conversion is pretty straightforward.

The code for debug drawing is not great, but it does the job.
Rewriting it is for another day, if it becomes more widely used.

4 years agoAdd stdlib.h include to fix missing 'abort' prototype.
Lukas Tönne [Wed, 16 Nov 2016 10:31:35 +0000 (11:31 +0100)]
Add stdlib.h include to fix missing 'abort' prototype.

4 years agoFix custom props not being handled correctly by manual/pyref UI menu entries.
Bastien Montagne [Wed, 16 Nov 2016 10:07:07 +0000 (11:07 +0100)]
Fix custom props not being handled correctly by manual/pyref UI menu entries.

4 years agoDisable possibility to flip bone names of linked armatures
Sergey Sharybin [Wed, 16 Nov 2016 09:39:41 +0000 (10:39 +0100)]
Disable possibility to flip bone names of linked armatures

Linked data should not be modified in such a way.

Reported by Nathan here in the studio, reviewed by Bastien, thanks!

4 years agoCleanup: Remove unused function
Sergey Sharybin [Wed, 16 Nov 2016 09:09:43 +0000 (10:09 +0100)]
Cleanup: Remove unused function

4 years agoBlender2.8 convert UI_view2d_constant_grid_draw to new immediate mode
Mike Erwin [Tue, 15 Nov 2016 23:56:52 +0000 (18:56 -0500)]
Blender2.8 convert UI_view2d_constant_grid_draw to new immediate mode

Convert UI_view2d_constant_grid_draw to new immediate mode.

Part of T49043.

Reviewers: merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Differential Revision:

4 years agoUse new immediate mode for ED_region_grid_draw
Mike Erwin [Tue, 15 Nov 2016 23:28:37 +0000 (18:28 -0500)]
Use new immediate mode for ED_region_grid_draw

Convert ED_region_grid_draw to new immediate mode.

Part of T49043

Reviewers: merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Differential Revision:

4 years agoFix T50026: "Only Insert Needed" doesn't work when using Trackball rotation
Joshua Leung [Tue, 15 Nov 2016 22:14:38 +0000 (11:14 +1300)]
Fix T50026: "Only Insert Needed" doesn't work when using Trackball rotation

The rotation case here only covered rotation by the "Rotate" tool, but skipped
the "Trackball" tool.

4 years agoFix T50023: Inverse Kinematics angle limits defaulting to 10313.2403124°
Joshua Leung [Tue, 15 Nov 2016 22:09:02 +0000 (11:09 +1300)]
Fix T50023: Inverse Kinematics angle limits defaulting to 10313.2403124°

Regression from 2.77a. The units for the min/max limits were changed in RNA
but the pose channels were still being initialised with in degrees.

4 years agoFIX T49899: Add EIGEN_MAKE_ALIGNED_OPERATOR_NEW to classes that use eigen's data...
lazydodo [Tue, 15 Nov 2016 20:21:01 +0000 (13:21 -0700)]
FIX T49899: Add EIGEN_MAKE_ALIGNED_OPERATOR_NEW to classes that use eigen's data types , to force aligned on 16 byte boundaries.

4 years agoblender 2.8: OpenGL immediate mode: anim_draw
Mike Erwin [Tue, 15 Nov 2016 17:16:47 +0000 (12:16 -0500)]
blender 2.8: OpenGL immediate mode: anim_draw

Reviewers: merwin

Reviewed By: merwin

Maniphest Tasks: T49043

Differential Revision:

4 years agostart using COMP_* instead of GL_* in viewport
Mike Erwin [Tue, 15 Nov 2016 16:49:00 +0000 (11:49 -0500)]
start using COMP_* instead of GL_* in viewport

Gawain can accept either enum, but its own COMP_ values are recommended.

4 years agoRNA Main API: set remove's do_unlink default value to true.
Bastien Montagne [Tue, 15 Nov 2016 16:12:18 +0000 (17:12 +0100)]
RNA Main API: set remove's do_unlink default value to true.

On second and third thoughts, this should have been done that way since
the begining, cases were you just delete a few data-blocks without any
serious knowledge of their usages are much, much more frequent than
cases where you are deleting thousands of data-blocks and are sure they
are not used anywhere anymore...

Own fault, but really frustrated that this topic was only raised the day
after 2.78a was released. :(

4 years agoGet rid of 'drivers unlinking' code in `BKE_libblock_free_data()`
Bastien Montagne [Tue, 15 Nov 2016 15:36:47 +0000 (16:36 +0100)]
Get rid of 'drivers unlinking' code in `BKE_libblock_free_data()`

This has nothing to do here (freeing is not unlinking/remapping!), and
was actually redoing something already taken care of by
`BKE_libblock_relink_ex()` call in `BKE_libblock_free_ex()`.

Also, gives some noticeable speedup when removing datablocks with
do_unlink=True, about 5 to 10% quicker e.g. when deleting all objects
from a py console, in a big production file...

4 years agoDepsgraph: Fix frash with iTaSC solver
Sergey Sharybin [Tue, 15 Nov 2016 15:18:59 +0000 (16:18 +0100)]
Depsgraph: Fix frash with iTaSC solver

This commit reverts part of a fix for T33275, but things are:

- I can not reproduce the original issue at all, so doesn't seem to
  cause any regressions.

- It is really bad idea to do delayed initialization in the threaded
  environment, it's a straight way to some nasty issues.

- We can't do things like this anyway because we go more granular,
  meaning such a delayed initialization will fail in the case of
  having several IK solvers (unless they properly accommodate to
  changed bone head).

- Verified the fix with various files from Mango project and all of
  them seems to work nice with new depednency graph now (old depsgraph
  has some flickering, but it's not related on DEG itself, but on
  an environment with lots of proxies and threaded evaluation and it
  is not a new behavior).

4 years agoRevert "Proxy: Construct pchan hash when syncing armature proxy"
Sergey Sharybin [Tue, 15 Nov 2016 15:13:24 +0000 (16:13 +0100)]
Revert "Proxy: Construct pchan hash when syncing armature proxy"

This reverts commit 9b5a32cbfb8a8565202bdccd232c53f98b62eeec.

Apparently it is possible to have other thread mocking around with the hash.

Needs deeper investigation, for the time being reverting to prevent crashes.

4 years agoFix menu inconsistencies
Aaron Carlisle [Tue, 15 Nov 2016 14:55:54 +0000 (15:55 +0100)]
Fix menu inconsistencies

This commit fixes two issues:

- UV/Image editor uvs menu did not match the 3D View's which was changed in rB2b240b043078
- Circle select tool was missing in particle edit mode

Reviewers: Severin
Differential Revision:

4 years agoCleanup: More explicit parentheses
Sergey Sharybin [Tue, 15 Nov 2016 15:01:21 +0000 (16:01 +0100)]
Cleanup: More explicit parentheses

4 years agoAvoid interface ID remapping when freeing the whole database
Sergey Sharybin [Tue, 15 Nov 2016 14:46:52 +0000 (15:46 +0100)]
Avoid interface ID remapping when freeing the whole database

This makes heavy scenes to be freed almost instantly (so now
quadbot scene takes only 0.06sec to free),

4 years agoAvoid driver target remapping when freeing the whole database
Sergey Sharybin [Tue, 15 Nov 2016 14:38:03 +0000 (15:38 +0100)]
Avoid driver target remapping when freeing the whole database

Added BKE_libblock_free_data_ex() which takes special do_id_user
argument which basically indicates whether main database was already
taken care about not having "dead" pointers.

Gives about 40% speedup of main database free with quadbot scene
(3.4sec vs. 5.4 sec on quite powerful desktop).

4 years agoFix T50022: "Mirror" in Dopesheet Crashes Blender
Julian Eisel [Tue, 15 Nov 2016 14:27:22 +0000 (15:27 +0100)]
Fix T50022: "Mirror" in Dopesheet Crashes Blender

Just fixing crash itself. Actually operator shouldn't run in most editors (not in dopesheet either I guess), but don't want to spend time on that right now.

4 years agoImplement grouped undo option for operators
Dalai Felinto [Tue, 15 Nov 2016 10:50:11 +0000 (11:50 +0100)]
Implement grouped undo option for operators

This option makes an operator to not push a task to the undo stack if the previous stored elemen is the same operator or part of the same undo group.

The main usage is for animation, so you can change frames to inspect the
poses, and revert the previous pose without having to roll back tons of
"change frame" operator, or even see the undo stack full.

This complements rB13ee9b8e
Design with help by Sergey Sharybin.

Reviewers: sergey, mont29

Reviewed By: mont29, sergey

Subscribers: pyc0d3r, hjalti, Severin, lowercase, brecht, monio, aligorith, hadrien, jbakker

Differential Revision:

4 years agoDepsgraph: Fix typo in previous optimization commit
Sergey Sharybin [Tue, 15 Nov 2016 10:30:21 +0000 (11:30 +0100)]
Depsgraph: Fix typo in previous optimization commit

Was a residue from another experiment, caused infinite loop when
reporting dependency cycles.

4 years agoAtomics: Add some extra utility functions
Sergey Sharybin [Tue, 15 Nov 2016 12:41:08 +0000 (13:41 +0100)]
Atomics: Add some extra utility functions

Also fixed semantic of fetch-and-add in assembler implementation,
it seemed to not match the naming.

4 years agoAtomics: Make naming more obvious about which value is being returned
Sergey Sharybin [Tue, 15 Nov 2016 11:16:26 +0000 (12:16 +0100)]
Atomics: Make naming more obvious about which value is being returned

4 years agoblender 2.8: OpenGL immediate mode: action_draw
Mike Erwin [Tue, 15 Nov 2016 03:54:56 +0000 (22:54 -0500)]
blender 2.8: OpenGL immediate mode: action_draw

Updated action_draw to use imm mode.

Reviewers: merwin

Subscribers: LazyDodo

Differential Revision:

4 years agoBMesh: remove redundant link-list manipulation
Campbell Barton [Tue, 15 Nov 2016 01:39:33 +0000 (12:39 +1100)]
BMesh: remove redundant link-list manipulation

No need to track previous edge in vert-separate cleanup

4 years agoblender 2.8: Opengl: UI_draw_roundbox
Mike Erwin [Tue, 15 Nov 2016 01:04:59 +0000 (20:04 -0500)]
blender 2.8: Opengl: UI_draw_roundbox

all is in the title too..

Reviewers: merwin

Reviewed By: merwin

Subscribers: Blendify, Severin

Tags: #bf_blender_2.8, #opengl_gfx

Maniphest Tasks: T49043

Differential Revision:

4 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.

4 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.

4 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

4 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.

4 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.

4 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.

4 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

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

4 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.

4 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

4 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

4 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.

4 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.

4 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...).

4 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.

4 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.

4 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.

4 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.

4 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

4 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:

4 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.

4 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.

4 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.