6 years agoPyAPI: don't adjust prefs when an fails to load
Campbell Barton [Fri, 23 Jan 2015 10:09:31 +0000 (21:09 +1100)]
PyAPI: don't adjust prefs when an fails to load

Recent addons commit meant that addons would be enabled even if they weren't found.
This would give an error (which is fine), but also remove from preferences.

6 years agoCycles: Don't re-generate blackbody/beckmann tables on every shaders update
Sergey Sharybin [Fri, 23 Jan 2015 09:00:48 +0000 (14:00 +0500)]
Cycles: Don't re-generate blackbody/beckmann tables on every shaders update

This commit makes it so blackbody and beckmann lookup tables are stored on CPU
after being generated and then only being copied to the device if needed.

This solves lag of viewport update when tweaking shader tree by using 266KB of
CPU memory.

6 years agoPyAPI: avoid scanning all addons on startup
Campbell Barton [Fri, 23 Jan 2015 05:20:37 +0000 (16:20 +1100)]
PyAPI: avoid scanning all addons on startup

Gives small speedup

6 years agoPyAPI: use set.discard instead of set-subtraction
Campbell Barton [Fri, 23 Jan 2015 05:37:00 +0000 (16:37 +1100)]
PyAPI: use set.discard instead of set-subtraction

6 years agoPyAPI: Replace importlib.reload, not 'imp'
Campbell Barton [Fri, 23 Jan 2015 05:34:08 +0000 (16:34 +1100)]
PyAPI: Replace importlib.reload, not 'imp'

6 years agoCleanup: replace deprecated imp -> importlib
Campbell Barton [Fri, 23 Jan 2015 01:37:58 +0000 (12:37 +1100)]
Cleanup: replace deprecated imp -> importlib

6 years agoSet bAction.chanbase to deprecated
Campbell Barton [Thu, 22 Jan 2015 23:52:20 +0000 (10:52 +1100)]
Set bAction.chanbase to deprecated

6 years agoTheme Flatty Light
Pablo Vazquez [Thu, 22 Jan 2015 22:49:49 +0000 (23:49 +0100)]
Theme Flatty Light

As discussed, welcome flatty light to master!

6 years agoFix: Joining armatures fixes up the drivers accordingly
Joshua Leung [Thu, 22 Jan 2015 13:33:01 +0000 (02:33 +1300)]
Fix: Joining armatures fixes up the drivers accordingly

Finally! At long last, I've gotten this working! This ended up being far trickier
to get right than anticipated; the normal remapping API's cannot be used as-is
as they will just clobber over subtleties whenever datablock changes are involved.
So, for now, we have to duplicate the logic a bit.

6 years agoWIP: Attempt to get driver links remapped correctly when joining armatures
Joshua Leung [Thu, 22 Jan 2015 09:04:16 +0000 (22:04 +1300)]
WIP: Attempt to get driver links remapped correctly when joining armatures

Now, RNA Paths and driver targets get corrected, but at the expense of this
always happening (i.e. even for those affecting drivers which existed before).

6 years agoFix: Joining armatures wasn't updating Action Constraints properly
Joshua Leung [Wed, 21 Jan 2015 13:29:18 +0000 (02:29 +1300)]
Fix: Joining armatures wasn't updating Action Constraints properly

The code here was still trying to access ancient 2.4x "action channels" to rename
them. Now, this renames the relevant FCurves instead.

6 years agoCycles: Fix compilation error with some compilers
Sergey Sharybin [Thu, 22 Jan 2015 12:04:01 +0000 (17:04 +0500)]
Cycles: Fix compilation error with some compilers

Not sure why this was not visible previously, but the change is
logical anyway.

6 years agoCTests: Add render tests for Cycles
Sergey Sharybin [Thu, 22 Jan 2015 10:53:49 +0000 (15:53 +0500)]
CTests: Add render tests for Cycles

The idea is to use the set of really small images from the lib folder
and run Cycles render on them comparing render output to reference
images in the tests repository.

For sure same thing could become more generic for BI or Freestyle
render engines.

Thanks Campbell for review and code tweaks!

6 years agoCMake: Auto-detect path to idiff application in FindOpenImageIO.cmake
Sergey Sharybin [Thu, 22 Jan 2015 10:52:50 +0000 (15:52 +0500)]
CMake: Auto-detect path to idiff application in FindOpenImageIO.cmake

Not used at this moment, but will be real soon with new ctests.

6 years agoQuit blender with non-zero exit code if tryign to use non-existing render engine...
Sergey Sharybin [Thu, 22 Jan 2015 10:23:09 +0000 (15:23 +0500)]
Quit blender with non-zero exit code if tryign to use non-existing render engine via the command line

6 years agoFix T43357: Cycles crash with spatial splits after recent changes
Sergey Sharybin [Thu, 22 Jan 2015 09:56:00 +0000 (14:56 +0500)]
Fix T43357: Cycles crash with spatial splits after recent changes

When doing BVH leaf node split we can't rely on leaf size limit from
BVH parameters in case there's spatial split enabled.

This commit basically reverts previous optimization change here which
used stack-allocated memory and uses heap-allocated vector now.

It's possible to boost this code up again by using own allocator.

6 years agoCycles: Add assert check to triangle packing
Sergey Sharybin [Thu, 22 Jan 2015 09:27:13 +0000 (14:27 +0500)]
Cycles: Add assert check to triangle packing

Handy for troubleshooting.

6 years agoFix T43120: Cycles mapping node rotation order is different from viewport
Sergey Sharybin [Thu, 15 Jan 2015 08:23:33 +0000 (13:23 +0500)]
Fix T43120: Cycles mapping node rotation order is different from viewport

Root of the issue goes to the fact that since the very beginning Cycles was
using ZYX euler rotation for mapping shader node but blender was always
using XYZ euler rotation.

This commit switches Cycles to use XYZ euler order and adds versioning code
to preserve backward compatibility.

There was no really nice solution here because either we're ending up with
versioning code or we'll need to deal with all sort of exceptions from blender
side in order to support ZYX order for the mapping node. The latest one is
also creepy from the other render engines points of view -- that might break
compatibility with existing bindings or introduce some extra headache for them
in the future.

This could also become a PITA for us with need of supporting all sort of weird
and wonderful exceptions in the refactored viewport project.

NOTE: This commit breaks forward compatibility, meaning opening new files in
older blender might not give proper result if Mapping node was used.

Also, libraries are to be re-saved separately from the scene file, otherwise
versioning code for them wouldn't run if scene file was re-saved with new
version of blender.

Reviewers: brecht, juicyfruit, campbellbarton

Reviewed By: campbellbarton

Differential Revision:

6 years agoCleanup / Cycles: Code de-duplication for graph node relinking.
Thomas Dinges [Thu, 22 Jan 2015 08:58:11 +0000 (09:58 +0100)]
Cleanup / Cycles: Code de-duplication for graph node relinking.

Differential Revision:

6 years agoExpose shading node shading compatibility to the RNA
Sergey Sharybin [Thu, 22 Jan 2015 08:48:20 +0000 (13:48 +0500)]
Expose shading node shading compatibility to the RNA

This way it is possible to probe shading compatibility of a given node from
python, making things like versioning code much easier to perform.

it's only valid for shading nodes, for other nodes the property also exists
but reads as an empty enum.

To access this compatibilities:


6 years agoFix: Audaspace threw an exception for files it could not open.
Jörg Müller [Thu, 22 Jan 2015 05:57:56 +0000 (18:57 +1300)]
Fix: Audaspace threw an exception for files it could not open.

6 years agoDocs: touch ups in the bge.render doc introduction
Dalai Felinto [Thu, 22 Jan 2015 05:20:39 +0000 (03:20 -0200)]
Docs: touch ups in the bge.render doc introduction

6 years agobge.render.getStereoEye() and bge.types.LEFT_EYE/RIGHT_EYE
Dalai Felinto [Thu, 22 Jan 2015 04:42:40 +0000 (02:42 -0200)]
bge.render.getStereoEye() and bge.types.LEFT_EYE/RIGHT_EYE

This function allows the user to run specific code for each of the
rendered stereoscopic eyes in the Game Engine.

The initial use case is to set the camera projection matrix in
a scene.pre_draw callback function for each eye, to be used in VR
(Virtual Reality) installations.

Reviewed by Mitchell Stokes and Campbell Barton, thank you guys.

Sample Test Python Script:
import bge
import bgl
import blf

def init():
    """init function - runs once"""
    scene = bge.logic.getCurrentScene()

def write():
    """write on screen - depending on the eye"""
    width = bge.render.getWindowWidth()
    height = bge.render.getWindowHeight()

    # OpenGL setup
    bgl.gluOrtho2D(0, width, 0, height)

    eye = bge.render.getStereoEye()

    if eye == bge.render.LEFT_EYE:
        blf.position(0, (width * 0.2), (height * 0.3), 0)
        blf.size(0, 40, 72)
        blf.draw(0, "Left")

    else: # bge.render.RIGHT_EYE:
        blf.position(0, (width * 0.7), (height * 0.3), 0)
        blf.size(0, 40, 72)
        blf.draw(0, "Right")

6 years agoerror in last commit (missed in review)
Campbell Barton [Wed, 21 Jan 2015 23:56:52 +0000 (10:56 +1100)]
error in last commit (missed in review)

6 years agoOutliner: use enum for outliner_data_operation()
Campbell Barton [Wed, 21 Jan 2015 23:47:53 +0000 (10:47 +1100)]
Outliner: use enum for outliner_data_operation()

No functional change, D997 by @lichtwerk

6 years agoCycles: Support tube projection for images
Sergey Sharybin [Wed, 21 Jan 2015 19:37:09 +0000 (00:37 +0500)]
Cycles: Support tube projection for images

This way Cycles finally becomes feature-full on image projections
compared to Blender Internal and Gooseberry Project Team could
finally finish the movie.

6 years agoCycles: Support sphere mapping for the image texture
Sergey Sharybin [Wed, 21 Jan 2015 17:44:30 +0000 (22:44 +0500)]
Cycles: Support sphere mapping for the image texture

6 years agoCycles: Optimization for black world backgrounds
Thomas Dinges [Wed, 21 Jan 2015 19:06:53 +0000 (20:06 +0100)]
Cycles: Optimization for black world backgrounds

* If a Background node is set to a black color or zero strength,
it now gets removed from the shader graph.

* In case the graph is empty (no background node), the kernel will skip
evaluating it and save some rendertime. This can help quite a bit in scenes,
where the majority of the image consists of a black background.

In this case the render is ~16% faster.

Differential Revision:

6 years agoCleanup of BGE code CcdPhysicsEnvironment::CallbackTriggers()
Sybren A. Stüvel [Wed, 21 Jan 2015 17:42:24 +0000 (18:42 +0100)]
Cleanup of BGE code CcdPhysicsEnvironment::CallbackTriggers()

Refactored some code to be easier to read. Semantically the code is

  - Some conditions were negated to be able to return/continue early,
    rather than having the majority of the code inside an if-body.
  - Conditions were simplified (!(a == b)) turned into (a != b);
    repeated conditions calculated only once.
  - Unnecessary variables and one unnecessary condition were

Reviewers: campbellbarton, lordloki

Reviewed By: lordloki

Projects: #game_physics

Differential Revision:

6 years agoCMake/MSVC: Quotes around the path
Campbell Barton [Wed, 21 Jan 2015 14:52:17 +0000 (01:52 +1100)]
CMake/MSVC: Quotes around the path

D940 by @TeeTrizZz

6 years agoFix: Joining armatures loses drivers
Joshua Leung [Wed, 21 Jan 2015 13:08:29 +0000 (02:08 +1300)]
Fix: Joining armatures loses drivers

Currently, when joining two armatures, the drivers of the armatures being merged
in are lost. This commit introduces a new AnimData API function for merging
animation data into another AnimData block.

* For now, this only copies the drivers over. As a result, manual effort will
  still be needed to go through and fix the drivers.

  I am working on automating that process, but it's more important that the
  drivers don't have to be created from scratch for now (since this is needed
  for the Goosberry rigging work).

6 years agoAdded new debug flag which can be used to lazy-init the SimDebug drawing.
Lukas Tönne [Wed, 21 Jan 2015 13:00:59 +0000 (14:00 +0100)]
Added new debug flag which can be used to lazy-init the SimDebug drawing.

A development addon can be used now to enable the debug drawing, without
the need to add UI code for this in the release files.

The SimDebug feature should also get an overall build flag and use
function stubs unless enabled. That way any possibility of overhead in
releases is eliminated.

6 years agoFix limit check before accessing array in opennl
Martin Ettl [Wed, 21 Jan 2015 12:18:39 +0000 (17:18 +0500)]
Fix limit check before accessing array in opennl

Please note that opennl is already modified (for double precision)
so re-integration is not really easy. Also, we'll eventually switch
to Eigen.

For until that let's just solve the condition in our bundled opennl.

6 years agoFix T43158: pixels in the 3d-view was mis-aligned
Campbell Barton [Wed, 21 Jan 2015 12:01:50 +0000 (23:01 +1100)]
Fix T43158: pixels in the 3d-view was mis-aligned

Change the pixel offset for regions, it make oversampling blurry when drawing pixel aligned values.
See T41749

6 years agoRemoved generic debug1..4 values from the cloth data.
Lukas Tönne [Wed, 21 Jan 2015 09:07:11 +0000 (10:07 +0100)]
Removed generic debug1..4 values from the cloth data.

These were used as UI buttons during development. If such parameters are
needed again later they should instead be added in the (now global)
SimDebugData and made accessible with a dev addon or so.

6 years agoUI: support alt+wheel for expanded enums
Campbell Barton [Wed, 21 Jan 2015 05:27:21 +0000 (16:27 +1100)]
UI: support alt+wheel for expanded enums

6 years agoFix T43247: Don't open pulldown when a popup overlaps it
julianeisel [Wed, 21 Jan 2015 02:45:00 +0000 (03:45 +0100)]
Fix T43247: Don't open pulldown when a popup overlaps it

Auto-opening of pulldown menus didn't take overlapping popups into account.

6 years agoBKE_screen: add BKE_screen_find_area_xy
Campbell Barton [Wed, 21 Jan 2015 02:43:46 +0000 (13:43 +1100)]
BKE_screen: add BKE_screen_find_area_xy

Use from eyedropper & screen operators
also define SPACE_TYPE_ANY for readability.

6 years agoFix Python CTest's, ignore 'addons_contrib'
Campbell Barton [Wed, 21 Jan 2015 01:56:30 +0000 (12:56 +1100)]
Fix Python CTest's, ignore 'addons_contrib'

Too many contrib addons are in an unstable state making the test not so useful.

Thanks to Sergey initial patch: D1012, redid mostly - but outcome is the same.

6 years agoRemove 'addons_extern' was used before git move
Campbell Barton [Wed, 21 Jan 2015 01:56:03 +0000 (12:56 +1100)]
Remove 'addons_extern' was used before git move

6 years agoCleanup: style
Campbell Barton [Wed, 21 Jan 2015 00:57:11 +0000 (11:57 +1100)]
Cleanup: style

6 years agoUpdate icons after recent cleanup in svg file.
Bastien Montagne [Tue, 20 Jan 2015 20:49:57 +0000 (21:49 +0100)]
Update icons after recent cleanup in svg file.

Note differences in those five icons are invisible by eye, just for sake of consistency.

6 years agoCleanup SVG icon file, pass II.
Bastien Montagne [Tue, 20 Jan 2015 19:05:54 +0000 (20:05 +0100)]
Cleanup SVG icon file, pass II.

Name each icon group from its define in Blender.

Simplifies searching for a given icon (in one way or the other), and could also be
useful one day in some scripting.

Also, removed/fixed more empty and stray groups...

Finally, found that we have several svg icons not linked to any defines, and one define
with no icon (dyntopo), would be nice to sort this one way or the other too.

6 years agoCleanup SVG icons file: pass I.
Bastien Montagne [Tue, 20 Jan 2015 14:18:34 +0000 (15:18 +0100)]
Cleanup SVG icons file: pass I.

Made sure each icon has its own, 'private' group.
Removed empty groups, and some stray paths and rects (among other benefits,
'make icons' do not generate anymore that half o dozen of empty icons one had to remove
by hand before committing ;) ).

Note: double checked, only five generated icons differ (on binary level) from before,
with no actual visual diff.

6 years agoMade SimDebugData into a single global instance.
Lukas Tönne [Tue, 20 Jan 2015 17:29:31 +0000 (18:29 +0100)]
Made SimDebugData into a single global instance.

This way it doesn't have to be stored as DNA runtime pointers or passed
down as a function argument. Currently there is now no property or
button to enable debugging, this will be added again later.

6 years agoOutliner: "Show Active" - if active is a child, open tree to show child
julianeisel [Tue, 20 Jan 2015 16:32:54 +0000 (17:32 +0100)]
Outliner: "Show Active" - if active is a child, open tree to show child

Previously, if the active object was a child, "Show Active" only showed the
parent object. Now it also opens the tree to take children into account.

Patch D974 by @lichtwerk with some minor edits, reviewed by me.

6 years agoFix for BI rendering of hair spirals: Was not taking the extra points
Lukas Tönne [Tue, 20 Jan 2015 15:38:03 +0000 (16:38 +0100)]
Fix for BI rendering of hair spirals: Was not taking the extra points
into account.

6 years agoDe-duplicate large block of shared code for GL vert attribs
Nicholas Bishop [Tue, 20 Jan 2015 13:17:08 +0000 (14:17 +0100)]
De-duplicate large block of shared code for GL vert attribs

Code in ccgdm_draw_attrib_vertex() was entirely the same as the top
portion of the code in cddm_draw_attrib_vertex(). Moved this code to a
new function, DM_draw_attrib_vertex().

ccgdm_draw_attrib_vertex() was removed in favor of calling
DM_draw_attrib_vertex(). cddm_draw_attrib_vertex() still does a couple
extra things, so it still exists but calls DM_draw_attrib_vertex().

In the interest of easy code review, no changes made to the code in
DM_draw_attrib_vertex() other than the new name and an added comment.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision:

6 years agoFix UI glitch: Ctrl/Shift didnt refresh the UI
Campbell Barton [Tue, 20 Jan 2015 12:02:15 +0000 (23:02 +1100)]
Fix UI glitch: Ctrl/Shift didnt refresh the UI

6 years agoFix transform glitch: Ctrl/Shift didn't refresh
Campbell Barton [Tue, 20 Jan 2015 12:14:06 +0000 (23:14 +1100)]
Fix transform glitch: Ctrl/Shift didn't refresh

6 years agoCleanup: use const
Campbell Barton [Tue, 20 Jan 2015 11:41:30 +0000 (22:41 +1100)]
Cleanup: use const

6 years agoFix for crash when using virtual parent hairs and clumping.
Lukas Tönne [Tue, 20 Jan 2015 10:42:33 +0000 (11:42 +0100)]
Fix for crash when using virtual parent hairs and clumping.

The paths for parents and children are generated using the same function
with a rather obscure test to distinguish them. Modifiers (clump, kink,
roughness) should not be applied to parents though.

6 years agoCleanup: warnings
Campbell Barton [Tue, 20 Jan 2015 10:06:21 +0000 (21:06 +1100)]
Cleanup: warnings

6 years agoCode cleanup: Unused variable in RNA callback
Sergey Sharybin [Tue, 20 Jan 2015 10:05:39 +0000 (15:05 +0500)]
Code cleanup: Unused variable in RNA callback

6 years agoFix T42844: Compositor scale offset
Sergey Sharybin [Tue, 20 Jan 2015 09:46:21 +0000 (14:46 +0500)]
Fix T42844: Compositor scale offset

Different interpolation methods in compositor could lead to 0.5 pixel offset in
final renders. This is because of some inconsistency in integer coordinates
which might mean pixel corner or pixel center.

Should be all fine now.

6 years agoFixed missing import in particles UI script.
Lukas Tönne [Tue, 20 Jan 2015 09:36:05 +0000 (10:36 +0100)]
Fixed missing import in particles UI script.

6 years agoFix error in freestyle api
Campbell Barton [Tue, 20 Jan 2015 08:53:29 +0000 (19:53 +1100)]
Fix error in freestyle api

6 years agoFixed merge errors.
Lukas Tönne [Tue, 20 Jan 2015 08:38:39 +0000 (09:38 +0100)]
Fixed merge errors.

6 years agoFix for incorrect DNA field name in versioning, causes constant
Lukas Tönne [Mon, 19 Jan 2015 14:09:44 +0000 (15:09 +0100)]
Fix for incorrect DNA field name in versioning, causes constant
resetting of clump noise size on reload.


6 years agoUse separate flags to enable/disable clump and roughness curves for
Lukas Tönne [Mon, 19 Jan 2015 12:32:53 +0000 (13:32 +0100)]
Use separate flags to enable/disable clump and roughness curves for
child hairs.

This allows disabling the curves temporarily without losing the setup.


6 years agoFix for slow deformation-motionblur in Cycles using the new spiral kink
Lukas Tönne [Fri, 16 Jan 2015 15:04:10 +0000 (16:04 +0100)]
Fix for slow deformation-motionblur in Cycles using the new spiral kink

This was caused by variation of the number of keys on child hairs due
to shortening of hair curves based on euclidian distances. The other
kink modes also shorten hairs, but use the parametric distance instead,
which does not vary with deformation of hairs.

6 years agoSecond variant of the copy-to-select operator for particles to only
Lukas Tönne [Fri, 16 Jan 2015 10:42:13 +0000 (11:42 +0100)]
Second variant of the copy-to-select operator for particles to only
copy the active particle system (and not remove existing in the process).

6 years agoMake removal of existing particle systems on copying optional.
Lukas Tönne [Fri, 16 Jan 2015 10:07:00 +0000 (11:07 +0100)]
Make removal of existing particle systems on copying optional.

This will be most useful when copying individual particle systems
one-by-one (to be implemented).

6 years agoAdded space selection option to the particle system copy operator.
Lukas Tönne [Thu, 15 Jan 2015 19:36:51 +0000 (20:36 +0100)]
Added space selection option to the particle system copy operator.

By default this now copies from one object's local space to another
object's local space (instead of the previous world space). This is
more useful when transferring particles between objects, because it
doesn't require moving objects on top of each other, as long as they
have similar shapes.

6 years agoRemoved debugging code.
Lukas Tönne [Thu, 15 Jan 2015 17:18:03 +0000 (18:18 +0100)]
Removed debugging code.

6 years agoFix for particle system copy: This has to make sure the ORIGSPACE data
Lukas Tönne [Thu, 15 Jan 2015 17:15:52 +0000 (18:15 +0100)]
Fix for particle system copy: This has to make sure the ORIGSPACE data
layer is available.

Otherwise particle mapping to the new mesh cannot work with subdivided
and constructively-modified meshes.

6 years agoAdded a "specials" menu button next to the particle systems list for
Lukas Tönne [Thu, 15 Jan 2015 11:53:28 +0000 (12:53 +0100)]
Added a "specials" menu button next to the particle systems list for
accessing the copy operator.

6 years agoChanged the workflow for the particle system copy operator to the common
Lukas Tönne [Thu, 15 Jan 2015 11:35:19 +0000 (12:35 +0100)]
Changed the workflow for the particle system copy operator to the common
active-to-selected pattern.

6 years agoNew operator for copying (hair) particle systems from one object to
Lukas Tönne [Thu, 15 Jan 2015 10:51:30 +0000 (11:51 +0100)]
New operator for copying (hair) particle systems from one object to
another, including edit data (grooming).

This uses basically the same method as the existing connect/disconnect
feature. The main difference is that it allows working with multiple
objects and transferring the //particle/hair data// instead of the
//mesh// data (which is what connect/disconnect expects). This is a much
more realistic workflow when rigging, topology etc. changes and
groomed hair has to be transferred to the changed model.

6 years agoRemoved unused particles pointer from particle edit data.
Lukas Tönne [Wed, 14 Jan 2015 15:06:24 +0000 (16:06 +0100)]
Removed unused particles pointer from particle edit data.

6 years agoNew texture influence option for particle kink amplitude (as opposed to
Lukas Tönne [Wed, 14 Jan 2015 11:29:19 +0000 (12:29 +0100)]
New texture influence option for particle kink amplitude (as opposed to

6 years agoRenaming "Kink" texture influence to "Kink Frequency" to be more
Lukas Tönne [Wed, 14 Jan 2015 11:03:55 +0000 (12:03 +0100)]
Renaming "Kink" texture influence to "Kink Frequency" to be more

6 years agoSpiral rotation axis was not always fully normalized, avoid an assert.
Lukas Tönne [Wed, 14 Jan 2015 10:48:51 +0000 (11:48 +0100)]
Spiral rotation axis was not always fully normalized, avoid an assert.

6 years agoMake random child length work again with the spiral kink mode.
Lukas Tönne [Wed, 14 Jan 2015 09:08:45 +0000 (10:08 +0100)]
Make random child length work again with the spiral kink mode.

6 years agoAdd missing stub to the player, so buildbot keeps delivering gooseberry builds
Sergey Sharybin [Wed, 14 Jan 2015 08:05:13 +0000 (13:05 +0500)]
Add missing stub to the player, so buildbot keeps delivering gooseberry builds

6 years agoAllow clumping and roughness in Spiral kink mode as well.
Lukas Tönne [Tue, 13 Jan 2015 19:58:28 +0000 (20:58 +0100)]
Allow clumping and roughness in Spiral kink mode as well.

This requires interpolating the parent key properties, because no single
parent key can be mapped to each key on the children any more.

6 years agoOptional randomization factors for the spiral radius and axis orientation.
Lukas Tönne [Tue, 13 Jan 2015 18:41:25 +0000 (19:41 +0100)]
Optional randomization factors for the spiral radius and axis orientation.

6 years agoSupport in Cycles for the extra spiral keys in hair paths.
Lukas Tönne [Tue, 13 Jan 2015 18:18:46 +0000 (19:18 +0100)]
Support in Cycles for the extra spiral keys in hair paths.

6 years agoNicer calculation of the kink axis and result of the spiraling for
Lukas Tönne [Tue, 13 Jan 2015 17:37:24 +0000 (18:37 +0100)]
Nicer calculation of the kink axis and result of the spiraling for
negative radius.

6 years agoRemoved unused old code.
Lukas Tönne [Tue, 13 Jan 2015 17:03:47 +0000 (18:03 +0100)]
Removed unused old code.

6 years agoDisable the path length check for spiral kink mode.
Lukas Tönne [Tue, 13 Jan 2015 16:59:41 +0000 (17:59 +0100)]
Disable the path length check for spiral kink mode.

This test is terribly expensive for some reason and not necessary for
for the spiral mode anyway.

6 years agoFix for calculation of the key velocity on the last child hair segment.
Lukas Tönne [Tue, 13 Jan 2015 16:28:53 +0000 (17:28 +0100)]
Fix for calculation of the key velocity on the last child hair segment.

6 years agoAnother crappy approach to spirals on hairs, crazy expensive though.
Lukas Tönne [Tue, 13 Jan 2015 16:24:20 +0000 (17:24 +0100)]
Another crappy approach to spirals on hairs, crazy expensive though.


6 years agoSpiral kink mode for particles.
Lukas Tönne [Mon, 12 Jan 2015 19:24:50 +0000 (20:24 +0100)]
Spiral kink mode for particles.

This is BAD code, but the particle kinking does not make it easy to
write a non-local modifier that requires neighboring positions,
curvature, etc. The feature is needed for Gooseberry.

6 years agoOptional clumping noise feature for simulating twisted hair strands.
Lukas Tönne [Mon, 12 Jan 2015 15:03:12 +0000 (16:03 +0100)]
Optional clumping noise feature for simulating twisted hair strands.

This adds another level of clumping on child hairs. When enabled, child
hairs chose a secondary clumping target using a Voronoi pattern. This
adds visual detail on a smaller scale, which is useful particularly when
the number of parents is relatively small.

Natural fibres behave in a similar way when they become sticky and
intertwined. Hairs close to each other form a first twisted strand, then
combine into larger strands. Similar features can be found in ropes:


6 years agoDisable scope updates in texture and image paint modes.
Lukas Tönne [Mon, 12 Jan 2015 13:21:23 +0000 (14:21 +0100)]
Disable scope updates in texture and image paint modes.

Scope update is very slow for high resolutions, and currently blocks
the UI thread(!). This is especially terrible in paint modes, where
each stroke causes a scope update and unacceptable freezing.

The scopes update method tries to avoid this somewhat by skipping if the
toolbar is disabled, but this doesn't help when painting where brush
tools etc. are frequently needed. It's also a bad-level poll, with the
core system accessing a UI element.

Eventually scope updates should become a low-priority background job,
as well as becoming threaded. Until then this polling provides a usable
workaround to the most outrageous cases.

6 years agoCurve-based control for "roughness" (noise displacement) of child hair.
Lukas Tönne [Fri, 9 Jan 2015 14:58:18 +0000 (15:58 +0100)]
Curve-based control for "roughness" (noise displacement) of child hair.

6 years agoCurve-based control for child path tapering.
Lukas Tönne [Fri, 9 Jan 2015 13:24:19 +0000 (14:24 +0100)]
Curve-based control for child path tapering.

This is an alternative method to the current fixed function with a
clump factor and "shape" parameter. This function is quite limited and
does not give the desired result in many cases (e.g. long, parallel
rasta strands are problematic). So rather than trying to add more
parameters there is now a fully user-defined optional curve for setting
the tapering shape.

6 years agoMoved kink, clump and roughness functions into the dedicated source file.
Lukas Tönne [Fri, 9 Jan 2015 10:44:05 +0000 (11:44 +0100)]
Moved kink, clump and roughness functions into the dedicated source file.

6 years agoReorganizing hair child code a little bit to make it not totally insane.
Lukas Tönne [Fri, 9 Jan 2015 10:31:00 +0000 (11:31 +0100)]
Reorganizing hair child code a little bit to make it not totally insane.

This contains a few pieces of code for a future "modifier" system that
would allow more flexible combination of effects. Eventually a node
system is the way to go, but the current code makes that impossible.

6 years agoSeparate context freeing from task freeing in threaded particle updates
Lukas Tönne [Thu, 8 Jan 2015 11:40:27 +0000 (12:40 +0100)]
Separate context freeing from task freeing in threaded particle updates
to prevent double-freeing/invalid mem access.

This can happen with the "virtual parents" feature, which generates both
parent and child paths. Each task free function also freed the shared
context, leading to double freeing.

6 years agoProperly register the `mathutils.interpolate` submodule.
Lukas Tönne [Wed, 31 Dec 2014 08:58:47 +0000 (09:58 +0100)]
Properly register the `mathutils.interpolate` submodule.

6 years agoFix for invalid access to undefined hair data in edge-only cloth meshes.
Lukas Tönne [Mon, 22 Dec 2014 10:54:24 +0000 (11:54 +0100)]
Fix for invalid access to undefined hair data in edge-only cloth meshes.

Cloth data is used both for hair and actual cloth, which makes things
really difficult. The face number was used for distinguishing the two
types (no faces == hair mesh), but the extra hair data necessary for
hair sim is generated by particles and not available for edge-only cloth
meshes. This really needs to be sanitized ...


6 years agoPresets for hair dynamics.
Lukas Tönne [Fri, 19 Dec 2014 13:56:02 +0000 (14:56 +0100)]
Presets for hair dynamics.

This is necessary because the hair dynamics settings are not part of the
ParticleSettings datablock, but part of the convoluted cloth modifier
inside the particle system struct. In the future this will be recoded
properly, but in the meantime presets provide a simple an unobtrusive
way to have reusable dynamics settings for hair.


6 years agoRadical simplification of the wind effect on hair, since the previous
Lukas Tönne [Thu, 18 Dec 2014 12:52:31 +0000 (13:52 +0100)]
Radical simplification of the wind effect on hair, since the previous
approach does not work very well.

Using a cross section estimate still causes large oscillations due to
varying hair force based on angles. It also requires a sensible hair
thickness value (particle radius) which is difficult to control and
visualize at this point.

The new model is based purely on per-vertex forces, which seems to be
much more stable. It's also somewhat justified by the fact that each
hair vertex represents a certain mass.


6 years agoFix for wind force function call.
Lukas Tönne [Mon, 19 Jan 2015 19:20:03 +0000 (20:20 +0100)]
Fix for wind force function call.

6 years agoImproved force field effects on hair strands.
Lukas Tönne [Tue, 16 Dec 2014 18:40:29 +0000 (19:40 +0100)]
Improved force field effects on hair strands.

The previous calculation was modulated with the angle between the wind
direction and the segments, which leads to very oscillating behavior.

Now the formula includes an estimate for the geometric cross section
of a hair segment based on the incident angle and the hair thickness
(currently just the particle size). This gives a more stable behavior
and more realistic response to wind.


6 years agoNew python submodule `mathutils.interpolate` for various mesh interpolation and weigh...
Lukas Tönne [Mon, 15 Dec 2014 18:45:01 +0000 (19:45 +0100)]
New python submodule `mathutils.interpolate` for various mesh interpolation and weighting methods.

This module will contain mirrored functions for calculating and applying
weights for points on a mesh. This includes barycentric and UV weighting
and possibly more advanced global weighting such as harmonic weights.

The naming should follow this scheme:


Reviewers: campbellbarton

Differential Revision:

6 years agoFix for missing library linking in blenderplayer.
Lukas Tönne [Mon, 1 Dec 2014 17:15:53 +0000 (18:15 +0100)]
Fix for missing library linking in blenderplayer.

6 years agoAnother fix for particle instance child lookups, was not subtracting
Lukas Tönne [Fri, 21 Nov 2014 15:00:24 +0000 (16:00 +0100)]
Another fix for particle instance child lookups, was not subtracting
parent amount.