blender.git
3 years agoFix T50230: Rigid Body simulation shouldn't step when time is beyond cached area
Luca Rood [Fri, 30 Jun 2017 13:56:44 +0000 (15:56 +0200)]
Fix T50230: Rigid Body simulation shouldn't step when time is beyond cached area

This makes the last time (`ltime`) stored in the rigid body world (`rbw`)
only be updated once a simulation step actually occurs, this prevents
another simulation step from being solved unless the current time is
exactly one frame after the last cached frame. Thus this prevents the
formation of gaps in the cache, such as seen in T50230.

Reviewers: mont29, sergey, angavrilov

Tags: #physics

Maniphest Tasks: T50230

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

3 years agoBetter fix for isfinite problem - works in older gcc's too.
Howard Trickey [Fri, 30 Jun 2017 13:04:01 +0000 (09:04 -0400)]
Better fix for isfinite problem - works in older gcc's too.

Previous fix relying on __cplusplus value didn't fix for older
gcc's on linux, but this fix does.

3 years agoFix compile error after recent 9c2bbfb6 commit.
Howard Trickey [Fri, 30 Jun 2017 11:47:37 +0000 (07:47 -0400)]
Fix compile error after recent 9c2bbfb6 commit.

Older C++ compilers use finite instead of isfinite.

3 years agoCycles: Use float constants instead of double
Mai Lavelle [Fri, 30 Jun 2017 02:52:31 +0000 (22:52 -0400)]
Cycles: Use float constants instead of double

3 years agoCycles: Disable baking in mega kernel when not in use to improve build times
Mai Lavelle [Fri, 30 Jun 2017 02:50:00 +0000 (22:50 -0400)]
Cycles: Disable baking in mega kernel when not in use to improve build times

3 years agoFix T50887: Holes in fluid mesh on Windows
Campbell Barton [Fri, 30 Jun 2017 01:30:15 +0000 (11:30 +1000)]
Fix T50887: Holes in fluid mesh on Windows

D2556 by @chrisr

3 years agoFix unpredictable trackball rotation
Campbell Barton [Fri, 30 Jun 2017 00:33:42 +0000 (10:33 +1000)]
Fix unpredictable trackball rotation

D2729 by @IgorNull

Currently, trackball rotation sequentially applies rotation across x axis and y axis,
which produces a strange/unusable result on diagonal pointer motion.

This change fixes the problem by using a single axis which is orthogonal
and proportional to mouse delta - matching view-port trackball.

3 years agoWorkaround T51934: Array's > SHRT_MAX aren't supported
Campbell Barton [Fri, 30 Jun 2017 00:04:32 +0000 (10:04 +1000)]
Workaround T51934: Array's > SHRT_MAX aren't supported

3 years agoFix T51890: Turning off viewport display for array modifier is blocking dupliface...
Bastien Montagne [Thu, 29 Jun 2017 13:44:00 +0000 (15:44 +0200)]
Fix T51890: Turning off viewport display for array modifier is blocking dupliface in final render

DupliVert/Face were not using render DM at render time.

3 years agoFix T51926: Selecting pose icon under expanded group in outliner causes crash.
Bastien Montagne [Thu, 29 Jun 2017 08:09:17 +0000 (10:09 +0200)]
Fix T51926: Selecting pose icon under expanded group in outliner causes crash.

Cannot switch uninstantiated armature to Pose mode...

3 years agoFix T51909: Cycles: Uninitialized closure normals for the Hair BSDF
Lukas Stockner [Wed, 28 Jun 2017 19:25:30 +0000 (21:25 +0200)]
Fix T51909: Cycles: Uninitialized closure normals for the Hair BSDF

As the title says, the normal wasn't set for the Hair BSDF because it wasn't
needed before. However, the denoiser uses it to store the feature passes, so
it needs to be set now.

3 years agoFix node UI not using translation context correctly.
Bastien Montagne [Wed, 28 Jun 2017 18:50:21 +0000 (20:50 +0200)]
Fix node UI not using translation context correctly.

Now that some node types may have custom context, we need to handle that
in the (convoluted :| ) UI code of nodes as well.

Reported in T43295 by Gabriel Gazzán (@gab3d), thanks.

3 years agoFix own really stupid mistake/typo in previous commit...
Bastien Montagne [Wed, 28 Jun 2017 11:21:04 +0000 (13:21 +0200)]
Fix own really stupid mistake/typo in previous commit...

3 years agoFix T51900: Crash after pressing "F" multiple times.
Bastien Montagne [Wed, 28 Jun 2017 08:53:52 +0000 (10:53 +0200)]
Fix T51900: Crash after pressing "F" multiple times.

`BMO_iter_as_array()` may fill less items than requested in given array,
so we have to update number of items to work on from its returned value,
otherwise code might try to use uninitialized memory.

3 years agoFix T51913: Context tab for textures issue
Dalai Felinto [Tue, 27 Jun 2017 14:53:43 +0000 (16:53 +0200)]
Fix T51913: Context tab for textures issue

The original code was doing a sanity check to see if existing index was
out of range. However the comparison was wrong.

So if the previous ct->user (active index of texture node) was larger
than then number of available texture nodes + 1 in the other material,
we would never re-set the index to 0.

Bug introduced on c31f74de6bb7.

There was an early attempt of fixing this (2b2ac5d3cc) but it was just working
by pure, luck. And failing in cases like the one from this bug report.

3 years agoCleanup: remove unused function
Campbell Barton [Tue, 27 Jun 2017 08:05:44 +0000 (18:05 +1000)]
Cleanup: remove unused function

3 years agoCMake: Only set CMAKE_BUILD_TYPE_INIT when not set
Campbell Barton [Mon, 26 Jun 2017 23:50:35 +0000 (09:50 +1000)]
CMake: Only set CMAKE_BUILD_TYPE_INIT when not set

Convenience makefile now uses CMAKE_BUILD_TYPE_INIT,
this means you can change the build type of an existing build
and it won't be overwritten when running `make`.

Useful if you want to add debug info to a release build for profiling.

3 years agoAdd warning that 'purge all' action in Outliner does save to current .blend file.
Bastien Montagne [Mon, 26 Jun 2017 17:00:45 +0000 (19:00 +0200)]
Add warning that 'purge all' action in Outliner does save to current .blend file.

This is a very important, potentially deadly side-effect of this
operator. If something goes wrong, it can save a broken .blend file.

Ideally we could get rid of that operation anyway, once ID management if
fully renewed, but for now would rather keep it around.

Related to T51902.

3 years agoFix T51902: Severe problem with relocating linked libraries when using proxies.
Bastien Montagne [Mon, 26 Jun 2017 16:55:30 +0000 (18:55 +0200)]
Fix T51902: Severe problem with relocating linked libraries when using proxies.

Fix is a bit ugly, but cannot think of another solution for now, at
least this **should** not break anything else.

And now I go find myself a very remote, high and lonely mountain, climb
to its top, roar "I hate proxies!" a few times, and relax hearing the echos...

3 years agoEnable optional jack in install_deps.sh
Bastien Montagne [Mon, 26 Jun 2017 14:12:32 +0000 (16:12 +0200)]
Enable optional jack in install_deps.sh

Based on D2578, now you can install JACK audio server and use it in
Blender build without having to specify the `--with-all` option (that
one still enables also JACK of course).

Reviewers: mont29

Maniphest Tasks: T51033

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

3 years agoBuilding w/o Python works again
Campbell Barton [Mon, 26 Jun 2017 03:25:51 +0000 (13:25 +1000)]
Building w/o Python works again

3 years agoFix freestyle lineset panels being animatable
Aaron Carlisle [Mon, 26 Jun 2017 00:03:19 +0000 (20:03 -0400)]
Fix freestyle lineset panels being animatable

3 years agoUI: Fix Capitalization Inconsistency
Aaron Carlisle [Sun, 25 Jun 2017 23:55:05 +0000 (19:55 -0400)]
UI: Fix Capitalization Inconsistency

3 years agoDocs: correct doc-strings
Campbell Barton [Sun, 25 Jun 2017 21:36:29 +0000 (07:36 +1000)]
Docs: correct doc-strings

3 years agoCollada: Exporter now only exports either 'Materials' or 'UV Textures as Materials...
Gaia Clary [Sun, 25 Jun 2017 20:06:04 +0000 (22:06 +0200)]
Collada: Exporter now only exports either 'Materials' or 'UV Textures as Materials'. This makes the user interface more streight

3 years agofix: overlooked the RET_ZERO appendix
Gaia Clary [Sun, 25 Jun 2017 15:04:47 +0000 (17:04 +0200)]
fix: overlooked the RET_ZERO appendix

3 years agofix: T51622 The exporter now exports meshes as <Triangles> when all contained polygon...
Gaia Clary [Sun, 25 Jun 2017 12:51:51 +0000 (14:51 +0200)]
fix: T51622 The exporter now exports meshes as <Triangles> when all contained polygons are tris

3 years agofix: Collada fprintf needs std::string be converted to char *
Gaia Clary [Sun, 25 Jun 2017 11:18:21 +0000 (13:18 +0200)]
fix: Collada fprintf needs std::string be converted to char *

3 years agofix: collada: removed unnecessary extra qualification
Gaia Clary [Sun, 25 Jun 2017 11:10:03 +0000 (13:10 +0200)]
fix: collada: removed unnecessary extra qualification

3 years agofix: adjusted collada declaration after changes in collada module.
Gaia Clary [Sun, 25 Jun 2017 08:50:03 +0000 (10:50 +0200)]
fix: adjusted collada declaration after changes in collada module.
@campbell Barton: Why is this declaration needed at all in stubs.c?
Further up the file collada.h is imported and that already decalres
the function and results in a duplicate declaration.

3 years agoCollada: Fix: Geometry exporter did not create all polylist when meshes are only...
Gaia Clary [Sat, 24 Jun 2017 21:33:34 +0000 (23:33 +0200)]
Collada: Fix: Geometry exporter did not create all polylist when meshes are only partially textured

3 years agocollada: export UV Textures as materials. Note: the reimport of the exported collada...
Gaia Clary [Sat, 24 Jun 2017 20:16:32 +0000 (22:16 +0200)]
collada: export UV Textures as materials. Note: the reimport of the exported collada files will have materials assigned instead of UV Face Textures! This is expected behavior

3 years agocollada: change image export: export either UV Textures or Materials. This
Gaia Clary [Sat, 24 Jun 2017 20:09:08 +0000 (22:09 +0200)]
collada: change image export: export either UV Textures or Materials. This
avoids wrong texture data when multiple objects are exported. Note: This
commit might possiblyt not work fully. The full feature is added with the
next commit)

3 years agoCollada: improved Error handling: Avoid shutdown of Blender when the Collada importer...
Gaia Clary [Sat, 24 Jun 2017 19:50:04 +0000 (21:50 +0200)]
Collada: improved Error handling: Avoid shutdown of Blender when the Collada importer finds Syntax errors in import data

3 years agoCollada: added new functions for improved material exporter (not used yet)
Gaia Clary [Sat, 24 Jun 2017 19:36:03 +0000 (21:36 +0200)]
Collada: added new functions for improved material exporter (not used yet)

3 years agoFix T50856: crash when minimizing window on AMD / Windows.
Brecht Van Lommel [Sat, 24 Jun 2017 14:44:48 +0000 (16:44 +0200)]
Fix T50856: crash when minimizing window on AMD / Windows.

3 years agoFix T51792: crash calling bpy.ops.screen.animation_cancel while scrubbing.
Brecht Van Lommel [Sat, 24 Jun 2017 16:02:30 +0000 (18:02 +0200)]
Fix T51792: crash calling bpy.ops.screen.animation_cancel while scrubbing.

3 years agoGrease Pencil: Fix hardcoded DKEY for continous drawing
Dalai Felinto [Fri, 23 Jun 2017 08:32:03 +0000 (10:32 +0200)]
Grease Pencil: Fix hardcoded DKEY for continous drawing

3 years agoFix T51845
raa [Fri, 23 Jun 2017 08:04:58 +0000 (11:04 +0300)]
Fix T51845

3 years agoFix T51867: Insert Keyframe I - L / I - R / I - S key combos are broken.
Bastien Montagne [Thu, 22 Jun 2017 08:26:27 +0000 (10:26 +0200)]
Fix T51867: Insert Keyframe I - L / I - R / I - S key combos are broken.

Reorder keyingsets registration order, since it also afects order of I
menu options, better show most used ones first, pure alphabetical order
is not great here... Will likely break some muscle memory though. :|

Based on D2720 by Carlo Andreacchio (@candreacchio), thanks.

3 years agoFix T51863: CompositorNodeSwitchView have the wrong rna API
Dalai Felinto [Thu, 22 Jun 2017 08:25:05 +0000 (10:25 +0200)]
Fix T51863: CompositorNodeSwitchView have the wrong rna API

Although the original report was about the docs, the real issue was in
the API.

My original commit started from a copy-paste from the Switch
Node. However I don't use custom1 for thew Switch View node.

The docs is slightly incomplete since it would be nice to mention the
views here. Or maybe even expose them via Python. But honestly they are
generated depending on the scene multi-view settings.

3 years agoCycles: Fix excessive sampling weight of glossy Principled BSDF components
Lukas Stockner [Wed, 21 Jun 2017 00:57:58 +0000 (02:57 +0200)]
Cycles: Fix excessive sampling weight of glossy Principled BSDF components

If there was any specularity in the Principled BSDF, it would get a sampling
weight of one regardless of its actual impact.

This commit makes Cycles estimate the contribution of the component and adjust
the weighting accordingly, which greatly improves the noise characteristics of
the Principled BSDF in many cases.

Note that this commit might slightly change the brightness of areas when using
MultiGGX and high roughnesses, but the new brightness is more accurate and
closer to the result of Branched Path Tracing. See T51836 for details.

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

3 years agoFix T51836: Cycles: Fix incorrect PDF approximations of the MultiGGX closures
Lukas Stockner [Wed, 21 Jun 2017 00:51:34 +0000 (02:51 +0200)]
Fix T51836: Cycles: Fix incorrect PDF approximations of the MultiGGX closures

The PDF of the MultiGGX sampling is approximated by the singlescattering GGX
term as well as a scaled diffuse term that makes up for the energy in the
multiscattering component that's missed by GGX.

However, there were two problems with the glossy terms: The diffuse term missed
a normalization factor, and the singlescattering term was not properly scaled
down based on the albedo estimate.

The glass term was completely wrong and has been rewritten. It uses the fresnel
factor to weight reflection vs. refraction and uses the glossy MultiGGX model
for reflection.
For refraction, the correct singlescattering term is now used, and a new
albedo approximation is used that was derived by evaluating GGX albedo for
roughnesses from 0 to 1 and IORs from 1 to 3 and fitting numerical
approximations to it. The resulting model has a mean relative error of 9e-5,
but could probably be simplified without losing noticable accuracy in the
final render.

The improved PDFs help with glossy highlights (due to better light sampling vs.
closure sampling MIS) and fix the situation described in T51836 where mixing
MultiGGX with other closures (as it happens in e.g. the Principled
BSDF) causes incorrect darkening.

3 years agoFix T51862: principled shader GLSL artifacts in ortho mode.
Brecht Van Lommel [Wed, 21 Jun 2017 19:31:08 +0000 (21:31 +0200)]
Fix T51862: principled shader GLSL artifacts in ortho mode.

3 years agoFix T51849: change Cycles clearcoat gloss to roughness.
Brecht Van Lommel [Wed, 21 Jun 2017 17:24:57 +0000 (19:24 +0200)]
Fix T51849: change Cycles clearcoat gloss to roughness.

This is compatible with UE4 and more consistent with specular and transmission
roughness, even if it deviates from the original Disney BRDF.

3 years agoFix typo in builtbot config
Dalai Felinto [Wed, 21 Jun 2017 12:05:23 +0000 (14:05 +0200)]
Fix typo in builtbot config

3 years agoFix T51856: `BKE_mesh_new_from_object()` would often generate default 'Mesh' named...
Bastien Montagne [Wed, 21 Jun 2017 08:30:38 +0000 (10:30 +0200)]
Fix T51856: `BKE_mesh_new_from_object()` would often generate default 'Mesh' named datablock.

This is annoying especially for exporters who do use mesh name, since it
broke any relation with actual Mesh naming in original Blend file.

Unfortunately, we cannot avoid the extra .xxx digits. ;)

3 years agoFix: Icon alignment for scaled pie buttons with no text
raa [Tue, 20 Jun 2017 17:15:04 +0000 (20:15 +0300)]
Fix: Icon alignment for scaled pie buttons with no text

3 years agoFix (unreported) missing Image usercount increase when copying UVProject modifier.
Bastien Montagne [Mon, 19 Jun 2017 13:05:08 +0000 (15:05 +0200)]
Fix (unreported) missing Image usercount increase when copying UVProject modifier.

3 years agoAlembic tests: make failures a bit easier to diagnose.
Sybren A. Stüvel [Mon, 19 Jun 2017 15:55:51 +0000 (17:55 +0200)]
Alembic tests: make failures a bit easier to diagnose.

3 years agoFix T51762: Unit test script_alembic_import is failing.
Sybren A. Stüvel [Mon, 19 Jun 2017 15:50:43 +0000 (17:50 +0200)]
Fix T51762: Unit test script_alembic_import is failing.

Implemented workaround for use with the legacy depsgraph.

3 years agoFixed bl_load_py_modules / script_load_modules unit test
Sybren A. Stüvel [Mon, 19 Jun 2017 13:28:28 +0000 (15:28 +0200)]
Fixed bl_load_py_modules / script_load_modules unit test

It tried to assert that
addons/io_blend_utils/blender_bam-unpacked.whl/__init__.py was loaded when
the io_blend_utils module was imported. However, this happens only on
demand, and not directly when importing the add-on.

3 years agoUse for/else instead of setting 'ok' variable.
Sybren A. Stüvel [Mon, 19 Jun 2017 13:25:58 +0000 (15:25 +0200)]
Use for/else instead of setting 'ok' variable.

This is more efficient, and this use case is exactly what the else clause
is for.

3 years agoRemoved trailing spaces
Sybren A. Stüvel [Mon, 19 Jun 2017 08:46:07 +0000 (10:46 +0200)]
Removed trailing spaces

3 years agoFix (unreported) bad copying code of Surface Deform modifier.
Bastien Montagne [Mon, 19 Jun 2017 12:57:40 +0000 (14:57 +0200)]
Fix (unreported) bad copying code of Surface Deform modifier.

3 years agoFix compiler warnings from own recent rB0d5c7e5e36b9.
Bastien Montagne [Mon, 19 Jun 2017 12:43:44 +0000 (14:43 +0200)]
Fix compiler warnings from own recent rB0d5c7e5e36b9.

3 years agoFix (unreported) bad copying of Ocean modifier.
Bastien Montagne [Mon, 19 Jun 2017 12:40:08 +0000 (14:40 +0200)]
Fix (unreported) bad copying of Ocean modifier.

Was needlessly complicated code, forgot to copy a value (foam_fade), and
was utterly leaking memory!

3 years agoFix (unreported) bad copying code in Mesh Deform modifier.
Bastien Montagne [Mon, 19 Jun 2017 10:55:11 +0000 (12:55 +0200)]
Fix (unreported) bad copying code in Mesh Deform modifier.

3 years agoFix (unreported) Dynamic Paint modifier not increasing ID usercount in copy function.
Bastien Montagne [Mon, 19 Jun 2017 10:25:41 +0000 (12:25 +0200)]
Fix (unreported) Dynamic Paint modifier not increasing ID usercount in copy function.

*Sigh* One more example of why we should keep ID management handling in
as few places as possible! It's impossible to keep more than a few
places in sync regarding which ID pointer is refcounted etc.

3 years agoFix (unreported) memory leak in Fluid modifier copying.
Bastien Montagne [Mon, 19 Jun 2017 10:21:14 +0000 (12:21 +0200)]
Fix (unreported) memory leak in Fluid modifier copying.

Also generally simplify/sanitize this copy code.

3 years agoCleanup: doxygen comments
Campbell Barton [Sun, 18 Jun 2017 23:33:23 +0000 (09:33 +1000)]
Cleanup: doxygen comments

Also remove duplicate & mismatching comments from grease-pencil header.
Keep comments close to implementation to avoid getting out of sync.

3 years agoFix T51774: Children particles hair interpolation not correct with textures or dp.
Bastien Montagne [Sun, 18 Jun 2017 21:54:52 +0000 (23:54 +0200)]
Fix T51774: Children particles hair interpolation not correct with textures or dp.

Children where always getting at least one segment of fixed length...

Now fully hidden ones (zero length) get no segment at all.

Note that even very short ones keep getting one 'unit' length segment - would
rather avoid changing that at this point, given how complex children
particles 'length' can get with all kind of modifiers... Think we can
live with that for now anyway.

3 years agoFix T51840: UI redraw in node editor header missing on pointcache bake
Thomas Beck [Sun, 18 Jun 2017 14:26:09 +0000 (16:26 +0200)]
Fix T51840: UI redraw in node editor header missing on pointcache bake

Missing a notifier handler in the node editor

3 years agoFix unreported: Copy-pasting nodes crashes when they have an undefined type
Lukas Stockner [Sun, 18 Jun 2017 03:13:32 +0000 (05:13 +0200)]
Fix unreported: Copy-pasting nodes crashes when they have an undefined type

3 years agoDocs: Fix file:line links in generated API docs
Campbell Barton [Sat, 17 Jun 2017 16:33:13 +0000 (02:33 +1000)]
Docs: Fix file:line links in generated API docs

3 years agoAdd Cone: tip soft-min should be zero
Campbell Barton [Sat, 17 Jun 2017 16:07:22 +0000 (02:07 +1000)]
Add Cone: tip soft-min should be zero

Default value should be included in range.

3 years agoGuarded allocator: Fix type in macro definition
Sergey Sharybin [Sat, 17 Jun 2017 14:13:30 +0000 (16:13 +0200)]
Guarded allocator: Fix type in macro definition

The crash did not happen yet because we always had proper vmemh defined in
the parent scope.

Patch by Ivan Ivanov (aka obiwanus), thanks!

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

3 years agoPyAPI: Fix warning about indent
Aaron Carlisle [Fri, 16 Jun 2017 16:30:18 +0000 (12:30 -0400)]
PyAPI: Fix warning about indent

3 years agoFix T51810: Add minimal example of usage of translation API for non-official addons.
Bastien Montagne [Fri, 16 Jun 2017 14:43:46 +0000 (16:43 +0200)]
Fix T51810: Add minimal example of usage of translation API for non-official addons.

3 years agoUsual i18n/UI messages fixes.
Bastien Montagne [Fri, 16 Jun 2017 10:50:24 +0000 (12:50 +0200)]
Usual i18n/UI messages fixes.

Please do not add useless tooltips! We have enough messages to translate
already...

3 years agoCycles: Fix race condition happening in progress utility
Sergey Sharybin [Fri, 16 Jun 2017 08:22:35 +0000 (10:22 +0200)]
Cycles: Fix race condition happening in progress utility

This is not enough to mutex-guard modification code of integer values,
since this operation is NOT atomic. This is not even safe for a single
byte data types.

For now guarded the getter functions, similar to other functions in
this module.

Ideally we want to switch modification to an atomic operations, so we
wouldn't need any locks in the getters.

3 years agoPyAPI: Fix changed ref link
Aaron Carlisle [Fri, 16 Jun 2017 02:03:22 +0000 (22:03 -0400)]
PyAPI: Fix changed ref link

3 years agoPyAPI: Add HTML logo and favicon
Aaron Carlisle [Fri, 16 Jun 2017 01:24:50 +0000 (21:24 -0400)]
PyAPI: Add HTML logo and favicon

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

3 years agoPyAPI: Remove addon tutorial
Aaron Carlisle [Thu, 15 Jun 2017 17:00:58 +0000 (13:00 -0400)]
PyAPI: Remove addon tutorial

This page now lives at https://docs.blender.org/manual/en/dev/advanced/scripting/addon_tutorial.html

3 years agoCMake: print absolute CMakeCache.txt
Campbell Barton [Thu, 15 Jun 2017 21:38:20 +0000 (07:38 +1000)]
CMake: print absolute CMakeCache.txt

Message didn't show the path of the file to remove
which could be confusing.

3 years agoMath Lib: add angle_on_axis_v3v3_v3
Campbell Barton [Thu, 15 Jun 2017 15:25:08 +0000 (01:25 +1000)]
Math Lib: add angle_on_axis_v3v3_v3

Use for calculating the angle between 2 directions on an axis.

Also signed version and normalized plane projection,
use when input is normalized.

3 years agoCleanup: do not use `BKE_libblock_free_ex()` unless needed!
Bastien Montagne [Thu, 15 Jun 2017 14:20:51 +0000 (16:20 +0200)]
Cleanup: do not use `BKE_libblock_free_ex()` unless needed!

3 years agoFix/workaround 'convert object' messing up linked data.
Bastien Montagne [Thu, 15 Jun 2017 13:40:24 +0000 (15:40 +0200)]
Fix/workaround 'convert object' messing up linked data.

'Convert To...' Object operation has very weird effect of actually
working at obdata level, not object level, which means *all* objects
(even unselected/hidden/in other scenes/...) using same obdata will be
converted to new selected type.

IMHO this is very bad behavior, but... not a bug really, so do not
change this for now.

But at least, do not do that when working on some linked data, else it
leaves Blend file in invalid (incoherent) state until next reload.

So workaround for now is to enforce the 'Keep Original' option when some
linked object/obdata is affected by the operation.

Also fixed somewhat broken usercount handling in Curve->Mesh part.

3 years agoCleanup: make Group Unlink outliner action use `BKE_libblock_delete() too.
Bastien Montagne [Thu, 15 Jun 2017 11:05:29 +0000 (13:05 +0200)]
Cleanup: make Group Unlink outliner action use `BKE_libblock_delete() too.

Same as in rB2bd51474a44...

3 years agoCleanup: remove useless call to `BKE_screen_free()` in screen deletion.
Bastien Montagne [Thu, 15 Jun 2017 11:00:11 +0000 (13:00 +0200)]
Cleanup: remove useless call to `BKE_screen_free()` in screen deletion.

`BKE_libblock_free()` will call it itself.

3 years agoFix dangerous code when deleting Scene.
Bastien Montagne [Thu, 15 Jun 2017 10:57:08 +0000 (12:57 +0200)]
Fix dangerous code when deleting Scene.

That one was probably not an actual issue, except maybe in some corner
cases (like deleting a linked scene also used by some other linked scene).

Again, better not try to do smart & complex freeing logic outside of
BKE_library area, let's keep spaghetti nitghmare in a single place!

3 years agoCleanup: make Group Unlink operator use BKE_libblock_delete(), since that's what...
Bastien Montagne [Thu, 15 Jun 2017 10:49:40 +0000 (12:49 +0200)]
Cleanup: make Group Unlink operator use BKE_libblock_delete(), since that's what it is doing.

Previous code (same as what `BKE_libblock_free_us()` is doing when
usercount reach 0) was probably OK in that specific case, but still not
good idea, and potentially risky.

3 years agoFix collada importer doing own handling of usercount/freeing.
Bastien Montagne [Thu, 15 Jun 2017 10:44:15 +0000 (12:44 +0200)]
Fix collada importer doing own handling of usercount/freeing.

Better use generic `BKE_libblock_free_us()`.

3 years agoFix potentially dnagerous code in doversionning of brush.
Bastien Montagne [Thu, 15 Jun 2017 10:38:55 +0000 (12:38 +0200)]
Fix potentially dnagerous code in doversionning of brush.

Even though in that specific it was probably safe-ish, there is no
guarantee at this point Brush we want to remove are not used somewhere,
better take the slightly slower, much safer `BKE_libblock_delete()` path here.

3 years agoFix serious bug in 'curve-to-mesh' conversion code.
Bastien Montagne [Thu, 15 Jun 2017 10:34:12 +0000 (12:34 +0200)]
Fix serious bug in 'curve-to-mesh' conversion code.

Eeeeeek!^2 Calling unconditionnaly ID freeing `BKE_libblock_free()` on a
datablock (ob->data, i.e. Curve) that may be used elsewhere...
Veryveryvery bad!

3 years agoFix potential memory leak in Sequencer sound strip creation code.
Bastien Montagne [Thu, 15 Jun 2017 10:32:27 +0000 (12:32 +0200)]
Fix potential memory leak in Sequencer sound strip creation code.

3 years agoFix compilation error with strict cflags after recent const changes
Sergey Sharybin [Thu, 15 Jun 2017 08:14:56 +0000 (10:14 +0200)]
Fix compilation error with strict cflags after recent const changes

3 years agoFurther improvements of text editor for POV-Ray
Bastien Montagne [Thu, 15 Jun 2017 07:34:38 +0000 (09:34 +0200)]
Further improvements of text editor for POV-Ray

*tryed "#" as preprocessor used in POV-Ray for language keywords best behaviour was to have it as a punctuation symbol
*moved "finish" to its proper category
*changed order of some POV-Ray ini files keywords to have them work better
*added a few keywords from latest pov version
*Fixed C-style closing of multiline comments (*/)

Reviewers: campbellbarton, mont29

Reviewed By: campbellbarton, mont29

Subscribers: mont29

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

3 years agoPyAPI: Add toctree link on parent page of submodule
Aaron Carlisle [Thu, 15 Jun 2017 05:41:28 +0000 (01:41 -0400)]
PyAPI: Add toctree link on parent page of submodule

3 years agoPyAPI: Proper Solution to bpy.app
Aaron Carlisle [Thu, 15 Jun 2017 04:54:41 +0000 (00:54 -0400)]
PyAPI: Proper Solution to bpy.app

3 years agoPYAPI: Fix mathutils doc structure
Aaron Carlisle [Wed, 14 Jun 2017 20:46:49 +0000 (16:46 -0400)]
PYAPI: Fix mathutils doc structure

3 years agoMake whole ID copying code use const source pointer.
Bastien Montagne [Wed, 14 Jun 2017 20:36:30 +0000 (22:36 +0200)]
Make whole ID copying code use const source pointer.

Noisy change, but safe, and better do it sooner than later if we are to
rework copying code. Also, previous commit shows this *is* useful to
catch some mistakes.

3 years agoFix three obvious mistakes in brush/mask/cachefile ID copying.
Bastien Montagne [Wed, 14 Jun 2017 20:33:04 +0000 (22:33 +0200)]
Fix three obvious mistakes in brush/mask/cachefile ID copying.

They were modifying some source ID prop, instead of copied version of
it... Found while making all source of ID copying const. ;)

3 years agoPYAPI: fix documention structure of bpy.app
Aaron Carlisle [Wed, 14 Jun 2017 20:19:05 +0000 (16:19 -0400)]
PYAPI: fix documention structure of bpy.app

3 years agoFix missing toctree for bmesh submodules
Aaron Carlisle [Wed, 14 Jun 2017 19:22:26 +0000 (15:22 -0400)]
Fix missing toctree for bmesh submodules

3 years agoPYAPI: Fix freestyle submodules without tocrees
Aaron Carlisle [Wed, 14 Jun 2017 18:41:07 +0000 (14:41 -0400)]
PYAPI: Fix freestyle submodules without tocrees

Fixes 6 compile warnings
Follow up on rBf87ca5f1c314f67353b6111d3647aef159dc07c6

3 years agoDepsgraph: Cleanup, indentation
Sergey Sharybin [Wed, 14 Jun 2017 10:01:52 +0000 (12:01 +0200)]
Depsgraph: Cleanup, indentation

3 years agoRemove unused bmain argument from BKE_libblock_free_data
Sergey Sharybin [Wed, 14 Jun 2017 09:16:34 +0000 (11:16 +0200)]
Remove unused bmain argument from BKE_libblock_free_data

3 years agoCleanup: Indentation got broken in previous commit
Sergey Sharybin [Wed, 14 Jun 2017 08:54:30 +0000 (10:54 +0200)]
Cleanup: Indentation got broken in previous commit

3 years agoAdd utility function to free memory used by a datablock
Sergey Sharybin [Wed, 14 Jun 2017 08:45:20 +0000 (10:45 +0200)]
Add utility function to free memory used by a datablock

This function is similar to BKE_libblock_free but does no DEG
tagging or any extra things, just operates on memory.