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
path: root/source
AgeCommit message (Collapse)Author
2022-02-16BLI: Implement templated math functions for basic typesHans Goudey
This is meant to complement the `blender::math` functions recently added by D13791. It's sometimes desired to template an operation to work on vector types, but also basic types like `float` and `int`. This patch adds that ability with a new `BLI_math_base.hh` header. The existing vector math header is changed to use the `vec_base` type more explicitly, to allow the compiler's generic function overload resolution to determine which implementation of each math function to use. This is a relatively large change, but it also makes the file significantly easier to understand by reducing the use of macros. Differential Revision: https://developer.blender.org/D14113
2022-02-16Merge branch 'blender-v3.1-release'Jacques Lucke
2022-02-16Fix: removing anonymous attributes before adding mesh to bmainJacques Lucke
This was an issue when e.g. `bpy.data.meshes.new_from_object` was used on an object that uses geometry nodes.
2022-02-16Cleanup: Use const qualifier in modifier data copySergey Sharybin
Fix possible overflow of Modifier UUID The code prior this change was re-generating modifier's session UUID prior to copying this id from the source. This approach has a higher risk of modifiers session UUID to overflow and start colliding with existing modifiers. This change makes it so that modifier copy does not re-generated the session UUID unless it is needed. Differential Revision: https://developer.blender.org/D14125
2022-02-16Cleanup: Use const qualifier in modifier data copySergey Sharybin
2022-02-16BLI: Fix compilation error caused by rBa9f023e22638Clément Foucault
Explicitly referencing the typename fixes the issue.
2022-02-16Merge branch 'blender-v3.1-release'Jeroen Bakker
2022-02-16Fix Image GPU texture.Jeroen Bakker
Due to recent changes there have been reports of incorrect loading of GPU textures. This fix reverts a part of {D13238} that might be the source of the issue.
2022-02-16Merge branch 'blender-v3.1-release'Philipp Oeser
2022-02-16Fix T95787: Texture paint: Apply Camera Image crash for certain imagesPhilipp Oeser
This does not happen with **any** image, but with images that have ID properties. ID properties are used to store view projection matrices (e.g. for reprojection with `Image from View` or `Quick Edit` -- these are the ones we are interested in), but of course they can be used for anything else, too. The images in the file from the report have ID properties from an Addon for example. So the crash can reliably be reproduced with **any** image doing the following: ``` bpy.data.images['myImage']['myIDprop'] = "foo" ``` This would lead code in `texture_paint_camera_project_exec` to think the needed `view_data` is on the image (but in reality it was just some other IDprop). Solution is simple: just check `view_data` is really valid after getting it from the IDprops. Maniphest Tasks: T95787 Differential Revision: https://developer.blender.org/D14116
2022-02-16UV: move sticky selection from image space into tool settingsCampbell Barton
Having this setting stored in the image space caused low level selection logic to have to pass around the image space (which could be NULL in some cases). Use the tool-settings instead since there doesn't seem to be much/any advantage in having this setting per-space.
2022-02-16License headers: use SPDX identifiersCampbell Barton
2022-02-16Cleanup: spelling in commentsCampbell Barton
2022-02-16Cleanup: clang-format, use static sets, sort struct declarationsCampbell Barton
2022-02-16GPUTexture: Add dimensions getterClément Foucault
Pretty straight forward. Returns the texture dimensions count. This is different from the size.
2022-02-15Fix: Build error in debug buildHans Goudey
Error in a9f023e226389461b1140
2022-02-15Merge remote-tracking branch 'origin/blender-v3.1-release'Kévin Dietrich
2022-02-15Fix T95806: subdivision missing in Cycles when using autosmoothKévin Dietrich
Although rB56407432a6a did fix missing subdivision in some cases, in other cases it did not return the mesh wrapper (like when using autosmooth, which requires a copy of the mesh), so the non-subdivided mesh was still returned.
2022-02-15Merge remote-tracking branch 'origin/blender-v3.1-release'Kévin Dietrich
2022-02-15Fix T95697: GPU subdivision ignores custom normalsKévin Dietrich
Similarly to the CPU subdivision, we interpolate custom loop normals from the coarse mesh, and this for the final normals.
2022-02-15GPU subdiv: fix custom data interpolation for N-gonsKévin Dietrich
Not all coarse vertices were used to compute the center value (off by one), and the interpolation for the current would always start at the base corner for the base face instead of the base corner for the current patch.
2022-02-15BLI: Change dependencies in vector math filesHans Goudey
This patch reverses the dependency between `BLI_math_vec_types.hh` and `BLI_math_vector.hh`. Now the higher level `blender::math` functions depend on the header that defines the types they work with, rather than the other way around. The initial goal was to allow defining an `enable_if` in the types header and using it in the math header. But I also think this operations to types dependency is more natural anyway. This required changing the includes some files used from the type header to the math implementation header. I took that change a bit further removing the C vector math header from the C++ header; I think that helps to make the transition between the two systems clearer. Differential Revision: https://developer.blender.org/D14112
2022-02-15Cleanup: Rename file used for calculating mesh edgesHans Goudey
This commit renames `mesh_validate.cc` to `mesh_calc_edges.cc`. I would like to move `mesh_validate.c` to C++, but it makes sense to keep this specific algorithm in a smaller file.
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-15RNA: add RNA_collection_is_empty & RNA_property_collection_is_emptyCampbell Barton
Some collections needed to be iterated over to count their length. Provide a function to check if the collection is empty to avoid this.
2022-02-15Merge branch 'blender-v3.1-release'Campbell Barton
2022-02-15Fix T95791: Unable to switch between multiviews.Jeroen Bakker
Root cause is copy pasting buggy code.
2022-02-15Fix T94085: Crash with empty stroke listCampbell Barton
2022-02-15Fix T95791: Unable to switch between multiviews.Jeroen Bakker
Root cause is copy pasting buggy code.
2022-02-15CMake: create readme.html with configure_fileAnkit Meel
Since the output file stays unmodified for most developer builds, install step installed it redundantly. Create readme.html using `configure_file`: - Now it's modified only if final output changes (handled by CMake). - If input file (from git) or blender version changes, it //will// be modified. Also don't re-implement what CMake can do. Reviewed By: campbellbarton, LazyDodo Differential Revision: https://developer.blender.org/D13863
2022-02-15Cleanup: unused argument warningsCampbell Barton
2022-02-15Cleanup: minor changes to Python argument parsing loopCampbell Barton
- Increment the argument index at the end of the loop. Otherwise using the index after incrementing required subtracting 1. - Move error prefix creation into a function: `pyrna_func_error_prefix` so it's possible to create an error prefix without duplicate code. This simplifies further changes for argument parsing from D14047.
2022-02-15Merge branch 'blender-v3.1-release'Hans Goudey
2022-02-15Fix T95720: Spreadsheet missing volume grid infoHans Goudey
The cell drawing code in 474adc6f883c2d5a854d7 was missing an implementation for virtual arrays of strings.
2022-02-15GLShaderInterface: Fix undefined behavior when attributes are optimized away.Clément Foucault
Optimized out attributes returns an invalid location `-1` resulting in an undefined behavior shift.
2022-02-15Merge branch 'blender-v3.1-release'Clément Foucault
2022-02-15GLCompute: Apply state before dispatchClément Foucault
2022-02-15GLDebug: Fix severity checkClément Foucault
The check was reversed, leading to less errors being reported.
2022-02-15GPUTexture: Fix missing enum cases in `to_component_len()`Clément Foucault
This might have caused undersized buffer if using the wrong formats with `GPU_texture_read()`.
2022-02-15Cleanup: Use C++ math functionsHans Goudey
Use functions from the `math` and `std` namespaces instead of from `BLI_math_vector.h`.
2022-02-14Cleanup: Pass const Scene to mesh evaluationHans Goudey
2022-02-14Merge branch 'blender-v3.1-release'Sergey Sharybin
2022-02-14Fix T95756: Crash inserting geometry node after linking modifierSergey Sharybin
The root issue was caused by a mistake in modifier copy data which was wrongly re-generating source modifier data identifier. The c8cca8885181 simply exposed a bug in code which always was there since the modifiers session UUID was introduced. Shows an importance of const qualifier :)
2022-02-14Merge branch 'blender-v3.1-release'Thomas Dinges
2022-02-14Cleaunp: Modify commentAntonio Vazquez
2022-02-14Fix T94479: GPU Subdivision surface modifier does not apply to Cycles rendersKévin Dietrich
Since now we delegate the evaluation of the last subsurf modifier in the stack to the draw code, Cycles does not get a subdivided mesh anymore. This is because the subdivision wrapper for generating a CPU side subdivision is never created as it is only ever created via `BKE_object_get_evaluated_mesh` which Cycles does not call (rather, it accesses the Mesh either via `object.data()`, or via `object.to_mesh()`). This ensures that a subdivision wrapper is created when accessing the object data or converting an Object to a Mesh via the RNA/Python API. Reviewed by: brecht Differential Revision: https://developer.blender.org/D14048
2022-02-14GPencil: Fill Dilate using negative values contract the fill areaAntonio Vazquez
This is requested by artist for some animation styles where is necessary to fill the area, but create a gap between fill and stroke. Also some code cleanup and fix a bug in dilate for top area. Reviewed By: pepeland, mendio Differential Revision: https://developer.blender.org/D14082
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-14Merge remote-tracking branch 'origin/blender-v3.1-release'Kévin Dietrich
2022-02-14Fix T95177: GPU subdiv crashes mirror modifier in edit-modeKévin Dietrich
The issue has two causes: on one hand origin indices were not handled properly, on the other hand the extraction type (Mesh, BMesh, or mapped) was not detected correctly. For the second case reuse the MeshRenderData creation from the coarse code path so that we make the same decisions. Loose geometry extraction had to be updated to properly handle the BMesh cases. For the origin indices, in some cases (for edges and faces), the arrays used by the subdivision code already have the origin indices baked into them, so mapping them a second time through the origin index layer is wrong, and could cause out of bounds accesses. For vertices especially, we would use two arrays: one for mapping subdivision vertices to coarse vertices, and another one to map coarse vertices to subdivision loops used for the selection index buffer. The second one is now removed (which saves a bit of memory) as it is did not have the proper data setup for use with the origin indices and we can easily compute it using the first array anyway.