7 years agoText3d: avoid converting utf8 to wchar_t in editmode
Campbell Barton [Fri, 3 Jan 2014 03:18:06 +0000 (14:18 +1100)]
Text3d: avoid converting utf8 to wchar_t in editmode

7 years agoFix T38032, typo in Python API documentation.
Thomas Dinges [Fri, 3 Jan 2014 01:28:21 +0000 (02:28 +0100)]
Fix T38032, typo in Python API documentation.

7 years agoUI: Tooltip fix for the Particle Template ID.
Andrew Buttery [Fri, 3 Jan 2014 01:14:32 +0000 (02:14 +0100)]
UI: Tooltip fix for the Particle Template ID.

Reviewed By: brecht, dingto
Differential Revision:

7 years agoFix :I broke the build for MSVC 2008 this fixes it
Martijn Berger [Thu, 2 Jan 2014 22:32:44 +0000 (23:32 +0100)]
Fix :I broke the build for MSVC 2008 this fixes it

7 years agoFix T37987: MSVC 2013 has C99 headers and warns for out define hypot _hypot for good...
Martijn Berger [Thu, 2 Jan 2014 21:19:10 +0000 (22:19 +0100)]
Fix T37987: MSVC 2013 has C99 headers and warns for out define hypot _hypot for good reason it seems

7 years agoFix T38033: cycles volume emission changes with step size.
Brecht Van Lommel [Thu, 2 Jan 2014 20:33:04 +0000 (21:33 +0100)]
Fix T38033: cycles volume emission changes with step size.

7 years agoFix T37056: Making segment flips curves it's not needed
Sergey Sharybin [Thu, 2 Jan 2014 19:44:46 +0000 (01:44 +0600)]
Fix T37056: Making segment flips curves it's not needed

Made the system around splines order a bit smarter, so
crating a segment between two splines wouldn't switch
direction if splines are selected in a way that they're

It is possible to make things even smarter using active
point and so, but that i'd consider a TODO.

7 years agoBring back edit curve add menu
Sergey Sharybin [Thu, 2 Jan 2014 19:34:35 +0000 (01:34 +0600)]
Bring back edit curve add menu

It was wrongly considered unused in rB5fdfa6d47542db32426ac080f071a1fd751e05a7

7 years agoFix T37170: Missing curve outline when using constructive modifiers
Sergey Sharybin [Thu, 2 Jan 2014 16:59:21 +0000 (22:59 +0600)]
Fix T37170: Missing curve outline when using constructive modifiers

Issue was caused by wrong bool flag assignment.

7 years agoFix T38004: size of Waveform, Vectorscope and Histogram is incorrect in VSE
Sergey Sharybin [Thu, 2 Jan 2014 11:57:01 +0000 (17:57 +0600)]
Fix T38004: size of Waveform, Vectorscope and Histogram is incorrect in VSE

Made it so scopes image buffer is displayed without any additional scale
applied on them,

Further tweaks are possible here, but that i'd consider a TODO.

7 years agoFix T38002: crash selecting a view mode for "Preview" in Sequence Editor
Sergey Sharybin [Thu, 2 Jan 2014 11:43:47 +0000 (17:43 +0600)]
Fix T38002: crash selecting a view mode for "Preview" in Sequence Editor

7 years agoAdd back - and / shortcuts in modal numinput (as other 'special' keys, you have to...
Bastien Montagne [Thu, 2 Jan 2014 10:58:19 +0000 (11:58 +0100)]
Add back - and / shortcuts in modal numinput (as other 'special' keys, you have to use ctrl to activate them)...

7 years agoFix "Flipped" drawn in edgeslide header text even when Even is disabled.
Bastien Montagne [Thu, 2 Jan 2014 08:46:23 +0000 (09:46 +0100)]
Fix "Flipped" drawn in edgeslide header text even when Even is disabled.

7 years agoFix T38019: Edge/Vertex Slide recognises Even and Flipped as if they were numerical...
Bastien Montagne [Thu, 2 Jan 2014 08:33:59 +0000 (09:33 +0100)]
Fix T38019: Edge/Vertex Slide recognises Even and Flipped as if they were numerical values

Further tweaked/simplified events handling in transform code, hope this time it works OK...

7 years agoCode cleanup: remove patch series from libmv
Sergey Sharybin [Thu, 2 Jan 2014 09:22:28 +0000 (15:22 +0600)]
Code cleanup: remove patch series from libmv

Since we're using own libmv branch from
we don't need to have local patches for libmv in blender
source tree.

7 years agoCode and style cleanup
Sergey Sharybin [Thu, 2 Jan 2014 09:14:47 +0000 (15:14 +0600)]
Code and style cleanup

Mainly fixed some style warnings reported by cpplint.

Also changed how camera (un)distortion happens internally
by replacing number of channels as a template argument
with number as channels passing as function argument.
Makes code easier to follow by eliminating loads checks
how much channels are used and which argument to pass to
the template.

7 years agoFix T38025: Key-framing lattice points fails
Joshua Leung [Wed, 1 Jan 2014 23:37:00 +0000 (12:37 +1300)]
Fix T38025: Key-framing lattice points fails

Clarified the tooltip/description on the property to make it
clear that it shouldn't be edited, and that LatticePoint.co_deform should be
used instead.

7 years agoAdd new BGE Stereo mode: 3DTV top-bottom.
Benoit Bolsee [Wed, 1 Jan 2014 23:26:15 +0000 (00:26 +0100)]
Add new BGE Stereo mode: 3DTV top-bottom.
This mode is designed for passive 3D TV: the viewport is split
horizontally - left eye above, right eye below - but the original camera
viewport is squashed in each half (with half the vertical resolution).
This is necessary to restore the aspect ratio in the 3D output because the TV expands each half to the full screen size.

7 years agoCode cleanup: use bool flag for direction in clip prefetch
Sergey Sharybin [Wed, 1 Jan 2014 17:23:12 +0000 (23:23 +0600)]
Code cleanup: use bool flag for direction in clip prefetch

That was nothing really wrong with the old short used for
direction, but that became kinda annoying because of compiler
idiocy which considered direction might have been zero.

Using explicit dual-state flag is more clear anyway.

7 years agoCode cleanup: line wraps and file names in doxy comments
Sergey Sharybin [Wed, 1 Jan 2014 16:45:59 +0000 (22:45 +0600)]
Code cleanup: line wraps and file names in doxy comments

7 years agoFix crash happening in Cycles fcurve modifier
Sergey Sharybin [Sun, 29 Dec 2013 13:15:37 +0000 (19:15 +0600)]
Fix crash happening in Cycles fcurve modifier

Crash was happening because of fcurve modifier stack
used modifier's DNA to store temporary data.

Now made it so storage for such a thing is being
allocated locally per object update so multiple objects
which shares the same animation wouldn't run into
threading conflict anymore.

This storage might be a part of EvaluationContext,
but that'd mean passing this context all over in
object_where_is which will clutter API for now without
actual benefit for this.

Optimization notes: storage is only being allocated
if there're Cycles modifier in the stack, so there're
no extra allocations happening in all other cases.

To make code a bit less cluttered with this storage
passing all over the place added extra callbacks to
the FModifier storage which runs evaluation with the
given storage.

Reviewers: brecht, campbellbarton, aligorith

CC: plasmasolutions
Differential Revision:

7 years agoRe-bundle libmv from new upstream repository
Sergey Sharybin [Mon, 30 Dec 2013 13:03:13 +0000 (19:03 +0600)]
Re-bundle libmv from new upstream repository

No functional changes, just to make sure all the patches
are ported nicely and that update scripts works fine.

7 years agoSplit tracking.c into several files
Sergey Sharybin [Mon, 30 Dec 2013 11:03:59 +0000 (17:03 +0600)]
Split tracking.c into several files

File tracking.c became rather huge and annoying to
maintain and it really contains several independent
areas of motrack pipeline.

Now we've got:

* tracking.c: general-purpose functions which are used
  by blender, clip editor, RNA and so.

* tracking_detect.c: feature detection functions
  (blender-side, logic is still in libmv).

* tracking_plane_tracker.c: blender-side 2D tracking logic.

* tracking_plane_tracker.c: plane track tracker.

* tracking_solver.c: functions for camera solving.

* tracking_stabilize.c: 2D stabilization functions.

* tracking_util.c: utility functions for all those files
  and which shouldn't be public.

7 years agoUpdate Ceres to the latest upstream
Sergey Sharybin [Sun, 29 Dec 2013 10:59:15 +0000 (16:59 +0600)]
Update Ceres to the latest upstream

This brings up much easier termination type usage,
which for us means we might use:


instead of doing manual funky enum values check.

Reviewers: keir

Differential Revision:

7 years agoFix deadlock happening when using Save Buffers for render
Sergey Sharybin [Wed, 1 Jan 2014 10:59:38 +0000 (16:59 +0600)]
Fix deadlock happening when using Save Buffers for render

Issue was caused by the same tile being written twice to
the EXR file. This was happening because of partial update
of work-in-progress tiles was merging result to the final
render result in order to make color management pipeline

We need to avoid such a merges and keep memory usage as
low as possible when Save Buffers is enabled.

Now render pipeline will allocate special display buffer
in render layer which will contain combined pass in the
display space. This keeps memory usage as low as we can
do at this moment.

There's one weak thing which is changing color management
settings during rendering would lead to lossy conversion.
This is because render result's display buffer uses color
space from the time when rendering was invoked.

This is actually what was happening in previous release
already actually so not a big issue.

Reviewers: brecht

Reviewed By: brecht

Differential Revision:

7 years agoFix wrongly shorten labels in splash (allocated size was a bit too small, rB3c6b5b72a...
Bastien Montagne [Wed, 1 Jan 2014 15:04:52 +0000 (16:04 +0100)]
Fix wrongly shorten labels in splash (allocated size was a bit too small, rB3c6b5b72a497).

7 years agoFix T38013: Incorrect RNA Path when trying to keyframe the nth vertex of Bezier...
Joshua Leung [Wed, 1 Jan 2014 11:28:02 +0000 (00:28 +1300)]
Fix  T38013: Incorrect RNA Path when trying to keyframe the nth vertex of Bezier curve shape key data

key->elemsize is set to 16 for ID_CU (i.e. Curves and NURBS surfaces). However,
this value is only correct for NURBS (which use BPoints). When trying to keyframe
the nth vertex of a particular shape key's data (where the shape keys are being
used on Bezier curves), the RNA Paths for that are generated with the wrong
data index. From empirical testing, it appears that this should be 12 instead.

7 years agoFix T38008: Bug in templates
Bastien Montagne [Wed, 1 Jan 2014 11:02:43 +0000 (12:02 +0100)]
Fix T38008: Bug in templates

7 years agoAdd a new "shortening process" for UI string drawing, which keeps both right and...
Bastien Montagne [Wed, 1 Jan 2014 10:18:27 +0000 (11:18 +0100)]
Add a new "shortening process" for UI string drawing, which keeps both right and left parts
of the drawstr and replaces the middle by '...'

It's usually easier to figure out what a troncated string means if you have both its start and end parts.

It currently affects all UI items (text fields, buttons, labels...).
Only exceptions are buttons inside menus, text fields & co being edited, and numbuttons/sliders.
Note that some static texts (like panels' titles or items in outliner) do not use usual UI items,
and just draw the whole text, using OpenGL to clip it. Will make another patch to fix this.

Reviewers: campbellbarton, brecht, carter2422, #user_interface

Reviewed by: brecht, carter2422

CC: billrey
Differential Revision:

7 years agoFix T37965, loop multicut confirmation not happening when numeric input
Antony Riakiotakis [Wed, 1 Jan 2014 04:17:57 +0000 (06:17 +0200)]
Fix T37965, loop multicut confirmation not happening when numeric input
is used. When numerical input was active confirmation events were not
getting handled.

Code here seems a bit duplicated, it may be possible to simplify it, but
leaving it slightly bloated for now.

7 years agoClean up Zoom Style section of Input Preferences
Jonathan Williamson [Wed, 1 Jan 2014 00:53:12 +0000 (18:53 -0600)]
Clean up Zoom Style section of Input Preferences

This removes some grouping labels and improves option names to make them self explanatory and consistent with one another.


7 years agoAlign Author field and label horizontally
Jonathan Williamson [Wed, 1 Jan 2014 00:12:51 +0000 (18:12 -0600)]
Align Author field and label horizontally

This aligns the User Preferences > File > Author field and label horizontally, saving space and making it more consistent with author text fields within the same section.

7 years agoImprove readability of System panel of User Preferences
Jonathan Williamson [Wed, 1 Jan 2014 00:09:20 +0000 (18:09 -0600)]
Improve readability of System panel of User Preferences

This commit adjusts the spacing of the items in User Preferences > System. The spacing is adjusted via separators between each section of options. This better differentiates between groups of options. It also removes a few extra separators for more consistency.

7 years agoUnits: Make grams base unit for mass
Sergej Reich [Tue, 31 Dec 2013 17:01:07 +0000 (18:01 +0100)]
Units: Make grams base unit for mass

7 years agoFix T37993: mass of Rigid Body ignores scene unit scale
Sergej Reich [Tue, 31 Dec 2013 16:58:55 +0000 (17:58 +0100)]
Fix T37993: mass of Rigid Body ignores scene unit scale

Mass units weren't scaled in the ui.

7 years agoCycles Volume Render: these changes should have included in the last commit.
Brecht Van Lommel [Tue, 31 Dec 2013 16:33:55 +0000 (17:33 +0100)]
Cycles Volume Render: these changes should have included in the last commit.

7 years agoCycles Volume Render: generated texture coordinates for volume render.
Brecht Van Lommel [Tue, 31 Dec 2013 16:33:55 +0000 (17:33 +0100)]
Cycles Volume Render: generated texture coordinates for volume render.

This does not support staying fixed while the surface deforms, but for static
meshes it should match up with the surface texture coordinates. Implemented
as a matrix transform from objects space to mesh texture space.

Making this work for deforming surfaces would be quite complicated, you might
need something like harmonic coordinates as used in the mesh deform modifier,
probably will not be possible anytime soon.

7 years agoCycles Volume Render: optimization to avoid exporting surface attributes when
Brecht Van Lommel [Tue, 31 Dec 2013 16:30:34 +0000 (17:30 +0100)]
Cycles Volume Render: optimization to avoid exporting surface attributes when
only a volume shader is used.

7 years agoFix T37994: crash in preview render after recent color management changes.
Lawrence D'Oliveiro [Tue, 31 Dec 2013 14:00:00 +0000 (15:00 +0100)]
Fix T37994: crash in preview render after recent color management changes.

Reviewed By: brecht

7 years agoFix T37992: german NUMPAD-COMMA is not tranlated to decimal dot (for modal numinput).
Bastien Montagne [Tue, 31 Dec 2013 12:39:43 +0000 (13:39 +0100)]
Fix T37992: german NUMPAD-COMMA is not tranlated to decimal dot (for modal  numinput).

7 years agoFix T37935: 3dsmax key configuration broken after recent mesh operator changes.
Brecht Van Lommel [Tue, 31 Dec 2013 01:19:21 +0000 (02:19 +0100)]
Fix T37935: 3dsmax key configuration broken after recent mesh operator changes.

7 years agoFix T37947: large cursors now also work on linux/mac for the edit mode cross.
Brecht Van Lommel [Tue, 31 Dec 2013 01:00:21 +0000 (02:00 +0100)]
Fix T37947: large cursors now also work on linux/mac for the edit mode cross.

7 years agoFix console incorrectly showing on Windows Blender startup in some cases.
Masakazu Ito [Mon, 30 Dec 2013 23:08:07 +0000 (00:08 +0100)]
Fix console incorrectly showing on Windows Blender startup in some cases.

The console window is hidden by default, but we need to avoid this when
starting from the command prompt, because it would hide the window you just
typed the command in.

Previously it would check if Blender was started from "explorer.exe" to
determine that, but that wasn't working for application launchers like
Appetizer or Colibri. Instead we now check if the process ID is the same as
the process ID of the console window, which appears to work reliably.

Reviewed By: brecht

Differential Revision:

7 years agoUI: improve tooltip for use preview range option in timeline.
Andrew Buttery [Mon, 30 Dec 2013 22:50:19 +0000 (23:50 +0100)]
UI: improve tooltip for use preview range option in timeline.

Reviewed By: brecht

Differential Revision:

7 years agoone more msvc 2013 change
Martijn Berger [Mon, 30 Dec 2013 21:25:42 +0000 (22:25 +0100)]
one more msvc 2013 change

7 years agoFix T37970: Node scale/rotate use incorrect pivor
Campbell Barton [Mon, 30 Dec 2013 09:09:16 +0000 (20:09 +1100)]
Fix T37970: Node scale/rotate use incorrect pivor

note: added code to use real node center, but ifdef'd for now since it
doesnt work well with absolute snapping.

7 years agoNode Editor: enable transform helper line
Campbell Barton [Mon, 30 Dec 2013 08:23:29 +0000 (19:23 +1100)]
Node Editor: enable transform helper line

7 years agoFix T37920: BGE LibLoad failed for meshes with no materials
Campbell Barton [Mon, 30 Dec 2013 04:49:13 +0000 (15:49 +1100)]
Fix T37920: BGE LibLoad failed for meshes with no materials

7 years agoMain API: refactor naming, use BKE_main_ prefix and add main arg.
Campbell Barton [Mon, 30 Dec 2013 02:25:27 +0000 (13:25 +1100)]
Main API: refactor naming, use BKE_main_ prefix and add main arg.

7 years agoCode Cleanup: quiet unused define warning
Campbell Barton [Mon, 30 Dec 2013 01:19:27 +0000 (12:19 +1100)]
Code Cleanup: quiet unused define warning

7 years agoFix for crash with game engines LibLoad feature
Campbell Barton [Mon, 30 Dec 2013 01:18:41 +0000 (12:18 +1100)]
Fix for crash with game engines LibLoad feature

7 years agoCode Cleanup: cycles tips and long lines
Campbell Barton [Mon, 30 Dec 2013 01:06:36 +0000 (12:06 +1100)]
Code Cleanup: cycles tips and long lines

7 years agoCode Cleanup: unused defines & style
Campbell Barton [Sun, 29 Dec 2013 23:53:09 +0000 (10:53 +1100)]
Code Cleanup: unused defines & style

7 years agoCycles Volume Render: heterogeneous (textured) volumes support.
Brecht Van Lommel [Sun, 29 Dec 2013 21:19:38 +0000 (22:19 +0100)]
Cycles Volume Render: heterogeneous (textured) volumes support.

Volumes can now have textured colors and density. There is a Volume Sampling
panel in the Render properties with these settings:

* Step size: distance between volume shader samples when rendering the volume.
  Lower values give more accurate and detailed results but also increased render
* Max steps: maximum number of steps through the volume before giving up, to
  protect from extremely long render times with big objects or small step sizes.

This is much more compute intensive than homogeneous volume, so when you are not
using a texture you should enable the Homogeneous Volume option in the material
or world for faster rendering.

One important missing feature is that Generated texture coordinates are not yet
working in volumes, and they are the default coordinates for nearly all texture
nodes. So until that works you need to plug in object texture coordinates or a
world space position.

This is work by "storm", Stuart Broadfoot, Thomas Dinges and myself.

7 years agoFix cycles volume emission not working with OSL.
Brecht Van Lommel [Sun, 29 Dec 2013 15:30:55 +0000 (16:30 +0100)]
Fix cycles volume emission not working with OSL.

7 years agoCode refactor: better distinguish scatter and absorption for volume integration.
Brecht Van Lommel [Sun, 29 Dec 2013 14:49:16 +0000 (15:49 +0100)]
Code refactor: better distinguish scatter and absorption for volume integration.

7 years agoBuildbot SCons MSVC 2013 packing also requires something extra
Martijn Berger [Sun, 29 Dec 2013 18:56:03 +0000 (19:56 +0100)]
Buildbot SCons MSVC 2013 packing also requires something extra

7 years agoMSVC 2013 buildbot changes
Martijn Berger [Sun, 29 Dec 2013 16:43:31 +0000 (17:43 +0100)]
MSVC 2013 buildbot changes

7 years agoAdded option to have a seperate environment for executing nvcc
Martijn Berger [Sun, 29 Dec 2013 13:42:02 +0000 (14:42 +0100)]
Added option to have a seperate environment for executing nvcc
This can be used to compiler cuda kernels with Visual Studio 2010 while
the rest of blender is compiled with MSVC 12.0 / 2013

7 years agoText3d: add select all operator
Campbell Barton [Sun, 29 Dec 2013 12:43:19 +0000 (23:43 +1100)]
Text3d: add select all operator

also add Edit menu for 3d text and move cut/copy/paste there.

7 years agocorrection to previous commit
Campbell Barton [Sun, 29 Dec 2013 12:34:13 +0000 (23:34 +1100)]
correction to previous commit

7 years agoFix crash moving the cursor after deleting 3d text
Campbell Barton [Sun, 29 Dec 2013 12:18:38 +0000 (23:18 +1100)]
Fix crash moving the cursor after deleting 3d text

7 years agoText3d: add assert's to check the selection and length are valid
Campbell Barton [Sun, 29 Dec 2013 12:16:02 +0000 (23:16 +1100)]
Text3d: add assert's to check the selection and length are valid

7 years agoFix movie output when using render border
Sergey Sharybin [Sun, 29 Dec 2013 11:25:56 +0000 (17:25 +0600)]
Fix movie output when using render border

Reported by @plasmasolutions in IRC.

7 years agoFollow up to the previous commit: vfont_get_data is to use the same RW lock
Sergey Sharybin [Sun, 29 Dec 2013 11:07:38 +0000 (17:07 +0600)]
Follow up to the previous commit: vfont_get_data is to use the same RW lock

7 years agoFix T37980: Multiple font objects sharing an external font gives problems
Sergey Sharybin [Sun, 29 Dec 2013 10:40:34 +0000 (16:40 +0600)]
Fix T37980: Multiple font objects sharing an external font gives problems

Solved by adding RW lock to BKE_vfont_to_curve.

So now all the threads are allowed to read chars from ghash,
but they'll be locked as soon as one thread would need to load
more chars from font to the ghash.

7 years agoText3d: setting upper/lower case now uses the selection
Campbell Barton [Sun, 29 Dec 2013 10:05:39 +0000 (21:05 +1100)]
Text3d: setting upper/lower case now uses the selection

7 years agoText3d: remove redundant call to wcslen
Campbell Barton [Sun, 29 Dec 2013 10:04:54 +0000 (21:04 +1100)]
Text3d: remove redundant call to wcslen

7 years agoFix for 3d text ctrl+arrow keys failing for multi-byte characters.
Campbell Barton [Sun, 29 Dec 2013 05:54:43 +0000 (16:54 +1100)]
Fix for 3d text ctrl+arrow keys failing for multi-byte characters.

7 years agoMath Lib: replace point in polygon function with one thats ~23x faster.
Campbell Barton [Sun, 29 Dec 2013 03:46:56 +0000 (14:46 +1100)]
Math Lib: replace point in polygon function with one thats ~23x faster.

rather then using angle summing, use line intersection checks.

7 years agoFix for inexact 3d cursor placement especially when zoomed out.
Campbell Barton [Sun, 29 Dec 2013 02:35:00 +0000 (13:35 +1100)]
Fix for inexact 3d cursor placement especially when zoomed out.

Even with the startup scene clicking multiple times in the corner of the
view without moving the mouse would move the cursor a little each time.

7 years agoFix missing check if isect_plane_plane_v3 fails to find an intersection.
Campbell Barton [Sun, 29 Dec 2013 01:51:27 +0000 (12:51 +1100)]
Fix missing check if isect_plane_plane_v3 fails to find an intersection.

7 years agoFix cycles volume render crash when trying to access primitive attributes
Brecht Van Lommel [Sat, 28 Dec 2013 22:39:15 +0000 (23:39 +0100)]
Fix cycles volume render crash when trying to access primitive attributes
like generated texture coordinates or tangents.

7 years agoCycles Volume Render: add volume emission support.
Brecht Van Lommel [Sat, 28 Dec 2013 22:00:51 +0000 (23:00 +0100)]
Cycles Volume Render: add volume emission support.

This is done using the existing Emission node and closure (we may add a volume
emission node, not clear yet if it will be needed).

Volume emission only supports indirect light sampling which means it's not very
efficient to make small or far away bright light sources. Using direct light
sampling and MIS would be tricky and probably won't be added anytime soon. Other
renderers don't support this either as far as I know, lamps and ray visibility
tricks may be used instead.

7 years agoUse ccl_device_inline for SSE perlin noise
Sv. Lockal [Sat, 28 Dec 2013 19:25:55 +0000 (23:25 +0400)]
Use ccl_device_inline for SSE perlin noise

msvc ignores inline hint here and generates a bunch of push/lea

7 years agoCycles Volume Render: add support for overlapping volume objects.
Brecht Van Lommel [Sat, 28 Dec 2013 19:02:40 +0000 (20:02 +0100)]
Cycles Volume Render: add support for overlapping volume objects.

This works pretty much as you would expect, overlapping volume objects gives
a more dense volume. What did change is that world volume shaders are now
active everywhere, they are no longer excluded inside objects.

This may not be desirable and we need to think of better control over this.
In some cases you clearly want it to happen, for example if you are rendering
a fire in a foggy environment. In other cases like the inside of a house you
may not want any fog, but it doesn't seem possible in general for the renderer
to automatically determine what is inside or outside of the house.

This is implemented using a simple fixed size array of shader/object ID pairs,
limited to max 15 overlapping objects. The closures from all shaders are put
into a single closure array, exactly the same as if an add shader was used to
combine them.

7 years agoCycles Volume Render: support for rendering of homogeneous volume with absorption.
Brecht Van Lommel [Sat, 28 Dec 2013 15:56:19 +0000 (16:56 +0100)]
Cycles Volume Render: support for rendering of homogeneous volume with absorption.

This is the simplest possible volume rendering case, constant density inside
the volume and no scattering or emission. My plan is to tweak, verify and commit
more volume rendering effects one by one, doing it all at once makes it
difficult to verify correctness and track down bugs.

Documentation is here:

Currently this hooks into path tracing in 3 ways, which should get us pretty
far until we add more advanced light sampling. These 3 hooks are repeated in
the path tracing, branched path tracing and transparent shadow code:

* Determine active volume shader at start of the path
* Change active volume shader on transmission through a surface
* Light attenuation over line segments between camera, surfaces and background

This is work by "storm", Stuart Broadfoot, Thomas Dinges and myself.

7 years agoCode cleanup: move shadow_blocked function into separate file.
Brecht Van Lommel [Sat, 28 Dec 2013 01:56:53 +0000 (02:56 +0100)]
Code cleanup: move shadow_blocked function into separate file.

7 years agoCycles Volume Render: add flags to quickly detect when objects have a volume shader.
Brecht Van Lommel [Sat, 28 Dec 2013 01:27:48 +0000 (02:27 +0100)]
Cycles Volume Render: add flags to quickly detect when objects have a volume shader.

7 years agoCycles Volume Render: work on nodes and closures.
Brecht Van Lommel [Sat, 28 Dec 2013 00:54:44 +0000 (01:54 +0100)]
Cycles Volume Render: work on nodes and closures.

* Henyey-Greenstein scattering closure implementation.
* Rename transparent to absorption node and isotropic to scatter node.
* Volume density is folded into the closure weights.
* OSL support for volume closures and nodes.
* This commit has no user visible changes, there is no volume render code yet.

This is work by "storm", Stuart Broadfoot, Thomas Dinges and myself.

7 years agoFix regression T37971: Crash setting recursive dupli-verts
Campbell Barton [Sat, 28 Dec 2013 14:36:51 +0000 (01:36 +1100)]
Fix regression T37971: Crash setting recursive dupli-verts

7 years agoFix T37939, concern raised in rBd9e0a94: Avoid access to linked node
Lukas Tönne [Sat, 28 Dec 2013 13:51:53 +0000 (14:51 +0100)]
Fix T37939, concern raised in rBd9e0a94: Avoid access to linked node
tree ID data when freeing bNodeTree data blocks, while also making sure
localized node group copies get freed properly.

7 years agoupdate console shell for changes in api
Campbell Barton [Sat, 28 Dec 2013 13:51:51 +0000 (00:51 +1100)]
update console shell for changes in api

7 years agoText3d: avoid calculating the font boundbox scale for every character
Campbell Barton [Sat, 28 Dec 2013 08:45:54 +0000 (19:45 +1100)]
Text3d: avoid calculating the font boundbox scale for every character

7 years agoFix for text3d issue, \n was attempting to find a character too
Campbell Barton [Sat, 28 Dec 2013 08:34:50 +0000 (19:34 +1100)]
Fix for text3d issue, \n was attempting to find a character too

7 years agoFix for 3d fonts loading the character of the string terminator.
Campbell Barton [Sat, 28 Dec 2013 08:04:03 +0000 (19:04 +1100)]
Fix for 3d fonts loading the character of the string terminator.

also remove redundant call to wcslen and ensure FT_Init_FreeType runs
once the font loads.

7 years ago3D Text: use ghash for character lookups
Campbell Barton [Sat, 28 Dec 2013 06:33:19 +0000 (17:33 +1100)]
3D Text: use ghash for character lookups

7 years agoFix for BKE_nurb_handles_autocalc using 2d tests on 3d data
Campbell Barton [Sat, 28 Dec 2013 06:29:58 +0000 (17:29 +1100)]
Fix for BKE_nurb_handles_autocalc using 2d tests on 3d data

7 years agoMath Lib: add dist_squared_to_line_v2, avoids sqrt in scanfill and 3d-text
Campbell Barton [Sat, 28 Dec 2013 06:17:55 +0000 (17:17 +1100)]
Math Lib: add dist_squared_to_line_v2, avoids sqrt in scanfill and 3d-text

7 years agocreation of path from std::string on Windows (VC10/11/12) crashes (access error)
Martijn Berger [Fri, 27 Dec 2013 21:38:46 +0000 (22:38 +0100)]
creation of path from std::string on Windows (VC10/11/12) crashes (access error)

Seems to be a known problem in boost:

Applied the solution but do not know if this is the right place.

Reviewers: dingto, brecht

Reviewed By: dingto

Differential Revision:

7 years agoCycles: Move SIMD utility functions into its own file.
Thomas Dinges [Fri, 27 Dec 2013 20:30:03 +0000 (21:30 +0100)]
Cycles: Move SIMD utility functions into its own file.

Recently added SSE macros for noise texture can be moved here as well, but I leave this for later.

7 years agoBasic scons support for building with Visual Studio 2013 although full MSVC 2013...
Martijn Berger [Fri, 27 Dec 2013 18:46:55 +0000 (19:46 +0100)]
Basic scons support for building with Visual Studio 2013 although full MSVC 2013 support still needs more work in scons itself

7 years agoCycles / Perlin Noise: Optimize noise calculation by using SIMD instructions on CPU.
Thomas Dinges [Fri, 27 Dec 2013 17:48:37 +0000 (18:48 +0100)]
Cycles / Perlin Noise: Optimize noise calculation by using SIMD instructions on CPU.
This makes scenes with a Noise Texture render faster, the BMW file is 12-15% faster now.

Patch by Sv. Lockal, many thanks! :)

7 years agoFix T36474: Blender 2.68a crashes upon rendering
Sergey Sharybin [Fri, 27 Dec 2013 12:52:41 +0000 (18:52 +0600)]
Fix T36474: Blender 2.68a crashes upon rendering

Original issue was caused by wring detection of whether
SS modifier is being applied for render/viewport. After
recent dependency graph commit this was no longer an

But it still might have happen conflict between viewport
draw and scene_update_for_newframe() invoked from render
thread when using external engines like Cycles.

Solved by adding viewport lock while scene is being
updated and objects being exported to the render engine.

Same lock was already used for Blender Internal.

Reviewers: brecht

Reviewed By: brecht

Maniphest Tasks: T36474

Differential Revision:

7 years agoRemove TODO. Those args could be useful in the future.
Sergey Sharybin [Fri, 27 Dec 2013 12:34:36 +0000 (18:34 +0600)]
Remove TODO. Those args could be useful in the future.

7 years agoTypo fix in a comment
Sergey Sharybin [Fri, 27 Dec 2013 11:09:19 +0000 (17:09 +0600)]
Typo fix in a comment

7 years agoCode Cleanup: style
Campbell Barton [Fri, 27 Dec 2013 03:20:46 +0000 (14:20 +1100)]
Code Cleanup: style

7 years agoAPI Docs: use a simpler example for merging namespaces
Campbell Barton [Fri, 27 Dec 2013 03:20:08 +0000 (14:20 +1100)]
API Docs: use a simpler example for merging namespaces

7 years agoCycles / Hair: Avoid duplicate calculations and remove redundant if branch, instead...
Thomas Dinges [Thu, 26 Dec 2013 20:52:23 +0000 (21:52 +0100)]
Cycles / Hair: Avoid duplicate calculations and remove redundant if branch, instead add the condition to the one above.

7 years agoRigidbody: Code cleanup
Sergej Reich [Thu, 26 Dec 2013 20:30:53 +0000 (21:30 +0100)]
Rigidbody: Code cleanup

Make some functions private.
Remove unneeded nested if statements.
Avoid mixing short and bool.