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-04-13Cleanup: avoid redundant float/int conversions in BLFCampbell Barton
Internally many offsets for BLF were integers but exposed as floats, since these are used in pixel-space, many callers were converging them back to integers. Simplify logic by using ints.
2022-04-01Cleanup: Improve variable namingLeon Schittek
The variable `ofs` in `widget_numslider` was referring to the radius. `rad` is more clear and consistent with the other widget functions.
2022-04-01Fix T88785: Keep value slider from clippingLeon Schittek
Keep the value slider from clipping through rounded corners for low values by ensuring the width of the slider rectangle is at least twice the corner radius. Reviewed By: Hans Goudey Differential Revision: https://developer.blender.org/D11474
2022-03-30Metal: Adding alternative support for GPU_PRIM_TRI_FAN/LINE_LOOP For Metal ↵Jason Fielder
backend. - Metal uniform array compatibility in DRW module. - Guard OpenGL-specific workarounds and flushes behind GPU_type_matches_ex API guard. Add further render boundaries for render paths called outside of the main loop. Authored by Apple: Michael Parkin-White Ref: T96261 Reviewed By: fclem Differential Revision: https://developer.blender.org/D14438
2022-03-24Outliner: Don't draw library overrides indicator for override buttonsJulian Eisel
All the buttons in the Library Overrides display mode would be shown in cyan, indicating that they are library overrides. Given that this is solely what this display mode is about, the indicator is just redundant, confusing (why are the buttons purple?) and looks weird. Part of T95802. Reviewed by: Bastien Montagne Differential Revision: https://developer.blender.org/D14416
2022-03-07UI: align labels of number fields and value slidersLeon Schittek
Previously the labels and values in number fields and value sliders used different padding for the text. This looks weird when they are placed underneath each other in a column and, as noted by a comment in the code of `widget_numslider`, they are actually meant to be aligned. This patch fixes that by using the same padding that is used for the number field for the value slider, as well. This also has the benefit, that the labels of the value sliders don't shift anymore when adjusting the corner roundness. Differential Revision: https://developer.blender.org/D14091
2022-03-01Cleanup: use doxygen comments, correct spellingCampbell Barton
Also move eDupli_ID_Flags doc-string to it's declaration.
2022-02-23Cleanup: Remove repeated word in commentsCampbell Barton
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-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.
2022-01-12BLI: Refactor vector types & functions to use templatesClément 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 @Howard Trickey (howardt) opinion on the matter. - The noexcept on the copy constructor of mpq(2|3) is being removed. But according to @Jacques Lucke (JacquesLucke) it is not a real problem for now. I would like to give a huge thanks to @Jacques Lucke (JacquesLucke) who helped during this and pushed me to reduce the duplication further. Reviewed By: brecht, sergey, JacquesLucke Differential Revision: http://developer.blender.org/D13791
2022-01-12BLF: UI_fontstyle_draw UsageHarley Acheson
Add maximum string length argument to UI_fontstyle_draw to reduce usage of BLF_DRAW_STR_DUMMY_MAX. Reorders arguments to UI_fontstyle_draw_ex See D13794 for more details. Differential Revision: https://developer.blender.org/D13794 Reviewed by Campbell Barton
2022-01-12BLF: Reduction of use of BLF_DRAW_STR_DUMMY_MAXHarley Acheson
Reduction of the number of uses of the define BLF_DRAW_STR_DUMMY_MAX by using actual sizes of static character arrays. See D13793 for more details. Differential Revision: https://developer.blender.org/D13793 Reviewed by Campbell Barton
2021-12-14Cleanup: correct unbalanced doxygen groupsCampbell Barton
Also add groups in some files.
2021-12-08Cleanup: move public doc-strings into headers for 'editors'Campbell Barton
Ref T92709
2021-12-02UI: Fix scaling of HSV cursor when zoomingLeon Leno
The small circle used to choose the hue/saturation and value in the color widget was drawn with a fixed screen space size. Now scale the circle used as cursor in the color widget based on the zoom. This could have been part of a9642f8d6130 but the implementation is different. Based on a fix provided by Erik Abrahamsson Differential Revision: https://developer.blender.org/D13444
2021-11-30Cleanup: clang-format, trailing spaceCampbell Barton
2021-11-25Merge branch 'blender-v3.0-release'Julian Eisel
2021-11-25Fix T92278: Small size of previews in the shading popoverJulian Eisel
Don't use the side padding for menu item contents when displaying previews or icons in a row or grid layout. This can cause problems for the preview drawing and doesn't make sense to draw there anyway. This not only fixes the mentioned issue, but also too small heighlight for the collection color tag in the Outliner context menu. Alternative to and similar to D13125.
2021-11-24Merge branch 'blender-v3.0-release'Julian Eisel
2021-11-24UI: Improve scaling of widgets when zoomingLeon Leno
This commit improves the scaling of some ui widgets when zooming by making the radius of the rounded corners dependent on the element's zoom level. Needed to fix T92278 without padding issues, see D13125. Reviewed By: Hans Goudey, Julian Eisel Differential Revision: https://developer.blender.org/D12842
2021-11-20Refactor: Port spreadsheet data set to UI tree viewHans Goudey
This patch removes a bunch of specific code for drawing the spreadsheet data set region, which was an overly specific solution for a generic UI. Nowadays, the UI tree view API used for asset browser catalogs is a much better way to implement this behavior. To make this possible, the tree view API is extended in a few ways. Collapsibility can now be turned off, and whether an item should be active is moved to a separate virtual function. The only visual change is that the items are now drawn in a box, just like the asset catalog. Differential Revision: https://developer.blender.org/D13198
2021-11-06Fix: Property editor icon jittering in some casesLeon Leno
In the tools tab, the tool icon would be offset when it intersected the bottom of the editor. With some screen resolutions, the icons on the left side of the editor would also move when intersecting the bottom of the editor. This happened because of the truncation in the implicit conversion from float to int. Instead, use explicit conversion functions. Differential Revision: https://developer.blender.org/D11097
2021-11-04UI: Fix UIList item using "regular" widget colors while editedPablo Vazquez
Simply removing the check for `UI_STATE_TEXT_INPUT` makes it inherit the "List Item" User Interface theme settings. This patch changes the default theme to match the colors of text input fields. #### Master {F11680556, size=full} #### This patch {F11680557, size=full} All the included commmunity themes seem to work well (only Deep Grey might need more contrast but that's a different patch). Related reports: T92720 Reviewed By: #user_interface, Severin Maniphest Tasks: T92720 Differential Revision: https://developer.blender.org/D13073
2021-10-28Fix: Improve node socket icon scaling group input/output listLeon Leno
This patch makes `widget_nodesocket` base the size of the drawn socket icon on the rectangle that’s passed in to allow it to scale with the rest of the interface. Differential Revision: https://developer.blender.org/D11734
2021-10-25Cleanup: Remove unused functions, make functions staticHans Goudey
2021-10-25Fix T92293: Clipped labels for graph editor modifiersCampbell Barton
While c7d94a7827a5be9343eea22a9638bb059f185206 exposed this bug, this was caused by a discrepancy in padding where labels would have additional padding when drawing without emboss. The padding made widget drawing behave as if the text took up more room causing it to be clipped. Now labels are considered the same width with/without emboss.
2021-10-23Cleanup: Remove unused functionHans Goudey
2021-10-15UI: Remove extra padding around curve widgetLeon Leno
This commit removes the constant padding around to the left and right of the curve widget. The padding worked in screen space and didn't take UI scale/zoom into account. This makes the curve widget consistent with the more recently added curve profile widget used for bevel profiles. Differential Revision: https://developer.blender.org/D12883
2021-10-13UI: Make menu item use theme roundnessPablo Vazquez
Menu items ignore the roundness setting since they spread left to right. This patch makes it so menu items use the theme preference instead of hardcoded square corners. Providing more flexibility to themes. All built-in and included themes already have this set so no need to update them. For the default themes (Dark/Light) roundness is 0.4. {F10950727, size=full} The motivations behind this change are: * To be more consistent with other widgets. * Improve themes flexibility. * Match padding with other elements that have like the Search field: {F10950746, size=full} Reviewed By: #user_interface, Severin Differential Revision: https://developer.blender.org/D12813
2021-10-08UI: Support showing superimposed icons as disabled (with disabled hint)Julian Eisel
If the operator poll of a superimposed icon returned `false`, the superimposed icon would just draw normally and fail silently. Instead it will now be drawn grayed out, plus the tooltip of the icon can show the usual "disabled hint" (a hint explaining why the button is disabled).
2021-10-03Cleanup: spelling in stringsCampbell Barton
2021-09-23UI: Tree-View API for easy creation of tree UIsJulian Eisel
This follows three main targets: * Make creation of new tree UIs easy. * Groundwork to generalize tree UIs (so e.g. Outliner, animation channels, asset catalogs and spreadsheet data-sets don't have to re-implement basic tree UI code) or even other data-view UIs. * Better separate data and UI state. E.g. with this, tree-item selection or the open/collapsed state can be stored on the UI level, rather than in data. (Asset Catalogs need this, storing UI state info in them is not an option.) In addition, the design should be well testable and could even be exposed to Python. Note that things will likely change in master still. E.g. the actually resulting UI isn't very nice visually yet. The design is documented here: https://wiki.blender.org/wiki/Source/Interface/Views Differential Revision: https://developer.blender.org/D12573
2021-09-13Asset Template: Extra UI optionsDalai Felinto
This allow users to show/hide: * Library name / refresh. * Assets names. * Filter. To set them in Python use: display_options={'NO_NAMES', 'NO_FILTER', 'NO_LIBRARY'} With contributions by Julian Eisel. Differential Revision: https://developer.blender.org/D12476
2021-08-27Cleanup: utf8 stepping functionsCampbell Barton
Various changes to reduce risk of out of bounds errors in utf8 seeking. - Remove BLI_str_prev_char_utf8 This function could potentially scan past the beginning of a string. Use BLI_str_find_prev_char_utf8 instead which takes a limiting string start argument. - Swap arguments for BLI_str_find_prev_char_utf8 so the stepping argument is first and the limiting argument is last. This matches BLI_str_find_next_char_utf8. - Change behavior of these functions to return it the start or end pointers instead of NULL, which complicated use of these functions to calculate offsets. Callers that need to check if the limits were reached can compare the return value with the start/end pointers. - Return 'const char *' from these functions so they don't remove const from the input arguments.
2021-08-19UI: Remove "Unfitted" Kerning Style OptionHarley Acheson
This patch removes the "Kerning Style" option for UI widget font drawing and uses only the current default of "Fitted", since the other option of "Unfitted" is just the result of truncation errors. see D12231 for much more information. Differential Revision: https://developer.blender.org/D12231 Reviewed by Campbell Barton
2021-07-30Cleanup: missing leading '*' from comment blocksCampbell Barton
2021-07-15UI: New button/widget type for Asset Browser like preview tilesJulian Eisel
This button type shows a preview image above centered text, similar to the File Browser files in Thumbnail Display Mode or the default Asset Browser display. In fact we may want to port these over to use the new button type at some point. Will be used by the asset view UI template that will be added in a following commit. That is basically a mini version of the Asset Browser that can be displayed elsewhere in the UI.
2021-07-15Cleanup: replace BLI_assert(!"text") with BLI_assert_msg(0, "text")Campbell Barton
This shows the text as part of the assertion message.
2021-07-13Cleanup: duplicate checks, unused initializationCampbell Barton
2021-07-07Cleanup: spelling in commentsCampbell Barton
2021-07-06UI: Center the Status Bar Progress TextVincent Blankfield
This patch horizontally centers the text inside the progress bar widget. It is currently left-aligned and offset to the middle, which doesn't center properly. see D11205 for details and examples. Differential Revision: https://developer.blender.org/D11205 Reviewed by Julian Eisel
2021-07-05Fix: macOS wrong IME candidate window position on first displayYuki Hashimoto
IME conversion candidate window was displayed at the mouse position, instead of below the cursor or text selection. Blender need to tell the input method program where the conversion candidate window is during Japanese and Chinese input. In macOS, the `firstRectforCharacterRange` is called when input by the input method starts, and the position of the conversion candidate window is specified. Therefore, it is necessary to set the position of the conversion candidate window before input starts. This patch changes it so that the position of the conversion candidate window is always set when the cursor is drawn. Differential Revision: https://developer.blender.org/D11697
2021-07-05Fix: IME input displays text after cursor before cursorYuki Hashimoto
When inserting text using IME on a button, the character after the cursor is displayed before the cursor. This bug seems to have occurred during the refactoring in D765. Differential Revision: https://developer.blender.org/D11072
2021-07-05Cleanup: spelling in commentsCampbell Barton
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-06-30Cleanup: use const arguments for accessor functionsCampbell Barton
2021-06-28Cleanup: repeated terms in code comments & error messagesCampbell Barton