blender-staging.git
3 years agoCleanup: style/spelling
Campbell Barton [Thu, 31 Mar 2016 23:02:59 +0000 (10:02 +1100)]
Cleanup: style/spelling

3 years agoGeneric check for string being a Py keyword
Campbell Barton [Thu, 31 Mar 2016 22:43:11 +0000 (09:43 +1100)]
Generic check for string being a Py keyword

Driver code used incomplete list of Py keywords

3 years agoUse STRPREFIX macro for testing property name
Campbell Barton [Thu, 31 Mar 2016 22:24:50 +0000 (09:24 +1100)]
Use STRPREFIX macro for testing property name

3 years agoFix T48012: Knife Project crash
Campbell Barton [Thu, 31 Mar 2016 19:22:30 +0000 (06:22 +1100)]
Fix T48012: Knife Project crash

3 years agoFix NULL check before free
Campbell Barton [Thu, 31 Mar 2016 18:42:15 +0000 (05:42 +1100)]
Fix NULL check before free

3 years agoCycles: Fix wrong initialization order of mesh flags and object transform
Sergey Sharybin [Thu, 31 Mar 2016 15:54:03 +0000 (17:54 +0200)]
Cycles: Fix wrong initialization order of mesh flags and object transform

3 years agoCycles: Fix too many objects being considered an instance
Sergey Sharybin [Thu, 31 Mar 2016 15:46:22 +0000 (17:46 +0200)]
Cycles: Fix too many objects being considered an instance

3 years agoCycles: Fix compilation on Win32 after bitscan commit
Sergey Sharybin [Thu, 31 Mar 2016 14:46:59 +0000 (16:46 +0200)]
Cycles: Fix compilation on Win32 after bitscan commit

Need to revisit utility headers a bit more carefully and perhaps
move such utilities outside of simd-related headers.

3 years agoFix memory leak when assigning driver
Julian Eisel [Thu, 31 Mar 2016 14:41:50 +0000 (16:41 +0200)]
Fix memory leak when assigning driver

Also added NULL-checks for RNA paths, though they might be a bit paranoid.

3 years agoFix memory leak when calling new driver eyedropper
Julian Eisel [Thu, 31 Mar 2016 14:18:04 +0000 (16:18 +0200)]
Fix memory leak when calling new driver eyedropper

Would return OPERATOR_RUNNING_MODAL for non-modal operator.

3 years agoRemove the obsolete windows launcher
Martijn Berger [Thu, 31 Mar 2016 12:07:57 +0000 (14:07 +0200)]
Remove the obsolete windows launcher

3 years agoCMAKE disable building the windows launcher, fix type in delayloading of debug dll
Martijn Berger [Thu, 31 Mar 2016 12:05:38 +0000 (14:05 +0200)]
CMAKE disable building the windows launcher, fix type in delayloading of debug dll

3 years agoCycles: Name cleanup and some comments in BVH code
Sergey Sharybin [Mon, 22 Feb 2016 15:33:42 +0000 (16:33 +0100)]
Cycles: Name cleanup and some comments in BVH code

3 years agoCMAKE / msvc openmp, delay loading of openmp dll so we can set environment
Martijn Berger [Thu, 31 Mar 2016 11:45:33 +0000 (13:45 +0200)]
CMAKE / msvc openmp, delay loading of openmp dll so we can set environment
variable before it is loaded

3 years agoCycles: Add easy to use spin lock primitive
Sergey Sharybin [Mon, 22 Feb 2016 15:43:48 +0000 (16:43 +0100)]
Cycles: Add easy to use spin lock primitive

Currently unused, but will be handy for an upcoming changes.

It'll also be nice to be able to do scoped_lock() for both
Mutex and Spin, but currently it's not really easy to do,
need some changes in typedefs and such, will happen as a
separate commit.

3 years agoCycles: Expose array's capacity via getter function
Sergey Sharybin [Mon, 22 Feb 2016 15:40:32 +0000 (16:40 +0100)]
Cycles: Expose array's capacity via getter function

This way it's possible to query capacity of an array, which then
could be used for some smart re-allocation and reserve policies.

3 years agoCycles: Avoid per-split memory allocation for the new references list
Sergey Sharybin [Sun, 21 Feb 2016 15:46:16 +0000 (16:46 +0100)]
Cycles: Avoid per-split memory allocation for the new references list

3 years agoCycles: Pass BVH builder by const reference to spatial splitters
Sergey Sharybin [Sun, 21 Feb 2016 15:36:57 +0000 (16:36 +0100)]
Cycles: Pass BVH builder by const reference to spatial splitters

3 years agoCycles: Only sort indices when finding a best dimension to split
Sergey Sharybin [Mon, 22 Feb 2016 15:25:33 +0000 (16:25 +0100)]
Cycles: Only sort indices when finding a best dimension to split

This reduces amount of data being moved back and forth, which should
have positive effect on the performance.

3 years agoCycles: Wrap spatial split storage into own structure
Sergey Sharybin [Sun, 21 Feb 2016 14:39:02 +0000 (15:39 +0100)]
Cycles: Wrap spatial split storage into own structure

This has following advantages:

- Localizes all the run-time storage into a single structure,
  which could easily be extended further.

- Storage could be created per-thread, so once builder is
  threaded we wouldn't have any conflicts between threads.

- Global nature of the storage avoids memory re-allocation
  on the runtime, keeping builder as fast as possible.

Currently it's just API changes, which don't affect user at all.

3 years agoCycles: Use stack storage for temporary data on leaf creation
Sergey Sharybin [Sun, 21 Feb 2016 14:22:48 +0000 (15:22 +0100)]
Cycles: Use stack storage for temporary data on leaf creation

Uses new StackAllocator from util_stack_allocator. Some tweaks to the stack
storage size are possible, read notes in the code about this.

At this point we might want to rename allocator files to util_allocator_foo.c,
so the stay nicely grouped in the folder.

3 years agoCycles: Add STL allocator which uses stack memory
Sergey Sharybin [Wed, 30 Mar 2016 08:54:35 +0000 (10:54 +0200)]
Cycles: Add STL allocator which uses stack memory

At this point we might want to rename allocator files to
util_allocator_foo.c so the stay nicely grouped in the folder.

3 years agoCycles: Move non-vectorized bitscan() to util
Sergey Sharybin [Sun, 21 Feb 2016 14:13:09 +0000 (15:13 +0100)]
Cycles: Move non-vectorized bitscan() to util

This way we can use bitscan() from both vectorized and non-vectorized
code, which applies to both kernel and host code.

3 years agoCycles: Aligned vector was not covered by guarded stat
Sergey Sharybin [Wed, 30 Mar 2016 08:46:56 +0000 (10:46 +0200)]
Cycles: Aligned vector was not covered by guarded stat

This was making stats printed by the logging being wrong: they did not
include such memory as BVH storage.

3 years agocmake fix full debug builds on msvc
Martijn Berger [Thu, 31 Mar 2016 06:12:41 +0000 (08:12 +0200)]
cmake fix full debug builds on msvc

3 years agoFix T47985: VSE GL-render scene strip hangs
Campbell Barton [Thu, 31 Mar 2016 04:35:47 +0000 (15:35 +1100)]
Fix T47985: VSE GL-render scene strip hangs

Regression in d5f1b9c22,
threading deadlock rendering a scene from the OpenGL preview.

3 years agoUsual ui messages fixes/tweaks.
Bastien Montagne [Wed, 30 Mar 2016 21:39:54 +0000 (23:39 +0200)]
Usual ui messages fixes/tweaks.

3 years agolibquery foreach looper: in recursive case, do not bother with NULL id pointers!
Bastien Montagne [Wed, 30 Mar 2016 19:36:09 +0000 (21:36 +0200)]
libquery foreach looper: in recursive case, do not bother with NULL id pointers!

3 years agoFix T47983: Particles - Emit from Verts emits double on one vert.
Bastien Montagne [Wed, 30 Mar 2016 18:59:07 +0000 (20:59 +0200)]
Fix T47983: Particles - Emit from Verts emits double on one vert.

When non-random, particle distribution used a small start offset (to avoid
zero-weight faces), which is fine with "continuous" entities like faces, but not
for discrete ones like vertices - in that case it was generating some undesired
"jump" over a few verts in case step was small enough
(i.e. total number of verts/particles was big enough).

3 years agoUse Ctrl-Shift-RMB for to enable 'Fill Region'
Campbell Barton [Wed, 30 Mar 2016 17:30:33 +0000 (04:30 +1100)]
Use Ctrl-Shift-RMB for to enable 'Fill Region'

3 years agoShortest Path Select: option to select all paths between 2 elements
Campbell Barton [Wed, 30 Mar 2016 17:21:02 +0000 (04:21 +1100)]
Shortest Path Select: option to select all paths between 2 elements

This option selects all paths between source/destination which are no longer than the path found.

Handy for selecting meshes with a grid-topology.

3 years agoPartly fix (unreported) particles not updating correctly when changing settings.
Bastien Montagne [Wed, 30 Mar 2016 15:10:54 +0000 (17:10 +0200)]
Partly fix (unreported) particles not updating correctly when changing settings.

Point-cached particles (those using simulations) would not update at all outside of
first frame, due to PSYS_RECALC_RESET flag being ingnored in `system_step()`...

For some mysterious reasons, udate is still non-fully functional outside of startframe
(e.g. changing face distribution between random and jittered), but at least when choosing
'Vertices' you get particles from verts and not faces!

3 years agoParticles: Fix broken grid distribution in some case from own recent rB201d3938622.
Bastien Montagne [Wed, 30 Mar 2016 14:54:13 +0000 (16:54 +0200)]
Particles: Fix broken grid distribution in some case from own recent rB201d3938622.

3 years agoCycles: Resumable render implementation for Cycles
Sergey Sharybin [Wed, 30 Mar 2016 13:55:12 +0000 (15:55 +0200)]
Cycles: Resumable render implementation for Cycles

This feature is also known by the name Samples Offset, which allows
artists to render animation with given amount of samples N, but then
render more samples, starting from N and ending with M (where M > N)
and merge renders together as if they rendered exactly M samples.

Surely such effect could be achieved by changing Seed variable, but
that has possible issues with correlation artifacts and requiring to
manually deal with per render layer samples and such.

While we can't support all possible renderfarm-related features in
Cycles it's nice to support really commonly used stuff.

Here's a command how to run Blender with the new feature enabled:

  blender -- --cycles-resumable-num-chunks 24 --cycles-resumable-current-chunk 2

This command will divide samples range in 24 parts and render
range #2 (chunk number is 1-based).

This feature might be changed a bit after we'll do some tests here
in the studio with it.

3 years agoFix T47940: Custom bone shapes, select error w/ Open NVidia drivers
Campbell Barton [Wed, 30 Mar 2016 13:55:48 +0000 (00:55 +1100)]
Fix T47940: Custom bone shapes, select error w/ Open NVidia drivers

Latest nouveau drivers have a bug here, use occlusion queries.

3 years agoCMake cleanup target_link_libraries_decoupled
Martijn Berger [Wed, 30 Mar 2016 13:15:07 +0000 (15:15 +0200)]
CMake cleanup target_link_libraries_decoupled

3 years agoFix T46623: OSX bpy.app.binary_path_python incorrect
Campbell Barton [Wed, 30 Mar 2016 11:44:44 +0000 (22:44 +1100)]
Fix T46623: OSX bpy.app.binary_path_python incorrect

CMake's PYTHON_EXECUTABLE wasn't set.

3 years agoFix T47993: noise_vector ignores random seed
Campbell Barton [Wed, 30 Mar 2016 09:37:54 +0000 (20:37 +1100)]
Fix T47993: noise_vector ignores random seed

Replace hard coded values with offsets derived from the random seed.

3 years agoFix T48000: Eyedropper sample-merged ignored at first
Campbell Barton [Wed, 30 Mar 2016 06:28:01 +0000 (17:28 +1100)]
Fix T48000: Eyedropper sample-merged ignored at first

3 years agoFix transform center2d for 2d views
Campbell Barton [Tue, 29 Mar 2016 20:15:33 +0000 (07:15 +1100)]
Fix transform center2d for 2d views

While this didn't show up as a bug, the center2d was being calculated with a zero aspect,
causing TransInfo.center2d to be NAN.

3 years agoFix T47814: VSE Scene 'Use Sequence' fails
Campbell Barton [Tue, 29 Mar 2016 19:59:36 +0000 (06:59 +1100)]
Fix T47814: VSE Scene 'Use Sequence' fails

Conflict with flags between depsgraph and sequencer caused error.
Now pass state of sequencer parents to avoid recursion.

3 years agoFix T47961: Wipe effects should have 2 inputs
Campbell Barton [Tue, 29 Mar 2016 19:33:35 +0000 (06:33 +1100)]
Fix T47961: Wipe effects should have 2 inputs

3 years agoFix T47967: Select next active fails in some cases
Campbell Barton [Tue, 29 Mar 2016 17:56:18 +0000 (04:56 +1100)]
Fix T47967: Select next active fails in some cases

For cases when there are multiple matches,
find the closest match (with increasingly fuzzy tests) instead of failing.

3 years agoBuildbot: Attempt to work-around unsupported clang on OSX machine
Sergey Sharybin [Tue, 29 Mar 2016 17:46:10 +0000 (19:46 +0200)]
Buildbot: Attempt to work-around unsupported clang on OSX machine

Ideally this would need to be fixed by nvcc itself. but they didn't
do that for a long time.

3 years agoFix error in ghash/gset_ensure_p_ex
Campbell Barton [Tue, 29 Mar 2016 16:00:26 +0000 (03:00 +1100)]
Fix error in ghash/gset_ensure_p_ex

The key is needed in the case the ghash resizes.
Caused regression T47984.

3 years agoFix T47902: Particle grid not using modifier stack, Take II.
Bastien Montagne [Tue, 29 Mar 2016 15:45:56 +0000 (17:45 +0200)]
Fix T47902: Particle grid not using modifier stack, Take II.

Now only fix correct handling of use_modifier_stack for grid distribution,
fixing it globally breaks all existing edited hair systems. :/

3 years agoRevert "Fix T47902: Particle grid not using modifier stack."
Bastien Montagne [Tue, 29 Mar 2016 15:33:08 +0000 (17:33 +0200)]
Revert "Fix T47902: Particle grid not using modifier stack."

This reverts commit 2bd3acf7cd27c0c3ee77b10d56b91c3b03226d39.

Commit is valid in theory - but in practice, it means nearly all edited hair systems
would need to be re-created from scratch... Not nice, so better revert and note in code
that particle distribution is ugly and does not respect 'use modifier stack' option in most cases.

3 years agoGPencil New Stroke Smoothing: Don't perform smoothing on pressure values
Joshua Leung [Tue, 29 Mar 2016 14:21:33 +0000 (03:21 +1300)]
GPencil New Stroke Smoothing: Don't perform smoothing on pressure values

As noted by Antonio and Daniel, performing smoothing on the pressure values
for new strokes doesn't work that great. From an artist POV, it is apparently
"very strange that line thickness shrink suddenly after drawing it".

3 years agoDriver Mapping Types: Added temporary icons to break up the two types of mapping...
Joshua Leung [Tue, 29 Mar 2016 14:18:01 +0000 (03:18 +1300)]
Driver Mapping Types: Added temporary icons to break up the two types of mapping behaviours (modal vs manual)

3 years agoRMB Menu: Add icons for delineating each cluster of options in this menu
Joshua Leung [Tue, 29 Mar 2016 14:14:52 +0000 (03:14 +1300)]
RMB Menu: Add icons for delineating each cluster of options in this menu

From T33052 by Harley Acheson (harley)

3 years agoDrivers Setup: Expose all mapping types for creating drivers
Joshua Leung [Tue, 29 Mar 2016 14:01:27 +0000 (03:01 +1300)]
Drivers Setup: Expose all mapping types for creating drivers

* This includes the "manually create" modes, which correspond to the previous behaviour
  for setting up drivers. This is necessary when the current screen layout is not
  well suited to having multiple property editors open (e.g. small screen or heavily
  subdivided screen).

* Only the modes relevant for the current property type (i.e. array vs single)
  will be shown

* The "Add Driver" entries in the RMB context menu have now been replaced by a
  submenu which will list all the available mapping types.

* NOTE: The code for the ANIM_OT_button_driver_add() operator is perhaps a bit hairy.
  However, it currently allows us to have the desired behaviour. It can always get
  cleaned up later though.

3 years agoAdd license text for OCIO configuration
Sergey Sharybin [Tue, 29 Mar 2016 10:48:50 +0000 (12:48 +0200)]
Add license text for OCIO configuration

3 years agoFix T47987: Blender Cycles standalone does not properly read UV coordinates from XML
Sergey Sharybin [Tue, 29 Mar 2016 08:02:17 +0000 (10:02 +0200)]
Fix T47987: Blender Cycles standalone does not properly read UV coordinates from XML

3 years agoFix T47986: OBJ Import fails w/ imagepath encoding
Campbell Barton [Tue, 29 Mar 2016 07:22:35 +0000 (18:22 +1100)]
Fix T47986: OBJ Import fails w/ imagepath encoding

3 years agoFix T47958: Crash in Walk or Fly Navigation in Camera mode when invoking from non...
Bastien Montagne [Mon, 28 Mar 2016 16:17:45 +0000 (18:17 +0200)]
Fix T47958: Crash in Walk or Fly Navigation in Camera mode when invoking from non-3DView region

3 years agoT47532: Pop-ups drop fast mouse clicks
Julian Eisel [Mon, 28 Mar 2016 14:42:13 +0000 (16:42 +0200)]
T47532: Pop-ups drop fast mouse clicks

Caused by rBc24be7ec6e5.

Before rBc24be7ec6e5,  wm_handlers_do always called handlers a second time with event value KM_PRESS in case of a double click. After it, this was only the case for non-LEFTMOUSE events.
Since ui_popup_handler (almost) always returned WM_UI_HANDLER_BREAK, the second handler iteration with KM_PRESS wouldn't run. This fix just makes sure we return WM_UI_HANDLER_CONTINUE for double click events instead (causing second iteration to run).

3 years agoFix T47969: Select Random always uses same seed
Campbell Barton [Mon, 28 Mar 2016 14:20:45 +0000 (01:20 +1100)]
Fix T47969: Select Random always uses same seed

Increment the seed on each use,
otherwise calling again selects the same order, unless you manually adjust the seed.

3 years agoFix T47972: Blender crash showing particle system.
Bastien Montagne [Mon, 28 Mar 2016 13:37:08 +0000 (15:37 +0200)]
Fix T47972: Blender crash showing particle system.

Do same as with faces - if no orcodata is available, fill orco with current location...

3 years agoFix T47973: Render stamp ignores font alpha
Campbell Barton [Mon, 28 Mar 2016 13:25:07 +0000 (00:25 +1100)]
Fix T47973: Render stamp ignores font alpha

3 years agoBLF: alpha support for drawing to buffer
Campbell Barton [Mon, 28 Mar 2016 13:23:37 +0000 (00:23 +1100)]
BLF: alpha support for drawing to buffer

3 years agoFix T47931: Missed world shader update when having object dependency
Sergey Sharybin [Mon, 28 Mar 2016 08:45:29 +0000 (10:45 +0200)]
Fix T47931: Missed world shader update when having object dependency

3 years agoFix T47898: Error adding mask node with "Add Mask Node" operator
Sergey Sharybin [Mon, 28 Mar 2016 08:07:06 +0000 (10:07 +0200)]
Fix T47898: Error adding mask node with "Add Mask Node" operator

This operator is intended to be used by drag-n-drop, no user invocation
is expected to happen here. Use Add->Search to quickly add nodes instead.

3 years agoCleanup: Unused variable
Sergey Sharybin [Mon, 28 Mar 2016 07:36:41 +0000 (09:36 +0200)]
Cleanup: Unused variable

3 years agoGraph Editor UI: Experimental Tweak - Use tabs for properties region, to make it...
Joshua Leung [Mon, 28 Mar 2016 01:45:54 +0000 (14:45 +1300)]
Graph Editor UI: Experimental Tweak - Use tabs for properties region, to make it easier to navigate

3 years agoGPencil: Note that clicking outside the active area also exits draw mode
Joshua Leung [Sun, 27 Mar 2016 14:42:31 +0000 (03:42 +1300)]
GPencil: Note that clicking outside the active area also exits draw mode

3 years agoFix T47959: make tip for 'individual origins' pivot point in UV editor more accurate.
Bastien Montagne [Sun, 27 Mar 2016 15:00:28 +0000 (17:00 +0200)]
Fix T47959: make tip for 'individual origins' pivot point in UV editor more accurate.

Based on D1877 from Philipp Oeser (lichtwerk), thanks.

3 years agoGPencil: Remove the old UserPrefs-based On/Off Stroke Smoothing method
Joshua Leung [Sun, 27 Mar 2016 14:39:26 +0000 (03:39 +1300)]
GPencil: Remove the old UserPrefs-based On/Off Stroke Smoothing method

This never really worked that well, and often ended up being far too strong
to be of practical use. The new options do similar things, but with greater
control, so removing this old method now.

3 years agoGPencil: Smooth and Subdivision variable/setting naming
Joshua Leung [Sun, 27 Mar 2016 14:20:15 +0000 (03:20 +1300)]
GPencil: Smooth and Subdivision variable/setting naming

On second thought, these might be better names for these... I'm still not 100%
happy with these, but they will do for now.

(Best results currently seem to be with smooth 0.7, and subdivision steps 1 or 2)

3 years agoGPencil: Removed the restriction of not subdividing strokes further if it exceeds...
Joshua Leung [Sun, 27 Mar 2016 14:05:01 +0000 (03:05 +1300)]
GPencil: Removed the restriction of not subdividing strokes further if it exceeds GP_STROKE_BUFFER_MAX

Assuming that this subdivision + smoothing mostly only happens at the end of a stroke
anyway, enforcing this max-points limit in some cases was resulting in strokes that
weren't quite getting subdivided properly as the others.

3 years agoGPencil: Code Cleanup - Simplify and clarify the code for subdividing a stroke
Joshua Leung [Sun, 27 Mar 2016 13:56:43 +0000 (02:56 +1300)]
GPencil: Code Cleanup - Simplify and clarify the code for subdividing a stroke

3 years agoGPencil: Restore ability for Smooth brush to affect pressure values of strokes
Joshua Leung [Sun, 27 Mar 2016 13:55:59 +0000 (02:55 +1300)]
GPencil: Restore ability for Smooth brush to affect pressure values of strokes

3 years agoCode Cleanup - Style tweaks
Joshua Leung [Sun, 27 Mar 2016 13:33:14 +0000 (02:33 +1300)]
Code Cleanup - Style tweaks

3 years agoImprove grease pencil stroke quality
Antonio Vazquez [Sun, 27 Mar 2016 10:24:14 +0000 (23:24 +1300)]
Improve grease pencil stroke quality

Improve the quality of current grease pencil strokes adding a new dynamic smooth and subdivision. The level of smooth and subdivide can be adjusted using UI parameters. These options are disabled by default in order to keep the grease pencil stroke compatible with any existing add-on.

Both parameters are defined at layer level.

Reviewers: aligorith

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

3 years agoMore tooltip tweaks
Joshua Leung [Sun, 27 Mar 2016 05:25:26 +0000 (18:25 +1300)]
More tooltip tweaks

The "UI_OT_eyedropper_id" operator only actually works in the 3D view,
so change the tooltip to match that

3 years agoFix T45075: "Error, region type 2 missing in - name:"File", id:5"
Julian Eisel [Sun, 27 Mar 2016 11:36:12 +0000 (13:36 +0200)]
Fix T45075: "Error, region type 2 missing in - name:"File", id:5"

Unexpectedly found out what was going wrong here. If a file was saved with a filebrowser open, we searched for the channel region in the wrong list (see 'ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;').

Minor annoyance is that I had to move the loookup to the 2.77.1 version patch now.

3 years agoFix T47697: Smoke simulation doesn't work in viewport
Sergey Sharybin [Sun, 27 Mar 2016 11:19:09 +0000 (13:19 +0200)]
Fix T47697: Smoke simulation doesn't work in viewport

Seems to be a division by zero error.

Should be safe for an upcoming 'a' release.

3 years agoFix changing view in default video editing layout broken
Julian Eisel [Sun, 27 Mar 2016 11:17:10 +0000 (13:17 +0200)]
Fix changing view in default video editing layout broken

Own mistake in 802bb422671
Apparently we only store one preview region for all views, didn't know that (makes sense though).

3 years agoFix T47962: It's possible to set a Sound strip as a modifier Mask.
Bastien Montagne [Sun, 27 Mar 2016 11:01:58 +0000 (13:01 +0200)]
Fix T47962: It's possible to set a Sound strip as a modifier Mask.

3 years agoCleanup: Silence some compiler warnings
Sergey Sharybin [Sun, 27 Mar 2016 10:33:34 +0000 (12:33 +0200)]
Cleanup: Silence some compiler warnings

3 years agoDriver Eyedropper: Auto detection/correction magic for rotation properties
Joshua Leung [Sun, 27 Mar 2016 04:57:27 +0000 (17:57 +1300)]
Driver Eyedropper: Auto detection/correction magic for rotation properties

When linking a rotation property to a non-rotation property (going in either
direction - i.e. rot -> normal, normal -> rot), the driver expression will
now be set so that the new drivers behave as expected (i.e. you get the values
you see, instead of "weird" values that seem several orders of magnitude off).

This may not be that great for everyone (i.e. the rare users out there who
actually like to look at their rotations in radians), but they usually know
what they're doing anyway, so this will be easy to correct.

3 years agoDrivers: Add a "none" mode for use when adding drivers
Joshua Leung [Sun, 27 Mar 2016 04:02:53 +0000 (17:02 +1300)]
Drivers: Add a "none" mode for use when adding drivers

Although it isn't currently exposed, this allows for the old behaviour,
where an "empty" driver was added (without any target assigned yet).
For this reason, it's also referred to as the "Manual" mode.

There are also some attempts at improving the tooltips + names for the
other modes (again, not shown anywhere yet)

3 years agoCode Cleanup - Split out the property-button-finding code so that it can be used...
Joshua Leung [Sat, 26 Mar 2016 12:22:19 +0000 (01:22 +1300)]
Code Cleanup - Split out the property-button-finding code so that it can be used for other eyedroppers

3 years agoFix crash opening some .blend files after recent fix for hidden preview regions.
Brecht Van Lommel [Sun, 27 Mar 2016 00:55:51 +0000 (01:55 +0100)]
Fix crash opening some .blend files after recent fix for hidden preview regions.

3 years agoFix T47758: rigidbody bug with constraint breaking and disable collisions.
Brecht Van Lommel [Sun, 27 Mar 2016 00:25:25 +0000 (01:25 +0100)]
Fix T47758: rigidbody bug with constraint breaking and disable collisions.

This is a regression in Bullet, reverted the problematic change for now with
a custom patch.

3 years agoFix T47668: Cycles OpenCL glass not rendering correctly on AMD.
Brecht Van Lommel [Sat, 26 Mar 2016 22:44:30 +0000 (23:44 +0100)]
Fix T47668: Cycles OpenCL glass not rendering correctly on AMD.

Work around what appears to be a compiler bug.

3 years agoFix T47939, take II: Check clang package version, not llvm-devel one.
Bastien Montagne [Sat, 26 Mar 2016 20:07:04 +0000 (21:07 +0100)]
Fix T47939, take II: Check clang package version, not llvm-devel one.

Looks like some distro still provide llvm-3.4-devel, while no more clang-3.4.
Since clang depends on llvm of same version, check clang only should ensure
us we also have matvhing llvm... *sigh*

3 years agoFix T47935: Hair particles; The display percentage parameter breaks after a render...
Bastien Montagne [Sat, 26 Mar 2016 16:41:56 +0000 (17:41 +0100)]
Fix T47935: Hair particles; The display percentage parameter breaks after a render is done.

Follow same logic in `psys_render_restore` as in `psys_render_set` - if hair and
display percentage is not 100%, we have to recompute particles...

With regular 'emitter' particles just hiding some is fine (though using random here
will not give a precise proportion...).

3 years agoFix T47951: UserId problem on reload.
Bastien Montagne [Sat, 26 Mar 2016 15:22:17 +0000 (16:22 +0100)]
Fix T47951: UserId problem on reload.

readfile.c would increment object usercount in three places, where it should not.
Remember kids: Objects are **only** refcounted by Scene's bases, and Object->proxy!

3 years agoFix own regression in rBc08924bf94f2dff - foreach ID looper was broken due to missing...
Bastien Montagne [Sat, 26 Mar 2016 15:07:57 +0000 (16:07 +0100)]
Fix own regression in rBc08924bf94f2dff - foreach ID looper was broken due to missing initialization.

Quite unbelievable this could slip in... tons of shame on me :/

3 years agoRevert "Fix T47896: Scripted Expression string length limit is too short for some...
Joshua Leung [Sat, 26 Mar 2016 10:00:20 +0000 (23:00 +1300)]
Revert "Fix T47896: Scripted Expression string length limit is too short for some autogenerated expressions"

This reverts commit 322f86d6b330ebeb1da5c1f527714745dc901460.

3 years agoDriver Variable Name Validation: Added missing check for zero-length (i.e. "blank...
Joshua Leung [Sat, 26 Mar 2016 05:01:02 +0000 (18:01 +1300)]
Driver Variable Name Validation: Added missing check for zero-length (i.e. "blank") names

3 years agoDriver Setup Workflow Improvement: Property Eyedropper
Joshua Leung [Sat, 26 Mar 2016 04:55:42 +0000 (17:55 +1300)]
Driver Setup Workflow Improvement: Property Eyedropper

This commit brings some long requested improvements to the workflow for setting up
drivers, which should make it easier and faster to set up new drivers in a more
interactive fashion.

The new workflow is as follows:
1) Hover over the property (e.g. "Lamp Energy" or "Y Location") or properties ("Rotation")
   you wish to add drivers to. We'll refer to this as the "destination"
2) Ctrl-D to active the new "Add Drivers" eyedropper
3) Click on the property you want to use as the source/target. The property under the
   mouse will be used to drive the property you invoked Ctrl-D on.

For example, to drive the X, Y, and Z location of the Cube using the Y Location of the Lamp,
hover over any of the X/Y/Z location buttons, hit Ctrl-D, then click on the Y-Location
button of the Lamp object. Drivers will be added to the X, Y, and Z Location properties
of the Cube; each driver will have a single variable, which uses the Y-Location Transform
Channel of the Lamp.

Tips:
- Transform properties will automatically create "Transform Channel" driver variables.
  Everything else will use "Single Property" ones

- Due to the way that Blender's UI Context works, you'll need two Properties Panel instances
  open (and to have pinned one of the two to show the properties for the unselected
  object). It's slightly clunky, but necessary for implementing a workflow like this,
  as the UI cannot be manipulated while using eyedroppers to pick data.

- The eyedropper operator implemented here actually has three modes of operation.
  1) The "1-N" (one to many) mode is the default used for Ctrl-D, and "Add Driver to All"
     in the RMB Menu. This is the behaviour described above.
  2) There's also a "1-1" (one to one) mode that is used for the "Add Single Driver" in the
     RMB Menu.
  3) Finally, there's the "N-N" mode (many to many), which isn't currently exposed.
     The point of this is to allow mapping XYZ to XYZ elementwise (i.e. direct copying)
     which is useful for things like locations, rotations, scaling, and colours.

Implementation Notes:
- The bulk of the driver adding logic is in editors/animation/drivers.c, where most of
  the Driver UI operators and tools are defined

- The property eyedropper code is in interface_eyedropper.c along with all the other
  eyedroppers (even though they don't share much actual code in common). However, this
  turns out to be necessary, as we can't get access to many of the low-level buttons API's
  otherwise.

Todo:
- It may be necessary to restore a way to access the old behaviour (i.e. "manual setup")
  in case it is not practical to immediately pick a property.

- Other things to investigate here include extra hotkeys (e.g. Ctrl-Shift-D for Add Single?),
  and to expose the N-N mode.

- Other things we could try include interactively applying scaling factors, picking
  multiple targets (e.g. for location difference and rotation difference drivers),
  and/or other ways of using these property picking methods.

3 years agoDrivers Workflow: Change hotkey for "Add Drivers" to Ctrl-D (it was previously just...
Joshua Leung [Sat, 26 Mar 2016 04:28:02 +0000 (17:28 +1300)]
Drivers Workflow: Change hotkey for "Add Drivers" to Ctrl-D  (it was previously just DKEY)

Just using DKEY for this was resulting in too many drivers being accidentally created
by users drawing using Grease Pencil. This change also works better with the following
workflow changes to the driver setup process.

3 years agoFix T47939: Install Deps OSL 1.7.1 and clang-3.5
Bastien Montagne [Fri, 25 Mar 2016 23:31:41 +0000 (00:31 +0100)]
Fix T47939: Install Deps OSL 1.7.1 and clang-3.5

Until we officially support llvm3.5 or more, only allow for 3.4 llvm packages,
and build own stuff otherwise...

3 years agoFix T47902: Particle grid not using modifier stack.
Bastien Montagne [Fri, 25 Mar 2016 21:46:19 +0000 (22:46 +0100)]
Fix T47902: Particle grid not using modifier stack.

Disclaimer: this is tentative fix, seems to be working but you never know with particles.
If issue arise, we'll just revert this commit and hide 'use modifier stack' option
for grid distribution instead.

This commit also try to make choice of which dm to use during distribution more generic
(deduplication of code), again hopping not to break anything. :P

3 years agoFix sequencer view in video editing layout containing hidden preview region
Julian Eisel [Fri, 25 Mar 2016 23:03:43 +0000 (00:03 +0100)]
Fix sequencer view in video editing layout containing hidden preview region

Steps to reproduce were:
* Open default video editing layout
* Drag down or click '+' icon in upper right corner of sequencer view
* A preview region appears, even though the view type is not set to sequencer-preview split mode

Another bug that has been there since ages :/ Reported by @Blendify via IRC, thanks!

3 years agoFix Cycles debug panel, being shown in BI as well.
Thomas Dinges [Fri, 25 Mar 2016 18:59:18 +0000 (19:59 +0100)]
Fix Cycles debug panel, being shown in BI as well.

3 years agoCycles: Add an option to build single kernel only which fits current CPU
Sergey Sharybin [Fri, 25 Mar 2016 15:09:05 +0000 (16:09 +0100)]
Cycles: Add an option to build single kernel only which fits current CPU

This seems quite useful for the development, so you don't need to wait
all the kernels to be re-compiled when working on a new feature, which
speeds up re-iteration.

Marked as an advanced option, so if it doesn't work so well in practice
it's safe to revert anyway.

3 years agoCycles: Cleanup, indent nested preprocessor directives
Sergey Sharybin [Fri, 12 Feb 2016 17:33:43 +0000 (18:33 +0100)]
Cycles: Cleanup, indent nested preprocessor directives

Quite straightforward, main trick is happening in path_source_replace_includes().

Reviewers: brecht, dingto, lukasstockner97, juicyfruit

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

3 years agoCycles: Use dedicated BVH for subsurface ray casting
Sergey Sharybin [Thu, 25 Feb 2016 14:12:11 +0000 (15:12 +0100)]
Cycles: Use dedicated BVH for subsurface ray casting

This commit makes it so casting subsurface rays will totally ignore all
the BVH nodes and primitives which do not belong to a current object,
making it much simpler traversal code and reduces number of intersection
tests.

Reviewers: brecht, juicyfruit, dingto, lukasstockner97

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