7 years agoMissed one usage of use_hidden_preview.
Jeroen Bakker [Mon, 9 Dec 2013 21:16:05 +0000 (22:16 +0100)]
Missed one usage of use_hidden_preview.

7 years agoNode Previews:
Jeroen Bakker [Mon, 9 Dec 2013 20:50:02 +0000 (21:50 +0100)]
Node Previews:
Removed USE_HIDDEN_PREVIEW from source code as it is now deprecated.
The feature was introduced during project mango to quickly hide previews, now that the previews are hidden by default this feature has no need.
Inside the DNA the flag is still visible in comment, this way no one will reuse that value as it could have some side effects

Jeroen & Monique
 - At Mind -

7 years agoFix T37694: cycles particles emitter object rendering when it shouldn't.
Brecht Van Lommel [Mon, 9 Dec 2013 20:57:30 +0000 (21:57 +0100)]
Fix T37694: cycles particles emitter object rendering when it shouldn't.

This was broken by a recent bugfix for T37159.

7 years agoRefactoring/cleanup, borrowed from soc-2013-paint branch.
Antony Riakiotakis [Mon, 9 Dec 2013 20:36:33 +0000 (22:36 +0200)]
Refactoring/cleanup, borrowed from soc-2013-paint branch.

* Move symmetry options to the paint struct (where all paint systems can
make use of it)

* Rename draw_pressure to stroke_active. This is what is really checked
on those occasions that this is used. Also move turning on/off of this
option to the stroke level and avoid doing it on every stroke system.

* Rename BRUSH_RESTORE_MESH to BRUSH_DRAG_DOT. In image painting this
won't restore any mesh, so better have a name that is directly linked to
what the flag actually does.

7 years agoPREVIEW: updated the default themes.
Jeroen Bakker [Mon, 9 Dec 2013 15:20:44 +0000 (16:20 +0100)]
PREVIEW: updated the default themes.

7 years agoCompositor node preview:
Jeroen Bakker [Sun, 8 Dec 2013 20:53:35 +0000 (21:53 +0100)]
Compositor node preview:

moved the hide preview logic to a method on bNodeTreeType. This way the node.c keeps clean, but logic could still be shared.
Implementing this per node, can lead to future errors.

7 years agoEnhancement: By default do not show the previews of composite nodes
Jeroen Bakker [Sun, 1 Dec 2013 20:56:52 +0000 (21:56 +0100)]
Enhancement: By default do not show the previews of composite nodes
only input nodes will show the preview by default.

7 years agoEnhancement: added node colors for every node class
Jeroen Bakker [Sun, 1 Dec 2013 20:30:04 +0000 (21:30 +0100)]
Enhancement: added node colors for every node class

In the user preferences all node classes can get its own color
The in/out color is splitted into 2 sepatate colors
the rna has been updated to better names

7 years agoFix T37751: Crash subdividing bones
Campbell Barton [Mon, 9 Dec 2013 14:14:31 +0000 (01:14 +1100)]
Fix T37751: Crash subdividing bones

7 years agoPython API: when OCIO is disabled use the same version format.
Campbell Barton [Mon, 9 Dec 2013 14:11:02 +0000 (01:11 +1100)]
Python API: when OCIO is disabled use the same version format.

7 years agoArmature Editmode: blend the bone radius when subdividing
Campbell Barton [Mon, 9 Dec 2013 14:02:20 +0000 (01:02 +1100)]
Armature Editmode: blend the bone radius when subdividing

7 years agoFix T37752: Color rna path functions missing
Campbell Barton [Mon, 9 Dec 2013 13:48:59 +0000 (00:48 +1100)]
Fix T37752: Color rna path functions missing

7 years agoFix T37750: Incorrect stats for dupli-metaballs
Campbell Barton [Mon, 9 Dec 2013 13:23:53 +0000 (00:23 +1100)]
Fix T37750: Incorrect stats for dupli-metaballs

7 years agoFix T37715: Incorrect docstring
Campbell Barton [Mon, 9 Dec 2013 13:02:37 +0000 (00:02 +1100)]
Fix T37715: Incorrect docstring

7 years agoGame Engine: Option to record static objects animation
James Yonan [Mon, 9 Dec 2013 11:26:52 +0000 (22:26 +1100)]
Game Engine: Option to record static objects animation

7 years agoFix T37741: Duplicating node editor did not copy node tree pointers.
Lukas Tönne [Mon, 9 Dec 2013 10:54:00 +0000 (11:54 +0100)]
Fix T37741: Duplicating node editor did not copy node tree pointers.

The effect of this is not visible with standard compositor/shader nodes,
because the editor node tree is immediately set from context afterward
using the scene or active material. But with pynodes the context update
is not necessarily defined and the node tree pointer gets lost.

7 years agoFix T37727: z-offset problems with camera view
Campbell Barton [Mon, 9 Dec 2013 09:59:29 +0000 (20:59 +1100)]
Fix T37727: z-offset problems with camera view

7 years agoCode Cleanup: use ELEM macro when checking object type
Campbell Barton [Mon, 9 Dec 2013 06:07:59 +0000 (17:07 +1100)]
Code Cleanup: use ELEM macro when checking object type

7 years agoView3D API: rename view3d_camera_get to ED_view3d_camera_data_get
Campbell Barton [Mon, 9 Dec 2013 06:03:37 +0000 (17:03 +1100)]
View3D API: rename view3d_camera_get to ED_view3d_camera_data_get

7 years agoFix T37712: Point cache index lookup crashed with 0 points stored.
Lukas Tönne [Mon, 9 Dec 2013 10:02:41 +0000 (11:02 +0100)]
Fix T37712: Point cache index lookup crashed with 0 points stored.

The BKE_ptcache_mem_index_find is using unsigned ints for binary search
"high" values - but this leads to integer overflow if the totpoint
number is 0 and causes invalid array access.

7 years agoInterface: Rename "Duplicate Objects" to just "Duplicate", was already done for the...
Thomas Dinges [Mon, 9 Dec 2013 09:49:16 +0000 (10:49 +0100)]
Interface: Rename "Duplicate Objects" to just "Duplicate", was already done for the Mesh/Curve...variants but not for the Object Mode one.

7 years agoFix T37747: keymap import error with region timers.
Brecht Van Lommel [Mon, 9 Dec 2013 05:38:44 +0000 (06:38 +0100)]
Fix T37747: keymap import error with region timers.

7 years agoLattice Editmode: Select Mirror
Campbell Barton [Mon, 9 Dec 2013 04:40:41 +0000 (15:40 +1100)]
Lattice Editmode: Select Mirror

patch originally by Philipp Oeser with some edits.

7 years agoLattice API: add BKE_lattice_index_flip, BKE_lattice_bitmap_from_flag
Campbell Barton [Mon, 9 Dec 2013 04:32:05 +0000 (15:32 +1100)]
Lattice API: add BKE_lattice_index_flip, BKE_lattice_bitmap_from_flag

7 years agoFix build error when building without OSL support.
Brecht Van Lommel [Mon, 9 Dec 2013 04:28:01 +0000 (05:28 +0100)]
Fix build error when building without OSL support.

7 years agoTooltips: abbreviate long python operator tooltips
Walid Shouman [Mon, 9 Dec 2013 03:20:53 +0000 (14:20 +1100)]
Tooltips: abbreviate long python operator tooltips

Some tooltips would end up containing long string/array args spanning the screen.

7 years agoUpdate to OIIO 1.39 and OSL 1.4.0.
Bastien Montagne [Sun, 8 Dec 2013 17:25:37 +0000 (18:25 +0100)]
Update to OIIO 1.39 and OSL 1.4.0.

Note that I also updated OpenEXR to 2.1.0 (and updated our CMake openexr module as well).

Users will have to update their build settings as told by the script (also in BUILD_NOTES.txt generated file)!

Note I removed all ugly patches from this script, we are currently using custom git repo for OpenEXR/OIIO/OSL,
hopefully we will soon be able to use vanillia code from official repos!

7 years agoScons: as requested by Ideasman, make MACOSX_COMPILER -> C_COMPILER_ID,
Jens Verwiebe [Sun, 8 Dec 2013 14:35:06 +0000 (15:35 +0100)]
Scons: as requested by Ideasman, make MACOSX_COMPILER -> C_COMPILER_ID,
leave env set for OSX exclusive for now”

7 years agoCycles OSL: update to build with latest OSL master shader group changes.
Brecht Van Lommel [Sun, 8 Dec 2013 14:15:27 +0000 (15:15 +0100)]
Cycles OSL: update to build with latest OSL master shader group changes.

7 years agoCode cleanup: delete cineon header files that were empty but not deleted.
Shane Ambler [Sun, 8 Dec 2013 12:16:26 +0000 (13:16 +0100)]
Code cleanup: delete cineon header files that were empty but not deleted.

Reviewed By: brecht

Differential Revision:

7 years agoStyle: use frozen sets
Campbell Barton [Sun, 8 Dec 2013 11:53:55 +0000 (22:53 +1100)]
Style: use frozen sets

7 years agoCycles: Update stdosl.h to OSL 1.4.0. (includes new aastep functions).
Thomas Dinges [Sun, 8 Dec 2013 11:20:15 +0000 (12:20 +0100)]
Cycles: Update stdosl.h to OSL 1.4.0. (includes new aastep functions).

7 years agoCode cleanup: UI cleanup for cycles UI code and fix typo in system info.
Thomas Dinges [Sun, 8 Dec 2013 11:13:09 +0000 (12:13 +0100)]
Code cleanup: UI cleanup for cycles UI code and fix typo in system info.

7 years agoBummer, forgot to test with OSL disabled.
Sergey Sharybin [Sun, 8 Dec 2013 09:19:21 +0000 (15:19 +0600)]
Bummer, forgot to test with OSL disabled.

7 years agoCorrection to previous commit, sorry
Sergey Sharybin [Sun, 8 Dec 2013 09:10:47 +0000 (15:10 +0600)]
Correction to previous commit, sorry

7 years agoExtend system-info with information about OIIO, OCIO and OSL
Sergey Sharybin [Sun, 8 Dec 2013 09:03:17 +0000 (15:03 +0600)]
Extend system-info with information about OIIO, OCIO and OSL

Version of those libraries might be useful to know.

- OIIO and OCIO is exposed via and
  There're "supported", "version" and "version_string" defined
  in those modules.

- OSL is available as _cycles.osl_version and _cycles.osl_version_string.

Reviewers: campbellbarton

Reviewed By: campbellbarton

CC: dingto
Differential Revision:

7 years agoFix T37212: Wrong user counter when more than 32K users
Sergey Sharybin [Sun, 8 Dec 2013 07:34:37 +0000 (13:34 +0600)]
Fix T37212: Wrong user counter when more than 32K users

Was a limitation of short data type used for id->us.
Made it to be int, needed to reshuffle fields a bit
because of alignment.

Reviewers: campbellbarton, brecht

Reviewed By: brecht

Maniphest Tasks: T37212

Differential Revision:

7 years agoUtil-defines: avoid multiple calculation/access for MIN/MAX macros
Campbell Barton [Sun, 8 Dec 2013 06:29:22 +0000 (17:29 +1100)]
Util-defines: avoid multiple calculation/access for MIN/MAX macros

7 years agoMath lib: optimize hsv/rgb conversion
Campbell Barton [Sun, 8 Dec 2013 06:20:53 +0000 (17:20 +1100)]
Math lib: optimize hsv/rgb conversion

7 years ago3D Text: delete selection before pasting
Campbell Barton [Sat, 7 Dec 2013 11:57:21 +0000 (22:57 +1100)]
3D Text: delete selection before pasting

7 years agoMinor addition for completeness (unlikely to happen), make sure new
Antony Riakiotakis [Sat, 7 Dec 2013 23:57:44 +0000 (01:57 +0200)]
Minor addition for completeness (unlikely to happen), make sure new
sculpt struct has at least dyntopo subdivision turned on.

7 years agoAdd themable colors for edges in UV editor. Reuse WIRE_EDIT for outlines
Antony Riakiotakis [Sat, 7 Dec 2013 23:36:31 +0000 (01:36 +0200)]
Add themable colors for edges in UV editor. Reuse WIRE_EDIT for outlines
and EDGE_SELECT theme colors for selected edges.

7 years agoFix T37731: some window manager operators unnecessarily required a window to be active.
Brecht Van Lommel [Sat, 7 Dec 2013 22:58:18 +0000 (23:58 +0100)]
Fix T37731: some window manager operators unnecessarily required a window to be active.

7 years agoFix T37326 inversion of image channels did not do an undo push. Now only do an undo...
Antony Riakiotakis [Thu, 5 Dec 2013 20:28:14 +0000 (22:28 +0200)]
Fix T37326 inversion of image channels did not do an undo push. Now only do an undo if we are in image paint mode and use the paint undo stack. Also added missing GPU update.:

7 years agoOSX/scons: forgot Intel CC ( ‘icc’ ) in detection
Jens Verwiebe [Sat, 7 Dec 2013 17:05:27 +0000 (18:05 +0100)]
OSX/scons: forgot Intel CC ( ‘icc’ ) in detection
Todo: perhaps unify this for all OS, but keep in mind:
Apple compiler versions may have other capabilities
than std gcc, llvm, clang ( other versioning also )

7 years agoParticles: change material picking from index number in UI to menu with materials.
Geoffroy Krantz [Sat, 7 Dec 2013 00:51:44 +0000 (01:51 +0100)]
Particles: change material picking from index number in UI to menu with materials.

Also fix material slot index not being properly initialized to 1, this got clamped
from zero only on drawing the UI.

Reviewed By: brecht

Differential Revision:

7 years agoCycles: network render code updated for latest changes and improved
Martijn Berger [Sat, 7 Dec 2013 01:29:53 +0000 (02:29 +0100)]
Cycles: network render code updated for latest changes and improved

This actually works somewhat now, although viewport rendering is broken and any
kind of network error or connection failure will kill Blender.

* Experimental WITH_CYCLES_NETWORK cmake option
* Networked Device is shown as an option next to CPU and GPU Compute
* Various updates to work with the latest Cycles code
* Locks and thread safety for RPC calls and tiles
* Refactored pointer mapping code
* Fix error in CPU brand string retrieval code

This includes work by Doug Gale, Martijn Berger and Brecht Van Lommel.

Reviewers: brecht

Differential Revision:

7 years agoCycles: show remaining render time in render info text
Thomas Laroche [Sat, 7 Dec 2013 01:22:35 +0000 (02:22 +0100)]
Cycles: show remaining render time in render info text

It's a simple estimate, not very precise but that isn't really possible always.
For progressive render it will become more accurate the longer you render.

Reviewed By: brecht

Differential Revision:

7 years agoCode Cleanup: pass rectangles as const in insterface files
Campbell Barton [Sat, 7 Dec 2013 04:47:57 +0000 (15:47 +1100)]
Code Cleanup: pass rectangles as const in insterface files

7 years agoUtil Macros: reduce multiple access & conversion for CLAMP/CLAMPIS/ABS
Campbell Barton [Sat, 7 Dec 2013 03:24:09 +0000 (14:24 +1100)]
Util Macros: reduce multiple access & conversion for CLAMP/CLAMPIS/ABS

7 years agoCompiler warnings: quiet warnings for gcc4.7x
Campbell Barton [Sat, 7 Dec 2013 02:21:59 +0000 (13:21 +1100)]
Compiler warnings: quiet warnings for gcc4.7x
patch from Sergey

7 years agoFix T37722 - Can't undo deleting a screen layout
Joshua Leung [Sat, 7 Dec 2013 00:23:21 +0000 (13:23 +1300)]
Fix T37722 - Can't undo deleting a screen layout

Operations on screen and UI stuff is not actually saved in the undo
files/buffers. Therefore, these shouldn't have the flags set for
getting included for undo and in the last operator settings.

7 years agoCycles / OSL Templates: Add Simplex and Gabor noise templates and remove ones which...
Thomas Dinges [Fri, 6 Dec 2013 17:48:17 +0000 (18:48 +0100)]
Cycles / OSL Templates: Add Simplex and Gabor noise templates and remove ones which are available as regular nodes.

7 years agoOSX/scons: Introduce a new env var 'MACOSX_COMPILER'
Jens Verwiebe [Fri, 6 Dec 2013 16:06:37 +0000 (17:06 +0100)]
OSX/scons: Introduce a new env var 'MACOSX_COMPILER'
This is needed to resolve the real used compiler from the compatibility shim’S or symlinks.
Also set the real CCVERSION as scons CCVERSION would only read the default one, which
is not useful for OSX

7 years agoAlpha channel of a plane track image works fine in MCE now
Sergey Sharybin [Fri, 6 Dec 2013 14:08:37 +0000 (20:08 +0600)]
Alpha channel of a plane track image works fine in MCE now

7 years agoBMesh Py API: add bmesh.geometry.intersect_face_point()
Campbell Barton [Fri, 6 Dec 2013 10:13:11 +0000 (21:13 +1100)]
BMesh Py API: add bmesh.geometry.intersect_face_point()

patch originally by mont29 with some edits.

7 years agoRectangle API: add single axis intersection check
Campbell Barton [Fri, 6 Dec 2013 07:48:55 +0000 (18:48 +1100)]
Rectangle API: add single axis intersection check

7 years agoFix T37710: Missing bounds check for active UI list item could crash.
Campbell Barton [Thu, 5 Dec 2013 23:52:04 +0000 (10:52 +1100)]
Fix T37710: Missing bounds check for active UI list item could crash.

7 years agoAppease grumpy ole gcc 4.7 of MinGW64 (possibly gcc 4.6 of MinGW32 too?)
Antony Riakiotakis [Thu, 5 Dec 2013 21:32:30 +0000 (23:32 +0200)]
Appease grumpy ole gcc 4.7 of MinGW64 (possibly gcc 4.6 of MinGW32 too?)
that cannot convert float to char without false warnings that are turned
into errors with strict flags. I expect that any real conversion
warnings can be caught on linux.

7 years agoRemoved unused Freestyle env_map images.
Tamito Kajiyama [Thu, 5 Dec 2013 22:28:54 +0000 (22:28 +0000)]
Removed unused Freestyle env_map images.

7 years agoForgot to theme-ify color of shadow UVs (color used to draw uvs during
Antony Riakiotakis [Thu, 5 Dec 2013 21:06:41 +0000 (23:06 +0200)]
Forgot to theme-ify color of shadow UVs (color used to draw uvs during
image painting)

7 years agoCorrection to fix of T37688
Sergey Sharybin [Thu, 5 Dec 2013 19:10:16 +0000 (01:10 +0600)]
Correction to fix of T37688

rB68d39a262c90 didn't check correct file for doing
versioning code. It shall check userprefs.blend not

7 years agoCode Cleanup: use strict flags for math lib, add inline declarations
Campbell Barton [Thu, 5 Dec 2013 16:46:27 +0000 (03:46 +1100)]
Code Cleanup: use strict flags for math lib, add inline declarations

7 years agoFix for own error in recent tessellation update.
Campbell Barton [Thu, 5 Dec 2013 14:31:33 +0000 (01:31 +1100)]
Fix for own error in recent tessellation update.

7 years agoFix T37698: Crash from invalid context access when freeing custom
Lukas Tönne [Thu, 5 Dec 2013 14:02:17 +0000 (15:02 +0100)]
Fix T37698: Crash from invalid context access when freeing custom
python nodes on Blender exit.

The nodeFreeNode function is calling a customizable freefunc callback,
which can be implemented by python. However, the context is invalid when
using this callback while the node tree data block is freed on exit.
Luckily it is also not necessary: When freeing the bNodeTree data blocks
all that is needed is freeing of the DNA data, no other side effects
should happen. So now disable the api callbacks when freeing nodes in
the ntreeFreeTree function.

Also some minor cleanup: checking node->typeinfo is not necessary, all
nodes will always have a valid typeinfo pointer - if a node type is
unknown this will be a stub bNodeType to avoid the need for such checks.

7 years agoFix T37688: User Preferences do not load correctly
Sergey Sharybin [Thu, 5 Dec 2013 13:32:48 +0000 (19:32 +0600)]
Fix T37688: User Preferences do not load correctly

Issue was caused by from_memory=true passing to wm_homefile_read
in case there's a configuration folder for current blender.

But the thing is, we still might fallback to reading home file
from memory (i.e. in cases there's no startup.blend in config

In this case we still need to run versioning code for userprefs.

7 years agoFix T37703: Shadow pass output image is mangled.
Sergey Sharybin [Thu, 5 Dec 2013 11:31:01 +0000 (17:31 +0600)]
Fix T37703: Shadow pass output image is mangled.

Was a mistake in own optimization commit.

7 years agoBlender Internal: Fix for rendered view crash that happens when changing screen or...
IRIE Shinsuke [Thu, 5 Dec 2013 06:22:55 +0000 (15:22 +0900)]
Blender Internal: Fix for rendered view crash that happens when changing screen or area type

This crash is very similar to T36936.  If changing screen or area type
buried the rendered view, popping up it again may cause the crash by
corrupted render database.

7 years agoUser Interface: Ctrl+C over a menu copies the py command
Campbell Barton [Thu, 5 Dec 2013 06:26:03 +0000 (17:26 +1100)]
User Interface: Ctrl+C over a menu copies the py command

also use bools rather then ints

7 years agoCompiler warnings: quiet float/double conversion warning
Campbell Barton [Wed, 4 Dec 2013 23:34:30 +0000 (10:34 +1100)]
Compiler warnings: quiet float/double conversion warning

7 years agoOSX/scons: fix misdesigned version detection of compiler ( todo: do with submodule...
Jens Verwiebe [Wed, 4 Dec 2013 22:15:29 +0000 (23:15 +0100)]
OSX/scons: fix misdesigned version detection of compiler ( todo: do with submodule ), fix a compiler warning with clang < 5”

7 years agoFix T37189: Inconsistent icons for Force field
Sergey Sharybin [Wed, 4 Dec 2013 19:24:05 +0000 (01:24 +0600)]
Fix T37189: Inconsistent icons for Force field

There's still an issue with Curve Guide force field
which you can not so easily change type from/to.

This i would consider TODO for later.

7 years agoFix T37680: Texture image scale is not refreshing
Sergey Sharybin [Wed, 4 Dec 2013 17:17:59 +0000 (23:17 +0600)]
Fix T37680: Texture image scale is not refreshing

7 years agoAdd alloca include for MSVC
Campbell Barton [Wed, 4 Dec 2013 16:44:51 +0000 (03:44 +1100)]
Add alloca include for MSVC

7 years agoFix for EWA (elliptical weighted average) sampling in the compositor.
Lukas Tönne [Wed, 4 Dec 2013 15:05:56 +0000 (16:05 +0100)]
Fix for EWA (elliptical weighted average) sampling in the compositor.

EWA sampling is designed for downsampling images, i.e. scaling down the size of
input image pixels, which happens regularly in compositing. While the standard
sampling methods (linear, cubic) work reasonably well for linear
transformations, they don't yield good results in non-linear cases like
perspective projection or arbitrary displacement. EWA sampling is comparable to
mipmapping, but avoids problems with discontinuities.

To work correctly the EWA algorithm needs partial derivatives of the mapping
functions which convert output pixel coordinates back into the input image
space (2x2 Jacobian matrix). With these derivatives the EWA algorithm
projects ellipses into the input space and accumulates colors over their
area. This calculation was not done correctly in the compositor, only the
derivatives du/dx and dv/dy were calculation, basically this means it only
worked for non-rotated input images.

The patch introduces full derivative calculations du/dx, du/dy, dv/dx, dv/dy for
the 3 nodes which use EWA sampling currently: PlaneTrackWarp, MapUV and
Displace. In addition the calculation of ellipsis area and axis-aligned
bounding boxes has been fixed.

For the MapUV and Displace nodes the derivatives have to be estimated by
evaluating the UV/displacement inputs with 1-pixel offsets, which can still have
problems on discontinuities and sub-pixel variations. These potential problems
can only be alleviated by more radical design changes in the compositor
functions, which are out of scope for now. Basically the values passed to the
UV/Displacement inputs would need to be associated with their 1st order
derivatives, which requires a general approach to derivatives in all nodes.

7 years agoFix T37690: UI does not immediatelly reflect new length of effect strip
Sergey Sharybin [Wed, 4 Dec 2013 14:47:23 +0000 (20:47 +0600)]
Fix T37690: UI does not immediatelly reflect new length of effect strip

7 years agoFix for interpolation errors on lower-left borders in compositor image
Lukas Tönne [Wed, 4 Dec 2013 10:56:36 +0000 (11:56 +0100)]
Fix for interpolation errors on lower-left borders in compositor image

Problem is that all image buffer reader nodes (RenderLayer, Image,
MovieClip) were clipping pixel coordinates to 0..N range (N being width
or height respectively). Bilinear interpolation works ok then on the
upper-right borders (x, N) and (N, y), since the last (N-1) pixel fades
out to N (background). But the lower-left (x, 0) and (0, y) borders are
not correctly interpolated because the nodes cut off the negative pixels
before the interpolation function can calculate their value.

To fix this, the interpolation functions are now entirely responsible
for handling "out of range" cases, i.e. setting (0,0,0,0) results for
invalid pixels, while also handling interpolation for borders.
Callers should not do pixel range checks themselves, which also makes
the code simpler. Should not have any real performance penalty,
the interpolation functions do this check anyway, so is probably even
slightly faster.

7 years agoCode cleanup: remove unused color management functions
Sergey Sharybin [Wed, 4 Dec 2013 09:57:54 +0000 (15:57 +0600)]
Code cleanup: remove unused color management functions

7 years agoCompiler Warnings: disallow 'long' in DNA, its not reliably 64bit (gcc only)
Campbell Barton [Wed, 4 Dec 2013 02:51:41 +0000 (13:51 +1100)]
Compiler Warnings: disallow 'long' in DNA, its not reliably 64bit (gcc only)

7 years agoUser interface: internal change, collect panels to draw before drawing.
Campbell Barton [Wed, 4 Dec 2013 00:54:56 +0000 (11:54 +1100)]
User interface: internal change, collect panels to draw before drawing.

avoids calling poll twice, in some cases

7 years agoFix UI bug with 'socket menus' (used e.g. by cycles' Material panels).
Bastien Montagne [Tue, 3 Dec 2013 23:00:09 +0000 (00:00 +0100)]
Fix UI bug with 'socket menus' (used e.g. by cycles' Material panels).

Also tweaked a bit how nodes with more than one socket available are drawn:
* The node entry itself (a label) has no more any icon, so that it is aligned with the other single-socket nodes.
* The sub-entries (i.e. node's sockets) are more clearly indented (using a blank icon).

Another case of bad internal UI_HAS_ICON flag erasing by brutally assigning an uneeded value to but->flag.
Revealed by recent split of some button flags into but->drawflag.

Thanks to Thomas Dinge for noting the issue.

7 years agoCode Cleanup: correct fabsf/fabs/abs use
Campbell Barton [Tue, 3 Dec 2013 22:23:29 +0000 (09:23 +1100)]
Code Cleanup: correct fabsf/fabs/abs use

7 years agoUsual UI messages fixes & tweaks.
Bastien Montagne [Tue, 3 Dec 2013 21:42:58 +0000 (22:42 +0100)]
Usual UI messages fixes & tweaks.

7 years agoCleanup: Internal degrees removal.
Bastien Montagne [Tue, 3 Dec 2013 19:09:25 +0000 (20:09 +0100)]
Cleanup: Internal degrees removal.

This patch changes most of the reamining degrees usage in internal code into radians.
I let a few which I know off asside, for reasons explained below - and I'm not sure to have found out all of them.

WARNING: this introduces forward incompatibility, which means files saved from this version won't open 100% correctly
         in previous versions (a few angle properties would use radians values as degrees...).

- Data:
-- Lamp.spotsize: Game engine exposed this setting in degrees, to not break the API here I kept it as such
                  (using getter/setter functions), still using radians internally.
-- Mesh.smoothresh: Didn't touch to this one, as we will hopefully replace it completely by loop normals currently in dev.

- Modifiers:
-- EdgeSplitModifierData.split_angle, BevelModifierData.bevel_angle: Done.

- Postprocessing:
-- WipeVars.angle (sequencer's effect), NodeBokehImage.angle, NodeBoxMask.rotation, NodeEllipseMask.rotation: Done.

- BGE:
-- bConstraintActuator: Orientation type done (the minloc[0] & maxloc[0] cases). Did not touch to 'limit location' type,
                        it can also limit rotation, but it exposes through RNA the same limit_min/limit_max, which hence
                        can be either distance or angle values, depending on the mode. Will leave this to BGE team.
-- bSoundActuator.cone_outer_angle_3d, bSoundActuator.cone_inner_angle_3d: Done (note I kept degrees in BGE itself,
                                                                           as it seems this is the expected value here...).
-- bRadarSensor.angle: Done.

Reviewers: brecht, campbellbarton, sergey, gaiaclary, dfelinto, moguri, jbakker, lukastoenne, howardt

Reviewed By: brecht, campbellbarton, sergey, gaiaclary, moguri, jbakker, lukastoenne, howardt
Thanks to all!

Differential Revision:

7 years agoFix T37663: Black matcap when object located on a curve
Sergey Sharybin [Tue, 3 Dec 2013 16:14:16 +0000 (22:14 +0600)]
Fix T37663: Black matcap when object located on a curve

Issue was caused by GLSL samplers not valid anymore after
dupliobject was drawn into OpenGL displist.

Solution for now is to not use displist for active object
when matcap is used.

The same issue exists for regular GLSL viewport draw, and
this was solved by disabling diplist if draw_glsl_material
returns truth for current dupliobject.

Reviewers: brecht

Reviewed By: brecht

Maniphest Tasks: T37663

Differential Revision:

7 years agoFix T37670: Paint mode + procedural map colours error
Sergey Sharybin [Tue, 3 Dec 2013 16:13:15 +0000 (22:13 +0600)]
Fix T37670: Paint mode + procedural map colours error

Seems to be known TODO in the code, but no idea why it
was never solved, especially since tweak is so much easy.

It might be arguable that we need to support painting
color space, but it's still much better to convert to
sRGB space. It's gonna to cover 90% of cases anyway.

Reviewers: campbellbarton, brecht

Reviewed By: brecht

Maniphest Tasks: T37670

Differential Revision:

7 years agoKeymap: add walk mode
Campbell Barton [Tue, 3 Dec 2013 13:40:45 +0000 (00:40 +1100)]
Keymap: add walk mode

7 years agoCode cleanup: replace rectf_scale with BLI_rctf_scale
Campbell Barton [Tue, 3 Dec 2013 12:53:21 +0000 (23:53 +1100)]
Code cleanup: replace rectf_scale with BLI_rctf_scale

and add area arg to ui_handler_panel_region

7 years agoCode Cleanup: python import formatting
Campbell Barton [Tue, 3 Dec 2013 12:45:38 +0000 (23:45 +1100)]
Code Cleanup: python import formatting

7 years agoView Navigation: Walk and Fly modes
Dalai Felinto [Tue, 3 Dec 2013 05:14:09 +0000 (03:14 -0200)]
View Navigation: Walk and Fly modes

This is a addtion to the dynamic fly mode.
It behaves as the first person navigation system available in most 3d world  games nowadays.

You can alternate between the old mode (Fly) and the new mode (Walk) in User Preferences > Inputs


WASD (hold)  - Move forward/backward and straft left/right
QE (hold)    - Move up and down
Tab          - Alternate between Walk and Fly modes
Shift (hold) - Speed up movement
Alt (hold)   - Slow down movement
Space or MMB - Teleport
V            - Jump
+/- or mouse wheel - speed increase/decrease speed for this Blender session

User Preferences Options:
Navigation Mode   - fly/walk navigation systems (fly is the old, walk is the new, next options are for walk mode only)
Gravity           - alternate between free navigation and walk with gravity modes
Mouse Sensitivity - sensitivity factor to mouse influence to look around
Teleport Duration - how long the teleport lasts
Camera Height     - camera height to use in gravity mode
Jump Height       - maximum jump speed in m/s
Move Speed        - base move speed in m/s
Boost Factor      - multiplication factor when running or going slow (1/boost)

Development Notes:
* The initial code was based on view3d_fly.c.
* The NDoF code was not touched, so it most likely is not working.

Pending Issues:
* Draw in the UI the shortcut options, and current values (e.g., Mode: Fly/Walk)
  (we need a proper API for that)
* OSX seems to present issues if we re-center the mouse every time. We implemented a workaround for that, but a real fix would be welcome.

Code reviewed and with collaborations from Campbell Barton - @campbellbarton
Differential Revision:

7 years agoCode Cleanup: minor changes fly-mode edits, use copy_v3_fl3, remove comments
Campbell Barton [Tue, 3 Dec 2013 02:37:04 +0000 (13:37 +1100)]
Code Cleanup: minor changes fly-mode edits, use copy_v3_fl3, remove comments

7 years agoCode Cleanup: remove redundant/misleading NULL checks
Campbell Barton [Mon, 2 Dec 2013 22:22:29 +0000 (09:22 +1100)]
Code Cleanup: remove redundant/misleading NULL checks

7 years agoCode Cleanup: use BLI_strncpy when copying into fixed sized buffers
Campbell Barton [Mon, 2 Dec 2013 22:12:44 +0000 (09:12 +1100)]
Code Cleanup: use BLI_strncpy when copying into fixed sized buffers

7 years agoUser Interface: error in own recent commit, replacing loop with memset
Campbell Barton [Mon, 2 Dec 2013 22:10:55 +0000 (09:10 +1100)]
User Interface: error in own recent commit, replacing loop with memset

7 years agoKnife Tool: incorrect sized vector args (harmless but misleading)
Campbell Barton [Mon, 2 Dec 2013 22:10:03 +0000 (09:10 +1100)]
Knife Tool: incorrect sized vector args (harmless but misleading)

7 years agoLaplacian Deform Modifier: fix possible NULL pointer dereference.
Campbell Barton [Mon, 2 Dec 2013 22:06:22 +0000 (09:06 +1100)]
Laplacian Deform Modifier: fix possible NULL pointer dereference.

7 years agoFix for crash pasting text into uilist filter
Campbell Barton [Mon, 2 Dec 2013 14:48:05 +0000 (01:48 +1100)]
Fix for crash pasting text into uilist filter

7 years agoUser Preferences: grey out Mouse Over options if option is unchecked.
Scott Petrovic [Mon, 2 Dec 2013 14:23:06 +0000 (15:23 +0100)]
User Preferences: grey out Mouse Over options if option is unchecked.

Reviewed By: brecht

Differential Revision:

7 years ago3D View: use proper units for viewport lens length, matching the camera property.
Scott Petrovic [Mon, 2 Dec 2013 14:20:27 +0000 (15:20 +0100)]
3D View: use proper units for viewport lens length, matching the camera property.

Reviewed By: brecht

Differential Revision:

7 years agoBevel: add width consistency pass.
Howard Trickey [Mon, 2 Dec 2013 12:16:49 +0000 (07:16 -0500)]
Bevel: add width consistency pass.

When the desired widths (offsets) of beveled edges cannot be
satisfied, often because we want them to meet on an intermediate
non-beveled edge, we need to compromise on the widths somehow.
This code changes the compromise to minimize the sum of squares
of errors in the offsets.  It also adds a global width consistency
pass: starting from a vertex that needed width adjustment, it
uses a breadth-first search to try to propagate the adjustments
and keep the bevel widths from having to taper along the edges.

Also fixed a case where a reflex angle would cause bad results.
Also fixed the way the 'percentage' width method was calculated.