5 years agoFix T48250: suppress CMake ranlib warnings to avoid issue with Qt Creator
Tianwei Shen [Sat, 23 Apr 2016 13:44:26 +0000 (15:44 +0200)]
Fix T48250: suppress CMake ranlib warnings to avoid issue with Qt Creator

Reviewed By: campbellbarton, brecht

Differential Revision:

5 years agoFix weird wording in driver operator tooltip
Julian Eisel [Sat, 23 Apr 2016 12:49:30 +0000 (14:49 +0200)]
Fix weird wording in driver operator tooltip

5 years agoPyAPI: support writing compressed library blends
Campbell Barton [Sat, 23 Apr 2016 12:08:42 +0000 (22:08 +1000)]
PyAPI: support writing compressed library blends

5 years agoGHOST/X11: print description of error event
Campbell Barton [Sat, 23 Apr 2016 08:38:43 +0000 (18:38 +1000)]
GHOST/X11: print description of error event

5 years agoFix T48173: event.mouse_prev_x/y unreliable.
Brecht Van Lommel [Sun, 17 Apr 2016 21:14:17 +0000 (23:14 +0200)]
Fix T48173: event.mouse_prev_x/y unreliable.

5 years agoFix T48216: Cycles light fallof node gives black emission in baking.
Brecht Van Lommel [Sat, 23 Apr 2016 00:58:37 +0000 (02:58 +0200)]
Fix T48216: Cycles light fallof node gives black emission in baking.

5 years agoFix T48223: 3D View not refresh after changing Blending mode in NLA.
Bastien Montagne [Fri, 22 Apr 2016 14:48:57 +0000 (16:48 +0200)]
Fix T48223: 3D View not refresh after changing Blending mode in NLA.

This fixes a lot of things in NLA RNA update handling (which basically did not update anything previously).

There are more update issues with this editor though...

5 years agoFix (unreported) crash when listing available fmodifier types.
Bastien Montagne [Fri, 22 Apr 2016 13:23:59 +0000 (15:23 +0200)]
Fix (unreported) crash when listing available fmodifier types.

Some types are defined but not yet implemented...

5 years agoFix T48230: Home key when only one keyframe makes the DopeSheet acting weird.
Bastien Montagne [Fri, 22 Apr 2016 12:38:46 +0000 (14:38 +0200)]
Fix T48230: Home key when only one keyframe makes the DopeSheet acting weird.

Simply apply same minimal range as in graph editor when we get a zero one from keyframes.

5 years agoFix curve snap to surface w/ offset & taper
Campbell Barton [Fri, 22 Apr 2016 11:28:39 +0000 (21:28 +1000)]
Fix curve snap to surface w/ offset & taper

Adjusting the pressure wasn't re-adjusting the offset.

5 years agoBLF: use float vector passing color args
Campbell Barton [Fri, 22 Apr 2016 10:02:03 +0000 (20:02 +1000)]
BLF: use float vector passing color args

5 years agoFix T48236: OpenVDB smoke cache glitches out with smokeless flames.
Kévin Dietrich [Fri, 22 Apr 2016 09:46:02 +0000 (11:46 +0200)]
Fix T48236: OpenVDB smoke cache glitches out with smokeless flames.

Issue was that before writing to disk grids are clipped against the
density field's tree to optimize for memory/disk space, which in the
case of simulations with no density field results in all grids having
empty trees.

For now avoid clipping against empty grids, but perhaps in the future it
can be interresting to have some UI parameters to let the user choose
the grid used for clipping.

5 years agoSilence some annoying warnings when doing full build with strict flags
Sergey Sharybin [Fri, 22 Apr 2016 08:59:15 +0000 (10:59 +0200)]
Silence some annoying warnings when doing full build with strict flags

This mainly touches extern libraries and few debug-only places in intern.

Some summary:

- External libraries are not strict at all about missing declarations,
  so we can rather safely remove such warning together with other strict

- Bullet has some static functions which are not used.
  Those were commented out.

- Carve now has some unused debug-only functions commented out as well.
  While we're on the way of getting rid of Carve, it makes sense to make
  things a bit cleaner for the time being.

- In LZMA we have some parts disabled which gives some set but unused
  variables which is rather correct.

- Elbeem had quite some variables set and never used because their usage
  is inside of debug-only code which is commented out.

Note about patching upstream libraries: surely one might say that we
have to make local patchset against this, but own experience says it
only gives extra work trying to merge such tweaks to a new upstream
version and usually it's just faster to re-apply such fixes again after
bundling new upstream library.

5 years agoCycles: Reduce verbosity of logging
Sergey Sharybin [Fri, 22 Apr 2016 08:55:26 +0000 (10:55 +0200)]
Cycles: Reduce verbosity of logging

Mainly makes logging less verbose when doing progressive sampling in viewport.

Such kind of verbosity is not really possible to be filtered out with `grep`
so let's reshuffle few lines of code.

5 years agoNDof device: Check for socket exists before connecting to spnavd
Sergey Sharybin [Fri, 22 Apr 2016 08:14:30 +0000 (10:14 +0200)]
NDof device: Check for socket exists before connecting to spnavd

This allows us to get rid of annoying and misleading error printed to the console
about being unable to connect to something.

5 years agoTransform Snap: optionally cache the BVH tree
Campbell Barton [Fri, 22 Apr 2016 06:11:47 +0000 (16:11 +1000)]
Transform Snap: optionally cache the BVH tree

Use the SnapObjectContext to store the bvh tree for reuse.

5 years agoTransform Snap: initial snap context refactor
Campbell Barton [Thu, 21 Apr 2016 01:29:32 +0000 (11:29 +1000)]
Transform Snap: initial snap context refactor

This introduces a snap-context that can be re-used for casting rays into the scene
(by operators such as walk-mode, ruler and transform code).

This can be used to cache data between calls too.

5 years agoCleanup: warnings (double promote, string format)
Campbell Barton [Fri, 22 Apr 2016 02:18:57 +0000 (12:18 +1000)]
Cleanup: warnings (double promote, string format)

5 years agoFix T48212: Typos in bpy enum props examples.
Bastien Montagne [Thu, 21 Apr 2016 10:16:32 +0000 (12:16 +0200)]
Fix T48212: Typos in bpy enum props examples.

5 years agoUpdate for ArchLinux.
Ejner Fergo [Thu, 21 Apr 2016 08:44:46 +0000 (10:44 +0200)]
Update for ArchLinux.

The script is updated for ArchLinux, since all dependencies are included in Arch's official repositories.

I've made a few changes, such as enabling OCIO and OSD without requiring locally installed lib-path, and a fix to ''get_package_version_ARCH()' so it ignores package epoch (as in the case of ffmpeg).

I intend to look at OpenVDB next.

Reviewers: mont29

Differential Revision:

5 years agoCleanup: math lib use w/ walk mode
Campbell Barton [Thu, 21 Apr 2016 02:43:35 +0000 (12:43 +1000)]
Cleanup: math lib use w/ walk mode

5 years agoMesh Deform Modifier - leave bind settings visible after binding
Ines Almeida [Wed, 20 Apr 2016 18:51:59 +0000 (19:51 +0100)]
Mesh Deform Modifier - leave bind settings visible after binding

The 'precision' and 'dynamic' settings for binding are now always visible.
The settings that can not be edited after binding are disabled (not inactive).

I find it useful to see with what settings a mesh was bound, in case
the file is not mine or if I simply lost track of it.

5 years agoCycles: Multi-thread object transform update
Sergey Sharybin [Wed, 20 Apr 2016 16:12:26 +0000 (18:12 +0200)]
Cycles: Multi-thread object transform update

Simple idea, use threads when dealing with "Copying Transformations to device"
scene update step. Only do it if there's enough objects in the scene.

Hopefully only brings less synchronization time and doesn't break anything.

From tests on my desktop this brings down transform update time from 58sec to
11sec on victor_cpu.blend scene from out benchmark.

5 years agoCycles: Stop rendering when bad_alloc happens
Sergey Sharybin [Wed, 20 Apr 2016 14:15:11 +0000 (16:15 +0200)]
Cycles: Stop rendering when bad_alloc happens

This is an attempt to gracefully handle out-of-memory events
and stop rendering with an error message instead of a crash.

It uses bad_alloc exception, and usually i'm not really fond
of exceptions, but for such limited use for errors from which
we can't recover it should be fine.

Ideally we'll need to stop full Cycles Session, so viewport
render and persistent images frees all the memory, but that
we can support later, since it'll mainly related on telling
Blender what to do.

General rules are:

- Use as less exception handles as possible, try to find a
  most geenric pace where to handle those.

  For example, ccl::Session.

- Threads needs own handling, exception trap from one thread
  will not catch exceptions from other threads.

  That's why BVH build needs own thing.

Reviewers: brecht, juicyfruit, dingto, lukasstockner97

Differential Revision:

5 years agoCycles: Throw bad_alloc exception when custom allocators failed to allocate memory
Sergey Sharybin [Wed, 20 Apr 2016 13:49:52 +0000 (15:49 +0200)]
Cycles: Throw bad_alloc exception when custom allocators failed to allocate memory

This mimics behavior of default allocators in STL and allows all the routines
to catch out-of-memory exceptions and hopefully recover from that situation/

5 years agoCycles: Use threads to sort reference arrays when searching for split
Sergey Sharybin [Mon, 18 Apr 2016 14:15:05 +0000 (16:15 +0200)]
Cycles: Use threads to sort reference arrays when searching for split

This commits implements threaded sorting of references when looking for
object spatial split. It mainly useful when doing initial binning, which
happens from main thread.

Gives nice speedup of BVH build for Bunny.blend: 36sec vs. 55sec for
the Rabbit mesh BVH build.

On more complex scenes the speedup is probably minimal, but still nice
to have more instant rendering for simplier scenes.

Some further tests with production scenes would be interesting.

Reviewers: juicyfruit, dingto, lukasstockner97, brecht

Reviewed By: brecht

Differential Revision:

5 years agoCycles: Avoid reference copy
Sergey Sharybin [Wed, 20 Apr 2016 13:03:39 +0000 (15:03 +0200)]
Cycles: Avoid reference copy

5 years agoFix T46903: Missing Render Border Menu items
Sergey Sharybin [Wed, 20 Apr 2016 13:02:03 +0000 (15:02 +0200)]
Fix T46903: Missing Render Border Menu items

While other borders are more like a toggle, it is an intrinsic behavior
of those operators. Render Border is intrinsicly split into two operators
and trying to expose it as a toggle will end up with rather confusing
situation when shortcut listed in the menu changes depending on the

5 years agoFix T47794: Point density sometime seems stretched when rendered on GPU
Sergey Sharybin [Wed, 20 Apr 2016 12:42:04 +0000 (14:42 +0200)]
Fix T47794: Point density sometime seems stretched when rendered on GPU

5 years agoFix T48162: GPU render gives wrong results in certain volume setups
Sergey Sharybin [Wed, 20 Apr 2016 11:49:54 +0000 (13:49 +0200)]
Fix T48162: GPU render gives wrong results in certain volume setups

ideally this part of code should be de-duplicated across __VOLUME_INTERSECT_ALL
and regular code.

5 years agoFix T47812: GPU renders have warmer colors than CPU renders
Sergey Sharybin [Wed, 20 Apr 2016 10:29:08 +0000 (12:29 +0200)]
Fix T47812: GPU renders have warmer colors than CPU renders

Seems was a mistake in f2c54df, volume attributes are not supposed to
have repeated texture type.

5 years agoUpdate bundled openjpeg from 1.5.0 to 1.5.2
Sergey Sharybin [Wed, 20 Apr 2016 08:36:58 +0000 (10:36 +0200)]
Update bundled openjpeg from 1.5.0 to 1.5.2

Solves following issues:

- Quite reasonable amount of paranoid warnings were solved by an upstream
- Upstream seems to have all fixes needed for FreeBSD and OSX already
- Brings all fixes and such from upstream

5 years agoFix T47891: Edges throw shadow in edit mode
Campbell Barton [Wed, 20 Apr 2016 02:39:15 +0000 (12:39 +1000)]
Fix T47891: Edges throw shadow in edit mode

5 years agoFix T48086: Smart UV Project fails w/ small faces
Campbell Barton [Wed, 20 Apr 2016 01:49:14 +0000 (11:49 +1000)]
Fix T48086: Smart UV Project fails w/ small faces

Epsilon for small faces was too large.

Also suppress exception when all faces area are below the epsilon.

5 years agoMinor optimization for scanfill
Campbell Barton [Tue, 19 Apr 2016 23:52:27 +0000 (09:52 +1000)]
Minor optimization for scanfill

Replace angle with with cosine calculation.

5 years agoFix image-space mask-transform crash w/o an image
Campbell Barton [Tue, 19 Apr 2016 23:37:51 +0000 (09:37 +1000)]
Fix image-space mask-transform crash w/o an image

5 years agoCleanup: rename cos-angle to match BLI_math
Campbell Barton [Tue, 19 Apr 2016 21:45:16 +0000 (07:45 +1000)]
Cleanup: rename cos-angle to match BLI_math

5 years agoMinor optimization for limited-dissolve
Campbell Barton [Tue, 19 Apr 2016 09:13:39 +0000 (19:13 +1000)]
Minor optimization for limited-dissolve

Use dot product instead of angle.

5 years agoFix crash in rB37493fb9f - there is no guaranty CTX_wm_foo() will return a valid...
Bastien Montagne [Tue, 19 Apr 2016 20:51:46 +0000 (22:51 +0200)]
Fix crash in rB37493fb9f - there is no guaranty CTX_wm_foo() will return a valid pointer!

5 years agoCleanup unused header includes from previous commit.
Bastien Montagne [Tue, 19 Apr 2016 15:53:46 +0000 (17:53 +0200)]
Cleanup unused header includes from previous commit.

5 years agoCleanup: move operators & related code of files & append/link to relevant dedicated...
Bastien Montagne [Tue, 19 Apr 2016 15:08:31 +0000 (17:08 +0200)]
Cleanup: move operators & related code of files & append/link to relevant dedicated source files.

This commit adds a new `wm_files_link.c` which contains everything related to append/link code,
moved from `wm_operators.c` (rather small currently, but will expand quite a bit with future reload & asset works).

It also moves all load/save .bland files (and related userpref/startup stuff) from `wm_operators.c`
to `wm_files.c` (some helper funcs were already there).

This also makes `wm_operators.c` significantly lighter.

5 years agoFix T48198: Missing plus sign to open the tool shelf in text editor
Julian Eisel [Tue, 19 Apr 2016 19:01:55 +0000 (21:01 +0200)]
Fix T48198: Missing plus sign to open the tool shelf in text editor

Did not happen when using screen layout saved in default startup.blend

5 years agoToggle to standard cursor when opening menus/popups
Julian Eisel [Tue, 19 Apr 2016 14:04:44 +0000 (16:04 +0200)]
Toggle to standard cursor when opening menus/popups

Cursor is now set to standard arrow-cursor when opening menu, and reset to previous one when closing it. Previously it just stayed as it was before, e.g. the edit mode cross-cursor stayed active even if a menu was opened.

Fixes T48192.

5 years agoCycles: Improvements and fixes for the resumable render
Sergey Sharybin [Tue, 19 Apr 2016 10:54:29 +0000 (12:54 +0200)]
Cycles: Improvements and fixes for the resumable render

- Fix wrong current sample reported in the log
- Also includes fix for progressive refine log
- Explicitly print to the stdout that resumable render is enabled
- Print error message and abort when passing wrong values for the
  resumable render. Never waste someone's compute power for wrong

Fixes T48185: Cycles resumable num chunks breaks sample counter

5 years agoFix T48193: Incorrect keyframe_insert docs
Campbell Barton [Tue, 19 Apr 2016 08:25:56 +0000 (18:25 +1000)]
Fix T48193: Incorrect keyframe_insert docs

5 years agoMinor edits to last commit
Campbell Barton [Tue, 19 Apr 2016 03:07:01 +0000 (13:07 +1000)]
Minor edits to last commit

Avoid redundant tests

5 years agoFix T47998: Limited dissolve fails /w holes
Campbell Barton [Tue, 19 Apr 2016 02:11:51 +0000 (12:11 +1000)]
Fix T47998: Limited dissolve fails /w holes

Holes with flat surfaces could have their edges dissolved causing degenerate faces.
Now check that collapsing a vertices isn't creating self-overlapping faces.

5 years agoCleanup: pass event args as const
Campbell Barton [Sun, 17 Apr 2016 20:20:42 +0000 (06:20 +1000)]
Cleanup: pass event args as const

5 years agoCycles microdisplacement: add max subdivision setting
Mai Lavelle [Mon, 18 Apr 2016 20:35:49 +0000 (22:35 +0200)]
Cycles microdisplacement: add max subdivision setting

This is to prevent situations such as when the camera gets very close to a mesh
and causes it to be tessellated into an excessive amount of micropolygons. In
REYES this is known as the eye-splits problem.

Reviewed By: brecht

Differential Revision:

5 years agoCycles microdisplacement: fix handling of triangles in DiagSplit
Mai Lavelle [Mon, 18 Apr 2016 20:29:25 +0000 (22:29 +0200)]
Cycles microdisplacement: fix handling of triangles in DiagSplit

Theres still more room for improvement but this makes things useable.

Reviewed By: brecht

Differential Revision:

5 years agoFix: Make it easier to tell if Color Swatches are greyed out or not
Joshua Leung [Mon, 18 Apr 2016 12:42:59 +0000 (00:42 +1200)]
Fix: Make it easier to tell if Color Swatches are greyed out or not

This commit makes disabled/inactive color swatches look more obviously disabled
by halving their alpha values. It is necessary because the results of
ui_widget_color_disabled() (which is usually used when disabling widgets)
get overwritten by the color filling code here.

To avoid confusion, the checkerboard background (when the color genuinely has
alpha) will still only show in those cases. That is, when disabled, color swatches
won't show the checkerboard unless the color actually has an alpha component if it
wasn't disabled.

5 years agoFix T48186: Grease Pencil Smooth brush doesn't work properly - "erase" the stroke...
Joshua Leung [Mon, 18 Apr 2016 12:18:29 +0000 (00:18 +1200)]
Fix T48186: Grease Pencil Smooth brush doesn't work properly - "erase" the stroke thickness

As soon as you started trying to smooth a stroke, the thickness of the stroke
would quickly drop right down to near zero, if "affect pressure" was enabled.

This step got accidentally missed when restoring the affect pressure functionality to
the stroke smoothing brush code, following cleanups from the stroke quality patch.

5 years agoCycles microdisplacement: scene level render and preview dicing rates
Mai Lavelle [Sun, 17 Apr 2016 18:15:50 +0000 (20:15 +0200)]
Cycles microdisplacement: scene level render and preview dicing rates

This makes it easier to control overall dicing rate without having to tweak
every object. The preview rate makes viewport editing more interactive. The
default preview rate of 8 is roughly 64 times faster for some operations.

Reviewed By: brecht

Differential Revision:

5 years ago"View Frame" now works in the sequencer too
Joshua Leung [Sun, 17 Apr 2016 00:26:44 +0000 (12:26 +1200)]
"View Frame" now works in the sequencer too

5 years agoFix a few compiler warnings with OS X / clang.
Brecht Van Lommel [Sat, 16 Apr 2016 22:51:29 +0000 (00:51 +0200)]
Fix a few compiler warnings with OS X / clang.

5 years agoFix T48171: activating spacebar search menu over text button activates it or shows...
Brecht Van Lommel [Sat, 16 Apr 2016 22:22:42 +0000 (00:22 +0200)]
Fix T48171: activating spacebar search menu over text button activates it or shows tooltip.

5 years agoCycles: Refactor Image Texture limits.
Thomas Dinges [Sat, 16 Apr 2016 18:48:33 +0000 (20:48 +0200)]
Cycles: Refactor Image Texture limits.

Instead of treating Fermi GPU limits as default,
and overriding them for other devices,
we now nicely set them for each platform.

* Due to setting values for all platforms,
we don't have to offset the slot id for OpenCL anymore,
as the image manager wont add float images for OpenCL now.

* Bugfix: TEX_NUM_FLOAT_IMAGES was always 5, even for CPU,
so the code in svm_image.h clamped float textures with alpha on CPU after the 5th slot.

Reviewers: #cycles, brecht

Reviewed By: #cycles, brecht

Subscribers: brecht

Differential Revision:

5 years agoAnim Editors: "View Frame" Operator - Code Cleanups/Reshuffling + NLA/Timeline Support
Joshua Leung [Sat, 16 Apr 2016 15:44:10 +0000 (03:44 +1200)]
Anim Editors: "View Frame" Operator - Code Cleanups/Reshuffling + NLA/Timeline Support

* Reshuffled code for existing "View Frame" implementations, and removed leftover
  comment from some of the the copy-and-paste used to build it.
* Added support for this operator in the NLA and Timeline

5 years agoAssorted enum tweaks
Joshua Leung [Sat, 16 Apr 2016 15:28:45 +0000 (03:28 +1200)]
Assorted enum tweaks

* Knock out "Python" FModifier entry - It really hasn't been coded yet!
* Add icon for "Match Indices" driver eyedropper mode. It should help provide
  a bit more of a hint of what it does, but it also doesn't look quite as nice now.

5 years agoExperimental Drivers UI Tweak: Use icons for variable types
Joshua Leung [Sat, 16 Apr 2016 15:27:26 +0000 (03:27 +1200)]
Experimental Drivers UI Tweak: Use icons for variable types

This commit aims to streamline the driver variables layout a bit
* Each variable type now has an icon. (The loc diff and rot diff ones are placeholders,
  which could deserve something better/dedicated if we continue to use this)
* Instead of taking up an entire row, the variable type dropdown now only shows
  an icon, and is located before the variable name field.

Feedback wanted: Is this more/less confusing than it was?

5 years agoTweaks to Streamline Drivers UI - Don't use uiTemplateAnyID for properties where...
Joshua Leung [Sat, 16 Apr 2016 15:05:24 +0000 (03:05 +1200)]
Tweaks to Streamline Drivers UI - Don't use uiTemplateAnyID for properties where only objects can be used

5 years agoCycles: Insert util_texture.h in CMakeLists to make Cycles compile again after recent...
Thomas Beck [Sat, 16 Apr 2016 09:58:38 +0000 (11:58 +0200)]
Cycles: Insert util_texture.h in CMakeLists to make Cycles compile again after recent refactory.

5 years agoCleanup: Move texture definitions to util, to avoid bad level include.
Thomas Dinges [Fri, 15 Apr 2016 21:01:20 +0000 (23:01 +0200)]
Cleanup: Move texture definitions to util, to avoid bad level include.

5 years agoCurve draw fix w/ surface offset + only-first enabled
Campbell Barton [Fri, 15 Apr 2016 20:43:53 +0000 (06:43 +1000)]
Curve draw fix w/ surface offset + only-first enabled

In this case the initial offset needs to be applied to the rest of the stroke.

5 years agoFix T48157: 3D view's depth of field isn't displayed correctly with scene units scale.
Bastien Montagne [Fri, 15 Apr 2016 14:17:21 +0000 (16:17 +0200)]
Fix T48157: 3D view's depth of field isn't displayed correctly with scene units scale.

focus distance is given in BU, no need to scale it at all.

5 years agoFix T48139: Checker texture strange behavior in cycles
Sergey Sharybin [Fri, 15 Apr 2016 13:29:12 +0000 (15:29 +0200)]
Fix T48139: Checker texture strange behavior in cycles

Seems particular CUDA implementations has some precision issues,
which made integer coordinate (which was expected to always be
positive) to go negative.

5 years agoUI: copy to selected: add 'single'/'all' options to buttons' menu when relevant.
Bastien Montagne [Fri, 15 Apr 2016 13:17:18 +0000 (15:17 +0200)]
UI: copy to selected: add 'single'/'all' options to buttons' menu when relevant.

Same as reset or anim keyframe/driver operators... Inconsistency reported by Leon Cheung
through IRC, thanks.

5 years agoCode Cleanup: Fix up various odds and ends
Joshua Leung [Fri, 15 Apr 2016 10:08:13 +0000 (22:08 +1200)]
Code Cleanup: Fix up various odds and ends

5 years agoCode Cleanup: Remove unused define left over from earlier versions of this code
Joshua Leung [Fri, 15 Apr 2016 10:05:18 +0000 (22:05 +1200)]
Code Cleanup: Remove unused define left over from earlier versions of this code

5 years agoRemove a leftover from older code
Sergey Sharybin [Fri, 15 Apr 2016 13:06:08 +0000 (15:06 +0200)]
Remove a leftover from older code

5 years agoCycles: Optimization to spatial BVH build
Sergey Sharybin [Fri, 15 Apr 2016 12:27:23 +0000 (14:27 +0200)]
Cycles: Optimization to spatial BVH build

Simple fix: release lock earlier.

Reduces spatial split build time from 96 to 53sec on the Bunny.blend
(using studio Intel for benchmark).

NOTE: Timing difference is not that spectacular when comparing numbers
with builds before memory optimization, but even then it's about 20%
faster build.

5 years agoFix T48151: Brush texture overlay won't refresh automatically in UV editor when chang...
Bastien Montagne [Fri, 15 Apr 2016 11:13:00 +0000 (13:13 +0200)]
Fix T48151: Brush texture overlay won't refresh automatically in UV editor when changed in buttons window.

Simple solution is to get rid of this stupid `rna_TextureSlot_brush_update` func, and do what it was doing directly
in BR case of `rna_TextureSlot_update`. That way, all updates to brush texture will invalidate correctly the overlay.

Note that this double definition of texture pointer for brushes looks rather fishy, am really not convinced this helps
keeping things simple and clear at all (what happened here is that texture selector in image paint editor was using
'texture' member of brush itself, which was performing correct RNA update, while context-based brush texture selector
from buttons space was using 'texture' member of the TextureSlot struct, which had default texture update callback
which was not invalidating overlay).

5 years agoNew freehand curve drawing tool
Campbell Barton [Fri, 15 Apr 2016 08:10:05 +0000 (18:10 +1000)]
New freehand curve drawing tool

- Access with Shift-LMB or from the 'Create' toolbar tab.
- Uses curve fitting for bezier curves, with error and corner angle options.
- Optional tablet pressure to curve radius mapping.
- Depth can use the cursor or optionally draw onto the surface,
  for the entire stroke or using the stroke start.
- Stroke plane can optionally be perpendicular to, or aligned to the surface normal.
- Optional radius tapering and for start/end points.
- Supports operator redo and calling from Python.

5 years agoAdd lib for n-dimensional cubic curve fitting
Campbell Barton [Fri, 15 Apr 2016 08:02:17 +0000 (18:02 +1000)]
Add lib for n-dimensional cubic curve fitting

This will be used for calculating bezier curves from freehand drawing,
may be used for other areas too.

Original code from GraphicsGems, 1990 (FitCurve.c),
with updates from OpenToonz, under 3 clause BSD license.
with own minor modifications for integration with Blender:
- support adding extra custom-data.
- improved handle clamping.

5 years agoCycles: Support heat volume attribute
Sergey Sharybin [Fri, 15 Apr 2016 10:02:31 +0000 (12:02 +0200)]
Cycles: Support heat volume attribute

Similar to velocity, it was kind of supported by the mesh manager but
was missing a code in BlenderSession to get actual values.

In Cycles Heat is an attribute which goes from -1 to 1, where -1 is
the coldest ever temperature, 1 is the hottest ever one.

5 years agoCycles: Improve error print a bit
Sergey Sharybin [Fri, 15 Apr 2016 09:24:59 +0000 (11:24 +0200)]
Cycles: Improve error print a bit

5 years agoTests: Fix wrong hash after "no redundant zeroes" commit
Sergey Sharybin [Fri, 15 Apr 2016 08:37:20 +0000 (10:37 +0200)]
Tests: Fix wrong hash after "no redundant zeroes" commit

5 years agoDrivers Editing: Added "Copy/Paste" buttons beside "Add Variable" for copying all...
Joshua Leung [Fri, 15 Apr 2016 08:04:07 +0000 (20:04 +1200)]
Drivers Editing: Added "Copy/Paste" buttons beside "Add Variable" for copying all variables from one driver to another

This was a feature request from a few years back (IIRC from ZanQdo?) to make it
easier to reuse one set of driver variables across several different drivers.

Dev Notes:
* Finally it's done! All that trouble for two little buttons.
* Grr... cmake... grrr!

5 years agoNLA Copy/Paste Modifiers: Apply similar fixes as those done in Graph Editor
Joshua Leung [Sun, 10 Apr 2016 14:42:06 +0000 (02:42 +1200)]
NLA Copy/Paste Modifiers: Apply similar fixes as those done in Graph Editor

5 years agoFix T42148: Copying/Pasting FModifiers copies to all selected FCurves, not just activ...
Joshua Leung [Sun, 10 Apr 2016 14:39:10 +0000 (02:39 +1200)]
Fix T42148: Copying/Pasting FModifiers copies to all selected FCurves, not just active one

5 years agoFModifiers: Various tweaks for consistency + improved behaviour
Joshua Leung [Sat, 9 Apr 2016 06:05:22 +0000 (18:05 +1200)]
FModifiers: Various tweaks for consistency + improved behaviour

* Use an RNA enum callback for NLA FModifier types too
* Cleaned up tooltips for these operators in Graph and NLA editors
* Fix update notifiers after adding FModifiers in the Graph Editor

5 years agoFModifiers: "Add Modifiers" in Graph/NLA Editor buttons now uses a dropdown instead...
Joshua Leung [Sun, 3 Apr 2016 12:30:59 +0000 (00:30 +1200)]
FModifiers: "Add Modifiers" in Graph/NLA Editor buttons now uses a dropdown instead of a button

This brings the UI here more in line with the Constraints and Modifiers UI's.

* The tooltips/descriptions on the operators now need fixing, as we can no longer
  use custom tooltips when defining these buttons.
* The operators need to be fixed to only operate on the active data

5 years agoCode Cleanup: Add proper defines (with ANIM_* prefix) for animation-related copy...
Joshua Leung [Sat, 2 Apr 2016 12:18:23 +0000 (01:18 +1300)]
Code Cleanup: Add proper defines (with ANIM_* prefix) for animation-related copy-paste buffer free callbacks

5 years agoGraph Editor: Move "View" panel to be the last
Joshua Leung [Fri, 1 Apr 2016 05:42:26 +0000 (18:42 +1300)]
Graph Editor: Move "View" panel to be the last

This change means that when going from having no FCurves active to having
an active FCurve, the properties panels will not get stuck with only showing
the "View" tab, which is not that useful a lot of the time.

5 years agoCycles: Yet another fix for camera in volume
Sergey Sharybin [Thu, 14 Apr 2016 15:20:17 +0000 (17:20 +0200)]
Cycles: Yet another fix for camera in volume

Was an embarrassing glitch in original optimization policy,
the for-loops can't be de-duplicated here.

5 years agoCompositor: Fix image and render layer always extending edges
Sergey Sharybin [Thu, 14 Apr 2016 09:20:00 +0000 (11:20 +0200)]
Compositor: Fix image and render layer always extending edges

It was no more possible to translate two images, put one on top of
another in order to do things like mapping VR views.

5 years agoRemove redundant abs ray/line point functions
Campbell Barton [Thu, 14 Apr 2016 03:00:53 +0000 (13:00 +1000)]
Remove redundant abs ray/line point functions

5 years agoMath Lib: ray_point_factor_v3 functions
Campbell Barton [Thu, 14 Apr 2016 01:45:37 +0000 (11:45 +1000)]
Math Lib: ray_point_factor_v3 functions

Gives a bit better precision than creating a line in some cases,
use for ED_view3d_win_to_3d.

5 years agoCycles: Resolve ridiculous amount of memory used by spatial split builder
Sergey Sharybin [Wed, 13 Apr 2016 12:22:53 +0000 (14:22 +0200)]
Cycles: Resolve ridiculous amount of memory used by spatial split builder

This was only visible on systems with lots of threads and root of the issue
was that we've been pre-allocating too much memory for all the threads.

Now we only pre-allocate data for the main thread and rest of the threads
does allocation on-demand.

This brings down memory usage from 36Gig to 6.9Gig when building spatial
split for the Bunny.blend file on our Intel beast.

Originally regression was happened by the threaded spacial split builder

5 years agoFix T47813: Cycles Standalone not respecting integrator sample_clamp_direct
Sergey Sharybin [Wed, 13 Apr 2016 08:39:21 +0000 (10:39 +0200)]
Fix T47813: Cycles Standalone not respecting integrator sample_clamp_direct

5 years agoCleanup string includes after versioning commits
Thomas Dinges [Thu, 31 Mar 2016 22:44:35 +0000 (00:44 +0200)]
Cleanup string includes after versioning commits

5 years agoShow version number in UI as well
Thomas Dinges [Thu, 31 Mar 2016 11:35:31 +0000 (13:35 +0200)]
Show version number in UI as well

5 years agoTweaks to the version string formation
Sergey Sharybin [Thu, 31 Mar 2016 07:44:09 +0000 (09:44 +0200)]
Tweaks to the version string formation

Couple of things:

- No need to use string streams to format the version string,
  we can do it at compile time and don't bother with anything
  at runtime.

- Function declaration was wring and would have caused linking
  conflicts in cases when util_version.h was included from
  multiple places.

We should have an utility function to get Cycles version so
applications which are linked to Cycles dynamically can query
the version, but that can't be done as an inlined function in
header and would need to be a function properly exported to a
global symbol table (aka, be implemented in a .cpp file).

5 years agoAdd a version number to Cycles standalone
Thomas Dinges [Wed, 30 Mar 2016 23:13:13 +0000 (01:13 +0200)]
Add a version number to Cycles standalone

Now Cycles has its own versioning, that is mainly interesting for external projects, which integrate the engine.

We start with version 1.7.0. Reasons for that:

* The engine is too mature for a 1.0 release.
* We assume that Cycles inside of Blender 2.61 was version 0.1. We count upwards in 0.1 steps, therefore Cycles inside of Blender 2.77 would be 1.7.

We use a common versioning scheme here, with 3 decimals for the major, minor and patch level.

At the moment cycles --version can be used to display the version, easy to parse for external projects. The info will be added to the UI later aswell.

5 years agoCycles: Minor cleanup, whitespace around keyword and preprocessor indent
Sergey Sharybin [Wed, 13 Apr 2016 06:58:52 +0000 (08:58 +0200)]
Cycles: Minor cleanup, whitespace around keyword and preprocessor indent

5 years agoCycles microdisplacement: preserve smooth normals for linear subdivison
Mai Lavelle [Tue, 12 Apr 2016 23:17:34 +0000 (01:17 +0200)]
Cycles microdisplacement: preserve smooth normals for linear subdivison

This way we prevent cracks in the model due to discontinuous normals, by using
smooth normals for displacement instead of always getting flat normals after
linear subdivision.

Reviewed By: brecht

Differential Revision:

5 years agoFix T47754: Meshes glitch on cycling Viewport Shading mode with Linked Groups
Sergey Sharybin [Tue, 12 Apr 2016 15:14:13 +0000 (17:14 +0200)]
Fix T47754: Meshes glitch on cycling Viewport Shading mode with Linked Groups

This is a regression since 4310128 which is cased by really bad logic:
there might be dependencies between dupli-objects, which means _if_ we
really want to ensure derived mesh on dupli creation we have to do it
before any matrix is overwritten.

I'm not sure if such derived mesh trick is really the only way to go
without major refactor, but seems simple fix for now will do it.

5 years agoMissed last commit
Campbell Barton [Tue, 12 Apr 2016 14:49:47 +0000 (00:49 +1000)]
Missed last commit

5 years agoCorrect UI messages: hyphenate 'add-ons'
Campbell Barton [Tue, 12 Apr 2016 14:29:01 +0000 (00:29 +1000)]
Correct UI messages: hyphenate 'add-ons'

5 years agoCycles: Add missing velocity attribute to builtin image loader
Sergey Sharybin [Tue, 12 Apr 2016 11:25:20 +0000 (13:25 +0200)]
Cycles: Add missing velocity attribute to builtin image loader

For some reason other parts of blender importer were assuming velocity
is supported, but actual loader was not aware of that.

Fixes T48064: Adding velocity attribute crashes render