blender.git
16 months agoOpenVDB : use underscores instead of spaces in grid names.
Kévin Dietrich [Mon, 29 Jan 2018 17:37:35 +0000 (18:37 +0100)]
OpenVDB : use underscores instead of spaces in grid names.

Some other software cannot handle grid names with spaces in them. We still check for names with spaces so as to not break old
files.

This fixes T53802.

16 months agoCycles: add Principled Volume shader.
Brecht Van Lommel [Tue, 30 Jan 2018 14:05:19 +0000 (15:05 +0100)]
Cycles: add Principled Volume shader.

Similar to the Principled BSDF, this should make it easier to set up volume
materials. Smoke and fire can be rendererd with just a single principled
volume node, the appropriate attributes will be used when available. The node
also works for simpler homogeneous volumes like water or mist.

Differential Revision: https://developer.blender.org/D3033

16 months agoCycles: change smoke color grid to not include density multiplied in.
Brecht Van Lommel [Sun, 18 Feb 2018 02:16:29 +0000 (03:16 +0100)]
Cycles: change smoke color grid to not include density multiplied in.

This breaks backwards compatibility some, making smoke colors brighters
than before. But it is also more correct this way.

16 months agoCode refactor: improve attribute handling for optional volume attributes.
Brecht Van Lommel [Sun, 18 Feb 2018 02:20:39 +0000 (03:20 +0100)]
Code refactor: improve attribute handling for optional volume attributes.

A volume shader should be able to request attributes, and still be rendered
as homogeneous if no volume attributes are available for the object.

16 months agoSmoke: change default flame temperatures to match OpenGL preview.
Brecht Van Lommel [Sun, 18 Feb 2018 02:24:40 +0000 (03:24 +0100)]
Smoke: change default flame temperatures to match OpenGL preview.

16 months agoSmoke: add temperature grid, with values 0..1 corresponding to 0..1000K.
Brecht Van Lommel [Sun, 18 Feb 2018 02:13:07 +0000 (03:13 +0100)]
Smoke: add temperature grid, with values 0..1 corresponding to 0..1000K.

16 months agoNodes: left align text for color and string sockets, same as other types.
Brecht Van Lommel [Sun, 18 Feb 2018 02:15:13 +0000 (03:15 +0100)]
Nodes: left align text for color and string sockets, same as other types.

16 months agoFix T54137: OpenEXR files with long red/green/blue channel names not loading correctly.
Brecht Van Lommel [Fri, 23 Feb 2018 13:32:17 +0000 (14:32 +0100)]
Fix T54137: OpenEXR files with long red/green/blue channel names not loading correctly.

16 months agoBuildbot: Enable Volta deviced CUDA binaries
Sergey Sharybin [Fri, 23 Feb 2018 13:24:59 +0000 (14:24 +0100)]
Buildbot: Enable Volta deviced CUDA binaries

16 months agoBuildbot: Remove master configuration files
Sergey Sharybin [Fri, 23 Feb 2018 11:37:05 +0000 (12:37 +0100)]
Buildbot: Remove master configuration files

Those are stored in blender-buildbot repository now, so having them in
Blender only causes extra work to keep files in sync.

16 months agoBuildbot: Disable cuda hack for macOS
Sergey Sharybin [Fri, 23 Feb 2018 09:55:14 +0000 (10:55 +0100)]
Buildbot: Disable cuda hack for macOS

16 months agoWM: Add WM_menutype_poll function
Campbell Barton [Fri, 23 Feb 2018 06:01:22 +0000 (17:01 +1100)]
WM: Add WM_menutype_poll function

Wraps menutype poll, no functional changes.

16 months agoWM: add WM_keymap_poll function
Campbell Barton [Fri, 23 Feb 2018 01:50:56 +0000 (12:50 +1100)]
WM: add WM_keymap_poll function

Wrapps keymap poll, no functional changes.

16 months agoCleanup: header guards & style
Campbell Barton [Fri, 23 Feb 2018 01:59:02 +0000 (12:59 +1100)]
Cleanup: header guards & style

16 months agoDepsgraph: Fix mistake in previous refactor commit
Sergey Sharybin [Thu, 22 Feb 2018 15:30:47 +0000 (16:30 +0100)]
Depsgraph: Fix mistake in previous refactor commit

16 months agoCleanup: Fix const pointers mess in previous commit.
Bastien Montagne [Thu, 22 Feb 2018 14:41:41 +0000 (15:41 +0100)]
Cleanup: Fix const pointers mess in previous commit.

16 months agoFix (unreported) meshes changing shading when creating empty clnors data.
Bastien Montagne [Thu, 22 Feb 2018 14:00:42 +0000 (15:00 +0100)]
Fix (unreported) meshes changing shading when creating empty clnors data.

When you were using autosmooth to generate some custom normals, and
created empty custom loop normal data, you would go back to an 'all
smooth' shading, cancelling some sharp edges generated by the mesh's
smooth threshold.

Now we will first tag such edges as sharp, such that shading remains the
same. This is not crucial in current master, but it is for clnors
editing gsoc branch!

16 months agoCleanup: clnor code: more 'do not use same varname for two different things'.
Bastien Montagne [Thu, 22 Feb 2018 09:35:08 +0000 (10:35 +0100)]
Cleanup: clnor code: more 'do not use same varname for two different things'.

16 months agoFix T54129: Moving keyframes on top of other keyframes, removes both keyframes
Joshua Leung [Thu, 22 Feb 2018 14:13:56 +0000 (03:13 +1300)]
Fix T54129: Moving keyframes on top of other keyframes, removes both keyframes

Regression caused by earlier commits to improve the automerge behaviour.
In this case, the problems only occurred when moving a selected keyframe
forwards in time to overlap an unselected keyframe.

16 months agoFix: Don't ignore duplicate channels when doing border/circle/lasso select
Joshua Leung [Thu, 22 Feb 2018 13:34:19 +0000 (02:34 +1300)]
Fix: Don't ignore duplicate channels when doing border/circle/lasso select

While it is necessary to ignore duplicates when doing Deselect/Column Select
(where double-updates may result in nothing being selected), for borderselect,
not including the duplicates meant that sometimes, nothing would happen
if you were trying to borderselect keyframes originating from hidden channels.

This was first noticed in the greasepencil-object branch, but affects all
animation channel types.

16 months agoDepsgraph: Remove unused argument
Sergey Sharybin [Thu, 22 Feb 2018 13:27:29 +0000 (14:27 +0100)]
Depsgraph: Remove unused argument

16 months agoDepsgraph: Remove unused bmain from modifiers relations update context
Sergey Sharybin [Thu, 22 Feb 2018 13:07:08 +0000 (14:07 +0100)]
Depsgraph: Remove unused bmain from modifiers relations update context

16 months agoFix compilation error with legacy depsgraph disabled
Sergey Sharybin [Thu, 22 Feb 2018 12:05:38 +0000 (13:05 +0100)]
Fix compilation error with legacy depsgraph disabled

16 months agoDepsgraph: Wrap all arguments foe modifiers relations update into a struct
Sergey Sharybin [Thu, 22 Feb 2018 11:54:06 +0000 (12:54 +0100)]
Depsgraph: Wrap all arguments foe modifiers relations update into a struct

Makes it easier to add or remove fields needed to update relations.

16 months agoDepsgraph: Replace LIB_TAG_DOIT with hash lookup
Sergey Sharybin [Thu, 22 Feb 2018 10:03:39 +0000 (11:03 +0100)]
Depsgraph: Replace LIB_TAG_DOIT with hash lookup

This allows us to:

- Not mock around with tags stored in a global space,
    and not to iterate over all datablocks in the database
    to clear the tags.

- Properly deal with datablocks which might not be in main database.

    While it sounds crazy, it might be handy when dealing with preview,
    or some partial scene updates, such as motion paths.

- Avoids majority of places where depsgraph construction needed bmain.

    This is something what could help in blender2.8 branch.

From tests with production file here did not see any measurable slowdown.

Hopefully, there is no functional changes :)

16 months agoDepsgraph: Add utility class to keep track of handled ID datablocks
Sergey Sharybin [Thu, 22 Feb 2018 09:52:43 +0000 (10:52 +0100)]
Depsgraph: Add utility class to keep track of handled ID datablocks

Currently unused, actual logic change will come in the next commit.

16 months agoDepsgraph: Use proper debug print flags check
Sergey Sharybin [Thu, 22 Feb 2018 09:40:18 +0000 (10:40 +0100)]
Depsgraph: Use proper debug print flags check

Was printing some tagging/evaluation prints when only building
messages were requested.

16 months agoDepsgraph: Report graph construction time when run with --debug-depsgraph-build
Sergey Sharybin [Thu, 22 Feb 2018 09:35:04 +0000 (10:35 +0100)]
Depsgraph: Report graph construction time when run with --debug-depsgraph-build

16 months agoDepsgraph: Cleanup, reduce indentation level
Sergey Sharybin [Thu, 22 Feb 2018 09:31:47 +0000 (10:31 +0100)]
Depsgraph: Cleanup, reduce indentation level

16 months agoCycles: add Russian roulette termination for volume multiple scattering.
Brecht Van Lommel [Tue, 20 Feb 2018 14:36:07 +0000 (15:36 +0100)]
Cycles: add Russian roulette termination for volume multiple scattering.

This mainly helps with dense volumes, rendering can be 30% faster with
little noise increase in such scenes.

16 months agoCycles: better path termination for transparency.
Brecht Van Lommel [Tue, 20 Feb 2018 13:22:40 +0000 (14:22 +0100)]
Cycles: better path termination for transparency.

We now continue transparent paths after diffuse/glossy/transmission/volume
bounces are exceeded. This avoids unexpected boundaries in volumes with
transparent boundaries. It is also required for MIS to work correctly with
transparent surfaces, as we also continue through these in shadow rays.

The main visible changes is that volumes will now be lit by the background
even at volume bounces 0, same as surfaces.

Fixes T53914 and T54103.

16 months agoCycles: make principled BSDF node wider in the node editor by default.
Brecht Van Lommel [Mon, 19 Feb 2018 22:47:42 +0000 (23:47 +0100)]
Cycles: make principled BSDF node wider in the node editor by default.

16 months agoCode cleanup: fix incorrect socket names in hair and particle info nodes.
Brecht Van Lommel [Wed, 21 Feb 2018 12:18:40 +0000 (13:18 +0100)]
Code cleanup: fix incorrect socket names in hair and particle info nodes.

16 months agoFix incorrect OSL raytype bits and add some comments.
Brecht Van Lommel [Tue, 20 Feb 2018 13:36:50 +0000 (14:36 +0100)]
Fix incorrect OSL raytype bits and add some comments.

16 months agoFix T54105: random walk SSS missing in branched indirect paths.
Brecht Van Lommel [Mon, 19 Feb 2018 23:15:14 +0000 (00:15 +0100)]
Fix T54105: random walk SSS missing in branched indirect paths.

Unify the path and branched path indirect SSS code. No performance impact
found on CUDA, for AMD split kernel the extra code was already there.

16 months agoFix T54107: bevel shader + normal map gives wrong result.
Brecht Van Lommel [Tue, 20 Feb 2018 19:24:40 +0000 (20:24 +0100)]
Fix T54107: bevel shader + normal map gives wrong result.

16 months agoCleanup: Don't perform borderselect on channels that aren't visible
Joshua Leung [Wed, 21 Feb 2018 11:59:15 +0000 (00:59 +1300)]
Cleanup: Don't perform borderselect on channels that aren't visible

16 months agoFix: Return back to conventional way of averaging points for keyframe de-dup
Joshua Leung [Wed, 21 Feb 2018 11:44:03 +0000 (00:44 +1300)]
Fix: Return back to conventional way of averaging points for keyframe de-dup

The other approach was causing too much error in some cases (e.g. favouring
the lower-valued keyframes). This fix should make the resulting curves less
bumpy/jagged.

16 months agoFix: Forgot to recalculate handles after deleting keyframes
Joshua Leung [Wed, 21 Feb 2018 10:21:56 +0000 (23:21 +1300)]
Fix: Forgot to recalculate handles after deleting keyframes

16 months agoFix: Don't average keyframe values if FCurve can only have int/discrete values
Joshua Leung [Wed, 21 Feb 2018 09:37:48 +0000 (22:37 +1300)]
Fix: Don't average keyframe values if FCurve can only have int/discrete values

This is to prevent problems with integer/enum properties getting invalid
values set.

16 months agoCleanup: Delete debugging code and the old version of the automerge code
Joshua Leung [Wed, 21 Feb 2018 06:15:41 +0000 (19:15 +1300)]
Cleanup: Delete debugging code and the old version of the automerge code

16 months agoTweak/Fix for T54106 - Moving multiple selected keyframes on top of an unselected...
Joshua Leung [Wed, 21 Feb 2018 06:14:33 +0000 (19:14 +1300)]
Tweak/Fix for T54106 - Moving multiple selected keyframes on top of an unselected one would not merge the keys

This commit removes an earlier attempt at optimising the lookups
for duplicates of a particular tRetainedKeyframe once we'd already
deleted all the selected copies. The problem was that now, instead
of getting rid of the unselected keys (i.e. the basic function here),
we were only getting rid of the selected duplicates.

With this fix, unselected keyframes will now get removed (as expected)
again. However, we currently don't take their values into account
when merging keyframes, since it is assumed that we don't care so much
about their values when overriding.

16 months agoMinor Optimisation: Terminate early if we've passed the insertion point for tRetained...
Joshua Leung [Wed, 21 Feb 2018 05:59:15 +0000 (18:59 +1300)]
Minor Optimisation: Terminate early if we've passed the insertion point for tRetainedKeyframes

16 months agoFeature Request T54106: When scaling keyframes, merge (by-averaging) selected keys
Joshua Leung [Wed, 21 Feb 2018 04:53:54 +0000 (17:53 +1300)]
Feature Request T54106: When scaling keyframes, merge (by-averaging) selected keys
that end up on the same frame

Currently, when scaling keyframes in the Dopesheet, if multiple
selected keyframes end up on the same frame post-scaling, they
would not get removed by the "Automerge" setting that normally
removes duplicates on the same frame.

This commit changes the behaviour so that when multiple selected
keyframes end up on the same frame, instead of keeping all these
around on the same frame (e.g. resulting in a column of keyframes
on different values), we will instead merge them into a single
keyframe (by averaging the values). This should result in a
smoother F-Curve with fewer "stair-steps" that need to be carefully
cleaned out afterwards.

Requested by @hjalti

16 months agobezt_add_to_cfra_elem() - Use same keyframe equality test as in other places
Joshua Leung [Thu, 15 Feb 2018 04:40:19 +0000 (17:40 +1300)]
bezt_add_to_cfra_elem() - Use same keyframe equality test as in other places

This shouldn't affect anything currently, as this function doesn't appear
to get used anywhere.

16 months agoFix T54065: NLA-Strip Control Curves would get disabled when name-based-filtering...
Joshua Leung [Thu, 15 Feb 2018 03:39:46 +0000 (16:39 +1300)]
Fix T54065: NLA-Strip Control Curves would get disabled when name-based-filtering is enabled

This bug took a while to track down. In the test file with this report,
the Nla-Strip Control Curve for strip time would get disabled if you
changed the NLA Editor to a second Graph Editor instance.

It turns out that because this second Graph Editor would have the
"filter fcurves by name" option enabled, this would trigger a lookup
of the referenced property's name (in order to test whether it matched
the filtering criteria). However, since that filtering code was written
before the introduction of these curves, it still assumed that the names
for these Control Curves should be handled the same as for standard FCurves.
Unfortunately, that doesn't work, as the property lookups fail if the standard
method is used - when the lookups fail, the F-Curves get tagged as being
invalid/disabled (and need to be reset using the "Revive Disabled FCurves"
operator).

Note: The changes in this patch look complicated, as I've had to shuffle
a bit of code around so that the name-filtering check can have access to
the additional info it needs. In the process, I've also removed the earlier
(hacky) approach where the control curves were getting added to a temp
buffer to get changed from normal FCurves to special ANIMTYPE_NLACURVES.

16 months agoFix more missing ID remapping in animation editor callbacks
Joshua Leung [Thu, 15 Feb 2018 02:45:08 +0000 (15:45 +1300)]
Fix more missing ID remapping in animation editor callbacks

Applying the same fixes as introduced in 98d797b67c07e85889768bf8ecde292e9e6f70e9
this time, for the Graph and NLA editors

16 months agoDepsgraph: Fix fake dependency cycle with chained IK solvers with tip excluded
Sergey Sharybin [Wed, 21 Feb 2018 11:04:28 +0000 (12:04 +0100)]
Depsgraph: Fix fake dependency cycle with chained IK solvers with tip excluded

Not sure why we need a relation from solver to a tip local transform, this
will be handled via parent relation.

Fixes remaining dependency cycles reported in T54083.

16 months agoDepsgraph: Fix dependency when constraint influence drives some other constraint
Sergey Sharybin [Wed, 21 Feb 2018 10:13:25 +0000 (11:13 +0100)]
Depsgraph: Fix dependency when constraint influence drives some other constraint

It is not possible to address transform at particular position of constraint
stack, and when constraint is being addressed is usually from driver variable.

This fixes some of dependency cycles reported in T54083.

16 months agoDepsgraph: Split debug flags
Sergey Sharybin [Wed, 21 Feb 2018 09:44:36 +0000 (10:44 +0100)]
Depsgraph: Split debug flags

Now it's possible to have debug messages for following things:

- Graph construction
- Graph evaluation
- Graph tagging

16 months agoDepsgraph: Fix crash using --debug-depsgraph and --debug-depsgraph-no-threads
Sergey Sharybin [Wed, 21 Feb 2018 09:42:22 +0000 (10:42 +0100)]
Depsgraph: Fix crash using --debug-depsgraph and --debug-depsgraph-no-threads

Was accessing past the array boundaries.

Should be safe for 2.79a.

16 months agoDepsgraph: Report overall number of cycles detected
Sergey Sharybin [Tue, 20 Feb 2018 16:16:41 +0000 (17:16 +0100)]
Depsgraph: Report overall number of cycles detected

Handy to quickly see if a fix fixed any of the cycles in a real rig,
or whether it's introduced new ones.

16 months agoVSE: skip non image/movie w/ proxy dir storage
Campbell Barton [Wed, 21 Feb 2018 07:13:40 +0000 (18:13 +1100)]
VSE: skip non image/movie w/ proxy dir storage

This would use uninitialized filename variable,
looked into supporting this however generating proxies currently only
works for movies.

16 months agoCleanup: split normals: use different varnames for angle and its cosine.
Bastien Montagne [Tue, 20 Feb 2018 12:03:10 +0000 (13:03 +0100)]
Cleanup: split normals: use different varnames for angle and its cosine.

Using same name for two different things is not the best idea ever...

16 months agoFix T54069: Vertex groups for hair length is wrong in some cases
Sergey Sharybin [Tue, 20 Feb 2018 09:47:01 +0000 (10:47 +0100)]
Fix T54069: Vertex groups for hair length is wrong in some cases

This is a regression in rB4f1c0a1 which only allowed cutting haior at the
second segment only, while there is nothing wrong with cutting hair at the
first segmewnt.

16 months agoFix T54096: Subdivision Surface + Boolean Modifiers + Transform = crash
Sergey Sharybin [Mon, 19 Feb 2018 15:16:56 +0000 (16:16 +0100)]
Fix T54096: Subdivision Surface + Boolean Modifiers + Transform = crash

Don't use dm->get*Array for DM you don't own. This call can allocate temporary
CD layer, which is not thread safe at all.

Also removed hard-coded logic around CDDM check. new functions will do same
logic, but are mode DM-type-=independent.

16 months agoFix T53032: Image sequence works bad with Displace modifier
Sergey Sharybin [Mon, 19 Feb 2018 13:33:48 +0000 (14:33 +0100)]
Fix T53032: Image sequence works bad with Displace modifier

We shouldn't mix image pool acuisition with and without user provided,
the fact that internally image.c uses last frame from Image datablock
confuses the logic.

16 months agoCleanup: rename SequenceEditor instance to 'ed'
Campbell Barton [Mon, 19 Feb 2018 11:32:41 +0000 (22:32 +1100)]
Cleanup: rename SequenceEditor instance to 'ed'

Name 'sequencer' & 'sequence' are too similar.

16 months agoCleanup: remove BMeshToMeshParams.calc_tessface
Campbell Barton [Mon, 19 Feb 2018 06:41:37 +0000 (17:41 +1100)]
Cleanup: remove BMeshToMeshParams.calc_tessface

This wasn't used, tessface is being phased out.
Caller can run explicitly if needed.

16 months agoFix T54098: Crash existing /w dyntopo sculpt
Campbell Barton [Mon, 19 Feb 2018 06:27:01 +0000 (17:27 +1100)]
Fix T54098: Crash existing /w dyntopo sculpt

Optionally don't remap indices for objects.

Checking all objects parent's would reference a freed pointer
while freeing all objects.

In the case of dynamic topology there is no use in keeping track
of hook/vertex-parent indices.

Also disable this when creating meshes for undo storage
since adding an undo step shouldn't be modifying other objects.

16 months agoCleanup: sync vertex-paint and sculpt from 2.8
Campbell Barton [Mon, 19 Feb 2018 01:20:18 +0000 (12:20 +1100)]
Cleanup: sync vertex-paint and sculpt from 2.8

Sync API changes from 2.8 to master.

16 months agoFix T54089: missing GLSL material draw update when changing object pass index.
Brecht Van Lommel [Sun, 18 Feb 2018 18:28:14 +0000 (19:28 +0100)]
Fix T54089: missing GLSL material draw update when changing object pass index.

16 months agoCleanup: group BLI_ghash_utils.c API in BLU_ghash.h
Campbell Barton [Sun, 18 Feb 2018 11:10:56 +0000 (22:10 +1100)]
Cleanup: group BLI_ghash_utils.c API in BLU_ghash.h

16 months agoCleanup: split GHash helpers from implementation
Campbell Barton [Sun, 18 Feb 2018 10:44:56 +0000 (21:44 +1100)]
Cleanup: split GHash helpers from implementation

16 months agoCleanup: add 2d suffix to BLI files
Campbell Barton [Sun, 18 Feb 2018 10:27:33 +0000 (21:27 +1100)]
Cleanup: add 2d suffix to BLI files

Some of these API's can have 3D versions, explicitly name them 2D.

17 months agoCycles: tweak CUDA messages and avoid build errors with existing sm_2x configs.
Brecht Van Lommel [Tue, 6 Feb 2018 14:19:25 +0000 (15:19 +0100)]
Cycles: tweak CUDA messages and avoid build errors with existing sm_2x configs.

17 months agoCode cleanup: remove some more unused code after recent CUDA changes.
Brecht Van Lommel [Sat, 17 Feb 2018 23:51:46 +0000 (00:51 +0100)]
Code cleanup: remove some more unused code after recent CUDA changes.

17 months agoCycles: Remove Fermi texture code.
Thomas Dinges [Sat, 17 Feb 2018 21:56:58 +0000 (22:56 +0100)]
Cycles: Remove Fermi texture code.

This should be the last Fermi removal commit, unless I missed something.
It's been a pleasure Fermi!

17 months agoCycles: Remove fermi related defines from the code.
Thomas Dinges [Sat, 17 Feb 2018 21:19:54 +0000 (22:19 +0100)]
Cycles: Remove fermi related defines from the code.

Did not touch Texture related defines, that comes next.

17 months agoCycles: Remove Fermi support from CMake and update runtime checks in device_cuda...
Thomas Dinges [Sat, 17 Feb 2018 15:15:07 +0000 (16:15 +0100)]
Cycles: Remove Fermi support from CMake and update runtime checks in device_cuda.cpp.

Fermi code in Cycles kernel and texture system are coming next.

17 months agoBuildbot: Disable Cycles CUDA support on 32bit, and stop building sm_2x.
Thomas Dinges [Sat, 17 Feb 2018 14:49:37 +0000 (15:49 +0100)]
Buildbot: Disable Cycles CUDA support on 32bit, and stop building sm_2x.

17 months agofix:T50079 collada matrix and blender matrix are transposed. This was not regarded...
Gaia Clary [Fri, 16 Feb 2018 15:58:20 +0000 (16:58 +0100)]
fix:T50079 collada matrix and blender matrix are transposed. This was not regarded by the animation importer, so it was creating very odd results

17 months agofix: limit precision also for animation matrixes if the limit option is set (gives...
Gaia Clary [Fri, 16 Feb 2018 15:53:16 +0000 (16:53 +0100)]
fix: limit precision also for animation matrixes if the limit option is set (gives nicer output for inspection)

17 months agoFix rotation issues due to matrix to quaternion ambiguities
Gaia Clary [Fri, 16 Feb 2018 11:37:36 +0000 (12:37 +0100)]
Fix rotation issues due to matrix to quaternion ambiguities

Reviewers: mont29

Reviewed By: mont29

Subscribers: mont29

Differential Revision: https://developer.blender.org/D3066

17 months agoCode cleanup: deduplicate code for running Python scripts outside Blender.
Brecht Van Lommel [Fri, 16 Feb 2018 00:22:34 +0000 (01:22 +0100)]
Code cleanup: deduplicate code for running Python scripts outside Blender.

17 months agoTests: add OpenGL UI drawing tests.
Brecht Van Lommel [Wed, 14 Feb 2018 19:33:33 +0000 (20:33 +0100)]
Tests: add OpenGL UI drawing tests.

This reuses the Cycles regression test code to also work for OpenGL UI drawing.
We launch Blender with a bunch of .blend files, take a screenshot and compare
it with a reference screenshot, and generate a HMTL report showing the failed
tests and their differences.

For Cycles we keep small reference renders to compare to in svn, but for OpenGL
developers currently have to generate the references manually. How to use:

* WITH_OPENGL_DRAW_TESTS=ON in CMake
* BLENDER_TEST_UPDATE=1 ctest -R opengl_draw
* .. make code changes ..
* ctest -R opengl_draw
* open build_dir/tests/opengl_draw/report.html

Differential Revision: https://developer.blender.org/D3064

17 months agoTests: split off render report test code from Cycles tests.
Brecht Van Lommel [Wed, 14 Feb 2018 16:33:06 +0000 (17:33 +0100)]
Tests: split off render report test code from Cycles tests.

This renames test environment variables from CYCLESTEST_* to BLENDER_TEST_*.

Differential Revision: https://developer.blender.org/D3064

17 months agoFix bplayer (c)
Bastien Montagne [Fri, 16 Feb 2018 09:42:43 +0000 (10:42 +0100)]
Fix bplayer (c)

17 months agoFix part II of T53977: Severe problem with multiple instances of a library (save...
Bastien Montagne [Fri, 16 Feb 2018 09:31:03 +0000 (10:31 +0100)]
Fix part II of T53977: Severe problem with multiple instances of a library (save and reload).

Once 'losing lib' issue is fixed (in previous commit), we have new issue
that this could lead to several copies of the same linked data-block in
.blend file. Which is not good. At all.

So had to add a GHash-based check in libraries reading code to ensure we
only load a same ID from a same lib once.

17 months agoFix part I of T53977: Severe problem with multiple instances of a library (save and...
Bastien Montagne [Tue, 13 Feb 2018 19:58:40 +0000 (20:58 +0100)]
Fix part I of T53977: Severe problem with multiple instances of a library (save and reload).

The issue was that when a same lib was found several times in loaded
.blend, we'd only keep the first occurence. But since Blender expects
next data-blocks to belong to last found library, we could actually
be adding data-blocks assigned to copies of the duplicated lib to
another, totally unrelated lib.

Those data-blocks were then obviously not found when actually loading
libs content, and lost.

Note that this only fix one part of the issue, current code can
generate several copies of same linked data-block now, will fix in
another commit.

17 months agoCode cleanup: simplify switch statement, ensure we catch missing enums.
Brecht Van Lommel [Thu, 15 Feb 2018 17:13:07 +0000 (18:13 +0100)]
Code cleanup: simplify switch statement, ensure we catch missing enums.

17 months agoFix T54073: crash and uninitialized memory in Cycles displacement hashing.
Brecht Van Lommel [Thu, 15 Feb 2018 14:28:34 +0000 (15:28 +0100)]
Fix T54073: crash and uninitialized memory in Cycles displacement hashing.

17 months agoFix crash reading deg_point_cache_transform.blend test, saved with 2.8.
Brecht Van Lommel [Thu, 15 Feb 2018 15:25:37 +0000 (16:25 +0100)]
Fix crash reading deg_point_cache_transform.blend test, saved with 2.8.

In general 2.8 files may not be readable in master, but might as well fix
this case so all the lib/tests can be opened still.

17 months agoCleanup: Remove debug-only code
Sergey Sharybin [Thu, 15 Feb 2018 16:57:44 +0000 (17:57 +0100)]
Cleanup: Remove debug-only code

17 months agoFix T54076: MCE in Graph mode - clip.graph_select_border does not work by header...
Sergey Sharybin [Thu, 15 Feb 2018 15:56:49 +0000 (16:56 +0100)]
Fix T54076: MCE in Graph mode - clip.graph_select_border does not work by header menu

While the script should be using INVOKE_PREVIEW for operators in clip view,
window manager was lacking some switch statements.

Thanks Brecht fore review!

17 months agoCleanup: rename BLI_thread.h API
Campbell Barton [Thu, 15 Feb 2018 14:13:46 +0000 (01:13 +1100)]
Cleanup: rename BLI_thread.h API

- Use BLI_threadpool_ prefix for (deprecated)
  thread/listbase API.
- Use BLI_thread as prefix for other functions.

See P614 to apply instead of manually resolving conflicts.

17 months agoCleanup: use '_len' instead of '_size' w/ BLI API
Campbell Barton [Thu, 15 Feb 2018 12:36:11 +0000 (23:36 +1100)]
Cleanup: use '_len' instead of '_size' w/ BLI API

- When returning the number of items in a collection use BLI_*_len()
- Keep _size() for size in bytes.
- Keep _count() for data structures that don't store length
  (hint this isn't a simple getter).

See P611 to apply instead of manually resolving conflicts.

17 months agoCleanup: Style, braces with macros
Sergey Sharybin [Thu, 15 Feb 2018 11:41:35 +0000 (12:41 +0100)]
Cleanup: Style, braces with macros

See https://wiki.blender.org/index.php/Dev:Doc/Code_Style#Braces_with_Macros

17 months agoCleanup: Remove BLI_ prefix from listbase macro
Sergey Sharybin [Thu, 15 Feb 2018 11:38:21 +0000 (12:38 +0100)]
Cleanup: Remove BLI_ prefix from listbase macro

This is kind of doesn't matter where macro itself is defined.

We should stick to the following:

- If some macro is actually more an inline function, follow regular
  function name conventions.
- If macro is a macro, type it in capitals. Use module prefix if that
  helps readability or it if helps avoiding accidents.

17 months agoSimple hair children: Make twist affected by texture
Sergey Sharybin [Thu, 15 Feb 2018 10:22:44 +0000 (11:22 +0100)]
Simple hair children: Make twist affected by texture

This completes twist feature, which is now possible to also control by
texture. Since textures can not easily contain negative values as well,
same trick with 0.5 neutral as vertex groups is used.

All in all, this twist features allows to do following things.

Original hair:

{F2287535}

Hair with scientifically calculated twist value of 0.5:

{F2287540}

And we can also twist braids in opposite directions dependent on left/right
side:

{F2287548}

17 months agoFix T54078: Adding subsurf prior to particle system breaks simple children vgroups...
Sergey Sharybin [Thu, 15 Feb 2018 09:27:39 +0000 (10:27 +0100)]
Fix T54078: Adding subsurf prior to particle system breaks simple children vgroups and textures

cpa->num points to a face index on BASE mesh, but get_child_modifier_parameters()
expects index on a FINAL dm. So wrong index was used here.

17 months agoSimple hair children: Make twist affected by vertex group
Sergey Sharybin [Wed, 14 Feb 2018 15:46:29 +0000 (16:46 +0100)]
Simple hair children: Make twist affected by vertex group

The idea is to give a control over direction of twist, and maybe amount of
twist as well. More concrete example: make braids on left and right side of
character head to be twisting opposite directions.

Now, tricky part: we need some negative values to flip direction, but weights
can not be negative. So we use same trick as displacement map and tangent normal
maps, where 0.5 is neutral, values below 0.5 are considered negative and values
above 0.5 are considered positive.

17 months agoSimple hair children: Initial implementation of twist control
Sergey Sharybin [Wed, 14 Feb 2018 13:33:53 +0000 (14:33 +0100)]
Simple hair children: Initial implementation of twist control

It allows to have children hair to be twisted around parent curve, which is
quite an essential feature when creating hair braids.

There are currently two controls:

- Number of turns around parent children.
- Influence curve, which allows to modify "twistness" along the strand.

17 months agoBlenlib: Assert when attempting to rotate point around vector and store result in...
Sergey Sharybin [Wed, 14 Feb 2018 13:29:37 +0000 (14:29 +0100)]
Blenlib: Assert when attempting to rotate point around vector and store result in the point

This isn't supported since there are subsequent reads to all point coordinates
after modification started.

Probably we need to create a temp copy of point, but that's like extra CPU
ticks.

17 months agoParticles: Wrap insane amount of arguments to child modifier evaluation
Sergey Sharybin [Wed, 14 Feb 2018 11:33:34 +0000 (12:33 +0100)]
Particles: Wrap insane amount of arguments to child modifier evaluation

Use single structure. It seems we will need to pass more information soon,
so better to do it via the structure.

17 months agoFix T54075: Align Objects fails w/ empty mesh
Campbell Barton [Thu, 15 Feb 2018 00:33:47 +0000 (11:33 +1100)]
Fix T54075: Align Objects fails w/ empty mesh

17 months agoCleanup: style
Campbell Barton [Thu, 15 Feb 2018 00:13:54 +0000 (11:13 +1100)]
Cleanup: style

17 months agoFix T54072: Crash splitting edges
Campbell Barton [Wed, 14 Feb 2018 23:48:12 +0000 (10:48 +1100)]
Fix T54072: Crash splitting edges

17 months agoCycles: restore Particle Info Index for now, keep it next to Random.
Brecht Van Lommel [Wed, 14 Feb 2018 16:02:28 +0000 (17:02 +0100)]
Cycles: restore Particle Info Index for now, keep it next to Random.

It seems to be useful still in cases where the particle are distributed in
a particular order or pattern, to colorize them along with that. This isn't
really well defined, but might as well avoid breaking backwards compatibility
for now.

17 months agoCycles: change Index output of Hair and Particle Info to Random, in 0..1 range.
Brecht Van Lommel [Wed, 14 Feb 2018 13:32:38 +0000 (14:32 +0100)]
Cycles: change Index output of Hair and Particle Info to Random, in 0..1 range.

These are used for randomization, so it's convenient if the index is already
hashed and consistent with the Object Info node.