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-09-02GPencil: Simplify Perimeter functions to not use RegionView3DAntonio Vazquez
This makes the api more portable and not depend on any visual area for background tasks like future modifiers.
2022-08-30GPencil: Improve Thickness handling for Outline operatorAntonio Vazquez
Actually, when you increase the thickness of the stroke in the outline conversion, the shape of the stroke changes and becomes thicker. This commit includes a new algorithm to correct this problem. A new `Keep Shape` parameter allows you to disable it because, for artist reasons, it may be good to keep the old algorithm and change the shape.
2022-08-02GPencil: Fix compiler warningAntonio Vazquez
The variable can never be NULL and the comparison was wrong.
2022-08-02GPencil: Allow import several SVG at timeAntonio Vazquez
For SVG is very convenient to be able to import several SVG in one operation. Each SVG is imported as a new Grease Pencil object. Also, now the SVG file name is used as Object name. Important: As all SVG imported are converted to Grease Pencil object in the same location of the 3D cursor, the SVG imported are not moved and the result may require a manual fix of location. The same is applied for depth order, the files are imported in alphabetic order according to the File list. Reviewed By: mendio, pepeland Differential Revision: https://developer.blender.org/D14865
2022-07-15Cleanup: add utlity function to compute render resolutionBrecht Van Lommel
Instead of duplicating logic many times.
2022-06-30Cleanup: Remove scene frame macros (`CFRA` et al.)Julian Eisel
Removes the following macros for scene/render frame values: - `CFRA` - `SUBFRA` - `SFRA` - `EFRA` These macros don't add much, other than saving a few characters when typing. It's not immediately clear what they refer to, they just hide what they actually access. Just be explicit and clear about that. Plus these macros gave read and write access to the variables, so eyesores like this would be done (eyesore because it looks like assigning to a constant): ``` CFRA = some_frame_nbr; ``` Reviewed By: sergey Differential Revision: https://developer.blender.org/D15311
2022-03-29GPencil: Fix Windows compiler errorsAntonio Vazquez
For non trivial data must be used `MEM_new`
2022-03-24Cleanup: use "filepath" instead of "filename" for full pathsCampbell Barton
Reserve "filename" when only the name component is used.
2022-03-01Cleanup: ED_view3d_win_to_delta & ED_view3d_calc_zfac usageCampbell Barton
- Rename ED_view3d_win_to_delta `mval` argument to `xy_delta` as it as it was misleading since this is an screen-space offset not a region relative cursor position (typical use of the name `mval`). Also rename the variable passed to this function which also used the term `mval` in many places. - Re-order the output argument of ED_view3d_win_to_delta last. use an r_ prefix for return arguments. - Document how the `zfac` argument is intended to be used. - Split ED_view3d_calc_zfac into two functions as the `r_flip` argument was only used in some special cases.
2022-02-22GPencil: Simplify sample modifier improvements.YimingWu
1. Now handles cyclic strokes correctly. 2. Added a sharp threshold value to allow preservation of sharp corners. Reviewed By: Antonio Vazquez (antoniov), Aleš Jelovčan (frogstomp) Ref D14044
2022-02-11Cleanup: remove white-space before headersCampbell 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-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 @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
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-07Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
MSVC used to warn about const mismatch for arguments passed by value. Remove these as newer versions of MSVC no longer show this warning.
2021-12-25Cleanup: use new c++ guarded allocator APIAaron Carlisle
API added in rBa3ad5abf2fe85d623f9e78fefc34e27bdc14632e
2021-12-09Cleanup: move public doc-strings into headers for 'io/gpencil'Campbell Barton
Ref T92709
2021-11-08GPencil: New option to export PDF full sceneAntonio Vazquez
This new mode export all frames of the scene. Reviewed By: pepeland Differential Revision: https://developer.blender.org/D13055
2021-08-26Cleanup: sort struct blocksCampbell Barton
2021-08-06Move NanoSVG lib to externAntonio Vazquez
The library has some modifications and it has been included in a diff. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D12142 (Some minor changes done in the patch)
2021-07-29GPencil: Fix unreported problems painting after import SVGAntonio Vazquez
After doing an import, the bounding box of the stroke was not calculated and any operation related to brushes (Sculpt, Weight Paint and Vertex Paint) was not working as expected because the bounding box of the stroke was wrong. This problem was solved automatically after any edit operation, but must be solved in the import process.
2021-07-20Cleanup: use '#if 0' for disabling multiple linesCampbell Barton
2021-07-16Cleanup: sort struct declarationsCampbell Barton
2021-07-03GPencil: Fix unreported PDF export offsetAntonio Vazquez
When exporting a PDF, the image was displaced towards top right a few pixels. Also removed is_orthographic variable because is not needed now.
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-15Cleanup: use back-slash for doxygen commentsCampbell Barton
2021-06-09Cleanup: remove redundant checks which have already been testedCampbell Barton
Note that these changes are limited simple cases as these kinds of changes could allow for errors when refactoring code when the known state is not so obvious.
2021-05-24Fix T88524: GPencil PDF does not take into account the marker cameraAntonio Vazquez
The camera was not checked before doing the export.
2021-05-19GPencil: Apply NanoSVG fixAntonio Vazquez
This fix is ported from official NanoSVG git
2021-05-17Merge branch 'blender-v2.93-release'Antonio Vazquez
2021-05-17GPencil: Fix unreported error exporting to PDF/SVG with animated cameraAntonio Vazquez
Before, the camera parameters were calculated only for first frame. If the camera is animated, these values need to be recalculated in order to get the new camera view position and export the strokes as expected. Also fixed the export of PDF when the view is not in camera view. PDF export, needs to be done in camera view.
2021-05-14GPencil: Refactor Append operatorsAntonio Vazquez
Now the operators work like other areas of Blender using the list of selected objects. Also, the name has been changed to: ```Layers: - Copy Layer to Selected - Copy All Layers to Selected Materials: - Copy Material to Selected - Copy All Materials to Selected``` Reviewed By: mendio, pablovazquez, pepeland Differential Revision: https://developer.blender.org/D11216
2021-04-28Gpencil: Fix for SVG import arc and float errorsErik Abrahamsson
Fix for the Arc commands (A/a) to successfully parse the 4th and 5th arguments. Fix for floats without a specified integer part, like `.123` File for testing: {F10042021} Reviewed By: filedescriptor Differential Revision: https://developer.blender.org/D11099
2021-04-15GPencil: Avoid invisible strokes in PDF exportAntonio Vazquez
There were still some invisible strokes.
2021-04-15Cleanup: Use correct float formatAntonio Vazquez
2021-04-15GPencil: Fix unreported error exporting big files in PDFAntonio Vazquez
The exporting was creating a pdf state for each stroke, but this was necessary only for strokes with opacity. Now, the state is only created when needed and remove the state variable from class. Also, avoid exporting invisible strokes.
2021-04-14Fix T87479: GPencil SVG export outside of cameraFalk David
When trying to export a GPencil object to SVG from outside the camera view, the expoted file would contain invalid data. This was because the calculation of the bounding box did not have any objects to iterate over. The fix makes sure we create the object list before trying to calculate the bounding box. Reviewed By: antoniov Maniphest Tasks: T87479 Differential Revision: https://developer.blender.org/D10975
2021-04-13Cleanup: sort cmake file listsCampbell Barton
2021-04-02Fix T87131: SVG as GPencil elements with both Stroke and Fill failsAntonio Vazquez
The importer was not checking if both were enabled. Now a new material is created if it's needed.
2021-03-29Fix T87013: GPencil SVG export wrong svg xml header settingsAntonio Vazquez
The attribute was missing.
2021-03-27Correct header rename error 10cfa75e1d1e80b32da640a0e7de2b50f831dcfdCampbell Barton
2021-03-27Cleanup: use .hh extension for C++ headersCampbell Barton
Follow documented convention for file naming.
2021-03-26Fix T86942: GPencil does not export SVG or PDF in orthographic cameraAntonio Vazquez
The calculation of the 2D point was wrong when using orthographic mode. Also small cleanup in float3 variable. Differential Revision: https://developer.blender.org/D10828
2021-03-26Cleanup: Fix clang-tidy errors.Jeroen Bakker
2021-03-26Cleanup: spellingCampbell Barton
2021-03-26CMake: add headers to source lists, sort file-listsCampbell Barton