blender.git
2 years agoCLEW: Workaround compilation error on ppc64el
Sergey Sharybin [Mon, 21 Nov 2016 20:03:34 +0000 (21:03 +0100)]
CLEW: Workaround compilation error on ppc64el

Something was conflicting here, causing C++ to consider bool as
a __vector(4) bool.

2 years agoPartly revert own rBb97c567c1df1e, clear_proxy is actually safe.
Bastien Montagne [Mon, 21 Nov 2016 19:57:02 +0000 (20:57 +0100)]
Partly revert own rBb97c567c1df1e, clear_proxy is actually safe.

This is very confusing, in fact, and rna tooltip was wrong,
BKE_object_make_local_ex actually ensures we never have several proxies
of same object, since it always clears proxy when it has to copy object
to make it local...

What that RNA function is probably missing, though, is same logic as in
BKE_library_make_local to actually remap proxy from old linked object to
new local one.

2 years agoFix two very bad issues in new ID.make_local RNA function.
Bastien Montagne [Mon, 21 Nov 2016 14:19:34 +0000 (15:19 +0100)]
Fix two very bad issues in new ID.make_local RNA function.

I) `clear_proxy` parameter was not assigned to parm in RNA define code,
so 'pyfunc optional' flag was set to `new_id` parameter of `user_remap`
func - super ugly!

II) `clear_proxy` parameter itself, when set to False, would allow to
leave .blend file in invalid state (more than one proxy of same object),
this should never, ever be allowed in RNA API imho. Left the PAI
untouched for now, just disabled any effect from this parameter (hence
always clearing proxy when copying).

2 years agoCleanup: get rid of unused `BKE_constraints_relink()`.
Bastien Montagne [Mon, 21 Nov 2016 13:26:35 +0000 (14:26 +0100)]
Cleanup: get rid of unused `BKE_constraints_relink()`.

Libquery/generic ID remapping code handles this now.

2 years agoFix T49981: New Depsgraph - When camera is on inactive layer, it does not evaluate...
Sergey Sharybin [Mon, 21 Nov 2016 13:36:36 +0000 (14:36 +0100)]
Fix T49981: New Depsgraph - When camera is on inactive layer, it does not evaluate constraints

2 years agoCycles: Attempt to fix compilation error on ppc64el
Sergey Sharybin [Mon, 21 Nov 2016 12:32:41 +0000 (13:32 +0100)]
Cycles: Attempt to fix compilation error on ppc64el

There is some define conflict between system headers and clew,
so delay include of clew.h as much as possible.]

This is something which needed to be done in the code before
the refactor, hopefully such change will still work.

2 years agoDepsgraph: Fix infinite viewport object update in CYcles render mode
Sergey Sharybin [Mon, 21 Nov 2016 11:00:09 +0000 (12:00 +0100)]
Depsgraph: Fix infinite viewport object update in CYcles render mode

The issue was caused by wrong object re-tag needed to have proper dependnecies
update for OpenSubdiv.

2 years agoDepsgraph: use more explicit parenthesis
Sergey Sharybin [Mon, 21 Nov 2016 10:05:56 +0000 (11:05 +0100)]
Depsgraph: use more explicit parenthesis

2 years agoFix Xcode link error, missing definitions in RNA C++ API that other compilers ignored.
Brecht Van Lommel [Sun, 20 Nov 2016 16:46:29 +0000 (17:46 +0100)]
Fix Xcode link error, missing definitions in RNA C++ API that other compilers ignored.

2 years agoCycles: Don't shadow loop variable
Mai Lavelle [Sun, 20 Nov 2016 16:46:43 +0000 (11:46 -0500)]
Cycles: Don't shadow loop variable

2 years agoCycles: add basic backwards compatibility for device selection, move to System tab.
Brecht Van Lommel [Sat, 19 Nov 2016 00:15:08 +0000 (01:15 +0100)]
Cycles: add basic backwards compatibility for device selection, move to System tab.

For the multi-GPU case users still have to reconfigure the devices they want to use.

Based on patch from Lukas Stockner.

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

2 years agoCycles: refactor culling code into utility class.
Brecht Van Lommel [Sat, 12 Nov 2016 23:45:16 +0000 (00:45 +0100)]
Cycles: refactor culling code into utility class.

2 years agoCycles: distance culling for objects.
Carlo Andreacchio [Sat, 12 Nov 2016 23:16:50 +0000 (00:16 +0100)]
Cycles: distance culling for objects.

This can be used together with camera culling to keep nearby objects visible in
reflections, using a minimum distance within which objects are visible. It is
also useful to cull small objects far from the camera.

Reviewed By: brecht

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

2 years agoCleanup: harmless mistake in rangetree
Campbell Barton [Sat, 19 Nov 2016 22:11:26 +0000 (09:11 +1100)]
Cleanup: harmless mistake in rangetree

2 years agoGHOST/X11: Incorrect WM_STATE access
Campbell Barton [Sat, 19 Nov 2016 21:58:41 +0000 (08:58 +1100)]
GHOST/X11: Incorrect WM_STATE access

This worked by accident because of struct padding,
treat state as a CARD32 as documented.

Matches wine-x11 usage.

2 years agoFix T50081: Grease pencil parented rotation problem
Antonioya [Sat, 19 Nov 2016 21:41:37 +0000 (22:41 +0100)]
Fix T50081: Grease pencil parented rotation problem

When the parent object matrix change after the layer was parented, the
inverse matrix for strokes must be updated when editing strokes or the
transformations will be wrong.

2 years agoFix T50078: Vertex Groups not copied over when making proxy.
Luca Rood [Sat, 19 Nov 2016 18:18:10 +0000 (19:18 +0100)]
Fix T50078: Vertex Groups not copied over when making proxy.

Reviewers: mont29

Reviewed By: mont29

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

2 years agoFix T49991: reloading librairies doesn't update node groups.
Bastien Montagne [Sat, 19 Nov 2016 11:20:29 +0000 (12:20 +0100)]
Fix T49991: reloading librairies doesn't update node groups.

We need to check node tree links are still valid, after we remapped
some NodeGroup.

Note: In fact, we have to run that for *all* ID types, since nodes may
use any kind of data-block (in theory)... :/

2 years agoFix NodeGroup generic verify function crashing if node's ID pointer is NULL.
Bastien Montagne [Sat, 19 Nov 2016 11:18:32 +0000 (12:18 +0100)]
Fix NodeGroup generic verify function crashing if node's ID pointer is NULL.

Another nice crasher - in this case, we just want to nuke all sockets...

Related to T49991.

2 years agoFix (unreported) nodeRemoveAllSockets() not clearing inputs/outputs sockets lists.
Bastien Montagne [Sat, 19 Nov 2016 11:16:14 +0000 (12:16 +0100)]
Fix (unreported) nodeRemoveAllSockets() not clearing inputs/outputs sockets lists.

Nice crasher (though seems to not be much used so far)!

Related to T49991.

2 years agoFix forward-compat Nodes write code being executed also for undo steps writing.
Bastien Montagne [Fri, 18 Nov 2016 21:41:56 +0000 (22:41 +0100)]
Fix forward-compat Nodes write code being executed also for undo steps writing.

Forward compatibility code should never, ever be run during undo saving.

Note: related to T49991 (but does not fix it either, crash now happens
when doing a real file save...).

2 years agoFix Node space ID remap callback not handling node trees.
Bastien Montagne [Fri, 18 Nov 2016 21:36:52 +0000 (22:36 +0100)]
Fix Node space ID remap callback not handling node trees.

Yep. Kinda ridiculous, but forgot to handle the very node trees
data-blocks in that editor!

Related (but not fixing) to T49991.

2 years agoFix T50071: Radience HDR fomat does not support alpha at all.
Bastien Montagne [Fri, 18 Nov 2016 21:34:04 +0000 (22:34 +0100)]
Fix T50071: Radience HDR fomat does not support alpha at all.

2 years agoFix UV layer bug in object_utils.object_data_add()
Campbell Barton [Fri, 18 Nov 2016 19:57:55 +0000 (06:57 +1100)]
Fix UV layer bug in object_utils.object_data_add()

Adding a torus in edit-mode, with 'Generate UVs'
for example would either create another UV layer with the default name or
switch to the default UV layer name if it exists.

Now use the existing UV layer if present.

2 years agoAdd Torus: avoid excessive attr access
Campbell Barton [Fri, 18 Nov 2016 19:57:13 +0000 (06:57 +1100)]
Add Torus: avoid excessive attr access

2 years agoBMesh: invalid return from BM_mesh_validate
Campbell Barton [Fri, 18 Nov 2016 19:26:25 +0000 (06:26 +1100)]
BMesh: invalid return from BM_mesh_validate

Returned value was always false, even for valid meshes,
note that this is a debug-only function.

Also set internal-tag cleared.

2 years agoMinor debug-report tweak to autosave code.
Bastien Montagne [Fri, 18 Nov 2016 17:46:10 +0000 (18:46 +0100)]
Minor debug-report tweak to autosave code.

Print in cosole a warning when we skip autosave due to runnning modal op.

Related to T49974.

2 years agoCycles: Different noise seed for stereoscopic rendering (Fix #T50024)
Dalai Felinto [Fri, 18 Nov 2016 17:23:45 +0000 (18:23 +0100)]
Cycles: Different noise seed for stereoscopic rendering (Fix #T50024)

Patch by Sergey Sharybin.

2 years agoDepsgraph: Fix residue of debug-only code
Sergey Sharybin [Fri, 18 Nov 2016 16:47:17 +0000 (17:47 +0100)]
Depsgraph: Fix residue of debug-only code

2 years agoFix T50035: Minor interface bug: UV/ImageEditor - Paint Mode - Fill Brush
Bastien Montagne [Fri, 18 Nov 2016 14:49:41 +0000 (15:49 +0100)]
Fix T50035: Minor interface bug: UV/ImageEditor - Paint Mode - Fill Brush

Patch by @LucaRood, added some cleanup of DRAW/FILL conditions in this
code too...

2 years agoFix (unreported) bad handling of brush's fill threshold value.
Bastien Montagne [Fri, 18 Nov 2016 14:32:50 +0000 (15:32 +0100)]
Fix (unreported) bad handling of brush's fill threshold value.

'1' threshold value would only allow to access a third of the basic
'color space' (from black to white, from 0.0 to 1.0 component values),
when you expect it to access the whole range.

Unfortunately, this needs a subversion bump to allow already defined
brushes to keep exact same behavior!

Also, did not change default value (0.2) for new brushes, think here
keeping current one makes more sense.

Thanks to @LucaRood for confirming the issue.

2 years agoFix T50052: bpy.utils.unregister_module doesn't unregister classes of submodules...
Bastien Montagne [Fri, 18 Nov 2016 14:14:22 +0000 (15:14 +0100)]
Fix T50052: bpy.utils.unregister_module doesn't unregister classes of submodules in reload scenario.

reload case would clear TypeMap before unregistering addons, which made
all calls to unregister_module() to do absolutely nothing.

2 years agoFix T50063: Editing driver's expression eliminates "Zero" number
Julian Eisel [Fri, 18 Nov 2016 12:37:04 +0000 (13:37 +0100)]
Fix T50063: Editing driver's expression eliminates "Zero" number

Disables trimming of trailing zeros in case button contains an expression.

2 years agoImplement multi-view stereo support for image empties
Dalai Felinto [Fri, 18 Nov 2016 11:37:39 +0000 (12:37 +0100)]
Implement multi-view stereo support for image empties

Empty images were implemented to expand (and eventually replace)
the background images functionalities. If we are ever to drop
background images "image empties" should support stereo/multi-view as well.

2 years agoFix potential NULL dereference in mesh sequence cache modifier.
Bastien Montagne [Fri, 18 Nov 2016 11:03:12 +0000 (12:03 +0100)]
Fix potential NULL dereference in mesh sequence cache modifier.

Reported by coverity.

2 years agoFix copy/paste typo in new depsgraph object geometry builder (found by coverity).
Bastien Montagne [Fri, 18 Nov 2016 10:55:28 +0000 (11:55 +0100)]
Fix copy/paste typo in new depsgraph object geometry builder (found by coverity).

2 years agoBMesh: avoid using temp array for face-area
Campbell Barton [Thu, 17 Nov 2016 18:55:37 +0000 (05:55 +1100)]
BMesh: avoid using temp array for face-area

2 years agoBMesh: minor cleanup
Campbell Barton [Tue, 15 Nov 2016 16:22:49 +0000 (03:22 +1100)]
BMesh: minor cleanup

Comment & don't use dummy pointer.

2 years agoCleanup: redundant index loop for monkey-create
Campbell Barton [Thu, 17 Nov 2016 19:08:51 +0000 (06:08 +1100)]
Cleanup: redundant index loop for monkey-create

Also rename face vars (the faces aren't temp),
and quiet old-style-definition warning.

2 years agoDepsgrpah: Fix missing animation update in movie clips
Sergey Sharybin [Thu, 17 Nov 2016 15:37:25 +0000 (16:37 +0100)]
Depsgrpah: Fix missing animation update in movie clips

2 years agoDepsgraph: Move scene builder function to own file
Sergey Sharybin [Thu, 17 Nov 2016 14:38:03 +0000 (15:38 +0100)]
Depsgraph: Move scene builder function to own file

This way it's much easier to grasp what the graph actually contains.

2 years agoFix T50060: New depsgraph does not update mask animation
Sergey Sharybin [Thu, 17 Nov 2016 14:29:22 +0000 (15:29 +0100)]
Fix T50060: New depsgraph does not update mask animation

2 years agoDepsgraph: Use utility macro to iterate over linked list
Sergey Sharybin [Thu, 17 Nov 2016 14:11:55 +0000 (15:11 +0100)]
Depsgraph: Use utility macro to iterate over linked list

This will be compiled into same exact code, just saves us from
doing annoying type casts all over the place.

2 years agoDepsgraph: Move rig builder functions to own files
Sergey Sharybin [Thu, 17 Nov 2016 13:34:46 +0000 (14:34 +0100)]
Depsgraph: Move rig builder functions to own files

Those routines are rather big and started to be annoying to have
one big file.

Should be no functional changes.

2 years ago[MSVC] Preliminary VS2017 support.
lazydodo [Thu, 17 Nov 2016 03:13:58 +0000 (20:13 -0700)]
[MSVC] Preliminary VS2017 support.

2 years agoFix T50001: auto tile size addon broken after Cycles GPU device changes.
Brecht Van Lommel [Thu, 17 Nov 2016 01:16:21 +0000 (02:16 +0100)]
Fix T50001: auto tile size addon broken after Cycles GPU device changes.

Adds a get_num_gpu_devices() utility function for the addon to use.

2 years agoFix T50051: Avoid crash when render grease pencil from VSE
Antonioya [Wed, 16 Nov 2016 20:33:47 +0000 (21:33 +0100)]
Fix T50051: Avoid crash when render grease pencil from VSE

The renderpasses for grease pencil are not necessary when render from
sequencer.

This fix solves the GPF but we need to rethink the complete render
process for grease pencil and integrate better in the render and
composition workflow.

Thanks to Dalai Felinto por helping in the debug and fixing of the
problem.

2 years agoCycles: Fix different noise pattern from fix in T49838:
Sergey Sharybin [Wed, 16 Nov 2016 14:12:31 +0000 (15:12 +0100)]
Cycles: Fix different noise pattern from fix in T49838:

No need to hash subframe == 0.

2 years agoFix T50046: Segmentation fault due to out-of-range VertexGroup.weight() call.
Bastien Montagne [Wed, 16 Nov 2016 11:38:57 +0000 (12:38 +0100)]
Fix T50046: Segmentation fault due to out-of-range VertexGroup.weight() call.

`get_vert_def_nr()` was not checking vert index in bmesh case (aka Edit mode).

2 years agoRemove unused vector icons
Martijn Berger [Wed, 16 Nov 2016 09:03:11 +0000 (10:03 +0100)]
Remove unused vector icons

it seems to me the icons are unused:

  - VICO_VIEW3D_VEC
  - VICO_EDIT_VEC
  - VICO_EDITMODE_VEC_DEHLT
  - VICO_EDITMODE_VEC_HLT
  - VICO_DISCLOSURE_TRI_RIGHT_VEC
  - VICO_DISCLOSURE_TRI_DOWN_VEC
  - VICO_MOVE_UP_VEC
  - VICO_MOVE_DOWN_VEC
  - VICO_X_VEC

Since their code contains immediate mode GL calls and they seem to be unused i thought we could remove them.

Reviewers: mont29

Reviewed By: mont29

Subscribers: merwin

Tags: #bf_blender_2.8

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

2 years agoFix custom props not being handled correctly by manual/pyref UI menu entries.
Bastien Montagne [Wed, 16 Nov 2016 10:07:07 +0000 (11:07 +0100)]
Fix custom props not being handled correctly by manual/pyref UI menu entries.

2 years agoDisable possibility to flip bone names of linked armatures
Sergey Sharybin [Wed, 16 Nov 2016 09:39:41 +0000 (10:39 +0100)]
Disable possibility to flip bone names of linked armatures

Linked data should not be modified in such a way.

Reported by Nathan here in the studio, reviewed by Bastien, thanks!

2 years agoCleanup: Remove unused function
Sergey Sharybin [Wed, 16 Nov 2016 09:09:43 +0000 (10:09 +0100)]
Cleanup: Remove unused function

2 years agoFix T50026: "Only Insert Needed" doesn't work when using Trackball rotation
Joshua Leung [Tue, 15 Nov 2016 22:14:38 +0000 (11:14 +1300)]
Fix T50026: "Only Insert Needed" doesn't work when using Trackball rotation

The rotation case here only covered rotation by the "Rotate" tool, but skipped
the "Trackball" tool.

2 years agoFix T50023: Inverse Kinematics angle limits defaulting to 10313.2403124°
Joshua Leung [Tue, 15 Nov 2016 22:09:02 +0000 (11:09 +1300)]
Fix T50023: Inverse Kinematics angle limits defaulting to 10313.2403124°

Regression from 2.77a. The units for the min/max limits were changed in RNA
but the pose channels were still being initialised with in degrees.

2 years agoFIX T49899: Add EIGEN_MAKE_ALIGNED_OPERATOR_NEW to classes that use eigen's data...
lazydodo [Tue, 15 Nov 2016 20:21:01 +0000 (13:21 -0700)]
FIX T49899: Add EIGEN_MAKE_ALIGNED_OPERATOR_NEW to classes that use eigen's data types , to force aligned on 16 byte boundaries.

2 years agoRNA Main API: set remove's do_unlink default value to true.
Bastien Montagne [Tue, 15 Nov 2016 16:12:18 +0000 (17:12 +0100)]
RNA Main API: set remove's do_unlink default value to true.

On second and third thoughts, this should have been done that way since
the begining, cases were you just delete a few data-blocks without any
serious knowledge of their usages are much, much more frequent than
cases where you are deleting thousands of data-blocks and are sure they
are not used anywhere anymore...

Own fault, but really frustrated that this topic was only raised the day
after 2.78a was released. :(

2 years agoGet rid of 'drivers unlinking' code in `BKE_libblock_free_data()`
Bastien Montagne [Tue, 15 Nov 2016 15:36:47 +0000 (16:36 +0100)]
Get rid of 'drivers unlinking' code in `BKE_libblock_free_data()`

This has nothing to do here (freeing is not unlinking/remapping!), and
was actually redoing something already taken care of by
`BKE_libblock_relink_ex()` call in `BKE_libblock_free_ex()`.

Also, gives some noticeable speedup when removing datablocks with
do_unlink=True, about 5 to 10% quicker e.g. when deleting all objects
from a py console, in a big production file...

2 years agoDepsgraph: Fix frash with iTaSC solver
Sergey Sharybin [Tue, 15 Nov 2016 15:18:59 +0000 (16:18 +0100)]
Depsgraph: Fix frash with iTaSC solver

This commit reverts part of a fix for T33275, but things are:

- I can not reproduce the original issue at all, so doesn't seem to
  cause any regressions.

- It is really bad idea to do delayed initialization in the threaded
  environment, it's a straight way to some nasty issues.

- We can't do things like this anyway because we go more granular,
  meaning such a delayed initialization will fail in the case of
  having several IK solvers (unless they properly accommodate to
  changed bone head).

- Verified the fix with various files from Mango project and all of
  them seems to work nice with new depednency graph now (old depsgraph
  has some flickering, but it's not related on DEG itself, but on
  an environment with lots of proxies and threaded evaluation and it
  is not a new behavior).

2 years agoRevert "Proxy: Construct pchan hash when syncing armature proxy"
Sergey Sharybin [Tue, 15 Nov 2016 15:13:24 +0000 (16:13 +0100)]
Revert "Proxy: Construct pchan hash when syncing armature proxy"

This reverts commit 9b5a32cbfb8a8565202bdccd232c53f98b62eeec.

Apparently it is possible to have other thread mocking around with the hash.

Needs deeper investigation, for the time being reverting to prevent crashes.

2 years agoFix menu inconsistencies
Aaron Carlisle [Tue, 15 Nov 2016 14:55:54 +0000 (15:55 +0100)]
Fix menu inconsistencies

This commit fixes two issues:

- UV/Image editor uvs menu did not match the 3D View's which was changed in rB2b240b043078
- Circle select tool was missing in particle edit mode

Reviewers: Severin
Differential Revision: https://developer.blender.org/D2329

2 years agoCleanup: More explicit parentheses
Sergey Sharybin [Tue, 15 Nov 2016 15:01:21 +0000 (16:01 +0100)]
Cleanup: More explicit parentheses

2 years agoAvoid interface ID remapping when freeing the whole database
Sergey Sharybin [Tue, 15 Nov 2016 14:46:52 +0000 (15:46 +0100)]
Avoid interface ID remapping when freeing the whole database

This makes heavy scenes to be freed almost instantly (so now
quadbot scene takes only 0.06sec to free),

2 years agoAvoid driver target remapping when freeing the whole database
Sergey Sharybin [Tue, 15 Nov 2016 14:38:03 +0000 (15:38 +0100)]
Avoid driver target remapping when freeing the whole database

Added BKE_libblock_free_data_ex() which takes special do_id_user
argument which basically indicates whether main database was already
taken care about not having "dead" pointers.

Gives about 40% speedup of main database free with quadbot scene
(3.4sec vs. 5.4 sec on quite powerful desktop).

2 years agoFix T50022: "Mirror" in Dopesheet Crashes Blender
Julian Eisel [Tue, 15 Nov 2016 14:27:22 +0000 (15:27 +0100)]
Fix T50022: "Mirror" in Dopesheet Crashes Blender

Just fixing crash itself. Actually operator shouldn't run in most editors (not in dopesheet either I guess), but don't want to spend time on that right now.

2 years agoImplement grouped undo option for operators
Dalai Felinto [Tue, 15 Nov 2016 10:50:11 +0000 (11:50 +0100)]
Implement grouped undo option for operators

This option makes an operator to not push a task to the undo stack if the previous stored elemen is the same operator or part of the same undo group.

The main usage is for animation, so you can change frames to inspect the
poses, and revert the previous pose without having to roll back tons of
"change frame" operator, or even see the undo stack full.

This complements rB13ee9b8e
Design with help by Sergey Sharybin.

Reviewers: sergey, mont29

Reviewed By: mont29, sergey

Subscribers: pyc0d3r, hjalti, Severin, lowercase, brecht, monio, aligorith, hadrien, jbakker

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

2 years agoDepsgraph: Fix typo in previous optimization commit
Sergey Sharybin [Tue, 15 Nov 2016 10:30:21 +0000 (11:30 +0100)]
Depsgraph: Fix typo in previous optimization commit

Was a residue from another experiment, caused infinite loop when
reporting dependency cycles.

2 years agoAtomics: Add some extra utility functions
Sergey Sharybin [Tue, 15 Nov 2016 12:41:08 +0000 (13:41 +0100)]
Atomics: Add some extra utility functions

Also fixed semantic of fetch-and-add in assembler implementation,
it seemed to not match the naming.

2 years agoAtomics: Make naming more obvious about which value is being returned
Sergey Sharybin [Tue, 15 Nov 2016 11:16:26 +0000 (12:16 +0100)]
Atomics: Make naming more obvious about which value is being returned

2 years agoBMesh: remove redundant link-list manipulation
Campbell Barton [Tue, 15 Nov 2016 01:39:33 +0000 (12:39 +1100)]
BMesh: remove redundant link-list manipulation

No need to track previous edge in vert-separate cleanup

2 years agoBMesh: match BM_vert_find_first_loop with iterator logic
Campbell Barton [Mon, 14 Nov 2016 20:55:55 +0000 (07:55 +1100)]
BMesh: match BM_vert_find_first_loop with iterator logic

Use changes from previous commit for BM_vert_find_first_loop.

2 years agoBMesh: avoid extra calls per faces-of-vert iterator
Campbell Barton [Mon, 14 Nov 2016 20:30:36 +0000 (07:30 +1100)]
BMesh: avoid extra calls per faces-of-vert iterator

- `bmesh_radial_faceloop_find_first` & `bmesh_disk_faceedge_find_first`
  can be replaced with a single call to a new function:
  `bmesh_disk_faceloop_find_first`

- `bmesh_disk_faceedge_find_first` called `bmesh_radial_facevert_check`
  which isn't needed, since either the current or next loop in the
  cycle is attached to the edge we're looking for.

2 years agoBMesh: use const for BM_vert_face_check
Campbell Barton [Mon, 14 Nov 2016 20:30:18 +0000 (07:30 +1100)]
BMesh: use const for BM_vert_face_check

2 years agoBMesh: minor improvement to BM_vert_face_check
Campbell Barton [Mon, 14 Nov 2016 19:50:33 +0000 (06:50 +1100)]
BMesh: minor improvement to BM_vert_face_check

No need to perform edge-of-vert then loop-of-edge check.

Any vertex that has an edge with a face will be connected to a face.

2 years agoBMesh: fix edge-rotate with w/ flipped faces
Campbell Barton [Mon, 14 Nov 2016 16:57:44 +0000 (03:57 +1100)]
BMesh: fix edge-rotate with w/ flipped faces

Edge-rotate would randomly flip one of the faces to match the other.

Also maintain active-face when rotating the edge.

2 years agoBMesh: fix edge-rotation selection state bug
Campbell Barton [Mon, 14 Nov 2016 16:26:19 +0000 (03:26 +1100)]
BMesh: fix edge-rotation selection state bug

Failed edge rotation could leave unselected edge between selected faces,
also report warning when edges fail to be rotated.

2 years agoBMesh: replace iterator with BM_face_vert_share_loop
Campbell Barton [Mon, 14 Nov 2016 15:41:23 +0000 (02:41 +1100)]
BMesh: replace iterator with BM_face_vert_share_loop

2 years agoBMesh: remove redundant argument
Campbell Barton [Mon, 14 Nov 2016 03:21:15 +0000 (14:21 +1100)]
BMesh: remove redundant argument

2 years agoCycles: De-duplicate image loading functions
Sergey Sharybin [Mon, 14 Nov 2016 13:03:17 +0000 (14:03 +0100)]
Cycles: De-duplicate image loading functions

The code was templated already, so don't see big reason to have
3 versions of templated functions. It was giving some extra code
to maintain and in fact already had divergency for support of huge
image resolution (missing size_t cast in byte image loading).

There should be no changes visible by artists.

2 years agointsall_deps / OSL use c++11 ABI when install_deps is asking for c++11
Martijn Berger [Mon, 14 Nov 2016 08:59:30 +0000 (09:59 +0100)]
intsall_deps / OSL use c++11 ABI when install_deps is asking for c++11

2 years agoBMesh: BM_face_exists no longer uses return arg
Campbell Barton [Sun, 13 Nov 2016 17:10:47 +0000 (04:10 +1100)]
BMesh: BM_face_exists no longer uses return arg

Just return the face or NULL, like BM_edge_exists(),
Also for BM_face_exists_overlap & bm_face_exists_tri_from_loop_vert.
No functional changes.

Old code did some partial overlap checks where this made some sense,
but it's since been removed.

2 years agoFix T50013: Blender 2.78a Link/Append Crash.
Bastien Montagne [Sun, 13 Nov 2016 14:49:41 +0000 (15:49 +0100)]
Fix T50013: Blender 2.78a Link/Append Crash.

Object freeing may in some kind access its obdata (in case it has some
caches e.g.), since here obdata may have already been freed, let's set
object's data pointer to NULL (probably not ideal solution, but we don't
care much, those form archipelagos of unused linked datablocks,
we nuke'em all anyway).

Also fix stupid mistake in one of own recent commits (using ID we just
freed, tsst...).

2 years agoFix T50007: blender offline python documentation in zipped HTML files, not shown...
Bastien Montagne [Sun, 13 Nov 2016 11:03:28 +0000 (12:03 +0100)]
Fix T50007: blender offline python documentation in zipped HTML files, not shown correctly.

Stupid mistake, os.scandir is not recursive... Patch by @brecht, thanks.

2 years agoFix T49997: don't flip texture users menu in texture properties.
Brecht Van Lommel [Sun, 13 Nov 2016 01:27:45 +0000 (02:27 +0100)]
Fix T49997: don't flip texture users menu in texture properties.

2 years agoFix T50008: camera DOF Distance picking from W key menu not working.
Brecht Van Lommel [Sat, 12 Nov 2016 21:29:49 +0000 (22:29 +0100)]
Fix T50008: camera DOF Distance picking from W key menu not working.

2 years agofix T50004: Removed check for empty mesh and adjusted the vertex import function...
Gaia Clary [Sat, 12 Nov 2016 21:20:07 +0000 (22:20 +0100)]
fix T50004: Removed check for empty mesh and adjusted the vertex import function to accept meshes without vertices as well

2 years agoFix Make Vertex Parent operator missing from vertex/curve/lattice menus.
Geoffroy Krantz [Sat, 12 Nov 2016 17:57:40 +0000 (18:57 +0100)]
Fix Make Vertex Parent operator missing from vertex/curve/lattice menus.

Reviewed By: brecht

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

2 years agoFix T49904: Cycles standalone missing default generated texture coordinates.
Brecht Van Lommel [Sat, 12 Nov 2016 16:21:21 +0000 (17:21 +0100)]
Fix T49904: Cycles standalone missing default generated texture coordinates.

2 years agoFix Cycles OSL compilation based on modified time not working.
Brecht Van Lommel [Sat, 12 Nov 2016 16:20:40 +0000 (17:20 +0100)]
Fix Cycles OSL compilation based on modified time not working.

2 years agoFix Cycles standalone not finding CPU device after recent changes.
Brecht Van Lommel [Sat, 12 Nov 2016 14:41:42 +0000 (15:41 +0100)]
Fix Cycles standalone not finding CPU device after recent changes.

2 years agoFix T49985: cycles standalone XML missing distant lights.
Brecht Van Lommel [Sat, 12 Nov 2016 14:26:51 +0000 (15:26 +0100)]
Fix T49985: cycles standalone XML missing distant lights.

2 years agoFix T49985: cycles standalone using wrong socket names for XML reading.
Brecht Van Lommel [Sat, 12 Nov 2016 14:26:24 +0000 (15:26 +0100)]
Fix T49985: cycles standalone using wrong socket names for XML reading.

2 years agoSculpt UI: Make DynTopo constant detail a resolution value
Julian Eisel [Sat, 12 Nov 2016 15:14:09 +0000 (16:14 +0100)]
Sculpt UI: Make DynTopo constant detail a resolution value

This should make it easier to sculpt in high resolutions, downside is that the new way to calculate maximum edge length is a bit less intuitive. Maximum edge length used to be calculated as blender_unit * percentage_value, now it's blender_unit / value.

Reused old DNA struct member, but had to bump subversion to ensure correct compatibility conversion. Also changed default value slightly (would have had to set to 3.333... otherwise).

Was Requested by @monio (see https://rightclickselect.com/p/sculpting/zpbbbc/dyntopo-better-scale-input-in-constant-detail-mode) and I think it's worth testing.

2 years agoBMesh: update comments, ifdef'd code
Campbell Barton [Sat, 12 Nov 2016 14:35:22 +0000 (01:35 +1100)]
BMesh: update comments, ifdef'd code

2 years agoBMesh: Minor improvement to face-join
Campbell Barton [Fri, 11 Nov 2016 23:06:53 +0000 (10:06 +1100)]
BMesh: Minor improvement to face-join

Pass in loops instead of edge & faces.
Nearly all callers have the loop-pairs to pass in.

2 years agoFix renaming error in last commit
Campbell Barton [Fri, 11 Nov 2016 23:29:38 +0000 (10:29 +1100)]
Fix renaming error in last commit

2 years agoBKE_library_make_local(): some minor improvements.
Bastien Montagne [Fri, 11 Nov 2016 22:15:55 +0000 (23:15 +0100)]
BKE_library_make_local(): some minor improvements.

Do not set 'real user' to groups every time we run the first clearing loop.

And do fully clear properly LIB_TAG_DOIT (this is not yet enforced in
existing code, but would love to get to that stage in future, so let's
do it at least with new code!).

2 years agoMinor naming cleanup.
Bastien Montagne [Fri, 11 Nov 2016 21:56:47 +0000 (22:56 +0100)]
Minor naming cleanup.

2 years agoEnhance BKE_library_make_local() to make it much quicker in complex cases.
Bastien Montagne [Fri, 11 Nov 2016 21:29:54 +0000 (22:29 +0100)]
Enhance BKE_library_make_local() to make it much quicker in complex cases.

Basic idea is to split first loop in two, and run checks before making
anything actually local, to detect data-blocks that we can directly make
local (because we are sure they are only used by already/future local
datablocks).

This allows to avoid a lot of overhead in later 'cleanup' steps of this
function, here with barbershop shot it's four times quicker (from 190s to 48s).

We are still far from the instantaneous results of MakeLocal in 2.77,
but in that version main characters lose their connection to their
armature and remain static after makelocal, so guess new code is still
better. ;)

There are probably more optimizations possible here, but would rather
polish this area of code once we get rid of proxies, those really
make it a nightmare to work on.

2 years agoMinor optimization to BKE_library_tag_unused_linked_data().
Bastien Montagne [Fri, 11 Nov 2016 18:32:59 +0000 (19:32 +0100)]
Minor optimization to BKE_library_tag_unused_linked_data().