Commit Graph

89 Commits

Author SHA1 Message Date
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Sergey Sharybin c1bc70b711 Cleanup: Add a copyright notice to files and use SPDX format
A lot of files were missing copyright field in the header and
the Blender Foundation contributed to them in a sense of bug
fixing and general maintenance.

This change makes it explicit that those files are at least
partially copyrighted by the Blender Foundation.

Note that this does not make it so the Blender Foundation is
the only holder of the copyright in those files, and developers
who do not have a signed contract with the foundation still
hold the copyright as well.

Another aspect of this change is using SPDX format for the
header. We already used it for the license specification,
and now we state it for the copyright as well, following the
FAQ:

    https://reuse.software/faq/
2023-05-31 16:19:06 +02:00
Sergey Sharybin a12a8a71bb Remove "All Rights Reserved" from Blender Foundation copyright code
The goal is to solve confusion of the "All rights reserved" for licensing
code under an open-source license.

The phrase "All rights reserved" comes from a historical convention that
required this phrase for the copyright protection to apply. This convention
is no longer relevant.

However, even though the phrase has no meaning in establishing the copyright
it has not lost meaning in terms of licensing.

This change makes it so code under the Blender Foundation copyright does
not use "all rights reserved". This is also how the GPL license itself
states how to apply it to the source code:

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software ...

This change does not change copyright notice in cases when the copyright
is dual (BF and an author), or just an author of the code. It also does
mot change copyright which is inherited from NaN Holding BV as it needs
some further investigation about what is the proper way to handle it.
2023-03-30 10:51:59 +02:00
Hans Goudey ebc385de5f Cleanup: Remove unused DerivedMesh functions 2022-09-11 21:42:41 -05:00
Campbell Barton c434782e3a File headers: SPDX License migration
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-02-11 09:14:36 +11:00
Sebastian Parborg 2115232a16 Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fix
No functional changes
2020-09-04 21:04:16 +02:00
Jacques Lucke 91694b9b58 Code Style: use "#pragma once" in source directory
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.

This patch has been generated by P1561 followed by `make format`.

Differential Revision: https://developer.blender.org/D8466
2020-08-07 09:50:34 +02:00
Campbell Barton 00e99959d3 Cleanup: double-spaces in comments 2020-05-09 17:15:43 +10:00
Jacques Lucke 5de56f9596 Cleanup: make remaining blenkernel headers work in C++ 2020-03-02 15:07:49 +01:00
Campbell Barton c8d31807d2 Cleanup: reduce CDDM use, remove unused function calls 2020-02-26 15:22:46 +11:00
Campbell Barton e6be2af061 Cleanup: remove cddm_from_bmesh
Use BKE_mesh_from_bmesh_for_eval_nomain instead.
2020-02-25 21:30:23 +11:00
Campbell Barton 0050a044fa Cleanup: remove unused derived-mesh API calls 2019-08-21 11:41:40 +10:00
Campbell Barton e12c08e8d1 ClangFormat: apply to source, most of intern
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-17 06:21:24 +02:00
Bastien Montagne ab0bc65c24 Refactor CDData masks, to have one mask per mesh elem type.
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-03-07 11:29:50 +01:00
Campbell Barton de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
Campbell Barton eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
Campbell Barton 65ec7ec524 Cleanup: remove redundant, invalid info from headers
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-02-02 01:36:28 +11:00
Campbell Barton c0f88ed8a8 Cleanup: sort forward declarations of enum & struct
Done using:
  source/tools/utils_maintenance/c_sort_blocks.py
2019-01-28 21:17:58 +11:00
Campbell Barton 38828309d3 Cleanup: unused code 2018-10-15 18:12:14 +11:00
Campbell Barton dbb35ff7c8 Cleanup: unused functions 2018-10-15 17:37:54 +11:00
Campbell Barton 1b910082a0 Edit Mesh: replace DerivedMesh w/ Mesh
DerivedMesh is now removed from edit-mesh modifier evaluation.
2018-10-09 17:48:28 +11:00
Campbell Barton 772c4d6313 Edit Mesh: basic show in edit mode support
Note this is just using the derived-mesh data at the moment,
to support this properly we'll need to remove derived-mesh.
2018-10-08 17:31:32 +11:00
Campbell Barton 18d87e79e9 Merge branch 'master' into blender2.8 2018-06-29 09:25:40 +02:00
Campbell Barton b372766816 Cleanup: trailing newlines 2018-06-29 09:23:51 +02:00
Campbell Barton 01f9e13c30 Cleanup: use 'e' prefix for enum types 2018-05-30 10:29:41 +02:00
Sergey Sharybin 301a27187c Cleanup: More typed allocation type enum usage
Majority of the code is EOL, but still handy for debug purposes.
2018-05-30 10:22:28 +02:00
Brecht Van Lommel 2fb9a50a4f Fix T55146: hair + subsurf modifier not positioning hair correctly.
ORIGSPACE data was not being preserved correctly through subsurf.
2018-05-22 18:43:20 +02:00
Sybren A. Stüvel 1553f6b656 Introduced CDDM_from_mesh_ex() to create a non-referencing CDDM
This allows the mesh to be freed and the CDDM kept.
2018-05-01 18:02:17 +02:00
Sergey Sharybin 03544eccb4 Fix missing hair after rendering with different viewport/render settings
Derived mesh for particles did not include tessellated faces when it
was expected to. Now added explicit function to copy CDDM with tess
faces without need to re-tessellate the result.
2017-02-07 14:21:29 +01:00
Campbell Barton f964334b88 Fix T46215: Explode modifier looses textures 2015-09-23 22:57:00 +10:00
Campbell Barton 595a491e63 Add tessellation data to DerivedMesh (LoopTri)
This stores loop indices into the loop array giving easier acess
to data such as vertex-colors and UV's,
removing the need to store an MFace duplicate of custom-data.

This doesn't yet move all internal code from MFace to LoopTri just yet.

Only applies to:
- opengl drawing
- sculpting (pbvh)
- vertex/weight paint

Thanks to @psy-fi for review, fixes and improvements to drawing!
2015-07-17 03:55:14 +10:00
Bastien Montagne 138c9dba9b Add Custom Loop Normals.
This is the core code for it, tools (datatransfer and modifier) will come in next commits).
RNA api is already there, though.

See the code for details, but basically, we define, for each 'smooth fan'
(which is a set of adjacent loops around a same vertex that are smooth, i.e. have a single same normal),
a 'loop normal space' (or lnor space), using auto-computed normal and relevant edges, and store
custom normal as two angular factors inside that space. This allows to have custom normals
'following' deformations of the geometry, and to only save two shorts per loop in new clnor CDLayer.

Normal manipulation (editing, mixing, interpolating, etc.) shall always happen with plain 3D vectors normals,
and be converted back into storage format at the end.

Clnor computation has also been threaded (at least for Mesh case, not for BMesh), since the process can
be rather heavy with high poly meshes.

Also, bumping subversion, and fix mess in 2.70 versioning code.
2015-02-05 14:32:57 +01:00
Bastien Montagne 0af11a1742 Make use/computation of lnors consistant.
Issue was, when requesting (building) lnors for a mesh that has
autosmooth disabled, one would expect to simply get vnors as lnors.

Until now, it wasn't the case, which was bad e.g. for normal projections
of loops in recent remap code (projecting along split loop normals
when you would expect projection along vertex normals...).

Also, removed the 'angle' parameter from RNA's `mesh.calc_normals_split`.
This should *always* use mesh settings (both autosmooth and smoothresh),
otherwise once again we'd get inconsistencies in some cases.
Will update fbx and obj addons too.
2015-01-19 15:51:20 +01:00
Campbell Barton ab06ec7a24 Rewritten Array Modifier D443
Patch by PatB with own edits

- replace BMesh with CDDM functions.
- faster remove-vertex merging.
- extend CDDM_merge_verts to be more flexible.
2014-08-12 13:52:17 +10:00
Bastien Montagne 18e4224142 Split Normals I (1/5): basis for split normals (nearly nothing user-visible here):
* Add a new calcLoopNormals function to DerivedMesh struct, and implement it for CDDM and CCGDM (subsurf).
  EditDerivedBMesh (edit mode DM) only gets a dummy one in this commit.
* Add a tessellated version of CD_LOOPNORMAL layer (CD_TESSLOOPNORMAL), with relevant code to handle it
  (tessellation, rna access, etc.).
* Change auto_smooth options of Mesh (angle now in radian internaly, and toggle is now used to enable/disable
  split normals in DM creation process). Note BI render code is not touched here, hence its behavior regarding
  this option is now incoherent, will be addressed in a separate commit.

Reviewers: campbellbarton

CC: brecht

Differential Revision: https://developer.blender.org/D365
2014-04-13 12:19:00 +02:00
Bastien Montagne c37e8ecc50 Cleanup: int/short to bool in BKE_cdderivedmesh.h functions (and TRUE/FALSE to true/false in code using them). 2014-01-23 14:52:46 +01:00
Campbell Barton 4ae7ae6f2e Code Cleanup: use bool for return values and correct comments
also remove CDDM_Check, theres no need for it.
2014-01-22 02:53:48 +11:00
Campbell Barton a5606fadbb Code Cleanup: remove object arg to CDDM_from_mesh mesh_create_derived 2013-12-26 08:27:08 +11:00
Campbell Barton d07f3f793b add CDDM_lower_num_loops(), for completeness (currently unused). 2013-11-04 12:01:46 +00:00
Campbell Barton a70fa65592 optimize mirror merging, remove array reallocation, replace with fixed size arrays. 2013-05-27 20:11:12 +00:00
Brecht Van Lommel b39090bb5a Fix #33752: UV Orco coordinates were wrong for Cycles (and other external
render engines). Replaced generating orco_index by filling the UV loop data
directly which is easier and all that needed to be done anyway.
2013-01-10 17:37:17 +00:00
Campbell Barton 2de2acc681 add CDDM_from_bmesh(), avoids using BMEditMesh in modifiers. 2012-10-24 07:24:11 +00:00
Campbell Barton 8f6197bd08 support for curve orco uv's as UV's in cycles.
ideally these would be used as generated coordinates, but this is tricly because cycles calculates its own orco's and doesnt know about curve settings.
2012-07-31 13:43:26 +00:00
Sergey Sharybin 8a9d1c0a79 Fix #31021: Render settings are not taken into account for curves
Refactored code a bit to make naming a bit more clear and added a
function to create mesh from given display list rather than from
object's displist.

Tested using plain curves (which doesn't imply using derived meshes)
and curves with constructive modifiers (which are using derived meshed).
2012-07-14 17:30:49 +00:00
Campbell Barton 9892736206 code cleanup: header cleanup and remove some duplicate defines. 2012-05-12 20:39:39 +00:00
Campbell Barton 4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
Campbell Barton e56f714000 ngons draw with uniform normals in object mode now, I had this code disabled for speed (it was being called when it didnt need to), but for CDDM meshes without face normal layers this should still be called. 2012-03-18 06:49:32 +00:00
Campbell Barton 4f7bdc59d3 style cleanup: spelling.
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00
Campbell Barton 95670e03a0 style cleanup / comment formatting for bli/bke/bmesh 2012-03-03 20:19:11 +00:00
Campbell Barton 7bbf4b7831 style cleanup
- spelling - turns out we had tessellation spelt wrong all over.
- use \directive for doxy (not @directive)
- remove BLI_sparsemap.h - was from bmesh merge IIRC but entire file commented and not used.
2012-03-02 16:05:54 +00:00