Commit Graph

63822 Commits

Author SHA1 Message Date
Sergey Sharybin
7bce3dd3ad 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.
2016-03-27 13:21:33 +02:00
Julian Eisel
9c2704c169 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).
2016-03-27 13:20:30 +02:00
Bastien Montagne
ce71e2e789 Fix T47962: It's possible to set a Sound strip as a modifier Mask. 2016-03-27 13:02:43 +02:00
Sergey Sharybin
fb9315ce2a Cleanup: Silence some compiler warnings 2016-03-27 12:36:49 +02:00
Joshua Leung
e12650bdd1 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.
2016-03-27 18:05:35 +13:00
Joshua Leung
4b279815d5 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)
2016-03-27 18:05:35 +13:00
Joshua Leung
6caad32c12 Code Cleanup - Split out the property-button-finding code so that it can be used for other eyedroppers 2016-03-27 18:05:34 +13:00
52f3f6ffa4 Fix crash opening some .blend files after recent fix for hidden preview regions. 2016-03-27 01:55:51 +01:00
e14324daa7 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.
2016-03-27 01:32:28 +01:00
273740006e Fix T47668: Cycles OpenCL glass not rendering correctly on AMD.
Work around what appears to be a compiler bug.
2016-03-26 23:45:18 +01:00
Bastien Montagne
9317f9c055 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*
2016-03-26 21:07:04 +01:00
Bastien Montagne
8fcf774167 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...).
2016-03-26 17:41:56 +01:00
Bastien Montagne
112f431c3b 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!
2016-03-26 16:22:17 +01:00
Bastien Montagne
6483c3c280 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 :/
2016-03-26 16:11:12 +01:00
Joshua Leung
6a0c187653 Revert "Fix T47896: Scripted Expression string length limit is too short for some autogenerated expressions"
This reverts commit 322f86d6b330ebeb1da5c1f527714745dc901460.
2016-03-26 23:00:20 +13:00
Joshua Leung
5759e335c3 Driver Variable Name Validation: Added missing check for zero-length (i.e. "blank") names 2016-03-26 18:02:02 +13:00
Joshua Leung
0512e20ae9 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.
2016-03-26 18:02:02 +13:00
Joshua Leung
ee9898e0fa 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.
2016-03-26 18:02:01 +13:00
Bastien Montagne
eac770a33a 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...
2016-03-26 00:31:41 +01:00
Bastien Montagne
2bd3acf7cd 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
2016-03-26 00:18:00 +01:00
Julian Eisel
802bb42267 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!
2016-03-26 00:09:34 +01:00
Thomas Dinges
7607d064d6 Fix Cycles debug panel, being shown in BI as well. 2016-03-25 19:59:18 +01:00
Sergey Sharybin
e4a265f058 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.
2016-03-25 16:09:05 +01:00
Sergey Sharybin
700722f686 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
2016-03-25 13:55:42 +01:00
Sergey Sharybin
0e47e0cc9e 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
2016-03-25 13:42:13 +01:00
Bastien Montagne
712a257994 Fix T47928: Crashing save corruption with dynamic paint drip effector groups.
Dynapaint's `foreachIDLink` was mnot handling effector_weights->group pointer...
2016-03-25 13:17:04 +01:00
Julian Eisel
4509559c13 Fix modal bevel OP immediately stopping when called using enter key from search menu
Steps to reproduce were:
* Go to edit mode, select geometry
* Spacebar -> search for bevel OP
* Activate *using enter key*
* Immediately stops when releasing enter key

To fix we simply make sure the initial release event is ignored. For mouse events that wasn't an issue since activating an element is done on key release in menus. An alternative fix would be to do the same for enter key, but that's more risky. Also, checking event value is highly recommended anyway.
2016-03-25 12:31:46 +01:00
Bastien Montagne
7219988258 Revert "Fix T47263: numpad4/6 rotates around worl Z axis and not view Y axis."
This reverts commit fe0ca82b232dcab29030c4a20b8bd1b033d1d346.

This is a design issue, needs more thinking, for now just revert back to old behavior.
2016-03-25 12:09:59 +01:00
Sergey Sharybin
a0a7d823e0 CMake: Disable Cycles OSL for the light configuration
While it was indirectly disabled already, it's handy to use the config
as template and enable certain features. In case of Cycles enabling it
would also enable OSL which is not very expected.
2016-03-25 11:27:08 +01:00
Campbell Barton
7f3da8f5c9 UI: Presets for scene units
This adds simple preset menu for unit scale scene property.

D1799 by @alm
2016-03-25 05:03:25 +11:00
Bastien Montagne
9dc5e1dbc2 Make IDPreview handling code use new recursive libquery looper. 2016-03-24 16:10:39 +01:00
Bastien Montagne
c08924bf94 Rework library_query foreach looper - add optional recursivity.
This commit:
* Fixes bad handling of 'stop iteration' (by adding a status flag, so that we can actually
  stop in helper functions too, and jumping to a finalize label instead of raw return, to
  allow propper clean up).
* Adds optional recursion into 'ID tree' - callback can also decide to exclude current id_pp
  from recursion. Note that this implies 'readonly', modifying IDs while recursing is not
  something we want to support!
* Changes callback signature/expected behavior: return behavior is now handled through flags,
  and 'parent' ID of id_pp is also passed (since it may not always be root id anymore).

Reviewers: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D1869
2016-03-24 16:10:39 +01:00
Sergey Sharybin
60cf62ff4b Cycles: Minor optimization of equirectangular projection
Don't calculate sine twice, store this in a variable instead.

Perhaps compilers can optimize this out, but helping them a but wouldn't hurt.
2016-03-24 15:01:39 +01:00
Campbell Barton
8249046b82 UI: search operator's by word prefix
Would match middle of words which wasn't very useful in most cases.
2016-03-24 23:30:51 +11:00
Campbell Barton
70fcecc1f7 Fix BLI_strncasestr use with a single character 2016-03-24 23:30:51 +11:00
Lukas Tönne
bdae647670 Color sources for point density textures based on mesh vertices
This patch adds support for coloring point density textures based on several mesh vertex attributes.

* Vertex Color: Use a vertex color layer for coloring the point density texture
* Vertex Weight: Use a weights from a vertex group as intensity values. (for Blender Render engine the additional color band is used)
* Vertex Normals: Use object-space vertex normals as RGB values.

The vertex color source enum is stored separately from the particle color source, to avoid invalid values when switching.

Note that vertex colors are technically "corner colors" (MLoop), so each vertex can have as many colors as faces it is part of.
For the purpose of point density the mloop colors are simply averaged, which is physically plausible because corners can be viewed
as multiple points in the same location.
2016-03-24 12:07:03 +01:00
Joshua Leung
8e9a55f1e5 Fix some typos and incorrect tooltips/descriptions 2016-03-24 23:31:06 +13:00
Campbell Barton
f209529c3d Fix T47910: Knife project fails
Regression in fix for T43896, using screen-space precision here is very problematic,
using lower precision here works for both reports.
2016-03-24 18:27:39 +11:00
Campbell Barton
7e65b02fb6 Cleanup: use prefix for return args 2016-03-24 18:05:10 +11:00
Campbell Barton
2a9e3c2bdb Fix incorrect arg type 2016-03-24 17:56:30 +11:00
Campbell Barton
75849b099f Fix T47838: Walk gravity fails w/ intersecting objects
Regression in 3ad0344, fix from @mano-wii.

More comprehensive fix can be done after 2.77a.
2016-03-24 17:52:31 +11:00
Joshua Leung
17d0c10096 Driver Keyframing: Some tweaks to make inserting keyframes on Driver F-Curves easier
Now, when trying to insert a keyframe on a driven property (using IKEY, or with
autokeying enabled), the keyframes will get created on the Driver's F-Curve
(instead of creating a new FCurve that goes into the active action, but will never
do anything). Furthermore, the x-value of the new keyframe will be the current
result of the driver expression.

Why/Motivations:
This way, it becomes easier to create corrective drivers, as you can position all
the targets the driver depends on, then adjust the driver value until it does what
you need, and then you keyframe that value to bake it into the Driver F-Curve
(in effect, "training" the computer how to behave in that case).

Usage Notes:
* In practice, that particular workflow is still quite clunky to achieve, due to some
  quirks of how the driver system and the UI widgets interact. Specifically, you'll
  need to disable/mute the driver before trying to edit the setting (to prevent the
  driver from immediately resetting the value - before even autokey fires!). However,
  if you're using the Graph Editor to preview/monitor/manage the keying process, you'll
  then want to re-enable the driver before changing the targets, so that you can see
  how much of a change you'll want to be applying!

* The warning about editing driver values may need to be disabled or selectively
  knocked out. I had it disabled while testing this functionality, but it's actually
  harmless in its current state (if just a bit annoying).
2016-03-24 19:34:52 +13:00
Campbell Barton
0a3792a65b Fix T47900: VSE adjustment crashes on blank frame
Regression, should have been included in previous fix.
2016-03-24 17:13:25 +11:00
Joshua Leung
d2244b59d8 Fix dodgy indentation 2016-03-24 15:20:56 +13:00
Joshua Leung
c4956faf99 Drivers UI: Added name validation/linting for Driver Variables
When attempting to change a driver variable name to an "invalid" name,
an indicator will now be shown beside the offending variable name.
Clicking on this icon will show a popup which provides more information
about why the variable name cannot be used.

Reasons that it knows about are:
1) Starts with number
2) Has a dot
3) Has a space
4) Starts with or contains a special character
5) Starts with an underscore (Python does allow this, but it's bad practice,
   and makes checking security of drivers harder)
6) Is a reserved Python keyword
2016-03-24 15:15:04 +13:00
Joshua Leung
322f86d6b3 Fix T47896: Scripted Expression string length limit is too short for some autogenerated expressions
While most scripted expressions are quite short (e.g. "var" or "frame + 1"),
those that are autogenerated by scripts (to take into account a wide range of factors)
may require a bit more headroom to operate in.

By doubling the maximum length here, we now make it possible to combine up to 38
3-letter variables in some linear combination (with all factors expressed to 4 dp).
That should be more than enough for anyone or anything for quite a while!

Unfortunately, this does increase memory consumption for drivers across the board.
2016-03-24 13:02:22 +13:00
Sergey Sharybin
c1095c7a9f Revert "Fix T47869: OpenColorIO Error with unicode path to config file under Windows"
White the config itself could be loaded this way, lookup tables can not. Additionally,
that's not really clear how to solve the issue with search path which is multi-byte
only in the API.

Reverting for further investigation.

This reverts commit ab4307aa0868f2d8389cc0dd500eff38909b08f1.
2016-03-23 19:28:16 +01:00
Campbell Barton
376eb77fd7 Fix T47900: VSE adjustment crashes on blank frame 2016-03-24 05:23:37 +11:00
Sergey Sharybin
2103e2112c Fix T47870: Missing viewport update when material output is inside of the group 2016-03-23 15:42:38 +01:00
Joshua Leung
c87e65542c Fix T47833: View-aligned GPencil strokes move in crazyspace when grabbed
These fixes "seem" to do the right thing now...
2016-03-24 03:32:28 +13:00