1
1

Compare commits

..

315 Commits

Author SHA1 Message Date
6a0f9cdbed make property spreadsheet a bit more generic 2021-03-05 13:55:21 +01:00
ea81fcbc96 show a custom property 2021-03-05 13:48:22 +01:00
8ff310861c cleanup 2021-03-05 13:36:51 +01:00
46194c68cf draw rna properties 2021-03-05 12:54:56 +01:00
a32bf199d4 support drawing ints 2021-03-05 11:38:50 +01:00
77136bd7b3 initial python spreadsheet 2021-03-05 11:35:56 +01:00
381e2d4dc2 Merge branch 'master' into temp-spreadsheet-editor 2021-03-05 10:22:39 +01:00
b5d154f400 Cleanup: move check_drag & check_click out of wmEvent
These variables track the wmWindow.event_queue state,
however they were used in a way that wasn't correct.

- check_drag & check_click from wmWindow.eventstate
  were used to track the click/drag status of events handled in
  wmWindow.event_queue.
- Event's in the queue read from wmEvent.check_drag.
- Once a drag action was detected, wmWindow.eventstate.check_drag
  was disabled.

Disabling drag in the event state would not change the drag state
for values already in the event queue.

Simplify logic by moving these values into the window,
so there is one place these variables are tracked.
2021-03-05 17:10:11 +11:00
663b0bb04c UI: minor changes to preset sorting
- Only sort by the preset name (not it's directory).
- Remove redundant string conversion.
- Only call lower() once on the input.
- Don't assign the lambda to a variable for single use.
2021-03-05 17:10:11 +11:00
511ff8b6b4 UI: Add Presets for high framerate video
It is quite common to high framerate video with modern cameras. To make
it easier to edit this footage new framerate presets are added and the
soft limit increased.

Note there is a bug with preset ordering, Blender thinks "120" goes
before "24" this bug needs to be fixed before these changes can be
merged.

Differential Revision: https://developer.blender.org/D10553
2021-03-04 23:22:47 -05:00
c2a8676544 Presets: Improve sort order of presets
Pythons sort function does not sort naturally,
to solve this a custom sort key is used.

This issue is apparent when trying D10553
2021-03-04 23:22:47 -05:00
78bd155f5c Cleanup: disambiguate 'queue' struct members
The term queue isn't very descruptive on it's own, use:

- wmWindow.event_queue
- wmWindowManager.notifier_queue
2021-03-05 14:59:38 +11:00
c2e73a1225 UI: save-preview tip now states that it's used for blend thumbnails 2021-03-05 14:44:39 +11:00
23dfcc5ac7 Cleanup: rename event to event_type
Reserve `event` for wmEvent.
2021-03-05 14:44:28 +11:00
aa86710242 Cleanup: spelling 2021-03-05 14:44:28 +11:00
b9833860e5 Cleanup: maintain include order without disabling clang format 2021-03-05 14:08:00 +11:00
e0ba6a4411 Cleanup: rename evt to event
Following naming convention of most operators.
2021-03-05 14:04:22 +11:00
59889d9b4f Cleanup: rename variables in wm_event_add_ghostevent
Using both evt and event together was confusing.

Renamed:

- event_state          <- evt
- event_state_other    <- oevt
- event_other          <- oevent
- win_other            <- owin
2021-03-05 14:03:54 +11:00
97fabc3c1c Fix T86185: Win32 Multiple Monitor Window Position
Because of D10469 we can now not force child windows onto parent's monitor and allow them to go where they wish.

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

Reviewed by Ray Molenkamp
2021-03-04 17:54:46 -08:00
Jacob Møller
57812c7e4f Windows/CLog: Support color logging on Win 10
Windows 10 supports V100 on all consoles given
you enable the ENABLE_VIRTUAL_TERMINAL_PROCESSING
flag for the console.

This patch enables color logging only on windows
10 and only if the log is not being redirected
to a file.

Differential Revision: https://developer.blender.org/D10546
2021-03-04 18:20:52 -07:00
6a662ffda8 GPencil: Implement Autokey button for Draw/Edit and Sculpt mode
Now, if the Autokey is not enabled, a new frame is not created and it is used the last active one. If no active frame, a message is displayed and the operation is canceled.

This is a common request for 2D artists.

Also, grease pencil was not working as Blender does in other areas.

Reviewed By: pepeland

Differential Revision: https://developer.blender.org/D10557
2021-03-04 21:32:37 +01:00
1668f883fb Fix T59376: UV project modifier not working after modifiers that dont provide a UVMap
This was reported for remesh and skin modifiers.
These dont preserve UV layers (and probably cannot in a reasonable way),
so instead let the UV Project modifier create a new (equally named) UV
layer (as was suggested by @brecht in T59376).

Maniphest Tasks: T59376

Differential Revision: https://developer.blender.org/D10617
2021-03-04 20:20:05 +01:00
63b7ff9f4e Cleanup: Main foreach ID code: Remove MAX_LIBARRAY and improve comments.
The `MAX_LIBARRAY` define was an annoying doublon to the `INDEX_ID_MAX` enum value
now defined in `DNA_ID.h`, and it is no more useful.

And comments were somewhat outdated. Also added an explanation about
chosen order for the `INDEX_ID_<IDTYPE>` order.
2021-03-04 18:43:30 +01:00
f951aa063f UI: prefer shorter search items in fuzzy search
This is a simple heuristic that seems to improve the search results in many cases.

Differential Revision: https://developer.blender.org/D10618
2021-03-04 18:39:31 +01:00
7d685391a0 Nodes: improve NodeTreeRef
This adds a couple more utility methods to various node tree ref types.
Also `InternalLinkRef` has been added to get simpler access to internal links.
2021-03-04 18:15:22 +01:00
bb1f02510b BLI: support mutable lookup from multi value map 2021-03-04 17:38:01 +01:00
Corbin Dunn
d09b874244 macOS/Ghost: Opt out of AppKit’s automatic window tabbing
Since Blender is single-tabbed, this will prevent extraneous
tab-related options from appearing in "Window" menu in case AppKit's
internals change.

Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10606
2021-03-04 21:53:27 +05:30
3de5fbba3a Fix T86050: use material count from correct data block
See comment in code for more details.

Differential Revision: https://developer.blender.org/D10615
2021-03-04 15:27:33 +01:00
a988099ee4 Fix T86172: tag relations update when pasting nodes
Pasting nodes can create new id relations, because nodes can reference IDs.
Therefore the depsgraph has to be updated when nodes are pasted.
We could somehow check if the pasted nodes referenced IDs, but I'm not sure
if this complexity is worth it.
2021-03-04 13:33:03 +01:00
386e3dd842 PyAPI: use methods for bpy.data.libraries.load & write
Replace static methods with regular methods.
Now the 'Main' value is taken from the collection.

Needed to support multiple 'Main' instances in Python, see T86183.
2021-03-04 23:13:07 +11:00
d9e567d365 PyAPI: support methods for collection properties
Previously only static methods were supported.

Now C/API functions added to collections can receive a 'self' argument.
2021-03-04 23:09:11 +11:00
7fd6c7f371 Fix T86204: support multiple group inputs in node group
Note that this still does not work when in the node group directly referenced
by the modifier, only in sub-node-groups. This limitation will be removed
at some point.
2021-03-04 12:50:23 +01:00
bda95ac0f9 Fix T86209: Preference Defaults "Relative Paths" tooltip could be improved.
This UserPref setting is only used when no path is set yet.
2021-03-04 12:20:10 +01:00
06d33a6876 Fix Saving startup file changing paths of the current file
Saving the startup file now uses "Save Copy", so paths are preserved.
2021-03-04 20:56:17 +11:00
9fffb78343 Fix T86231: Saving startup file always remaps relative 2021-03-04 20:52:03 +11:00
ef7efc3751 Tests: don't write thumbnails when running tests
Also replace WM_OT_read_factory_settings with WM_OT_read_homefile
so the preferences don't have to be reloaded.
2021-03-04 17:43:12 +11:00
753a2a34ce Cleanup: include '--open-last' in "Misc Options"
This was using fall-back category "Other Options"
which should be kept empty.
2021-03-04 17:43:11 +11:00
12b529b3a6 Cleanup: redundant struct declarations 2021-03-04 17:17:19 +11:00
2df2f1c908 Cleanup: use non-zero comparisons for event modifiers
Use event modifier checks that follow most of Blender's code.
2021-03-04 17:10:56 +11:00
abaa6c3ace Cleanup: use BM_mesh_copy_init_customdata utility function 2021-03-04 17:06:50 +11:00
be627ab9e2 Cleanup: comments 2021-03-04 17:00:42 +11:00
39b86a989d Cleanup: use const arrays 2021-03-04 16:58:03 +11:00
d10700a3ac Cleanup: number literals 2021-03-04 16:55:50 +11:00
24f0807550 Cleanup: replace Py_CLEAR with Py_DECREF in bpy.app modules
In this case, there is no benefit to using Py_CLEAR
as the value will never be NULL and can't be used later on.
2021-03-04 15:46:07 +11:00
a40ccde405 Fix logic for calling PyObject_GC_UnTrack
All tracked objects need a matching un-track,
also remove redundant Py_XDECREF call.
2021-03-04 15:18:10 +11:00
0d28e2a334 PyAPI: correct garbage collection for StructRNA types
By default objects are no longer GC tracked, this removes some overhead
although it's not significant in my own testing.

- Only enable GC for StructRNA when 'WITH_PYTHON_SAFETY' is on.
- Only track StructRNA when their 'reference' is set.
- Add missing NULL check when 'WITH_PYTHON_SAFETY' is on
  and objects new objects be created.
2021-03-04 15:18:10 +11:00
67856d8c4a macOS/GTests: add_dependencies to fix build error
When building `install`, linking blender_test fails because
test libraries do not exist. This happened on lite + Xcode. Error in
{rBdcb2821292f962951e88f146cb304160f21f73da}.

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D10607
2021-03-04 08:04:17 +05:30
e4a55b46c4 UI: Remove extra blank space for decorators in FCurve modifiers
None of these properties can be animated, so it doesn't make sense
to leave space for decorators on the right side of the panels. In fact
that is what was intended, but they were not manually disabled
in all of the panels.
2021-03-03 16:32:55 -06:00
b450d2d148 Fix T86042 EEVEE: incorrect irradiance bake
The environment (world) irradiance wasn't correctly skipped.
2021-03-03 23:14:06 +01:00
dd43a37016 Geometry Nodes: Allow clearing an attribute text field
Because pressing enter will choose the current search item from the menu,
and there was no search item with an empty string, it was impossible to
clear the text of an attribute text field. This commit adds a simple "X"
icon in the top row when you delete the string.
2021-03-03 13:48:39 -06:00
f53221bff7 UI: Allow translation for node error messages
This commit exposes the strings used in the node error messages for
localization. It also changes the message tooltip creation to
automatically add the period at the end, to be more consistent with
the (arguably bad) design of other tooltips in Blender.

Calling `TIP_` directly in the node implementation files allows us to
continue using `std::string` concatenation instead of passing variadic
arguments. It's also more explicit about which part of the message is
translated and which isn't. The files already include the translation
header anyway.
2021-03-03 12:58:33 -06:00
Corbin Dunn
93cdf461f3 macOS/Ghost: Remove redundant nil check after initWithContentRect
AppKit’s NSWindow.h has NS_ASSUME_NONNULL_BEGIN, and only methods/
properties explicitly marked nullable will ever return nil.

Reviewed By: #platform_macos, sebbas
Differential Revision: https://developer.blender.org/D10603
2021-03-03 21:26:09 +05:30
Corbin Dunn
87c949a3bd macOS/Ghost: Fix memory leak.
`new` allocates a new object that needs to be autoreleased.

Reviewed By: #platform_macos, sebbas, ankitm
Maniphest Tasks: T86222
Differential Revision: https://developer.blender.org/D10597
2021-03-03 21:25:20 +05:30
b9bb69a114 EEVEE: Avoid old files with too many volume shadow sample being too slow
This clamp the volumetric shadow samples to the actual old max to avoid
problematic slowdown after the bugfix rB3a29c19b2bff.
2021-03-03 15:20:35 +01:00
Mikhail
cd9a6a0f93 EEVEE: SSS: Fix light leaking bewteen object at different depths
The SSS shader in Eevee has the following drawbacks (elaborated in {T79933}):

1. Glowing
2. Ringing. On low SSS jittering it is rendered a bunch of sharp lines
3. Overall blurriness due to the nature of the effect
4. Shadows near occlusions as in T65849
5. Too much SSS near the edge and on highly-tilted surfaces

{F9438636}
{F9427302}

In the original shader code there was a depth correction factor, as far as I can understand for fixing light bleeding from one object to another. But it was scaled incorrectly. I modified its scale to depend on SSS scale*radius and made it independent from the scene scale. The scale parameter (`-4`) is chosen so that it makes tilted surfaces to have visually the same SSS radius as straight surfaces (surfaces with normal pointed directly to the camera).

This depth correction factor alone fixes all the problems except for ringing (pt. 2). Because of float-point precision errors and irradiance interpolation some samples near the border of an object might leak light, causing sparkly or dashed (because of aliasing) patterns around the highlights. Switching from `texture()` to `texelFetch()` fixes this problem and makes textures on renders visually sharper.

An alternative solution would be to detect object borders and somehow prevent samples from crossing it. This can be done by:
1. Adding an `object_id` texture. I think it requires much more code changing and makes the shader more complicated. Again, `object_id` is not interpolatable.
2. Watch gradient of depth and discard samples if the gradient is too big. This solution depends on scene scale and requires more texture lookups. Since SSS is usually a minor effect, it probably doesn't require that level of accuracy.

I haven't notice it in practice, but I assume it can make visible SSS radius slightly off (up to 0.5 px in screen space, which is negligible). It is completely mitigated with render sampling.

Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D9740
2021-03-03 14:57:25 +01:00
f746b568f3 EEVEE: SSR: Check reflection ray against geometric normal
This improve self intersection prevention. Also reduce the bias
that was making a lot of rays not being shoot at grazing angles.
2021-03-03 14:57:25 +01:00
1c22b551d0 EEVEE: Add ensure_valid_reflection to glossy closures
This is ported from Cycles and fixes issues with bump/normal mapping
giving weird reflections/lighting.

Fixes T81070 Specular light should be limited to normal pointing toward the camera
Fixes T78501 Normal mapping making specular artifact
2021-03-03 14:57:25 +01:00
87da26404f Fix compiler issues introduced in recent commit.
{73af762e9cd595ea708647c02c7e74752d844e80}
2021-03-03 13:42:28 +01:00
dcf7313e73 Cleanup: use zero_v3 to clear colors. 2021-03-03 12:37:52 +01:00
73af762e9c Cleanup: Make node_composite_cryptomatte CPP.
Core API of cryptomatte is also CPP.
2021-03-03 12:37:52 +01:00
cf6208382e Merge branch 'master' into temp-spreadsheet-editor 2021-03-03 12:36:51 +01:00
b837933b17 Cleanup: clang-tidy 2021-03-03 12:36:48 +01:00
3f716bb626 Cleanup: clang tidy
Warnings:
* readability-inconsistent-declaration-parameter-name
* readability-redundant-smartptr-get
2021-03-03 12:23:02 +01:00
7d2f27244c Cleanup: clang tidy
Can use const parameter.
2021-03-03 12:17:48 +01:00
e9c50913f8 Cleanup: clang tidy
Warning: else-after-return/break
2021-03-03 12:17:16 +01:00
b9ee877752 Cleanup: make format 2021-03-03 12:14:06 +01:00
a915e47ca1 Fix (unreported) Outliner missing updates copying IDs via python
Steps to reproduce:
- switch to Scripting workspace
- execute bpy.data.meshes['Cube'].copy()
- Outliner will not show the new mesh immediately

Now just send appropriate notifier.

Differential Revision: https://developer.blender.org/D10584
2021-03-03 08:53:13 +01:00
44ab908c86 Nodes: store references to bNodeLinks in NodeTreeRef
Sometimes it is useful to have this information available to be able
to read information from links.
2021-03-03 07:59:07 +01:00
4dd1068a57 Fix crash when dragging nodes
The `bNodeLinkDrag` struct was NULL when dragging a node instead of
a link. It is allocated with `calloc` anyway, so this field doesn't
need to be explitely cleared.
2021-03-02 22:53:25 -06:00
7fddf383b1 Cleanup: minor changes to Python RNA pointer assignment
Don't assign the BPy_StructRNA a value which can be 'None',
instead, set it to NULL.
2021-03-03 15:06:59 +11:00
023788ef9a Cleanup: Use span and float matrix type in direct boolean code
This commit includes a few simple improvements to the direct mesh
boolean code added recently.
 - Passing the transforms and meshes to `direct_mesh_boolean` as spans
   makes the function easier to call from C++.
 - The definition of `TransMat`, was unecessary when we have the
   `float4x4` type already used elsewhere in C++ code.

Differential Revision: https://developer.blender.org/D10592
2021-03-02 20:58:05 -06:00
a4f81c6838 Fix T85966: Wrong link picked when dragging multi-input socket
The socket drag operator stored the index of the last picked socket
into RNA in case the mouse cursor leaves the link while dragging.

This id was not unique which is why sometimes a link from an other node
with the same id is picked.

This patch changes the way the last picked link is stored and stores a
pointer to the link directly into bNodeLinkDrag struct instead.

Differential Revision: https://developer.blender.org/D10590
2021-03-02 23:13:59 +01:00
6aec6568a0 Cleanup: spelling, minor corrections
Also use doxygen comments for sculpt functions.
2021-03-03 06:20:27 +11:00
Patrick Busch
3eb8307160 Python API: Expose CurveMapping Reset View function
The Python API for the curve mapping widget offers the `update`
function, but no way to reset the view to the clipping rectangle.

This commit adds a blenkernel function for this operation,
and exposes it to the CurvMapping RNA API. This allows addons
to display a more user-friendly view of the data in this widget.

Differential Revision: https://developer.blender.org/D10561
2021-03-02 13:13:36 -06:00
85421c4fab Geometry Nodes: Attribute search drop-down
This commit adds a search for existing attributes when you click
on an attribute field. This is useful because otherwise you have
to remember which attributes should be available at each node in
the tree.

The fundamental complication is that this information is not
accessible statically. So the search data is only a cache from
the previous node tree evaluation. The information is added
with `BKE_nodetree_attribute_hint_add`, currently for every
input geometry socket for a single node.

This is only an initial implementation, and later versions will
expose the data type and domain of the attributes.

Differential Revision: https://developer.blender.org/D10519
2021-03-02 13:01:33 -06:00
a344f20346 UI: Rename search button variable
I landed D10527 in rB1a8aee0a7cec accidentally, and the version there was
missing a name change discussed in review. This commit just renames the
boolean variable controlling the special behavior for attribute search.

Original message meant for this change:
For geometry nodes we will use search buttons to display a list of
attributes available the last time the node tree was executed (D10519).
Because this list is just a hint, we need to be able to enter any string,
not just strings from the search items.

This patch adds a boolean option to string buttons to enable this.
The change is quite simple, changes to behavior are only required in
two places. The type-specific button struct changes help a lot here.

Differential Revision: https://developer.blender.org/D10527
2021-03-02 12:43:27 -06:00
81c770944c CMake/deps: Append platform CFLAGS and LDFLAGS to Python build to ensure compatibility with minimum macOS version
Similarly to other dependencies, the Python build should make use of the default CMake arguments. On macOS, for example, these arguments are required to set the deployment target correctly.

See also: https://devtalk.blender.org/t/compiling-latest-branch-on-macos-fails-undefined-symbol/17649

Reviewed By: brecht, sybren

Differential Revision: https://developer.blender.org/D10498
2021-03-02 19:08:26 +01:00
William Reynish
6471cf6bc8 UI: Clean up labels and descriptions: "Draw" to "Display"
In Blender, we used to use the term 'draw' to refer to information
displayed to the user. For version 2.80, it was decided to change these
instances to 'display' instead. This was to avoid the ambiguity between
end-user drawing tools and display options.

From the Oxford English Dictionary:
 - Draw: produce (a picture or diagram) by making lines and marks on
   paper with a pencil, pen, etc.
 - Display: show (data or an image) on a computer, television, or
   other screen.

Therefore, we should use draw when referring to drawing tools for
making marks, but use display when referring to information
shown/displayed to the user. From a user POV, the computer displays
certain information, whereas the user draws a mark.

Apparently this change was not implemented consistently, so this patch
changes all remaining relevant instances of "draw".

Differential Revision: https://developer.blender.org/D10551
2021-03-02 11:58:25 -06:00
1a8aee0a7c UI: Expose an "is first search" boolean to search button callbacks
Currently when you open an RNA collection search button, like a
vertex group selector, the search filter isn't applied until you
start typing, in order to display every option at the start.
Otherwise they wouldn't be visible, since the search filter would
run for the current text.

Currently this check happens in one place, but it relies on the
`changed` value of `uiBut`. This is fine in the interface directory,
but anywhere else it would require exposing `uiBut.changed`, which
is probably too low-level to expose.

The solution is adding an `is_first` argument to the search callbacks,
which is nice for a few reasons:
  - They work at a higher level of abstraction, meaning they don't
    have to worry about how exactly to tell if this is the first
    search.
  - It makes it easier to do special behavior when the search menu
    is first opened.
  - Then, obviously, it makes that state accessible without including
    `interface_intern.h`.

Needed for attribute search: T85658

Differential Revision: https://developer.blender.org/D10528
2021-03-02 11:42:05 -06:00
5a3b7c5329 Fix Node UI Storage Threading Issues
Since the same node tree can be used in modifiers on different objects,
there can be multiple threads writing to the maps in the node tree UI
storage at the same time. The additions for attribute name hints and
error messages made it so this would often cause a crash or at least
an ASAN report. This patch adds locks to prevent multiple threads
from using the maps concurrently.

In a brief test I actually didn't observe a crash without the global
`bNodeTree` UI storage mutex, but I think it's necessary for the change
to be correct, and I did notice some unfreed memory without it anyway.
Ideally it would be in a node tree runtime struct though.

Differential Revision: https://developer.blender.org/D10577
2021-03-02 11:08:36 -06:00
3a29c19b2b EEVEE: Fix incorrect volumetric light shadowing
The shadowing was computed on the light distance squared,
leaking to much light since it was integrating the extinction behind
the ligth itself.

Also bump the maximum shadow max step to the actual UI values. Otherwise
we get shadowing under evaluated because `dd` is too small.
2021-03-02 18:00:02 +01:00
3d7a00b8aa Fix (unreported) light cache bake crash
missing NULL check if there is no cache there to begin with.

Differential Revision: https://developer.blender.org/D10581
2021-03-02 17:54:45 +01:00
9c604ab0ca Fix Fuild error with lite build
With audaspace disabled, function SEQ_add_sound_strip was declared as prototype.
2021-03-02 17:47:21 +01:00
82e7032477 Sculpt: Expand Operator
Expand is a new operator for Sculpt Mode which is intended to be the main
tool for masking, Face Set editing, interacting with the filters and pattern
creation.

The fundamentals of the tool are similar to the previous sculpt.mask_expand
operator. It shares the same default shortcuts and functionality, making
the previous operator obsolete.

The shortcuts to execute the operator are:
- Shift + A: Expand mask
- Shift + Alt + A: Expand mask by normals
- Shift + W: Expand Face Set
- Shift + Alt + W: Resize current Face Set

The main changes compared to the previous sculpt.mask_expand operator are:
- Modal keymap, all operator options can be changed in real time while the
operator is running.
- Supports creating Mask, Face Sets and Sculpt Vertex Colors.
- Much better code, new features can be easily integrated.

Limitations:
- All Mask operations are supported for Sculpt Vertex colors, but not exposed
by default as their support is still experimental.
- Dyntopo does not support any Face Set or Sculpt Vertex Colors. functionality
 (they are not implemented in general for Dyntopo).
- Multires does not support any feature related to geodesic distances.
- Multires does not support vertex colors.
- Multires does not support recursions.
- In Multires, Face Sets snaping does not initialize all current enabled Face
Sets when toggling snapping.
- In Multires, Face Sets are created at base mesh level (works by this by
 design, like any other tool).
- Unlike the previous mask_expand operator, this one does not blur the mask
by default after finishing Expand as that does not fit the new design.
The mask can still be blurred by using the mask filter manually.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10455
2021-03-02 16:53:56 +01:00
7f36498740 Fix T86026: Crash Opening Cryptomatte File.
Not sure this fixes the root cause. It seems that memory corruption
happens in dynstr. This patch replaces dynstr with a streamstring.
2021-03-02 16:21:31 +01:00
b3886c1f2a Fix crash on NULL dereference
Caused by e1f3996d74, `seq_update_meta_disp_range()` did not check if
sequencer data exists.
2021-03-02 15:21:09 +01:00
ca2044f72b Fix T86122: Performance Debug View Viewport Not Working
The performance debug menu isn't used that often anymore as render doc
also show the timings. This patch will make sure that enabling the
performance debug view (21) does not crash blender.
2021-03-02 14:27:52 +01:00
fece538e3d Cleanup: remove unused arguments 2021-03-02 14:21:30 +01:00
8d6a79ffc2 Fix error in rBb9e1cc931ee9
Bad copy paste...
2021-03-02 14:11:16 +01:00
b9e1cc931e Fix T86138 EEVEE: Bake Indirect Lighting crash in 2.93 with older files
This was caused by a missing version check.
2021-03-02 13:56:24 +01:00
f094b4fa08 Fix T86172: check if attribute is actually accessible
The crash happened when the density in the Point Distribute node was
above zero but so small, that no point was generated. In this case, there
was a point cloud component, but the point cloud was empty, making some
attributes unavailable.

One could also make more attributes available in this case, but that can
be done separately if necessary.
2021-03-02 13:29:35 +01:00
1e7d8a4ad5 EEVEE: Depth of field: Do not shrink highlights when using overblur
This fixes the issue of bokeh size being smaller when using overblur.

The additional overblur needs to be centered on the outer radius.
2021-03-02 13:08:57 +01:00
e1f3996d74 VSE: Refactor meta operators
Move low level logic to module code and versioning logic to versioning code.

Metas strip position was handled in diffrent way compared to other strips.
This was introduced in c8b0d25794 as bugfix for T28158.
I disagree with such design. Meta strips should be handled in same way as
any other strips.

I have tested this change and haven't found any problems.
No problems after checking T28158 as well.
There should be no functional changes on user level.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9972
2021-03-02 12:54:45 +01:00
b3005bf688 Fix T85981, part II: bone's custom shape disappear on undo in some cases.
Nicely hidden bug in pose read library code, it was using the library
from the wrong ID as reference to relink the custom shape object pointer
(pose is data from Object, not Armature).
2021-03-02 12:41:03 +01:00
3059c0b386 Fix T85970: Incorrect scaling of meta strips
This is same issue as fixed by d857892553, but I forgot to check meta
strips. Meta strip output is always in render size.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10560
2021-03-02 12:23:04 +01:00
88604b79b7 FFmpeg: Improve scrubbing performance
Applying negative offset to seek position before scanning doesnn't have
any effect. This change results in 1.5x faster seeking (random frame,
average value) in sample file with 30 frame GOP length.

If I am not mistaken, B frames can have pts that can be less than
pts of I frame that must be decoded. Even in this case though, B frame
packet will be stored after that I frame.

In addition, preseek value is de facto hardcoded so seeking would fail
if it could. This can be hard to spot though.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D10529
2021-03-02 12:23:04 +01:00
bbb1936411 VSE: Refactor VSE strip loading code
Isolate RNA and operator logic from functions that create strips.
 - Operator specific code was removed from `SeqLoadInfo` structure and
   `SEQ_add_*` functions.
 - Strip loading code was removed from RNA and operator functions.
 - `SEQ_add_*` API was unified to work on `SeqLoadData` struct.
   Only exception is image strip, which require files to be loaded
   separately to strip creation itself. This is not ideal, but I think
   it's acceptable.
 - Some functions and variables were refactored so the code reads
   better.

There are minor functional changes (coincidental bugfixes):
 - Operator errors are reported per-strip. Previously they were not
   reported at all?
 - `new_sound()` RNA API function now create sound with length of 1
   if source file does not exist. Previously it created strip with
   length of 0.
 - Replace selection operator property wasn't working correctly.
   Fixed in this patch.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9760
2021-03-02 12:23:04 +01:00
b279fef85d Geometry Nodes: show "Show Texture in texture tab" button
This enables the quick access button [to show the relevant Texture in
the Properties Editor] for textures used in geometry nodes.

This goes in line to what we do for other textures:
- modifier textures have this button
- particle textures have this button
- brush textures will soon have it, too (see D9813)

When outside of the Properties Editor, the button will always show (if a
texture is actually assigned), but will be inactive if no suiting
Properties Editor to show the texture in can be found.

Note this also changes the behavior to not show the button if _no_
texture is assigned (as in: we are still showing the "New" button).
Previously it was always there (e.g. for modifier textures), even if it
would take us to an empty texture tab. (Sure, we could add a texture
there then, but imho it makes more sense to just start showing it once a
texture is already there)

For this to work with geometry nodes, the following chages were done:
- implement foreachTexLink for geonode modifiers
- new buttons_texture_user_node_property_add() that stores prop as well
as node
- also use NODE_ACTIVE_TEXTURE flag in geometry nodetrees

notes:
- this still uses the first suiting (as in: pinning does not interfere)
Properties Editor it finds, this should (maybe?) find the _closest_
Property Editor instead (see related feedback in D9813).
- this will already show the button for brush textures as well
(disabled), but there is another mandatory change in an upcomming commit
to make it work there as well (see D9813)

ref. T85278

Maniphest Tasks: T85278

Differential Revision: https://developer.blender.org/D10293
2021-03-02 12:08:44 +01:00
3ca094651b cleanup 2021-03-02 12:00:25 +01:00
ad8238cb51 improve comment 2021-03-02 11:55:59 +01:00
9c58324b78 make naming more consistent 2021-03-02 11:55:14 +01:00
00f27a8568 Cleanup: RNA: Remove useless setter of PoseBone's custom shape.
If the property is properly tagged, RNA knows how to deal with ID
usercount by itself, no need of a custom setter callback for that.
2021-03-02 11:54:25 +01:00
f78dd85077 update editor on mode change 2021-03-02 11:49:55 +01:00
8ce62fedd8 make title row a bit thinner 2021-03-02 11:49:15 +01:00
Jeroen Bakker
2d4b638a67 Cryptomatte: Read metadata from multilayer OpenEXR.
Currently the compositor reads cryptomatte meta-data from the render
result. When loading a multilayer open exr file the meta-data was ignored.
This patch will also load the cryptomatte meta-data from multilayer open
exr files.

This enabled workflows where the rendering and compositing are done in
separate scenes or for future changes where the cryptomatte node will
use the meta-data for name matching and color picking.

Reviewed By: Sergey Sharybin

Differential Revision: https://developer.blender.org/D10384
2021-03-02 11:20:01 +01:00
fba3d696ee fix ensure bmesh table 2021-03-02 11:18:42 +01:00
ea0bfde339 Merge branch 'master' into temp-spreadsheet-editor 2021-03-02 10:57:27 +01:00
8dec6452f2 Cryptomatte: Session from Existing Render Result.
Utility to construct a cryptomatte session from a render result or
openexr file. This will allow D3959 to be more aware of the context
it is working on and would also support external render engines in
the cryptomatte color picker.
2021-03-02 10:14:10 +01:00
c4ef90f5a0 Fix click-drag regression in fix for T86116
1638af109e &
bfc70a6a95
caused a regression with click-drag (not tweak which has it's own logic).

Restore some changes from these commits with added comments.

Minor changes from previous functionality from
39919e3532.

- `prevval` & `prevtype` are now set for all kinds of new events
  in the queue previously this was not done for some kinds of events
  (mouse wheel, ndof - for example).

- Set `prevval` & `prevtype` for other windows for mouse buttons.
2021-03-02 18:40:15 +11:00
ae96db0cf5 WM: log errors when wmWindow.eventstate values are invalid
Ensure they're working as documented (only for debug builds).
2021-03-02 17:02:57 +11:00
f8415261a6 WM: window.event_simulate now sets previous values properly
Match wm_event_add_ghostevent behavior for setting previous values.
2021-03-02 17:02:55 +11:00
bf1ee49e20 WM: use wmEvent.is_repeat instead of previous event checks
This check was added before is_repeat was supported, use this variable
instead since it's more a more reliable way of detecting held keys.

Also remove outdated comment.
2021-03-02 17:02:54 +11:00
92dac21e6b Docs: notes on wmEvent previous state struct member use 2021-03-02 17:02:54 +11:00
7093e8b40a Cleanup: remove Python 2.x support from complete_calltip 2021-03-02 17:02:52 +11:00
8f2c3c63e9 Fix build error after last commit 2021-03-01 15:45:06 -06:00
3084f6a8e0 Cleanup: Rename node UI storage function
"ensure" makes more sense in this case because the function actually
adds an item to the map if one doesn't exist yet.
2021-03-01 15:43:40 -06:00
Germano Cavalcante
6c6b1c015c GPU Python: Implement gpu.texture.from_image
It can be useful to replace `image.bindcode` and `image.gl_load`.

Used for example in https://docs.blender.org/api/current/gpu.html#d-image

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10458
2021-03-01 17:38:57 -03:00
f39143bc2e CMake: reduce Neon related output on Intel platforms
* Only try to find sse2neon if Neon detected
* Only run Neon support test once
2021-03-01 19:43:54 +01:00
77bc5510a9 Cleanup: rename some animation-related functions
Rename:
- `BKE_animsys_store_rna_setting` → `BKE_animsys_rna_path_resolve`
- `BKE_animsys_read_rna_setting` → `BKE_animsys_read_from_rna_path`
- `BKE_animsys_write_rna_setting` → `BKE_animsys_write_to_rna_path`

The concept of "RNA setting" is unclear; the new names reflect better
what the functions actually do.

No functional changes.
2021-03-01 18:44:26 +01:00
4cc04beb77 Fix T85981: Undo on linked rig with overrides loses custom shapes.
While generally speaking bone shapes objects should not be overridden,
it can happens in some cases, and should be properly supported then.
2021-03-01 18:25:35 +01:00
03ab698921 Cleanup: refactor BKE_animsys_store_rna_setting()
Lower the cognitive complexity of `BKE_animsys_store_rna_setting()` by
flipping conditions and using early returns.

No functional changes.
2021-03-01 18:18:20 +01:00
7ab29c748a header listeners 2021-03-01 18:18:14 +01:00
fdbc54ca74 Cleanup: remove superfluous animsys_evaluate_action_ex() call
Remove `animsys_evaluate_action()` and rename
`animsys_evaluate_action_ex()` to it. The only function of the former
was to call the latter, with the exact same parameters.

No functional changes.
2021-03-01 17:37:46 +01:00
be36c4d37d initial listeners for main region 2021-03-01 16:59:04 +01:00
aeb7bc5beb GLog: Lower default logging severity to INFO
Before this change messages of ERROR and above were printed.
This change makes it so LOG(INFO), LOG(WARNING), LOG(ERROR)
and LOG(FATAL) will be printed to the console by default
(without --debug-libmv and --debug-cycles).

On a user level nothing is changed because neither INFO nor
WARNING severity are used in our codebase. For developers this
change allows to use LOG(INFO) to print relevant for debugging
information. Bering able to see WARNING messages is also nice,
since those are not related to debugging, but are about some
detected "bad" state.

After this change the LOG(INFO) is really treated as a printf.
Why not to use printf to begin with? Because it is often more
annoying to print non-scalar types. Why not to use cout? Just
a convenience, so that all type of logging is handled in the
same way. When one is familiar with Glog used in the area, it
is easy to use same utilities during development. Also, it is
easy to change LOG(INFO) to VLOG(2) when development is done
and one wants to keep the log print but make it only appear
when using special verbosity flags.

The initial reason why default severity was set to maximum
possible value is because of misuse of VLOG with verbosity
level 0, which is the same as LOG(INFO). This is also why
back in the days --debug-libmv was introduced.

Now there is some redundancy between --debug-libmv, --debug-cyles
and --verbose, but changes in their meaning will cause user
level side effects.

Differential Revision: https://developer.blender.org/D10513
2021-03-01 16:56:34 +01:00
ea95ea644a Libmv: Avoid use of LOG(INFO) in solver
Usage of LOG(INFO) actually went against own guidelines in the
logging.h: the INFO is for messages which are to be printed
regardless of debug/verbosity settings.
2021-03-01 16:54:14 +01:00
61b3870981 Cryptomatte: Flexible Definition of CryptomatteLayers.
Cryptomatte layers in Blender are predefined. Other render engines
might have other naming schemes. This patch will allow creation of
cryptomatte layers with other names. This will be used by D3959 to
load cryptomatte openexr files from other render engines.

EEVEE and Cycles still use our fix naming scheme so no changes are
detectable by users.
2021-03-01 16:37:42 +01:00
1d9092f632 Fix Crash: Access Unallocated Memory. 2021-03-01 16:37:42 +01:00
6b20ccb753 Cleanup: Missing const keyword. 2021-03-01 16:37:42 +01:00
82dccff809 Cleanup: Mention Correct Types In Comments 2021-03-01 16:37:42 +01:00
5da418d4e6 Fix Cycles build error without Embree on Windows
Don't use ssize_t, it's not available in MSVC.
2021-03-01 16:33:31 +01:00
f4a9883294 UI: Correct output attribute name in proximity node
I made an incorrect comment in patch review that "Location"
should be used instead of position. "Position" is more appropriate
here since it refers to generic data rather than an object origin.
"Position" is also the name we chose for the attribute for this reason.
2021-03-01 09:32:48 -06:00
b35a3933ee Build-system: Use C-linkage for internal interface header
That way the header can be included in C++ files.
2021-03-01 16:30:51 +01:00
Christoph Lendenfeld
fdb2c24c09 Cleanup: move some drawing code into ed_draw.c
Move some drawing code from `area.c` and `ed_util.c`  into `ed_draw.c`.
This is to support the new generic slider that wil be used in T81785.

No functional changes.

Reviewed By: #animation_rigging, #user_interface, Severin, sybren

Maniphest Tasks: T81785

Differential Revision: https://developer.blender.org/D9313
2021-03-01 16:23:15 +01:00
c5bf114d78 add theme for spreadsheet editor 2021-03-01 16:10:29 +01:00
51c844d69b cleanup includes 2021-03-01 15:46:01 +01:00
3649b5b6df Add --open-last CLI argument that opens the most recent file
Add a CLI argument `--open-last` that opens the most recent file,
effectively doing the same as {key Ctrl Shift O}, {key Enter} after
starting Blender.

When there are no known recent files, print a warning and do nothing,
showing the startup file instead.

Note that this does not try to be smart about restoring the last Blender
session. It just opens the file from disk, as if the user had typed
`blender $(head -n1 ~/.config/blender/2.93/config/recent-files.txt)`.

There is also no smartness when that file cannot be opened; it behaves
exactly the same as typing the most recent filename on the CLI.

Reviewed by: mont29, campbellbarton

Differential Revision: https://developer.blender.org/D10563
2021-03-01 14:37:33 +01:00
e0ef38f3ac Spreadsheet: New spreadsheet editor (WIP).
Differential Revision: https://developer.blender.org/D10566
2021-03-01 13:49:18 +01:00
e06f5f64ae Cleanup: Use LISTBASE_FOREACH and LISTBASE_FOREACH_MUTABLE macro 2021-03-01 09:35:27 -03:00
4b3dcd8069 CMake/deps: Added new macOS arm64 build dependency to instructions
macOS arm64 has extra requirements.
2021-03-01 13:08:01 +01:00
e81034f75d Harden checks in datatoc_icon binary
The goal of the change is to perform check for attempts of icons
being overwritten on canvas. The check is based on checking original
coordinate of icons against all read icons. If there are two icon
files which have same original an error will be reported. The report
includes both file names to make it easier to troubleshoot.

This change will allow to early-on catch issues which we currently
have with the release environment: official Linux builds might have
different icon from Blender compiled locally. This is because the
order in which directory listing is traversed is not defined, so
it's like a race condition between two files to win the place in
the final canvas.

There is still possible improvement in the code to move more fields
into the context structure. This is beyond of goal of this change.

Note that before committing this change icons must be brought back
to their consistent state. Otherwise the build will fail.

Differential Revision: https://developer.blender.org/D9715
2021-03-01 12:00:32 +01:00
9def00a8ca Work around T86015: Crash undoing in certain scenario (disabling Global Undo).
Simply disable advanced 're-use current blend data` process when loading
a memfile step and Global Undo is disabled, since there is no way to
ensure we have a proper 'differential' state in the stack then.

NOTE: this is a quick work-around to fix the crash, not a satisfying
solution by far (pretty sure there can still be crashes if you then
re-enable Global Undo afterwards e.g.).
2021-03-01 11:27:24 +01:00
ca63729a5b Fix T86087: Assert when changing compositor node value or invoking tooltip.
Regression from rBde25b79ff5c4, this flag is inconsistent currently for
embedded IDs, needs to be sorted out, see T86119.
2021-03-01 10:59:07 +01:00
8451fa3125 Merge branch 'master' into temp-spreadsheet-editor 2021-03-01 10:29:34 +01:00
71ed6f32d2 Fix T84658: Anisotropic BSDF - most modes not using Screen Space
Reflection

Anisotropic is not really supported in Eevee, but since code looks like
it is just intended to make it behave like glossy, it should function
like it too.

Seems like the internal calling from `node_bsdf_glossy` from
`node_bsdf_anisotropic` has swapped arguments.
Also: ssr_id is available for SH_NODE_BSDF_ANISOTROPIC as well (see
`ntree_tag_bsdf_cb`), so why not use it?

Maniphest Tasks: T84658

Differential Revision: https://developer.blender.org/D10547
2021-03-01 09:04:07 +01:00
bfc70a6a95 Fix T86116: Failure to detect click events with modifier held
Click detection logic relied on the event queue not accumulating events
as newly added events at the end of the queue adjusted
`wm->eventstate->prev{val/type}` which was then compared with events
at the front of the queue.

This made Ctrl-Click fail to detect the click as releasing Ctrl
set the previous value before the previous event was handled.

In practice this only happened in heavy scenes,
updating 10 fps or lower. It also made automated tests fail that
accumulate events before handling them.
2021-03-01 17:12:46 +11:00
d8b35219d1 WM: set previous values for events in the event queue
This makes event's prevval and prevtype usable for events in the queue.

Previously they were unused, except as a hack for modal keymap handling.

This is needed to fix T86116, where the `wm->eventstate->prev{val/type}`
are set to values from events that have not been processed.
2021-03-01 16:54:59 +11:00
8da58dc85b WM: prevent model keymap handling overwriting previous event values
`wmEvent.prevtype` & `wmEvent.prevval` were overwritten
when used in modal keymaps.

Now they are restored to their original values.
2021-03-01 16:54:59 +11:00
6de41bed2f Cleanup: move logic to copy the previous event state to a function 2021-03-01 16:54:52 +11:00
72d1545ec2 Cleanup: minor change to click detection checks
Change order of checks for more convenient click-detection debugging.
2021-03-01 12:21:57 +11:00
1638af109e WM: don't set event prevval/prevtype on cursor motion
Currently the intended behavior regarding prevval/prevtype isn't
handled consistently. However, including cursor motion causes events
in `wm->queue` and `wm->eventstate` to behave differently,
where `wm->eventstate` ignores motion (necessary for click detection).

This makes checks from `wm->eventstate` to events in the queue fail.

This reverts 39919e3532,
using the `event.type` instead of it's previous type.
This works as it includes mouse button release events.
2021-03-01 12:00:29 +11:00
fc08fe82ae Cleanup: spelling 2021-03-01 11:00:22 +11:00
fbba239e3a Fix T86082 Bevel messed up UVs on some multisegment bevels.
When polygons around a bevel are rebuilt, sometimes UVs are merged
around a new vertex in the case of the face opposite a single edge
being beveled on a 3-edge vertex. This should not have been done
if any of the edges at that vertex were a seam.
2021-02-28 11:33:25 -05:00
f3d60c68ef Fix T85948 Exact boolean crash with some nonplanar ngons.
Triangulating ngons could fail with the method that was being
used: projecting along the dominant normal axis and then using CDT.
It could fail if the ngon has self crossings or might be so after
the described projection.
Switched to using projection along the normal itself, and also to
using polyfill which produces some kind of triangulation no matter
what in such circumstances. This will also likely be faster if
there are a lot of ngons in the meshes, since the exact arithmetic
CDT was being used before, and now float arithmetic is used.
2021-02-27 18:51:48 -05:00
92743cc895 Fix T85886: Rotate Tool and Adjust Last Operation - angles inverted
The constraint was not set when redoing.

This commit also removes `postInputRotation`. I really couldn't see a use for it.
2021-02-27 17:22:47 -03:00
aad2f1510a Fix T86028: Crash when loading file with missing libraries.
Regression from rB53d13b6f5387c68.
2021-02-27 13:12:07 +01:00
28f0a4b27e Fix (unreported) broken OCIO from install_deps.
Looks like they removed static libs by default in OCIO 2.0, for some
historical reasons `install_deps` was enforcing using only static libs
for this one, now removed it so that Blender buil can use usual so's.
2021-02-27 13:12:07 +01:00
4b16cb1e9a Fix T85987: Selection when GP is parented
When a GP object was parented to e.g. a bone, box selection as well as
point selection were broken in that the selection from the user would
not correlate with what was actually being selected.

The issue was that box and point selection did not use the active
evaluated stroke data. The fix uses the correct data.

Reviewed By: antoniov

Maniphest Tasks: T85987

Differential Revision: https://developer.blender.org/D10555
2021-02-27 13:08:46 +01:00
e3c11b36da Fix error converting simulated events press/release to clicks
Move logic that sets previous event state into WM_event_add_simulate.
2021-02-27 22:05:01 +11:00
9cfb320208 RNA: add Region.data member to access RegionView3D
Without this, the RegionView3D could only be accessed from
`context.region_data`, not the region.
2021-02-27 16:30:07 +11:00
Victor-Louis De Gusseme
f7933d0744 Geometry Nodes: Add "Location" output to Attribute Proximity node
This patch adds an output field to the Attribute Proximity node and
renames the existing string socket from "Result" to "Distance".
  - The "Distance" output contains distance to the closest position
    on the Target geometry.
  - The new "Location" output contains the coordinates of the closest
    position on the Target geometry.

A basic use case for this data is a simple shrinkwrap operation.

Differential Revision: https://developer.blender.org/D10415
2021-02-26 15:23:09 -06:00
e00a87163c CMake/deps: Adjust OSL shader directory
The location of the shaders changed with OSL 1.11.10. This commit is therefore in addition to D10212.

@sybren With the latest SVN libraries, I am fairly certain there is a "OSL not found" in the CMake output. Can you check on Linux?

@LazyDodo Since you haven't pushed the new OSL libs yet, this should not be a problem on Windows. So this will only be needed whenever those land.

Reviewed By: LazyDodo

Differential Revision: https://developer.blender.org/D10552
2021-02-26 21:35:54 +01:00
5c6cd5f8cd Cleanup: unused class member 2021-02-26 20:57:24 +01:00
c0d8a14ae3 Fix crash with dyntopo on tools that use cached vertex info
Tools can cache data related to the mesh topology for later use. This
data is indexed by vertex index, so it will be invalid after dyntopo
changes the topology during the stroke.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10550
2021-02-26 19:27:56 +01:00
fb7751f3e6 CMake/deps: Fix LLVM and OSL builds
This commit is addition to D10212. Apple arm64 support was left out in that patch.
2021-02-26 17:38:14 +01:00
cd388ef2f1 Fix (unreported) missing 3DView update after some Outliner Override operations. 2021-02-26 17:15:03 +01:00
c0b8a767b4 enable view2d buttons keymap
This mainly activates the page up/down keys.
2021-02-26 16:48:33 +01:00
b2eb674731 Cleanup: Use find_first_not_of. 2021-02-26 16:32:53 +01:00
cb8dd9905a initial support for rows for selected vertices 2021-02-26 16:23:43 +01:00
6ccfb9e0ea Fix: Compile issue Windows. 2021-02-26 15:36:04 +01:00
87ace46827 Cryptomatte: Manifest Parsing.
This patch adds manifest parsing to Cryptomatte. Normally when loading
cryptomatte layer from an OpenEXR file the manifest contains data to
convert a hash to its original name of the object/material. In the
future we want to use this to support lookup of cryptomatte
hashes and show it to the user.

Currently this logic isn't available to users (for now), but is required
by D3959 where a new cryptomatte workflow is implemented.
2021-02-26 14:13:15 +01:00
c489bb7c01 GPencil: Cancel Fill if the filled area is not closed
Fill only if it never comes in contact with an edge. It is better not to fill than to fill the entire area, as this is confusing for the artist.

Differential Revision: https://developer.blender.org/D10536
2021-02-26 13:25:06 +01:00
17534e28ff Assets: Preview rendering for Action datablocks
Render previews for Action datablocks by rendering the scene camera with
the Workbench (solid) engine. The //look// can be configured by setting
the scene's render engine to Workbench and editing the scene's shading
properties.

It is assumed that the pose has already been applied and that the scene
camera is capturing the pose. In other words, the render function just
renders from the scene camera without evaluating/applying the Action
stored in `preview->id`. The ID is only used to determine its type and
to store the resulting preview.

Not all code paths that lead to the `action_preview_render()` function
actually provide a depsgraph. The "Refresh Asset Preview" button
(`ED_OT_lib_id_generate_preview`) does, but `WM_OT_previews_ensure` does
not.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D10543
2021-02-26 12:44:08 +01:00
e1a541c689 CMake/Deps: Python 3.9.2
Straight up minor version bump, no anomalies to report

Reviewed By: sebbas, sybren

Differential Revision: https://developer.blender.org/D10523
2021-02-26 12:25:45 +01:00
53d13b6f53 UX: Readfile: Libraries error messages: avoid wall of warnings.
When a lot of libraries or linked IDs were missing/not found when
loading a .blend file, Blender used to show one warning report for each
missing item, potentially covering the user's screen with a giant
unuable popup.

Now it will instead generate a single warning with amount of missing lib
files and linked IDs. Each missing item is still reported individually,
but only as `INFO`, so it will still show up in the console or Info editor.
2021-02-26 11:59:14 +01:00
4df7e6047b use new spreadsheet icon 2021-02-26 11:44:57 +01:00
b2774b03b9 Merge branch 'master' into temp-spreadsheet-editor 2021-02-26 11:39:31 +01:00
72ceab8ab2 Cleanup: use early exit 2021-02-26 16:59:26 +11:00
7cb55a79d8 Cleanup: use boolean arguments 2021-02-26 16:55:58 +11:00
9059ee81ef Fix particle-edit crash on undo/redo
Undo/redo was crashing & asserting.

There ware two bugs:

- Entering particle system edit-mode requires an evaluated depsgraph.

- The active object could get out of sync when undo/redo
  moves between different modes.

The new test 'view3d_mesh_particle_edit_mode_simple'
in `tests/ui_simulate/test_undo.py` exposes both issues.
2021-02-26 16:32:49 +11:00
b7939a059f Undo: use low level API calls to enable font edit-mode
While I couldn't redo a bug in this case, it's possible for the
active object to become out of sync in rare cases,
so best use these functions.
2021-02-26 16:31:11 +11:00
0c9607312f Undo: don't log an error when the undo limit has been exceeded 2021-02-26 16:31:11 +11:00
c402cfa308 Cleanup: move comment into function doc-string 2021-02-26 16:31:11 +11:00
c67b03b810 Cleanup: Clang Format 2021-02-25 20:31:55 -05:00
81e795e7f0 Fix T84953: Incorrect tooltip for dragging collections
"Shift to parent" does not make any sense for collections since they
don't have parenting like objects. This commit just adds a simple check
for whether the first drag ID is an object before displaying
that part of the message.

Differential Revision: https://developer.blender.org/D10203
2021-02-25 19:23:19 -06:00
b1b9671c93 Cleanup: commented/out of date rpdb2 import 2021-02-25 18:27:57 -05:00
fbb0017c90 PyAPI Docs: Update Sphinx to 3.5.1 2021-02-25 17:51:48 -05:00
57c41a9c63 Icons: Add icon for the upcoming spreadsheet editor
The editor is being worked on by the geometry nodes team.
Icon created by Andrzej Ambroz (jendrzych).

Addresses https://developer.blender.org/T85925.
2021-02-25 18:09:00 +01:00
16504ed4a2 Icons: Update blender_icons.svg to have a document background
When opening the SVG you wouldn't even see the icons, since they are all white
now. You'd always have to set up a document background color and make sure to
undo that again before saving the file, so it's not written into it.
Just make everyone's life easier by saving the file with a proper background
(gray with checkerboard).
2021-02-25 18:09:00 +01:00
1981f04b0f Icons: Resaved blender_icons.svg in new Inkscape version
Inkscape often does a number of unrelated changes when saving an SVG, not sure
if these are just formatting changes in the source SVG text or if there's more
to it. Either way this makes adding new icons hard since you want to avoid
these unrelated changes. Saving the file in a new Inkscape version every once
in a while should mitigate the problem a bit.
Regenerating the icons (e.g. through `make icons`) shows no difference in the
output.

Note that I also ran "Clean Up Document" in Inkscape, but that doesn't seem to
have changed anything/much.
2021-02-25 18:09:00 +01:00
2718ea80d2 Improve Purge operator.
The Purge operator to remove unused IDs can now also remove 'indirectly
unused' data-blocks (those only used by unused ones, recursively).

It can also now only operate on linked, or on local data.

All those options are exposed in the `File -> Cleanup` main menu.

The behavior of the `Purge` button in the Outliner remains unchanged,
needs some UI/UX design task for that.
2021-02-25 17:48:54 +01:00
ec4d412c9c Py API: update bpy.data.orphans_purge to support new options.
This API function can now purge recursively in a single call, and choose
to ignore (not purge) local or linked IDs.

Default behavior (with not argument) remains unchanged, so no API
breackage here.
2021-02-25 17:48:54 +01:00
1df6cd67a1 Fix (unreported) bad usercount handling in batch ID deletion.
This was rather obscure and non-critical issue, but in some cases ID
usercount of some deleted IDs from batch-deletion code would not be
properly nullified, which would then assert later in actual deletion
code.
2021-02-25 17:48:54 +01:00
b958a59c79 BKE_lib_query: Add a function to detect and tag all unused IDs.
With the option to detect orphaned data recursively (i.e. if ID `a` is the
only user of ID `b`, and ID `a` is unused, ID `b` will also get tagged
as unused).

To be used by the Purge operation.
2021-02-25 17:48:54 +01:00
6daff9a08e UI: Fix icon width and padding in search menus
Previously the padding size and the width saved for the icon were
constant regardless of the zoom level. This resulted in overlapping
icons and text, and ugly padding with more extreme zoom levels.
We can retrieve the size of the row from the `rect` argument.
2021-02-25 10:28:39 -06:00
81d4e4d35e split spreadsheet editor code into multiple files 2021-02-25 17:20:49 +01:00
1e6d38133e Merge branch 'master' into temp-spreadsheet-editor 2021-02-25 17:18:22 +01:00
f908ff1ccd BLI: simplify adding an arbitrary value to a resource container
With this is becomes easily possible to store a lambda in a resource
collector so that it will be freed when the resource collector is freed.
2021-02-25 17:17:45 +01:00
6e261f79ef Merge branch 'master' into temp-spreadsheet-editor 2021-02-25 16:58:46 +01:00
35df354e4a Cleanup: quiet warning
"loop variable 'item' is always a copy because the range of type ..."
2021-02-25 16:56:01 +01:00
400f2e4be6 Fix T85959 EEVEE: DOF with "Jitter Camera" broken
Was caused by recent changes in window_translate_m4 by rBbb2af40ec7dd.
2021-02-25 15:27:10 +01:00
626a8e0f10 Fix T85979: Attribute missing warning with empty geometry
An error doesn't make sense in these situations because we don't expect
to find attributes on empty geometry, and an empty geometry set is a
valid situation.

Note that we can't use `component.is_empty` here, because often the
component is visually "empty" but still has a point cloud with no
points or a mesh with no vertices.
2021-02-25 08:20:02 -06:00
bcd369c3c1 Fix macOS SSE support not detected correctly after recent changes
Due to moving the code the test binary was incorrectly compiled with OpenMP
flags. Move setting of the OpenMP flags to the appropriate place.
2021-02-25 15:09:10 +01:00
ae581f9445 Fix T85976: Outliner crash deleting collection with multiple windows 2021-02-26 00:17:43 +11:00
a977ed1920 automatically adapt index column width 2021-02-25 13:30:35 +01:00
83ed51c2f1 automatically adapt column width 2021-02-25 13:24:11 +01:00
cccdd6626d PyAPI Docs: Add 'gpu.state' module
Also exclude `gpu.shader` from quick tests.
2021-02-25 09:16:48 -03:00
fa62b24b57 draw float2 attributes 2021-02-25 13:09:36 +01:00
18d99cd5fb draw bool attributes 2021-02-25 13:06:33 +01:00
cc3e6c4950 don't draw invisible column cells 2021-02-25 12:57:51 +01:00
5a71c3cb56 draw color attributes 2021-02-25 12:54:20 +01:00
e2cf5b8b2e draw integer attributes 2021-02-25 12:50:20 +01:00
e67275538a show float and float3 attributes 2021-02-25 12:40:24 +01:00
179dfdccd2 draw attribute name 2021-02-25 12:04:23 +01:00
59c1029e20 install_deps: bump USD version to 21.02.
Should have been part of D10367/rBa923a34de19c, but for some reasons it
did not make it into final commit...

Re T85365.
2021-02-25 11:56:14 +01:00
adf1525171 install_deps: bump python version to 3.9.2.
Also bump exlusive maximal version to 3.11, since 3.10 is now supported.

Re T85365.
2021-02-25 11:50:38 +01:00
de25b79ff5 Refactor: IDTypeInfo: Add owner_get to get owner of embedded IDs.
This concerns currently only collections (`master_collection` of scenes)
and root node trees. It removes the matching type-specific helpers
(`BKE_collection_master_scene_search` and `BKE_node_tree_find_owner_ID`).

No functional change expected here.

NOTE: Current implementation of `owner_get` is far from optimal, we
could probably do it better, see {T69169}.

NOTE: While it could also have it, shapekeys IDTypeInfo was left out of
this change for now. Mainly because it sould not be used currently, and
we ultimately want to demote shape keys from ID status anyway.
2021-02-25 11:39:10 +01:00
17615ab5aa initial pinning in header ui 2021-02-25 11:14:13 +01:00
b5d39f9b46 Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-02-25 10:17:02 +01:00
1b34d6cd79 Merge branch 'master' into temp-spreadsheet-editor 2021-02-25 10:00:37 +01:00
0e1c6a29cb Cleanup: spelling 2021-02-25 16:34:50 +11:00
94dc6ceaa7 Cleanup: remove assert left in by accident, outdated comment 2021-02-25 16:33:55 +11:00
b073e59d4e Fix T85975: Edit-mode undo/redo removes overlays
Setting the active object when decoding undo steps missed
a call to ED_object_base_active_refresh.
2021-02-25 16:13:53 +11:00
e301f3422d Fix T85974: Edit-mode undo/redo causes assertion
Assert the poll function succeeds after setting the active object.
2021-02-25 16:13:53 +11:00
2b60d7d09c Fix entering edit-mode when object mode and edit-data don't match
In rare cases, it's possible for an object to have edit-mode data
without it's Object.mode set to edit-mode.

This could happen with undo, part of fix for: T85974.
2021-02-25 16:13:47 +11:00
3ed6d9f966 Cleanup: use low level edit-object access functions for undo
Use OBEDIT_FROM_VIEW_LAYER macro for curve & fonts (matching edit-mesh).

While the difference isn't significant at the moment,
there are no reason these should be different between undo systems.
2021-02-25 12:20:23 +11:00
72370b92be Fix T85926: Cycles missing viewport updates when making materials single user
This issue seems to be caused by the reallocation flag not being set on
the device shader data array so it was never updated on the GPU although
the host memory was modified.
2021-02-25 02:18:02 +01:00
c47990f41c PyAPI: expose imbuf.types.ImBuf, include in API docs
Without this, the ImBuf type wasn't part of documentation.
2021-02-25 12:04:23 +11:00
17260c9b9a Fix T85963: Combine and separate XYZ nodes don't work on instances
They were missing the `geometry_set_realize_instances` function used to
make any input instances real for writing.
2021-02-24 16:11:21 -06:00
01e13e2c95 Cleanup: Remove unused node editor button event defines
These defines seem to be left over from the initial implementation
of the node editor. In a few places the values were used in button
creation, but the callbacks never checked the value anyway.
Node uiBlocks also had a callback what would never do anything
since the value it checked for was never used.
2021-02-24 14:53:37 -06:00
Yevgeny Makarov
a50f6bc40b UI: Clean up "Dupli" to "Instance"
Following the naming conventions defined in T56648, where in this
instance there were still a few remaining uses of the old term.

Differential Revision: https://developer.blender.org/D9817
2021-02-24 13:49:14 -06:00
Yevgeny Makarov
962b87f06a UI: Clean up use of the term "Metaballs"
Clear the weird term "Metaelement".
These are the metaballs (elements) inside one metaball objects.
  - "Meta Ball" to "Metaball"
  - "Metaelement", "Meta element" to "Metaball element"

Differential Revision: https://developer.blender.org/D9910
2021-02-24 13:44:24 -06:00
Yevgeny Makarov
4f247dba5e UI: Cleanup and fix labels and descriptions in various places
Changes include using proper and consistent grammar, simplifying
phrasing, using correct terminology, and not including python API
identifiers in tooltips.

Differential Revision: https://developer.blender.org/D9924
2021-02-24 13:25:44 -06:00
9a1b29e16c CMake: Removed temporarily disabled clang block
Was disabled in rBc778fd981e63. Libraries have been updated in rBL62576.
2021-02-24 20:23:42 +01:00
7a8a8241b9 Revert "t"
This reverts commit d3a96e5022.
2021-02-24 16:23:18 -03:00
201ab7c540 Fix T85823: bpy.ops.transform... ignoring 'center_override' for Bezier control points
`transform_around_single_fallback_ex` ignored that the center could be overwritten.
2021-02-24 16:20:03 -03:00
d3a96e5022 t 2021-02-24 16:20:02 -03:00
Yevgeny Makarov
8cc4366a98 UI: Remove colons from some labels
The colons are not necessary in these situations because it's clear
that the label applies to the next group of buttons anyway, and they
add unecessary visual complexity. Committing as part of D9924.
2021-02-24 13:15:48 -06:00
bc0e121bce UI: Reorder mesh merge operator types for consistent shortcuts
In vertex selection mode, the "At First" and "At Last" options are
contextually added to the beginning of the list of merge operations.
This means the automatic shortcuts in the merge menu are different,
making learning the shortcuts much more difficult than necessary.

This patch reorders the items so that "At First" and "At Last" are
added after the first three options so the shortcuts are always
consistent.

Fixes T84335

Differential Revision: https://developer.blender.org/D10008
2021-02-24 13:08:26 -06:00
66874824e6 GPencil: Fix missing change material menu using U key
The menu was not activated when vertex mode was enabled.
2021-02-24 20:04:10 +01:00
Fabian Schempp
b54b56fcbe UI: Make node virtual sockets more visible
This commit tweaks how virtual sockets (unconnected node group input
and output sockets) are drawn to make them more recognizable. The
outline is changed to a gray color, and they get a dark inner color.

Differential Revision: https://developer.blender.org/D10080
2021-02-24 13:01:24 -06:00
89196765ba Cleanup: Clang tidy else after return 2021-02-24 12:57:49 -06:00
Kdaf
e8a99dda25 Fix T84796: Particle tool properties displayed for select tool
When using particle mode, the particle tool settings were always
displayed, even if select/cursor is the active tool. This patch
hides the properties of the particle tools for non-brush tools,
using the same check as in other modes.

Differential Revision: https://developer.blender.org/D10266
2021-02-24 12:27:25 -06:00
e7e3f17c49 Merge branch 'master' into temp-spreadsheet-editor 2021-02-24 18:43:18 +01:00
10804043a5 fixes 2021-02-24 18:12:48 +01:00
b79cd1cb03 refactor spreadsheet drawing 2021-02-24 18:06:04 +01:00
7f9f6ac29f Merge branch 'master' into temp-spreadsheet-editor 2021-02-24 18:05:25 +01:00
5dd176cde8 PyAPI: Ensure GIL state only when a callback exists
There are fewer python callbacks than `ARegionType`s.

This also broke GTests's `bf_blenderloader_tests`.
2021-02-24 13:57:06 -03:00
02948a2cab Blender 2.92.0 release tagging 2021-02-24 17:25:10 +01:00
069d96fce5 Docs: 2.92 release description for Linux appdata 2021-02-24 17:24:11 +01:00
b0b33b77fa Workbench: Fix typo in rB32ca8e58a374
This was creating incorrectly occluded overlays.
2021-02-24 17:10:18 +01:00
b22204fa37 Cleanup: Simplify vector direction comparison
Multiply the two number together. If the sign of the result is positive, then the sign was the same. If the sign of the result is negative, then the signs were different.
2021-02-24 16:44:34 +01:00
c778fd981e CMake: Temporarily removing find clang block
New libs have not landed in the SVN repository. Once they are up, this commit will be reverted.
2021-02-24 16:13:06 +01:00
c0b2c75c44 Geometry Nodes: store available attribute names in node ui storage
This information will be used by the attribute search in string sockets.

Ref T85657.

Differential Revision: https://developer.blender.org/D10462
2021-02-24 16:00:33 +01:00
7972785d7b PyAPI: Fix memory leak of parameters used for python 'draw_callbacks'
When closing the blender, while the callbacks are removed, the
reference count of the object used as `customdata` is not decremented.

This commit adds two functions that correctly release the
python `draw_callbacks` before releasing all `draw_callbacks`.

Differential Revision: https://developer.blender.org/D10478
2021-02-24 11:57:29 -03:00
6b6469a2e5 Cleanup: Fix comment 2021-02-24 15:47:11 +01:00
7bbf27891c GPencil: Improve Interpolate AutoFlip algorithm II
Improved the calculation of the distances and changed the variable names to make it more readable.

Still, there are some corner cases that could be not handled properly, but we keep as is to test more real drawings to analyze if the small number of corner cases needs to be fixed or not.
2021-02-24 15:34:24 +01:00
9243d286f4 Cleanup: CryptomatteLayer
Missing code flow.
2021-02-24 15:30:29 +01:00
bb3e54d8be Cleanup: Cryptomatte Use StringRef(Null). 2021-02-24 15:29:23 +01:00
79f34447d6 Cleanup: CryptomatteLayer structure.
Current implementation was to restricting for future enhancements where
the CryptomatterLayer could be read from existing metadata.
2021-02-24 15:18:31 +01:00
4fb0c83c1c Cmake/deps: Update OSL to 1.11.10.0
This bumps OSL to 1.11.10.0. OSL Has a new build time
dependency: Clang, and more importantly it expects
clang and llvm to share a library folder, which it
previously for us did not.

This patch changes:

-OSL Update to 1.11.10.0

-refactor the llvm/clang/clang-tools-extra builds into the llvm
 build using the llvm-project tarball for building that has all
 of the subprojects in it.

-update ispc/openmp builds since clang no longer its own dependency
 and they have to depend on the llvm build now.

-Update the windows builder to use the 64 bit host tools since it
 ran out of ram linking clang

-Since OSL now needs clang to link successfully a findclang.cmake
 has been provided for linux/OSX

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

Reviewed By: brecht, sebbas, sybren
2021-02-24 07:13:37 -07:00
5be72125bf Cleanup: Move some utilities to 'gpu_py.h' 2021-02-24 10:58:15 -03:00
8f6fd07b54 Fix T85947: Missing check of master collection for objects being instanced.
`object_in_any_collection` used during linking/appending to check
whether an object is already instanced by at least one collection, was
not taking into account embedded master collections from scenes.
2021-02-24 14:14:46 +01:00
0c0553ace7 Fix T85915: Cannot save new theme preset
Since making bpy.types a real module `dir(bpy.types)` now includes
__dir__ and __getattr__ methods which need to be ignored.
2021-02-24 23:39:38 +11:00
5c098ef58c Fix crash updating themes in background mode 2021-02-24 23:39:38 +11:00
d829a0a607 include gpu 2021-02-24 13:02:15 +01:00
812a362bd8 Docs: 2.91 release description for Linux appdata 2021-02-24 12:53:00 +01:00
a0191eb889 Merge branch 'master' into temp-spreadsheet-editor 2021-02-24 12:15:04 +01:00
12b805148f Cleanup: quiet asan overflow warning 2021-02-24 12:10:45 +01:00
32ca8e58a3 Workbench: Fix samples taken outside of pixel footprint
With the previous implementation, we could have pixels with offset larger
than 1 pixel.

Also fix a bug when the closest_index is not last. The sample positions
were incorrect in this case.
2021-02-24 11:37:03 +01:00
bb2af40ec7 Fix T85726 Workbench: Orthographic view is blurry
This was caused by the window_translate_m4 not offsetting the winmat in the
right direction for perspective view. Thus leading to incorrect weights.
The workbench sample weight computation was also inverted.

This fix will change the sampling pattern for EEVEE too (it will just
mirror it in perspective view).
2021-02-24 11:37:03 +01:00
1a427973b4 Fix incorrect icon .dat files after recent commit
Using `make icons` for 420f538fad changed some icons that it shouldn't have
touched on my system. Not sure what caused this, maybe a bug in the slightly
outdated Inkscape version there (1.0.1). Here on macOS the version is only
reported as 1.0 so I'm not sure what the situation is. Either way, this fixes
the icons.
2021-02-24 11:29:01 +01:00
daf7f42364 Fix line width broken for consecutive line draw calls
D9054 did multiple consecutive `immBegin()`/`immEnd()` draw calls to draw
multiple lines at varying thickness. This would only work for the first line,
then they'd all get a 1px thickness (at least on macOS).

Issue was that `wide_line_workaround_end()` called `immBindShader()` directly
to restore the old shader (which the workaround overrides). However this
doesn't set `imm->builtin_shader_bound` which has to be done for the workaround
to work on the next `immBegin()` call. Instead `immBindBuiltinProgram()` can be
called.

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

Reviewed by: Clément Foucault
2021-02-24 11:16:51 +01:00
0fe25a6232 Fix T85939: Eevee Specular BSDF shader compile error
Introduced by 7f7e683099.
2021-02-24 10:45:25 +01:00
8d50a3e19e Fix T85930: Custom Property Error: Wrong Subtype
Regression in 08dbc4f996

Unfortunately lambda functions don't work with postponed annotations.
2021-02-24 16:16:53 +11:00
d4c0c40015 Cleanup: spelling 2021-02-24 15:53:03 +11:00
5c2e10d5ed Docs: clarify radial/cycle use for BMesh loops
Also add minor corrections clarifications elsewhere.
2021-02-24 15:39:43 +11:00
b2c7ea6d82 Geometry Nodes: Move node UI storage function to BKE
This function will be used in another file with attribute search,
so it makes sense to share from the UI storage header.
2021-02-23 17:15:03 -06:00
dde7d4417a GPencil: Fix typo error in previous commit 2021-02-23 23:09:33 +01:00
4d9d87d2bf GPencil: Improve Flip algorithm for Interpolate
If the lines cross, but the angle is very sharp, check the distance between the extremes.
2021-02-23 23:06:06 +01:00
b67b1d59c3 Merge branch 'blender-v2.92-release' 2021-02-23 13:59:24 -08:00
eb554051e7 Revert Automatic Tablet API dynamic fallback.
Removes fallback to Windows Ink when Wintab reports no devices present.
Returns to old behavior of using only Wintab if Wintab.dll exists.
2021-02-23 13:29:59 -08:00
ee4f306509 Fix T85844: high pressure at start of line.
m_tabletInRange is no longer set for Wintab after 2e81f2c01a
reverted Wintab changes. This reverts most button processing to
behavior present in 2.91.2.

Left in place is a bugfix for Windows Ink: button events while a
Windows Ink pen is in range should still be processed. Events processed
by Windows Ink and not passed to DefWindowProc do not create WM_*BUTTON
events, but button events from e.g. tablet pad express keys do create
WM_*BUTTON events and should be handled.
2021-02-23 13:29:59 -08:00
f227a69a87 Revert high fequency mouse input for Windows.
Windows mouse history function GetMouesMovePointsEx has well documented
bugs where it receives and returns 32 bit screen coordinates, but
internally truncates to unsigned 16 bits. For mouse (relative position)
input this is not a problem as motion events and the resulting screen
coordinates reliably fit within 16 bit precision.

For tablets (absolute position) the 16 bit truncation results in
corrupt history when tablet drivers use mouse_event or SendInput from
the Windows API to move the mouse cursor. Both of these functions take
absolute mouse position as singed 32 bit value on the range of 0-65535
(or 0x0-0xFFFF) inclusive. Values larger than 0x7FFF (the largest
signed 16 bit value) are reliably corrupt when retrieved from
GetMouesMovePointsEx history. This is true regardless of whether mouse
history is retrieved using display resolution (GMMP_USE_DISPLAY_POINTS)
or high resolution points (GMMP_USE_HIGH_RESOLUTION_POINTS), the latter
of which should return points in range 0-65535.

Reviewed By: brecht

Maniphest Tasks: T85874

Differential Revision: https://developer.blender.org/D10507
2021-02-23 13:29:51 -08:00
8d02fdc7e0 WM_MOUSEMOVE cleanup. 2021-02-23 11:47:53 -08:00
6844b768f3 Revert Automatic Tablet API dynamic fallback.
Removes fallback to Windows Ink when Wintab reports no devices present.
Returns to old behavior of using only Wintab if Wintab.dll exists.
2021-02-23 11:27:40 -08:00
37afeb7eaa Fix T85844: high pressure at start of line.
m_tabletInRange is no longer set for Wintab after 2e81f2c01a
reverted Wintab changes. This reverts most button processing to
behavior present in 2.91.2.

Left in place is a bugfix for Windows Ink: button events while a
Windows Ink pen is in range should still be processed. Events processed
by Windows Ink and not passed to DefWindowProc do not create WM_*BUTTON
events, but button events from e.g. tablet pad express keys do create
WM_*BUTTON events and should be handled.
2021-02-23 11:27:40 -08:00
cd9dbe317d Revert high fequency mouse input for Windows.
Windows mouse history function GetMouesMovePointsEx has well documented
bugs where it receives and returns 32 bit screen coordinates, but
internally truncates to unsigned 16 bits. For mouse (relative position)
input this is not a problem as motion events and the resulting screen
coordinates reliably fit within 16 bit precision.

For tablets (absolute position) the 16 bit truncation results in
corrupt history when tablet drivers use mouse_event or SendInput from
the Windows API to move the mouse cursor. Both of these functions take
absolute mouse position as singed 32 bit value on the range of 0-65535
(or 0x0-0xFFFF) inclusive. Values larger than 0x7FFF (the largest
signed 16 bit value) are reliably corrupt when retrieved from
GetMouesMovePointsEx history. This is true regardless of whether mouse
history is retrieved using display resolution (GMMP_USE_DISPLAY_POINTS)
or high resolution points (GMMP_USE_HIGH_RESOLUTION_POINTS), the latter
of which should return points in range 0-65535.

Reviewed By: brecht

Maniphest Tasks: T85874

Differential Revision: https://developer.blender.org/D10507
2021-02-23 11:25:27 -08:00
b123aadeee Fix T85895: Viewing value passes in Image Editor displays the value as alpha
There was a similar report prior to the introduction of the Image
Engine, see T74586.
This was fixed by rB6a5bd812b569 at that time, but got lost in the
refactor it seems.

Above commit introduced the `ED_space_image_get_display_channel_mask`
function that will determine
the valid bitflags for the display channel of a given ImBuf.

But since the refactor, this is not called anymore (`draw_image_main` is
not called anymore)
Now it seems we can safely reuse that said function
`ED_space_image_get_display_channel_mask` also for the Image Engine.

Maniphest Tasks: T85895

Differential Revision: https://developer.blender.org/D10510
2021-02-23 18:32:09 +01:00
64c35769f9 Cleanup: Remove unecessary double negative 2021-02-23 11:25:13 -06:00
1868880e7a enable scrollbars 2021-02-23 17:07:12 +01:00
247707c52a cleanup 2021-02-23 17:07:02 +01:00
64ddb1c8f2 right align indices 2021-02-23 17:03:22 +01:00
70b0b63d7b draw float attributes 2021-02-23 16:57:56 +01:00
c4b67853bd save spreadsheet space in file 2021-02-23 16:38:04 +01:00
c62e60f01f Annotations: Add layer Opacity paramater
This option was removed in the refactor of grease pencil and never was set again.
2021-02-23 16:14:56 +01:00
67c2ef5242 Merge branch 'master' into temp-spreadsheet-editor 2021-02-23 15:36:06 +01:00
18be02b859 Geometry Nodes: improve accessing attribute meta data
This allows accessing attribute meta data like domain and data type
without having to create a `ReadAttribute`. I kept the `attribute_names`
method for now to keep the patch more self contained.

Differential Revision: https://developer.blender.org/D10511
2021-02-23 15:15:29 +01:00
8568bed752 write attribute names and row indices 2021-02-23 13:18:25 +01:00
Yevgeny Makarov
420f538fad Fix T84707: Wrong icon for Movie Clip Editor
Sync the list of icons in CMakeLists.txt with UI_icons.h.
Restore, in the source file, the FUND icon that was accidentally
deleted.
Delete four old/unused icons.

See also D9715.
2021-02-23 12:07:25 +01:00
0ad34e603c Merge branch 'master' into temp-spreadsheet-editor 2021-02-23 11:53:35 +01:00
aa4882506c BLI: new FunctionRef type
Using `FunctionRef` is better than using `std::function`, templates and c function
pointers in some cases. The trade offs are explained in more detail in code documentation.

The following are some of the main benefits of using `FunctionRef`:
* It is convenient to use with all kinds of callables.
* It is cheaper to construct, copy and (possibly) call compared to `std::function`.
* Functions taking a `FunctionRef` as parameter don't need to be declared
  in header files (as is necessary when using templates usually).

Differential Revision:  https://developer.blender.org/D10476
2021-02-23 11:52:06 +01:00
b2e1b13abd Cycles: Add option to change input passes for viewport denoising
There are cases where the default input passes of color+albedo do not yield useful results
and while this was possible to change that for final frame rendering (in the layer settings),
viewport denoising always used a fixed color+albedo. This adds an option to change the
input passes for viewport denoising too, so that one can use it in scenes that otherwise
wouldn't work well with it.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10404
2021-02-23 11:45:02 +01:00
2e8d77967e hookup view2d to spreadsheet editor 2021-02-23 11:41:36 +01:00
525819b1af Merge branch 'master' into temp-spreadsheet-editor 2021-02-23 10:52:02 +01:00
eb6b26192d cleanup 2021-02-22 16:55:52 +01:00
27373011de initial drawing into block directly 2021-02-22 16:13:37 +01:00
ced130f849 register basic listener 2021-02-22 14:01:34 +01:00
6ff897157c draw vertex positions 2021-02-22 13:45:29 +01:00
73872fd0e0 initial drawing 2021-02-22 13:11:47 +01:00
794c0a09eb spreadsheet background 2021-02-22 12:53:30 +01:00
886d28f342 initial header drawing 2021-02-22 12:47:26 +01:00
6989349251 remove warnings 2021-02-22 12:39:22 +01:00
eedc06b6b2 actually create spreadsheet 2021-02-22 11:22:31 +01:00
ea58786120 initial spreadsheet boilerplate code 2021-02-22 11:12:23 +01:00
452 changed files with 27991 additions and 8394 deletions

View File

@@ -416,6 +416,7 @@ else()
option(LLVM_STATIC "Link with LLVM static libraries" OFF)
endif()
mark_as_advanced(LLVM_STATIC)
option(WITH_CLANG "Use Clang" OFF)
# disable for now, but plan to support on all platforms eventually
option(WITH_MEM_JEMALLOC "Enable malloc replacement (http://www.canonware.com/jemalloc)" ON)
@@ -742,6 +743,7 @@ if(WITH_CYCLES)
# auto enable llvm for cycles_osl
if(WITH_CYCLES_OSL)
set(WITH_LLVM ON CACHE BOOL "" FORCE)
set(WITH_CLANG ON CACHE BOOL "" FORCE)
endif()
else()
set(WITH_CYCLES_OSL OFF)
@@ -899,6 +901,18 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
endif()
endif()
# Test SIMD support, before platform includes to determine if sse2neon is needed.
if(WITH_CPU_SIMD)
set(COMPILER_SSE_FLAG)
set(COMPILER_SSE2_FLAG)
# Test Neon first since macOS Arm can compile and run x86-64 SSE binaries.
TEST_NEON_SUPPORT()
if(NOT SUPPORT_NEON_BUILD)
TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
endif()
endif()
# ----------------------------------------------------------------------------
# Main Platform Checks
#
@@ -954,16 +968,11 @@ if(WITH_INTERNATIONAL)
endif()
endif()
# See TEST_SSE_SUPPORT() and TEST_NEON_SUPPORT() for how these are defined.
# Enable SIMD support if detected by TEST_SSE_SUPPORT() or TEST_NEON_SUPPORT().
#
# This is done globally, so that all modules can use it if available, and
# because these are used in headers used by many modules.
if(WITH_CPU_SIMD)
set(COMPILER_SSE_FLAG)
set(COMPILER_SSE2_FLAG)
# Test Neon first since macOS Arm can compile and run x86-64 SSE binaries.
TEST_NEON_SUPPORT()
if(SUPPORT_NEON_BUILD)
# Neon
if(SSE2NEON_FOUND)
@@ -972,7 +981,6 @@ if(WITH_CPU_SIMD)
endif()
else()
# SSE
TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
if(SUPPORT_SSE_BUILD)
string(PREPEND PLATFORM_CFLAGS "${COMPILER_SSE_FLAG} ")
add_definitions(-D__SSE__ -D__MMX__)
@@ -1213,6 +1221,7 @@ if(WITH_OPENMP)
if(NOT WITH_OPENMP_STATIC)
string(APPEND CMAKE_C_FLAGS " ${OpenMP_C_FLAGS}")
string(APPEND CMAKE_CXX_FLAGS " ${OpenMP_CXX_FLAGS}")
string(APPEND CMAKE_EXE_LINKER_FLAGS " ${OpenMP_LINKER_FLAGS}")
else()
# Typically avoid adding flags as defines but we can't
# pass OpenMP flags to the linker for static builds, meaning
@@ -1881,6 +1890,7 @@ if(FIRST_RUN)
info_cfg_text("Build Options:")
info_cfg_option(WITH_ALEMBIC)
info_cfg_option(WITH_BULLET)
info_cfg_option(WITH_CLANG)
info_cfg_option(WITH_CYCLES)
info_cfg_option(WITH_FFTW3)
info_cfg_option(WITH_FREESTYLE)

View File

@@ -31,6 +31,7 @@
#
# MAC OS X USAGE:
# Install with homebrew: brew install autoconf automake bison cmake libtool pkg-config yasm
# Additional requirements for macOS arm64: brew install flex
# Run "make deps" from main Blender directory
#
# LINUX USAGE:
@@ -71,7 +72,6 @@ include(cmake/opensubdiv.cmake)
include(cmake/sdl.cmake)
include(cmake/opencollada.cmake)
include(cmake/llvm.cmake)
include(cmake/clang.cmake)
if(APPLE)
include(cmake/openmp.cmake)
endif()

View File

@@ -1,104 +0,0 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(CLANG_EXTRA_ARGS
-DLLVM_DIR="${LIBDIR}/llvm/lib/cmake/llvm/"
-DLLVM_USE_CRT_RELEASE=MD
-DLLVM_USE_CRT_DEBUG=MDd
-DLLVM_CONFIG=${LIBDIR}/llvm/bin/llvm-config
)
set(BUILD_CLANG_TOOLS OFF)
if(WIN32)
set(CLANG_GENERATOR "Ninja")
else()
set(CLANG_GENERATOR "Unix Makefiles")
endif()
if(APPLE)
set(BUILD_CLANG_TOOLS ON)
set(CLANG_EXTRA_ARGS ${CLANG_EXTRA_ARGS}
-DLIBXML2_LIBRARY=${LIBDIR}/xml2/lib/libxml2.a
)
endif()
if(BUILD_CLANG_TOOLS)
# ExternalProject_Add does not allow multiple tarballs to be
# downloaded. Work around this by having an empty build action
# for the extra tools, and referring the clang build to the location
# of the clang-tools-extra source.
ExternalProject_Add(external_clang_tools
URL ${CLANG_TOOLS_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CLANG_TOOLS_HASH}
INSTALL_DIR ${LIBDIR}/clang_tools
PREFIX ${BUILD_DIR}/clang_tools
CONFIGURE_COMMAND echo "."
BUILD_COMMAND echo "."
INSTALL_COMMAND echo "."
)
list(APPEND CLANG_EXTRA_ARGS
-DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=${BUILD_DIR}/clang_tools/src/external_clang_tools/
)
endif()
ExternalProject_Add(external_clang
URL ${CLANG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CLANG_HASH}
PREFIX ${BUILD_DIR}/clang
CMAKE_GENERATOR ${CLANG_GENERATOR}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/clang ${DEFAULT_CMAKE_FLAGS} ${CLANG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/clang
)
if(MSVC)
if(BUILD_MODE STREQUAL Release)
set(CLANG_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/ ${HARVEST_TARGET}/llvm/)
else()
set(CLANG_HARVEST_COMMAND
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/lib/ ${HARVEST_TARGET}/llvm/debug/lib/
)
endif()
ExternalProject_Add_Step(external_clang after_install
COMMAND ${CLANG_HARVEST_COMMAND}
DEPENDEES mkdir update patch download configure build install
)
endif()
add_dependencies(
external_clang
ll
)
if(BUILD_CLANG_TOOLS)
# `external_clang_tools` is for downloading the source, not compiling it.
add_dependencies(
external_clang
external_clang_tools
)
endif()
# We currently do not build libxml2 on Windows.
if(NOT WIN32)
add_dependencies(
external_clang
external_xml2
)
endif()

View File

@@ -97,15 +97,15 @@ harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpg/include jpeg/include "*.h")
harvest(jpg/lib jpeg/lib "libjpeg.a")
harvest(lame/lib ffmpeg/lib "*.a")
harvest(clang/bin llvm/bin "clang-format")
harvest(llvm/bin llvm/bin "clang-format")
if(BUILD_CLANG_TOOLS)
harvest(clang/bin llvm/bin "clang-tidy")
harvest(clang/share/clang llvm/share "run-clang-tidy.py")
harvest(llvm/bin llvm/bin "clang-tidy")
harvest(llvm/share/clang llvm/share "run-clang-tidy.py")
endif()
harvest(clang/include llvm/include "*")
harvest(llvm/include llvm/include "*")
harvest(llvm/bin llvm/bin "llvm-config")
harvest(llvm/lib llvm/lib "libLLVM*.a")
harvest(llvm/lib llvm/lib "libclang*.a")
if(APPLE)
harvest(openmp/lib openmp/lib "*")
harvest(openmp/include openmp/include "*.h")
@@ -158,7 +158,7 @@ harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a")
harvest(osl/bin osl/bin "oslc")
harvest(osl/include osl/include "*.h")
harvest(osl/lib osl/lib "*.a")
harvest(osl/shaders osl/shaders "*.h")
harvest(osl/share/OSL/shaders osl/share/OSL/shaders "*.h")
harvest(png/include png/include "*.h")
harvest(png/lib png/lib "*.a")
harvest(pugixml/include pugixml/include "*.hpp")

View File

@@ -24,11 +24,12 @@ if(WIN32)
-DARM_ENABLED=Off
)
elseif(APPLE)
# Use bison installed via Homebrew.
# The one which comes which Xcode toolset is too old.
# Use bison and flex installed via Homebrew.
# The ones that come with Xcode toolset are too old.
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison
-DFLEX_EXECUTABLE=/opt/homebrew/opt/flex/bin/flex
-DARM_ENABLED=On
)
else()
@@ -39,8 +40,8 @@ elseif(APPLE)
endif()
elseif(UNIX)
set(ISPC_EXTRA_ARGS_UNIX
-DCMAKE_C_COMPILER=${LIBDIR}/clang/bin/clang
-DCMAKE_CXX_COMPILER=${LIBDIR}/clang/bin/clang++
-DCMAKE_C_COMPILER=${LIBDIR}/llvm/bin/clang
-DCMAKE_CXX_COMPILER=${LIBDIR}/llvm/bin/clang++
-DARM_ENABLED=Off
)
endif()
@@ -51,11 +52,11 @@ set(ISPC_EXTRA_ARGS
-DISPC_INCLUDE_TESTS=Off
-DLLVM_ROOT=${LIBDIR}/llvm/lib/cmake/llvm
-DLLVM_LIBRARY_DIR=${LIBDIR}/llvm/lib
-DCLANG_EXECUTABLE=${LIBDIR}/clang/bin/clang
-DCLANGPP_EXECUTABLE=${LIBDIR}/clang/bin/clang++
-DCLANG_EXECUTABLE=${LIBDIR}/llvm/bin/clang
-DCLANGPP_EXECUTABLE=${LIBDIR}/llvm/bin/clang++
-DISPC_INCLUDE_TESTS=Off
-DCLANG_LIBRARY_DIR=${LIBDIR}/clang/lib
-DCLANG_INCLUDE_DIRS=${LIBDIR}/clang/include
-DCLANG_LIBRARY_DIR=${LIBDIR}/llvm/lib
-DCLANG_INCLUDE_DIRS=${LIBDIR}/llvm/include
${ISPC_EXTRA_ARGS_WIN}
${ISPC_EXTRA_ARGS_APPLE}
${ISPC_EXTRA_ARGS_UNIX}
@@ -74,7 +75,6 @@ ExternalProject_Add(external_ispc
add_dependencies(
external_ispc
ll
external_clang
)
if(WIN32)

View File

@@ -22,6 +22,15 @@ else()
set(LLVM_TARGETS X86)
endif()
if(APPLE)
set(LLVM_XML2_ARGS
-DLIBXML2_LIBRARY=${LIBDIR}/xml2/lib/libxml2.a
)
set(LLVM_BUILD_CLANG_TOOLS_EXTRA ^^clang-tools-extra)
set(BUILD_CLANG_TOOLS ON)
endif()
set(LLVM_EXTRA_ARGS
-DLLVM_USE_CRT_RELEASE=MD
-DLLVM_USE_CRT_DEBUG=MDd
@@ -31,6 +40,8 @@ set(LLVM_EXTRA_ARGS
-DLLVM_ENABLE_TERMINFO=OFF
-DLLVM_BUILD_LLVM_C_DYLIB=OFF
-DLLVM_ENABLE_UNWIND_TABLES=OFF
-DLLVM_ENABLE_PROJECTS=clang${LLVM_BUILD_CLANG_TOOLS_EXTRA}
${LLVM_XML2_ARGS}
)
if(WIN32)
@@ -45,7 +56,9 @@ ExternalProject_Add(ll
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${LLVM_HASH}
CMAKE_GENERATOR ${LLVM_GENERATOR}
LIST_SEPARATOR ^^
PREFIX ${BUILD_DIR}/ll
SOURCE_SUBDIR llvm
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/ll/src/ll < ${PATCH_DIR}/llvm.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/llvm ${DEFAULT_CMAKE_FLAGS} ${LLVM_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/llvm
@@ -65,3 +78,11 @@ if(MSVC)
DEPENDEES mkdir update patch download configure build install
)
endif()
# We currently do not build libxml2 on Windows.
if(APPLE)
add_dependencies(
ll
external_xml2
)
endif()

View File

@@ -30,5 +30,5 @@ ExternalProject_Add(external_openmp
add_dependencies(
external_openmp
external_clang
ll
)

View File

@@ -19,12 +19,7 @@
if(WIN32)
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
set(OSL_FLEX_BISON -DFLEX_EXECUTABLE=${LIBDIR}/flexbison/win_flex.exe -DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe)
set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO${LIBEXT};${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO_Util${LIBEXT};${LIBDIR}/png/lib/libpng16${LIBEXT};${LIBDIR}/jpg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}")
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=0)
else()
set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=sse2)
endif()
set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=sse2)
SET(OSL_PLATFORM_FLAGS -DLINKSTATIC=ON)
else()
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES)
@@ -34,7 +29,6 @@ else()
endif()
set(OSL_ILMBASE_CUSTOM_LIBRARIES "${LIBDIR}/openexr/lib/Imath${OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/Half{OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/IlmThread${OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/Iex${OPENEXR_VERSION_POSTFIX}.lib")
set(OSL_LLVM_LIBRARY "${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMAnalysis${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMAsmParser${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMAsmPrinter${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMBitReader${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMBitWriter${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMCodeGen${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMCore${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMDebugInfo${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMExecutionEngine${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMInstCombine${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMInstrumentation${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMInterpreter${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMJIT${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMLinker${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMMC${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMMCDisassembler${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMMCJIT${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMMCParser${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMObject${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMRuntimeDyld${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMScalarOpts${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMSelectionDAG${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMSupport${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMTableGen${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMTarget${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMTransformUtils${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMVectorize${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86AsmParser${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86AsmPrinter${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86CodeGen${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86Desc${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86Disassembler${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86Info${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86Utils${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMipa${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMipo${LIBEXT}")
set(OSL_EXTRA_ARGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
@@ -45,13 +39,8 @@ set(OSL_EXTRA_ARGS
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
-DLLVM_DIRECTORY=${LIBDIR}/llvm
-DLLVM_INCLUDES=${LIBDIR}/llvm/include
-DLLVM_LIB_DIR=${LIBDIR}/llvm/lib
-DLLVM_VERSION=3.4
-DLLVM_LIBRARY=${OSL_LLVM_LIBRARY}
-DOPENEXR_HOME=${LIBDIR}/openexr/
-DILMBASE_HOME=${LIBDIR}/openexr/
-DOpenEXR_ROOT=${LIBDIR}/openexr/
-DIlmBase_ROOT=${LIBDIR}/openexr/
-DILMBASE_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_HALF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_IMATH_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Imath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
@@ -59,35 +48,32 @@ set(OSL_EXTRA_ARGS
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOpenImageIO_ROOT=${LIBDIR}/openimageio/
-DOSL_BUILD_TESTS=OFF
-DOSL_BUILD_MATERIALX=OFF
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DOPENIMAGEIOHOME=${LIBDIR}/openimageio/
-DOPENIMAGEIO_INCLUDE_DIR=${LIBDIR}/openimageio/include
-DOPENIMAGEIO_LIBRARY=${OSL_OPENIMAGEIO_LIBRARY}
${OSL_FLEX_BISON}
-DCMAKE_CXX_STANDARD_LIBRARIES=${OSL_CMAKE_CXX_STANDARD_LIBRARIES}
-DBUILDSTATIC=ON
-DBUILD_SHARED_LIBS=OFF
${OSL_PLATFORM_FLAGS}
-DOSL_BUILD_PLUGINS=Off
-DOSL_BUILD_PLUGINS=OFF
-DSTOP_ON_WARNING=OFF
-DUSE_LLVM_BITCODE=OFF
-DLLVM_ROOT=${LIBDIR}/llvm/
-DLLVM_DIRECTORY=${LIBDIR}/llvm/
-DUSE_PARTIO=OFF
-DUSE_QT=OFF
-DUSE_Qt5=OFF
-DINSTALL_DOCS=OFF
${OSL_SIMD_FLAGS}
-DPARTIO_LIBRARIES=
-DPUGIXML_HOME=${LIBDIR}/pugixml
-Dpugixml_ROOT=${LIBDIR}/pugixml
-DUSE_PYTHON=OFF
)
if(APPLE)
# Make symbol hiding consistent with OIIO which defaults to OFF,
# avoids linker warnings on macOS
set(OSL_EXTRA_ARGS
${OSL_EXTRA_ARGS}
-DHIDE_SYMBOLS=OFF
)
# Apple arm64 uses LLVM 11, LLVM 10+ requires C++14
if (APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
list(APPEND OSL_EXTRA_ARGS -DCMAKE_CXX_STANDARD=14)
endif()
ExternalProject_Add(external_osl
@@ -105,7 +91,6 @@ add_dependencies(
external_osl
external_boost
ll
external_clang
external_openexr
external_zlib
external_flexbison

View File

@@ -81,8 +81,8 @@ else()
# Link against zlib statically (Unix). Avoid rpath issues (macOS).
set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_unix.diff)
set(PYTHON_CONFIGURE_EXTRA_ARGS "--with-openssl=${LIBDIR}/ssl")
set(PYTHON_CFLAGS "-I${LIBDIR}/sqlite/include -I${LIBDIR}/bzip2/include -I${LIBDIR}/lzma/include -I${LIBDIR}/zlib/include")
set(PYTHON_LDFLAGS "-L${LIBDIR}/ffi/lib -L${LIBDIR}/sqlite/lib -L${LIBDIR}/bzip2/lib -L${LIBDIR}/lzma/lib -L${LIBDIR}/zlib/lib")
set(PYTHON_CFLAGS "-I${LIBDIR}/sqlite/include -I${LIBDIR}/bzip2/include -I${LIBDIR}/lzma/include -I${LIBDIR}/zlib/include ${PLATFORM_CFLAGS}")
set(PYTHON_LDFLAGS "-L${LIBDIR}/ffi/lib -L${LIBDIR}/sqlite/lib -L${LIBDIR}/bzip2/lib -L${LIBDIR}/lzma/lib -L${LIBDIR}/zlib/lib ${PLATFORM_LDFLAGS}")
set(PYTHON_CONFIGURE_EXTRA_ENV
export CFLAGS=${PYTHON_CFLAGS} &&
export CPPFLAGS=${PYTHON_CFLAGS} &&

View File

@@ -116,28 +116,16 @@ set(OPENCOLORIO_HASH 1a2e3478b6cd9a1549f24e1b2205e3f0)
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
# Newer version required by ISPC with arm support.
set(LLVM_VERSION 11.0.1)
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz)
set(LLVM_HASH 6ec7ae9fd43da9b87cda15b3ab9cc7af)
set(CLANG_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/clang-${LLVM_VERSION}.src.tar.xz)
set(CLANG_HASH b4cb0b74b1f3292a89c9720f3e1e2934)
set(CLANG_TOOLS_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/clang-tools-extra-${LLVM_VERSION}.src.tar.xz)
set(CLANG_TOOLS_HASH 1e577a85948a0f07483b7c405e59a0ca)
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-project-${LLVM_VERSION}.src.tar.xz)
set(LLVM_HASH e700af40ab83463e4e9ab0ba3708312e)
set(OPENMP_VERSION 9.0.1)
set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${OPENMP_VERSION}/openmp-${OPENMP_VERSION}.src.tar.xz)
set(OPENMP_HASH 6eade16057edbdecb3c4eef9daa2bfcf)
else()
set(LLVM_VERSION 9.0.1)
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz)
set(LLVM_HASH 31eb9ce73dd2a0f8dcab8319fb03f8fc)
set(CLANG_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/clang-${LLVM_VERSION}.src.tar.xz)
set(CLANG_HASH 13468e4a44940efef1b75e8641752f90)
set(CLANG_TOOLS_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/clang-tools-extra-${LLVM_VERSION}.src.tar.xz)
set(CLANG_TOOLS_HASH c76293870b564c6a7968622b475b7646)
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-project-${LLVM_VERSION}.tar.xz)
set(LLVM_HASH b4268e733dfe352960140dc07ef2efcb)
set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/openmp-${LLVM_VERSION}.src.tar.xz)
set(OPENMP_HASH 6eade16057edbdecb3c4eef9daa2bfcf)
@@ -151,15 +139,15 @@ set(TIFF_VERSION 4.1.0)
set(TIFF_URI http://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz)
set(TIFF_HASH 2165e7aba557463acc0664e71a3ed424)
set(OSL_VERSION 1.10.10)
set(OSL_VERSION 1.11.10.0)
set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.tar.gz)
set(OSL_HASH 00dec08a93c8084e53848b9ad047889f)
set(OSL_HASH dfdc23597aeef083832cbada62211756)
set(PYTHON_VERSION 3.9.1)
set(PYTHON_VERSION 3.9.2)
set(PYTHON_SHORT_VERSION 3.9)
set(PYTHON_SHORT_VERSION_NO_DOTS 39)
set(PYTHON_URI https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz)
set(PYTHON_HASH 61981498e75ac8f00adcb908281fadb6)
set(PYTHON_HASH f0dc9000312abeb16de4eccce9a870ab)
set(TBB_VERSION 2020_U2)
set(TBB_URI https://github.com/oneapi-src/oneTBB/archive/${TBB_VERSION}.tar.gz)

View File

@@ -376,10 +376,10 @@ USE_CXX11=true
CLANG_FORMAT_VERSION_MIN="6.0"
CLANG_FORMAT_VERSION_MAX="10.0"
PYTHON_VERSION="3.9.1"
PYTHON_VERSION="3.9.2"
PYTHON_VERSION_SHORT="3.9"
PYTHON_VERSION_MIN="3.7"
PYTHON_VERSION_MAX="3.10"
PYTHON_VERSION_MAX="3.11"
PYTHON_VERSION_INSTALLED=$PYTHON_VERSION_SHORT
PYTHON_FORCE_BUILD=false
PYTHON_FORCE_REBUILD=false
@@ -526,10 +526,10 @@ ALEMBIC_FORCE_BUILD=false
ALEMBIC_FORCE_REBUILD=false
ALEMBIC_SKIP=false
USD_VERSION="20.08"
USD_VERSION_SHORT="20.08"
USD_VERSION="21.02"
USD_VERSION_SHORT="21.02"
USD_VERSION_MIN="20.05"
USD_VERSION_MAX="21.00"
USD_VERSION_MAX="22.00"
USD_FORCE_BUILD=false
USD_FORCE_REBUILD=false
USD_SKIP=false
@@ -1732,7 +1732,7 @@ compile_OCIO() {
fi
# To be changed each time we make edits that would modify the compiled result!
ocio_magic=2
ocio_magic=3
_init_ocio
# Force having own builds for the dependencies.
@@ -1802,11 +1802,11 @@ compile_OCIO() {
make -j$THREADS && make install
# Force linking against static libs
rm -f $_inst/lib/*.so*
#rm -f $_inst/lib/*.so*
# Additional depencencies
cp ext/dist/lib/libtinyxml.a $_inst/lib
cp ext/dist/lib/libyaml-cpp.a $_inst/lib
#cp ext/dist/lib/libtinyxml.a $_inst/lib
#cp ext/dist/lib/libyaml-cpp.a $_inst/lib
make clean

View File

@@ -1,5 +1,5 @@
--- a/lib/Support/Unix/Path.inc 2020-02-17 09:24:26.000000000 +0100
+++ b/lib/Support/Unix/Path.inc 2020-02-17 09:26:25.000000000 +0100
--- a/llvm/lib/Support/Unix/Path.inc 2020-02-17 09:24:26.000000000 +0100
+++ b/llvm/lib/Support/Unix/Path.inc 2020-02-17 09:26:25.000000000 +0100
@@ -1200,7 +1200,9 @@
/// implementation.
std::error_code copy_file(const Twine &From, const Twine &To) {

View File

@@ -43,27 +43,23 @@ diff -Naur OpenShadingLanguage-Release-1.9.9/src/liboslexec/llvm_util.cpp extern
-
+void LLVM_Util::Cleanup ()
+{
+ jitmm_hold.clear();
+ if(jitmm_hold) jitmm_hold->clear();
+}
size_t
LLVM_Util::total_jit_memory_held ()
diff -Naur OpenShadingLanguage-Release-1.9.9/CMakeLists.txt external_osl/CMakeLists.txt
--- orig/CMakeLists.txt 2020-01-27 16:22:31 -0700
+++ external_osl/CMakeLists.txt 2020-05-13 18:04:52 -0600
@@ -102,10 +102,11 @@
set (OPTIX_EXTRA_LIBS CACHE STRING "Extra lib targets needed for OptiX")
set (CUDA_TARGET_ARCH "sm_35" CACHE STRING "CUDA GPU architecture (e.g. sm_35)")
-# set (USE_OIIO_STATIC ON CACHE BOOL "If OIIO is built static")
-# if (USE_OIIO_STATIC)
-# add_definitions ("-DOIIO_STATIC_BUILD=1")
-# endif ()
diff -Naur org/CMakeLists.txt external_osl/CMakeLists.txt
--- org/CMakeLists.txt 2020-12-01 12:37:15 -0700
+++ external_osl/CMakeLists.txt 2021-01-20 13:26:50 -0700
@@ -84,6 +84,11 @@
CACHE STRING "Directory where OptiX PTX files will be installed")
set (CMAKE_DEBUG_POSTFIX "" CACHE STRING "Library naming postfix for Debug builds (e.g., '_debug')")
+set (USE_OIIO_STATIC ON CACHE BOOL "If OIIO is built static")
+if (USE_OIIO_STATIC)
+ add_definitions ("-DOIIO_STATIC_BUILD=1")
+ add_definitions ("-DOIIO_STATIC_DEFINE=1")
+endif ()
set (OSL_NO_DEFAULT_TEXTURESYSTEM OFF CACHE BOOL "Do not use create a raw OIIO::TextureSystem")
if (OSL_NO_DEFAULT_TEXTURESYSTEM)
if (OSL_NO_DEFAULT_TEXTURESYSTEM)

View File

@@ -117,7 +117,7 @@ set path=%BUILD_DIR%\downloads\mingw\mingw64\msys\1.0\bin\;%BUILD_DIR%\downloads
mkdir %STAGING%\%BuildDir%%ARCH%R
cd %Staging%\%BuildDir%%ARCH%R
echo %DATE% %TIME% : Start > %StatusFile%
cmake -G "%CMAKE_BUILDER%" %SOURCE_DIR% -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DBUILD_MODE=Release -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/
cmake -G "%CMAKE_BUILDER%" -Thost=x64 %SOURCE_DIR% -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DBUILD_MODE=Release -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/
echo %DATE% %TIME% : Release Configuration done >> %StatusFile%
if "%dobuild%" == "1" (
msbuild /m "ll.vcxproj" /p:Configuration=Release /fl /flp:logfile=BlenderDeps_llvm.log;Verbosity=normal
@@ -130,7 +130,7 @@ if "%NODEBUG%" == "1" goto exit
cd %BUILD_DIR%
mkdir %STAGING%\%BuildDir%%ARCH%D
cd %Staging%\%BuildDir%%ARCH%D
cmake -G "%CMAKE_BUILDER%" %SOURCE_DIR% -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DCMAKE_BUILD_TYPE=Debug -DBUILD_MODE=Debug -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/ %CMAKE_DEBUG_OPTIONS%
cmake -G "%CMAKE_BUILDER%" -Thost=x64 %SOURCE_DIR% -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DCMAKE_BUILD_TYPE=Debug -DBUILD_MODE=Debug -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/ %CMAKE_DEBUG_OPTIONS%
echo %DATE% %TIME% : Debug Configuration done >> %StatusFile%
if "%dobuild%" == "1" (
msbuild /m "ll.vcxproj" /p:Configuration=Debug /fl /flp:logfile=BlenderDeps_llvm.log;;Verbosity=normal

View File

@@ -0,0 +1,111 @@
# - Find Clang library
# Find the native Clang includes and library
# This module defines
# CLANG_INCLUDE_DIRS, where to find AST/AST.h, Set when
# CLANG_INCLUDE_DIR is found.
# CLANG_LIBRARIES, libraries to link against to use Clang.
# CLANG_ROOT_DIR, The base directory to search for Clang.
# This can also be an environment variable.
# CLANG_FOUND, If false, do not try to use Clang.
#=============================================================================
# Copyright 2021 Blender Foundation.
#
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If CLANG_ROOT_DIR was defined in the environment, use it.
if(NOT CLANG_ROOT_DIR AND NOT $ENV{CLANG_ROOT_DIR} STREQUAL "")
set(CLANG_ROOT_DIR $ENV{CLANG_ROOT_DIR})
endif()
set(_CLANG_SEARCH_DIRS
${CLANG_ROOT_DIR}
/opt/lib/clang
)
find_path(CLANG_INCLUDE_DIR
NAMES
AST/AST.h
HINTS
${_CLANG_SEARCH_DIRS}
PATH_SUFFIXES
include
include/clang
)
set(_CLANG_FIND_COMPONENTS
clangDependencyScanning
clangDynamicASTMatchers
clangFrontendTool
clangStaticAnalyzerFrontend
clangHandleCXX
clangStaticAnalyzerCheckers
clangStaticAnalyzerCore
clangToolingASTDiff
clangToolingRefactoring
clangToolingSyntax
clangARCMigrate
clangCodeGen
clangCrossTU
clangIndex
clangTooling
clangFormat
clangToolingInclusions
clangRewriteFrontend
clangFrontend
clangSerialization
clangDriver
clangToolingCore
clangParse
clangRewrite
clangSema
clangEdit
clangAnalysis
clangASTMatchers
clangAST
clangLex
clangBasic
)
set(_CLANG_LIBRARIES)
foreach(COMPONENT ${_CLANG_FIND_COMPONENTS})
string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
find_library(CLANG_${UPPERCOMPONENT}_LIBRARY
NAMES
${COMPONENT}
HINTS
${_CLANG_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
list(APPEND _CLANG_LIBRARIES "${CLANG_${UPPERCOMPONENT}_LIBRARY}")
endforeach()
# Handle the QUIETLY and REQUIRED arguments and set CLANG_FOUND to TRUE if
# all listed variables are TRUE.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Clang DEFAULT_MSG
_CLANG_LIBRARIES CLANG_INCLUDE_DIR)
if(CLANG_FOUND)
set(CLANG_LIBRARIES ${_CLANG_LIBRARIES})
set(CLANG_INCLUDE_DIRS ${CLANG_INCLUDE_DIR})
endif()
mark_as_advanced(
CLANG_INCLUDE_DIR
)
foreach(COMPONENT ${_CLANG_FIND_COMPONENTS})
string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
mark_as_advanced(CLANG_${UPPERCOMPONENT}_LIBRARY)
endforeach()
unset(_CLANG_SEARCH_DIRS)
unset(_CLANG_FIND_COMPONENTS)
unset(_CLANG_LIBRARIES)

View File

@@ -682,11 +682,13 @@ macro(TEST_SSE_SUPPORT
endmacro()
macro(TEST_NEON_SUPPORT)
include(CheckCXXSourceCompiles)
check_cxx_source_compiles(
"#include <arm_neon.h>
int main() {return vaddvq_s32(vdupq_n_s32(1));}"
SUPPORT_NEON_BUILD)
if(NOT DEFINED SUPPORT_NEON_BUILD)
include(CheckCXXSourceCompiles)
check_cxx_source_compiles(
"#include <arm_neon.h>
int main() {return vaddvq_s32(vdupq_n_s32(1));}"
SUPPORT_NEON_BUILD)
endif()
endmacro()
# Only print message if running CMake first time

View File

@@ -324,7 +324,7 @@ if(WITH_NANOVDB)
find_package(NanoVDB)
endif()
if(WITH_CPU_SIMD)
if(WITH_CPU_SIMD AND SUPPORT_NEON_BUILD)
find_package(sse2neon)
endif()
@@ -333,6 +333,13 @@ if(WITH_LLVM)
if(NOT LLVM_FOUND)
message(FATAL_ERROR "LLVM not found.")
endif()
if(WITH_CLANG)
find_package(Clang)
if(NOT CLANG_FOUND)
message(FATAL_ERROR "Clang not found.")
endif()
endif()
endif()
if(WITH_CYCLES_OSL)
@@ -345,7 +352,7 @@ if(WITH_CYCLES_OSL)
list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -force_load ${OSL_LIB_EXEC} ${OSL_LIB_QUERY})
find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
find_path(OSL_SHADER_DIR NAMES stdosl.h PATHS ${CYCLES_OSL}/shaders)
find_path(OSL_SHADER_DIR NAMES stdosl.h PATHS ${CYCLES_OSL}/share/OSL/shaders)
if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER AND OSL_SHADER_DIR)
set(OSL_FOUND TRUE)
@@ -403,7 +410,7 @@ if(WITH_OPENMP)
set(OPENMP_FOUND ON)
set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
string(APPEND CMAKE_EXE_LINKER_FLAGS " -L'${LIBDIR}/openmp/lib' -lomp")
set(OpenMP_LINKER_FLAGS "-L'${LIBDIR}/openmp/lib' -lomp")
# Copy libomp.dylib to allow executables like datatoc and tests to work.
# `@executable_path/../Resources/lib/` is a default dylib search path.

View File

@@ -70,6 +70,7 @@ if(EXISTS ${LIBDIR})
set(BOOST_LIBRARYDIR ${LIBDIR}/boost/lib)
set(Boost_NO_SYSTEM_PATHS ON)
set(OPENEXR_ROOT_DIR ${LIBDIR}/openexr)
set(CLANG_ROOT_DIR ${LIBDIR}/llvm)
endif()
if(WITH_STATIC_LIBS)
@@ -284,7 +285,7 @@ if(WITH_NANOVDB)
endif()
endif()
if(WITH_CPU_SIMD)
if(WITH_CPU_SIMD AND SUPPORT_NEON_BUILD)
find_package_wrapper(sse2neon)
endif()
@@ -420,7 +421,9 @@ if(WITH_LLVM)
endif()
find_package_wrapper(LLVM)
if(WITH_CLANG)
find_package_wrapper(Clang)
endif()
# Symbol conflicts with same UTF library used by OpenCollada
if(EXISTS ${LIBDIR})
if(WITH_OPENCOLLADA AND (${LLVM_VERSION} VERSION_LESS "4.0.0"))
@@ -430,7 +433,13 @@ if(WITH_LLVM)
if(NOT LLVM_FOUND)
set(WITH_LLVM OFF)
set(WITH_CLANG OFF)
message(STATUS "LLVM not found")
else()
if(NOT CLANG_FOUND)
set(WITH_CLANG OFF)
message(STATUS "Clang not found")
endif()
endif()
endif()

View File

@@ -49,7 +49,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
if(NOT EXISTS "${CLANG_OPENMP_DLL}")
message(FATAL_ERROR "Clang OpenMP library (${CLANG_OPENMP_DLL}) not found.")
endif()
string(APPEND CMAKE_EXE_LINKER_FLAGS " \"${CLANG_OPENMP_LIB}\"")
set(OpenMP_LINKER_FLAGS "\"${CLANG_OPENMP_LIB}\"")
endif()
if(WITH_WINDOWS_STRIPPED_PDB)
message(WARNING "stripped pdb not supported with clang, disabling..")
@@ -672,6 +672,10 @@ endif()
if(WITH_CYCLES_OSL)
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
set(OSL_SHADER_DIR ${CYCLES_OSL}/shaders)
# Shaders have moved around a bit between OSL versions, check multiple locations
if(NOT EXISTS "${OSL_SHADER_DIR}")
set(OSL_SHADER_DIR ${CYCLES_OSL}/share/OSL/shaders)
endif()
find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)

View File

@@ -1,2 +1,2 @@
Sphinx==3.4.3
Sphinx==3.5.1
sphinx_rtd_theme==0.5.1

View File

@@ -75,7 +75,6 @@ def rna_info_BuildRNAInfo_cache():
rna_info_BuildRNAInfo_cache.ret = None
# --- end rna_info cache
# import rpdb2; rpdb2.start_embedded_debugger('test')
import os
import sys
import inspect
@@ -228,6 +227,7 @@ else:
"blf",
"bl_math",
"imbuf",
"imbuf.types",
"bmesh",
"bmesh.ops",
"bmesh.types",
@@ -251,6 +251,9 @@ else:
"gpu.types",
"gpu.matrix",
"gpu.select",
"gpu.shader",
"gpu.state",
"gpu.texture",
"gpu_extras",
"idprop.types",
"mathutils",
@@ -1976,11 +1979,14 @@ def write_rst_importable_modules(basepath):
"aud": "Audio System",
"blf": "Font Drawing",
"imbuf": "Image Buffer",
"imbuf.types": "Image Buffer Types",
"gpu": "GPU Shader Module",
"gpu.types": "GPU Types",
"gpu.matrix": "GPU Matrix",
"gpu.select": "GPU Select",
"gpu.shader": "GPU Shader",
"gpu.matrix": "GPU Matrix Utilities",
"gpu.select": "GPU Select Utilities",
"gpu.shader": "GPU Shader Utilities",
"gpu.state": "GPU State Utilities",
"gpu.texture": "GPU Texture Utilities",
"bmesh": "BMesh Module",
"bmesh.ops": "BMesh Operators",
"bmesh.types": "BMesh Types",

View File

@@ -1,4 +1,4 @@
/*
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@@ -38,8 +38,13 @@
#endif
#if defined(_MSC_VER)
# include <Windows.h>
# include <VersionHelpers.h> /* This needs to be included after Windows.h. */
# include <io.h>
# include <windows.h>
# if !defined(ENABLE_VIRTUAL_TERMINAL_PROCESSING)
# define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
# endif
#endif
/* For printing timestamp. */
@@ -228,6 +233,9 @@ enum eCLogColor {
#define COLOR_LEN (COLOR_RESET + 1)
static const char *clg_color_table[COLOR_LEN] = {NULL};
#ifdef _WIN32
static DWORD clg_previous_console_mode = 0;
#endif
static void clg_color_table_init(bool use_color)
{
@@ -548,13 +556,22 @@ static void CLG_ctx_output_set(CLogContext *ctx, void *file_handle)
#if defined(__unix__) || defined(__APPLE__)
ctx->use_color = isatty(ctx->output);
#elif defined(WIN32)
/* Windows Terminal supports color like the Linux terminals do while the standard console does
* not, the way to tell the two apart is to look at the `WT_SESSION` environment variable which
* will only be defined for Windows Terminal. */
/* As of Windows 10 build 18298 all the standard consoles supports color
* like the Linux Terminal do, but it needs to be turned on.
* To turn on colors we need to enable virtual terminal processing by passing the flag
* ENABLE_VIRTUAL_TERMINAL_PROCESSING into SetConsoleMode.
* If the system doesn't support virtual terminal processing it will fail silently and the flag
* will not be set. */
/* #getenv is used here rather than #BLI_getenv since it would be a bad level call
* and there are no benefits for using it in this context. */
ctx->use_color = isatty(ctx->output) && getenv("WT_SESSION");
GetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), &clg_previous_console_mode);
ctx->use_color = 0;
if (IsWindows10OrGreater() && isatty(ctx->output)) {
DWORD mode = clg_previous_console_mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING;
if (SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), mode)) {
ctx->use_color = 1;
}
}
#endif
}
@@ -638,6 +655,9 @@ static CLogContext *CLG_ctx_init(void)
static void CLG_ctx_free(CLogContext *ctx)
{
#if defined(WIN32)
SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), clg_previous_console_mode);
#endif
while (ctx->types != NULL) {
CLG_LogType *item = ctx->types;
ctx->types = item->next;

View File

@@ -646,6 +646,12 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
min=0, max=(1 << 24),
default=1,
)
preview_denoising_input_passes: EnumProperty(
name="Viewport Input Passes",
description="Passes used by the denoiser to distinguish noise from shader and geometry detail",
items=enum_denoising_input_passes,
default='RGB_ALBEDO',
)
debug_reset_timeout: FloatProperty(
name="Reset timeout",
@@ -1434,7 +1440,6 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
items=enum_denoising_input_passes,
default='RGB_ALBEDO',
)
denoising_openimagedenoise_input_passes: EnumProperty(
name="Input Passes",
description="Passes used by the denoiser to distinguish noise from shader and geometry detail",

View File

@@ -275,6 +275,8 @@ class CYCLES_RENDER_PT_sampling_denoising(CyclesButtonsPanel, Panel):
sub.prop(cscene, "denoiser", text="")
layout.separator()
heading = layout.column(align=False, heading="Viewport")
row = heading.row(align=True)
row.prop(cscene, "use_preview_denoising", text="")
@@ -285,6 +287,9 @@ class CYCLES_RENDER_PT_sampling_denoising(CyclesButtonsPanel, Panel):
sub = heading.row(align=True)
sub.active = cscene.use_preview_denoising
sub.prop(cscene, "preview_denoising_start_sample", text="Start Sample")
sub = heading.row(align=True)
sub.active = cscene.use_preview_denoising
sub.prop(cscene, "preview_denoising_input_passes", text="Input Passes")
class CYCLES_RENDER_PT_sampling_advanced(CyclesButtonsPanel, Panel):

View File

@@ -1005,6 +1005,9 @@ DenoiseParams BlenderSync::get_denoise_params(BL::Scene &b_scene,
cscene, "preview_denoiser", DENOISER_NUM, DENOISER_NONE);
denoising.start_sample = get_int(cscene, "preview_denoising_start_sample");
denoising.input_passes = (DenoiserInput)get_enum(
cscene, "preview_denoising_input_passes", DENOISER_INPUT_NUM, (int)denoising.input_passes);
/* Auto select fastest denoiser. */
if (denoising.type == DENOISER_NONE) {
if (!Device::available_devices(DEVICE_MASK_OPTIX).empty()) {

View File

@@ -107,9 +107,9 @@ BVHObjectBinning::BVHObjectBinning(const BVHRange &job,
/* map geometry to bins, unrolled once */
{
ssize_t i;
int64_t i;
for (i = 0; i < ssize_t(size()) - 1; i += 2) {
for (i = 0; i < int64_t(size()) - 1; i += 2) {
prefetch_L2(&prims[start() + i + 8]);
/* map even and odd primitive to bin */
@@ -146,7 +146,7 @@ BVHObjectBinning::BVHObjectBinning(const BVHRange &job,
}
/* for uneven number of primitives */
if (i < ssize_t(size())) {
if (i < int64_t(size())) {
/* map primitive to bin */
const BVHReference &prim0 = prims[start() + i];
BoundBox bounds0 = get_prim_bounds(prim0);
@@ -237,7 +237,7 @@ void BVHObjectBinning::split(BVHReference *prims,
BoundBox lcent_bounds = BoundBox::empty;
BoundBox rcent_bounds = BoundBox::empty;
ssize_t l = 0, r = N - 1;
int64_t l = 0, r = N - 1;
while (l <= r) {
prefetch_L2(&prims[start() + l + 8]);

View File

@@ -44,6 +44,7 @@ set(LIB
${OSL_LIBRARIES}
${OPENIMAGEIO_LIBRARIES}
${PUGIXML_LIBRARIES}
${CLANG_LIBRARIES}
${LLVM_LIBRARY}
)

View File

@@ -276,7 +276,6 @@ class AlembicObject : public Node {
MatrixSampleMap xform_samples;
Alembic::AbcGeom::IObject iobject;
Transform xform;
/* Set if the path points to a valid IObject whose type is supported. */
AbcSchemaType schema_type;

View File

@@ -1585,6 +1585,7 @@ void GeometryManager::device_update_preprocess(Device *device, Scene *scene, Pro
dscene->tri_patch.tag_realloc();
dscene->tri_vnormal.tag_realloc();
dscene->tri_patch_uv.tag_realloc();
dscene->tri_shader.tag_realloc();
dscene->patches.tag_realloc();
}

View File

@@ -46,17 +46,13 @@ void util_logging_init(const char *argv0)
#ifdef WITH_CYCLES_LOGGING
using CYCLES_GFLAGS_NAMESPACE::SetCommandLineOption;
/* Make it so ERROR messages are always print into console. */
char severity_fatal[32];
snprintf(severity_fatal, sizeof(severity_fatal), "%d", google::GLOG_ERROR);
google::InitGoogleLogging(argv0);
SetCommandLineOption("logtostderr", "1");
if (!is_verbosity_set()) {
SetCommandLineOption("v", "0");
}
SetCommandLineOption("stderrthreshold", severity_fatal);
SetCommandLineOption("minloglevel", severity_fatal);
SetCommandLineOption("stderrthreshold", "0");
SetCommandLineOption("minloglevel", "0");
#else
(void)argv0;
#endif
@@ -70,7 +66,7 @@ void util_logging_start()
if (!is_verbosity_set()) {
SetCommandLineOption("v", "2");
}
SetCommandLineOption("stderrthreshold", "1");
SetCommandLineOption("stderrthreshold", "0");
SetCommandLineOption("minloglevel", "0");
#endif
}

View File

@@ -278,7 +278,7 @@ GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext()
#ifdef GHOST_WAIT_FOR_VSYNC
{
GLint swapInt = 1;
/* wait for vsync, to avoid tearing artifacts */
/* Wait for vertical-sync, to avoid tearing artifacts. */
[m_openGLContext setValues:&swapInt forParameter:NSOpenGLCPSwapInterval];
}
#endif

View File

@@ -296,7 +296,7 @@ class GHOST_ImeWin32 {
* Disable the IME attached to the given window, i.e. prohibits any user-input
* events from being dispatched to the IME.
* In Chrome, this function is used when:
* * a rendeder process sets its input focus to a password input.
* * a renderer process sets its input focus to a password input.
* Parameters
* * window_handle [in] (HWND)
* Represents the window handle of the caller.

View File

@@ -80,7 +80,7 @@ static GHOST_TButtonMask convertButton(int button)
}
/**
* Converts Mac rawkey codes (same for Cocoa & Carbon)
* Converts Mac raw-key codes (same for Cocoa & Carbon)
* into GHOST key codes
* \param rawCode: The raw physical key code
* \param recvChar: the character ignoring modifiers (except for shift)
@@ -646,6 +646,11 @@ GHOST_TSuccess GHOST_SystemCocoa::init()
[NSApp setDelegate:appDelegate];
}
// AppKit provides automatic window tabbing. Blender is a single-tabbed application without a
// macOS tab bar, and should explicitly opt-out of this. This is also controlled by the macOS
// user default #NSWindowTabbingEnabled.
NSWindow.allowsAutomaticWindowTabbing = NO;
[NSApp finishLaunching];
[pool drain];

View File

@@ -225,9 +225,6 @@ GHOST_SystemWin32::GHOST_SystemWin32()
#ifdef WITH_INPUT_NDOF
m_ndofManager = new GHOST_NDOFManagerWin32(*this);
#endif
getCursorPosition(m_mousePosX, m_mousePosY);
m_mouseTimestamp = ::GetTickCount();
}
GHOST_SystemWin32::~GHOST_SystemWin32()
@@ -937,23 +934,15 @@ GHOST_EventButton *GHOST_SystemWin32::processButtonEvent(GHOST_TEventType type,
{
GHOST_SystemWin32 *system = (GHOST_SystemWin32 *)getSystem();
GHOST_TabletData td = GHOST_TABLET_DATA_NONE;
if (window->m_tabletInRange) {
td = window->getTabletData();
/* Check if tablet cursor position is in sync with Win32 cursor position, if not then move
* cursor to position where button event occurred. */
DWORD msgPos = ::GetMessagePos();
int msgPosX = GET_X_LPARAM(msgPos);
int msgPosY = GET_Y_LPARAM(msgPos);
if (msgPosX != system->m_mousePosX || msgPosY != system->m_mousePosY) {
system->pushEvent(new GHOST_EventCursor(
::GetMessageTime(), GHOST_kEventCursorMove, window, msgPosX, msgPosY, td));
}
if (type == GHOST_kEventButtonDown) {
window->updateMouseCapture(MousePressed);
}
else if (type == GHOST_kEventButtonUp) {
window->updateMouseCapture(MouseReleased);
}
return new GHOST_EventButton(system->getMilliSeconds(), type, window, mask, td);
return new GHOST_EventButton(
system->getMilliSeconds(), type, window, mask, window->getTabletData());
}
void GHOST_SystemWin32::processPointerEvent(
@@ -1033,82 +1022,26 @@ void GHOST_SystemWin32::processPointerEvent(
system->setCursorPosition(pointerInfo[0].pixelLocation.x, pointerInfo[0].pixelLocation.y);
}
void GHOST_SystemWin32::processCursorEvent(GHOST_WindowWin32 *window)
GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_WindowWin32 *window)
{
if (window->m_tabletInRange && window->useTabletAPI(GHOST_kTabletNative)) {
/* Tablet input handled in WM_POINTER* events. WM_MOUSEMOVE events in response to tablet
* input aren't normally generated when using WM_POINTER events, but manually moving the
* system cursor as we do in WM_POINTER handling does. */
return;
}
GHOST_TInt32 x_screen, y_screen;
GHOST_SystemWin32 *system = (GHOST_SystemWin32 *)getSystem();
GHOST_TabletData td = window->getTabletData();
DWORD msgPos = ::GetMessagePos();
LONG msgTime = ::GetMessageTime();
/* GetMessagePointsEx processes points as 16 bit integers and can fail or return erroneous values
* if negative input is not truncated. */
int msgPosX = GET_X_LPARAM(msgPos) & 0x0000FFFF;
int msgPosY = GET_Y_LPARAM(msgPos) & 0x0000FFFF;
const int maxPoints = 64;
MOUSEMOVEPOINT currentPoint = {msgPosX, msgPosY, (DWORD)msgTime, 0};
MOUSEMOVEPOINT points[maxPoints] = {0};
/* GetMouseMovePointsEx returns the number of points returned that are less than or equal to the
* requested point. If the requested point is the most recent, this returns up to 64 requested
* points. */
int numPoints = ::GetMouseMovePointsEx(
sizeof(MOUSEMOVEPOINT), &currentPoint, points, maxPoints, GMMP_USE_DISPLAY_POINTS);
if (numPoints == -1) {
/* Points at edge of screen are often not in the queue, use the message's point instead. */
numPoints = 1;
points[0] = currentPoint;
}
GHOST_TInt32 x_accum = 0, y_accum = 0;
window->getCursorGrabAccum(x_accum, y_accum);
/* Points are in reverse chronological order. Find least recent, unprocessed mouse move. */
int i;
for (i = 0; i < numPoints; i++) {
if (points[i].time < system->m_mouseTimestamp) {
break;
}
/* GetMouseMovePointsEx returns 16 bit number as 32 bit. If negative, we need to sign extend.
*/
points[i].x = points[i].x > 32767 ? points[i].x | 0xFFFF0000 : points[i].x;
points[i].y = points[i].y > 32767 ? points[i].y | 0xFFFF0000 : points[i].y;
if (points[i].time == system->m_mouseTimestamp && points[i].x == system->m_mousePosX &&
points[i].y == system->m_mousePosY) {
break;
if (window->m_tabletInRange) {
if (window->useTabletAPI(GHOST_kTabletNative)) {
/* Tablet input handled in WM_POINTER* events. WM_MOUSEMOVE events in response to tablet
* input aren't normally generated when using WM_POINTER events, but manually moving the
* system cursor as we do in WM_POINTER handling does. */
return NULL;
}
}
while (--i >= 0) {
system->pushEvent(new GHOST_EventCursor(system->getMilliSeconds(),
GHOST_kEventCursorMove,
window,
points[i].x + x_accum,
points[i].y + y_accum,
td));
}
DWORD lastTimestamp = points[0].time;
system->getCursorPosition(x_screen, y_screen);
/* Check if we need to wrap the cursor. */
if (window->getCursorGrabModeIsWarp() && !window->m_tabletInRange) {
/* Wrap based on current cursor position in case Win32 mouse move queue is out of order due to
* prior wrap. */
POINT point;
::GetCursorPos(&point);
GHOST_TInt32 x_current = point.x;
GHOST_TInt32 y_current = point.y;
GHOST_TInt32 x_wrap = point.x;
GHOST_TInt32 y_wrap = point.y;
GHOST_TInt32 x_new = x_screen;
GHOST_TInt32 y_new = y_screen;
GHOST_TInt32 x_accum, y_accum;
GHOST_Rect bounds;
/* Fallback to window bounds. */
@@ -1118,24 +1051,33 @@ void GHOST_SystemWin32::processCursorEvent(GHOST_WindowWin32 *window)
/* Could also clamp to screen bounds wrap with a window outside the view will fail atm.
* Use offset of 8 in case the window is at screen bounds. */
bounds.wrapPoint(x_wrap, y_wrap, 2, window->getCursorGrabAxis());
bounds.wrapPoint(x_new, y_new, 2, window->getCursorGrabAxis());
if (x_wrap != x_current || y_wrap != y_current) {
system->setCursorPosition(x_wrap, y_wrap);
window->setCursorGrabAccum(x_accum + (x_current - x_wrap), y_accum + (y_current - y_wrap));
/* First message after SendInput wrap is invalid for unknown reasons, skip events until one
* tick after SendInput event time. */
lastTimestamp = ::GetTickCount() + 1;
window->getCursorGrabAccum(x_accum, y_accum);
if (x_new != x_screen || y_new != y_screen) {
/* When wrapping we don't need to add an event because the setCursorPosition call will cause
* a new event after. */
system->setCursorPosition(x_new, y_new); /* wrap */
window->setCursorGrabAccum(x_accum + (x_screen - x_new), y_accum + (y_screen - y_new));
}
else {
return new GHOST_EventCursor(system->getMilliSeconds(),
GHOST_kEventCursorMove,
window,
x_screen + x_accum,
y_screen + y_accum,
window->getTabletData());
}
}
system->m_mousePosX = points[0].x;
system->m_mousePosY = points[0].y;
/* Use latest time, checking for overflow. */
if (lastTimestamp > system->m_mouseTimestamp || ::GetTickCount() < system->m_mouseTimestamp) {
system->m_mouseTimestamp = lastTimestamp;
else {
return new GHOST_EventCursor(system->getMilliSeconds(),
GHOST_kEventCursorMove,
window,
x_screen,
y_screen,
window->getTabletData());
}
return NULL;
}
void GHOST_SystemWin32::processWheelEvent(GHOST_WindowWin32 *window, WPARAM wParam, LPARAM lParam)
@@ -1511,10 +1453,6 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
////////////////////////////////////////////////////////////////////////
// Wintab events, processed
////////////////////////////////////////////////////////////////////////
case WT_INFOCHANGE:
window->processWintabInfoChangeEvent(lParam);
eventHandled = true;
break;
case WT_PACKET:
window->processWin32TabletEvent(wParam, lParam);
break;
@@ -1536,52 +1474,41 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
// Mouse events, processed
////////////////////////////////////////////////////////////////////////
case WM_LBUTTONDOWN:
window->updateMouseCapture(MousePressed);
event = processButtonEvent(GHOST_kEventButtonDown, window, GHOST_kButtonMaskLeft);
break;
case WM_MBUTTONDOWN:
window->updateMouseCapture(MousePressed);
event = processButtonEvent(GHOST_kEventButtonDown, window, GHOST_kButtonMaskMiddle);
break;
case WM_RBUTTONDOWN:
window->updateMouseCapture(MousePressed);
event = processButtonEvent(GHOST_kEventButtonDown, window, GHOST_kButtonMaskRight);
break;
case WM_XBUTTONDOWN:
if ((short)HIWORD(wParam) == XBUTTON1) {
window->updateMouseCapture(MousePressed);
event = processButtonEvent(GHOST_kEventButtonDown, window, GHOST_kButtonMaskButton4);
}
else if ((short)HIWORD(wParam) == XBUTTON2) {
window->updateMouseCapture(MousePressed);
event = processButtonEvent(GHOST_kEventButtonDown, window, GHOST_kButtonMaskButton5);
}
break;
case WM_LBUTTONUP:
window->updateMouseCapture(MouseReleased);
event = processButtonEvent(GHOST_kEventButtonUp, window, GHOST_kButtonMaskLeft);
break;
case WM_MBUTTONUP:
window->updateMouseCapture(MouseReleased);
event = processButtonEvent(GHOST_kEventButtonUp, window, GHOST_kButtonMaskMiddle);
break;
case WM_RBUTTONUP:
window->updateMouseCapture(MouseReleased);
event = processButtonEvent(GHOST_kEventButtonUp, window, GHOST_kButtonMaskRight);
break;
case WM_XBUTTONUP:
if ((short)HIWORD(wParam) == XBUTTON1) {
window->updateMouseCapture(MouseReleased);
event = processButtonEvent(GHOST_kEventButtonUp, window, GHOST_kButtonMaskButton4);
}
else if ((short)HIWORD(wParam) == XBUTTON2) {
window->updateMouseCapture(MouseReleased);
event = processButtonEvent(GHOST_kEventButtonUp, window, GHOST_kButtonMaskButton5);
}
break;
case WM_MOUSEMOVE:
processCursorEvent(window);
eventHandled = true;
event = processCursorEvent(window);
break;
case WM_MOUSEWHEEL: {
/* The WM_MOUSEWHEEL message is sent to the focus window

View File

@@ -308,12 +308,6 @@ class GHOST_SystemWin32 : public GHOST_System {
GHOST_WindowWin32 *window,
GHOST_TButtonMask mask);
/**
* Creates tablet events from Wintab events.
* \param window: The window receiving the event (the active window).
*/
static void processWintabEvent(GHOST_WindowWin32 *window);
/**
* Creates tablet events from pointer events.
* \param type: The type of pointer event.
@@ -328,8 +322,9 @@ class GHOST_SystemWin32 : public GHOST_System {
/**
* Creates cursor event.
* \param window: The window receiving the event (the active window).
* \return The event created.
*/
static void processCursorEvent(GHOST_WindowWin32 *window);
static GHOST_EventCursor *processCursorEvent(GHOST_WindowWin32 *window);
/**
* Handles a mouse wheel event.
@@ -453,13 +448,6 @@ class GHOST_SystemWin32 : public GHOST_System {
/** Wheel delta accumulator. */
int m_wheelDeltaAccum;
/** Last mouse x position. */
int m_mousePosX;
/** Last mouse y position. */
int m_mousePosY;
/** Last mouse timestamp. */
DWORD m_mouseTimestamp;
};
inline void GHOST_SystemWin32::retrieveModifierKeys(GHOST_ModifierKeys &keys) const

View File

@@ -34,9 +34,9 @@
#ifdef WITH_X11_XINPUT
# include <X11/extensions/XInput.h>
/* Disable xinput warp, currently not implemented by Xorg for multi-head display.
* (see comment in xserver "Xi/xiwarppointer.c" -> "FIXME: panoramix stuff is missing" ~ v1.13.4)
* If this is supported we can add back xinput for warping (fixing T48901).
/* Disable XINPUT warp, currently not implemented by Xorg for multi-head display.
* (see comment in XSERVER `Xi/xiwarppointer.c` -> `FIXME: panoramix stuff is missing` ~ v1.13.4)
* If this is supported we can add back XINPUT for warping (fixing T48901).
* For now disable (see T50383). */
// # define USE_X11_XINPUT_WARP
#endif

View File

@@ -336,11 +336,6 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(GHOST_SystemCocoa *systemCocoa,
backing:NSBackingStoreBuffered
defer:NO];
if (m_window == nil) {
[pool drain];
return;
}
[m_window setSystemAndWindowCocoa:systemCocoa windowCocoa:this];
// Forbid to resize the window below the blender defined minimum one

View File

@@ -253,7 +253,7 @@
- (NSAttributedString *)attributedSubstringFromRange:(NSRange)range
{
return [NSAttributedString new]; // XXX does this leak?
return [[[NSAttributedString alloc] init] autorelease];
}
- (NSRange)markedRange
@@ -284,7 +284,7 @@
- (NSArray *)validAttributesForMarkedText
{
return [NSArray array]; // XXX does this leak?
return [NSArray array];
}
@end

View File

@@ -92,16 +92,11 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system,
{
wchar_t *title_16 = alloc_utf16_from_8((char *)title, 0);
RECT win_rect = {left, top, (long)(left + width), (long)(top + height)};
RECT parent_rect = {0, 0, 0, 0};
// Initialize tablet variables
memset(&m_wintab, 0, sizeof(m_wintab));
m_tabletData = GHOST_TABLET_DATA_NONE;
if (parentwindow) {
GetWindowRect(m_parentWindowHwnd, &parent_rect);
}
DWORD style = parentwindow ?
WS_POPUPWINDOW | WS_CAPTION | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SIZEBOX :
WS_OVERLAPPEDWINDOW;
@@ -124,9 +119,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system,
MONITORINFOEX monitor;
monitor.cbSize = sizeof(MONITORINFOEX);
monitor.dwFlags = 0;
GetMonitorInfo(
MonitorFromRect(parentwindow ? &parent_rect : &win_rect, MONITOR_DEFAULTTONEAREST),
&monitor);
GetMonitorInfo(MonitorFromRect(&win_rect, MONITOR_DEFAULTTONEAREST), &monitor);
/* Adjust our requested size to allow for caption and borders and constrain to monitor. */
AdjustWindowRectEx(&win_rect, WS_CAPTION, FALSE, 0);
@@ -299,8 +292,6 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system,
if (m_wintab.enable && m_wintab.tablet) {
m_wintab.enable(m_wintab.tablet, TRUE);
}
m_wintab.info(WTI_INTERFACE, IFC_NDEVICES, &m_wintab.numDevices);
}
}
CoCreateInstance(
@@ -1033,7 +1024,7 @@ bool GHOST_WindowWin32::useTabletAPI(GHOST_TTabletAPI api) const
return true;
}
else if (m_system->getTabletAPI() == GHOST_kTabletAutomatic) {
if (m_wintab.numDevices)
if (m_wintab.tablet)
return api == GHOST_kTabletWintab;
else
return api == GHOST_kTabletNative;
@@ -1075,14 +1066,6 @@ void GHOST_WindowWin32::processWin32TabletInitEvent()
m_tabletData.Active = GHOST_kTabletModeNone;
}
void GHOST_WindowWin32::processWintabInfoChangeEvent(LPARAM lParam)
{
/* Update number of connected Wintab digitizers */
if (LOWORD(lParam) == WTI_INTERFACE && HIWORD(lParam) == IFC_NDEVICES) {
m_wintab.info(WTI_INTERFACE, IFC_NDEVICES, &m_wintab.numDevices);
}
}
void GHOST_WindowWin32::processWin32TabletEvent(WPARAM wParam, LPARAM lParam)
{
if (!useTabletAPI(GHOST_kTabletWintab)) {
@@ -1210,7 +1193,7 @@ GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(GHOST_TUns8 *bitmap
GHOST_TUns32 fullBitRow, fullMaskRow;
int x, y, cols;
cols = sizeX / 8; /* Number of whole bytes per row (width of bm/mask). */
cols = sizeX / 8; /* Number of whole bytes per row (width of bitmap/mask). */
if (sizeX % 8)
cols++;

View File

@@ -446,12 +446,6 @@ class GHOST_WindowWin32 : public GHOST_Window {
WPARAM wParam,
LPARAM lParam);
/**
* Handle Wintab info changes such as change in number of connected tablets.
* \param lParam: LPARAM of the event.
*/
void processWintabInfoChangeEvent(LPARAM lParam);
void processWin32TabletActivateEvent(WORD state);
void processWin32TabletInitEvent();
void processWin32TabletEvent(WPARAM wParam, LPARAM lParam);
@@ -576,7 +570,6 @@ class GHOST_WindowWin32 : public GHOST_Window {
HCTX tablet;
LONG maxPressure;
LONG maxAzimuth, maxAltitude;
UINT numDevices;
} m_wintab;
GHOST_TWindowState m_normal_state;

View File

@@ -35,16 +35,13 @@ static bool is_verbosity_set() {
void libmv_initLogging(const char* argv0) {
using LIBMV_GFLAGS_NAMESPACE::SetCommandLineOption;
// Make it so ERROR messages are always print into console.
char severity_fatal[32];
snprintf(severity_fatal, sizeof(severity_fatal), "%d",
google::GLOG_ERROR);
google::InitGoogleLogging(argv0);
SetCommandLineOption("logtostderr", "1");
if (!is_verbosity_set()) {
SetCommandLineOption("v", "0");
}
SetCommandLineOption("stderrthreshold", severity_fatal);
SetCommandLineOption("minloglevel", severity_fatal);
SetCommandLineOption("stderrthreshold", "0");
SetCommandLineOption("minloglevel", "0");
}
void libmv_startDebugLogging(void) {
@@ -53,7 +50,7 @@ void libmv_startDebugLogging(void) {
if (!is_verbosity_set()) {
SetCommandLineOption("v", "2");
}
SetCommandLineOption("stderrthreshold", "1");
SetCommandLineOption("stderrthreshold", "0");
SetCommandLineOption("minloglevel", "0");
}

View File

@@ -758,7 +758,7 @@ bool EuclideanResectionPPnP(const Mat2X &x_camera,
Z = Zmindiag.asDiagonal();
E = Y - Z*PR;
error = (E - E_old).norm();
LOG(INFO) << "PPnP error(" << (iteration++) << "): " << error;
LG << "PPnP error(" << (iteration++) << "): " << error;
E_old = E;
}
*t = -*R*c;

View File

@@ -352,7 +352,7 @@ struct ReprojectionErrorInvertIntrinsics {
// Print a message to the log which camera intrinsics are gonna to be optimized.
void BundleIntrinsicsLogMessage(const int bundle_intrinsics) {
if (bundle_intrinsics == BUNDLE_NO_INTRINSICS) {
LOG(INFO) << "Bundling only camera positions.";
LG << "Bundling only camera positions.";
} else {
std::string bundling_message = "";
@@ -373,7 +373,7 @@ void BundleIntrinsicsLogMessage(const int bundle_intrinsics) {
APPEND_BUNDLING_INTRINSICS("p1", BUNDLE_TANGENTIAL_P1);
APPEND_BUNDLING_INTRINSICS("p2", BUNDLE_TANGENTIAL_P2);
LOG(INFO) << "Bundling " << bundling_message << ".";
LG << "Bundling " << bundling_message << ".";
}
}

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 2.5 MiB

After

Width:  |  Height:  |  Size: 2.5 MiB

View File

@@ -1009,6 +1009,34 @@ const bTheme U_theme_default = {
.facedot_size = 4,
.gp_vertex_size = 3,
},
.space_spreadsheet = {
.back = RGBA(0x28282800),
.title = RGBA(0xffffffff),
.text = RGBA(0xe6e6e6ff),
.text_hi = RGBA(0xffffffff),
.header = RGBA(0x2e2e2eff),
.header_text = RGBA(0xeeeeeeff),
.header_text_hi = RGBA(0xffffffff),
.tab_active = RGBA(0x4b4b4bff),
.tab_inactive = RGBA(0x2b2b2bff),
.tab_back = RGBA(0x232323ff),
.tab_outline = RGBA(0x232323ff),
.button = RGBA(0x4b4b4bff),
.button_title = RGBA(0xffffffff),
.button_text = RGBA(0xe5e5e5ff),
.button_text_hi = RGBA(0xffffffff),
.execution_buts = RGBA(0x444444ff),
.panelcolors = {
.header = RGBA(0x4b4b4bff),
.back = RGBA(0x404040ff),
.sub_back = RGBA(0x0000003e),
},
.hilite = RGBA(0x4f76b3ff),
.vertex_size = 3,
.outline_width = 1,
.facedot_size = 4,
.row_alternate = RGBA(0xffffff07),
},
.tarm = {
{
.solid = RGBA(0x9a0000ff),

View File

@@ -40,6 +40,50 @@
</screenshot>
</screenshots>
<releases>
<release version="2.92" date="2021-02-25">
<description>
<p>New features:</p>
<ul>
<li>Geometry nodes</li>
<li>EEVEE AOV and Cryptomatte support</li>
<li>Grease pencil Bézier curves edit</li>
<li>APIC fluid simulation method</li>
<li>Add primitive tool</li>
</ul>
<p>Enhancements:</p>
<ul>
<li>Silhouette, elastic snake and smearing for sculpting</li>
<li>Grease pencil tracing image sequences support</li>
<li>Sparse NanoVDB grid for volume</li>
<li>OptiX hybrid rendering and new AO and bevel</li>
<li>Viscosity settings for fluid simulation</li>
</ul>
</description>
</release>
<release version="2.91" date="2020-11-25">
<description>
<p>New features:</p>
<ul>
<li>Volume modifiers</li>
<li>Precise boolean</li>
<li>Cloth brush collision</li>
<li>Custom curve bevels</li>
<li>Grease Pencil image tracer</li>
<li>Property search and fuzzy search</li>
</ul>
<p>Enhancements:</p>
<ul>
<li>Boundary and pose cloth brushes</li>
<li>Material holdout for Grease Pencil</li>
<li>Sculpting gestures</li>
<li>Overrides resync and transform support</li>
<li>Animation proxy conversion</li>
<li>Compound shape collision</li>
<li>Outliner collection colors</li>
<li>Snappier F-Curves and seamless keyframe insertion</li>
</ul>
</description>
</release>
<release version="2.90" date="2020-08-31">
<description>
<p>New features:</p>

View File

@@ -114,6 +114,7 @@ _km_hierarchy = [
('Custom Normals Modal Map', 'EMPTY', 'WINDOW', []),
('Bevel Modal Map', 'EMPTY', 'WINDOW', []),
('Paint Stroke Modal', 'EMPTY', 'WINDOW', []),
('Sculpt Expand Modal', 'EMPTY', 'WINDOW', []),
('Paint Curve', 'EMPTY', 'WINDOW', []),
('Object Non-modal', 'EMPTY', 'WINDOW', []), # mode change

View File

@@ -0,0 +1,61 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
import bpy
class SpreadsheetDrawer:
def get_row_amount(self):
return 0
def get_column_amount(self):
return 0
def get_top_row_cell(self, column_index):
return None
def get_left_column_cell(self, row_index):
return None
def get_content_cell(self, row_index, column_index):
return None
class PropertiesSpreadsheet(SpreadsheetDrawer):
def __init__(self, owners, property_names):
self.owners = owners
self.property_names = property_names
def get_row_amount(self):
return len(self.owners)
def get_column_amount(self):
return len(self.property_names)
def get_top_row_cell(self, column_index):
return self.property_names[column_index]
def get_left_column_cell(self, row_index):
return row_index
def get_content_cell(self, row_index, column_index):
owner = self.owners[row_index]
return (owner, self.property_names[column_index])
def get_spreadsheet_drawer(spreadsheet_space: bpy.types.SpaceSpreadsheet):
prop_names = ["name", "location.x", "location.y", "location.z", '["a"]']
return PropertiesSpreadsheet(list(bpy.context.selected_objects), prop_names)

View File

@@ -900,6 +900,7 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
layout = self.layout
import os
import re
import bpy.utils
layout = self.layout
@@ -920,7 +921,11 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
(filter_path(f)))
])
files.sort()
# Perform a "natural sort", so 20 comes after 3 (for example).
files.sort(
key=lambda file_path:
tuple(int(t) if t.isdigit() else t for t in re.split("(\d+)", file_path[0].lower())),
)
col = layout.column(align=True)

View File

@@ -107,11 +107,7 @@ def get_argspec(func, strip_self=True, doc=None, source=None):
try:
func = func.__func__
except AttributeError:
try:
# py 2.X
func = func.im_func
except AttributeError:
pass
pass
# is callable?
if not hasattr(func, '__call__'):
return ''
@@ -141,14 +137,10 @@ def get_argspec(func, strip_self=True, doc=None, source=None):
argspec = inspect.formatargspec(*inspect.getfullargspec(func))
except:
try:
# py 2.X
argspec = inspect.formatargspec(*inspect.getargspec(func))
argspec = inspect.formatargvalues(
*inspect.getargvalues(func))
except:
try:
argspec = inspect.formatargvalues(
*inspect.getargvalues(func))
except:
argspec = ''
argspec = ''
if strip_self:
argspec = argspec.replace('self, ', '')
return argspec

View File

@@ -26,14 +26,21 @@ def build_property_typemap(skip_classes, skip_typemap):
property_typemap = {}
for attr in dir(bpy.types):
# Skip internal methods.
if attr.startswith("_"):
continue
cls = getattr(bpy.types, attr)
if issubclass(cls, skip_classes):
continue
bl_rna = getattr(cls, "bl_rna", None)
# Needed to skip classes added to the modules `__dict__`.
if bl_rna is None:
continue
# # to support skip-save we can't get all props
# properties = cls.bl_rna.properties.keys()
# properties = bl_rna.properties.keys()
properties = []
for prop_id, prop in cls.bl_rna.properties.items():
for prop_id, prop in bl_rna.properties.items():
if not prop.is_skip_save:
properties.append(prop_id)

View File

@@ -0,0 +1,3 @@
import bpy
bpy.context.scene.render.fps = 120
bpy.context.scene.render.fps_base = 1

View File

@@ -0,0 +1,3 @@
import bpy
bpy.context.scene.render.fps = 240
bpy.context.scene.render.fps_base = 1

View File

@@ -1316,6 +1316,42 @@
</space>
</ThemeStatusBar>
</statusbar>
<spreadsheet>
<ThemeSpreadsheet
row_alternate="#ffffff0f"
>
<space>
<ThemeSpaceGeneric
back="#999999"
title="#000000"
text="#000000"
text_hi="#ffffff"
header="#adadadff"
header_text="#000000"
header_text_hi="#ffffff"
button="#999999e6"
button_title="#1a1a1a"
button_text="#000000"
button_text_hi="#ffffff"
navigation_bar="#00000000"
execution_buts="#999999e6"
tab_active="#6697e6"
tab_inactive="#cccccc"
tab_back="#999999ff"
tab_outline="#999999"
>
<panelcolors>
<ThemePanelColors
header="#42424200"
back="#00000028"
sub_back="#00000024"
>
</ThemePanelColors>
</panelcolors>
</ThemeSpaceGeneric>
</space>
</ThemeSpreadsheet>
</spreadsheet>
<bone_color_sets>
<ThemeBoneColorSet
normal="#9a0000"

View File

@@ -4470,6 +4470,15 @@ def km_sculpt(params):
{"properties": [("mode", 'INVERT')]}),
("sculpt.brush_stroke", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("mode", 'SMOOTH')]}),
# Expand
("sculpt.expand", {"type": 'A', "value": 'PRESS', "shift": True},
{"properties": [("target", "MASK"), ("falloff_type", "GEODESIC"), ("invert", True)]}),
("sculpt.expand", {"type": 'A', "value": 'PRESS', "shift": True, "alt": True},
{"properties": [("target", "MASK"), ("falloff_type", "NORMALS"), ("invert", False)]}),
("sculpt.expand", {"type": 'W', "value": 'PRESS', "shift": True},
{"properties": [("target", "FACE_SETS"), ("falloff_type", "GEODESIC"), ("invert", False), ("use_modify_active", False)]}),
("sculpt.expand", {"type": 'W', "value": 'PRESS', "shift": True, "alt": True},
{"properties": [("target", "FACE_SETS"), ("falloff_type", "BOUNDARY_FACE_SET"),("invert", False), ("use_modify_active", True)]}),
# Partial Visibility Show/hide
("sculpt.face_set_change_visibility", {"type": 'H', "value": 'PRESS'},
{"properties": [("mode", 'TOGGLE')]}),
@@ -4477,8 +4486,6 @@ def km_sculpt(params):
{"properties": [("mode", 'HIDE_ACTIVE')]}),
("sculpt.face_set_change_visibility", {"type": 'H', "value": 'PRESS', "alt": True},
{"properties": [("mode", 'SHOW_ALL')]}),
("sculpt.mask_expand", {"type": 'W', "value": 'PRESS', "shift": True},
{"properties": [("use_normals", False), ("keep_previous_mask", False), ("invert", False), ("smooth_iterations", 0), ("create_face_set", True)]}),
("sculpt.face_set_edit", {"type": 'W', "value": 'PRESS', "ctrl": True},
{"properties": [("mode", 'GROW')]}),
("sculpt.face_set_edit", {"type": 'W', "value": 'PRESS', "ctrl": True, "alt": True},
@@ -4499,10 +4506,6 @@ def km_sculpt(params):
("paint.mask_lasso_gesture", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, None),
("wm.context_toggle", {"type": 'M', "value": 'PRESS', "ctrl": True},
{"properties": [("data_path", 'scene.tool_settings.sculpt.show_mask')]}),
("sculpt.mask_expand", {"type": 'A', "value": 'PRESS', "shift": True},
{"properties": [("use_normals", False), ("keep_previous_mask", False), ("invert", True), ("smooth_iterations", 2), ("create_face_set", False)]}),
("sculpt.mask_expand", {"type": 'A', "value": 'PRESS', "shift": True, 'alt': True},
{"properties": [("use_normals", True), ("keep_previous_mask", True), ("invert", False), ("smooth_iterations", 0), ("create_face_set", False)]}),
# Dynamic topology
("sculpt.dynamic_topology_toggle", {"type": 'D', "value": 'PRESS', "ctrl": True}, None),
("sculpt.dyntopo_detail_size_edit", {"type": 'D', "value": 'PRESS', "shift": True}, None),
@@ -5571,6 +5574,39 @@ def km_paint_stroke_modal(_params):
return keymap
def km_sculpt_expand_modal(_params):
items = []
keymap = (
"Sculpt Expand Modal",
{"space_type": 'EMPTY', "region_type": 'WINDOW', "modal": True},
{"items": items},
)
items.extend([
("CANCEL", {"type": 'ESC', "value": 'PRESS', "any": True}, None),
("CANCEL", {"type": 'RIGHTMOUSE', "value": 'PRESS', "any": True}, None),
("CONFIRM", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None),
("INVERT", {"type": 'F', "value": 'PRESS', "any": True, "repeat" : False}, None),
("PRESERVE", {"type": 'E', "value": 'PRESS', "any": True, "repeat" : False}, None),
("GRADIENT", {"type": 'G', "value": 'PRESS', "any": True, "repeat" : False}, None),
("RECURSION_STEP_GEODESIC", {"type": 'R', "value": 'PRESS', "repeat" : False}, None),
("RECURSION_STEP_TOPOLOGY", {"type": 'R', "value": 'PRESS', "alt" : True ,"any": True, "repeat" : False}, None),
("MOVE_TOGGLE", {"type": 'SPACE', "value": 'ANY', "any": True, "repeat" : False}, None),
("FALLOFF_GEODESICS", {"type": 'ONE', "value": 'PRESS', "any": True, "repeat" : False}, None),
("FALLOFF_TOPOLOGY", {"type": 'TWO', "value": 'PRESS', "any": True, "repeat" : False}, None),
("FALLOFF_TOPOLOGY_DIAGONALS", {"type": 'THREE', "value": 'PRESS', "any": True, "repeat" : False}, None),
("FALLOFF_SPHERICAL", {"type": 'FOUR', "value": 'PRESS', "any": True, "repeat" : False}, None),
("SNAP_TOGGLE", {"type": 'LEFT_CTRL', "value": 'ANY', "repeat" : False}, None),
("LOOP_COUNT_INCREASE", {"type": 'W', "value": 'PRESS', "any": True, "repeat" : True}, None),
("LOOP_COUNT_DECREASE", {"type": 'Q', "value": 'PRESS', "any": True, "repeat" : True}, None),
("BRUSH_GRADIENT_TOGGLE", {"type": 'B', "value": 'PRESS', "any": True, "repeat" : False}, None),
("TEXTURE_DISTORTION_INCREASE", {"type": 'Y', "value": 'PRESS', "any": False, "repeat" : True}, None),
("TEXTURE_DISTORTION_DECREASE", {"type": 'T', "value": 'PRESS', "any": False, "repeat" : True}, None),
])
return keymap
# Fallback for gizmos that don't have custom a custom key-map.
def km_generic_gizmo(_params):
@@ -7085,6 +7121,7 @@ def generate_keymaps(params=None):
km_view3d_zoom_modal(params),
km_view3d_dolly_modal(params),
km_paint_stroke_modal(params),
km_sculpt_expand_modal(params),
# Gizmos.
km_generic_gizmo(params),

View File

@@ -58,6 +58,7 @@ def load_handler(dummy):
# Grease pencil object
scene = bpy.data.scenes[0]
if scene:
scene.tool_settings.use_keyframe_insert_auto = True
for ob in scene.objects:
if ob.type == 'GPENCIL':
gpd = ob.data

View File

@@ -45,6 +45,7 @@ _modules = [
"rigidbody",
"screen_play_rendered_anim",
"sequencer",
"spreadsheet",
"userpref",
"uvcalc_follow_active",
"uvcalc_lightmap",

View File

@@ -366,9 +366,9 @@ class AlignObjects(Operator):
bb_quality: BoolProperty(
name="High Quality",
description=(
"Enables high quality calculation of the "
"Enables high quality but slow calculation of the "
"bounding box for perfect results on complex "
"shape meshes with rotation/scale (Slow)"
"shape meshes with rotation/scale"
),
default=True,
)

View File

@@ -0,0 +1,47 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
from __future__ import annotations
import bpy
class SPREADSHEET_OT_toggle_pin(bpy.types.Operator):
'''Turn on or off pinning'''
bl_idname = "spreadsheet.toggle_pin"
bl_label = "Toggle Pin"
bl_options = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
space = context.space_data
return space and space.type == 'SPREADSHEET'
def execute(self, context):
space = context.space_data
if space.pinned_id:
space.pinned_id = None
else:
space.pinned_id = context.active_object
return {'FINISHED'}
classes = (
SPREADSHEET_OT_toggle_pin,
)

View File

@@ -614,8 +614,8 @@ class LightMapPack(Operator):
PREF_PACK_IN_ONE: BoolProperty(
name="Share Texture Space",
description=(
"Objects Share texture space, map all objects "
"into 1 uvmap"
"Objects share texture space, map all objects "
"into a single UV map"
),
default=True,
)

View File

@@ -1220,11 +1220,14 @@ class WM_OT_properties_edit(Operator):
)
subtype: EnumProperty(
name="Subtype",
items=lambda self, _context: WM_OT_properties_edit.subtype_items,
items=WM_OT_properties_edit._subtype_items_fn,
)
subtype_items = rna_vector_subtype_items
def _subtype_items_fn(_self, _context):
return WM_OT_properties_edit.subtype_items
def _init_subtype(self, prop_type, is_array, subtype):
subtype = subtype or 'NONE'
subtype_items = rna_vector_subtype_items
@@ -2063,7 +2066,7 @@ class WM_OT_batch_rename(Operator):
# Enum identifiers are compared with 'object.type'.
('MESH', "Meshes", ""),
('CURVE', "Curves", ""),
('META', "Meta Balls", ""),
('META', "Metaballs", ""),
('ARMATURE', "Armatures", ""),
('LATTICE', "Lattices", ""),
('GPENCIL', "Grease Pencils", ""),

View File

@@ -86,6 +86,7 @@ _modules = [
"space_outliner",
"space_properties",
"space_sequencer",
"space_spreadsheet",
"space_statusbar",
"space_text",
"space_time",

View File

@@ -328,11 +328,6 @@ class GPENCIL_MT_material_active(Menu):
@classmethod
def poll(cls, context):
ob = context.active_object
tool_settings = context.scene.tool_settings
mode = tool_settings.gpencil_paint.color_mode
if mode != 'MATERIAL':
return False
if ob is None or len(ob.material_slots) == 0:
return False
@@ -478,6 +473,7 @@ class AnnotationDataPanel:
tool_settings = context.tool_settings
if gpd and gpl:
layout.prop(gpl, "opacity", text="Opacity", slider=True)
layout.prop(gpl, "thickness")
else:
layout.prop(tool_settings, "annotation_thickness", text="Thickness")

View File

@@ -80,7 +80,7 @@ class RENDER_PT_dimensions(RenderOutputButtonsPanel, Panel):
fps_rate = round(fps / fps_base, 2)
# TODO: Change the following to iterate over existing presets
custom_framerate = (fps_rate not in {23.98, 24, 25, 29.97, 30, 50, 59.94, 60})
custom_framerate = (fps_rate not in {23.98, 24, 25, 29.97, 30, 50, 59.94, 60, 120, 240})
if custom_framerate is True:
fps_label_text = tip_("Custom (%.4g fps)") % fps_rate

View File

@@ -902,7 +902,7 @@ def brush_settings_advanced(layout, context, brush, popover=False):
if popover:
brush_settings(layout, context, brush, popover=True)
layout.separator()
layout.label(text="Advanced:")
layout.label(text="Advanced")
# These options are shared across many modes.
use_accumulate = False

View File

@@ -958,7 +958,7 @@ class PHYSICS_PT_particles(PhysicButtonsPanel, Panel):
col.separator()
col = flow.column()
col.prop(domain, "sndparticle_boundary", text="Particles in Boundary:")
col.prop(domain, "sndparticle_boundary", text="Particles in Boundary")
if domain.cache_type == 'MODULAR':
col.separator()

View File

@@ -323,7 +323,7 @@ class OUTLINER_PT_filter(Panel):
display_mode = space.display_mode
if display_mode == 'VIEW_LAYER':
layout.label(text="Restriction Toggles:")
layout.label(text="Restriction Toggles")
row = layout.row(align=True)
row.prop(space, "show_restrict_column_enable", text="")
row.prop(space, "show_restrict_column_select", text="")
@@ -334,7 +334,7 @@ class OUTLINER_PT_filter(Panel):
row.prop(space, "show_restrict_column_indirect_only", text="")
layout.separator()
elif display_mode == 'SCENES':
layout.label(text="Restriction Toggles:")
layout.label(text="Restriction Toggles")
row = layout.row(align=True)
row.prop(space, "show_restrict_column_select", text="")
row.prop(space, "show_restrict_column_hide", text="")
@@ -354,7 +354,7 @@ class OUTLINER_PT_filter(Panel):
layout.separator()
col = layout.column(align=True)
col.label(text="Search:")
col.label(text="Search")
col.prop(space, "use_filter_complete", text="Exact Match")
col.prop(space, "use_filter_case_sensitive", text="Case Sensitive")
@@ -363,7 +363,7 @@ class OUTLINER_PT_filter(Panel):
layout.separator()
layout.label(text="Filter:")
layout.label(text="Filter")
col = layout.column(align=True)

View File

@@ -0,0 +1,52 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
import bpy
class SPREADSHEET_HT_header(bpy.types.Header):
bl_space_type = 'SPREADSHEET'
def draw(self, context):
layout = self.layout
space = context.space_data
layout.template_header()
pinned_id = space.pinned_id
used_id = pinned_id if pinned_id else context.active_object
if used_id:
layout.label(text=used_id.name, icon="OBJECT_DATA")
layout.operator("spreadsheet.toggle_pin", text="", icon='PINNED' if pinned_id else 'UNPINNED', emboss=False)
layout.separator_spacer()
if isinstance(used_id, bpy.types.Object) and used_id.mode == 'EDIT':
layout.prop(space, "show_only_selected", text="Selected Only")
classes = (
SPREADSHEET_HT_header,
)
if __name__ == "__main__": # only for live edit.
from bpy.utils import register_class
for cls in classes:
register_class(cls)

View File

@@ -248,7 +248,34 @@ class TOPBAR_MT_file_cleanup(Menu):
layout = self.layout
layout.separator()
layout.operator("outliner.orphans_purge", text="Unused Data-Blocks")
op_props = layout.operator("outliner.orphans_purge", text="Unused Data-Blocks")
op_props.do_local_ids = True
op_props.do_linked_ids = True
op_props.do_recursive = False
op_props = layout.operator("outliner.orphans_purge", text="Recursive Unused Data-Blocks")
op_props.do_local_ids = True
op_props.do_linked_ids = True
op_props.do_recursive = True
layout.separator()
op_props = layout.operator("outliner.orphans_purge", text="Unused Linked Data-Blocks")
op_props.do_local_ids = False
op_props.do_linked_ids = True
op_props.do_recursive = False
op_props = layout.operator("outliner.orphans_purge", text="Recursive Unused Linked Data-Blocks")
op_props.do_local_ids = False
op_props.do_linked_ids = True
op_props.do_recursive = True
layout.separator()
op_props = layout.operator("outliner.orphans_purge", text="Unused Local Data-Blocks")
op_props.do_local_ids = True
op_props.do_linked_ids = False
op_props.do_recursive = False
op_props = layout.operator("outliner.orphans_purge", text="Recursive Unused Local Data-Blocks")
op_props.do_local_ids = True
op_props.do_linked_ids = False
op_props.do_recursive = True
class TOPBAR_MT_file(Menu):

View File

@@ -1333,7 +1333,7 @@ class USERPREF_PT_saveload_autorun(FilePathsPanel, Panel):
box = layout.box()
row = box.row()
row.label(text="Excluded Paths:")
row.label(text="Excluded Paths")
row.operator("preferences.autoexec_path_add", text="", icon='ADD', emboss=False)
for i, path_cmp in enumerate(prefs.autoexec_paths):
row = box.row()

View File

@@ -6210,7 +6210,7 @@ class VIEW3D_PT_overlay_motion_tracking(Panel):
col = layout.column()
col.active = display_all
col.label(text="Tracks:")
col.label(text="Tracks")
row = col.row(align=True)
row.prop(view, "tracks_display_type", text="")
row.prop(view, "tracks_display_size", text="Size")
@@ -6923,7 +6923,7 @@ class VIEW3D_PT_view3d_stereo(Panel):
col = layout.column()
col.row().prop(view, "stereo_3d_camera", expand=True)
col.label(text="Display:")
col.label(text="Display")
row = col.row()
row.active = basic_stereo
row.prop(view, "show_stereo_3d_cameras")

View File

@@ -333,6 +333,17 @@ class VIEW3D_PT_tools_particlemode(Panel, View3DPaintPanel):
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
tool_context = ToolSelectPanelHelper.tool_active_from_context(context)
if not tool_context:
# If there is no active tool, then there can't be an active brush.
tool = None
if not tool_context.has_datablock:
# tool.has_datablock is always true for tools that use brushes.
tool = None
if tool is not None:
col = layout.column()
col.prop(brush, "size", slider=True)

View File

@@ -235,12 +235,12 @@ typedef enum eAnimData_Recalc {
ADT_RECALC_ALL = (ADT_RECALC_DRIVERS | ADT_RECALC_ANIM),
} eAnimData_Recalc;
bool BKE_animsys_store_rna_setting(struct PointerRNA *ptr,
const char *rna_path,
const int array_index,
struct PathResolvedRNA *r_result);
bool BKE_animsys_read_rna_setting(struct PathResolvedRNA *anim_rna, float *r_value);
bool BKE_animsys_write_rna_setting(struct PathResolvedRNA *anim_rna, const float value);
bool BKE_animsys_rna_path_resolve(struct PointerRNA *ptr,
const char *rna_path,
const int array_index,
struct PathResolvedRNA *r_result);
bool BKE_animsys_read_from_rna_path(struct PathResolvedRNA *anim_rna, float *r_value);
bool BKE_animsys_write_to_rna_path(struct PathResolvedRNA *anim_rna, const float value);
/* Evaluation loop for evaluating animation data */
void BKE_animsys_evaluate_animdata(struct ID *id,

View File

@@ -39,7 +39,7 @@ extern "C" {
/* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION
#define BLENDER_FILE_SUBVERSION 8
#define BLENDER_FILE_SUBVERSION 10
/* Minimum Blender version that supports reading file written with the current
* version. Older Blender versions will test this and show a warning if the file

View File

@@ -77,8 +77,6 @@ struct Collection *BKE_collection_duplicate(struct Main *bmain,
/* Master Collection for Scene */
struct Collection *BKE_collection_master_add(void);
struct Scene *BKE_collection_master_scene_search(const struct Main *bmain,
const struct Collection *master_collection);
/* Collection Objects */

View File

@@ -59,6 +59,7 @@ enum {
CURVEMAP_SLOPE_POS_NEG = 2,
};
void BKE_curvemapping_reset_view(struct CurveMapping *cumap);
void BKE_curvemap_reset(struct CurveMap *cuma, const struct rctf *clipr, int preset, int slope);
void BKE_curvemap_remove(struct CurveMap *cuma, const short flag);
bool BKE_curvemap_remove_point(struct CurveMap *cuma, struct CurveMapPoint *cmp);

View File

@@ -197,6 +197,7 @@ struct SpaceInfo *CTX_wm_space_info(const bContext *C);
struct SpaceUserPref *CTX_wm_space_userpref(const bContext *C);
struct SpaceClip *CTX_wm_space_clip(const bContext *C);
struct SpaceTopBar *CTX_wm_space_topbar(const bContext *C);
struct SpaceSpreadsheet *CTX_wm_space_spreadsheet(const bContext *C);
void CTX_wm_manager_set(bContext *C, struct wmWindowManager *wm);
void CTX_wm_window_set(bContext *C, struct wmWindow *win);

View File

@@ -31,35 +31,35 @@ extern "C" {
#endif
struct CryptomatteSession;
struct ID;
struct Main;
struct Material;
struct Object;
struct RenderResult;
struct CryptomatteSession *BKE_cryptomatte_init(void);
void BKE_cryptomatte_finish(struct CryptomatteSession *session);
struct CryptomatteSession *BKE_cryptomatte_init_from_render_result(
const struct RenderResult *render_result);
void BKE_cryptomatte_free(struct CryptomatteSession *session);
void BKE_cryptomatte_add_layer(struct CryptomatteSession *session, const char *layer_name);
uint32_t BKE_cryptomatte_hash(const char *name, int name_len);
uint32_t BKE_cryptomatte_object_hash(struct CryptomatteSession *session,
const char *layer_name,
const struct Object *object);
uint32_t BKE_cryptomatte_material_hash(struct CryptomatteSession *session,
const char *layer_name,
const struct Material *material);
uint32_t BKE_cryptomatte_asset_hash(struct CryptomatteSession *session,
const char *layer_name,
const struct Object *object);
float BKE_cryptomatte_hash_to_float(uint32_t cryptomatte_hash);
char *BKE_cryptomatte_entries_to_matte_id(struct NodeCryptomatte *node_storage);
void BKE_cryptomatte_matte_id_to_entries(const struct Main *bmain,
struct NodeCryptomatte *node_storage,
void BKE_cryptomatte_matte_id_to_entries(struct NodeCryptomatte *node_storage,
const char *matte_id);
void BKE_cryptomatte_store_metadata(struct CryptomatteSession *session,
void BKE_cryptomatte_store_metadata(const struct CryptomatteSession *session,
struct RenderResult *render_result,
const ViewLayer *view_layer,
eViewLayerCryptomatteFlags cryptomatte_layer,
const char *cryptomatte_layer_name);
const ViewLayer *view_layer);
#ifdef __cplusplus
}

View File

@@ -23,11 +23,15 @@
#pragma once
#include <optional>
#include <string>
#include "BLI_map.hh"
#include "BLI_string_ref.hh"
namespace blender {
struct ID;
namespace blender::bke::cryptomatte {
/* Format to a cryptomatte meta data key.
*
@@ -56,4 +60,47 @@ std::string BKE_cryptomatte_meta_data_key(const StringRef layer_name,
*/
StringRef BKE_cryptomatte_extract_layer_name(const StringRef render_pass_name);
} // namespace blender
struct CryptomatteHash {
uint32_t hash;
CryptomatteHash(uint32_t hash);
CryptomatteHash(const char *name, const int name_len);
static CryptomatteHash from_hex_encoded(blender::StringRef hex_encoded);
std::string hex_encoded() const;
float float_encoded() const;
};
struct CryptomatteLayer {
blender::Map<std::string, CryptomatteHash> hashes;
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("cryptomatte:CryptomatteLayer")
#endif
static std::unique_ptr<CryptomatteLayer> read_from_manifest(blender::StringRefNull manifest);
uint32_t add_ID(const struct ID &id);
void add_hash(blender::StringRef name, CryptomatteHash cryptomatte_hash);
std::string manifest() const;
std::optional<std::string> operator[](float encoded_hash) const;
};
struct CryptomatteStampDataCallbackData {
struct CryptomatteSession *session;
blender::Map<std::string, std::string> hash_to_layer_name;
/**
* Extract the hash from a stamp data key.
*
* Cryptomatte keys are formatted as "cryptomatte/{layer_hash}/{attribute}".
*/
static blender::StringRef extract_layer_hash(blender::StringRefNull key);
/* C type callback function (StampCallback). */
static void extract_layer_names(void *_data, const char *propname, char *propvalue, int len);
/* C type callback function (StampCallback). */
static void extract_layer_manifest(void *_data, const char *propname, char *propvalue, int len);
};
} // namespace blender::bke::cryptomatte

View File

@@ -25,6 +25,7 @@
#include "BLI_float3.hh"
#include "BLI_float4x4.hh"
#include "BLI_function_ref.hh"
#include "BLI_hash.hh"
#include "BLI_map.hh"
#include "BLI_set.hh"
@@ -128,6 +129,20 @@ class OutputAttributePtr {
void apply_span_and_save();
};
/**
* Contains information about an attribute in a geometry component.
* More information can be added in the future. E.g. whether the attribute is builtin and how it is
* stored (uv map, vertex group, ...).
*/
struct AttributeMetaData {
AttributeDomain domain;
CustomDataType data_type;
};
/* Returns false when the iteration should be stopped. */
using AttributeForeachCallback = blender::FunctionRef<bool(blender::StringRefNull attribute_name,
const AttributeMetaData &meta_data)>;
/**
* This is the base class for specialized geometry component types.
*/
@@ -185,6 +200,8 @@ class GeometryComponent {
const CustomDataType data_type);
blender::Set<std::string> attribute_names() const;
void attribute_foreach(const AttributeForeachCallback callback) const;
virtual bool is_empty() const;
/* Get a read-only attribute for the given domain and data type.

View File

@@ -95,6 +95,8 @@ typedef void (*IDTypeForeachCacheFunction)(struct ID *id,
IDTypeForeachCacheFunctionCallback function_callback,
void *user_data);
typedef struct ID *(*IDTypeEmbeddedOwnerGetFunction)(struct Main *bmain, struct ID *id);
typedef void (*IDTypeBlendWriteFunction)(struct BlendWriter *writer,
struct ID *id,
const void *id_address);
@@ -181,6 +183,11 @@ typedef struct IDTypeInfo {
*/
IDTypeForeachCacheFunction foreach_cache;
/**
* For embedded IDs, return their owner ID.
*/
IDTypeEmbeddedOwnerGetFunction owner_get;
/* ********** Callbacks for reading and writing .blend files. ********** */
/**

View File

@@ -175,6 +175,13 @@ void BKE_library_ID_test_usages(struct Main *bmain,
bool *is_used_local,
bool *is_used_linked);
void BKE_lib_query_unused_ids_tag(struct Main *bmain,
const int tag,
const bool do_local_ids,
const bool do_linked_ids,
const bool do_tag_recursive,
int *r_num_tagged);
void BKE_library_unused_linked_data_set_tag(struct Main *bmain, const bool do_init_tag);
void BKE_library_indirectly_used_data_tag_clear(struct Main *bmain);

View File

@@ -223,7 +223,7 @@ struct GSet *BKE_main_gset_create(struct Main *bmain, struct GSet *gset);
#define FOREACH_MAIN_LISTBASE_BEGIN(_bmain, _lb) \
{ \
ListBase *_lbarray[MAX_LIBARRAY]; \
ListBase *_lbarray[INDEX_ID_MAX]; \
int _i = set_listbasepointers((_bmain), _lbarray); \
while (_i--) { \
(_lb) = _lbarray[_i];
@@ -234,9 +234,13 @@ struct GSet *BKE_main_gset_create(struct Main *bmain, struct GSet *gset);
((void)0)
/**
* DO NOT use break statement with that macro,
* use #FOREACH_MAIN_LISTBASE and #FOREACH_MAIN_LISTBASE_ID instead
* if you need that kind of control flow. */
* Top level `foreach`-like macro allowing to loop over all IDs in a given #Main data-base.
*
* NOTE: Order tries to go from 'user IDs' to 'used IDs' (e.g. collections will be processed
* before objects, which will be processed before obdata types, etc.).
*
* WARNING: DO NOT use break statement with that macro, use #FOREACH_MAIN_LISTBASE and
* #FOREACH_MAIN_LISTBASE_ID instead if you need that kind of control flow. */
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id) \
{ \
ListBase *_lb; \
@@ -259,8 +263,8 @@ const char *BKE_main_blendfile_path_from_global(void);
struct ListBase *which_libbase(struct Main *bmain, short type);
#define MAX_LIBARRAY 41
int set_listbasepointers(struct Main *main, struct ListBase *lb[MAX_LIBARRAY]);
//#define INDEX_ID_MAX 41
int set_listbasepointers(struct Main *main, struct ListBase *lb[]);
#define MAIN_VERSION_ATLEAST(main, ver, subver) \
((main)->versionfile > (ver) || \

View File

@@ -442,7 +442,6 @@ struct bNodeTree *ntreeCopyTree(struct Main *bmain, const struct bNodeTree *ntre
struct bNodeTree **BKE_ntree_ptr_from_id(struct ID *id);
struct bNodeTree *ntreeFromID(struct ID *id);
struct ID *BKE_node_tree_find_owner_ID(struct Main *bmain, struct bNodeTree *ntree);
void ntreeFreeLocalNode(struct bNodeTree *ntree, struct bNode *node);
void ntreeFreeLocalTree(struct bNodeTree *ntree);
@@ -778,7 +777,7 @@ void BKE_node_preview_free(struct bNodePreview *preview);
void BKE_node_preview_init_tree(struct bNodeTree *ntree,
int xsize,
int ysize,
int create_previews);
bool create_previews);
void BKE_node_preview_free_tree(struct bNodeTree *ntree);
void BKE_node_preview_remove_unused(struct bNodeTree *ntree);
void BKE_node_preview_clear(struct bNodePreview *preview);

View File

@@ -16,9 +16,12 @@
#pragma once
#include <mutex>
#include "BLI_hash.hh"
#include "BLI_map.hh"
#include "BLI_session_uuid.h"
#include "BLI_set.hh"
#include "DNA_ID.h"
#include "DNA_modifier_types.h"
@@ -28,6 +31,7 @@ struct ModifierData;
struct Object;
struct bNode;
struct bNodeTree;
struct bContext;
/**
* Contains the context necessary to determine when to display settings for a certain node tree
@@ -75,12 +79,18 @@ struct NodeWarning {
struct NodeUIStorage {
blender::Vector<NodeWarning> warnings;
blender::Set<std::string> attribute_name_hints;
};
struct NodeTreeUIStorage {
blender::Map<NodeTreeEvaluationContext, blender::Map<std::string, NodeUIStorage>> context_map;
std::mutex context_map_mutex;
};
const NodeUIStorage *BKE_node_tree_ui_storage_get_from_context(const bContext *C,
const bNodeTree &ntree,
const bNode &node);
void BKE_nodetree_ui_storage_free_for_context(bNodeTree &ntree,
const NodeTreeEvaluationContext &context);
@@ -89,3 +99,8 @@ void BKE_nodetree_error_message_add(bNodeTree &ntree,
const bNode &node,
const NodeWarningType type,
std::string message);
void BKE_nodetree_attribute_hint_add(bNodeTree &ntree,
const NodeTreeEvaluationContext &context,
const bNode &node,
const blender::StringRef attribute_name);

View File

@@ -469,10 +469,19 @@ typedef struct SculptSession {
struct MPropCol *vcol;
float *vmask;
/* Mesh connectivity */
/* Mesh connectivity maps. */
/* Vertices to adjacent polys. */
struct MeshElemMap *pmap;
int *pmap_mem;
/* Edges to adjacent polys. */
struct MeshElemMap *epmap;
int *epmap_mem;
/* Vertices to adjacent edges. */
struct MeshElemMap *vemap;
int *vemap_mem;
/* Mesh Face Sets */
/* Total number of polys of the base mesh. */
int totfaces;
@@ -508,6 +517,7 @@ typedef struct SculptSession {
struct StrokeCache *cache;
struct FilterCache *filter_cache;
struct ExpandCache *expand_cache;
/* Cursor data and active vertex for tools */
int active_vertex_index;

View File

@@ -404,7 +404,7 @@ void BKE_spacetypes_free(void); /* only for quitting blender */
/* spacedata */
void BKE_spacedata_freelist(ListBase *lb);
void BKE_spacedata_copylist(ListBase *lb1, ListBase *lb2);
void BKE_spacedata_draw_locks(int set);
void BKE_spacedata_draw_locks(bool set);
struct ARegion *BKE_spacedata_find_region_type(const struct SpaceLink *slink,
const struct ScrArea *area,

View File

@@ -21,7 +21,6 @@
#endif
struct Mesh;
struct VolumeGrid;
namespace blender::bke {

View File

@@ -303,6 +303,7 @@ IDTypeInfo IDType_ID_AC = {
.make_local = NULL,
.foreach_id = action_foreach_id,
.foreach_cache = NULL,
.owner_get = NULL,
.blend_write = action_blend_write,
.blend_read_data = action_blend_read_data,
@@ -2001,7 +2002,7 @@ void BKE_pose_blend_read_lib(BlendLibReader *reader, Object *ob, bPose *pose)
IDP_BlendReadLib(reader, pchan->prop);
BLO_read_id_address(reader, arm->id.lib, &pchan->custom);
BLO_read_id_address(reader, ob->id.lib, &pchan->custom);
if (UNLIKELY(pchan->bone == NULL)) {
rebuild = true;
}

View File

@@ -376,59 +376,56 @@ static bool is_fcurve_evaluatable(FCurve *fcu)
return true;
}
bool BKE_animsys_store_rna_setting(PointerRNA *ptr,
/* typically 'fcu->rna_path', 'fcu->array_index' */
const char *rna_path,
const int array_index,
PathResolvedRNA *r_result)
bool BKE_animsys_rna_path_resolve(PointerRNA *ptr,
/* typically 'fcu->rna_path', 'fcu->array_index' */
const char *rna_path,
const int array_index,
PathResolvedRNA *r_result)
{
bool success = false;
const char *path = rna_path;
/* write value to setting */
if (path) {
/* get property to write to */
if (RNA_path_resolve_property(ptr, path, &r_result->ptr, &r_result->prop)) {
if ((ptr->owner_id == NULL) || RNA_property_animateable(&r_result->ptr, r_result->prop)) {
int array_len = RNA_property_array_length(&r_result->ptr, r_result->prop);
if (array_len && array_index >= array_len) {
if (G.debug & G_DEBUG) {
CLOG_WARN(&LOG,
"Animato: Invalid array index. ID = '%s', '%s[%d]', array length is %d",
(ptr->owner_id) ? (ptr->owner_id->name + 2) : "<No ID>",
path,
array_index,
array_len - 1);
}
}
else {
r_result->prop_index = array_len ? array_index : -1;
success = true;
}
}
}
else {
/* failed to get path */
/* XXX don't tag as failed yet though, as there are some legit situations (Action Constraint)
* where some channels will not exist, but shouldn't lock up Action */
if (G.debug & G_DEBUG) {
CLOG_WARN(&LOG,
"Animato: Invalid path. ID = '%s', '%s[%d]'",
(ptr->owner_id) ? (ptr->owner_id->name + 2) : "<No ID>",
path,
array_index);
}
}
if (rna_path == NULL) {
return false;
}
return success;
const char *path = rna_path;
if (!RNA_path_resolve_property(ptr, path, &r_result->ptr, &r_result->prop)) {
/* failed to get path */
/* XXX don't tag as failed yet though, as there are some legit situations (Action Constraint)
* where some channels will not exist, but shouldn't lock up Action */
if (G.debug & G_DEBUG) {
CLOG_WARN(&LOG,
"Animato: Invalid path. ID = '%s', '%s[%d]'",
(ptr->owner_id) ? (ptr->owner_id->name + 2) : "<No ID>",
path,
array_index);
}
return false;
}
if (ptr->owner_id != NULL && !RNA_property_animateable(&r_result->ptr, r_result->prop)) {
return false;
}
int array_len = RNA_property_array_length(&r_result->ptr, r_result->prop);
if (array_len && array_index >= array_len) {
if (G.debug & G_DEBUG) {
CLOG_WARN(&LOG,
"Animato: Invalid array index. ID = '%s', '%s[%d]', array length is %d",
(ptr->owner_id) ? (ptr->owner_id->name + 2) : "<No ID>",
path,
array_index,
array_len - 1);
}
return false;
}
r_result->prop_index = array_len ? array_index : -1;
return true;
}
/* less than 1.0 evaluates to false, use epsilon to avoid float error */
#define ANIMSYS_FLOAT_AS_BOOL(value) ((value) > ((1.0f - FLT_EPSILON)))
bool BKE_animsys_read_rna_setting(PathResolvedRNA *anim_rna, float *r_value)
bool BKE_animsys_read_from_rna_path(PathResolvedRNA *anim_rna, float *r_value)
{
PropertyRNA *prop = anim_rna->prop;
PointerRNA *ptr = &anim_rna->ptr;
@@ -491,7 +488,7 @@ bool BKE_animsys_read_rna_setting(PathResolvedRNA *anim_rna, float *r_value)
}
/* Write the given value to a setting using RNA, and return success */
bool BKE_animsys_write_rna_setting(PathResolvedRNA *anim_rna, const float value)
bool BKE_animsys_write_to_rna_path(PathResolvedRNA *anim_rna, const float value)
{
PropertyRNA *prop = anim_rna->prop;
PointerRNA *ptr = &anim_rna->ptr;
@@ -502,7 +499,7 @@ bool BKE_animsys_write_rna_setting(PathResolvedRNA *anim_rna, const float value)
/* Check whether value is new. Otherwise we skip all the updates. */
float old_value;
if (!BKE_animsys_read_rna_setting(anim_rna, &old_value)) {
if (!BKE_animsys_read_from_rna_path(anim_rna, &old_value)) {
return false;
}
if (old_value == value) {
@@ -591,8 +588,8 @@ static void animsys_write_orig_anim_rna(PointerRNA *ptr,
}
PathResolvedRNA orig_anim_rna;
/* TODO(sergey): Should be possible to cache resolved path in dependency graph somehow. */
if (BKE_animsys_store_rna_setting(&ptr_orig, rna_path, array_index, &orig_anim_rna)) {
BKE_animsys_write_rna_setting(&orig_anim_rna, value);
if (BKE_animsys_rna_path_resolve(&ptr_orig, rna_path, array_index, &orig_anim_rna)) {
BKE_animsys_write_to_rna_path(&orig_anim_rna, value);
}
}
@@ -614,9 +611,9 @@ static void animsys_evaluate_fcurves(PointerRNA *ptr,
}
PathResolvedRNA anim_rna;
if (BKE_animsys_store_rna_setting(ptr, fcu->rna_path, fcu->array_index, &anim_rna)) {
if (BKE_animsys_rna_path_resolve(ptr, fcu->rna_path, fcu->array_index, &anim_rna)) {
const float curval = calculate_fcurve(&anim_rna, fcu, anim_eval_context);
BKE_animsys_write_rna_setting(&anim_rna, curval);
BKE_animsys_write_to_rna_path(&anim_rna, curval);
if (flush_to_original) {
animsys_write_orig_anim_rna(ptr, fcu->rna_path, fcu->array_index, curval);
}
@@ -666,9 +663,9 @@ static void animsys_evaluate_drivers(PointerRNA *ptr,
* NOTE: for 'layering' option later on, we should check if we should remove old value
* before adding new to only be done when drivers only changed. */
PathResolvedRNA anim_rna;
if (BKE_animsys_store_rna_setting(ptr, fcu->rna_path, fcu->array_index, &anim_rna)) {
if (BKE_animsys_rna_path_resolve(ptr, fcu->rna_path, fcu->array_index, &anim_rna)) {
const float curval = calculate_fcurve(&anim_rna, fcu, anim_eval_context);
ok = BKE_animsys_write_rna_setting(&anim_rna, curval);
ok = BKE_animsys_write_to_rna_path(&anim_rna, curval);
}
/* set error-flag if evaluation failed */
@@ -747,19 +744,19 @@ void animsys_evaluate_action_group(PointerRNA *ptr,
/* check if this curve should be skipped */
if ((fcu->flag & (FCURVE_MUTED | FCURVE_DISABLED)) == 0 && !BKE_fcurve_is_empty(fcu)) {
PathResolvedRNA anim_rna;
if (BKE_animsys_store_rna_setting(ptr, fcu->rna_path, fcu->array_index, &anim_rna)) {
if (BKE_animsys_rna_path_resolve(ptr, fcu->rna_path, fcu->array_index, &anim_rna)) {
const float curval = calculate_fcurve(&anim_rna, fcu, anim_eval_context);
BKE_animsys_write_rna_setting(&anim_rna, curval);
BKE_animsys_write_to_rna_path(&anim_rna, curval);
}
}
}
}
/* Evaluate Action (F-Curve Bag) */
static void animsys_evaluate_action_ex(PointerRNA *ptr,
bAction *act,
const AnimationEvalContext *anim_eval_context,
const bool flush_to_original)
void animsys_evaluate_action(PointerRNA *ptr,
bAction *act,
const AnimationEvalContext *anim_eval_context,
const bool flush_to_original)
{
/* check if mapper is appropriate for use here (we set to NULL if it's inappropriate) */
if (act == NULL) {
@@ -772,14 +769,6 @@ static void animsys_evaluate_action_ex(PointerRNA *ptr,
animsys_evaluate_fcurves(ptr, &act->curves, anim_eval_context, flush_to_original);
}
void animsys_evaluate_action(PointerRNA *ptr,
bAction *act,
const AnimationEvalContext *anim_eval_context,
const bool flush_to_original)
{
animsys_evaluate_action_ex(ptr, act, anim_eval_context, flush_to_original);
}
/* ***************************************** */
/* NLA System - Evaluation */
@@ -2008,7 +1997,7 @@ void nladata_flush_channels(PointerRNA *ptr,
if (nec->is_array) {
rna.prop_index = i;
}
BKE_animsys_write_rna_setting(&rna, value);
BKE_animsys_write_to_rna_path(&rna, value);
if (flush_to_original) {
animsys_write_orig_anim_rna(ptr, nec->rna_path, rna.prop_index, value);
}
@@ -2769,8 +2758,8 @@ static void animsys_evaluate_overrides(PointerRNA *ptr, AnimData *adt)
/* for each override, simply execute... */
for (aor = adt->overrides.first; aor; aor = aor->next) {
PathResolvedRNA anim_rna;
if (BKE_animsys_store_rna_setting(ptr, aor->rna_path, aor->array_index, &anim_rna)) {
BKE_animsys_write_rna_setting(&anim_rna, aor->value);
if (BKE_animsys_rna_path_resolve(ptr, aor->rna_path, aor->array_index, &anim_rna)) {
BKE_animsys_write_to_rna_path(&anim_rna, aor->value);
}
}
}
@@ -2850,7 +2839,7 @@ void BKE_animsys_evaluate_animdata(ID *id,
}
/* evaluate Active Action only */
else if (adt->action) {
animsys_evaluate_action_ex(&id_ptr, adt->action, anim_eval_context, flush_to_original);
animsys_evaluate_action(&id_ptr, adt->action, anim_eval_context, flush_to_original);
}
}
@@ -3100,13 +3089,13 @@ void BKE_animsys_eval_driver(Depsgraph *depsgraph, ID *id, int driver_index, FCu
// printf("\told val = %f\n", fcu->curval);
PathResolvedRNA anim_rna;
if (BKE_animsys_store_rna_setting(&id_ptr, fcu->rna_path, fcu->array_index, &anim_rna)) {
if (BKE_animsys_rna_path_resolve(&id_ptr, fcu->rna_path, fcu->array_index, &anim_rna)) {
/* Evaluate driver, and write results to COW-domain destination */
const float ctime = DEG_get_ctime(depsgraph);
const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(
depsgraph, ctime);
const float curval = calculate_fcurve(&anim_rna, fcu, &anim_eval_context);
ok = BKE_animsys_write_rna_setting(&anim_rna, curval);
ok = BKE_animsys_write_to_rna_path(&anim_rna, curval);
/* Flush results & status codes to original data for UI (T59984) */
if (ok && DEG_is_active(depsgraph)) {

View File

@@ -324,6 +324,7 @@ IDTypeInfo IDType_ID_AR = {
.make_local = NULL,
.foreach_id = armature_foreach_id,
.foreach_cache = NULL,
.owner_get = NULL,
.blend_write = armature_blend_write,
.blend_read_data = armature_blend_read_data,

View File

@@ -685,7 +685,8 @@ class DynamicAttributesProvider {
return false;
};
virtual void list(const GeometryComponent &component, Set<std::string> &r_names) const = 0;
virtual bool foreach_attribute(const GeometryComponent &component,
const AttributeForeachCallback callback) const = 0;
virtual void supported_domains(Vector<AttributeDomain> &r_domains) const = 0;
};
@@ -964,17 +965,23 @@ class CustomDataAttributeProvider final : public DynamicAttributesProvider {
return true;
}
void list(const GeometryComponent &component, Set<std::string> &r_names) const final
bool foreach_attribute(const GeometryComponent &component,
const AttributeForeachCallback callback) const final
{
const CustomData *custom_data = custom_data_access_.get_const_custom_data(component);
if (custom_data == nullptr) {
return;
return true;
}
for (const CustomDataLayer &layer : Span(custom_data->layers, custom_data->totlayer)) {
if (this->type_is_supported((CustomDataType)layer.type)) {
r_names.add(layer.name);
const CustomDataType data_type = (CustomDataType)layer.type;
if (this->type_is_supported(data_type)) {
AttributeMetaData meta_data{domain_, data_type};
if (!callback(layer.name, meta_data)) {
return false;
}
}
}
return true;
}
void supported_domains(Vector<AttributeDomain> &r_domains) const final
@@ -1026,6 +1033,7 @@ class NamedLegacyCustomDataProvider final : public DynamicAttributesProvider {
using AsReadAttribute = ReadAttributePtr (*)(const void *data, const int domain_size);
using AsWriteAttribute = WriteAttributePtr (*)(void *data, const int domain_size);
const AttributeDomain domain_;
const CustomDataType attribute_type_;
const CustomDataType stored_type_;
const CustomDataAccessInfo custom_data_access_;
const AsReadAttribute as_read_attribute_;
@@ -1033,11 +1041,13 @@ class NamedLegacyCustomDataProvider final : public DynamicAttributesProvider {
public:
NamedLegacyCustomDataProvider(const AttributeDomain domain,
const CustomDataType attribute_type,
const CustomDataType stored_type,
const CustomDataAccessInfo custom_data_access,
const AsReadAttribute as_read_attribute,
const AsWriteAttribute as_write_attribute)
: domain_(domain),
attribute_type_(attribute_type),
stored_type_(stored_type),
custom_data_access_(custom_data_access),
as_read_attribute_(as_read_attribute),
@@ -1107,17 +1117,22 @@ class NamedLegacyCustomDataProvider final : public DynamicAttributesProvider {
return false;
}
void list(const GeometryComponent &component, Set<std::string> &r_names) const final
bool foreach_attribute(const GeometryComponent &component,
const AttributeForeachCallback callback) const final
{
const CustomData *custom_data = custom_data_access_.get_const_custom_data(component);
if (custom_data == nullptr) {
return;
return true;
}
for (const CustomDataLayer &layer : Span(custom_data->layers, custom_data->totlayer)) {
if (layer.type == stored_type_) {
r_names.add(layer.name);
AttributeMetaData meta_data{domain_, attribute_type_};
if (!callback(layer.name, meta_data)) {
return false;
}
}
}
return true;
}
void supported_domains(Vector<AttributeDomain> &r_domains) const final
@@ -1201,16 +1216,22 @@ class VertexGroupsAttributeProvider final : public DynamicAttributesProvider {
return true;
}
void list(const GeometryComponent &component, Set<std::string> &r_names) const final
bool foreach_attribute(const GeometryComponent &component,
const AttributeForeachCallback callback) const final
{
BLI_assert(component.type() == GeometryComponentType::Mesh);
const MeshComponent &mesh_component = static_cast<const MeshComponent &>(component);
mesh_component.vertex_group_names().foreach_item(
[&](StringRef name, const int vertex_group_index) {
if (vertex_group_index >= 0) {
r_names.add(name);
}
});
for (const auto item : mesh_component.vertex_group_names().items()) {
const StringRefNull name = item.key;
const int vertex_group_index = item.value;
if (vertex_group_index >= 0) {
AttributeMetaData meta_data{ATTR_DOMAIN_POINT, CD_PROP_FLOAT};
if (!callback(name, meta_data)) {
return false;
}
}
}
return true;
}
void supported_domains(Vector<AttributeDomain> &r_domains) const final
@@ -1453,12 +1474,14 @@ static ComponentAttributeProviders create_attribute_providers_for_mesh()
nullptr);
static NamedLegacyCustomDataProvider uvs(ATTR_DOMAIN_CORNER,
CD_PROP_FLOAT2,
CD_MLOOPUV,
corner_access,
make_uvs_read_attribute,
make_uvs_write_attribute);
static NamedLegacyCustomDataProvider vertex_colors(ATTR_DOMAIN_CORNER,
CD_PROP_COLOR,
CD_MLOOPCOL,
corner_access,
make_vertex_color_read_attribute,
@@ -1669,23 +1692,48 @@ bool GeometryComponent::attribute_try_create(const StringRef attribute_name,
}
Set<std::string> GeometryComponent::attribute_names() const
{
Set<std::string> attributes;
this->attribute_foreach([&](StringRefNull name, const AttributeMetaData &UNUSED(meta_data)) {
attributes.add(name);
return true;
});
return attributes;
}
void GeometryComponent::attribute_foreach(const AttributeForeachCallback callback) const
{
using namespace blender::bke;
const ComponentAttributeProviders *providers = this->get_attribute_providers();
if (providers == nullptr) {
return {};
return;
}
Set<std::string> names;
/* Keep track handled attribute names to make sure that we do not return the same name twice. */
Set<std::string> handled_attribute_names;
for (const BuiltinAttributeProvider *provider :
providers->builtin_attribute_providers().values()) {
if (provider->exists(*this)) {
names.add_new(provider->name());
AttributeMetaData meta_data{provider->domain(), provider->data_type()};
if (!callback(provider->name(), meta_data)) {
return;
}
handled_attribute_names.add_new(provider->name());
}
}
for (const DynamicAttributesProvider *provider : providers->dynamic_attribute_providers()) {
provider->list(*this, names);
const bool continue_loop = provider->foreach_attribute(
*this, [&](StringRefNull name, const AttributeMetaData &meta_data) {
if (handled_attribute_names.add(name)) {
return callback(name, meta_data);
}
return true;
});
if (!continue_loop) {
return;
}
}
return names;
}
bool GeometryComponent::attribute_exists(const blender::StringRef attribute_name) const
@@ -1838,7 +1886,7 @@ OutputAttributePtr GeometryComponent::attribute_try_get_for_output(const StringR
if (!attribute) {
this->attribute_try_create(attribute_name, domain, data_type);
attribute = this->attribute_try_get_for_write(attribute_name);
if (default_value != nullptr) {
if (attribute && default_value != nullptr) {
void *data = attribute->get_span_for_write_only().data();
cpp_type->fill_initialized(default_value, data, attribute->size());
attribute->apply_span();

View File

@@ -865,7 +865,7 @@ bool BKE_blendfile_write_partial(Main *bmain_src,
ReportList *reports)
{
Main *bmain_dst = MEM_callocN(sizeof(Main), "copybuffer");
ListBase *lbarray_dst[MAX_LIBARRAY], *lbarray_src[MAX_LIBARRAY];
ListBase *lbarray_dst[INDEX_ID_MAX], *lbarray_src[INDEX_ID_MAX];
int a, retval;
void *path_list_backup = NULL;

Some files were not shown because too many files have changed in this diff Show More