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-02-17Cleanup: Alembic, split source files into reader and writerSybren A. Stüvel
This separation between reader and writer code is part of Milesone 2 of T73363. In this commit the reader and writer classes are separated into their own files, any `#include` and `using` statements are cleaned up, and some separator comments have been removed. No functional changes.
2020-02-10Cleanup/refactor: Rename `BKE_library` files to `BKE_lib`.Bastien Montagne
Note that `BKE_library.h`/`library.c` were renamed to `BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here. Part of T72604.
2020-02-05T73589: Code Quality: Renaming on BKE_material.hAntonio Vazquez
Old Name New Name ========= ========= init_def_material BKE_materials_init BKE_material_gpencil_default_free BKE_materials_exit test_object_materials BKE_object_materials_test test_all_objects_materials BKE_objects_materials_test_all give_matarar BKE_object_material_array give_totcolp BKE_object_material_num give_current_material_p BKE_object_material_get_p give_current_material BKE_object_material_get assign_material BKE_object_material_assign assign_matarar BKE_object_material_array_assign give_matarar_id BKE_id_material_array give_totcolp_id BKE_id_material_num assign_material_id BKE_id_material_assign clear_matcopybuf BKE_material_copybuf_clear free_matcopybuf BKE_material_copybuf_free copy_matcopybuf BKE_material_copybuf_copy paste_matcopybuf BKE_material_copybuf_paste BKE_material_init_gpencil_settings BKE_gpencil_material_attr_init BKE_material_add_gpencil BKE_gpencil_material_add BKE_material_gpencil_get BKE_gpencil_material BKE_material_gpencil_default_get BKE_gpencil_material_default BKE_material_gpencil_settings_get BKE_gpencil_material_settings
2020-01-27Fix OBJECT_GUARDED_FREE compiler error when type is in namespaceBrecht Van Lommel
2019-11-26Alembic export: don't assume transform is always animatedSybren A. Stüvel
Instead of always writing the transform on every frame, it's now checked whether the object is animated at all. This could be made stricter to reduce false positives, for example by checking FCurves and drivers to see whether translation/rotation/scale is animated. However, this approach is already better than the `return true` we had before. This commit adds the BKE_animdata_id_is_animated(id) function, which returns true if the ID datablock has non-empty animation data. This is determined by checking the the active action's fcurves, the drivers, and NLA tracks.
2019-11-06Alembic: improved import/export of mesh normalsSybren A. Stüvel
This commit implements the change in behaviour described in T71246. In short: For export, per mesh: - Custom loop normals are defined → loop normals are exported. - One or more polys are marked flat → loop normals are exported. - Otherwise, no normals are exported. For import, when the Alembic mesh contains: - loop normals (kFacevaryingScope) → use as custom loop normals, and enble Auto Smooth to have Blender actually use them. - vertex normals (kVertexScope or kVaryingScope) → convert to loop normals, and handle as above. - no normals → mark mesh as smooth. - unsupported normal types (kConstantScope, kUniformScope, kUnknownScope) → handle as 'no normals'. This also fixes T71130: Alembic split normal export issue Previously the mesh flag `ME_AUTOSMOOTH` was used in conjunction with the poly flag `ME_SMOOTH` to determine whether loop normals or vertex normals were exported. This behaviour was hard to predict for artists, and hard to describe in the manual. Instead, Blender now only exports loop normals, computing them if necessary. This way, the mesh in Alembic should always have the same loop normals as in Blender. Maniphest Tasks: T71130 Differential Revision: https://developer.blender.org/D6197
2019-11-05Alembic import: fix incorrect 'topology changed' errorSybren A. Stüvel
When importing subdivision surfaces a 'Topology Changed' error was shown even though the topology didn't change at all. The code was comparing to `totpoly` where `totloop` should have been used.
2019-10-17Fix T69182: Auto-Smooth does not work on Alembic meshes without normalsSybren A. Stüvel
The auto-smoothing flag can now be used by artists when the Alembic file does not contain custom loop normals. - Auto-smoothing disabled: mesh is flat-shaded. - Auto-smoothing enabled: works as usual; set angle to 180° to ensure a 100% smoothed mesh.
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-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-19Fix T70021: Alembic incomplete crease importSybren A. Stüvel
Creases are stored by the vertex indices of the edges. Sometimes they were stored with (v1, v2) when the edge itself was stored with (v2, v1). We now search for both orientations. Sorting the vertex indices before searching avoids the second search altogether when loading the example file of T70021.
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-07Partially revert "Cleanup: use post increment/decrement"Campbell Barton
This partially reverts commit 0b2d1badecc48b5cbff5ec088b29c6e9acc5e1d0 Post increment can deep-copy for C++ iterators, while in my own checks GCC was able to optimize this to get the same output, better follow C++ best practice and use pre-increment for iterators.
2019-09-07Cleanup: use post increment/decrementCampbell Barton
When the result isn't used, prefer post increment/decrement (already used nearly everywhere in Blender).
2019-08-17Cleanup: spellingCampbell Barton
2019-08-16Fix T56408: Hair children recalc on every frame on Alembic meshSybren A. Stüvel
This fixes the glitching hairs described in T56408, T63534, and possibly also T63534. The fix consists of returning the original mesh (i.e. as visible in edit mode) when constructing the ORCO mesh. This allows a static set of coordinates to be used when computing the child hair positions. The original mesh is only returned when it has the same topology (at least same number of vertices, loops, and polys. It's up the author of the Alembic file to ensure stable geometry when it's desired to be compatible with Blender's hair system. Reviewers: mont29, brecht Differential Revision: https://developer.blender.org/D5492
2019-08-01Alembic: fix heap-use-after-free errorSybren A. Stüvel
The mesh can be freed by BKE_mesh_nomain_to_mesh(), so we need to get the `ME_AUTOSMOOTH` flag before that call, and not after.
2019-07-30Alembic export: fix exporting of loop normalsSybren A. Stüvel
When the mesh is using custom normals, those should always be exported, regardless of the `ME_SMOOTH` flag on the invidivual polys. Also replaced the loop normal writing with the same logic as we use for reading (less pointer arithmetic, more normal counting).
2019-07-30Alembic import: load face-varying normalsSybren A. Stüvel
Loop normals are called 'Face-varying normals' in Alembic. Before this commit, the existence of such normals was used to enable smooth shading. This is incorrect, as the normals could encode flat faces just as well. This commit adds the loading of these normals as custom loop normals. It then also enables Auto-Smoothing on the mesh (which is a bit of a misnomer and indicates to Blender that the custom normals should be used). Fixes the glitching described in T65959. Differential Revision: https://developer.blender.org/D5191
2019-07-30Cleanup: Alembic: renamed 'smooth_normals' to 'export_loop_normals'Sybren A. Stüvel
The name now indicates what happens when the variable is set to true. No functional changes.
2019-07-30Alembic: changed 'void *user_data' to 'Mesh *mesh'Sybren A. Stüvel
The only thing that is stored in this pointer is a `Mesh*`, and casting it from/to `void*` is unnecessary and confusing. Maybe the entire CDStreamConfig class could/should be removed at some point. No functional changes.
2019-07-30Alembic: transformed chain-of-ifs into switch statementSybren A. Stüvel
By having a switch statement that lists all the values of the enum, it is clear which cases we're not handling, and it also allows for warnings in the future when the enum expands. No functional changes.
2019-07-30Alembic: use `r_` prefix for return variablesSybren A. Stüvel
No functional changes.
2019-07-30Alembic: removal of always-zero parameterSybren A. Stüvel
The `poly_start` parameter was always 0, so adding it to a poly index from Alembic is a no-op. No functional changes.
2019-07-09Alembic import: fix crash when loading invalid meshSybren A. Stüvel
These were just some missing nullptr checks.
2019-07-09Fix T52814 and T58686: Alembic crashing on fluid sim exportSybren A. Stüvel
The velocities std::vector was allocated in too narrow a scope, causing use-after-free errors.
2019-07-03Fix T66369: Excessive WARN messages in console when opening older filesBastien Montagne
CDData checking on file load was not taking into account deprecated CD_MTEXPOLY datatype, which unfortunately shows same weird glitch as CD_PAINT_MASK and CD_FACEMAP ones... Note that it was annoying (due to amount of warnings in console), but totally harmless, since that data type is just deleted anyway. This commit also generally cleans up the CD_MTEXPOLY deprecation code, we have a system to handle that, let's use it, instead of defining local static values to replace it...
2019-06-21Fix: Alembic import segfault when importing mesh with null UVsSybren A. Stüvel
This fixes an issue introduced in 4337bc2e6303dbd5f295878f3e7490995a62713a.
2019-06-18Fix T65901: Alembic crash on out-of-bounds UV indicesSybren A. Stüvel
An Alembic file saved by 3DS Max caused Blender to crash when importing. Either the UV indices in the file are out of bounds or they are written in a way we don't expect. In either case, this now no longer causes Blender to crash.
2019-04-22Cleanup: style, use bracesCampbell Barton
Add braces for modules already using braces almost everywhere.
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-04-11Fix T62664: Exporting Metaballs as Alembic crashes BlenderSybren A. Stüvel
The `AbcMetaballWriter` now subclasses `AbcGenericMeshWriter` instead of wrapping an `AbcMeshWriter`. `AbcGenericMeshWriter` was created for this purpose (writing non-mesh objects as mesh to Alembic) and performs the work in a cleaner and, more importantly, not crashing way.
2019-04-04Fix part of T62720: crash loading alembic mesh that has no vertices.Brecht Van Lommel
2019-03-22Modifiers: add minimum number of vertices to triangulate modifier.Ish Bosamiya
This lets you only triangulate n-gons when setting the number to 5 or more. Differential Revision: https://developer.blender.org/D4367
2019-03-15Cleanup: indentation, wrappingCampbell Barton
Mostly functions wrapping args, not confirming to our style guide.
2019-03-08Cleanup: use plural names for Main listsCampbell Barton
Convention was not to but after discussion on 918941483f7e we agree its best to change the convention. Names now mostly follow RNA. Some exceptions: - Use 'nodetrees' instead of 'nodegroups' since the struct is called NodeTree. - Use 'gpencils' instead of 'grease_pencil' since 'gpencil' is a common abbreviation in the C code. Other exceptions: - Leave 'wm' as it's a list of one. - Leave 'ipo' as is for versioning.
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-18doxygen: update doxygen & add balembic groupCampbell Barton
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-16Alembic: C++11 doesn't need the space between '> >'Sybren A. Stüvel
C++11 doesn't need the space between '> >' in a nested templated declaration, so instead of `std::vector<std::pair<a, b> >` we can now write `std::vector<std::pair<a, b> >`.
2019-01-16Alembic export: write curve/NURBS as meshSybren A. Stüvel
It's now possible to export curves and NURBS as mesh data to Alembic. This allows artists to do any crazy thing on curves and export the visual result to Alembic for interoperability with other software (or caching for later use, etc.). It's an often-requested feature. This works around T60503 and the fixes export part of T51311. Note that exporting zero-width curves is currently not supported, as exporting a faceless mesh (e.g. just edges and vertices) is not supported by the mesh writer at all. To test, create a curve with thickness (for example extruded), export to Alembic and check the 'Curves to Mesh' checkbox in the export options. Reviewers: sergey Differential Revision: https://developer.blender.org/D4213
2019-01-16Alembic export: separated "writing Alembic mesh" from "writing mesh object"Sybren A. Stüvel
I moved most of the `AbcMeshWriter` code to a new class `AbcGenericMeshWriter`. The latter is an abstract class and does not make any assumptions about the type of Blender object being written. This makes it possible to write metaballs, curves, nurbs surfaces, etc. as mesh to Alembic files. The `AbcMeshWriter` class now is the concrete implementation of `AbcGenericMeshWriter` for writing mesh objects. Reviewers: sergey Differential Revision: https://developer.blender.org/D4213
2019-01-15Alembic export: fixed memory leakSybren A. Stüvel
If the triangulated mesh was in itself a new mesh that should be freed this should happen before the function returns (as it only returns a single mesh, and thus the caller can only free one).
2018-11-07Cleanup: Remove 'BKE_library.h' include from 'BKE_main.h'Bastien Montagne
That kind of implicit includes should really only be done when totally, absolutely necessary, and ideally only with rather simple 'second-level' headers. Otherwise not being explicit with includes always end up biting in unexpected ways...
2018-10-23Cleanup: rename 'dm' -> 'me' for 'Mesh' typesCampbell Barton
2018-10-10Modifier: use simplified bmesh -> mesh conversionCampbell Barton
2018-10-09Cleanup: namingCampbell Barton
Use BKE_mesh_* prefix for mesh module.
2018-06-08Alembic: fixed MSVC incompatibilitySybren A. Stüvel
2018-06-07Alembic export: use depsgraph to get evaluated mesh/objectSybren A. Stüvel
2018-06-07Alembic import: don't crash Blender when reading invalid samplesSybren A. Stüvel