blender.git
3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Tue, 1 Aug 2017 05:00:49 +0000 (15:00 +1000)]
Merge branch 'master' into blender2.8

3 years agoCleanup: double promotion
Campbell Barton [Tue, 1 Aug 2017 03:35:26 +0000 (13:35 +1000)]
Cleanup: double promotion

3 years agoCleanup: warnings from last commit
Campbell Barton [Tue, 1 Aug 2017 02:31:19 +0000 (12:31 +1000)]
Cleanup: warnings from last commit

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Tue, 1 Aug 2017 00:38:36 +0000 (10:38 +1000)]
Merge branch 'master' into blender2.8

3 years agoCleanup: use static vars where appropriate
Campbell Barton [Mon, 31 Jul 2017 23:06:34 +0000 (09:06 +1000)]
Cleanup: use static vars where appropriate

3 years agoFix fcurve color assignment
Campbell Barton [Mon, 31 Jul 2017 22:27:35 +0000 (08:27 +1000)]
Fix fcurve color assignment

3 years agoCorrect accidental variable declaration
Campbell Barton [Mon, 31 Jul 2017 21:55:01 +0000 (07:55 +1000)]
Correct accidental variable declaration

3 years agoFix T52224: auto IK not respecting length, after recent bugfix.
Brecht Van Lommel [Mon, 31 Jul 2017 17:22:03 +0000 (19:22 +0200)]
Fix T52224: auto IK not respecting length, after recent bugfix.

3 years agoCode cleanup: fix warning with clang.
Brecht Van Lommel [Mon, 31 Jul 2017 17:07:29 +0000 (19:07 +0200)]
Code cleanup: fix warning with clang.

3 years agoFix T52232: Crash in RNA_enum_from_value while inspecting compositor image node prope...
Bastien Montagne [Mon, 31 Jul 2017 14:50:36 +0000 (16:50 +0200)]
Fix T52232: Crash in RNA_enum_from_value while inspecting compositor image node properties in outliner.

Bug was in RNA nodes code actually, itemf functions shall never, ever
return NULL!

Note that there were other itemf functions there that were potentially
buggy. Also harmonized a bit their code.

3 years agoFix two issues with recent changes to number display while editing them.
Bastien Montagne [Mon, 31 Jul 2017 13:40:26 +0000 (15:40 +0200)]
Fix two issues with recent changes to number display while editing them.

* Numbers with units (especially, angles) where not handled correctly
regarding number of significant digits (spotted by @brecht in T52222
comment, thanks).
* Zero value has no valid log, need to take that into account!

3 years agoEevee: SSR: Change clamp to a real clamp and add Max Roughness.
Clément Foucault [Mon, 31 Jul 2017 13:18:22 +0000 (15:18 +0200)]
Eevee: SSR: Change clamp to a real clamp and add Max Roughness.

Clamp will now works as in Cycles.

Max roughness limit ssr to a certain roughness level: for noise / performance tweaking.

3 years agoEevee: Draw background after depth prepass.
Clément Foucault [Mon, 31 Jul 2017 13:15:42 +0000 (15:15 +0200)]
Eevee: Draw background after depth prepass.

Reduce overdraw. 0.4ms goes to 0.01ms if background is completely occluded.

3 years agoEevee: SSR: Rewrote the raytracing algorithm.
Clément Foucault [Sun, 30 Jul 2017 15:11:05 +0000 (17:11 +0200)]
Eevee: SSR: Rewrote the raytracing algorithm.

It now uses a quality slider instead of stride.
Lower quality takes larger strides between samples and use lower mips when tracing rough rays.

Now raytracing is done entierly in homogeneous coordinate space. This run much faster.
Should be fairly optimized. We are still Bandwidth bound.

Add a line-line intersection refine.
Add a ray jitter between the multiple ray per pixel to fill some undersampling in mirror reflections.

The tracing now stops if it goes behind an object. This needs some work to allow it to continue even if behind objects.

3 years agoFix glitch updating manipulator after undo
Campbell Barton [Mon, 31 Jul 2017 04:35:10 +0000 (14:35 +1000)]
Fix glitch updating manipulator after undo

Running undo would notify manipulators to refresh,
but this still allowed for events in the queue to be handled,
where manipulators could be drawn for selection before
their refresh callback runs.

This made Python manipulators raise exceptions
about referencing invalid data (or crash).

Now tag manipulator update on file load (including undo)
and ensure the refresh callback runs
before drawing manipulator selection.

Also split manipulator map refresh flag in two since selection doesn't
perform the same operations as regular drawing.

3 years agoCleanup: use enum typedef for manipulator drawstep
Campbell Barton [Mon, 31 Jul 2017 03:14:42 +0000 (13:14 +1000)]
Cleanup: use enum typedef for manipulator drawstep

3 years agoCorrect last commit, for-loop included NULL check
Campbell Barton [Mon, 31 Jul 2017 01:39:17 +0000 (11:39 +1000)]
Correct last commit, for-loop included NULL check

3 years agoCleanup: remove next/prev from manipulator map
Campbell Barton [Mon, 31 Jul 2017 01:26:03 +0000 (11:26 +1000)]
Cleanup: remove next/prev from manipulator map

3 years agoFix manipulator Python API crash w/ undo
Campbell Barton [Sun, 30 Jul 2017 20:41:10 +0000 (06:41 +1000)]
Fix manipulator Python API crash w/ undo

Split up manipulator free & unlink, so freeing window data doesn't
run callbacks that might use freed data.

3 years agoFix manipulator keymap initialization
Campbell Barton [Sun, 30 Jul 2017 18:46:35 +0000 (04:46 +1000)]
Fix manipulator keymap initialization

Update flag was cleared before being checked
when registering after load.

3 years agoManipulator: Check we don't add multiple times
Campbell Barton [Sun, 30 Jul 2017 05:47:57 +0000 (15:47 +1000)]
Manipulator: Check we don't add multiple times

3 years agoRevert "Fix manipulator handles getting added each refresh"
Campbell Barton [Sun, 30 Jul 2017 05:38:32 +0000 (15:38 +1000)]
Revert "Fix manipulator handles getting added each refresh"

This reverts commit 122706db9cd23c88775474750e99b57e74a3b9e5.

Would loose manipulators, will check for duplicates instead.

3 years agoBLI_memiter: minor cleanup
Campbell Barton [Sun, 30 Jul 2017 03:55:41 +0000 (13:55 +1000)]
BLI_memiter: minor cleanup

3 years agoDwM: use BLI_memiter for draw storage & iteration
Campbell Barton [Sat, 29 Jul 2017 16:17:11 +0000 (02:17 +1000)]
DwM: use BLI_memiter for draw storage & iteration

This will only be noticeable for drawing many instances.

In contrived use-case with many instances, and `USE_PROFILE` disabled
this can close to double playback FPS.

The option to disable this is left in the code in case we want to
debug memory use.

See D2756 for details.

3 years agoDwM: add ability to disable the timer
Campbell Barton [Sat, 29 Jul 2017 15:31:36 +0000 (01:31 +1000)]
DwM: add ability to disable the timer

This interferes with benchmarking draw times,
so this makes it easy to turn off.

3 years agoBLI_memiter: Small API for many small allocations
Campbell Barton [Sat, 29 Jul 2017 13:38:20 +0000 (23:38 +1000)]
BLI_memiter: Small API for many small allocations

- Each allocation can be a different size
  (but should be smaller than the chunk size).
- Result can be looped over in order of allocation.
- Allocations are aligned to pointer size to avoid unaligned reads.

3 years agoProperty path generation fixes
Aleksandr Zinovev [Sat, 29 Jul 2017 12:23:01 +0000 (15:23 +0300)]
Property path generation fixes

3 years agoRemove volatile, causing issues w/ GCC/ubsan
Campbell Barton [Fri, 28 Jul 2017 22:58:11 +0000 (08:58 +1000)]
Remove volatile, causing issues w/ GCC/ubsan

Should remove from master since its workaround for Cygwin
but too close to release.

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 28 Jul 2017 22:43:58 +0000 (08:43 +1000)]
Merge branch 'master' into blender2.8

3 years agoCleanup: quiet picky ubsan warnings
Campbell Barton [Fri, 28 Jul 2017 22:42:32 +0000 (08:42 +1000)]
Cleanup: quiet picky ubsan warnings

3 years agoCleanup: multistatement-macros warning
Campbell Barton [Fri, 28 Jul 2017 22:18:20 +0000 (08:18 +1000)]
Cleanup: multistatement-macros warning

3 years agoCleanup: multistatement-macros warning
Campbell Barton [Fri, 28 Jul 2017 22:18:20 +0000 (08:18 +1000)]
Cleanup: multistatement-macros warning

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 28 Jul 2017 20:44:04 +0000 (06:44 +1000)]
Merge branch 'master' into blender2.8

3 years agoReplace magic numbers with deprecated names
Campbell Barton [Fri, 28 Jul 2017 20:25:54 +0000 (06:25 +1000)]
Replace magic numbers with deprecated names

The names aren't meaningful but means it wont
accidentally use valid names.

Also remove textured-font setting

3 years agoFix T52195: Sculpt from Python fails
Campbell Barton [Fri, 28 Jul 2017 19:59:17 +0000 (05:59 +1000)]
Fix T52195: Sculpt from Python fails

When calling sculpt from Python,
setting 3D 'location' but not 2D 'mouse' stopped working in 2.78.

Now check if the operator is running non-interactively and
skip the mouse-over check.

3 years agoWM: OP_IS_INVOKE was being incorrectly set
Campbell Barton [Fri, 28 Jul 2017 19:40:33 +0000 (05:40 +1000)]
WM: OP_IS_INVOKE was being incorrectly set

Calling an operator with EXEC_* context would still set the invoke flag.

3 years agoFix T52213: Enum drivers no longer work
Campbell Barton [Fri, 28 Jul 2017 16:39:16 +0000 (02:39 +1000)]
Fix T52213: Enum drivers no longer work

Regression in D1812: PyDriver variables as Objects

Taking the Python representation is nice in general
but for enums it would convert them into strings,
breaking some existing drivers.

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 28 Jul 2017 15:46:27 +0000 (01:46 +1000)]
Merge branch 'master' into blender2.8

3 years agoResolve T45301 by adding option for old behavior
Campbell Barton [Fri, 28 Jul 2017 15:35:07 +0000 (01:35 +1000)]
Resolve T45301 by adding option for old behavior

Some users really liked previous behavior,
so making it an option.

Cursor Lock Adjustment can be disabled to give something close to
2.4x behavior of cursor locking.

When lock-adjustment is disabled placing the cursor the view.
This avoids the issue reported in T40353
where the cursor could get *lost*.

3 years agoCleanup: clear deprecated UI flags
Campbell Barton [Fri, 28 Jul 2017 15:28:58 +0000 (01:28 +1000)]
Cleanup: clear deprecated UI flags

Also adds cursor-lock flag, to be used in next commit.

3 years agoFix T52156: Hair dynamics broken with density texture
Luca Rood [Fri, 28 Jul 2017 13:24:48 +0000 (15:24 +0200)]
Fix T52156: Hair dynamics broken with density texture

Even strands that were excluded by the density texture were being added
to the DM passed to cloth, but these ended up having some invalid data,
because they were not fully constructed.

This simply excludes `UNEXISTED` particles from the DM generation, as
would be expected.

3 years agoFix crash when duplicating object
Sergey Sharybin [Fri, 28 Jul 2017 11:02:20 +0000 (13:02 +0200)]
Fix crash when duplicating object

This fixes null pointer check fiasco.

3 years agoFix T52148: Point Density Texture ID User decrement error related to the Object field.
Bastien Montagne [Fri, 28 Jul 2017 10:43:06 +0000 (12:43 +0200)]
Fix T52148: Point Density Texture ID User decrement error related to the Object field.

Note that fix is not perfect, systematically make refcounting of all IDs
assigned to node's id pointer, which breaks the 'do not refcount
scene/object/text datablocks' principle...

But besides that principle being far from ideal in general, it becomes
pretty much impossible to apply when using //generic// ID pointer,
unless we add some kind of type data to that pointer somehow.

So for now, better to live with that, than having broken usercount.

3 years agoDepsgraph: Re-use evaluated mesh across frames and remove time dependency from all...
Sergey Sharybin [Fri, 28 Jul 2017 10:27:34 +0000 (12:27 +0200)]
Depsgraph: Re-use evaluated mesh across frames and remove time dependency from all CoW components

This commit is a work forward having less updates during playback, which speeds
things up a lot here. The idea is simple: stop update all copy-on-write
datablocks (which implies full re-evaluation actually) on frame change and
re-use existing evaluated meshes as much as possible.

This brings playback speed to 24 fps on the dino test scene here. Performance
drops down a lot when armature is animated tho, but that's because of need of
tangent space calculation which we can't do much about from just a dependency
graph.

Hopefully this doesn't make copy-on-write too unstable, quick tests here are
surviving fine.

3 years agoFix T52212: Vgroups doesn't work after Carve Boolean
Sergey Sharybin [Fri, 28 Jul 2017 09:55:24 +0000 (11:55 +0200)]
Fix T52212: Vgroups doesn't work after Carve Boolean

3 years agoFix potential 'divide-by-zero' in our UI fitting code.
Bastien Montagne [Fri, 28 Jul 2017 08:56:41 +0000 (10:56 +0200)]
Fix potential 'divide-by-zero' in our UI fitting code.

Reported by coverity, better fix even if highly unlikely to happen...

3 years agoFix T52208: Using UI_BUT_REDALERT flag for UI_BTYPE_KEY_EVENT buttons crashes Blender.
Bastien Montagne [Fri, 28 Jul 2017 08:38:47 +0000 (10:38 +0200)]
Fix T52208: Using UI_BUT_REDALERT flag for UI_BTYPE_KEY_EVENT buttons crashes Blender.

but pointer was not assigned in that case...

3 years agoCleanup: Remove gitignore for api images
Aaron Carlisle [Thu, 27 Jul 2017 20:04:42 +0000 (16:04 -0400)]
Cleanup: Remove gitignore for api images

3 years agoPrevent crash when duplicating object which doesn't have evaluated base properties yet
Sergey Sharybin [Thu, 27 Jul 2017 14:29:45 +0000 (16:29 +0200)]
Prevent crash when duplicating object which doesn't have evaluated base properties yet

This mainly happens when copy on write is enabled.

3 years agoCopy on write: Prevent crash when duplicating object with particle system
Sergey Sharybin [Thu, 27 Jul 2017 14:28:16 +0000 (16:28 +0200)]
Copy on write: Prevent crash when duplicating object with particle system

Transform system was using global main, which might have been pointing to a
freed scene layer.

3 years agoFix UI messages...
Bastien Montagne [Thu, 27 Jul 2017 13:20:44 +0000 (15:20 +0200)]
Fix UI messages...

3 years agoDepsgraph: Attempt to keep evaluated mesh when possible
Sergey Sharybin [Thu, 27 Jul 2017 13:12:08 +0000 (15:12 +0200)]
Depsgraph: Attempt to keep evaluated mesh when possible

Currently wouldn't make any difference, but required for upcoming work of
getting rid of time dependency for copy-on-write component.

3 years agoDepsgraph: Cleanup, variable name
Sergey Sharybin [Thu, 27 Jul 2017 13:10:22 +0000 (15:10 +0200)]
Depsgraph: Cleanup, variable name

3 years agoDepsgraph: Cleanup, use some utility functions to shorten construction code
Sergey Sharybin [Thu, 27 Jul 2017 13:08:29 +0000 (15:08 +0200)]
Depsgraph: Cleanup, use some utility functions to shorten construction code

Still some cleanup is possible.

3 years agoDepsgraph: Create ID nodes on build-time expansion using node builder
Sergey Sharybin [Thu, 27 Jul 2017 12:57:47 +0000 (14:57 +0200)]
Depsgraph: Create ID nodes on build-time expansion using node builder

This will allow us to do some builder-specific trickery when ID nodes are
requested to be created from build-time expansion.

3 years agoDepsgraph: Allow stealing copy-on-written pointer
Sergey Sharybin [Thu, 27 Jul 2017 12:42:06 +0000 (14:42 +0200)]
Depsgraph: Allow stealing copy-on-written pointer

This will become handy when we'll be re-using evaluated meshes for
objects after relations are updated.

3 years agoDepsgraph: Fix possibly missing lamp update when lamp data changes
Sergey Sharybin [Thu, 27 Jul 2017 12:40:49 +0000 (14:40 +0200)]
Depsgraph: Fix possibly missing lamp update when lamp data changes

3 years agoDepsgraph: Make it possible to use given pre-allocated ID as a copy
Sergey Sharybin [Thu, 27 Jul 2017 12:38:26 +0000 (14:38 +0200)]
Depsgraph: Make it possible to use given pre-allocated ID as a copy

3 years agoCopy on write: Make sure freeing evaluated mesh does not cause crash when re-evaluati...
Sergey Sharybin [Thu, 27 Jul 2017 12:18:45 +0000 (14:18 +0200)]
Copy on write: Make sure freeing evaluated mesh does not cause crash when re-evaluating the object

3 years agoDRW: Fix vertex buffer too large.
Clément Foucault [Thu, 27 Jul 2017 09:23:16 +0000 (11:23 +0200)]
DRW: Fix vertex buffer too large.

3 years agoEevee: Fix probes interfeering with SSR.
Clément Foucault [Thu, 27 Jul 2017 09:22:47 +0000 (11:22 +0200)]
Eevee: Fix probes interfeering with SSR.

3 years agoEevee: Planar Reflection: only support mirror reflection if not using SSR.
Clément Foucault [Thu, 27 Jul 2017 09:21:11 +0000 (11:21 +0200)]
Eevee: Planar Reflection: only support mirror reflection if not using SSR.

3 years agoEevee: Fix bloom once and for all.
Clément Foucault [Wed, 26 Jul 2017 18:00:07 +0000 (20:00 +0200)]
Eevee: Fix bloom once and for all.

... Hopefully ...

3 years agoDRW: Add stats group to eevee and object mode.
Clément Foucault [Wed, 26 Jul 2017 17:58:15 +0000 (19:58 +0200)]
DRW: Add stats group to eevee and object mode.

3 years agoDRW: Revamp the performance debugging tool.
Clément Foucault [Wed, 26 Jul 2017 17:57:46 +0000 (19:57 +0200)]
DRW: Revamp the performance debugging tool.

Old performance debug was doing queries for every frame even if not debugging perf.
Also, it did not record when a pass was draw multiple time, leading to incorect measurement.

New module also allows to group the timers to limit infos displayed.

Also fix the background CPU draw timer.

3 years agoFix factory setup using user scripts path still
Campbell Barton [Thu, 27 Jul 2017 12:22:26 +0000 (22:22 +1000)]
Fix factory setup using user scripts path still

3 years agoDepsgraph: Fix crash happening in copy-on-write of images
Sergey Sharybin [Thu, 27 Jul 2017 11:09:20 +0000 (13:09 +0200)]
Depsgraph: Fix crash happening in copy-on-write of images

Was a threading conflict or so in the cache limiter, and in fact
we don't even want images to be copied.

3 years agoFix T51776: Make sure button icons are updated on Ctrl-ScrollWheel
Jeff Knox [Thu, 27 Jul 2017 10:55:17 +0000 (12:55 +0200)]
Fix T51776: Make sure button icons are updated on Ctrl-ScrollWheel

3 years agoFix button text overlapping with shortcut text in popups
Julian Eisel [Thu, 27 Jul 2017 09:49:41 +0000 (11:49 +0200)]
Fix button text overlapping with shortcut text in popups

The purpose of the keymap strings is probably for un-embossed menu items
like seen in most pulldowns. I can't see a reason for also adding that
string for regularly drawn buttons within popups, we don't add it
anywhere else in the UI either. So this commit makes sure shortcut
strings are only added to buttons that are drawn like pulldown-menu
items.

3 years agoMinor code style corrections
Julian Eisel [Thu, 27 Jul 2017 09:44:51 +0000 (11:44 +0200)]
Minor code style corrections

3 years agoFix Label colors in popups
Aleksandr Zinovev [Thu, 27 Jul 2017 07:27:29 +0000 (10:27 +0300)]
Fix Label colors in popups

3 years agoFix: use click style if a pie was spawned by release or click event
Aleksandr Zinovev [Thu, 27 Jul 2017 07:13:40 +0000 (10:13 +0300)]
Fix: use click style if a pie was spawned by release or click event

3 years agoDepsgraph: Skip iterating over all ntree users on node tree parameter update
Sergey Sharybin [Thu, 27 Jul 2017 09:50:14 +0000 (11:50 +0200)]
Depsgraph: Skip iterating over all ntree users on node tree parameter update

Also make sure drivers on node tree properties will work correctly for viewport.

3 years agoFix button text overlapping with shortcut text in popups
Julian Eisel [Thu, 27 Jul 2017 09:49:41 +0000 (11:49 +0200)]
Fix button text overlapping with shortcut text in popups

The purpose of the keymap strings is probably for un-embossed menu items
like seen in most pulldowns. I can't see a reason for also adding that
string for regularly drawn buttons within popups, we don't add it
anywhere else in the UI either. So this commit makes sure shortcut
strings are only added to buttons that are drawn like pulldown-menu
items.

3 years agoMinor code style corrections
Julian Eisel [Thu, 27 Jul 2017 09:44:51 +0000 (11:44 +0200)]
Minor code style corrections

3 years agoFix Label colors in popups
Aleksandr Zinovev [Thu, 27 Jul 2017 07:27:29 +0000 (10:27 +0300)]
Fix Label colors in popups

3 years agoFix: use click style if a pie was spawned by release or click event
Aleksandr Zinovev [Thu, 27 Jul 2017 07:13:40 +0000 (10:13 +0300)]
Fix: use click style if a pie was spawned by release or click event

3 years agoManipulator: remove names
Campbell Barton [Wed, 26 Jul 2017 21:43:15 +0000 (07:43 +1000)]
Manipulator: remove names

They weren't used anywhere,
both C & Py manipulators better assign to vars (no lookup needed).

3 years agostub update
Campbell Barton [Wed, 26 Jul 2017 21:41:06 +0000 (07:41 +1000)]
stub update

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 26 Jul 2017 21:35:44 +0000 (07:35 +1000)]
Merge branch 'master' into blender2.8

3 years agoCleanup: remove check for old GCC&PPC
Campbell Barton [Wed, 26 Jul 2017 21:28:29 +0000 (07:28 +1000)]
Cleanup: remove check for old GCC&PPC

3 years agoCleanup: Py3.7x warning
Campbell Barton [Wed, 26 Jul 2017 21:23:36 +0000 (07:23 +1000)]
Cleanup: Py3.7x warning

3 years agoMinor template code patch. (objectHitList =/= hitObjectList)
Aaron Carlisle [Wed, 26 Jul 2017 19:56:43 +0000 (15:56 -0400)]
Minor template code patch. (objectHitList =/= hitObjectList)

The Blender text editor's built in python template "Gamelogic" has a reference near the bottom to "objectHitList" as an alleged attribute to the KX_TouchSensor. This name is incorrect, it's correct name is "hitObjectList."

Attempting to access the suggested objectHitList returns error...
```
AttributeError: 'KX_TouchSensor' object has no attribute 'objectHitList'
```

The provided diff corrects this minor error.

Reviewers: kupoman, moguri, campbellbarton, Blendify

Reviewed By: Blendify

Tags: #game_engine, #game_python

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

3 years agoFix crash in recent changes to instancing
Campbell Barton [Wed, 26 Jul 2017 17:19:12 +0000 (03:19 +1000)]
Fix crash in recent changes to instancing

Registrable classes already handled their own instancing,
changes to enable instancing everywhere conflicted.

3 years agoLast commit broke WITH_PYTHON_SAFETY
Campbell Barton [Wed, 26 Jul 2017 16:12:40 +0000 (02:12 +1000)]
Last commit broke WITH_PYTHON_SAFETY

Re-enable BPY_id_release call with thats enabled.

3 years agoBPY_id_release was a nop, use RNA invalidate directly
Campbell Barton [Wed, 26 Jul 2017 16:04:53 +0000 (02:04 +1000)]
BPY_id_release was a nop, use RNA invalidate directly

3 years agoFix T52186: Crash on bevel
Sergey Sharybin [Wed, 26 Jul 2017 14:31:53 +0000 (16:31 +0200)]
Fix T52186: Crash on bevel

bContext is not always available in transform, so need to use explicit
scene and scene layer to create evaluation context from.

3 years agoCLeanup: Use utility function in BKE
Sergey Sharybin [Wed, 26 Jul 2017 14:29:43 +0000 (16:29 +0200)]
CLeanup: Use utility function in BKE

3 years agoDepsgraph: Add utility function to initialize evaluation context from scene and layer
Sergey Sharybin [Wed, 26 Jul 2017 14:27:15 +0000 (16:27 +0200)]
Depsgraph: Add utility function to initialize evaluation context from scene and layer

3 years agoCleanup, line wraps
Sergey Sharybin [Wed, 26 Jul 2017 14:21:43 +0000 (16:21 +0200)]
Cleanup, line wraps

3 years agoInitialize time for evaluation context when creating from bContext
Sergey Sharybin [Wed, 26 Jul 2017 14:20:51 +0000 (16:20 +0200)]
Initialize time for evaluation context when creating from bContext

3 years agoFix T52176: Bevel doesn't correctly work with default empty Vgroup.
Bastien Montagne [Wed, 26 Jul 2017 14:23:24 +0000 (16:23 +0200)]
Fix T52176: Bevel doesn't correctly work with default empty Vgroup.

`defvert_array_find_weight_safe()` was confusing 'invalid vgroup' and
'valid but totally empty vgroup' cases.

Note that this also affected at least ShrinkWrap and SimpleDeform
modifiers.

3 years agoPyAPI: Store PyInstances for ID's
Campbell Barton [Wed, 26 Jul 2017 13:49:20 +0000 (23:49 +1000)]
PyAPI: Store PyInstances for ID's

This means once an ID is created,
it will keep using the same PyObject instance.

This has some advantages:
- Avoids unnecessary re-creation of instances on UI poll / redraw.
- Accessing free'd ID's gives an exception instead of crashing.
  (long standing annoyance!, though this only applies to ID's
   and not yet other data that uses the ID's - vertices for eg).
- Allows using instance comparison (a little faster).

Note that the instances won't be kept between undo.

3 years agoPyAPI: Fix for instancing (Blender owns a reference)
Campbell Barton [Wed, 26 Jul 2017 13:05:00 +0000 (23:05 +1000)]
PyAPI: Fix for instancing (Blender owns a reference)

Also set newly created values to the instance pointer.

3 years agoManipulator: only check for highlight once
Campbell Barton [Wed, 26 Jul 2017 10:49:57 +0000 (20:49 +1000)]
Manipulator: only check for highlight once

Was doing 2x lookups which is OK for click-select
but this runs on mouse-move and can become slow.

May enable this again if highlighting logic changes.

Also scale hotspot by pixelsize.

3 years agoblenderplayer stub update
Campbell Barton [Wed, 26 Jul 2017 08:18:32 +0000 (18:18 +1000)]
blenderplayer stub update

3 years agoCleanup: typedef enums
Campbell Barton [Wed, 26 Jul 2017 08:00:26 +0000 (18:00 +1000)]
Cleanup: typedef enums

Manipulator enum types are easy to confuse, use typedefs.

3 years agoManipulator: refactor/fix selection logic
Campbell Barton [Tue, 25 Jul 2017 22:12:46 +0000 (08:12 +1000)]
Manipulator: refactor/fix selection logic

- Cleanup array access, move into functions.
- Store allocated size to avoid realloc's on every add/remove.
- Make select editable from Python.
- Rename select callback to select_refresh
  (collided with select boolean).
- Call select_refresh when de-selecting as well as selection.

3 years agoFaceMaps: add select flag
Campbell Barton [Tue, 25 Jul 2017 19:21:38 +0000 (05:21 +1000)]
FaceMaps: add select flag

For use by manipulators since they don't have their own persistent data
in the blend file.

3 years agoEevee: Fix post process with Ugly color.
Clément Foucault [Tue, 25 Jul 2017 20:07:15 +0000 (22:07 +0200)]
Eevee: Fix post process with Ugly color.

This was cause by some post process not always sampling the highest mipmap.
But if there is no need for mipmapping (i.e. no SSR) these levels will be undefined.
So forcing all Post FX shader to sample level 0 fix this.