16 months agoCleanup: trailing space for modifiers
Campbell Barton [Sun, 17 Jun 2018 15:04:27 +0000 (17:04 +0200)]
Cleanup: trailing space for modifiers

16 months agoCleanup: trailing space for DNA headers
Campbell Barton [Sun, 17 Jun 2018 15:04:09 +0000 (17:04 +0200)]
Cleanup: trailing space for DNA headers

16 months agoCleanup: trailing space in source/gameengine/
Campbell Barton [Sun, 17 Jun 2018 15:01:43 +0000 (17:01 +0200)]
Cleanup: trailing space in source/gameengine/

16 months agoCleanup: trailing space for BLI
Campbell Barton [Sun, 17 Jun 2018 14:32:54 +0000 (16:32 +0200)]
Cleanup: trailing space for BLI

16 months agoCleanup: remove unused BLI_rebase_path
Campbell Barton [Sun, 17 Jun 2018 14:26:47 +0000 (16:26 +0200)]
Cleanup: remove unused BLI_rebase_path

16 months agoCleanup: BLI path extension API
Campbell Barton [Sun, 17 Jun 2018 14:13:24 +0000 (16:13 +0200)]
Cleanup: BLI path extension API

Use BLI_path_extension_* prefix.

16 months agoBLI_path: add string size debug define
Campbell Barton [Sun, 17 Jun 2018 13:35:00 +0000 (15:35 +0200)]
BLI_path: add string size debug define

Off by default, only for debugging.

16 months agoCMake: add missing headers
Campbell Barton [Sun, 17 Jun 2018 09:56:20 +0000 (11:56 +0200)]
CMake: add missing headers

16 months agoCleanup: use clamp_* from BLI_math (replace macro)
Campbell Barton [Sun, 17 Jun 2018 09:50:56 +0000 (11:50 +0200)]
Cleanup: use clamp_* from BLI_math (replace macro)

16 months agomake.bat: Fix `make showhashes` not working.
Ray Molenkamp [Sat, 16 Jun 2018 18:29:38 +0000 (12:29 -0600)]
make.bat: Fix `make showhashes` not working.

broke in recent refactor.

16 months agoFix T55427: Removing Vertex Group used by Data Transfer Modifier results in crash.
Bastien Montagne [Sat, 16 Jun 2018 14:19:53 +0000 (16:19 +0200)]
Fix T55427: Removing Vertex Group used by Data Transfer Modifier results in crash.

Only fixing crash, proper handling (a.k.a remapping) of all
possible cases here, for all possible data layers, is rather involved...

16 months agoUI: refactor drag-toggle for other button types
Campbell Barton [Sat, 16 Jun 2018 14:04:26 +0000 (16:04 +0200)]
UI: refactor drag-toggle for other button types

16 months agoUI: minor changes from 2.8
Campbell Barton [Sat, 16 Jun 2018 13:44:13 +0000 (15:44 +0200)]
UI: minor changes from 2.8

- Option to skip multi-data edits.
- Open hold buttons on drag.
- Utility function to set default value.

16 months agoCycles Cleanup: Remove unneccessary color management call
Lukas Stockner [Sat, 16 Jun 2018 11:47:49 +0000 (13:47 +0200)]
Cycles Cleanup: Remove unneccessary color management call

16 months agoCycles: change Ambient Occlusion shader to output colors.
Lukas Stockner [Fri, 15 Jun 2018 09:03:29 +0000 (11:03 +0200)]
Cycles: change Ambient Occlusion shader to output colors.

This means the shader can now be used for procedural texturing. New
settings on the node are Samples, Inside, Local Only and Distance.

Original patch by Lukas with further changes by Brecht.

Differential Revision:

16 months agoWM: suppress drag events if motion is handled
Campbell Barton [Fri, 15 Jun 2018 17:09:43 +0000 (19:09 +0200)]
WM: suppress drag events if motion is handled

16 months agoCleanup: some more G.main removal.
Bastien Montagne [Fri, 15 Jun 2018 15:42:17 +0000 (17:42 +0200)]
Cleanup: some more G.main removal.

We are really starting to scratch the last bits here...

16 months agoCleanup: validate G.main's in creator code.
Bastien Montagne [Fri, 15 Jun 2018 15:36:44 +0000 (17:36 +0200)]
Cleanup: validate G.main's in creator code.

Using G_MAIN here is valid!

16 months agoCleanup: some more G.main removal/validation...
Bastien Montagne [Fri, 15 Jun 2018 15:21:07 +0000 (17:21 +0200)]
Cleanup: some more G.main removal/validation...

16 months agoFix more Cycles CUDA errors after recent changes.
Brecht Van Lommel [Fri, 15 Jun 2018 13:58:48 +0000 (15:58 +0200)]
Fix more Cycles CUDA errors after recent changes.

16 months agoFix T55490, intersect two triangles fails.
Howard Trickey [Fri, 15 Jun 2018 12:48:45 +0000 (08:48 -0400)]
Fix T55490, intersect two triangles fails.

Need to use the 'use_partial_connect' option in island connect,
so changed signatures of various functions to pass that into and
then down from BM_mesh_intersect (making true for intersect, false
for boolean).
Then fix bm_face_split_edgenet_partial_connect to work when
input edges are not necessarily wire, but at least not in the
face they are being connected in. That caused generalization
of core BM_vert_separate_hflag_wire (which is only used in
this one place in all Blender).

16 months agoFix (unreported) Text Editor: scrollbar exiting early
Philipp Oeser [Fri, 15 Jun 2018 08:25:18 +0000 (10:25 +0200)]
Fix (unreported) Text Editor: scrollbar exiting early

caused by recent clickdrag changes

16 months agoFix Cycles CUDA error after recent changes.
Brecht Van Lommel [Fri, 15 Jun 2018 08:06:32 +0000 (10:06 +0200)]
Fix Cycles CUDA error after recent changes.

16 months agoWM: 2.8 screen compatibility
Campbell Barton [Fri, 15 Jun 2018 08:23:03 +0000 (10:23 +0200)]
WM: 2.8 screen compatibility

Without these minor changes loading files from 2.8 will crash.

Manually applied edits from 26786a2b87a08

16 months agoCycles: Query XYZ to/from Scene Linear conversion from OCIO instead of assuming sRGB
Lukas Stockner [Thu, 14 Jun 2018 15:48:19 +0000 (17:48 +0200)]
Cycles: Query XYZ to/from Scene Linear conversion from OCIO instead of assuming sRGB

I've limited it to just the RGB<->XYZ stuff for now, correct image handling is the next step.

Reviewers: brecht, sergey

Differential Revision:

16 months agoCycles: Connect value inputs to Strength instead of Color when inserting an Emission...
Lukas Stockner [Thu, 14 Jun 2018 20:16:42 +0000 (22:16 +0200)]
Cycles: Connect value inputs to Strength instead of Color when inserting an Emission node

Same result, but saves an additional ConvertNode.

16 months agoCycles: Automatically detect HDRI resolution by default and use non-square sampling map
Lukas Stockner [Thu, 14 Jun 2018 14:18:34 +0000 (16:18 +0200)]
Cycles: Automatically detect HDRI resolution by default and use non-square sampling map

The automatic mode checks all Enviroment Texture nodes and picks the largest image's resolution.
If there are no Enviroment Textures, it just uses the old default.

Also, the sampling map now isn't limited to square shapes. The automatic detection uses the exact image size,
the manual UI option now halves the value to get the height.

A default aspect ratio of 2:1 makes sense since this is what most HDRIs use.

Reviewers: brecht, sergey

Differential Revision:

16 months agoCleanup: remove last G.main's from Collada code.
Bastien Montagne [Thu, 14 Jun 2018 13:15:51 +0000 (15:15 +0200)]
Cleanup: remove last G.main's from Collada code.

16 months agoCleanup: Remove last G.main's from WM code.
Bastien Montagne [Thu, 14 Jun 2018 10:34:13 +0000 (12:34 +0200)]
Cleanup: Remove last G.main's from WM code.

Was mostly validating valid usages of G.main -> G_MAIN actually.

16 months agoFix T55470: Add option to not fix polygons' winding to Edit Normals modifier.
Bastien Montagne [Thu, 14 Jun 2018 09:41:12 +0000 (11:41 +0200)]
Fix T55470: Add option to not fix polygons' winding to Edit Normals modifier.

this is actually adding option to add buggy behavior, but.. NPR often
expects buggy behaviors, and its one of the main targets for normal editing.
So think it's reasonable to add that option (disabled by default of

Note that am not really happy with UI, but:
* Not sure where to put it, it's kind of own self-contained area option.
* Don't to make it too much visible, using this should be the exception!

16 months agoFix undo group to use human readable name, since this shows in the UI.
Brecht Van Lommel [Wed, 13 Jun 2018 16:38:38 +0000 (18:38 +0200)]
Fix undo group to use human readable name, since this shows in the UI.

16 months agoFix undo of transform after frame change undoing too much.
Brecht Van Lommel [Wed, 13 Jun 2018 16:22:17 +0000 (18:22 +0200)]
Fix undo of transform after frame change undoing too much.

For grouped undo we should not skip the undo push, rather replace the
previous undo push. This way undo goes back to the state after the last
operation in the group.

16 months agoCycles: auto insert emission node when linking color to closure.
Brecht Van Lommel [Wed, 13 Jun 2018 14:29:06 +0000 (16:29 +0200)]
Cycles: auto insert emission node when linking color to closure.

This is convenient for previewing the output of a node, and we agreed
to support this behavior in both Eevee and Cycles.

16 months agoWM: check release event for particle edit mode
Campbell Barton [Wed, 13 Jun 2018 16:23:09 +0000 (18:23 +0200)]
WM: check release event for particle edit mode

Caused by drag event.

16 months agoCleanup: get rid of last G.main in BMesh code.
Bastien Montagne [Wed, 13 Jun 2018 14:29:12 +0000 (16:29 +0200)]
Cleanup: get rid of last G.main in BMesh code.

16 months agoCleanup: moar ugly G.main removal...
Bastien Montagne [Wed, 13 Jun 2018 12:26:26 +0000 (14:26 +0200)]
Cleanup: moar ugly G.main removal...

Note that due to RNA get/setters issue, that one may actually add some
G.main usages to the total... But at least it's not hidden anymore in a
very low-level, dark corner of BKE pointcache code!

16 months agoFix T55467: nodes cant be resized after recent clickdrag change
Philipp Oeser [Wed, 13 Jun 2018 12:03:46 +0000 (14:03 +0200)]
Fix T55467: nodes cant be resized after recent clickdrag change

16 months agoCleanup: swapped X/Y UI_UNIT
Campbell Barton [Wed, 13 Jun 2018 09:10:32 +0000 (11:10 +0200)]
Cleanup: swapped X/Y UI_UNIT

16 months agoCleanup: remove more G.main from BKE area.
Bastien Montagne [Wed, 13 Jun 2018 08:57:10 +0000 (10:57 +0200)]
Cleanup: remove more G.main from BKE area.

16 months agoCleanup: moar G.main removal from BKE area.
Bastien Montagne [Tue, 12 Jun 2018 15:57:24 +0000 (17:57 +0200)]
Cleanup: moar G.main removal from BKE area.

16 months agoCleanup: BKE_scene_free should not have to worry about cleaning its usages.
Bastien Montagne [Tue, 12 Jun 2018 15:46:16 +0000 (17:46 +0200)]
Cleanup: BKE_scene_free should not have to worry about cleaning its usages.

This is supposed to be handled by calling code! Henceforce, no need to
call BKE_sequencer_clear_scene_in_allseqs() here, and... no need for
that ugly G.main case. ;)

16 months agoWM: remove sloppy region type access
Campbell Barton [Tue, 12 Jun 2018 15:34:44 +0000 (17:34 +0200)]
WM: remove sloppy region type access

Avoid accidentally operating on the wrong region type.

16 months agoWM: rename BKE_regiontype_from_id
Campbell Barton [Tue, 12 Jun 2018 15:26:38 +0000 (17:26 +0200)]
WM: rename BKE_regiontype_from_id

This returns the first as a fallback, causing confusing usage.
Renamed and added a version of the function that doesn't.

16 months agoFix T55452: Crash on saving with visible particle system.
Bastien Montagne [Tue, 12 Jun 2018 14:17:05 +0000 (16:17 +0200)]
Fix T55452: Crash on saving with visible particle system.

Missing Main pointer in recent refactor/cleanup of G.main usages...

16 months agoCleanup: moar removal of G.main in BKE area...
Bastien Montagne [Tue, 12 Jun 2018 13:16:45 +0000 (15:16 +0200)]
Cleanup: moar removal of G.main in BKE area...

16 months agoCleanup/simplify G.main usages.
Bastien Montagne [Tue, 12 Jun 2018 13:03:51 +0000 (15:03 +0200)]
Cleanup/simplify G.main usages.

Using G.main only to get main bled filepath, or built-in fonts, is OK.
So now using the 'valid' G_MAIN macro here instead.

16 months agoCleanup: remove moar G.main from BKE area.
Bastien Montagne [Tue, 12 Jun 2018 10:53:27 +0000 (12:53 +0200)]
Cleanup: remove moar G.main from BKE area.

16 months agoCleanup: remove some G.main from ED's animsys.
Bastien Montagne [Tue, 12 Jun 2018 10:28:14 +0000 (12:28 +0200)]
Cleanup: remove some G.main from ED's animsys.

The easy ones - there some much, much trickier to tackle there...

16 months agoCleanup: remove some G.main from BKE area.
Bastien Montagne [Tue, 12 Jun 2018 09:21:54 +0000 (11:21 +0200)]
Cleanup: remove some G.main from BKE area.

16 months agoFix T55448: Typo in Cycles CUDA debug output
Lukas Stockner [Tue, 12 Jun 2018 08:37:51 +0000 (10:37 +0200)]
Fix T55448: Typo in Cycles CUDA debug output

Reviewers: sergey, lukasstockner97

Reviewed By: lukasstockner97

Tags: #cycles, #bf_blender

Differential Revision:

16 months agoCleanup: remove moar ugly G.main usages...
Bastien Montagne [Mon, 11 Jun 2018 13:40:37 +0000 (15:40 +0200)]
Cleanup: remove moar ugly G.main usages...

BKE_image was an ugly nest, could fix all but the ones from compositor,
so moved ugly G.main there, at least we know where the Evil is that way ;)

16 months agoCycles: Cleanup, silence strict compiler warning
Sergey Sharybin [Mon, 11 Jun 2018 10:54:17 +0000 (12:54 +0200)]
Cycles: Cleanup, silence strict compiler warning

There is one legit place in the code where memcpy was used as an
optimization trick. Was needed for older version of GCC, but now
it should be re-evaluated and checked if it still helps to have
that trick.

In other places it's somewhat lazy programming to zero out all
object members. That is absolutely unsafe, at the moment when
less trivial class is used as a member in that object things
will break.

Other cases were using memcpy into an object which comes from
an external library. We don't control that object, and we can
not guarantee it will always be safe for such memory tricks
and debugging bugs caused by such low level access is far fun.

Ideally we need to use more proper C++, but needs to be done with
big care, including benchmarks of each change, For now do
annoying but simple cast to void*.

16 months agoLibmv: Cleanup, make strict compiler more happy
Sergey Sharybin [Mon, 11 Jun 2018 10:53:11 +0000 (12:53 +0200)]
Libmv: Cleanup, make strict compiler more happy

In C++ it is not really safe to memcpy objects, and newer GCC will warn
about this. However, we don't use our vector for unsafe-to-memcpy objects,
so just explicitly silence that warning.

16 months agoCleanup: Moar G.main removal of Hell.
Bastien Montagne [Mon, 11 Jun 2018 10:14:18 +0000 (12:14 +0200)]
Cleanup: Moar G.main  removal of Hell.

This commit actually adds some G.main... but at much, much higher level
than the ones it removes, so should still be better ;)

16 months agoCleanup: remove some G.main usages...
Bastien Montagne [Mon, 11 Jun 2018 09:05:37 +0000 (11:05 +0200)]
Cleanup: remove some G.main usages...

16 months agoFix bad level stubs
Sergey Sharybin [Mon, 11 Jun 2018 09:36:22 +0000 (11:36 +0200)]
Fix bad level stubs

16 months agoCleanup: Use BLI_strncpy
Sergey Sharybin [Mon, 11 Jun 2018 09:05:24 +0000 (11:05 +0200)]
Cleanup: Use BLI_strncpy

It has behavior which we expect, and silences strict compiler warning.

16 months agoFix T55278: Lightmap Pack > New Image broken when active object is None
Philipp Oeser [Mon, 11 Jun 2018 09:00:19 +0000 (11:00 +0200)]
Fix T55278: Lightmap Pack > New Image broken when active object is None

thanx bblanimation (Christopher Gearhart) for spotting the issue and
providing the fix!

Reviewed By: brecht

Differential Revision:

16 months agopath_util: avoid overflow w/ strtoll use
Campbell Barton [Mon, 11 Jun 2018 08:43:34 +0000 (10:43 +0200)]
path_util: avoid overflow w/ strtoll use

Also style cleanup.

16 months agoFix PyConsole: Drag events finished early in modal text selection
Philipp Oeser [Mon, 11 Jun 2018 08:18:51 +0000 (10:18 +0200)]
Fix PyConsole: Drag events finished early in modal text selection

16 months agoFix T55140: opened image doesn't show up in movie clip editor
Philipp Oeser [Fri, 1 Jun 2018 09:58:50 +0000 (11:58 +0200)]
Fix T55140: opened image doesn't show up in movie clip editor

atoi usage in BLI_stringdec could overflow, use strtoll instead and
valid range with INT_MIN and INT_MAX

Reviewed By: campbellbarton

Differential Revision:

16 months agoFix T55349: crash adding paint slot when object is on hidden layer
Philipp Oeser [Mon, 11 Jun 2018 07:12:29 +0000 (09:12 +0200)]
Fix T55349: crash adding paint slot when object is on hidden layer

use better poll and get ob with 'ED_object_active_context' (instead of

Reviewed By: campbellbarton

Differential Revision:

16 months agoWM: add macros to check mouse button/gesture/wheel
Campbell Barton [Sun, 10 Jun 2018 10:08:09 +0000 (12:08 +0200)]
WM: add macros to check mouse button/gesture/wheel

Use to check click/drag,
fixes issue with mouse wheel triggering pie menu.

16 months agoCleanup: trailing space in CMake files
Campbell Barton [Sun, 10 Jun 2018 06:12:13 +0000 (08:12 +0200)]
Cleanup: trailing space in CMake files

16 months agoRNA: remove Layout.introspect
Campbell Barton [Sat, 9 Jun 2018 16:55:51 +0000 (18:55 +0200)]
RNA: remove Layout.introspect

This was added as an experiment to extract information for docs
but this was never all that useful for its intended purpose.

16 months agoCleanup: unused functions
Campbell Barton [Sat, 9 Jun 2018 16:47:39 +0000 (18:47 +0200)]
Cleanup: unused functions

16 months agoCleanup: remove some G.main usages.
Bastien Montagne [Sat, 9 Jun 2018 13:16:44 +0000 (15:16 +0200)]
Cleanup: remove some G.main usages.

16 months agoCleanup: trailing space in RNA
Campbell Barton [Sat, 9 Jun 2018 12:40:09 +0000 (14:40 +0200)]
Cleanup: trailing space in RNA

16 months agoCleanup: style
Campbell Barton [Sat, 9 Jun 2018 12:30:32 +0000 (14:30 +0200)]
Cleanup: style

16 months agoGHOST/X11: Print the keycode w/ debug enabled
Campbell Barton [Sat, 9 Jun 2018 10:53:39 +0000 (12:53 +0200)]
GHOST/X11: Print the keycode w/ debug enabled

16 months agoGHOST/X11: Correct non-latin kb workaround case
Campbell Barton [Sat, 9 Jun 2018 10:04:07 +0000 (12:04 +0200)]
GHOST/X11: Correct non-latin kb workaround case

Harmless since this is always enabled,
only do this for easier troubleshooting when disabling the define.

16 months agoGHOST/X11: support accessing physical keycodes
Campbell Barton [Sat, 9 Jun 2018 09:23:41 +0000 (11:23 +0200)]
GHOST/X11: support accessing physical keycodes

This means we can check keys such as tilde in a generic way.

16 months agoWM: correct recent change to click/drag detection
Campbell Barton [Fri, 8 Jun 2018 20:17:21 +0000 (22:17 +0200)]
WM: correct recent change to click/drag detection

fb1915d87090a - caused click/drag events not to be detected.

Now check a key is a mouse or keyboard event.

16 months agoWM: fix panel drag event handling
Campbell Barton [Fri, 8 Jun 2018 16:58:41 +0000 (18:58 +0200)]
WM: fix panel drag event handling

16 months agoWM: fix node link & background drag
Campbell Barton [Fri, 8 Jun 2018 16:52:00 +0000 (18:52 +0200)]
WM: fix node link & background drag

16 months agoGHOST/X11: Map unknown es,dk keys to accentgrave
Campbell Barton [Fri, 8 Jun 2018 13:21:20 +0000 (15:21 +0200)]
GHOST/X11: Map unknown es,dk keys to accentgrave

16 months agoGHOST/X11: Map unknown de,fr keys to accentgrave
Campbell Barton [Fri, 8 Jun 2018 12:53:03 +0000 (14:53 +0200)]
GHOST/X11: Map unknown de,fr keys to accentgrave

This still uses the correct string when typing text,
it just allows the key to be used in keymaps.

We should eventually add scan-code support.

16 months agoPrevent wheel causing spurious click/drag events
Campbell Barton [Fri, 8 Jun 2018 12:09:45 +0000 (14:09 +0200)]
Prevent wheel causing spurious click/drag events

16 months agoCleanup: getting rid of G.main.
Bastien Montagne [Fri, 8 Jun 2018 10:16:37 +0000 (12:16 +0200)]
Cleanup: getting rid of G.main.

Sometimes one needs a *lot* of changes for a single G.main... :/

16 months agoCMake: disable WITH_COMPILER_ASAN for CMAKE_BUILD_TYPE Release
Jeroen Bakker [Fri, 8 Jun 2018 09:45:05 +0000 (11:45 +0200)]

16 months agoFix regression in grease pencil drawing
Campbell Barton [Fri, 8 Jun 2018 08:52:49 +0000 (10:52 +0200)]
Fix regression in grease pencil drawing

Drag events finished drawing early.

16 months agoFix T55301: Transform confirm on release fails w/ MMB
Campbell Barton [Fri, 8 Jun 2018 06:48:21 +0000 (08:48 +0200)]
Fix T55301: Transform confirm on release fails w/ MMB

16 months agoWM: backport event/keymap type util from 2.8
Campbell Barton [Fri, 8 Jun 2018 06:46:31 +0000 (08:46 +0200)]
WM: backport event/keymap type util from 2.8

16 months agoCleanup: trailing space
Campbell Barton [Fri, 8 Jun 2018 06:07:48 +0000 (08:07 +0200)]
Cleanup: trailing space

Remove from blender/nodes, collada, blenfont & render.

16 months agoFix recently added drag events closing menus
Campbell Barton [Fri, 8 Jun 2018 06:01:43 +0000 (08:01 +0200)]
Fix recently added drag events closing menus

16 months agoWM: fix drag events applying after release
Campbell Barton [Thu, 7 Jun 2018 18:37:28 +0000 (20:37 +0200)]
WM: fix drag events applying after release

16 months agoGHOST/X11: Xinput/XIM support caused double key-up
Campbell Barton [Thu, 7 Jun 2018 18:32:51 +0000 (20:32 +0200)]
GHOST/X11: Xinput/XIM support caused double key-up

All keyboard events were sending double key events (including modifiers)
when xinput was enabled with gnome (causing much confusion!).

I cant test if XIM works,
but this isn't useful to send double events, so disabling for now.

16 months agoCleanup: typo, and 0 -> false for booleans.
Bastien Montagne [Thu, 7 Jun 2018 16:35:37 +0000 (18:35 +0200)]
Cleanup: typo, and 0 -> false for booleans.

16 months agoWM: add support for drag events
Campbell Barton [Thu, 7 Jun 2018 15:05:49 +0000 (17:05 +0200)]
WM: add support for drag events

This allows for a single key to be mapped to both release and drag,
useful for pie menus to share a key with a different action.

16 months agoFix key repeat events resetting the click timer
Campbell Barton [Thu, 7 Jun 2018 14:51:03 +0000 (16:51 +0200)]
Fix key repeat events resetting the click timer

16 months agoCleanup: trailing space for windowmanager
Campbell Barton [Thu, 7 Jun 2018 14:43:52 +0000 (16:43 +0200)]
Cleanup: trailing space for windowmanager

16 months agoWM: check for release instead of not pressed
Campbell Barton [Thu, 7 Jun 2018 14:19:59 +0000 (16:19 +0200)]
WM: check for release instead of not pressed

Makes reasoning about events more predictable.

16 months agoFix crash due to missing init of new bAnimContext bmain member in transform code.
Bastien Montagne [Thu, 7 Jun 2018 13:38:31 +0000 (15:38 +0200)]
Fix crash due to missing init of new bAnimContext bmain member in transform code.

From own previous G.main-busting commit.

16 months agoFix double free in dyntopo-sculpt mode undo
Campbell Barton [Thu, 7 Jun 2018 12:54:09 +0000 (14:54 +0200)]
Fix double free in dyntopo-sculpt mode undo

16 months agoFix sculpt assert on initialization
Campbell Barton [Thu, 7 Jun 2018 11:38:46 +0000 (13:38 +0200)]
Fix sculpt assert on initialization

16 months agoCleanup: remove moar G.main usages.
Bastien Montagne [Thu, 7 Jun 2018 10:47:00 +0000 (12:47 +0200)]
Cleanup: remove moar G.main usages.

* Really need to address RNA setters case, end up adding way too much
G.main here these days... :/
* Added Main pointer into bAnimContext, helps a lot in anim code ;)

16 months agoRevert "Cycles: Cleanup: Don't use return on function returning void"
Sergey Sharybin [Thu, 7 Jun 2018 09:57:57 +0000 (11:57 +0200)]
Revert "Cycles: Cleanup: Don't use return on function returning void"

Not sure why exactly it is called a cleanup, the code was much more clear
and robust against possible missing return statements which are MANDATORY.

Missing return statement will:

- Cause two different BVH traversals to be run.

  Not is happening currently, but if more BVH layouts are added, it will
  become a problem.

- It is already causing assert() statements to fail, since functions are
  no longer returning when they are supposed to.

If there is any measurable reason to keep this change, let me know.
Otherwise just stick to reliable/tested/robust code.

This reverts commit ba65f7093b39a8e5f1fb869cbc347fb810a05ab9.

16 months agoCleanup: Nuke moar G.main usages...
Bastien Montagne [Wed, 6 Jun 2018 13:50:24 +0000 (15:50 +0200)]
Cleanup: Nuke moar G.main usages...

16 months agoPython API: Initial 'imbuf' API
Campbell Barton [Thu, 7 Jun 2018 05:41:49 +0000 (07:41 +0200)]
Python API: Initial 'imbuf' API

Support only basic operations new/load/write & resize.

Add now so we can extend as needed & more easily accept patches.

16 months agoFix BLI_ASSERT_UNIT macro w/ non-finite numbers
Campbell Barton [Wed, 6 Jun 2018 17:49:27 +0000 (19:49 +0200)]
Fix BLI_ASSERT_UNIT macro w/ non-finite numbers