Commit Graph

100091 Commits

Author SHA1 Message Date
Philipp Oeser a985b8bd9e Fix T80437: Auto IK Double Generates IK constraints
Caused by rB9a7f5f1bb422.

If using Auto IK (or targetless IK and Auto IK together), two temporary
constraints were added.
- from pose_grab_with_ik_add (even for targetless IK)
- from add_pose_transdata (even for Auto IK)

Since both both do similar things, but cannot work in tandem (with
possibly different chainlengths for example), we have to decide which
type to prefer over the other (as in: do not create a constraint for the
other).
It seems better to ignore the 'Auto IK' option on bones that will
have targetless IK set up for them specificallly [e.g. defining special
chainlength]. This way you can still work with 'Auto IK' ON generally
[with interactive chainlength control], but also have specific bones that
need their own custom chainlength.

For now, the most straightforward fix is to
- only add constraints for Auto IK from pose_grab_with_ik_add()
- only add constraints for targetless IK from add_pose_transdata()

Note: this area has some potential for later refactoring:
- move creation of all temporary constraints to a single place
[preferably pose_grab_with_ik_add]
- use only those temporary constraints in transform code [atm. we still
flip CONSTRAINT_IK_AUTO around on the "original" -- unneccesarily, after
rB9a7f5f1bb422 a dedicated temporary constraint is now always available]
- clarify CONSTRAINT_IK_AUTO vs. CONSTRAINT_IK_TEMP
- obeying standard rotation locks on bones in the chain (not just the
the IK locks) is not consistent between targetless IK and Auto IK

Potential candidate for 2.90.1 as well as 2.83 LTS

Maniphest Tasks: T80437

Differential Revision: https://developer.blender.org/D8930
2020-09-18 13:18:19 +02:00
Sergey Sharybin 9a5663ff43 Cycles: Add time report for Blender data synchronization
Allows to more easily access time information about how long Cycles
did spend synchronizing objects from evaluated depsgraph on Blender
side to its own structures.

This timer does not include time spent evaluating render depsgraph.
2020-09-18 12:03:22 +02:00
Jeroen Bakker 940ef1a4e8 EEVEE: Fixed Compilation Error
Regression from {b248ec97769f}. A new parameter was introduced, but the
stub shader macros still had the old number of parametes. This
change adds a new dummy parameter to the stub macros.
2020-09-18 10:39:32 +02:00
Philipp Oeser 7bfcd99a90 Fix T80904: GPencil: bones cannot be transformed when in weightpaint
mode

The transform convert of type TC_POSE was not being defined if the mode
was OB_MODE_WEIGHT_GPENCIL.

Maniphest Tasks: T80904

Differential Revision: https://developer.blender.org/D8934
2020-09-18 10:15:02 +02:00
Campbell Barton bda6eb1e27 Fix T71383: Error setting the windows workspaces from Python
Assigning window variables relied on notifiers that always used the
active window, no matter the window being assigned.

Pass the current window to the notifier.
2020-09-18 17:57:54 +10:00
Campbell Barton 9a52b30cc0 UV: select face loops when in face-select mode
Match edit-mesh behavior.
2020-09-18 16:04:43 +10:00
Campbell Barton 338ebea53e Cleanup: remove unused global locks from BLI_threads 2020-09-18 15:31:12 +10:00
Campbell Barton e6978f4d63 Fix T80885: Texture paint camera project crashes after undo/redo
Unmatched ED_image_undo_push_{begin/end},
add doc-strings noting why this is needed.

Thanks to @Baardaap for the initial fix.
2020-09-18 14:38:23 +10:00
Hans Goudey 14b2de37db UI: Refactor panel alignment function
This code had grown overly complicated and hard to understand.
The improvements in this commit:
 - Avoid allocating a duplicate of every active panel.
 - Instead of complicated logic to calculate each panel's offset,
   just keep track of the current offset while iterating through.
 - More readable code structure, better comments.

Note that calcuting the X offset here is a relic from pre-2.5 when
panels could be aligned horizontally. I kept this in, but it would
be reasonable to remove it in the future.
2020-09-17 23:15:20 -05:00
Hans Goudey aa2219285c Cleanup: Rename variables in panel alignment code
This makes these variable names more consistent with current standards,
mostly by not over-abbreviating already short words. The following commit
will refactor this function.
2020-09-17 22:58:07 -05:00
Campbell Barton 0e78dacb4d Cleanup: change enum usage so types are explicitly listed
Structure switch statements so new missing items cause warnings.
2020-09-18 11:15:12 +10:00
Campbell Barton 1dda60792c Cleanup: use 'UI_icon_*' prefix for icons API
- UI_collection_color_icon_get -> UI_icon_color_from_collection
- UI_idcode_icon_get           -> UI_icon_from_idcode
- UI_library_icon_get          -> UI_icon_from_library
- UI_mode_icon_get             -> UI_icon_from_object_mode
- UI_rnaptr_icon_get           -> UI_icon_from_rnaptr
- UI_alert_image               -> UI_icon_alert_imbuf_get
- UI_preview_render_size       -> UI_icon_preview_to_render_size
- UI_id_icon_render            -> UI_icon_render_id
2020-09-18 10:24:14 +10:00
Pablo Dobarro cacd57b67a Fix T80771: Avoid changing the visibility of loose geometry when entering Sculpt Mode
When entering scultp mode the visibility from the Face Sets is copied to
the base mesh. This steps was considering that if a vertex belongs to a
face with a visibible Face Set ID, it should be visible. As loose
geometry may not have any faces, those vertex were set to hidden.

Now this function check if a vertex visibility should be modified by the
face sets (by checking the loops), avoiding modifying the visibility of
loose geometry unintentionally.

Reviewed By: sergey

Maniphest Tasks: T80771

Differential Revision: https://developer.blender.org/D8899
2020-09-17 23:51:21 +02:00
Pablo Dobarro adfbb77b20 Fix Brushes with deformation target being affected by sim areas
Brushes that target the cloth simulation but are not the cloth brush
affect the entire mesh, so they don't have simulation areas and falloff.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8885
2020-09-17 23:46:36 +02:00
Pablo Dobarro 459fd1814c Fix bad allocation in mask sculpt gestures
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8886
2020-09-17 23:44:54 +02:00
Philipp Oeser 39de0b79fd Pointclouds: support mesh <-> pointcloud in convert operator
Just converts verts to points and vice versa.
Materials and Attribute layers are preserved (so for example if you set
custom radii on the pointcloud, convert to mesh, then convert back to
pointcloud, this will be preserved).

Also not add a Radius layer by default (it is still added and
filled when adding a pointcloud object from the menu), a global Radius
property that will be used if there is no radius attribute can be added
later. A Radius attribute can also be added in the pointcloud data
properties (and filled via python).

This will also add a new utility function that copies materials between
datablocks: BKE_id_materials_copy

ref T75717

Differential Revision: https://developer.blender.org/D7391
2020-09-17 22:39:57 +02:00
Hans Goudey 9ee588cd4a Cleanup: Correct comments 2020-09-17 15:18:24 -05:00
Hans Goudey 1f9e3d44a0 Cleanup: Doxygen sections 2020-09-17 13:14:47 -05:00
Philipp Oeser 66d7f9c8f0 Cleanup: remove unneeded check in uiTemplateConstraintHeader
Following rB7a0a60dde8b4, checking for temporary IK constraints in
uiTemplateConstraintHeader is not needed anymore (since the whole panel
will now be skipped earlier for those).

Differential Revision: https://developer.blender.org/D8902
2020-09-17 19:30:46 +02:00
Philipp Oeser 627132496d Fix T80131: Rigid Body World Field Weights dont have a proper RNA path
(e.g. cannot be animated)

An RNA path is mandatory for RNA_path_from_ID_to_property, and for
EffectorWeights, this has to be provided using RNA_def_struct_path_func
(since this struct is shared across ParticleSettings, Modifiers and Rigid
Body World). Without this, the animation system cannot work and e.g.
keyframes cannot be inserted.

The case for Rigid Body World in rna_EffectorWeight_path was missing,
now added.

Rigid Body World Field Weights are capable of being animated, tested
with file from T80131 (e.g. gravity, wind).

Maniphest Tasks: T80131

Differential Revision: https://developer.blender.org/D8713
2020-09-17 19:21:39 +02:00
Alex Strand b248ec9776 Shaders: add emission strength input to Principled BSDF node
This impacts I/O add-ons. OBJ, FBX and Collada have been updated, glTF not yet.

Differential Revision: https://developer.blender.org/D4971
2020-09-17 18:54:04 +02:00
Hans Goudey 65fd005312 Cleanup: Extract "draw_fcurve" as a separate function
This is reasonable to do by itself, but it also enables drawing fcurves
outside of this loop, which is useful for D7737.
2020-09-17 11:30:41 -05:00
Hans Goudey 5b7a35ddfb Cleanup: Use "r_" prefix for return arguments 2020-09-17 11:06:41 -05:00
Sebastián Barschkis 08a3f01ddc macOS: Added potrace in platform apple cmake
Ref T80818

Reviewed By: brecht

Maniphest Tasks: T80818

Differential Revision: https://developer.blender.org/D8922
2020-09-17 17:32:39 +02:00
Ankit Meel f37c83a12b CMake/Potrace: Fix capitalization, silence warning.
The `find_package()` callers expect the library name as `Potrace`, not
`POTRACE`.

Reviewed By: LazyDodo

Differential Revision: https://developer.blender.org/D8923
2020-09-17 19:45:20 +05:30
Germano Cavalcante 3a92a2df45 Add versioning for 2.90 files that may have invalid mesh
rBf2d26409e83b fixed a serious problem with invalid mesh after an
operation with the extrude manifold.

Since BKE_mesh_validate_arrays is a slow operation, the chosen
interval between versions is relatively small and also only the
mentioned invalid mesh problem is tested.

Differential Revision: https://developer.blender.org/D8898
2020-09-17 11:10:58 -03:00
Jacques Lucke 82bd1287dd Cleanup: reduce variable scope 2020-09-17 14:10:54 +02:00
Sergey Sharybin 393b5a231f Cleanup: Misplaced fullstop in comment 2020-09-17 13:33:53 +02:00
Campbell Barton ef4877fde3 Fix error in fix for T66256, not clearing the exception 2020-09-17 21:12:35 +10:00
Brecht Van Lommel 3dbb231ed2 Fix OpenCL render error in large scenes
In scenes such as Cosmos Laundromat, there were memory allocations bigger than
2GB which would overflow.

Problem and solution found by AMD, thanks!
2020-09-17 13:07:28 +02:00
Brecht Van Lommel 532ac1163c Tests: bundle tests for some modules in their own executables
The ffmpeg, guardedalloc and blenlib are quite isolated and putting them in
their own executable separate from blender_test is faster for development than
linking the entire blender_tests executable.

For Cycles, this also bundles all the unit tests into one executable.

Ref T79958

Differential Revision: https://developer.blender.org/D8714
2020-09-17 12:29:19 +02:00
Brecht Van Lommel f9fcb25d52 CMake: clean up setting of platform specific linker flags
Set flags directly on the target, and use common function for all cases.
This refactoring helps with the next commit for test executables.

Ref D8714
2020-09-17 12:29:19 +02:00
Sybren A. Stüvel 0700c045bc Fix: re-do versioning code for FCurve extremes and Collection colors
Bump Blender subversion from 4 to 5, and re-execute some versioning code.

Because of a mistake in the versioning code (corrected in rB1a4fc6dcd67b),
some of the versioning code didn't run in certain cases. This subversion
bump ensures that this code is still run.
2020-09-17 12:02:05 +02:00
Sergey Sharybin 157cd6c6e8 Make deps: Compile own nasm for Linux
This solves annoyance that the official RPM repository of nasm requires
newer version of rpm tool compared to what is shipped by default with
centOS 7.

Differential Revision: https://developer.blender.org/D8905
2020-09-17 11:02:27 +02:00
Campbell Barton d377b1fe76 Cleanup: remove deprecated PyEval_InitThreads use
Deprecated in Python 3.7
2020-09-17 19:00:48 +10:00
Campbell Barton 76f99bd13a Fix T66256: Context overrides crash when operators change context
Using context overrides in Python caused problems for any operator that
changed the context and require these changes to be read back.

CTX_wm_area_set() for e.g. would set the struct member but future
calls to CTX_wm_area() would still return the value defined by Python
callers context overrides.

This also resolves a mismatch between polling and calling operators
from Python, where poll would override the Python context where calling
only overrode the context when a new context was passed in.
2020-09-17 18:53:00 +10:00
Campbell Barton f085ebba58 Cleanup: use doxy sections for blender.c 2020-09-17 15:34:10 +10:00
Campbell Barton 8e0fc27722 Cleanup: use static assert to disable access to preferences
Prefer this over an unknown identifier as it gives a useful error.
2020-09-17 15:24:58 +10:00
Hans Goudey 8dd5902e1e Cleanup: Use enum instead of defines for panel runtime flag
Discovered an unused panel runtime flag as well, which this commit
removes.
2020-09-16 23:47:09 -05:00
Campbell Barton 4b20eebb85 UI: only draw a single header in the header region
While this isn't an issue with the default configuration it's possible
to register extra header types for a single region.

In this case the first header-type to successfully poll is drawn
without drawing other header types.

This issue was raised by T60195.
2020-09-17 14:43:28 +10:00
Campbell Barton 3fb7e5df50 Cleanup: don't register dope-sheet header types
These are only used to hold static methods, there is no reason to
register them.
2020-09-17 14:43:28 +10:00
Hans Goudey 7a1c405bb4 Cleanup: Comment formatting in interface_panel.c
Also cleaned up some grammar and wording issues, and switched a case
in an if statement to remove a double negative.
2020-09-16 22:56:29 -05:00
Campbell Barton 971fe43d06 Fix T63651: ImagePreviewCollection.new,load don't work as documented
Update doc-strings, add note for why this decision was made.
2020-09-17 12:44:46 +10:00
Campbell Barton 70eb24a575 Cleanup: warning (missing-braces) 2020-09-17 11:59:51 +10:00
Hans Goudey 27660b3cd9 Fix: Text object custom profile bevel not written to file
The CurveProfile struct was only being written to the file for regular
curve objects. Caused by an incorrect merge of master before committing.
2020-09-16 16:05:17 -05:00
Clément Foucault 6ade522f27 Fix T79523 Paint Cursor: Wide line not supported on OSX
This replace the use of GPU_line_width by the specialized
GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR shader.
2020-09-16 20:27:32 +02:00
Clément Foucault 1fb7f36acb Fix T79315 Normals Overlays broken with hidden geometry
Was caused by non-initialized variables before a return inside
the vertex shader.
2020-09-16 20:17:03 +02:00
Hans Goudey 5cf6f5e66d Fix: Property search crashes searching enums with separators 2020-09-16 13:05:28 -05:00
Ankit Meel 6759b8a224 Cleanup: silence [-Wmissing-braces] warning.
Introduced in {rBd6525e8d133b787655bdb2c2fcef218591a457c3}

Compiler: Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
```
source/blender/draw/engines/image/image_shader.c:46:13: warning:
suggest braces around initialization of subobject [-Wmissing-braces]
} e_data = {0}; /* Engine data */
            ^
            {}
1 warning generated.
```

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D8873
2020-09-16 23:22:55 +05:30
Hans Goudey 60fa80de0b Curves: Add custom profile bevel support
This adds support for the same custom bevel profile widget used in
the bevel tool and modifier to the geometry generation for curves.

This is expecially useful for text and 2D curves with extrusion, as
it works much better than a weld & bevel modifier combination.
It can also be useful for adding quick detail to pipe-like objects.

The curve holds the CurveProfile struct and a new "Bevel Mode"
property decides which type of bevel to build, round, object, or
custom profile.

Although curves can already use another curve to make the bevel
geometry, this is a quicker way, and it also defines the profile of
just one corner of the bevel, so it isn't redundant. It's also nice
to have the same custom profile functionality wherever there is bevel.

Differential Revision: https://developer.blender.org/D8402
2020-09-16 10:20:38 -05:00