Commit Graph

12 Commits

Author SHA1 Message Date
Germano Cavalcante e581dde40f Transform: remove restricted assert
`t-val` and `t->loc` can share same pointer, as long as `t->loc` is 3D.

This partially reverts 9dcf73c715
2023-11-17 08:55:27 -03:00
Hans Goudey 3d57bc4397 Cleanup: Move several blenkernel headers to C++
Mostly focus on areas where we're already using C++ features,
where combining C and C++ APIs is getting in the way.

Pull Request: https://projects.blender.org/blender/blender/pulls/114972
2023-11-16 11:41:55 +01:00
Germano Cavalcante 9dcf73c715 Fix #114787: VSE: canceling move does not reset strip channel
Probably caused by ad01cdd7fc.

Once again, problems resetting values due to `td->val` and `td->loc`
sharing the same pointer.

This needs to be avoided, as when resetting it is always expected that
one will be 1D and the other 3D.
2023-11-13 19:30:12 -03:00
Richard Antalik 3fccfe0bc6 VSE: Use C++ containers for strip iteration
Use `VectorSet`, `Vector` or `Span` instead of `SeqCollection` struct.
It is now possible to use native `for` loops and `SEQ_ITERATOR_FOREACH`
macro can be removed.

Another feature is, sets of strips no longer needs to be freed. However,
this poses a limitation, that query functions can not be used in case,
where these sets need to be available outside of scope where they are
created.

Pull Request: https://projects.blender.org/blender/blender/pulls/111909
2023-11-06 01:36:44 +01:00
Richard Antalik 4d37fb80b1 Cleanup: Convert VSE headers from .h to .hh 2023-11-03 01:33:54 +01:00
Aras Pranckevicius d973355b3a Cleanup: reduce amount of math-related includes
Using ClangBuildAnalyzer on the whole Blender build, it was pointing
out that BLI_math.h is the heaviest "header hub" (i.e. non tiny file
that is included a lot).

However, there's very little (actually zero) source files in Blender
that need "all the math" (base, colors, vectors, matrices,
quaternions, intersection, interpolation, statistics, solvers and
time). A common use case is source files needing just vectors, or
just vectors & matrices, or just colors etc. Actually, 181 files
were including the whole math thing without needing it at all.

This change removes BLI_math.h completely, and instead in all the
places that need it, includes BLI_math_vector.h or BLI_math_color.h
and so on.

Change from that:
- BLI_math_color.h was included 1399 times -> now 408 (took 114.0sec
  to parse -> now 36.3sec)
- BLI_simd.h 1403 -> 418 (109.7sec -> 34.9sec).

Full rebuild of Blender (Apple M1, Xcode, RelWithDebInfo) is not
affected much (342sec -> 334sec). Most of benefit would be when
someone's changing BLI_simd.h or BLI_math_color.h or similar files,
that now there's 3x fewer files result in a recompile.

Pull Request #110944
2023-08-10 14:51:40 +03:00
Hans Goudey ffe4fbe832 Cleanup: Move editors headers to C++
See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/110820
2023-08-05 02:57:52 +02:00
Campbell Barton adf58a77ff Cleanup: use LISTBASE_FOREACH & LISTBASE_FOREACH_BACKWARD macros 2023-08-04 08:51:13 +10:00
Germano Cavalcante 72d7e3e684 Fix Compiler Error in Clang
```
error: type 'float' cannot be narrowed to 'int' in initializer list [-Wc++11-narrowing]
```
2023-08-02 16:26:34 -03:00
Campbell Barton cc892efcd4 Cleanup: use snake case, especially for structs that define callbacks
Use snake case for ShaderFxTypeInfo, ModifierTypeInfo,
GpencilModifierTypeInfo & bConstraintTypeInfo.
2023-07-27 12:21:06 +10:00
Campbell Barton 3889baab4f Cleanup: spelling in comments 2023-07-15 15:54:55 +10:00
Jacques Lucke 3a2f5fb9db Editors: move transform code to C++
Also see #103343.

Co-authored-by: Germano Cavalcante <germano.costa@ig.com.br>
Pull Request: https://projects.blender.org/blender/blender/pulls/110049
2023-07-13 17:59:52 +02:00