Commit Graph

63743 Commits

Author SHA1 Message Date
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
Sergey Sharybin
ab4307aa08 Fix T47869: OpenColorIO Error with unicode path to config file under Windows 2016-03-23 15:09:36 +01:00
Joshua Leung
6a4967ca6e AnimEditors: Fuzzy/Multi-Word Name Filtering
Thanks to D1080 by @rockets, I've now been able to easily implement the
ability to type multiple word snippets/partial words into the text filter
field (in the Animation Editors), and have it filter the channels which
contain just some of those parts (instead of having to match everything).

For example, the following search strings will now work:
* "loc rot" or "lo ro" will now filter all location and rotation FCurves
* "col loc" will filter all location and color FCurves
* "scale" will also work as before to filter all scale FCurves

But, the following will not work:
* "lc rt" will NOT filter all location and rotation, as the fuzzy search only
  breaks down the search string based on whitespace placement

By default, this is not enabled when using name filtering (i.e. magnifying glass is checked,
and some filtering text is specified). Instead, you need to enable the "AZ" toggle beside
the name field. This fuzzy matching is not enabled by default as it could end up being
quite a bit slower on really heavy scenes. (There are probably some optimisation
opportunities, but that's only a future option if someone really needs it)
2016-03-24 02:45:14 +13:00
Sergey Sharybin
21f31e6054 Fix T47856: Cycles problem when running from multi-byte path
This is a mix of regression and old unsupported configuration.

Regression was caused by some checks added on Blender side which was
checking whether python function returned error or not. This made it
impossible to enable Cycles when running from a file path which can't
be encoded with MBCS codepage.

Non-regression issue was that it wasn't possible to use pre-compiled
CUDA kernels when running from a path with non-ascii multi-byte
characters.

This commit fixes regression and CUDA parts, but OSL still can't be
used from a non-ascii location because it uses non-widechar API to
work with file paths by the looks of it. Not sure we can solve this
just from our side by using some codepage trick (UTF-16?) since even
oslc fails to compile shader when there are non-ascii characters in
the path.
2016-03-23 13:58:31 +01:00
Campbell Barton
6e31f4f090 Fix T47893: BGE crashes w/ generated mesh data 2016-03-23 23:40:30 +11:00
Joshua Leung
74399e0a18 Radial Operator: Tweak number of digits displayed for the different property types
* As requested by venomgfx, rotations now only display to 2 decimal places (more than
  enough for rotations in degrees)
* Also, made it so that the "factor" types now show 3 dp (previously only 2, which isn't
  really enough when dealing with values from 0.0 - 1.0)
2016-03-24 01:00:13 +13:00
Joshua Leung
9815262444 Radial Control Operator: Always show the property name + value on the header
The radial control operator is commonly used for setting sculpt brush Size and Strength
settings. However, when using it, it can often be difficult to remember which hotkey
is responsible for which setting, meaning that you can often accidentally modify the
wrong setting without knowing it (or even what new value you've set it to).

This commit makes it so that the property name and the current value are always shown
on the header. Previously this info was only shown when the doing numeric input.
(It also fixes a bug where the numeric input print would hang around even after it
wasn't being used).
2016-03-24 01:00:12 +13:00
Campbell Barton
0f501a73ab Fix T47890: Vertex mask w/ subsurf select fails
Regression in GL refactor
2016-03-23 21:02:44 +11:00
Campbell Barton
80a7efdc1d UI: multi word filtering in search menu
D1080 by @rockets, with own improvements to tests
2016-03-23 18:51:29 +11:00
Campbell Barton
b0a7e77700 Cleanup: style 2016-03-23 04:47:16 +11:00
Campbell Barton
c31c53983e Cleanup: style (80-width) 2016-03-23 04:25:08 +11:00
Campbell Barton
46dd04faed Fix incorrect strncat use 2016-03-23 03:54:04 +11:00
Campbell Barton
0f1d711681 Fix T47830: Multi-edit w/ ui-list wont highlight
Regression from 4d6b892.
2016-03-23 03:37:23 +11:00
Campbell Barton
84d8b35d6c Weight Paint: support accumulate for blur brush
This re-applies smoothing based on the previous update.

Can smooth more but harder to get such even distribution.
2016-03-23 01:25:56 +11:00
Lukas Tönne
e2181c2ef2 Fix for crash of point density textures due to undefined point_data on loading. 2016-03-22 15:07:56 +01:00
Campbell Barton
220a7a4fb1 Weight Paint: blur now smooths connected weights
Previously it would average all points under the brush, giving an off feedback loop that often depended on the
direction of the brush stroke, giving not-very-useful smearing effect.

Now blend brush smooths between connected edges.
2016-03-22 22:37:30 +11:00
Campbell Barton
29acdb4889 Mesh API: add BKE_mesh_vert_edge_vert_map_create
Handy when you need to reference connected verts directly.
2016-03-22 22:07:45 +11:00
Campbell Barton
3b5dec4afc Fix T47882: startup camera not upright 2016-03-22 17:22:41 +11:00
Campbell Barton
121e273bb3 Cleanup: reduce scope for versioning vars 2016-03-22 17:20:17 +11:00
Bassam Kurdali
0f63ce61c5 Fix add mesh template 2016-03-22 14:26:48 +11:00
Antony Riakiotakis
4acd218c02 GPU compositing:
Minor optimization: Store the uniform interface of shaders instead of
re-querying every frame.
2016-03-21 22:43:03 +01:00
Philipp Oeser
2c3985d9e6 Fix T47842: UV sculpt brush widgets are available when not in uv sculpt mode.
rB5b3af3dd made the poll function here slightly too laxist.

To be backported to 2.77 should we make an 'a' release.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D1861
2016-03-21 15:45:16 +01:00
Alexander Romanov
da2dfaad1a Mirror influence of environment texture in Blender viewport
This patch implements Mirror influence for environment textures. Approach matches the one from BI.
{F281871}
See the video https://youtu.be/BskgCv6dcIE
Example: {F281876}
Alexander (Blend4Web Team)

Reviewers: campbellbarton, merwin, brecht

Reviewed By: brecht

Subscribers: TwisterGE, blueprintrandom, youle, Evgeny_Rodygin, AlexKowel, yurikovelenov

Differential Revision: https://developer.blender.org/D1786
2016-03-21 14:36:33 +03:00
Campbell Barton
112300a982 Fix T47862: VSE hard cut fails
Regression caused by changing how video length is calculated,
however similar problems could be caused by strip length changing on-disk.
2016-03-21 19:40:41 +11:00
Campbell Barton
f4840e878b Fix T47848: Fix regression in sequencer GL render
Own changes in 2.77 broke off-screen render with scene render size doesn't match output.
2016-03-21 16:36:20 +11:00
Campbell Barton
fb5c6333f9 GPU: avoid redundant logic for non-spot lamps 2016-03-21 16:06:04 +11:00
Campbell Barton
72bf5d13e6 Fix for non spot lamps calculating spot values
Logical error in D1378, also incorrectly used lamp type as a flag.
2016-03-21 16:02:37 +11:00
Campbell Barton
a0a66e0418 Correct strange icon scaling in preferences 2016-03-21 15:34:34 +11:00
Campbell Barton
8238f5b33b Fix T47868: Check Box shape doesn't scale 2016-03-21 15:16:43 +11:00
Campbell Barton
2683dd8b93 Docs: add missing bmesh.ops descriptions 2016-03-20 19:40:03 +11:00