blender.git
3 years agoManipulator: edit_properties -> target_properties
Campbell Barton [Wed, 21 Jun 2017 07:06:24 +0000 (17:06 +1000)]
Manipulator: edit_properties -> target_properties

Naming was too confusing between properties of a manipulator
and properties it edits.

3 years agoManipulator: Move types into their own directory
Campbell Barton [Wed, 21 Jun 2017 06:21:19 +0000 (16:21 +1000)]
Manipulator: Move types into their own directory

3 years agoManipulators: move settings to ID properties
Campbell Barton [Wed, 21 Jun 2017 03:54:46 +0000 (13:54 +1000)]
Manipulators: move settings to ID properties

This makes manipulator access closer to operators,
and allows Python access.

This adds RNA for manipulators, but not Python registration yet.

- Split draw style into 2x settings:
  `draw_style` (enum) & `draw_options` (enum-flag)
- Rename wmManipulator.properties -> properties_edit,
  Use wmManipulator.properties for ID-properties.
  Note that this area of the API will need further work since
  manipulators now have 2 kinds of properties & API's to access them.

3 years agoPyAPI: add intern strings
Campbell Barton [Wed, 21 Jun 2017 02:43:19 +0000 (12:43 +1000)]
PyAPI: add intern strings

Avoid string conversion on each use.

3 years agoRNA: avoid many calls to 'RNA_struct_is_a'
Campbell Barton [Wed, 21 Jun 2017 02:13:21 +0000 (12:13 +1000)]
RNA: avoid many calls to 'RNA_struct_is_a'

Quicker to find the ID-subtype then use direct pointer comparisons.

Also modify `ID_code_to_RNA_type` so missing ID-codes raise a warning
(handy when adding new ID types).

3 years agoIntroduce functions/options to indicate the type of render
Dalai Felinto [Tue, 20 Jun 2017 16:33:58 +0000 (18:33 +0200)]
Introduce functions/options to indicate the type of render

We should be able to differentiate between OpenGL render (viewport
render), offline render (F12), and view render (viewport draw).

This allows for us preventing offline render to skip mode drawings, grid, ...
Even OpenGL render can benefit from this forcing a higher quality
anti-alias and sampling than the viewport drawing.

I'm not sure if it's clever to keep the memset(0x00) outside the render
loop function as it is in this patch. An alternative is to just pass the
render "type" as a flag to the render function, and set DST.options
inside it. (I may change this tomorrow, I will wait to hear from
Campbell on that).

3 years agoClean node names and organize menus for eevee
Luca Rood [Tue, 20 Jun 2017 12:33:13 +0000 (14:33 +0200)]
Clean node names and organize menus for eevee

This makes the node menus aware of the Cycles/Eevee distinction, and
only show the relevant nodes for the current engine. Names have also
been changed to accomodate for the new output node system.

3 years agoImplement Eevee output node system
Luca Rood [Mon, 19 Jun 2017 14:31:10 +0000 (16:31 +0200)]
Implement Eevee output node system

This makes Eevee consistent with Cycles, by having a single output node,
and multiple shader nodes that connect to it.

Note that node systems for Eevee saved before this will be missing the
output node, and thus will show an invalid material. This is easily
resolved by connecting the shader output to a new output node.

3 years agoFix blenderplayer build (tm)
Dalai Felinto [Tue, 20 Jun 2017 13:51:42 +0000 (15:51 +0200)]
Fix blenderplayer build (tm)

3 years agoFix collada build after gawain rename/refactor
Dalai Felinto [Tue, 20 Jun 2017 13:42:06 +0000 (15:42 +0200)]
Fix collada build after gawain rename/refactor

Collada files should not have been touched.

Bug introduced on: c31f24c63b875e8c9a7cacd2733d3e8614eff74d

3 years agoManipulators: store operator type instead of id
Campbell Barton [Mon, 19 Jun 2017 18:44:34 +0000 (04:44 +1000)]
Manipulators: store operator type instead of id

Avoids lookups on each access.

3 years agoFix warning in view3d_draw.
Clément Foucault [Mon, 19 Jun 2017 14:31:20 +0000 (16:31 +0200)]
Fix warning in view3d_draw.

3 years agoFixup for gawan rename
Dalai Felinto [Mon, 19 Jun 2017 13:19:00 +0000 (15:19 +0200)]
Fixup for gawan rename

inten/opencolorio and *.cc were ignored.

Build error introduced on b4d053efc75424fca4b413ac1bc7a7e826fac629.

3 years agoDepsgraph: Fix crash with mouse select in edit mode with Copy-on-Write enabled
Sergey Sharybin [Mon, 19 Jun 2017 13:09:48 +0000 (15:09 +0200)]
Depsgraph: Fix crash with mouse select in edit mode with Copy-on-Write enabled

3 years agoDepsgraph: Synchronize selection from original scene to copied-on-write one
Sergey Sharybin [Mon, 19 Jun 2017 10:36:34 +0000 (12:36 +0200)]
Depsgraph: Synchronize selection from original scene to copied-on-write one

This makes it possible to select objects in the viewport.

Selection in edit mode is still tricky, mainly because currently such update
would require tagging batch as updated, which is not possible with using just
and original object because it will never have batch.

Possible solution here would be to introduce some "batch" or "render" component
to depsgraph ID node for objects, so we can tag batch for update via depsgraph
tagging API.

3 years agoDepsgraph: Initial groundwork for copy-on-write support
Sergey Sharybin [Wed, 14 Jun 2017 08:26:24 +0000 (10:26 +0200)]
Depsgraph: Initial groundwork for copy-on-write support

< Dependency graph Copy-on-Write >
 --------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

This is an initial commit of Copy-on-write support added to dependency graph.
Main priority for now: get playback (Alt-A) and all operators (selection,
transform etc) to work with the new concept of clear separation between
evaluated data coming from dependency graph and original data coming from
.blend file (and stored in bmain).

= How does this work? =

The idea is to support Copy-on-Write on the ID level. This means, we duplicate
the whole ID before we cann it's evaluaiton function. This is currently done
in the following way:

- At the depsgraph construction time we create "shallow" copy of the ID
  datablock, just so we know it's pointer in memory and can use for function
  bindings.

- At the evaluaiton time, the copy of ID get's "expanded" (needs a better
  name internally, so it does not conflict with expanding datablocks during
  library linking), which means the content of the datablock is being
  copied over and all IDs are getting remapped to the copied ones.

  Currently we do the whole copy, in the future we will support some tricks
  here to prevent duplicating geometry arrays (verts, edges, loops, faces
  and polys) when we don't need that.

- Evaluation functions are operating on copied datablocks and never touching
  original datablock.

- There are some cases when we need to know non-ID pointers for function
  bindings. This mainly applies to scene collections and armatures. The
  idea of dealing with this is to "expand" copy-on-write datablock at
  the dependency graph build time. This might introduce some slowdown to the
  dependency graph construction time, but allows us to have minimal changes
  in the code and avoid any hash look-up from evaluation function (one of
  the ideas to avoid using pointers as function bindings is to pass name
  of layer or a bone to the evaluation function and look up actual data based
  on that name).

  Currently there is a special function in depsgraph which does such a
  synchronization, in the future we might want to make it more generic.

At some point we need to synchronize copy-on-write version of datablock with
the original version. This happens, i.e., when we change active object or
change selection. We don't want any actual evaluation of update flush happening
for such thins, so now we have a special update tag:

  DEG_id_tag_update((id, DEG_TAG_COPY_ON_WRITE)

- For the render engines we now have special call for the dependency graph to
  give evaluated datablock for the given original one. This isn't fully ideal
  but allows to have Cycles viewport render.

  This is definitely a subject for further investigation / improvement.

This call will tag copy-on-write component tagged for update without causing
updates to be flushed to any other objects, causing chain reaction of updates.
This tag is handy when selection in the scene changes.

This basically summarizes ideas underneath this commit. The code should be
reasonably documented.

Here is a demo of dependency graph with all copy-on-write stuff in it:

  https://developer.blender.org/F635468

= What to expect to (not) work? =

- Only meshes are properly-ish aware of copy-on-write currently, Non-mesh
  geometry will probably crash or will not work at all.

- Armatures will need similar depsgraph built-time expansion of the copied
  datablock.

- There are some extra tags / relations added, to keep things demo-able but
  which are slowing things down for evaluation.

- Edit mode works for until click selection is used (due to the selection
  code using EditDerivedMesh created ad-hoc).

- Lots of tools will lack tagging synchronization of copied datablock for
  sync with original ID.

= How to move forward? =

There is some tedious work related on going over all the tools, checking
whether they need to work with original or final evaluated object and make
the required changes.

Additionally, there need synchronization tag done in fair amount of tools
and operators as well. For example, currently it's not possible to change
render engine without re-opening the file or forcing dependency graph for
re-build via python console.

There is also now some thoughts required about copying evaluated properties
between objects or from collection to a new object. Perhaps easiest way
would be to move base flag flush to Object ID node and tag new objects for
update instead of doing manual copy.

here is some WIP patch which moves such evaluaiton / flush:

  https://developer.blender.org/F635479

Lots of TODOs in the code, with possible optimization.

= How to test? =

This is a feature under heavy development, so obviously it is disabled by
default. The only reason it goes to 2.8 branch is to avoid possible merge
hell.

In order to enable this feature use WITH_DEPSGRAPH_COPY_ON_WRITE CMake
configuration option.

3 years agoGawain API naming refactor
Campbell Barton [Mon, 19 Jun 2017 10:18:04 +0000 (20:18 +1000)]
Gawain API naming refactor

Use consistent prefix for gawain API names as well as
some abbreviations to avoid over-long names, see: D2678

3 years agoCleanup: quiet warnings
Campbell Barton [Mon, 19 Jun 2017 09:31:36 +0000 (19:31 +1000)]
Cleanup: quiet warnings

3 years agoCMake: Remove unused legacy depsgraph option
Sergey Sharybin [Mon, 19 Jun 2017 09:14:11 +0000 (11:14 +0200)]
CMake: Remove unused legacy depsgraph option

We don't have legacy depsgraph anymore, no reason to keep the option.

3 years agoManipulator: use ui-scale for widgets
Campbell Barton [Mon, 19 Jun 2017 08:22:04 +0000 (18:22 +1000)]
Manipulator: use ui-scale for widgets

3 years agoEevee: Add data display for planar reflection.
Clément Foucault [Fri, 16 Jun 2017 23:59:01 +0000 (01:59 +0200)]
Eevee: Add data display for planar reflection.

Maybe not very useful but it's here for feature parity with the other probes.
The fragment shader clipping is here because I'm lazy and don't want to creating a proper quad Batch.

3 years agoEevee: Fix Planar Probe offset changing influence calculation.
Clément Foucault [Fri, 16 Jun 2017 23:56:45 +0000 (01:56 +0200)]
Eevee: Fix Planar Probe offset changing influence calculation.

3 years agoPlanar Probe: Add UI, 3d view Display and change defaults.
Clément Foucault [Fri, 16 Jun 2017 23:55:49 +0000 (01:55 +0200)]
Planar Probe: Add UI, 3d view Display and change defaults.

3 years agoEevee: Initial implementation of planar reflections.
Clément Foucault [Fri, 16 Jun 2017 22:08:03 +0000 (00:08 +0200)]
Eevee: Initial implementation of planar reflections.

Still pretty barebone: No roughness support, No normal distortion support.

3 years agoEevee: Add special shader for depth prespass.
Clément Foucault [Fri, 16 Jun 2017 21:50:40 +0000 (23:50 +0200)]
Eevee: Add special shader for depth prespass.

This way we can extend it to output more data (like motion vectors).
Add a variation that uses clip distances.

3 years agoDrwManager: Remove the need for buffers to be available.
Clément Foucault [Fri, 16 Jun 2017 13:11:23 +0000 (15:11 +0200)]
DrwManager: Remove the need for buffers to be available.

This way we can just avoid binding a texture by setting it's ref to NULL.

3 years agoDrwManager: Remove unnecessary ifs.
Clément Foucault [Fri, 16 Jun 2017 13:10:05 +0000 (15:10 +0200)]
DrwManager: Remove unnecessary ifs.

3 years agoProbe: Add planar type.
Clément Foucault [Fri, 16 Jun 2017 13:00:02 +0000 (15:00 +0200)]
Probe: Add planar type.

3 years agoDrwManager: Add support for Custom Clipping Planes
Clément Foucault [Fri, 16 Jun 2017 12:23:30 +0000 (14:23 +0200)]
DrwManager: Add support for Custom Clipping Planes

3 years agoDrwManager: Add the possibility to invert backfacing.
Clément Foucault [Fri, 16 Jun 2017 11:27:09 +0000 (13:27 +0200)]
DrwManager: Add the possibility to invert backfacing.

This is done in order to support planar reflection rendering.

3 years agoGPUFramebuffer: Add support to attach individual texture layer.
Clément Foucault [Fri, 16 Jun 2017 11:25:22 +0000 (13:25 +0200)]
GPUFramebuffer: Add support to attach individual texture layer.

3 years agoManipulator: de-duplicate flags and scale option
Campbell Barton [Mon, 19 Jun 2017 07:47:04 +0000 (17:47 +1000)]
Manipulator: de-duplicate flags and scale option

3 years agoCleanup: move copy-paste code into function
Campbell Barton [Mon, 19 Jun 2017 06:12:11 +0000 (16:12 +1000)]
Cleanup: move copy-paste code into function

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 19 Jun 2017 05:06:48 +0000 (15:06 +1000)]
Merge branch 'master' into blender2.8

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 agoManipulator: comments
Campbell Barton [Sat, 17 Jun 2017 23:08:30 +0000 (09:08 +1000)]
Manipulator: comments

3 years agoManipulator: use matrix for manipulator direction
Campbell Barton [Sat, 17 Jun 2017 21:43:45 +0000 (07:43 +1000)]
Manipulator: use matrix for manipulator direction

Remove type-specific axis functions.

3 years agoManipulator: use matrix instead of origin
Campbell Barton [Sat, 17 Jun 2017 19:38:10 +0000 (05:38 +1000)]
Manipulator: use matrix instead of origin

This avoids having to use manipulator-type specific functions
to set the orientation.
And will make it simpler to access transformation from Python.

Currently the matrix is still used as an offset in places.
Also per-type orientation values still need to be removed.

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 agoMerge branch 'master' into blender2.8
Campbell Barton [Sat, 17 Jun 2017 15:44:04 +0000 (01:44 +1000)]
Merge branch 'master' into blender2.8

3 years agoCleanup: use uint
Campbell Barton [Sat, 17 Jun 2017 15:34:41 +0000 (01:34 +1000)]
Cleanup: use uint

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 agoManipulator: draw options for dial
Campbell Barton [Sat, 17 Jun 2017 05:32:47 +0000 (15:32 +1000)]
Manipulator: draw options for dial

- Option to start helper angle lines based on a vector
  instead of the initial mouse coords (useful for bisect & spin).
- Option to show 2x helper lines
  useful when dial is used to rotate an axis value.

3 years agoManipulator: correct dial angle
Campbell Barton [Sat, 17 Jun 2017 04:31:27 +0000 (14:31 +1000)]
Manipulator: correct dial angle

Calculation was done in screen-space giving inaccuracy,
making the angle incorrect for tool code.

Cast mouse coords onto the dial plane to calculate the angle instead.

3 years agoManipulator: fix general purpose dial use
Campbell Barton [Sat, 17 Jun 2017 01:55:53 +0000 (11:55 +1000)]
Manipulator: fix general purpose dial use

Wasn't checking own location when checking if flip is needed.

3 years agoCleanup: unused code
Campbell Barton [Sat, 17 Jun 2017 01:31:49 +0000 (11:31 +1000)]
Cleanup: unused code

3 years agoManipulator: Ignore zoom-level for on-screen widgets
Campbell Barton [Sat, 17 Jun 2017 01:24:26 +0000 (11:24 +1000)]
Manipulator: Ignore zoom-level for on-screen widgets

3 years agoCamera widget only drew 3 sides
Campbell Barton [Sat, 17 Jun 2017 01:09:08 +0000 (11:09 +1000)]
Camera widget only drew 3 sides

3 years agoCleanup: minor consistency tweak for type name
Campbell Barton [Sat, 17 Jun 2017 00:04:48 +0000 (10:04 +1000)]
Cleanup: minor consistency tweak for type name

3 years agoManipulator: remove type specific 'new' functions
Campbell Barton [Sat, 17 Jun 2017 00:01:22 +0000 (10:01 +1000)]
Manipulator: remove type specific 'new' functions

Instead use generic 'WM_manipulator_new', adding a new 'setup'
callback (like wmManipulatorGroup.setup) used to initialize type vars.

This moves conventions closer to wmOperator and simplifies exposing to
Python.

3 years agoManipulator: initial manipulator for spin operator
Campbell Barton [Fri, 16 Jun 2017 20:38:51 +0000 (06:38 +1000)]
Manipulator: initial manipulator for spin operator

3 years agoManipulator: New grab preset, use for bisect
Campbell Barton [Fri, 16 Jun 2017 20:13:44 +0000 (06:13 +1000)]
Manipulator: New grab preset, use for bisect

3 years agoManipulator: add array get/set functions
Campbell Barton [Fri, 16 Jun 2017 16:31:21 +0000 (02:31 +1000)]
Manipulator: add array get/set functions

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 object selection doversion issue since Workspace
Dalai Felinto [Fri, 16 Jun 2017 16:12:20 +0000 (18:12 +0200)]
Fix object selection doversion issue since Workspace

Workspace commit (7f564d74f9edaaa41ce27c6e854869096f70b4da) made
selection to not be carried away from 2.7x files into 2.8.

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 agoMerge branch 'master' into blender2.8
Sergey Sharybin [Fri, 16 Jun 2017 08:26:37 +0000 (10:26 +0200)]
Merge branch 'master' into blender2.8

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 agoMissed last commit
Campbell Barton [Thu, 15 Jun 2017 22:52:42 +0000 (08:52 +1000)]
Missed last commit

3 years agoCleanup: rename manipulator files
Campbell Barton [Thu, 15 Jun 2017 22:51:14 +0000 (08:51 +1000)]
Cleanup: rename manipulator files

3 years agoAdd bisect manipulator
Campbell Barton [Thu, 15 Jun 2017 22:25:24 +0000 (08:25 +1000)]
Add bisect manipulator

Example that uses library widgets to control an operator,
the API hasn't been reviewed yet so this can be seen as a test.

3 years agoAdd support for delayed manipulator removal
Campbell Barton [Thu, 15 Jun 2017 22:20:27 +0000 (08:20 +1000)]
Add support for delayed manipulator removal

This is needed so manipulators can tag themselves for removal
without causing problems from freeing data within a callback.

Also use properties within the dial manipulator and fix an error where
removing a wmManipulatorGroupType didn't remove its keymap.

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 agoUV manipulator from custom widgets branch
Campbell Barton [Thu, 15 Jun 2017 21:30:27 +0000 (07:30 +1000)]
UV manipulator from custom widgets branch

This isn't advanced, just adding to get custom
manipulator branch from being too much out of sync with 2.8.

3 years agoExpose World ID panel for Eevee
Dalai Felinto [Thu, 15 Jun 2017 16:46:14 +0000 (18:46 +0200)]
Expose World ID panel for Eevee

That said, materials need to be updated when switching the world.

3 years agoFix duplication of scene, it was missing duplication of layer properties
Dalai Felinto [Thu, 15 Jun 2017 16:31:30 +0000 (18:31 +0200)]
Fix duplication of scene, it was missing duplication of layer properties

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Thu, 15 Jun 2017 15:29:20 +0000 (01:29 +1000)]
Merge branch 'master' into blender2.8

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 agoMerge branch 'master' into blender2.8
Bastien Montagne [Thu, 15 Jun 2017 14:37:10 +0000 (16:37 +0200)]
Merge branch 'master' into blender2.8

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 agoMerge branch 'master' into blender2.8
Bastien Montagne [Thu, 15 Jun 2017 13:54:11 +0000 (15:54 +0200)]
Merge branch 'master' into blender2.8

Conflicts:
source/blender/collada/MeshImporter.cpp
source/blender/editors/object/object_add.c
source/blender/editors/screen/screen_edit.c

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 agoEevee: Use PROP_NONE for probe grid resolution
Dalai Felinto [Thu, 15 Jun 2017 13:02:32 +0000 (15:02 +0200)]
Eevee: Use PROP_NONE for probe grid resolution

It makes no sense to use PROP_PIXEL as unit here.

3 years agoLayers: Scene copy should copy selection as well.
Dalai Felinto [Thu, 15 Jun 2017 11:46:52 +0000 (13:46 +0200)]
Layers: Scene copy should copy selection as well.

We need this for Depsgraph, otherwise CoW scene will have different selection properties.

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 agoUpdates to manipulator API
Campbell Barton [Thu, 15 Jun 2017 10:48:24 +0000 (20:48 +1000)]
Updates to manipulator API

While this is work-in-progress from custom-manipulators branch
its stable so adding into 2.8 so we don't get too much out of sync.

- ManipulatorGroupType's are moved out of the manipulator-map and are now
  global (like operators, panels etc) and added into spaces as needed.
  Without this all operators that might ever use a manipulator in the 3D
  view would be polling the viewport.
- Add optional get/set callbacks for non-RNA properties
  Needed so re-usable manipulators can control values that
  don't correspond to a single properly or need conversion.
- Fix divide by zero bug in arrow manipulator (when moving zero pixels).

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 T51463: Eevee motion blur not working (with AMD)
Dalai Felinto [Thu, 15 Jun 2017 09:31:43 +0000 (11:31 +0200)]
Fix T51463: Eevee motion blur not working (with AMD)

GLSL needs FragColor to be initialized. The default vec4 value seems to be
implementation dependent. Or it's a bug on Mesa/AMD.

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

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Thu, 15 Jun 2017 08:17:51 +0000 (10:17 +0200)]
Merge branch 'master' into blender2.8

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 agoProbes: Modify Add Menu and change defaults.
Clément Foucault [Wed, 14 Jun 2017 22:53:11 +0000 (00:53 +0200)]
Probes: Modify Add Menu and change defaults.

3 years agoProbe: Fix display of the Influence of grid probes.
Clément Foucault [Wed, 14 Jun 2017 22:23:37 +0000 (00:23 +0200)]
Probe: Fix display of the Influence of grid probes.