blender.git
4 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Mon, 23 Jan 2017 17:11:42 +0000 (18:11 +0100)]
Merge branch 'master' into blender2.8

4 years agoFix compilation error with legacy depsgraph disabled
Sergey Sharybin [Mon, 23 Jan 2017 17:08:41 +0000 (18:08 +0100)]
Fix compilation error with legacy depsgraph disabled

4 years agoCycles: Split ShaderData object and shader flags
Sergey Sharybin [Fri, 23 Dec 2016 10:31:19 +0000 (11:31 +0100)]
Cycles: Split ShaderData object and shader flags

We started to run out of bits there, so now we separate flags
which came from __object_flags and which are either runtime or
coming from __shader_flags.

Rule now is: SD_OBJECT_* flags are to be tested against new
object_flags field of ShaderData, all the rest flags are to
be tested against flags field of ShaderData.

There should be no user-visible changes, and time difference
should be minimal. In fact, from tests here can only see hardly
measurable difference and sometimes the new code is somewhat
faster (all within a noise floor, so hard to tell for sure).

Reviewers: brecht, dingto, juicyfruit, lukasstockner97, maiself

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

4 years agoCycles: Make object flag names more obvious that hey are object and not shader
Sergey Sharybin [Fri, 23 Dec 2016 09:49:59 +0000 (10:49 +0100)]
Cycles: Make object flag names more obvious that hey are object and not shader

4 years agoFix strict compiler warning in the gflags code
Sergey Sharybin [Mon, 23 Jan 2017 10:52:41 +0000 (11:52 +0100)]
Fix strict compiler warning in the gflags code

4 years agoSilence strict compiler warnings
Sergey Sharybin [Mon, 23 Jan 2017 10:46:02 +0000 (11:46 +0100)]
Silence strict compiler warnings

Similar thing to other areas where we mix Blender's char with OpenGL API.

4 years agoCycles: Fix typo in the panel name
Sergey Sharybin [Mon, 23 Jan 2017 09:35:15 +0000 (10:35 +0100)]
Cycles: Fix typo in the panel name

No user visible changes, it was a typo in the name of the class.

Spotted by povmaniac in IRC, thanks!

4 years agoCycles: Update current Cycles version
Sergey Sharybin [Mon, 23 Jan 2017 09:23:09 +0000 (10:23 +0100)]
Cycles: Update current Cycles version

4 years agoMerge branch 'master' into blender2.8
Julian Eisel [Sun, 22 Jan 2017 20:16:00 +0000 (21:16 +0100)]
Merge branch 'master' into blender2.8

Conflicts:
source/blender/editors/space_action/action_draw.c

4 years agoFix T50491: Cycles UI breaks when pushing F8.
Bastien Montagne [Sun, 22 Jan 2017 11:42:14 +0000 (12:42 +0100)]
Fix T50491: Cycles UI breaks when pushing F8.

Cycles add-on did not actually support reloading correctly.

When you want to correctly reload sub-modules (i.e. modules of an add-on
which is a package), you need to use importlib, a mere import will do
nothing with already loaded modules (RNA classes are sort of
pre-registered when they are evaluated, through the meta-class system).

4 years agoFix T49527: Blender stalls when changing armature ghosting range with stepsize = 0
Joshua Leung [Sat, 21 Jan 2017 13:54:35 +0000 (02:54 +1300)]
Fix T49527: Blender stalls when changing armature ghosting range with stepsize = 0

A big thanks to Steffen Mortensen (stifan) for finding the root cause of this bug!

4 years agoFix own mistake in rB051526da6279, confusing off_t with ptrdiff_t.
Bastien Montagne [Fri, 20 Jan 2017 20:57:48 +0000 (21:57 +0100)]
Fix own mistake in rB051526da6279, confusing off_t with ptrdiff_t.

4 years agoFix minor glitches in GP code.
Bastien Montagne [Fri, 20 Jan 2017 17:46:06 +0000 (18:46 +0100)]
Fix minor glitches in GP code.

Reported by coverity scan.

4 years agoFix/cleanup stupid check on array of char being non-NULL pointer...
Bastien Montagne [Fri, 20 Jan 2017 17:43:42 +0000 (18:43 +0100)]
Fix/cleanup stupid check on array of char being non-NULL pointer...

Reported by coverity scan.

4 years agoFix float buffer of tracking image accessed outside of check that it has been correct...
Bastien Montagne [Fri, 20 Jan 2017 17:41:56 +0000 (18:41 +0100)]
Fix float buffer of tracking image accessed outside of check that it has been correctly allocated.

Reported by coverity scan.

4 years agoCycles: Use more const qualifiers to avoid possible issues
Sergey Sharybin [Fri, 20 Jan 2017 16:54:17 +0000 (17:54 +0100)]
Cycles: Use more const qualifiers to avoid possible issues

4 years agoCycles: Cleanup, split one gigantic function into two smaller ones
Sergey Sharybin [Fri, 20 Jan 2017 16:52:48 +0000 (17:52 +0100)]
Cycles: Cleanup, split one gigantic function into two smaller ones

4 years agoFix compilation error with strict flags
Sergey Sharybin [Fri, 20 Jan 2017 16:47:09 +0000 (17:47 +0100)]
Fix compilation error with strict flags

4 years agoFix compilation error with strict flags and gcc-6
Sergey Sharybin [Fri, 20 Jan 2017 16:42:55 +0000 (17:42 +0100)]
Fix compilation error with strict flags and gcc-6

4 years agoCleanup/fix some BLI_string_utf8 not using size_t/off_t as expected.
Bastien Montagne [Fri, 20 Jan 2017 12:03:21 +0000 (13:03 +0100)]
Cleanup/fix some BLI_string_utf8 not using size_t/off_t as expected.

4 years agoCleanup/fix last remnant usages of int instead of size_t for string length in BLI_str...
Bastien Montagne [Fri, 20 Jan 2017 11:21:04 +0000 (12:21 +0100)]
Cleanup/fix last remnant usages of int instead of size_t for string length in BLI_string_utils.

4 years agoD1873: Customize style for animation motion paths
Antonio Vazquez [Fri, 20 Jan 2017 15:49:14 +0000 (16:49 +0100)]
D1873: Customize style for animation motion paths

New options to define the style of the animation paths in order to get
better visibility in complex scenes.

Now is possible define the color, thickness and several options relative
to the style of the lines used to draw motion path.

4 years agoCycles: Store time in BVH nodes
Sergey Sharybin [Tue, 17 Jan 2017 14:34:18 +0000 (15:34 +0100)]
Cycles: Store time in BVH nodes

This way we can stop traversing BVH node early on.

Gives about 2-2.5x times render time improvement with 3 BVH steps.
Hopefully this gives no measurable performance loss for scenes with
single BVH step.

Traversal is currently only implemented for QBVH, meaning old CPUs
and GPU do not benefit from this change.

4 years agoCycles: Add option to split triangle motion primitives by time steps
Sergey Sharybin [Tue, 17 Jan 2017 14:13:01 +0000 (15:13 +0100)]
Cycles: Add option to split triangle motion primitives by time steps

Similar to the previous commit, the statistics goes as:

BVH Steps     Render time (sec)       Memory usage (MB)
    0                46                    260
    1                27                    373
    2                18                    598
    3                15                    826

Scene used for the tests is the agent's body from one of the barber
shop scenes (no textures or anything, just a diffuse material).

Once again this is limited to regular (non-spatial split) BVH,
Support of spatial split to this feature will come later.

4 years agoCycles: Add option to split curve motion primitives by time steps
Sergey Sharybin [Tue, 17 Jan 2017 13:37:32 +0000 (14:37 +0100)]
Cycles: Add option to split curve motion primitives by time steps

The idea is to create several smaller BVH nodes for each of the motion
curve primitives. This acts as a forced spatial split for the single
primitive.

This gives up render time speedup of motion blurred hair in the cost
of extra memory usage. The numbers goes as:

BVH Steps     Render time (sec)       Memory usage (MB)
    0               258                    191
    1               123                    278
    2                69                    453
    3                43                    627

Scene used for the tests is the agent's hair from one of the barber
shop scenes.

Currently it's only limited to scenes without spatial split enabled,
since the spatial split builder requires some changes to work properly
with motion steps coordinates.

4 years agoCycles: Add utility function to calculate curve boundbox from given 4 keys
Sergey Sharybin [Tue, 17 Jan 2017 13:23:29 +0000 (14:23 +0100)]
Cycles: Add utility function to calculate curve boundbox from given 4 keys

Also fixed some issues with motion keys calculation:

- Clamp lower and upper limits of curves so we can safely call those
  functions for the very first and very last curve segment.
- Fixed wrong indexing for the curve radius array.
- Fixed wrong motion attribute offset calculation.

4 years agoCycles: Cleanup, trailing whitespace
Sergey Sharybin [Tue, 17 Jan 2017 11:12:14 +0000 (12:12 +0100)]
Cycles: Cleanup, trailing whitespace

4 years agoCycles: Split motion triangle file once again, avoids annoying forward declarations
Sergey Sharybin [Tue, 17 Jan 2017 09:58:04 +0000 (10:58 +0100)]
Cycles: Split motion triangle file once again, avoids annoying forward declarations

4 years agoCycles: Move motion triangle intersection functions to own file
Sergey Sharybin [Tue, 17 Jan 2017 09:48:56 +0000 (10:48 +0100)]
Cycles: Move motion triangle intersection functions to own file

Mimics how regular triangles are working and makes it more clear where
the stuff is located in the kernel.

Needed to have some forward declarations because of the current placement
of things in the kernel.

4 years agoCycles: Cleanup, better variable name
Sergey Sharybin [Mon, 16 Jan 2017 19:27:05 +0000 (20:27 +0100)]
Cycles: Cleanup, better variable name

4 years agoCycles: Add utility function to fetch motion keys while on CPU side
Sergey Sharybin [Mon, 16 Jan 2017 19:26:17 +0000 (20:26 +0100)]
Cycles: Add utility function to fetch motion keys while on CPU side

4 years agoCycles: Cleanup, comments
Sergey Sharybin [Mon, 16 Jan 2017 19:08:19 +0000 (20:08 +0100)]
Cycles: Cleanup, comments

4 years agoCycles: Add utility function to fetch motion triangle when on CPU side
Sergey Sharybin [Mon, 16 Jan 2017 18:56:40 +0000 (19:56 +0100)]
Cycles: Add utility function to fetch motion triangle when on CPU side

4 years agoCycles: Cleanup, delete trailing whitespace
Sergey Sharybin [Mon, 16 Jan 2017 17:59:22 +0000 (18:59 +0100)]
Cycles: Cleanup, delete trailing whitespace

4 years agoCycles: Fix compilation error on with older GCC
Sergey Sharybin [Fri, 20 Jan 2017 10:55:48 +0000 (11:55 +0100)]
Cycles: Fix compilation error on with older GCC

Hopefully it works on all platforms now.

4 years agoFix T50460. Greying out issue with Cycles culling options.
Thomas Dinges [Fri, 20 Jan 2017 09:58:03 +0000 (10:58 +0100)]
Fix T50460. Greying out issue with Cycles culling options.

4 years agoFix compile error (-Werror=float-conversion).
Thomas Dinges [Fri, 20 Jan 2017 09:50:55 +0000 (10:50 +0100)]
Fix compile error (-Werror=float-conversion).

4 years agoDopeSheet: Show group colours behind keyframes too
Joshua Leung [Fri, 20 Jan 2017 05:14:28 +0000 (18:14 +1300)]
DopeSheet: Show group colours behind keyframes too

Following @AlonDan's feature request and @hjalti's screenshot yesterday,
I've decided to implement support for this to make it easier to scan which
keyframes correspond with which set of controls, especially when faced with
a large wall of keyframes.

In retrospect, I should've done this a long time ago!

4 years agoAPI: Do not show "Created using Sphinx" in the footer
Aaron [Thu, 19 Jan 2017 21:16:04 +0000 (16:16 -0500)]
API: Do not show "Created using Sphinx" in the footer

I talked to Campbell and he said there is no need for this

4 years agoBuild dir should be set after the sanity checks
Aaron [Thu, 19 Jan 2017 20:55:50 +0000 (15:55 -0500)]
Build dir should be set after the sanity checks

Error here is that if do not have 2012 it switch to 2015 but not change the build dir

4 years agoBMesh: remove BM_face_create_ngon_vcloud
Campbell Barton [Thu, 19 Jan 2017 19:06:06 +0000 (06:06 +1100)]
BMesh: remove BM_face_create_ngon_vcloud

Instead, add BM_verts_sort_radial_plane
and use regular creation API.

4 years agoCorrect asserts, un-hiding when selected is ok
Campbell Barton [Thu, 19 Jan 2017 19:00:55 +0000 (06:00 +1100)]
Correct asserts, un-hiding when selected is ok

4 years agoCycles: Expose diffuse and glossy depth to Light Path node
Sergey Sharybin [Tue, 6 Dec 2016 15:15:36 +0000 (16:15 +0100)]
Cycles: Expose diffuse and glossy depth to Light Path node

Was a bit confusing to have transparent and translucent depth
exposed but no diffuse or glossy.

Reviewers: brecht

Subscribers: eyecandy

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

4 years agoCycles: Don't use fast math for the host code
Sergey Sharybin [Thu, 19 Jan 2017 13:48:43 +0000 (14:48 +0100)]
Cycles: Don't use fast math for the host code

This is important for the reliable behavior or isnan/isfinite/min/max
functions to work with nan and non-finite values. Some of the issues
with fast math are possible to work around, but didn't find a way to
have reliable min/max implementation yet.

4 years agoCycles: Add fast-math safe isnan and isfinite
Sergey Sharybin [Thu, 19 Jan 2017 13:41:04 +0000 (14:41 +0100)]
Cycles: Add fast-math safe isnan and isfinite

Currently unused, but might become really handy in the future.

4 years agoCycles: Remove using namespace hell
Sergey Sharybin [Thu, 19 Jan 2017 13:24:14 +0000 (14:24 +0100)]
Cycles: Remove using namespace hell

Please NEVER EVER use such a statement, it's only causing HUGE
issues. What is even worse: it's not always possible to immediately
see that the hell is coming from such a statement.

There is still some statements in the existing code, will leave
those for a later cleanup.

4 years agoGPencil: Add option to create blank frame in active layer only
Antonio Vazquez [Thu, 19 Jan 2017 12:04:56 +0000 (13:04 +0100)]
GPencil: Add option to create blank frame in active layer only

Now it is possible to select if the blank frame is created in active
layer only or in all layers.

4 years agoCleanup: naming, comments assert for hide+selected
Campbell Barton [Thu, 19 Jan 2017 11:59:41 +0000 (22:59 +1100)]
Cleanup: naming, comments assert for hide+selected

4 years agoBMesh: improve hide-flush internal logic
Campbell Barton [Thu, 19 Jan 2017 11:45:15 +0000 (22:45 +1100)]
BMesh: improve hide-flush internal logic

- flushing hidden state ran when it didn't need to.
- flushing checks didn't early exit when first visible element found.
- low level BM_*_hide API calls like this can use skip iterators
  can loop over struct members directly.

No user-visible changes.

4 years agoOpenGL: convert legacy calls in transform.c
Mike Erwin [Thu, 19 Jan 2017 05:46:01 +0000 (00:46 -0500)]
OpenGL: convert legacy calls in transform.c

Took pieces from D2316 and D2359, changed a few more things.

- use new immediate mode
- use new matrix stack
- remove state push/pop

Part of T49043 and T49450

4 years agoUI: Fix capitalization inconsistency
Aaron Carlisle [Thu, 19 Jan 2017 00:38:55 +0000 (19:38 -0500)]
UI: Fix capitalization inconsistency

4 years agoCycles: Fix amount of rendered samples not being shown while rendering the last tile...
Lukas Stockner [Wed, 18 Jan 2017 23:39:52 +0000 (00:39 +0100)]
Cycles: Fix amount of rendered samples not being shown while rendering the last tile on CPU

4 years agoFix T49807: Inset faces edge rail bug
Campbell Barton [Wed, 18 Jan 2017 23:35:10 +0000 (10:35 +1100)]
Fix T49807: Inset faces edge rail bug

4 years agoFix face-creation with existing hidden geometry
Campbell Barton [Wed, 18 Jan 2017 22:04:50 +0000 (09:04 +1100)]
Fix face-creation with existing hidden geometry

- face-create-extend option could add hidden verts and edges into
  the selection history (invalid state).
- faces could be created that included existing hidden edges
  that remained hidden (invalid state too).
- newly created faces could copy hidden flag from surrounding faces,
  giving very confusing results (looks as if face creation failed).

Surprising nobody noticed these years old bugs!

4 years agoBMesh: Use angle_signed_on_axis_v3v3v3_v3
Campbell Barton [Wed, 18 Jan 2017 20:59:32 +0000 (07:59 +1100)]
BMesh: Use angle_signed_on_axis_v3v3v3_v3

4 years agoFix strict compiler warning message
Sergey Sharybin [Wed, 18 Jan 2017 14:56:40 +0000 (15:56 +0100)]
Fix strict compiler warning message

4 years agoGPencil: Avoid variable shadowing
Sergey Sharybin [Wed, 18 Jan 2017 14:56:04 +0000 (15:56 +0100)]
GPencil: Avoid variable shadowing

4 years agoReproject Strokes - To Surface/Geometry
Joshua Leung [Wed, 18 Jan 2017 14:20:44 +0000 (03:20 +1300)]
Reproject Strokes - To Surface/Geometry

Experimental option for the Reproject Strokes operator to project strokes on to
geometry, instead of only doing this in a planar (i.e. parallel to viewplane) way.

The current implementation is quite rough, and may need to be improved before it
is really ready for use. Potential issues:
* Loss of precision (i.e. stairstepping artifacts) from the 3D -> 2D -> 3D conversion
  as we don't have float version of one of the projection funcs
* Jagged depth if there are gaps, since it will default back to the 3d-cursor plane
  if no geometry was found (instead of doing some fancy interpolation scheme)
* I'm not sure if it's that useful for adapting GP strokes to deforming geometry yet...

4 years agoFix: Make it possible to erase strokes (on other layers) even if the active layer...
Joshua Leung [Wed, 18 Jan 2017 14:00:33 +0000 (03:00 +1300)]
Fix: Make it possible to erase strokes (on other layers) even if the active layer doesn't have any frames

4 years agoFix: Avoid creating redundant frames when erasing
Joshua Leung [Wed, 18 Jan 2017 13:57:08 +0000 (02:57 +1300)]
Fix: Avoid creating redundant frames when erasing

Now the eraser checks if there's an active frame with some strokes in it
before creating a new frame. There's no point in creating a new frame if
there are no strokes in the active frame (if one exists).

This still doesn't help much if there were strokes but they weren't touched though...

4 years agoGPencil: Pressing 'B' while in 'Continuous Drawing' mode will create a blank frame
Joshua Leung [Wed, 18 Jan 2017 13:24:41 +0000 (02:24 +1300)]
GPencil: Pressing 'B' while in 'Continuous Drawing' mode will create a blank frame

This is a hardcoded keymapping that just calls the "Add Blank Frame" operator
introduced in the previous commit.

4 years agoGPencil: "Add Blank Frame" operator (D+B)
Joshua Leung [Wed, 18 Jan 2017 13:11:51 +0000 (02:11 +1300)]
GPencil: "Add Blank Frame" operator  (D+B)

This operator adds a new frame with nothing in it on the current frame.
If there is already a frame there, all existing frames are shifted one frame later.

Quite often when animating, you may want a quick way to get a blank frame,
ready to start drawing something new. Or maybe you just need a quick way to
add a "placeholder" frame so that a suddenly-appearing element does not show
up before its time.

4 years agoGPencil: Cleanup - move include line to correct scope
Antonio Vazquez [Wed, 18 Jan 2017 12:00:09 +0000 (13:00 +0100)]
GPencil: Cleanup - move include line to correct scope

4 years agoGPencil: Fix unreported error in animation after rename items
Antonio Vazquez [Wed, 18 Jan 2017 11:25:49 +0000 (12:25 +0100)]
GPencil: Fix unreported error in animation after rename items

If the layers or the colors were renamed, the animation data was wrong
because the data path was not updated.

I also have fixed a possible stroke color name update if the name was duplicated moving
the rename function call after checking unique name.

4 years agoCleanup: Strict compiler flags
Sergey Sharybin [Wed, 18 Jan 2017 11:20:53 +0000 (12:20 +0100)]
Cleanup: Strict compiler flags

Also seems the new file forced trailing whitespace, which goes against

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

4 years agoTransform manipulator: Allow first clicking Shift before selecting axis
Sergey Sharybin [Thu, 15 Dec 2016 10:12:43 +0000 (11:12 +0100)]
Transform manipulator: Allow first clicking Shift before selecting axis

Avoids possible jumps when one is trying to do some really preciese tweak.

Quite striaghtforward change for mouse input initialization: take Shift
state into account. However, this will interfere with the axis exclusion
which is currently also uses Shift (the feature to move something in a
plane which doesn't have selected axis). This is probably not so commonly
used feature (nobody in the studio even knew of it) and the only downside
now would be that such a constrainted movement will become accurate by
default. That's easy to deal from user side by just unholding Shift key.

Reviewers: brecht, mont29, Severin

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

4 years agoGP Interpolation: "Remove Breakdowns" operator
Joshua Leung [Wed, 18 Jan 2017 06:40:48 +0000 (19:40 +1300)]
GP Interpolation: "Remove Breakdowns" operator

To make it faster to try different interpolation curves, there's a new operator
"Remove Breakdowns" which will delete all breakdowns sandwiched by normal
keyframes (i.e. all the ones that the previous run of the Interpolation op created)

4 years agoGP Interpolate Sequence: Tool settings for controlling the shape of interpolation
Joshua Leung [Wed, 18 Jan 2017 06:00:17 +0000 (19:00 +1300)]
GP Interpolate Sequence: Tool settings for controlling the shape of interpolation

This commit introduces the ability to use the Robert Penner easing equations
or a Custom Curve to control the way that the "Interpolate Sequence" operator
interpolates between keyframes. Previously, it was only possible to get linear
interpolation between the gp frames.

Workflow:
1) Place current frame between a pair of GP keyframes
2) Open the "Interpolate" panel in the Toolshelf
3) Choose the interpolation type (under "Sequence Options")
4) Adjust settings (e.g. if you're using "Custom Curve", use the curvemap widget
   to define the way that the interpolation proceeds)
5) Click "Sequence" to interpolate
6) Play back/scrub the animation to see if you've got the result you want
7) If you need to make some tweaks, undo, or delete the generated keyframes,
   then repeat the process again from step 4 until you've got the desired result.

4 years agoGP Interpolate: Move settings from "gp_sculpt" to a new toolsettings struct - "gp_int...
Joshua Leung [Wed, 18 Jan 2017 03:43:17 +0000 (16:43 +1300)]
GP Interpolate: Move settings from "gp_sculpt" to a new toolsettings struct - "gp_interpolate"

The "gp_sculpt" settings should be strictly for stroke sculpting, and not abused by
other tools. (Similarly, if other general GP tools need one-off options, those should
go into the normal toolsettings->gpencil_flag)

Furthermore, this paves the way for introducing new settings for controlling the way
that GP interpolation takes place (e.g. with easing equations, or a custom curvemap)

4 years agoGP Interpolate Code Cleanup (Second Round)
Joshua Leung [Tue, 17 Jan 2017 12:29:40 +0000 (01:29 +1300)]
GP Interpolate Code Cleanup (Second Round)

* Reduce scope of variables
* Simplify a lot of the active_gpl->actframe->...->framenum stuff
* Missed some error messages

4 years agoCode Cleanup for GP Interpolation ops (first pass)
Joshua Leung [Tue, 17 Jan 2017 11:48:15 +0000 (00:48 +1300)]
Code Cleanup for GP Interpolation ops (first pass)

* Reshuffled some blocks of code for better ease of navigation/flow in the file
* Improved some tooltips
* Removed "Helper" tag from some functions that serve bigger roles
* Fixed some errant formatting

4 years agoCode Cleanup: Move GPencil Interpolation operators into their own file
Joshua Leung [Tue, 3 Jan 2017 10:29:21 +0000 (23:29 +1300)]
Code Cleanup: Move GPencil Interpolation operators into their own file

The interpolation operators (and their associated code) occupied a significant
portion of gpencil_edit.c (which was getting a bit heavy). So, it's best to split
these out into a separate file to make things easier to handle, in preparation
for some further dev work.

4 years agoT50457 Remove temporary solution for animation types and put in definitve position
Antonio Vazquez [Tue, 17 Jan 2017 19:01:59 +0000 (20:01 +0100)]
T50457 Remove temporary solution for animation types and put in definitve position

After revert the commit rB4b99958ca12642, the line added at the end of the enum is not necessary anymore because it is replaced by the corresponding element in the list in the right position.

4 years agoRevert "Remove particle expander"
Antonio Vazquez [Tue, 17 Jan 2017 18:46:05 +0000 (19:46 +0100)]
Revert "Remove particle expander"

This reverts commit 4b99958ca126420c6f288dd9e7aad11232d20dd8.

4 years agoFix previous commit because there are some code using this define, but really it...
Antonio Vazquez [Tue, 17 Jan 2017 14:53:31 +0000 (15:53 +0100)]
Fix previous commit because there are some code using this define, but really it is not used in editors. This is a temporary fix to broken editors, but this entry must be removed or moved to the right place when particles are in place again.

4 years agoRemove unused definition. This enum must be synchronized with the registration ANIM_i...
Antonio Vazquez [Tue, 17 Jan 2017 12:32:32 +0000 (13:32 +0100)]
Remove unused definition. This enum must be synchronized with the registration ANIM_init_channel_typeinfo_data function in anim_channels_define.c

If the list is not equal, weird things start to happend in animation editors.

4 years agoAdd 'Layer Weight' node to Blender internal node items
Alexander Romanov [Tue, 17 Jan 2017 09:02:05 +0000 (12:02 +0300)]
Add 'Layer Weight' node to Blender internal node items

4 years agoReturn correct alpha for environment map in GLSL
Alexander Romanov [Tue, 17 Jan 2017 08:52:02 +0000 (11:52 +0300)]
Return correct alpha for environment map in GLSL

4 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Mon, 16 Jan 2017 19:50:10 +0000 (20:50 +0100)]
Merge branch 'master' into blender2.8

4 years agoCleanup/refactor: move BKE_deform_flip_side_name & co to BLI_string_utils
Bastien Montagne [Mon, 16 Jan 2017 19:34:13 +0000 (20:34 +0100)]
Cleanup/refactor: move BKE_deform_flip_side_name & co to BLI_string_utils

Functions like that do not have anything to do in BKE really, even less
when actually more used for bones than vgroups!

4 years agoCleanup/refactor: get rid of fixed name limit in BKE_deform_flip_side_name & co.
Bastien Montagne [Mon, 16 Jan 2017 19:08:46 +0000 (20:08 +0100)]
Cleanup/refactor: get rid of fixed name limit in BKE_deform_flip_side_name & co.

Those were forcing to use vgroup name define in bones area, or even
mixing with maxbonename... ugly, and totally avoidable.

4 years agoCleanup/refactor: Add new BLI_string_util.
Bastien Montagne [Mon, 16 Jan 2017 16:33:34 +0000 (17:33 +0100)]
Cleanup/refactor: Add new BLI_string_util.

Things like `BLI_uniquename` had nothing, but really nothing to do in
BLI_path_util files!

Also, got rid of length limitation in `BLI_uniquename_cb`, we can use
alloca here to avoid overhead of malloc while keeping free size (within
reasonable limits of course).

4 years agoCleanup: remove unused & unimplemented `BLI_newname`.
Bastien Montagne [Mon, 16 Jan 2017 13:06:26 +0000 (14:06 +0100)]
Cleanup: remove unused & unimplemented `BLI_newname`.

4 years agoFix T50393: Flip names working just on one side when both are selected.
Bastien Montagne [Mon, 16 Jan 2017 13:03:31 +0000 (14:03 +0100)]
Fix T50393: Flip names working just on one side when both are selected.

Just store bones that could not get renamed to desired flipped name on the
first try into a temp list, and try to rename them a second time.

This is rather simple solution, will induce 'over numbering' in case you
flip a bone to another unselected bone's name (since number will be
incremented in both rename attempts), but think this is acceptable minor
glitch, for a corner case situation that does not have any good
resolution anyway.

Also, set `strip_numbers` option of `BKE_deform_flip_side_name` to
false, otherwise chains of bones with same names would get their numbers
completely messed up after name flipping.

Based on work by @dfelinto in D2456 (https://developer.blender.org/D2456), thanks.

4 years agoCycles: Cleanup, spelling
Sergey Sharybin [Mon, 16 Jan 2017 16:55:41 +0000 (17:55 +0100)]
Cycles: Cleanup, spelling

4 years agoCycles: Cleanup, avoid shadowing
Sergey Sharybin [Mon, 16 Jan 2017 16:54:39 +0000 (17:54 +0100)]
Cycles: Cleanup, avoid shadowing

4 years agoOpenGL: convert anim_channel_defines.c to new imm mode
Benjamin N. Summerton [Mon, 16 Jan 2017 05:04:42 +0000 (00:04 -0500)]
OpenGL: convert anim_channel_defines.c to new imm mode

This is part of T49043

fixed up some color/rect calls

fixed up ANIM_channel_draw()

Reviewers: krash, merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Maniphest Tasks: T49043

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

4 years agoOpenGL: fix immRect usage & convert more glRect calls
Mike Erwin [Mon, 16 Jan 2017 04:48:46 +0000 (23:48 -0500)]
OpenGL: fix immRect usage & convert more glRect calls

part of T49043

4 years agoUpdating outliner_draw_struct_marks to retained mode
Mike Erwin [Mon, 16 Jan 2017 00:26:35 +0000 (19:26 -0500)]
Updating outliner_draw_struct_marks to retained mode

Had to add a few utility functions to replace existing functions. Let me know if these are duplicates.

Reviewers: merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Maniphest Tasks: T49043

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

4 years agoAdd 3d to 2d plane mapping functions to math lib
Luca Rood [Thu, 22 Dec 2016 04:13:03 +0000 (02:13 -0200)]
Add 3d to 2d plane mapping functions to math lib

This adds two functions to project 3d coordinates onto a 3d plane,
to get 2d coordinates, essentially eliminating the plane's normal axis
from the coordinates.

Reviewed By: mont29

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

4 years agoFix missing user when opening text from ID UI widget.
Bastien Montagne [Fri, 13 Jan 2017 17:12:56 +0000 (18:12 +0100)]
Fix missing user when opening text from ID UI widget.

Own mistake in recent fix for Text data-block usercount (rBa9163f7d2).

Reported by @sergey over IRC, thanks.

4 years agoCycles: Fix wrong transparent shadows for motion blur hair
Sergey Sharybin [Fri, 13 Jan 2017 14:41:20 +0000 (15:41 +0100)]
Cycles: Fix wrong transparent shadows for motion blur hair

This was a missing bit from b53ce9a.

4 years agoCycles: Cleanup, style
Sergey Sharybin [Fri, 13 Jan 2017 14:24:56 +0000 (15:24 +0100)]
Cycles: Cleanup, style

4 years agoCycles: Simplify some code in Curve BVH reference fill
Sergey Sharybin [Fri, 13 Jan 2017 09:59:34 +0000 (10:59 +0100)]
Cycles: Simplify some code in Curve BVH reference fill

makes code slightly shorter and uses idea of const qualifiers.

4 years agoCycles: Avoid shadowing in BVH code
Sergey Sharybin [Fri, 13 Jan 2017 09:53:01 +0000 (10:53 +0100)]
Cycles: Avoid shadowing in BVH code

Run into some nasty bugs while trying various things here.

Wouldn't mind enabling -Wshadow for Cycles actually..

4 years agoFix small spelling error
Aaron Carlisle [Fri, 13 Jan 2017 04:36:08 +0000 (23:36 -0500)]
Fix small spelling error

4 years agoDynamic Paint: recursively search for island border edges.
Alexander Gavrilov [Tue, 3 Jan 2017 16:11:59 +0000 (19:11 +0300)]
Dynamic Paint: recursively search for island border edges.

It is quite likely in a triangulated mesh that the actual island edge
belongs to a different triangle than the current pixel; for example
consider corners of a triangulated axis aligned rectangle face that
have the additional edge: a pixel there will have to be assigned to
one of the triangles, but one of the edges of the original rectangle
can only be accessed through the other triangle.

Thus for robust operation it is necessary to do a recursive search.
The search is limited by requiring that it only goes through edges
that bring it closer to the target point, and also by depth as a
safeguard.

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

4 years agoDynamic Paint: provide margin of error for linking neighbors across seams.
Alexander Gavrilov [Tue, 3 Jan 2017 16:13:02 +0000 (19:13 +0300)]
Dynamic Paint: provide margin of error for linking neighbors across seams.

The code requires the pixel on the other side of the seam to be assigned
precisely to the expected triangle. This can cause false negatives around
vertices, where a pixel is likely to touch multiple triangles and thus
cannot be said to unambiguously belong to any one of them, so check
distance to the intended triangle and accept the result if it's close.

4 years agoDynamic Paint: improve UV island border handling in effects.
Alexander Gavrilov [Tue, 3 Jan 2017 15:50:15 +0000 (18:50 +0300)]
Dynamic Paint: improve UV island border handling in effects.

1. Forcibly symmetrize the neighbor relations, so that if A is neighbor
   of B, B is neighbor of A. The existing code is guaranteed to violate
   this if texture resolution is different between the sides of a seam.

2. In texture mode dynamic paint adds a 1 pixel wide border around the
   islands. These pixels aren't really part of the dynamic paint domain
   and thus by design can't have symmetrical neighbor relations. This
   means they can't be treated by effects like normal pixels.
   The simplest way to handle it in a consistent way is to exclude
   them from effects, but add an additional pass that recomputes them
   as average of their non-border neighbors, located on both sides of
   the seam.

4 years agoCycles: Allow up to 4 motion curve primitives per BVH node
Sergey Sharybin [Thu, 12 Jan 2017 17:23:23 +0000 (18:23 +0100)]
Cycles: Allow up to 4 motion curve primitives per BVH node

This avoids intersection AABB of different curve primitives
which makes it less ray-to-primitive intersections.

This gives about 30% speedup of hair rendering in the barber
shop scenes here. There is still some work to be done on those
files to solve major speed issues on certain frames.