Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-03-04Cleanup: use doxy-sections for interface_dropboxes.ccCampbell Barton
2022-03-04Cleanup: spelling in comments, function nameCampbell Barton
2022-03-04UI: Drag & Drop to Properties Materials PanelAzeem Bande-Ali
Support drag/drop of materials to Properties Material Slots. See D13549 for more details. Differential Revision: https://developer.blender.org/D13549 Reviewed by Julian Eisel
2022-03-03Cleanup: Remove redundant drag image size parametersJulian Eisel
Just use the image-buffer size and the already provided scale to determine the size, not the button size (which would always have to match the scaled image-buffer size or it would give unexpected results).
2022-03-02Event System: remove tweak events in favor of click-dragCampbell Barton
Supporting two kinds of dragging is redundant, remove tweak events as they only supported 3 mouse buttons and added complexity from using the 'value' to store directions. Support only click-drag events (KM_CLICK_DRAG) which can be used with any keyboard or mouse button. Details: - A "direction" member has been added to keymap items and events which can be used when the event value is set to KM_CLICK_DRAG. - Keymap items are version patched. - Loading older key-maps are also updated. - Currently the key-maps stored in ./release/scripts/presets/keyconfig/ still reference tweak events & need updating. For now they are updated on load. Note that in general this wont impact add-ons as modal operators don't receive tweak events. Reviewed By: brecht Ref D14214
2022-03-02Merge branch 'blender-v3.1-release'Germano Cavalcante
2022-03-02Fix T95608: Mac issues with drag drop on multi-monitorGermano Cavalcante
Mousemove events are sent to windows. In Windows OS, almost all mousemove events are sent to the window whose mouse cursor is over. On MacOS, the window with mousemove events is always the active window. It doesn't matter if the mouse cursor is inside or outside the window. So, in order for non-active windows to also have events, `WM_window_find_under_cursor` is called to find those windows and send the same events. The problem is that to find the window, `WM_window_find_under_cursor` only has the mouse coordinates available, it doesn't differentiate which monitor these coordinates came from. So the mouse on one monitor may incorrectly send events to a window on another monitor. The solution used is to use a native API on Mac to detect the window under the cursor. For Windows and Linux nothing has changed. Reviewed By: brecht Differential Revision: https://developer.blender.org/D14197
2022-03-01Cleanup: move Event.is_repeat & is_direction_inverted to flagsCampbell Barton
Use a flag for events to avoid adding struct members every time a new kind of tag is needed - so events remain small. This also simplifies copying settings as flags can be copied at once with a mask.
2022-03-01Cleanup: use doxygen comments, correct spellingCampbell Barton
Also move eDupli_ID_Flags doc-string to it's declaration.
2022-02-25Cleanup: use flags for wmEvent modifier keysCampbell Barton
Using flags makes checking multiple modifiers at once more convenient and avoids macros/functions such as IS_EVENT_MOD & WM_event_modifier_flag which have been removed. It also simplifies checking if modifier keys have changed.
2022-02-24Merge branch 'blender-v3.1-release'Campbell Barton
2022-02-24Fix 2D view NDOF panning requiring both axes to be non-zeroCampbell Barton
Possible fix for T86592.
2022-02-23Cleanup: Remove repeated word in commentsCampbell Barton
2022-02-22Merge branch 'blender-v3.1-release'Campbell Barton
2022-02-22Fix T93629: Reset to defaults undoes all steps when applied twiceCampbell Barton
Reset Defaults left the undo stack in an invalid state, with the active undo step left at the previous state then it should have been. Now the buttons own undo logic is used to perform undo pushes.
2022-02-18UI: Speedup preview icon loading from hard driveJulian Eisel
Significantly improves loading speed of preview images from disk, e.g. custom previews loaded using `bpy.utils.previews.ImagePreviewCollection.load()`. See D14144 for details & comparison videos. Differential Revision: https://developer.blender.org/D14144 Reviewed by: Bastien Montagne
2022-02-18Cleanup: Rename original curve object type enumHans Goudey
This commit renames enums related the "Curve" object type and ID type to add `_LEGACY` to the end. The idea is to make our aspirations clearer in the code and to avoid ambiguities between `CURVE` and `CURVES`. Ref T95355 To summarize for the record, the plans are: - In the short/medium term, replace the `Curve` object data type with `Curves` - In the longer term (no immediate plans), use a proper data block for 3D text and surfaces. Differential Revision: https://developer.blender.org/D14114
2022-02-15Curves: add initial sculpt modeJacques Lucke
This adds a new sculpt mode to the experimental new curves object. Currently, this mode can only be entered and exited, nothing else. The main initial purpose of this node will be to use it for hair grooming. The patch also adds the `editors/curves/` directory for the new curves object, which will be necessary for many other things as well. I added a completely new mode (`OB_MODE_SCULPT_CURVES`), because `OB_MODE_SCULPT` seems to be rather specific to meshes, and reusing it doesn't seem worth the trouble. The tools/brushes used in mesh vs. curves sculpt mode are quite distinct as well. I had to add DNA_userdef_enums.h to make the patch compile with C++ (forward declaration of enums isn't allowed). This follows the same pattern that we use for other enums in dna. Differential Revision: https://developer.blender.org/D14107
2022-02-14Merge branch 'blender-v3.1-release'Thomas Dinges
2022-02-14Fix T95320: CacheFile templates crash when used through PythonKévin Dietrich
The crash is caused as we did not check that the RNA pointer is null before trying to use it. This moves the existing checks from the modifier panels into the template functions so the logic is a bit centralized.
2022-02-11UI: Improve node drop shadowLeon Schittek
Improve the nodes' drop shadow by making it scale with the view and replace the loop for the alpha calculation with something more explicit. The amount of drop shadow softness was scaled with the zoom level and therefore had a fixed screen space size. DPI and UI scale weren't taken into account either. This patch fixes both issues by basing the shadow softness on the `widget_unit` that scales correctly in zoomable views and takes UI scale etc. into account. Differential Revision: https://developer.blender.org/D13356
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2022-02-08LibOverride: Add 'hierarchy root ID' info.Bastien Montagne
This change will make handling of liboverrides hierarchies (especially resyncing) much easier and efficient. It should also make it more resilient to 'degenerate' cases, and allow proper support of things like parenting an override to another override of the same linked data (e.g. a override character parented to another override of the same character). NOTE: this commit only implements minimal changes to add that data and generate it for existing files on load. Actual refactor of resync code to take advantage of this new info will happen separately.
2022-02-07Curves: Rename "Hair" types, variables, and functions to "Curves"Hans Goudey
Based on discussions from T95355 and T94193, the plan is to use the name "Curves" to describe the data-block container for multiple curves. Eventually this will replace the existing "Curve" data-block. However, it will be a while before the curve data-block can be replaced so in order to distinguish the two curve types in the UI, "Hair Curves" will be used, but eventually changed back to "Curves". This patch renames "hair-related" files, functions, types, and variable names to this convention. A deep rename is preferred to keep code consistent and to avoid any "hair" terminology from leaking, since the new data-block is meant for all curve types, not just hair use cases. The downside of this naming is that the difference between "Curve" and "Curves" has become important. That was considered during design discussons and deemed acceptable, especially given the non-permanent nature of the somewhat common conflict. Some points of interest: - All DNA compatibility is lost, just like rBf59767ff9729. - I renamed `ID_HA` to `ID_CV` so there is no complete mismatch. - `hair_curves` is used where necessary to distinguish from the existing "curves" plural. - I didn't rename any of the cycles/rendering code function names, since that is also used by the old hair particle system. Differential Revision: https://developer.blender.org/D14007
2022-02-05BLF: Cleanup blf_glyph_cache_find & blf_font_sizeHarley Acheson
Removes unnecessary calls to blf_glyph_cache_find, simplifies blf_font_size, and reduces calls to it. blf_glyph_cache_new and blf_glyph_cache_find made static. See D13374 for more details. Differential Revision: https://developer.blender.org/D13374 Reviewed by Campbell Barton
2022-02-04Cleanup: Grammar in comments and tooltipsHans Goudey
- "own" -> "its own" - "it's" -> "its" - Use proper plural
2022-02-04Remove internal proxy code, and deprecate related DNA data.Bastien Montagne
Part of T91671. Not much else to say, this is mainly a massive deletion of code. Note that a few cleanups possible after this proxy removal were kept out of this commit to try to reduce a bit its size. Reviewed By: sergey, brecht Maniphest Tasks: T91671 Differential Revision: https://developer.blender.org/D13995
2022-01-30Cleanup: Pass cursor position as a single array to eyedropper functionsAaron Carlisle
Since `event->xy` is now an array these functions can be simplified to accept the sample point as an array. Clarifications were also made to variable names: - `eye->last_x/y` --> `eye->cursor_last` - `mx/my` --> `cursor` Differential Revision: https://developer.blender.org/D13671
2022-01-30Cleanup: Cmake: remove unnecessary definitions for internationalizationAaron Carlisle
Previously, macros were ifdefed using the cmake option `WITH_INTERNATIONAL` However, the is unnecessary as withen the functions themselves have checks for building without internationalization. This also means that many `add_definitions(-DWITH_INTERNATIONAL)` are also unnecessary. Reviewed By: mont29, LazyDodo Differential Revision: https://developer.blender.org/D13929
2022-01-29Win IME: Ideographic Full Stop to Decimal PointHarley Acheson
Convert Ideographic Full Stop, used in Simplified Chinese and Japanese, to Decimal Point when entering numbers into numerical inputs. See D13903 for more details Differential Revision: https://developer.blender.org/D13903 Reviewed by Brecht Van Lommel
2022-01-28Drag & drop: Support using context of hovered button when droppingJulian Eisel
Buttons can hold context and it's very useful to use this as a way to let buttons provide context for drop operators. For example, with this D13549 can make the material slot list set the material-slot pointer for each row, and the drop operator can just query that.
2022-01-27Fix T95062: Outliner Library Overrides not refreshed when removing overrides.Bastien Montagne
Those operations were missing the necessary notification for the Outliner. This was also affecting RNA API of liboverrides.
2022-01-27Fix T93766: 'New Collection' entry in 'Move to collection' menu is not ↵Yevgeny Makarov
translated. Also fixes similar issues regarding some liboverride menu entries. Reviewed By: mont29 Maniphest Tasks: T93766 Differential Revision: https://developer.blender.org/D13513
2022-01-26Assets: allow creating preview image by rendering active objectJacques Lucke
For node groups there is no good default preview generation. Nevertheless, t would be useful to generate a preview image for a node group by rendering an object in some cases. This commit adds a new operator that allows updating the preview image for the active asset by rendering the active object. Note, the operator can also be used for other asset types, not just node groups. The operator can be found in a menu right below the refresh-preview button. Currently it is the only operator in that menu. In the future, more operators to create previews may be added. Differential Revision: https://developer.blender.org/D13747
2022-01-25Cleanup: Correct location of node function declarationsHans Goudey
Currently there are many function declarations in `BKE_node.h` that don't actually have implementations in blenkernel. This commit moves the declarations to `NOD_composite.h`, `NOD_texture.h`, and `NOD_shader.h` instead. This helps to clarify the purpose of the different modules. Differential Revision: https://developer.blender.org/D13869
2022-01-24Cleanup: Grammar: its self vs. itselfHans Goudey
2022-01-21UI: exclude "Undo History" from menu searchCampbell Barton
Undo history was showing in menu search since converting undo history to a menu from a popup, see: 0e1bb232e68ce71f4c3dd331ed6331665238a065.
2022-01-18RNA: display exact integer values without fraction if step is integer.Alexander Gavrilov
Display exact integer values of a floating point fields without a fraction if the step is also an exact integer. This is intended for cases when the value can technically be fractional, but most commonly is supposed to be integer. This handling is not applied if the field has any unit except frames, because integer values aren't special for quantities like length. The fraction is discarded in the normal display mode and when copying the value to clipboard, but not when editing to remind the user that the field allows fractions. Differential Revision: https://developer.blender.org/D13753
2022-01-18UI: fix a precision issue with float field step size.Alexander Gavrilov
Fix a precision issue when stepping down from 1 to 0 via the left decrement button and step 100 results in a small nonzero value. The reason is that 0.01 can't be precisely represented in binary and converting to double before multiplication reveals this. Ref D13753
2022-01-18GPU: Create Info for GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR.Jeroen Bakker
This patch converts GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR shader to use the GPUShaderCreateInfo pattern. It can be used as a reference when converting other shaders. In this special case the flat uniform vector cannot be used anymore as it doesn't fit as push constants. To solve this a uniform buffer is used.
2022-01-17Cleanup: Remove now redundant performance workaround for asset previewsJulian Eisel
Not needed anymore after aa0ecd179. The removed function was identical to `icon_draw_rect()` now. Reverts ab7214ca2ef9.
2022-01-17Cleanup: Improve naming of immediate mode buffer draw functionsJulian Eisel
Followup to the previous commit. Jeroen and I agreed the old naming was confusing.
2022-01-17UI: Speed up icon scalingJulian Eisel
Use GPU-side scaling to speed up the scaling itself, and to avoid having to copy the image buffer using the CPU. Mipmapping is used to get decent filtering when downscaling without ugly artifacts. In my comparisons, there was barely any difference between the methods for DPIs >= 1. Below that, the result looks a bit different due to the different filtering method. See D13144 for screen-recordings showing the difference. Part of T92922. Differential Revision: https://developer.blender.org/D13144 Reviewed by: Jeroen Bakker
2022-01-17Alembic: add support for reading override layersKévin Dietrich
Override layers are a standard feature of Alembic, where archives can override data from other archives, provided that the hierarchies match. This is useful for modifying a UV map, updating an animation, or even creating some sort of LOD system where low resolution meshes are swapped by high resolution versions. It is possible to add UV maps and vertex colors using this system, however, they will only appear in the spreadsheet editor when viewing evaluated data, as the UV map and Vertex color UI only show data present on the original mesh. Implementation wise, this adds a `CacheFileLayer` data structure to the `CacheFile` DNA, as well as some operators and UI to present and manage the layers. For both the Alembic importer and the Cycles procedural, the main change is creating an archive from a list of filepaths, instead of a single one. After importing the base file through the regular import operator, layers can be added to or removed from the `CacheFile` via the UI list under the `Override Layers` panel located in the Mesh Sequence Cache modifier. Layers can also be moved around or hidden. See differential page for tests files and demos. Reviewed by: brecht, sybren Differential Revision: https://developer.blender.org/D13603
2022-01-17Revert "Revert "GPUShaderCreateInfo for interface abstraction""Jeroen Bakker
This reverts commit edee5a947b7ea3e1324aa334a22c7c9bbf47f5f7. Fixes compilation error (Missing file BLI_float2.hh)
2022-01-17Revert "GPUShaderCreateInfo for interface abstraction"Jeroen Bakker
This reverts commit 8fb2ff458ba579dba08bfdf57d043ad158b5db07. Missing some files.
2022-01-17GPUShaderCreateInfo for interface abstractionJeroen Bakker
This is a first part of the Shader Create Info system could be. A shader create info provides a way to define shader structure, resources and interfaces. This makes for a quick way to provide backend agnostic binding informations while also making shader variations easy to declare. - Clear source input (only one file). Cleans up the GPU api since we can create a shader from one descriptor - Resources and interfaces are generated by the backend (much simpler than parsing). - Bindings are explicit from position in the array. - GPUShaderInterface becomes a trivial translation of enums and string copy. - No external dependency to third party lib. - Cleaner code, less fragmentation of resources in several libs. - Easy to modify / extend at runtime. - no parser involve, very easy to code. - Does not hold any data, can be static and kept on disc. - Could hold precompiled bytecode for static shaders. This also includes a new global dependency system. GLSL shaders can include other sources by using #pragma BLENDER_REQUIRE(...). This patch already migrated several builtin shaders. Other shaders should be migrated one at a time, and could be done inside master. There is a new compile directive `WITH_GPU_SHADER_BUILDER` this is an optional directive for linting shaders to increase turn around time. What is remaining: - pyGPU API {T94975} - Migration of other shaders. This could be a community effort. Reviewed By: jbakker Maniphest Tasks: T94975 Differential Revision: https://developer.blender.org/D13360
2022-01-12Revert "BLI: Refactor vector types & functions to use templates"Clément Foucault
Includes unwanted changes This reverts commit 46e049d0ce2bce2f53ddc41a0dbbea2969d00a5d.
2022-01-12BLI: Refactor vector types & functions to use templatesClment Foucault
This patch implements the vector types (i.e:`float2`) by making heavy usage of templating. All vector functions are now outside of the vector classes (inside the `blender::math` namespace) and are not vector size dependent for the most part. In the ongoing effort to make shaders less GL centric, we are aiming to share more code between GLSL and C++ to avoid code duplication. ####Motivations: - We are aiming to share UBO and SSBO structures between GLSL and C++. This means we will use many of the existing vector types and others we currently don't have (uintX, intX). All these variations were asking for many more code duplication. - Deduplicate existing code which is duplicated for each vector size. - We also want to share small functions. Which means that vector functions should be static and not in the class namespace. - Reduce friction to use these types in new projects due to their incompleteness. - The current state of the `BLI_(float|double|mpq)(2|3|4).hh` is a bit of a let down. Most clases are incomplete, out of sync with each others with different codestyles, and some functions that should be static are not (i.e: `float3::reflect()`). ####Upsides: - Still support `.x, .y, .z, .w` for readability. - Compact, readable and easilly extendable. - All of the vector functions are available for all the vectors types and can be restricted to certain types. Also template specialization let us define exception for special class (like mpq). - With optimization ON, the compiler unroll the loops and performance is the same. ####Downsides: - Might impact debugability. Though I would arge that the bugs are rarelly caused by the vector class itself (since the operations are quite trivial) but by the type conversions. - Might impact compile time. I did not saw a significant impact since the usage is not really widespread. - Functions needs to be rewritten to support arbitrary vector length. For instance, one can't call `len_squared_v3v3` in `math::length_squared()` and call it a day. - Type cast does not work with the template version of the `math::` vector functions. Meaning you need to manually cast `float *` and `(float *)[3]` to `float3` for the function calls. i.e: `math::distance_squared(float3(nearest.co), positions[i]);` - Some parts might loose in readability: `float3::dot(v1.normalized(), v2.normalized())` becoming `math::dot(math::normalize(v1), math::normalize(v2))` But I propose, when appropriate, to use `using namespace blender::math;` on function local or file scope to increase readability. `dot(normalize(v1), normalize(v2))` ####Consideration: - Include back `.length()` method. It is quite handy and is more C++ oriented. - I considered the GLM library as a candidate for replacement. It felt like too much for what we need and would be difficult to extend / modify to our needs. - I used Macros to reduce code in operators declaration and potential copy paste bugs. This could reduce debugability and could be reverted. - This touches `delaunay_2d.cc` and the intersection code. I would like to know @howardt opinion on the matter. - The `noexcept` on the copy constructor of `mpq(2|3)` is being removed. But according to @JacquesLucke it is not a real problem for now. I would like to give a huge thanks to @JacquesLucke who helped during this and pushed me to reduce the duplication further. Reviewed By: brecht, sergey, JacquesLucke Differential Revision: https://developer.blender.org/D13791
2022-01-12Revert "BLI: Refactor vector types & functions to use templates"Clément Foucault
Reverted because the commit removes a lot of commits. This reverts commit a2c1c368af48644fa8995ecbe7138cc0d7900c30.