blender.git
2 years agoMerge branch 'master' into blender2.8
Brecht Van Lommel [Fri, 16 Mar 2018 03:16:21 +0000 (04:16 +0100)]
Merge branch 'master' into blender2.8

2 years agoFix T54326: Import Alembic stuck in edit mode
Kévin Dietrich [Fri, 16 Mar 2018 03:06:18 +0000 (04:06 +0100)]
Fix T54326: Import Alembic stuck in edit mode

Switch to object mode before doing the import.

2 years agoFix T53971: single layer render showing the wrong render layer in image editor.
Cheryl Chen [Thu, 15 Mar 2018 22:36:15 +0000 (23:36 +0100)]
Fix T53971: single layer render showing the wrong render layer in image editor.

Original patch Cheryl Chen, extra fixes by Brecht.

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

2 years agoCode refactor: move OIIO image buffer writing outside session, into callback.
Guillaume Chereau [Thu, 15 Mar 2018 21:07:37 +0000 (22:07 +0100)]
Code refactor: move OIIO image buffer writing outside session, into callback.

Original patch by Guillaume, modifications by Brecht.

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

2 years agoGHOST: Support Unity taskbar progress API
Lukas Stockner [Thu, 15 Mar 2018 19:43:08 +0000 (20:43 +0100)]
GHOST: Support Unity taskbar progress API

Unity itself is deprecated, but the API is also supported by KDE and the GNOME Dock extension,
which means that it will be useful for a wide variety of distributions.

To get a progress bar, the system must have a blender.desktop file and libunity installed.

The need for libunity is annoying, but the only alternative would be to integrate a DBus library...

Reviewers: campbellbarton, brecht

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

2 years agoBLI_assert: extract from BLI_utildefines
Campbell Barton [Thu, 15 Mar 2018 19:03:29 +0000 (06:03 +1100)]
BLI_assert: extract from BLI_utildefines

BLI_utildefines is quite large, defining many unrelated things.
Add BLI_assert to include in inline headers, so math defines don't
pull in too much.

2 years agoUV/Image Editor: Optimize UV Drawing
Germano [Thu, 15 Mar 2018 16:36:16 +0000 (13:36 -0300)]
UV/Image Editor: Optimize UV Drawing

Use batchs to store the entire buffer of loops before drawing.
These batchs can be stored in the mesh draw cache later.

2 years agoDepsgraph: Fix missing shader updates with copy on write
Sergey Sharybin [Thu, 15 Mar 2018 14:18:16 +0000 (15:18 +0100)]
Depsgraph: Fix missing shader updates with copy on write

Basically, don't do full in-place copy of node tree datablock if it's
already expanded. Current way how node tree is evaluated is fully
built around the idea that evaluation copies values from original
to copied datablocks.

Changing links is handled on another level.

2 years agoMesh: Batch cache: Fix sculpt update issue.
Clément Foucault [Thu, 15 Mar 2018 12:55:20 +0000 (13:55 +0100)]
Mesh: Batch cache: Fix sculpt update issue.

Old solution was to create a new vbo and copy it to the location of
the old vbo hoping for the batches to update their vaos before drawing.

The issue is that the new VAO caching is not updating the VAOs at all
unless the shader interface changes.

So unless we expand gawain to support updating of vertex buffers (in a
better way than the current "dynamic" buffer) we need to delete every batch
linked to the vbo we want to recreate.

This solution might have performance implications.

2 years agoGWN: Fix compilation error without VRAM_USAGE flag.
Clément Foucault [Thu, 15 Mar 2018 12:31:49 +0000 (13:31 +0100)]
GWN: Fix compilation error without VRAM_USAGE flag.

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Thu, 15 Mar 2018 19:11:35 +0000 (06:11 +1100)]
Merge branch 'master' into blender2.8

2 years agoMinor cleanup & commenting.
Bastien Montagne [Thu, 15 Mar 2018 08:44:03 +0000 (09:44 +0100)]
Minor cleanup & commenting.

2 years agoGHOST: Fix wrong usage of wglCreatePbufferARB.
Clément Foucault [Thu, 15 Mar 2018 00:51:46 +0000 (01:51 +0100)]
GHOST: Fix wrong usage of wglCreatePbufferARB.

Last argument must be a pointer to list of int terminated by a value of 0.

2 years agoMissed last commit
Campbell Barton [Thu, 15 Mar 2018 00:16:32 +0000 (11:16 +1100)]
Missed last commit

2 years agoBLI_math: don't use asserts in inline API
Campbell Barton [Thu, 15 Mar 2018 00:10:11 +0000 (11:10 +1100)]
BLI_math: don't use asserts in inline API

Requires BLI_utildefines.h to be included first,
(already noted in other inline code).

Possible alternative could be to move BLI_assert into own header.

2 years agoGWN: Batch: Perf: Comment out glBindVertexArray(0)
Clément Foucault [Wed, 14 Mar 2018 21:40:56 +0000 (22:40 +0100)]
GWN: Batch: Perf: Comment out glBindVertexArray(0)

Even if they are for safety they are not free to use !

On my system (Mesa + AMD Vega GPU) calling:
glBindVertexArray(1);
glDrawArrays(GL_TRIANGLES, 0, 3);
glBindVertexArray(0);
in a loop, shows the same overhead as a full vao switching (which is more
or less 10 times slower than just calling glDrawArrays)

Moreover, now that we use OpenGL 3.3 binding a VAO is REQUIRED to issue a
drawcall so it is garanted to be overwritten before the next drawcall.
Problem can only happen if someone draws directly with opengl commands.

2 years agoGWN: Batch: Only revert to default Vao when needed.
Clément Foucault [Wed, 14 Mar 2018 21:21:59 +0000 (22:21 +0100)]
GWN: Batch: Only revert to default Vao when needed.

Drawing ranges via glDrawArrays is already supported and should not need
a manual offset in the VAO like glDrawArraysInstanced or glDrawElements.

2 years agoGWN: Add primitive restart in element/index buffers.
Clément Foucault [Wed, 14 Mar 2018 21:06:20 +0000 (22:06 +0100)]
GWN: Add primitive restart in element/index buffers.

This allows to draw multiple primitive of the type
GWN_PRIM_LINE_STRIP
GWN_PRIM_LINE_LOOP
GWN_PRIM_TRI_STRIP
GWN_PRIM_TRI_FAN
GWN_PRIM_LINE_STRIP_ADJ
with only one drawcall. This should speed up some areas that are really
sensitive to drawcall counts : UV drawing, Hair drawing...

2 years agoFix T54322: partial redraw not working after recent refactor.
Brecht Van Lommel [Wed, 14 Mar 2018 19:39:10 +0000 (20:39 +0100)]
Fix T54322: partial redraw not working after recent refactor.

2 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Wed, 14 Mar 2018 17:07:01 +0000 (18:07 +0100)]
Merge branch 'master' into blender2.8

2 years agoStyle cleanup.
Bastien Montagne [Wed, 14 Mar 2018 17:05:09 +0000 (18:05 +0100)]
Style cleanup.

2 years agoFix (unreported) broken IDarray case in IDP_EqualsProperties_ex.
Bastien Montagne [Wed, 14 Mar 2018 16:53:29 +0000 (17:53 +0100)]
Fix (unreported) broken IDarray case in IDP_EqualsProperties_ex.

For IDProps IDarray, IDP_EqualsProperties was called for each item,
instead of IDP_EqualsProperties_ex, discarding value of `is_strict`
option.

Probably not an issue with current code, though.

2 years agoFix T54319: Crash after double-clicking baked F-curve
Sergey Sharybin [Wed, 14 Mar 2018 14:57:14 +0000 (15:57 +0100)]
Fix T54319: Crash after double-clicking baked F-curve

2 years agoCleanup: rename BLI_array_count -> len
Campbell Barton [Wed, 14 Mar 2018 14:42:44 +0000 (01:42 +1100)]
Cleanup: rename BLI_array_count -> len

Match naming convention used everywhere else.
Count should only be used when this isn't directly accessible.

2 years agoDepsgraph: Fix missing updates with drivers
Sergey Sharybin [Wed, 14 Mar 2018 14:19:44 +0000 (15:19 +0100)]
Depsgraph: Fix missing updates with drivers

The issue was only visible with copy-on-write enabled, and related to the
fact, that dependency graph builder binds original FCurves.

For now use smallest patch possible to make things to work and to make
draguu happy.

Need to think of a smarter way to deal with drivers, bones and view layers.

2 years agoClay: Add FXAA.
Clément Foucault [Wed, 14 Mar 2018 13:55:36 +0000 (14:55 +0100)]
Clay: Add FXAA.

I tried to use real multisampling but the main problem is the outline detection that needs to have matching depth samples.

So adding FXAA instead. Always on for now, may add a parameter for it later.

One thing to note is that we need to copy the final output once again to the main color buffer because we cannot swap the dtxl textures (they can be referenced elsewhere like GPUOffscreen).

We could improve upon this and add TAA on top if viewport is still.

2 years agoGPUViewport: Fix offscreen multisample syncing.
Clément Foucault [Wed, 14 Mar 2018 11:55:19 +0000 (12:55 +0100)]
GPUViewport: Fix offscreen multisample syncing.

2 years agoClay: Refactor: Port clay to a deferred pipeline.
Clément Foucault [Tue, 13 Mar 2018 21:58:18 +0000 (22:58 +0100)]
Clay: Refactor: Port clay to a deferred pipeline.

This means that rendering clay with AO only needs 1 geometry pass.
Thus greatly improving performance of poly heavy scene.

This also fix a self shadow issue in the AO, making low sample count
way better.

We also do not need to blit the depth anymore since we
are doing a fullscreen shading pass.

The constant cost of running the a deferred shading pass is negligeable.
This include quite a bit of code cleanup inside clay_engine.c.

The deferred pipeline is only enabled if at least one material needs it.
Multisampling is not supported yet.

Small hacks when doing deferred:
- We invert the normal before encoding it for precision.
- We put the facing direction into the sign of the mat_id.
- We dither the normal to fight the low bitdepth artifacts of the normal
  buffer (which is 8bits per channel to reduce bandwidth usage).

2 years agoDRW: Add DRW_viewport_invert_size_get for more ease of use.
Clément Foucault [Tue, 13 Mar 2018 21:38:07 +0000 (22:38 +0100)]
DRW: Add DRW_viewport_invert_size_get for more ease of use.

2 years agoGPUTexture: Unlock GL_R16I format.
Clément Foucault [Tue, 13 Mar 2018 21:36:24 +0000 (22:36 +0100)]
GPUTexture: Unlock GL_R16I format.

2 years agoFix make single user crash
Dalai Felinto [Tue, 13 Mar 2018 19:10:20 +0000 (16:10 -0300)]
Fix make single user crash

How to reproduce the crash:
* Factory startup
* 'u'key (make single user)

It comes with a simple unittest to reproduce the original issue.

2 years agoCleanup: use flags instead of collection of bools to get RNA override status.
Bastien Montagne [Wed, 14 Mar 2018 10:47:35 +0000 (11:47 +0100)]
Cleanup: use flags instead of collection of bools to get RNA override status.

2 years agoUpdated bpy.props getter/setter example
Sybren A. Stüvel [Wed, 14 Mar 2018 10:42:36 +0000 (11:42 +0100)]
Updated bpy.props getter/setter example

- The common name in computer science are 'getters' and 'setters', so by
  adding these names to the documentation (while 'get' and 'set are still
  also mentioned) we improve findability. Having 'Getters/Setters' as a
  title also makes it clearer that this example is not just about
  getting or setting the property value.
- Added a little prefix to each printed value, so that print statement,
  expected output, and real output can be matched easier.

2 years agoFix T54286: bpy.props operator example misses property access
Sybren A. Stüvel [Wed, 14 Mar 2018 10:31:14 +0000 (11:31 +0100)]
Fix T54286: bpy.props operator example misses property access

The old example had two downsides:

- It promoted a blocking UI design, where the user is shown a popup
  before actually executing the operator.
- It didn't show how to actually use the property values.

The new code avoids these mistakes. The properties are also shown in the
redo panel in the 3D view.

Note that I also changed the bl_idname, as this is an example about
properties, not about dialogue boxes, and changed the class name to use
the standard operator naming convention.

I also extended the example to include a panel that sets multiple
properties of the operator, since I see questions about this relatively
frequently.

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 14 Mar 2018 07:08:37 +0000 (18:08 +1100)]
Merge branch 'master' into blender2.8

2 years agoCleanup: use sections for editmesh tools/select
Campbell Barton [Wed, 14 Mar 2018 06:25:23 +0000 (17:25 +1100)]
Cleanup: use sections for editmesh tools/select

2 years agoEevee: Fix sequencer rendering.
Clément Foucault [Wed, 14 Mar 2018 02:27:22 +0000 (03:27 +0100)]
Eevee: Fix sequencer rendering.

Sequencer rendering can use multisample render targets. Be sure to sync
thoses after rendering.

Also disable the sample loop when not needed.

Do note that currently the color correction is broken with the sequencer.

2 years agoGPUViewport: Fix offscreen multisample rendering.
Clément Foucault [Wed, 14 Mar 2018 02:22:35 +0000 (03:22 +0100)]
GPUViewport: Fix offscreen multisample rendering.

Multisample rendering needs to have both a multisample and a regular color/depth target for engines that does not support MSAA.

2 years agoGPUTexture: Save sample count inside texture struct.
Clément Foucault [Wed, 14 Mar 2018 02:20:39 +0000 (03:20 +0100)]
GPUTexture: Save sample count inside texture struct.

This adds a quick way to know if a texture is a multisample texture and its sample count.

2 years agoAPI generating script: give better version for releases builds.
Bastien Montagne [Tue, 13 Mar 2018 18:49:39 +0000 (19:49 +0100)]
API generating script: give better version for releases builds.

Was giving '2.62.1 <sha1>' even for releases, now rather giving nicer
'2.62a <sha1>' in that case.

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Tue, 13 Mar 2018 15:15:37 +0000 (02:15 +1100)]
Merge branch 'master' into blender2.8

2 years agoCleanup: pass selectmode directly
Campbell Barton [Tue, 13 Mar 2018 15:02:05 +0000 (02:02 +1100)]
Cleanup: pass selectmode directly

Pass instead of editmesh or toolsettings.
Needed for multi edit-mode

2 years agoCleanup: doxygen comments
Campbell Barton [Tue, 13 Mar 2018 14:58:46 +0000 (01:58 +1100)]
Cleanup: doxygen comments

2 years agoFix (unreported) crash when changing active shapekey in Edit mode.
Bastien Montagne [Tue, 13 Mar 2018 13:08:17 +0000 (14:08 +0100)]
Fix (unreported) crash when changing active shapekey in Edit mode.

Looks like someone changed the signature of some RNA update callback,
and for some reason that 'change skey' update function was not updated
(or later got merged from master)...

We'll need RNA to check for its func signatures, some day...

2 years agoFix T54302 - Wrong added scene when adding a scene strip to the Sequencer
Joshua Leung [Tue, 13 Mar 2018 10:04:58 +0000 (23:04 +1300)]
Fix T54302 - Wrong added scene when adding a scene strip to the Sequencer

When adding scene strips to the sequencer, the wrong scenes were
getting getting added if some were skipped. For example:
Given 4 scenes (A, B, C, D) if you're trying to add the last 3 scenes
(B, C, D) as strips to the first scene (A), it would ended up adding
"A, B, C" instead of "B, C, D" as expected.

Fix provided by Andrew (signal9).

2 years agoUse Action datablock's own icon (instead of Animation Data's one) for File Browser...
Joshua Leung [Mon, 12 Mar 2018 12:44:03 +0000 (01:44 +1300)]
Use Action datablock's own icon (instead of Animation Data's one) for File Browser's lib icons

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Tue, 13 Mar 2018 07:39:51 +0000 (18:39 +1100)]
Merge branch 'master' into blender2.8

2 years agoCleanup: long lines, use doxy sections
Campbell Barton [Tue, 13 Mar 2018 07:06:05 +0000 (18:06 +1100)]
Cleanup: long lines, use doxy sections

2 years agoEevee: Render: Add Info messages.
Clément Foucault [Tue, 13 Mar 2018 03:25:50 +0000 (04:25 +0100)]
Eevee: Render: Add Info messages.

2 years agoEevee: Render: Allow cancel during probe update.
Clément Foucault [Tue, 13 Mar 2018 02:58:27 +0000 (03:58 +0100)]
Eevee: Render: Allow cancel during probe update.

2 years agoEevee: Render: Fix softlock if rendering before lazy shader compil ends.
Clément Foucault [Tue, 13 Mar 2018 02:58:00 +0000 (03:58 +0100)]
Eevee: Render: Fix softlock if rendering before lazy shader compil ends.

Calling the rendering operator seems to kill any other WM_job running, leaving
uncompiled materials into a GPU_MAT_QUEUED state. This then made the probe update
looping indefinitely (all_materials_updated remaining to false).

To fix this, we resume compilation for materials that are in this state.
Cancelling Render before all material compilation could make certain material
remain uncompiled. Fortunately, this is not allowed as of now.

2 years agoGPUMaterial: Fix non finished material status if shader has no output.
Clément Foucault [Tue, 13 Mar 2018 02:49:04 +0000 (03:49 +0100)]
GPUMaterial: Fix non finished material status if shader has no output.

This wasn't producing any issue for now but it's better to make things clean.

2 years agoEevee: Fix temporal sampling not resetting.
Clément Foucault [Tue, 13 Mar 2018 00:35:16 +0000 (01:35 +0100)]
Eevee: Fix temporal sampling not resetting.

World Probe update was not resetting the TAA.

This also reset the volume sampling in cases that needs it (world/grid probe diffuse coefs update).

2 years agoEevee: Fix bad Outlines after probe updates.
Clément Foucault [Tue, 13 Mar 2018 00:24:51 +0000 (01:24 +0100)]
Eevee: Fix bad Outlines after probe updates.

This was because the default matrices were not setup back after resetting the current TAA sample.

2 years agoFix T54299: crash rendering objects with motion blur disabled, after recent changes.
Brecht Van Lommel [Mon, 12 Mar 2018 16:33:46 +0000 (17:33 +0100)]
Fix T54299: crash rendering objects with motion blur disabled, after recent changes.

2 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Mon, 12 Mar 2018 16:31:46 +0000 (17:31 +0100)]
Merge branch 'master' into blender2.8

2 years agoCycles: reorganize tests in more evenly distributed groups.
Brecht Van Lommel [Sun, 11 Mar 2018 21:43:15 +0000 (22:43 +0100)]
Cycles: reorganize tests in more evenly distributed groups.

2 years agoCycles: add constant folding to displacement nodes.
Brecht Van Lommel [Sun, 11 Mar 2018 21:42:38 +0000 (22:42 +0100)]
Cycles: add constant folding to displacement nodes.

2 years agoFix type in comment
Sergey Sharybin [Mon, 12 Mar 2018 16:03:54 +0000 (17:03 +0100)]
Fix type in comment

2 years agoDepsgraph: Make timing profile a command line option
Sergey Sharybin [Mon, 12 Mar 2018 16:01:02 +0000 (17:01 +0100)]
Depsgraph: Make timing profile a command line option

This way we can add even more statistics, even one which will be print
to the console.

Would be nice if we also have verbosity level control.

2 years agoFix T54296: Cycles viewport render stuck on constant re-render
Sergey Sharybin [Mon, 12 Mar 2018 09:49:07 +0000 (10:49 +0100)]
Fix T54296: Cycles viewport render stuck on constant re-render

Need Clear ID recalc flag on load. Otherwise it's possible to have
some IDs considered always updated by Cycles, when they were saved
in a tagged-for-update state.

Thanks Bastien for feedback and review!

2 years agoMerge branch 'master' into 28
Campbell Barton [Mon, 12 Mar 2018 05:38:41 +0000 (16:38 +1100)]
Merge branch 'master' into 28

2 years agoCleanup: remove misleading array size
Campbell Barton [Mon, 12 Mar 2018 05:37:26 +0000 (16:37 +1100)]
Cleanup: remove misleading array size

2 years agoCleanup: typo
Campbell Barton [Mon, 12 Mar 2018 05:35:31 +0000 (16:35 +1100)]
Cleanup: typo

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 12 Mar 2018 03:59:02 +0000 (14:59 +1100)]
Merge branch 'master' into blender2.8

2 years agoCleanup: sync EDBM_uv_* functions w/ 2.8
Campbell Barton [Mon, 12 Mar 2018 03:51:45 +0000 (14:51 +1100)]
Cleanup: sync EDBM_uv_* functions w/ 2.8

They're nearly the same, so keep names matching to avoid conflicts.

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 12 Mar 2018 03:25:20 +0000 (14:25 +1100)]
Merge branch 'master' into blender2.8

2 years agoUV: internal changes to picking
Campbell Barton [Mon, 12 Mar 2018 02:46:25 +0000 (13:46 +1100)]
UV: internal changes to picking

Nothing user visible, only things needed for multi-object support,
making picking functions more flexible too.

- Support passing in an initialized hit-struct,
  so it's possible to do multiple nearest calls on the same hit data.
- Replace manhattan distance w/ squared distance
  so they can be compared.
- Return success to detect changes to a hit-data
  which might already be initialized (also more readable).

2 years agoMerge branch 'blender2.8' of git.blender.org:blender into blender2.8
Gaia Clary [Sun, 11 Mar 2018 22:47:08 +0000 (23:47 +0100)]
Merge branch 'blender2.8' of git.blender.org:blender into blender2.8

2 years agoMerge remote-tracking branch 'origin' into blender2.8
Gaia Clary [Sun, 11 Mar 2018 22:45:53 +0000 (23:45 +0100)]
Merge remote-tracking branch 'origin' into blender2.8

2 years agoGPUImage: Add back garbage collection for the new viewport pipeline.
Clément Foucault [Sun, 11 Mar 2018 22:43:55 +0000 (23:43 +0100)]
GPUImage: Add back garbage collection for the new viewport pipeline.

2 years agoGPUMaterial: Add Material shader cache.
Clément Foucault [Sun, 11 Mar 2018 22:43:09 +0000 (23:43 +0100)]
GPUMaterial: Add Material shader cache.

This is mostly to avoid re-compilation when using undo/redo operators.
This also has the benefit to reuse the same GPUShader for multiple materials using the same nodetree configuration.

The cache stores GPUPasses that already contains the shader code and a hash to test for matches.
We use refcounts to know when a GPUPass is not used anymore.

I had to move the GPUInput list from GPUPass to GPUMaterial because it's containing references to the material nodetree and cannot be reused.

A garbage collection is hardcoded to run every 60 seconds to free every unused GPUPass.

2 years agoEevee: SSS: Fix compilation error.
Clément Foucault [Sun, 11 Mar 2018 22:27:58 +0000 (23:27 +0100)]
Eevee: SSS: Fix compilation error.

2 years agofix Collada: wrong usage of pointer and hidden redeclaration
Gaia Clary [Sun, 11 Mar 2018 19:32:47 +0000 (20:32 +0100)]
fix Collada: wrong usage of pointer and hidden redeclaration

* Suspicious usage of pointer:

  short *type = 0; // this creates a null pointer

When this is later used for anything then blender would crash.
After following the code and check what happens i strongly believe
the author wanted to use a short and not a pointer to a short here.

* local variable where reused later in same function
While this did no harm, i still felt it was better to use a different
name here to make things more separated:

- moved variable declaraiotns into loop (for int a=0; ...)
- renamed uv_images to uv_image_set
- renamed index variable from i to j in inner loop that
  reused same index name from outer loop

2 years agoCleanup Collada: Removed duplicate variable setting
Gaia Clary [Sun, 11 Mar 2018 19:15:44 +0000 (20:15 +0100)]
Cleanup Collada: Removed duplicate variable setting

2 years agoCleanup: avoid redeclaration of iterator in same function
Gaia Clary [Sun, 11 Mar 2018 19:12:55 +0000 (20:12 +0100)]
Cleanup: avoid redeclaration of iterator in same function

The iterator was redeclared 3 times. I fixed this to avoid future issues.
I commit separately because so the changes are less cluttered all over
the place.

2 years agoCleanup Collada: Avoid unintentional reuse of previous defined variable
Gaia Clary [Sun, 11 Mar 2018 19:09:26 +0000 (20:09 +0100)]
Cleanup Collada: Avoid unintentional reuse of previous defined variable

The variable child was redeclared multiple times in the same function.
While this has not created any issues i still changed this to avoid
confusion and keep the usage of the variables more local.

2 years agoFix Collada: Avoid unnecessary and even wrong check on unavailable data
Gaia Clary [Sun, 11 Mar 2018 19:00:46 +0000 (20:00 +0100)]
Fix Collada: Avoid unnecessary and even wrong check on unavailable data

The function validateConstraints() potentially causes a null pointer
exception. I changed this so that the function returns a failure as soon
as the validation fails. This avoids falling into the null pointer trap.

2 years agoCleanup Collada: Make sure index variables are not reused
Gaia Clary [Sun, 11 Mar 2018 18:57:40 +0000 (19:57 +0100)]
Cleanup Collada: Make sure index variables are not reused

The variables i and j have been declared before in the same function.
I changed the names to mi and mj to keep things clear.

2 years agoCleanup Collada: make sure float array is initialised
Gaia Clary [Sun, 11 Mar 2018 18:51:16 +0000 (19:51 +0100)]
Cleanup Collada: make sure float array is initialised

This is just to silence a compiler warning and keeping
the code clean. The actual code never uses uninitialised
array elements.

2 years agoRefactor Collada: combined 2 almost identical functions into one
Gaia Clary [Sun, 11 Mar 2018 11:44:02 +0000 (12:44 +0100)]
Refactor Collada: combined 2 almost identical functions into one

The 2 methods add_bezt() and create_bezt() do almost the same.
I combined them both into add_bezt() and added the optional parameter
eBezTriple_Interpolation ipo

2 years agoFix T54274, and rename option --window-borderless to --window-fullscreen
Arto Kitula [Sun, 11 Mar 2018 10:26:43 +0000 (12:26 +0200)]
Fix T54274, and rename option --window-borderless to --window-fullscreen

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Sun, 11 Mar 2018 05:08:12 +0000 (16:08 +1100)]
Merge branch 'master' into blender2.8

2 years agoCleanup: long lines
Campbell Barton [Sun, 11 Mar 2018 04:50:07 +0000 (15:50 +1100)]
Cleanup: long lines

2 years agoMerge branch 'master' into blender2.8
Brecht Van Lommel [Sat, 10 Mar 2018 18:01:01 +0000 (19:01 +0100)]
Merge branch 'master' into blender2.8

2 years agoCycles: add roughness baking support, using squared roughness convention.
Brecht Van Lommel [Sat, 10 Mar 2018 17:18:05 +0000 (18:18 +0100)]
Cycles: add roughness baking support, using squared roughness convention.

2 years agoCycles: switch to squared roughness convention for all nodes.
Brecht Van Lommel [Sat, 10 Mar 2018 15:09:22 +0000 (16:09 +0100)]
Cycles: switch to squared roughness convention for all nodes.

This was already done for the Principled BSDF to be compatible with typical
baked roughness maps in PBR workflows.

2 years agoMerge branch 'master' into blender2.8
Brecht Van Lommel [Sat, 10 Mar 2018 05:55:39 +0000 (06:55 +0100)]
Merge branch 'master' into blender2.8

2 years agoCode cleanup: fix compiler warning.
Brecht Van Lommel [Sat, 10 Mar 2018 05:51:52 +0000 (06:51 +0100)]
Code cleanup: fix compiler warning.

2 years agoFix T54279: viewport update bug with volume meshes.
Brecht Van Lommel [Sat, 10 Mar 2018 05:10:14 +0000 (06:10 +0100)]
Fix T54279: viewport update bug with volume meshes.

Meshes without vertex normals were not handled correctly.

2 years agoCode refactor: reduce number of loops over meshes.
Brecht Van Lommel [Sat, 10 Mar 2018 04:45:49 +0000 (05:45 +0100)]
Code refactor: reduce number of loops over meshes.

2 years agoFix T54278: volume artifacts with small density and color after recent changes.
Brecht Van Lommel [Sat, 10 Mar 2018 04:03:03 +0000 (05:03 +0100)]
Fix T54278: volume artifacts with small density and color after recent changes.

2 years agoFix T54269: saved EXR file files unreadable some editors in Blender.
Brecht Van Lommel [Sat, 10 Mar 2018 03:33:14 +0000 (04:33 +0100)]
Fix T54269: saved EXR file files unreadable some editors in Blender.

Don't write the multichannel metadata when there is only a single layer,
and don't unnecessarily consider single layer images with Blender metadata
as multi layer.

2 years agoCode cleanup: use spaces for aligned indentation.
Brecht Van Lommel [Sat, 10 Mar 2018 02:57:18 +0000 (03:57 +0100)]
Code cleanup: use spaces for aligned indentation.

2 years agoCycles: support arbitrary number of motion blur steps for objects.
Brecht Van Lommel [Thu, 8 Mar 2018 03:04:52 +0000 (04:04 +0100)]
Cycles: support arbitrary number of motion blur steps for objects.

2 years agoCycles: support arbitrary number of motion blur steps for cameras.
Brecht Van Lommel [Sat, 10 Mar 2018 00:36:09 +0000 (01:36 +0100)]
Cycles: support arbitrary number of motion blur steps for cameras.

2 years agoCode refactor: motion blur cleanups, preparing for next commit.
Brecht Van Lommel [Fri, 9 Mar 2018 23:37:07 +0000 (00:37 +0100)]
Code refactor: motion blur cleanups, preparing for next commit.

2 years agoCode refactor: don't expose UpdateObjectTransformState in header.
Brecht Van Lommel [Sat, 10 Mar 2018 00:15:02 +0000 (01:15 +0100)]
Code refactor: don't expose UpdateObjectTransformState in header.

2 years agoCode refactor: make Transform always affine, dropping last row.
Brecht Van Lommel [Thu, 8 Mar 2018 05:48:14 +0000 (06:48 +0100)]
Code refactor: make Transform always affine, dropping last row.

This save a little memory and copying in the kernel by storing only a 4x3
matrix instead of a 4x4 matrix. We already did this in a few places, and
those don't need to be special exceptions anymore now.

2 years agoCode refactor: add DecomposedTransform.
Brecht Van Lommel [Thu, 8 Mar 2018 05:19:17 +0000 (06:19 +0100)]
Code refactor: add DecomposedTransform.

This is in preparation of making Transform affine only, and also gives us
a little extra type safety so we don't accidentally treat it as a regular
4x4 matrix.