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
2020-03-17Cleanup: use more descriptive variable name for the data-maskCampbell Barton
Make it explicit this data mask is added to the default mask.
2020-03-06Cleanup: Mesh: Move to IDTypeInfo and remove unused BKE API.Bastien Montagne
2020-03-04Refactor ID make local to use a single flag parameter.Bastien Montagne
Instead of using anonymous booleans flags, also allows to keep the same behavior in all cases, without needing special handling from calling code for our beloved oddballs object proxies...
2020-02-26Cleanup: reduce CDDM use, remove unused function callsCampbell Barton
2020-02-07Cleanup: use of 'unsigned'Campbell Barton
- Replace 'unsigned' used on it's own with 'uint'. - Replace 'unsigned const char' with 'const uchar'.
2020-01-30Fix T65146: Curve Texture Coordinates in Cycles and Eevee differClément Foucault
Remove the use UV for mapping option.
2019-09-23Modifiers: every modifier now copies mesh settings, fixing texture space issuesBrecht Van Lommel
Modifier stack evaluation would copy mesh settings other than mesh topology automatically, outside of the individual modifier evaluation. This leads to hard to understand code, and makes it unclear which settings are available in following modifiers, and which only after the entire stack is evaluated. Now every modifier is responsible to ensure the mesh it outputs preserves materials, texture space and other settings, or alters them as needed. Fixes T64739: incorrect texture space for various modifiers Differential Revision: https://developer.blender.org/D5808
2019-09-23Cleanup: remove unimplemented texture space rotation variablesBrecht Van Lommel
2019-09-23Cleanup: remove Mesh.bb and Curve.bb, no reason for these to be persistentBrecht Van Lommel
These were only strictly valid for texture space calculation, don't store them since they should not be used after that. Only store a flag to indicate if the auto texture space has been evaluated. In the future it might make sense to store bounding boxes at the mesh level to speed up bounding box computation for multiple objects using the same mesh, but then it will need to be implemented differently.
2019-09-21Revert "Modifiers: every modifier now copies mesh settings, fixing texture ↵Brecht Van Lommel
space issues" This reverts commit e7a514369fe700dcc5a1fe433c8f709ed9595ded, it introduces a bug in selection in edit mode. Fixes T70103: can't select extruded Vertex Ref T64739
2019-09-19Modifiers: every modifier now copies mesh settings, fixing texture space issuesBrecht Van Lommel
Modifier stack evaluation would copy mesh settings other than mesh topology automatically, outside of the individual modifier evaluation. This leads to hard to understand code, and makes it unclear which settings are available in following modifiers, and which only after the entire stack is evaluated. Now every modifier is responsible to ensure the mesh it outputs preserves materials, texture space and other settings, or alters them as needed. Fixes T64739: incorrect texture space for various modifiers Differential Revision: https://developer.blender.org/D5808
2019-09-09Added function to calculate the total area of a mesh.Sebastian Parborg
2019-09-07Cleanup: includes in headersCampbell Barton
Forward declare structs where possible.
2019-08-27Fix multires modifier using too much memory outside of sculpt modeBrecht Van Lommel
This reduce memory usage by about 25% in object mode for multires meshes.
2019-08-25Cleanup: redundant struct declarationsCampbell Barton
2019-08-25Cleanup: remove UV name syncing functionCampbell Barton
MTFace's on the mesh are now only used for conversion. There is no need to keep both UV layers in sync at once.
2019-08-25Cleanup: rename mesh looptri/tessface functionsCampbell Barton
Use consistent terminology.
2019-08-25Cleanup: remove BKE_mesh_calc_normals_tessfaceCampbell Barton
This was used for versioning, now normals are calculated after initializing MPoly data.
2019-08-25Cleanup: remove tessface loop from set-smooth functionCampbell Barton
2019-08-24Transform: option to transform origins in object modeCampbell Barton
Currently supports mesh, armature, lattice, curve & metaballs. Access from pivot popover.
2019-08-21Cleanup: vertex coordinate access, naming & minor changesCampbell Barton
This also splits vertex access and allocation so it's possible to copy coordinates into an existing array without allocating it.
2019-08-21Cleanup: use const arguments for vertex coordsCampbell Barton
2019-08-14Mesh Batch Cache: Refactor + MultithreadClément Foucault
For clarity sake, the batch cache now uses exclusively per Loop attributes. While this is a bit of a waste of VRAM (for the few case where per vert attribs are enough) it reduces the complexity and amount of overall VBO to update in general situations. This patch also makes the VertexBuffers filling multithreaded. This make the update of dense meshes a bit faster. The main bottleneck is the IndexBuffers update which cannot be multithreaded efficiently (have to increment a counter and/or do a final sorting pass). We introduce the concept of "extract" functions/step. All extract functions are executed in one thread each and if possible, using multiple thread for looping over all elements. Reviewed By: brecht Differential Revision: http://developer.blender.org/D5424
2019-08-02Fix T68135: Do not return NULL/None when converting an object to a mesh.Bastien Montagne
Does not make sense in the use-cases of that function, especially since we don't know whether it is actually due to an error, or some glitch (like an empty curve). Think we always want to get a mesh when using either operator conversion, or the `bpy.data.meshes.new_from_object` function. Note that an assert was also added to ensure we do try to convert from a valid 'geometry' object type.
2019-07-31Add operator for removing unused material slotsLukas Stockner
Reviewers: campbellbarton, brecht Reviewed By: brecht Subscribers: brecht Differential Revision: https://developer.blender.org/D4991
2019-07-31Added BKE_mesh_clear_geometry() functionSybren A. Stüvel
This function makes it possible to clear/remove/nuke all the geometry in a mesh, allowing functions like `Mesh.from_python()` to construct a new mesh in its place. Without this function, code like in T67627 have to allocate a new Mesh datablock, fill that, and swap out the old Mesh for the new one. This introduces issues when exporting, as the new mesh could be seen by an exporter as unrelated to the old one. Shape keys are not freed by this function. Freeing those would require tagging the depsgraph for relations update, which is an expensive operation. They should be removed explicitly if necessary. Material slots are also not cleared by this function, in the same way that they are not cleared when manually removing all geometry from a mesh. The `BKE_mesh_clear_geometry()` function is available in Python as `mesh.clear_geometry()`. Reviewed by: mont29, brecht Differential Revision: https://developer.blender.org/D5373
2019-07-28Fix T67385: Bind in Laplacian Deform Modifier with new vertex group in Edit ↵Bastien Montagne
Mode crashes Blender. Main issue in that report was that meshes generated from `mesh_create_eval_final_view()` and the like need some special freeing handling (as, among other things, they borrow and do not own their potential editmesh data...). Factorized that into a helper func also used by `BKE_object_free_derived_caches()`.
2019-05-27Depsgraph API: Allow preserving custom data layersSergey Sharybin
This commit extends dependency graph API with an argument which denotes that all custom data layers are to be preserved. This forces modifier stack re-evaluation with more inclusive mask. Far from ideal, since this might fail in certain configurations with indirectly used objects which might be missing layers needed for the current object evaluation. But this is how it worked for a long time, so should be good enough for until more sophisticated solution is found. In order to use this new behavior two things are to be passed: - Pass keep_all_data_layers=True - Pass a valid dependency graph. The dependency graph is only needed if keep_all_data_layers=True and is NOT to be passed if keep_all_data_layers=False. If keep_all_data_layers=True the dependency graph MUST be passed. Reviewers: mont29, brecht Reviewed By: mont29 Maniphest Tasks: T64994, T64794 Differential Revision: https://developer.blender.org/D4940
2019-05-16Tweak API to support adding evaluated meshes to main databaseSergey Sharybin
One of the usecases is to create mesh from an object is a manner similar to how Apply Modifiers does it, and have it in the bmain so it can be referenced by other objects. This usecase is something what went unnoticed in the previous API changes, so here is a followup. Summary of changes: * bpy.meshes.new_from_object() behaves almost the same as before this change. The difference now is that it now ensures all referenced data-blocks are original (for example, materials referenced by the mesh). * object.to_mesh() now creates free-standing Mesh data-block which is outside of any bmain. The object owns it, which guarantees the memory never leaks. It is possible to force free memory by calling object.to_mesh_clear(). Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D4875
2019-05-16Dependency graph API changesSergey Sharybin
Main goal here is to make it obvious and predictable about what is going on. Summary of changes. - Access to dependency graph is now only possible to a fully evaluated graph. This is now done via context.evaluated_depsgraph_get(). The call will ensure both relations and datablocks are updated. This way we don't allow access to some known bad state of the graph, and also making explicit that getting update dependency graph is not cheap. - Access to evaluated ID is now possible via id.evaluated_get(). It was already possible to get evaluated ID via dependency graph, but that was a bit confusing why access to original is done via ID and to evaluated via depsgraph. If datablock is not covered by dependency graph it will be returned as-is. - Similarly, request for original from an ID which is not evaluated will return ID as-is. - Removed scene.update(). This is very expensive to update all the view layers. - Added depsgraph.update(). Now when temporary changes to objects are to be done, this is to happen on original object and then dependency graph is to be updated. - Changed object.to_mesh() to behave the following way: * When is used for original object modifiers are ignored. For meshes this acts similar to mesh-copy, not very useful but allows to keep code paths similar (i.e. for exporter which has Apply Modifiers option it's only matter choosing between original and evaluated object, the to_mesh() part can stay the same). For curves this gives a mesh which is constructed from displist without taking own modifiers and modifiers of bevel/taper objects into account. For metaballs this gives empty mesh. Polygonization of metaball is not possible from a single object. * When is used for evaluated object modifiers are always applied. In fact, no evaluation is happening, the mesh is either copied as-is, or constructed from current state of curve cache. Arguments to apply modifiers and calculate original coordinates (ORCO, aka undeformed coordinates) are removed. The ORCO is to be calculated as part of dependency graph evaluation. File used to regression-test (a packed Python script into .blend): {F7033464} Patch to make addons tests to pass: {F7033466} NOTE: I've included changes to FBX exporter, and those are addressing report T63689. NOTE: All the enabled-by-default addons are to be ported still, but first want to have agreement on this part of changes. NOTE: Also need to work on documentation for Python API, but, again, better be done after having agreement on this work. Reviewers: brecht, campbellbarton, mont29 Differential Revision: https://developer.blender.org/D4834
2019-05-08Cleanup: Remove BKE_MESH_BATCH_DIRTY_MAYBE_ALLClément Foucault
2019-05-08Cleanup: Mesh Batch Cache: Remove unused BKE_MESH_BATCH_DIRTY_SCULPT_COORDSClément Foucault
2019-04-29DRW: Improve edit mode selection time when using auto-smoothClément Foucault
Unfortunately it does not concern paint mode. Related to T63946
2019-04-29Cleanup: internal apply modifier code: make it clear we use eval modifier ↵Bastien Montagne
and object.
2019-04-27Cleanup: comments (long lines) in blenkernelCampbell Barton
2019-04-21Cleanup: comments (mainly long lines)Campbell Barton
Comments after code can cause awkward line breaks.
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-03-07Refactor CDData masks, to have one mask per mesh elem type.Bastien Montagne
We already have different storages for cddata of verts, edges etc., 'simply' do the same for the mask flags we use all around Blender code to request some data, or limit some operation to some layers, etc. Reason we need this is that some cddata types (like Normals) are actually shared between verts/polys/loops, and we don’t want to generate clnors everytime we request vnors! As a side note, this also does final fix to T59338, which was the trigger for this patch (need to request computed loop normals for another mesh than evaluated one). Reviewers: brecht, campbellbarton, sergey Differential Revision: https://developer.blender.org/D4407
2019-02-28Cleanup/refactor clnor code: add high-level helpers to set custom normals.Bastien Montagne
Now it will be simpler for code jsut wanting to preserve custom normals around to set them, without having to add same boiler plate code all the time around actual code.
2019-02-23Cleanup: move variable declarations to headersCampbell Barton
Quiet undeclared variable warning.
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-01-28Cleanup: sort forward declarations of enum & structCampbell Barton
Done using: source/tools/utils_maintenance/c_sort_blocks.py
2018-12-17RNA: Add Mesh.count_selected_items()Campbell Barton
Needed for context menu checks.
2018-12-13Silence warning (const)Dalai Felinto
2018-12-03Fix T57858: Add validation callback to CustomData layers.Bastien Montagne
Our mesh validation was only checking cd layout so far, not their actual data. While this might only be needed for a few types, this is a required addition for things like imported UVs, else we have no way to avoid nasty things like NANs & co. Note that more layer types may need that callback, time will say. For now added it to some obvious missing cases...
2018-11-27Revert "Inline function BKE_mesh_boundbox_calc inside BKE_mesh_texspace_calc ↵Campbell Barton
to avoid confusion." This reverts commit e6322abad23a8ae71b72e54befffc17ae35e30d9.
2018-11-26Inline function BKE_mesh_boundbox_calc inside BKE_mesh_texspace_calc to ↵mano-wii
avoid confusion.
2018-11-21transform_snap_object: Use the texture space bound box to test the need to ↵mano-wii
snap to meshes in edit mode. Before a value for bound box was stored in a local cache.