GPv3: Opacity modifier #116946

Merged
Lukas Tönne merged 52 commits from LukasTonne/blender:gp3-opacity-modifier into main 2024-01-16 16:56:22 +01:00
439 changed files with 1035 additions and 916 deletions
Showing only changes of commit adce5588c5 - Show all commits

View File

@ -540,6 +540,8 @@ Quentin Wenger <matpi@protonmail.ch>
RUben <KUbo_0>
Rahul Chaudhary <RC12>
Raimund Klink <raimund58@noreply.localhost>
Rajesh Advani <rajeshja>
Rajesh Malviya <rajveer0malviya@gmail.com>
Ralf Hölzemer <r.hoelzemer@googlemail.com>
Ramil Roosileht <Limarest>
Rateeb Riyasat <bmollusc>
@ -716,7 +718,6 @@ nBurn <nbwashburn@gmail.com>
nutti <nutti.metro@gmail.com>
ok_what <ip1149a@gmail.com>
persun <perplexing.sun@gmail.com>
rajveermalviya <rajveer0malviya@gmail.com>
swann <slumber>
unclezeiv <davide.vercelli@gmail.com>
yves <valfeur>

View File

@ -204,16 +204,27 @@ bool GHOST_System::getFullScreen()
GHOST_IWindow *GHOST_System::getWindowUnderCursor(int32_t x, int32_t y)
{
/* TODO: This solution should follow the order of the activated windows (Z-order).
* It is imperfect but usable in most cases. */
for (GHOST_IWindow *iwindow : m_windowManager->getWindows()) {
if (iwindow->getState() == GHOST_kWindowStateMinimized) {
* It is imperfect but usable in most cases. Ideally each platform should provide
* a custom version of this function that properly considers z-order. */
std::vector<GHOST_IWindow *> windows = m_windowManager->getWindows();
std::vector<GHOST_IWindow *>::reverse_iterator iwindow_iter;
/* Search through the windows in reverse order because in most cases
* the window that is on top was created after those that are below it. */
for (iwindow_iter = windows.rbegin(); iwindow_iter != windows.rend(); ++iwindow_iter) {
GHOST_IWindow *win = *iwindow_iter;
if (win->getState() == GHOST_kWindowStateMinimized) {
continue;
}
GHOST_Rect bounds;
iwindow->getClientBounds(bounds);
win->getClientBounds(bounds);
if (bounds.isInside(x, y)) {
return iwindow;
return win;
}
}

View File

@ -37,6 +37,8 @@ if not issue:
issue = "#88449"
elif version.startswith("3.3."):
issue = "#100749"
elif version.startswith("3.6."):
issue = "#109399"
else:
raise ValueError("Specify --issue or update script to include issue number for this version")

View File

@ -164,8 +164,14 @@ def execute(context, is_interactive):
line_exec = line if line.strip() else "\n"
is_multiline = console.push(line_exec)
except SystemExit as ex:
# Occurs when `exit(..)` is called, this raises an exception instead of exiting.
# The trace-back isn't helpful in this case, just print the exception.
stderr.write("%r\n" % ex)
# Without this, entering new commands may include the previous command, see: #109435.
console.resetbuffer()
except:
# unlikely, but this can happen with unicode errors for example.
# Unlikely, but this can happen with unicode errors accessing `line_object.body`.
import traceback
stderr.write(traceback.format_exc())

View File

@ -10,7 +10,7 @@
#include "BKE_action.h"
#include "BKE_anim_data.h"
#include "BKE_fcurve.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "DEG_depsgraph.hh"

View File

@ -25,7 +25,7 @@
#include "BKE_animsys.h"
#include "BKE_idprop.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_override.hh"
#include "ANIM_armature_iter.hh"

View File

@ -7,7 +7,7 @@
#include "BLT_translation.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "ANIM_bone_collections.hh"
#include "intern/bone_collections_internal.hh"

View File

@ -23,7 +23,7 @@
#include "BKE_fcurve.h"
#include "BKE_fcurve_driver.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_nla.h"
#include "BKE_report.h"

View File

@ -89,14 +89,14 @@ void BKE_animdata_foreach_id(struct AnimData *adt, struct LibraryForeachIDData *
/**
* Make a copy of the given AnimData - to be used when copying data-blocks.
* \param flag: Control ID pointers management,
* see LIB_ID_CREATE_.../LIB_ID_COPY_... flags in BKE_lib_id.h
* see LIB_ID_CREATE_.../LIB_ID_COPY_... flags in BKE_lib_id.hh
* \return The copied animdata.
*/
struct AnimData *BKE_animdata_copy(struct Main *bmain, struct AnimData *adt, int flag);
/**
* \param flag: Control ID pointers management,
* see LIB_ID_CREATE_.../LIB_ID_COPY_... flags in BKE_lib_id.h
* see LIB_ID_CREATE_.../LIB_ID_COPY_... flags in BKE_lib_id.hh
* \return true is successfully copied.
*/
bool BKE_animdata_copy_id(struct Main *bmain, struct ID *id_to, struct ID *id_from, int flag);

View File

@ -48,9 +48,9 @@ typedef struct AnimationEvalContext {
} AnimationEvalContext;
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph,
float eval_time);
float eval_time) ATTR_WARN_UNUSED_RESULT;
AnimationEvalContext BKE_animsys_eval_context_construct_at(
const AnimationEvalContext *anim_eval_context, float eval_time);
const AnimationEvalContext *anim_eval_context, float eval_time) ATTR_WARN_UNUSED_RESULT;
/* ************************************* */
/* KeyingSets API */

View File

@ -7,7 +7,7 @@
* \ingroup bke
*/
#include "BKE_undo_system.h"
#include "BKE_undo_system.hh"
#ifdef __cplusplus
extern "C" {

View File

@ -171,7 +171,7 @@ struct CameraBGImage *BKE_camera_background_image_new(struct Camera *cam);
* Duplicate a background image, in a ID management compatible way.
*
* \param copy_flag: The usual ID copying flags, see `LIB_ID_CREATE_`/`LIB_ID_COPY_` enums in
* `BKE_lib_id.h`.
* `BKE_lib_id.hh`.
*/
struct CameraBGImage *BKE_camera_background_image_copy(struct CameraBGImage *bgpic_src,
const int copy_flag);

View File

@ -24,7 +24,7 @@ void BKE_editmesh_loop_tangent_calc(BMEditMesh *em,
const char (*tangent_names)[MAX_CUSTOMDATA_LAYER_NAME],
int tangent_names_len,
const float (*face_normals)[3],
const float (*loop_normals)[3],
const float (*corner_normals)[3],
const float (*vert_orco)[3],
CustomData *dm_loopdata_out,
uint dm_loopdata_out_len,

View File

@ -65,7 +65,7 @@ bool BKE_idtype_cache_key_cmp(const void *key_a_v, const void *key_b_v);
typedef void (*IDTypeInitDataFunction)(struct ID *id);
/** \param flag: Copying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more). */
/** \param flag: Copying options (see BKE_lib_id.hh's LIB_ID_COPY_... flags for more). */
typedef void (*IDTypeCopyDataFunction)(struct Main *bmain,
struct ID *id_dst,
const struct ID *id_src,
@ -73,7 +73,7 @@ typedef void (*IDTypeCopyDataFunction)(struct Main *bmain,
typedef void (*IDTypeFreeDataFunction)(struct ID *id);
/** \param flags: See BKE_lib_id.h's LIB_ID_MAKELOCAL_... flags. */
/** \param flags: See BKE_lib_id.hh's LIB_ID_MAKELOCAL_... flags. */
typedef void (*IDTypeMakeLocalFunction)(struct Main *bmain, struct ID *id, int flags);
typedef void (*IDTypeForeachIDFunction)(struct ID *id, struct LibraryForeachIDData *data);

View File

@ -107,7 +107,7 @@ void BKE_view_layer_base_select_and_set_active(struct ViewLayer *view_layer, str
/**
* Only copy internal data of #ViewLayer from source to already allocated/initialized destination.
*
* \param flag: Copying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more).
* \param flag: Copying options (see BKE_lib_id.hh's LIB_ID_COPY_... flags for more).
*/
void BKE_view_layer_copy_data(struct Scene *scene_dst,
const struct Scene *scene_src,

View File

@ -35,10 +35,6 @@
#include "DNA_userdef_enums.h"
#ifdef __cplusplus
extern "C" {
#endif
struct BlendWriter;
struct GHash;
struct ID;
@ -64,18 +60,18 @@ void *BKE_libblock_alloc_notest(short type) ATTR_WARN_UNUSED_RESULT;
* The user count is set to 1, all other content (apart from name and links) being
* initialized to zero.
*/
void *BKE_libblock_alloc(struct Main *bmain, short type, const char *name, int flag)
void *BKE_libblock_alloc(Main *bmain, short type, const char *name, int flag)
ATTR_WARN_UNUSED_RESULT;
/**
* Initialize an ID of given type, such that it has valid 'empty' data.
* ID is assumed to be just calloc'ed.
*/
void BKE_libblock_init_empty(struct ID *id) ATTR_NONNULL(1);
void BKE_libblock_init_empty(ID *id) ATTR_NONNULL(1);
/**
* Reset the runtime counters used by ID remapping.
*/
void BKE_libblock_runtime_reset_remapping_status(struct ID *id) ATTR_NONNULL(1);
void BKE_libblock_runtime_reset_remapping_status(ID *id) ATTR_NONNULL(1);
/* *** ID's session_uuid management. *** */
@ -90,7 +86,7 @@ void BKE_libblock_runtime_reset_remapping_status(struct ID *id) ATTR_NONNULL(1);
* \note "session-wise" here means while editing a given .blend file. Once a new .blend file is
* loaded or created, undo history is cleared/reset, and so is the UUID counter.
*/
void BKE_lib_libblock_session_uuid_ensure(struct ID *id);
void BKE_lib_libblock_session_uuid_ensure(ID *id);
/**
* Re-generate a new session-wise UUID for the given \a id.
*
@ -99,14 +95,14 @@ void BKE_lib_libblock_session_uuid_ensure(struct ID *id);
* existing UI.
* - For IDs that are made local without needing any copying.
*/
void BKE_lib_libblock_session_uuid_renew(struct ID *id);
void BKE_lib_libblock_session_uuid_renew(ID *id);
/**
* Generic helper to create a new empty data-block of given type in given \a bmain database.
*
* \param name: can be NULL, in which case we get default name for this ID type.
*/
void *BKE_id_new(struct Main *bmain, short type, const char *name);
void *BKE_id_new(Main *bmain, short type, const char *name);
/**
* Generic helper to create a new temporary empty data-block of given type,
* *outside* of any Main database.
@ -189,30 +185,25 @@ enum {
LIB_ID_COPY_NO_LIB_OVERRIDE,
};
void BKE_libblock_copy_ex(struct Main *bmain,
const struct ID *id,
struct ID **r_newid,
int orig_flag);
void BKE_libblock_copy_ex(Main *bmain, const ID *id, ID **r_newid, int orig_flag);
/**
* Used everywhere in blenkernel.
*/
void *BKE_libblock_copy(struct Main *bmain, const struct ID *id) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL();
void *BKE_libblock_copy(Main *bmain, const ID *id) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
/**
* Sets the name of a block to name, suitably adjusted for uniqueness.
*/
void BKE_libblock_rename(struct Main *bmain, struct ID *id, const char *name) ATTR_NONNULL();
void BKE_libblock_rename(Main *bmain, ID *id, const char *name) ATTR_NONNULL();
/**
* Use after setting the ID's name
* When name exists: call 'new_id'
*/
void BKE_libblock_ensure_unique_name(struct Main *bmain, ID *id) ATTR_NONNULL();
void BKE_libblock_ensure_unique_name(Main *bmain, ID *id) ATTR_NONNULL();
struct ID *BKE_libblock_find_name(struct Main *bmain,
short type,
const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
struct ID *BKE_libblock_find_session_uuid(struct Main *bmain, short type, uint32_t session_uuid);
ID *BKE_libblock_find_name(Main *bmain, short type, const char *name) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL();
ID *BKE_libblock_find_session_uuid(Main *bmain, short type, uint32_t session_uuid);
/**
* Duplicate (a.k.a. deep copy) common processing options.
* See also eDupli_ID_Flags for options controlling what kind of IDs to duplicate.
@ -259,8 +250,8 @@ enum {
LIB_ID_FREE_NO_NAMEMAP_REMOVE = 1 << 10,
};
void BKE_libblock_free_datablock(struct ID *id, int flag) ATTR_NONNULL();
void BKE_libblock_free_data(struct ID *id, bool do_id_user) ATTR_NONNULL();
void BKE_libblock_free_datablock(ID *id, int flag) ATTR_NONNULL();
void BKE_libblock_free_data(ID *id, bool do_id_user) ATTR_NONNULL();
/**
* In most cases #BKE_id_free_ex handles this, when lower level functions are called directly
@ -268,7 +259,7 @@ void BKE_libblock_free_data(struct ID *id, bool do_id_user) ATTR_NONNULL();
*
* ID data-blocks such as #Material.nodetree are not stored in #Main.
*/
void BKE_libblock_free_data_py(struct ID *id);
void BKE_libblock_free_data_py(ID *id);
/**
* Complete ID freeing, extended version for corner cases.
@ -287,7 +278,7 @@ void BKE_libblock_free_data_py(struct ID *id);
* \param use_flag_from_idtag: Still use freeing info flags from given #ID data-block,
* even if some overriding ones are passed in \a flag parameter.
*/
void BKE_id_free_ex(struct Main *bmain, void *idv, int flag, bool use_flag_from_idtag);
void BKE_id_free_ex(Main *bmain, void *idv, int flag, bool use_flag_from_idtag);
/**
* Complete ID freeing, should be usable in most cases (even for out-of-Main IDs).
*
@ -297,18 +288,18 @@ void BKE_id_free_ex(struct Main *bmain, void *idv, int flag, bool use_flag_from_
* can be NULL in case it's a temp ID outside of any Main.
* \param idv: Pointer to ID to be freed.
*/
void BKE_id_free(struct Main *bmain, void *idv);
void BKE_id_free(Main *bmain, void *idv);
/**
* Not really a freeing function by itself,
* it decrements user-count of given id, and only frees it if it reaches 0.
*/
void BKE_id_free_us(struct Main *bmain, void *idv) ATTR_NONNULL();
void BKE_id_free_us(Main *bmain, void *idv) ATTR_NONNULL();
/**
* Properly delete a single ID from given \a bmain database.
*/
void BKE_id_delete(struct Main *bmain, void *idv) ATTR_NONNULL();
void BKE_id_delete(Main *bmain, void *idv) ATTR_NONNULL();
/**
* Like BKE_id_delete, but with extra corner-case options.
*
@ -317,8 +308,7 @@ void BKE_id_delete(struct Main *bmain, void *idv) ATTR_NONNULL();
* be e.g. `ID_REMAP_FORCE_UI_POINTERS`, required when default UI-handling callbacks of remapping
* code won't be working (e.g. from readfile code).
*/
void BKE_id_delete_ex(struct Main *bmain, void *idv, const int extra_remapping_flags)
ATTR_NONNULL(1, 2);
void BKE_id_delete_ex(Main *bmain, void *idv, const int extra_remapping_flags) ATTR_NONNULL(1, 2);
/**
* Properly delete all IDs tagged with \a LIB_TAG_DOIT, in given \a bmain database.
*
@ -329,20 +319,20 @@ void BKE_id_delete_ex(struct Main *bmain, void *idv, const int extra_remapping_f
* risky code in a complicated area.
* \return Number of deleted data-blocks.
*/
size_t BKE_id_multi_tagged_delete(struct Main *bmain) ATTR_NONNULL();
size_t BKE_id_multi_tagged_delete(Main *bmain) ATTR_NONNULL();
/**
* Add a 'NO_MAIN' data-block to given main (also sets user-counts of its IDs if needed).
*/
void BKE_libblock_management_main_add(struct Main *bmain, void *idv);
void BKE_libblock_management_main_add(Main *bmain, void *idv);
/** Remove a data-block from given main (set it to 'NO_MAIN' status). */
void BKE_libblock_management_main_remove(struct Main *bmain, void *idv);
void BKE_libblock_management_main_remove(Main *bmain, void *idv);
void BKE_libblock_management_usercounts_set(struct Main *bmain, void *idv);
void BKE_libblock_management_usercounts_clear(struct Main *bmain, void *idv);
void BKE_libblock_management_usercounts_set(Main *bmain, void *idv);
void BKE_libblock_management_usercounts_clear(Main *bmain, void *idv);
void id_lib_extern(struct ID *id);
void id_lib_indirect_weak_link(struct ID *id);
void id_lib_extern(ID *id);
void id_lib_indirect_weak_link(ID *id);
/**
* Ensure we have a real user
*
@ -351,19 +341,19 @@ void id_lib_indirect_weak_link(struct ID *id);
* However, #ID_REAL_USERS is used in several places outside of core lib.c,
* so think we can wait later to make this change.
*/
void id_us_ensure_real(struct ID *id);
void id_us_clear_real(struct ID *id);
void id_us_ensure_real(ID *id);
void id_us_clear_real(ID *id);
/**
* Same as \a id_us_plus, but does not handle lib indirect -> extern.
* Only used by `readfile.cc` so far, but simpler/safer to keep it here nonetheless.
*/
void id_us_plus_no_lib(struct ID *id);
void id_us_plus(struct ID *id);
void id_us_plus_no_lib(ID *id);
void id_us_plus(ID *id);
/* decrements the user count for *id. */
void id_us_min(struct ID *id);
void id_fake_user_set(struct ID *id);
void id_fake_user_clear(struct ID *id);
void BKE_id_newptr_and_tag_clear(struct ID *id);
void id_us_min(ID *id);
void id_fake_user_set(ID *id);
void id_fake_user_clear(ID *id);
void BKE_id_newptr_and_tag_clear(ID *id);
/** Flags to control make local code behavior. */
enum {
@ -392,11 +382,11 @@ enum {
* specific corner-cases implementations needed for objects and brushes.
*/
void BKE_lib_id_make_local_generic_action_define(
struct Main *bmain, struct ID *id, int flags, bool *r_force_local, bool *r_force_copy);
Main *bmain, ID *id, int flags, bool *r_force_local, bool *r_force_copy);
/**
* Generic 'make local' function, works for most of data-block types.
*/
void BKE_lib_id_make_local_generic(struct Main *bmain, struct ID *id, int flags);
void BKE_lib_id_make_local_generic(Main *bmain, ID *id, int flags);
/**
* Calls the appropriate make_local method for the block, unless test is set.
*
@ -406,17 +396,14 @@ void BKE_lib_id_make_local_generic(struct Main *bmain, struct ID *id, int flags)
* it needs specific handling.
* \return true is the ID has successfully been made local.
*/
bool BKE_lib_id_make_local(struct Main *bmain, struct ID *id, int flags);
bool BKE_lib_id_make_local(Main *bmain, ID *id, int flags);
/**
* \note Does *not* set #ID.newid pointer.
*/
bool id_single_user(struct bContext *C,
struct ID *id,
struct PointerRNA *ptr,
struct PropertyRNA *prop);
bool id_single_user(bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop);
/** Test whether given `id` can be copied or not. */
bool BKE_id_copy_is_allowed(const struct ID *id);
bool BKE_id_copy_is_allowed(const ID *id);
/**
* Generic entry point for copying a data-block (new API).
*
@ -439,13 +426,13 @@ bool BKE_id_copy_is_allowed(const struct ID *id);
* (leave to zero for default, full copy).
* \return NULL when copying that ID type is not supported, the new copy otherwise.
*/
struct ID *BKE_id_copy_ex(struct Main *bmain, const struct ID *id, struct ID **r_newid, int flag);
ID *BKE_id_copy_ex(Main *bmain, const ID *id, ID **r_newid, int flag);
/**
* Invoke the appropriate copy method for the block and return the new id as result.
*
* See #BKE_id_copy_ex for details.
*/
struct ID *BKE_id_copy(struct Main *bmain, const struct ID *id);
ID *BKE_id_copy(Main *bmain, const ID *id);
/**
* Invoke the appropriate copy method for the block and return the new id as result.
@ -462,17 +449,17 @@ struct ID *BKE_id_copy(struct Main *bmain, const struct ID *id);
* `USER_DUP_LINKED_ID` and `USER_DUP_ACT` have an effect here.
* \param copy_flags: flags passed to #BKE_id_copy_ex.
*/
struct ID *BKE_id_copy_for_duplicate(struct Main *bmain,
struct ID *id,
eDupli_ID_Flags duplicate_flags,
int copy_flags);
ID *BKE_id_copy_for_duplicate(Main *bmain,
ID *id,
eDupli_ID_Flags duplicate_flags,
int copy_flags);
/**
* Special version of #BKE_id_copy which is safe from using evaluated id as source with a copy
* result appearing in the main database.
* Takes care of the referenced data-blocks consistency.
*/
struct ID *BKE_id_copy_for_use_in_bmain(struct Main *bmain, const struct ID *id);
ID *BKE_id_copy_for_use_in_bmain(Main *bmain, const ID *id);
/**
* Does a mere memory swap over the whole IDs data (including type-specific memory).
@ -483,22 +470,16 @@ struct ID *BKE_id_copy_for_use_in_bmain(struct Main *bmain, const struct ID *id)
* \param do_self_remap: Whether to remap internal pointers to itself or not.
* \param self_remap_flags: Flags controlling self remapping, see BKE_lib_remap.hh.
*/
void BKE_lib_id_swap(struct Main *bmain,
struct ID *id_a,
struct ID *id_b,
const bool do_self_remap,
const int self_remap_flags);
void BKE_lib_id_swap(
Main *bmain, ID *id_a, ID *id_b, const bool do_self_remap, const int self_remap_flags);
/**
* Does a mere memory swap over the whole IDs data (including type-specific memory).
* \note All internal ID data itself is also swapped.
*
* For parameters description, see #BKE_lib_id_swap above.
*/
void BKE_lib_id_swap_full(struct Main *bmain,
struct ID *id_a,
struct ID *id_b,
const bool do_self_remap,
const int self_remap_flags);
void BKE_lib_id_swap_full(
Main *bmain, ID *id_a, ID *id_b, const bool do_self_remap, const int self_remap_flags);
/**
* Sort given \a id into given \a lb list, using case-insensitive comparison of the id names.
@ -508,12 +489,12 @@ void BKE_lib_id_swap_full(struct Main *bmain,
* \param id_sorting_hint: Ignored if NULL. Otherwise, used to check if we can insert \a id
* immediately before or after that pointer. It must always be into given \a lb list.
*/
void id_sort_by_name(struct ListBase *lb, struct ID *id, struct ID *id_sorting_hint);
void id_sort_by_name(ListBase *lb, ID *id, ID *id_sorting_hint);
/**
* Expand ID usages of given id as 'extern' (and no more indirect) linked data.
* Used by ID copy/make_local functions.
*/
void BKE_lib_id_expand_local(struct Main *bmain, struct ID *id, int flags);
void BKE_lib_id_expand_local(Main *bmain, ID *id, int flags);
/**
* Ensures given ID has a unique name in given listbase.
@ -527,9 +508,9 @@ void BKE_lib_id_expand_local(struct Main *bmain, struct ID *id, int flags);
*
* \return true if a new name had to be created.
*/
bool BKE_id_new_name_validate(struct Main *bmain,
struct ListBase *lb,
struct ID *id,
bool BKE_id_new_name_validate(Main *bmain,
ListBase *lb,
ID *id,
const char *name,
bool do_linked_data) ATTR_NONNULL(1, 2, 3);
@ -539,45 +520,45 @@ bool BKE_id_new_name_validate(struct Main *bmain,
*
* \param flags: Same set of `LIB_ID_MAKELOCAL_` flags as passed to #BKE_lib_id_make_local.
*/
void BKE_lib_id_clear_library_data(struct Main *bmain, struct ID *id, int flags);
void BKE_lib_id_clear_library_data(Main *bmain, ID *id, int flags);
/**
* Clear or set given tags for all ids of given type in `bmain` (runtime tags).
*
* \note Affect whole Main database.
*/
void BKE_main_id_tag_idcode(struct Main *mainvar, short type, int tag, bool value);
void BKE_main_id_tag_idcode(Main *mainvar, short type, int tag, bool value);
/**
* Clear or set given tags for all ids in listbase (runtime tags).
*/
void BKE_main_id_tag_listbase(struct ListBase *lb, int tag, bool value);
void BKE_main_id_tag_listbase(ListBase *lb, int tag, bool value);
/**
* Clear or set given tags for all ids in bmain (runtime tags).
*/
void BKE_main_id_tag_all(struct Main *mainvar, int tag, bool value);
void BKE_main_id_tag_all(Main *mainvar, int tag, bool value);
/**
* Clear or set given flags for all ids in listbase (persistent flags).
*/
void BKE_main_id_flag_listbase(struct ListBase *lb, int flag, bool value);
void BKE_main_id_flag_listbase(ListBase *lb, int flag, bool value);
/**
* Clear or set given flags for all ids in bmain (persistent flags).
*/
void BKE_main_id_flag_all(struct Main *bmain, int flag, bool value);
void BKE_main_id_flag_all(Main *bmain, int flag, bool value);
/**
* Next to indirect usage in `readfile.cc` / `writefile.cc` also in `editobject.c`, `scene.cc`.
*/
void BKE_main_id_newptr_and_tag_clear(struct Main *bmain);
void BKE_main_id_newptr_and_tag_clear(Main *bmain);
void BKE_main_id_refcount_recompute(struct Main *bmain, bool do_linked_only);
void BKE_main_id_refcount_recompute(Main *bmain, bool do_linked_only);
void BKE_main_lib_objects_recalc_all(struct Main *bmain);
void BKE_main_lib_objects_recalc_all(Main *bmain);
/**
* Only for repairing files via versioning, avoid for general use.
*/
void BKE_main_id_repair_duplicate_names_listbase(struct Main *bmain, struct ListBase *lb);
void BKE_main_id_repair_duplicate_names_listbase(Main *bmain, ListBase *lb);
#define MAX_ID_FULL_NAME (64 + 64 + 3 + 1) /* 64 is MAX_ID_NAME - 2 */
#define MAX_ID_FULL_NAME_UI (MAX_ID_FULL_NAME + 3) /* Adds 'keycode' two letters at beginning. */
@ -591,7 +572,7 @@ void BKE_main_id_repair_duplicate_names_listbase(struct Main *bmain, struct List
* \param separator_char: Character to use for separating name and library name.
* Can be 0 to use default (' ').
*/
void BKE_id_full_name_get(char name[MAX_ID_FULL_NAME], const struct ID *id, char separator_char);
void BKE_id_full_name_get(char name[MAX_ID_FULL_NAME], const ID *id, char separator_char);
/**
* Generate full name of the data-block (without ID code, but with library if any),
* with a 2 to 3 character prefix prepended indicating whether it comes from a library,
@ -606,7 +587,7 @@ void BKE_id_full_name_get(char name[MAX_ID_FULL_NAME], const struct ID *id, char
* \param r_prefix_len: The length of the prefix added.
*/
void BKE_id_full_name_ui_prefix_get(char name[MAX_ID_FULL_NAME_UI],
const struct ID *id,
const ID *id,
bool add_lib_hint,
char separator_char,
int *r_prefix_len);
@ -616,7 +597,7 @@ void BKE_id_full_name_ui_prefix_get(char name[MAX_ID_FULL_NAME_UI],
*
* \return A unique allocated string key for any ID in the whole Main database.
*/
char *BKE_id_to_unique_string_key(const struct ID *id);
char *BKE_id_to_unique_string_key(const ID *id);
/**
* Make linked data-blocks local.
@ -628,29 +609,26 @@ char *BKE_id_to_unique_string_key(const struct ID *id);
* \param set_fake: If true, set fake user on all localized data-blocks
* (except group and objects ones).
*/
void BKE_library_make_local(struct Main *bmain,
const struct Library *lib,
struct GHash *old_to_new_ids,
bool untagged_only,
bool set_fake);
void BKE_library_make_local(
Main *bmain, const Library *lib, GHash *old_to_new_ids, bool untagged_only, bool set_fake);
void BKE_id_tag_set_atomic(struct ID *id, int tag);
void BKE_id_tag_clear_atomic(struct ID *id, int tag);
void BKE_id_tag_set_atomic(ID *id, int tag);
void BKE_id_tag_clear_atomic(ID *id, int tag);
/**
* Check that given ID pointer actually is in G_MAIN.
* Main intended use is for debug asserts in places we cannot easily get rid of #G_Main.
*/
bool BKE_id_is_in_global_main(struct ID *id);
bool BKE_id_is_in_global_main(ID *id);
bool BKE_id_can_be_asset(const struct ID *id);
bool BKE_id_can_be_asset(const ID *id);
/**
* Return the owner ID of the given `id`, if any.
*
* \note This will only return non-NULL for embedded IDs (master collections etc.), and shape-keys.
*/
struct ID *BKE_id_owner_get(struct ID *id);
ID *BKE_id_owner_get(ID *id);
/**
* Check if that ID can be considered as editable from a high-level (editor) perspective.
@ -662,19 +640,19 @@ struct ID *BKE_id_owner_get(struct ID *id);
* we should either cache that status info also in virtual override IDs, or address the
* long-standing TODO of getting an efficient 'owner_id' access for all embedded ID types.
*/
bool BKE_id_is_editable(const struct Main *bmain, const struct ID *id);
bool BKE_id_is_editable(const Main *bmain, const ID *id);
/**
* Returns ordered list of data-blocks for display in the UI.
* Result is list of #LinkData of IDs that must be freed.
*/
void BKE_id_ordered_list(struct ListBase *ordered_lb, const struct ListBase *lb);
void BKE_id_ordered_list(ListBase *ordered_lb, const ListBase *lb);
/**
* Reorder ID in the list, before or after the "relative" ID.
*/
void BKE_id_reorder(const struct ListBase *lb, struct ID *id, struct ID *relative, bool after);
void BKE_id_reorder(const ListBase *lb, ID *id, ID *relative, bool after);
void BKE_id_blend_write(struct BlendWriter *writer, struct ID *id);
void BKE_id_blend_write(BlendWriter *writer, ID *id);
#define IS_TAGGED(_id) ((_id) && (((ID *)_id)->tag & LIB_TAG_DOIT))
@ -685,8 +663,4 @@ void BKE_id_blend_write(struct BlendWriter *writer, struct ID *id);
* Use handle the #ID_RECALC_PARAMETERS tag.
* \note Keep in sync with #ID_TYPE_SUPPORTS_PARAMS_WITHOUT_COW.
*/
void BKE_id_eval_properties_copy(struct ID *id_cow, struct ID *id);
#ifdef __cplusplus
}
#endif
void BKE_id_eval_properties_copy(ID *id_cow, ID *id);

View File

@ -28,7 +28,7 @@ struct ID;
struct IDRemapper;
struct Main;
/* BKE_libblock_free, delete are declared in BKE_lib_id.h for convenience. */
/* BKE_libblock_free, delete are declared in BKE_lib_id.hh for convenience. */
/* Also IDRemap->flag. */
enum {

View File

@ -25,7 +25,7 @@ void BKE_mesh_calc_loop_tangent_single_ex(const float (*vert_positions)[3],
int numVerts,
const int *corner_verts,
float (*r_looptangent)[4],
const float (*loop_normals)[3],
const float (*corner_normals)[3],
const float (*loopuv)[2],
int numLoops,
blender::OffsetIndices<int> faces,
@ -59,7 +59,7 @@ void BKE_mesh_calc_loop_tangent_ex(const float (*vert_positions)[3],
int tangent_names_len,
const float (*vert_normals)[3],
const float (*face_normals)[3],
const float (*loop_normals)[3],
const float (*corner_normals)[3],
const float (*vert_orco)[3],
/* result */
CustomData *loopdata_out,

View File

@ -170,9 +170,9 @@ struct MeshRuntime {
/** Lazily computed vertex normals (#Mesh::vert_normals()). */
SharedCache<Vector<float3>> vert_normals_cache;
/** Lazily computed face normals (#Mesh::vert_normals()). */
/** Lazily computed face normals (#Mesh::face_normals()). */
SharedCache<Vector<float3>> face_normals_cache;
/** Lazily computed face corner normals (#Mesh::vert_normals()). */
/** Lazily computed face corner normals (#Mesh::corner_normals()). */
SharedCache<Vector<float3>> corner_normals_cache;
/**

View File

@ -191,7 +191,7 @@ struct ModifierTypeInfo {
* Copy instance data for this modifier type. Should copy all user
* level settings to the target modifier.
*
* \param flag: Copying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more).
* \param flag: Copying options (see BKE_lib_id.hh's LIB_ID_COPY_... flags for more).
*/
void (*copy_data)(const ModifierData *md, ModifierData *target, int flag);

View File

@ -63,7 +63,7 @@ void BKE_nla_tracks_free(ListBase *tracks, bool do_id_user);
*
* \param use_same_action: When true, the existing action is used (instead of being duplicated)
* \param flag: Control ID pointers management, see LIB_ID_CREATE_.../LIB_ID_COPY_...
* flags in BKE_lib_id.h
* flags in BKE_lib_id.hh
*/
struct NlaStrip *BKE_nlastrip_copy(struct Main *bmain,
struct NlaStrip *strip,
@ -72,7 +72,7 @@ struct NlaStrip *BKE_nlastrip_copy(struct Main *bmain,
/**
* Copy a single NLA Track.
* \param flag: Control ID pointers management, see LIB_ID_CREATE_.../LIB_ID_COPY_...
* flags in BKE_lib_id.h
* flags in BKE_lib_id.hh
*/
struct NlaTrack *BKE_nlatrack_copy(struct Main *bmain,
struct NlaTrack *nlt,
@ -81,7 +81,7 @@ struct NlaTrack *BKE_nlatrack_copy(struct Main *bmain,
/**
* Copy all NLA data.
* \param flag: Control ID pointers management, see LIB_ID_CREATE_.../LIB_ID_COPY_...
* flags in BKE_lib_id.h
* flags in BKE_lib_id.hh
*/
void BKE_nla_tracks_copy(struct Main *bmain, ListBase *dst, const ListBase *src, int flag);

View File

@ -124,7 +124,7 @@ void BKE_scene_set_background(struct Main *bmain, struct Scene *sce);
struct Scene *BKE_scene_set_name(struct Main *bmain, const char *name);
/**
* \param flag: copying options (see BKE_lib_id.h's `LIB_ID_COPY_...` flags for more).
* \param flag: copying options (see BKE_lib_id.hh's `LIB_ID_COPY_...` flags for more).
*/
struct ToolSettings *BKE_toolsettings_copy(struct ToolSettings *toolsettings, int flag);
void BKE_toolsettings_free(struct ToolSettings *toolsettings);

View File

@ -7,34 +7,32 @@
* \ingroup bke
*/
#include "BLI_utildefines.h"
#include "DNA_ID.h"
#include "DNA_listBase.h"
#ifdef __cplusplus
extern "C" {
#endif
struct Main;
struct UndoStep;
struct UndoType;
struct bContext;
/* ID's */
/* IDs */
struct Main;
struct Mesh;
struct Object;
struct Scene;
struct Text;
typedef struct UndoRefID {
struct UndoRefID {
struct ID *ptr;
char name[MAX_ID_NAME];
} UndoRefID;
};
/* UndoRefID_Mesh & friends. */
#define UNDO_REF_ID_TYPE(ptr_ty) \
typedef struct UndoRefID_##ptr_ty { \
struct UndoRefID_##ptr_ty { \
struct ptr_ty *ptr; \
char name[MAX_ID_NAME]; \
} UndoRefID_##ptr_ty
}
UNDO_REF_ID_TYPE(Mesh);
UNDO_REF_ID_TYPE(Object);
UNDO_REF_ID_TYPE(Scene);
@ -42,14 +40,14 @@ UNDO_REF_ID_TYPE(Text);
UNDO_REF_ID_TYPE(Image);
UNDO_REF_ID_TYPE(PaintCurve);
typedef struct UndoStack {
struct UndoStack {
ListBase steps;
struct UndoStep *step_active;
UndoStep *step_active;
/**
* The last memfile state read, used so we can be sure the names from the
* library state matches the state an undo step was written in.
*/
struct UndoStep *step_active_memfile;
UndoStep *step_active_memfile;
/**
* Some undo systems require begin/end, see: #UndoType.step_encode_init
@ -57,19 +55,19 @@ typedef struct UndoStack {
* \note This is not included in the 'steps' list.
* That is done once end is called.
*/
struct UndoStep *step_init;
UndoStep *step_init;
/**
* Keep track of nested group begin/end calls,
* within which all but the last undo-step is marked for skipping.
*/
int group_level;
} UndoStack;
};
typedef struct UndoStep {
struct UndoStep *next, *prev;
struct UndoStep {
UndoStep *next, *prev;
char name[64];
const struct UndoType *type;
const UndoType *type;
/** Size in bytes of all data in step (not including the step). */
size_t data_size;
/** Users should never see this step (only use for internal consistency). */
@ -82,25 +80,25 @@ typedef struct UndoStep {
/** For use by undo systems that accumulate changes (mesh-sculpt & image-painting). */
bool is_applied;
/* Over alloc 'type->struct_size'. */
} UndoStep;
};
typedef enum eUndoStepDir {
enum eUndoStepDir {
STEP_REDO = 1,
STEP_UNDO = -1,
STEP_INVALID = 0,
} eUndoStepDir;
};
typedef enum eUndoPushReturn {
enum eUndoPushReturn {
UNDO_PUSH_RET_FAILURE = 0,
UNDO_PUSH_RET_SUCCESS = (1 << 0),
UNDO_PUSH_RET_OVERRIDE_CHANGED = (1 << 1),
} eUndoPushReturn;
};
ENUM_OPERATORS(eUndoPushReturn, UNDO_PUSH_RET_OVERRIDE_CHANGED)
typedef void (*UndoTypeForEachIDRefFn)(void *user_data, struct UndoRefID *id_ref);
using UndoTypeForEachIDRefFn = void (*)(void *user_data, struct UndoRefID *id_ref);
typedef struct UndoType {
struct UndoType *next, *prev;
struct UndoType {
UndoType *next, *prev;
/** Only for debugging. */
const char *name;
@ -142,10 +140,10 @@ typedef struct UndoType {
* The size of the undo struct 'inherited' from #UndoStep for that specific type. Used for
* generic allocation in BKE's `undo_system.cc`. */
size_t step_size;
} UndoType;
};
/** #UndoType.flag bitflags. */
typedef enum eUndoTypeFlags {
enum eUndoTypeFlags {
/**
* This undo type `encode` callback needs a valid context, it will fail otherwise.
* \note Callback is still supposed to properly deal with a NULL context pointer.
@ -158,7 +156,7 @@ typedef enum eUndoTypeFlags {
* This is typically used for undo systems that store both before/after states.
*/
UNDOTYPE_FLAG_DECODE_ACTIVE_STEP = 1 << 1,
} eUndoTypeFlags;
};
/* -------------------------------------------------------------------- */
/** \name Public Undo Types
@ -177,15 +175,15 @@ extern const UndoType *BKE_UNDOSYS_TYPE_TEXT;
#define BKE_UNDOSYS_TYPE_IS_MEMFILE_SKIP(ty) ELEM(ty, BKE_UNDOSYS_TYPE_IMAGE)
UndoStack *BKE_undosys_stack_create(void);
UndoStack *BKE_undosys_stack_create();
void BKE_undosys_stack_destroy(UndoStack *ustack);
void BKE_undosys_stack_clear(UndoStack *ustack);
void BKE_undosys_stack_clear_active(UndoStack *ustack);
/* name optional */
bool BKE_undosys_stack_has_undo(const UndoStack *ustack, const char *name);
void BKE_undosys_stack_init_from_main(UndoStack *ustack, struct Main *bmain);
void BKE_undosys_stack_init_from_main(UndoStack *ustack, Main *bmain);
/* called after 'BKE_undosys_stack_init_from_main' */
void BKE_undosys_stack_init_from_context(UndoStack *ustack, struct bContext *C);
void BKE_undosys_stack_init_from_context(UndoStack *ustack, bContext *C);
UndoStep *BKE_undosys_stack_active_with_type(UndoStack *ustack, const UndoType *ut);
UndoStep *BKE_undosys_stack_init_or_active_with_type(UndoStack *ustack, const UndoType *ut);
/**
@ -203,19 +201,19 @@ void BKE_undosys_stack_group_end(UndoStack *ustack);
* Only some UndoType's require init.
*/
UndoStep *BKE_undosys_step_push_init_with_type(UndoStack *ustack,
struct bContext *C,
bContext *C,
const char *name,
const UndoType *ut);
UndoStep *BKE_undosys_step_push_init(UndoStack *ustack, struct bContext *C, const char *name);
UndoStep *BKE_undosys_step_push_init(UndoStack *ustack, bContext *C, const char *name);
/**
* \param C: Can be NULL from some callers if their encoding function doesn't need it
*/
eUndoPushReturn BKE_undosys_step_push_with_type(UndoStack *ustack,
struct bContext *C,
bContext *C,
const char *name,
const UndoType *ut);
eUndoPushReturn BKE_undosys_step_push(UndoStack *ustack, struct bContext *C, const char *name);
eUndoPushReturn BKE_undosys_step_push(UndoStack *ustack, bContext *C, const char *name);
UndoStep *BKE_undosys_step_find_by_name_with_type(UndoStack *ustack,
const char *name,
@ -248,20 +246,17 @@ eUndoStepDir BKE_undosys_step_calc_direction(const UndoStack *ustack,
* it is assumed to match the current state, and will be used as basis for the undo/redo process
* (i.e. all steps in-between `us_reference` and `us_target` will be processed).
*/
bool BKE_undosys_step_load_data_ex(UndoStack *ustack,
struct bContext *C,
UndoStep *us_target,
UndoStep *us_reference,
bool use_skip);
bool BKE_undosys_step_load_data_ex(
UndoStack *ustack, bContext *C, UndoStep *us_target, UndoStep *us_reference, bool use_skip);
/**
* Undo/Redo until the given `us_target` step becomes the active (currently loaded) one.
*/
bool BKE_undosys_step_load_data(UndoStack *ustack, struct bContext *C, UndoStep *us_target);
bool BKE_undosys_step_load_data(UndoStack *ustack, bContext *C, UndoStep *us_target);
/**
* Undo/Redo until the step matching given `index` in the undo stack becomes the active
* (currently loaded) one.
*/
void BKE_undosys_step_load_from_index(UndoStack *ustack, struct bContext *C, int index);
void BKE_undosys_step_load_from_index(UndoStack *ustack, bContext *C, int index);
/**
* Undo until `us_target` step becomes the active (currently loaded) one.
@ -275,7 +270,7 @@ void BKE_undosys_step_load_from_index(UndoStack *ustack, struct bContext *C, int
* (if the given one has to be skipped).
*/
bool BKE_undosys_step_undo_with_data_ex(UndoStack *ustack,
struct bContext *C,
bContext *C,
UndoStep *us,
bool use_skip);
/**
@ -283,11 +278,11 @@ bool BKE_undosys_step_undo_with_data_ex(UndoStack *ustack,
*
* \note See #BKE_undosys_step_undo_with_data_ex for details.
*/
bool BKE_undosys_step_undo_with_data(UndoStack *ustack, struct bContext *C, UndoStep *us_target);
bool BKE_undosys_step_undo_with_data(UndoStack *ustack, bContext *C, UndoStep *us_target);
/**
* Undo one step from current active (currently loaded) one.
*/
bool BKE_undosys_step_undo(UndoStack *ustack, struct bContext *C);
bool BKE_undosys_step_undo(UndoStack *ustack, bContext *C);
/**
* Redo until `us_target` step becomes the active (currently loaded) one.
@ -301,7 +296,7 @@ bool BKE_undosys_step_undo(UndoStack *ustack, struct bContext *C);
* (if the given one has to be skipped).
*/
bool BKE_undosys_step_redo_with_data_ex(UndoStack *ustack,
struct bContext *C,
bContext *C,
UndoStep *us,
bool use_skip);
/**
@ -309,11 +304,11 @@ bool BKE_undosys_step_redo_with_data_ex(UndoStack *ustack,
*
* \note See #BKE_undosys_step_redo_with_data_ex for details.
*/
bool BKE_undosys_step_redo_with_data(UndoStack *ustack, struct bContext *C, UndoStep *us_target);
bool BKE_undosys_step_redo_with_data(UndoStack *ustack, bContext *C, UndoStep *us_target);
/**
* Redo one step from current active one.
*/
bool BKE_undosys_step_redo(UndoStack *ustack, struct bContext *C);
bool BKE_undosys_step_redo(UndoStack *ustack, bContext *C);
/**
* Useful when we want to diff against previous undo data but can't be sure the types match.
@ -330,7 +325,7 @@ UndoStep *BKE_undosys_step_same_type_prev(UndoStep *us);
* Similar to #WM_operatortype_append
*/
UndoType *BKE_undosys_type_append(void (*undosys_fn)(UndoType *));
void BKE_undosys_type_free_all(void);
void BKE_undosys_type_free_all();
/* ID Accessor. */
@ -341,7 +336,3 @@ void BKE_undosys_foreach_ID_ref(UndoStack *ustack,
#endif
void BKE_undosys_print(UndoStack *ustack);
#ifdef __cplusplus
}
#endif

View File

@ -418,7 +418,7 @@ set(SRC
BKE_keyconfig.h
BKE_lattice.hh
BKE_layer.h
BKE_lib_id.h
BKE_lib_id.hh
BKE_lib_override.hh
BKE_lib_query.h
BKE_lib_remap.hh
@ -504,7 +504,7 @@ set(SRC
BKE_texture.h
BKE_tracking.h
BKE_type_conversions.hh
BKE_undo_system.h
BKE_undo_system.hh
BKE_unit.hh
BKE_vfont.hh
BKE_vfontdata.hh

View File

@ -41,7 +41,7 @@
#include "BKE_geometry_set_instances.hh"
#include "BKE_key.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_material.h"
#include "BKE_mesh.hh"
#include "BKE_mesh_iterators.hh"

View File

@ -45,7 +45,7 @@
#include "BKE_fcurve.h"
#include "BKE_idprop.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_main.hh"
#include "BKE_object.hh"
@ -95,7 +95,7 @@ static CLG_LogRef LOG = {"bke.action"};
*
* WARNING! This function will not handle ID user count!
*
* \param flag: Copying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more).
* \param flag: Copying options (see BKE_lib_id.hh's LIB_ID_COPY_... flags for more).
*/
static void action_copy_data(Main * /*bmain*/, ID *id_dst, const ID *id_src, const int flag)
{

View File

@ -17,7 +17,7 @@
#include "BKE_fcurve_driver.h"
#include "BKE_global.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_main.hh"
#include "BKE_nla.h"

View File

@ -41,7 +41,7 @@
#include "BKE_context.hh"
#include "BKE_fcurve.h"
#include "BKE_global.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_main.hh"
#include "BKE_material.h"

View File

@ -44,7 +44,7 @@
#include "BKE_curve.hh"
#include "BKE_idprop.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_main.hh"
#include "BKE_object.hh"
@ -96,7 +96,7 @@ static void armature_init_data(ID *id)
* Note: this function's use case is narrow in scope, intended only for use in
* `armature_copy_data()` below. You probably don't want to use this otherwise.
*
* \param lib_id_flag: Copying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more).
* \param lib_id_flag: Copying options (see BKE_lib_id.hh's LIB_ID_COPY_... flags for more).
*/
static void copy_bone_collection(bArmature *armature_dst,
BoneCollection *&bcoll_dst,
@ -125,7 +125,7 @@ static void copy_bone_collection(bArmature *armature_dst,
*
* WARNING! This function will not handle ID user count!
*
* \param flag: Copying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more).
* \param flag: Copying options (see BKE_lib_id.hh's LIB_ID_COPY_... flags for more).
*/
static void armature_copy_data(Main * /*bmain*/, ID *id_dst, const ID *id_src, const int flag)
{

View File

@ -6,7 +6,7 @@
#include "BKE_bake_items_serialize.hh"
#include "BKE_curves.hh"
#include "BKE_instances.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_mesh.hh"
#include "BKE_pointcloud.hh"

View File

@ -7,7 +7,7 @@
#include "BKE_curves.hh"
#include "BKE_customdata.hh"
#include "BKE_instances.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_mesh.hh"
#include "BKE_pointcloud.hh"

View File

@ -30,7 +30,7 @@
#include "BKE_context.hh"
#include "BKE_global.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_scene.h"

View File

@ -36,7 +36,7 @@
#include "BKE_context.hh"
#include "BKE_global.h"
#include "BKE_main.hh"
#include "BKE_undo_system.h"
#include "BKE_undo_system.hh"
#include "BLO_readfile.h"
#include "BLO_undofile.hh"

View File

@ -43,7 +43,7 @@
#include "BKE_ipo.h"
#include "BKE_keyconfig.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_override.hh"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
@ -55,7 +55,7 @@
#include "BKE_scene.h"
#include "BKE_screen.hh"
#include "BKE_studiolight.h"
#include "BKE_undo_system.h"
#include "BKE_undo_system.hh"
#include "BKE_workspace.h"
#include "BLO_readfile.h"

View File

@ -38,7 +38,7 @@
#include "BKE_idtype.h"
#include "BKE_key.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_override.hh"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"

View File

@ -58,7 +58,7 @@
#include "BKE_idtype.h"
#include "BKE_image.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_library.hh"
#include "BKE_main.hh"
#include "BKE_node.h"

View File

@ -7,7 +7,7 @@
#include "BKE_bpath.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "MEM_guardedalloc.h"

View File

@ -27,7 +27,7 @@
#include "BKE_context.hh"
#include "BKE_gpencil_legacy.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
#include "BKE_main.hh"

View File

@ -28,7 +28,7 @@
#include "BKE_bpath.h"
#include "BKE_cachefile.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_modifier.hh"
#include "BKE_scene.h"

View File

@ -34,7 +34,7 @@
#include "BKE_idprop.h"
#include "BKE_idtype.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_main.hh"
#include "BKE_object.hh"
@ -69,7 +69,7 @@ static void camera_init_data(ID *id)
*
* WARNING! This function will not handle ID user count!
*
* \param flag: Copying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more).
* \param flag: Copying options (see BKE_lib_id.hh's LIB_ID_COPY_... flags for more).
*/
static void camera_copy_data(Main * /*bmain*/, ID *id_dst, const ID *id_src, const int flag)
{

View File

@ -30,7 +30,7 @@
#include "BKE_customdata.hh"
#include "BKE_effect.h"
#include "BKE_global.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_runtime.hh"
#include "BKE_modifier.hh"

View File

@ -25,7 +25,7 @@
#include "BKE_idprop.h"
#include "BKE_idtype.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
#include "BKE_main.hh"
@ -130,7 +130,7 @@ static void collection_init_data(ID *id)
*
* WARNING! This function will not handle ID user count!
*
* \param flag: Copying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more).
* \param flag: Copying options (see BKE_lib_id.hh's LIB_ID_COPY_... flags for more).
*/
static void collection_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int flag)
{

View File

@ -58,7 +58,7 @@
#include "BKE_fcurve_driver.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_mesh.hh"
#include "BKE_mesh_runtime.hh"

View File

@ -25,7 +25,7 @@
#include "BKE_editmesh.hh"
#include "BKE_geometry_set.hh"
#include "BKE_grease_pencil.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_wrapper.hh"
#include "BKE_modifier.hh"
@ -692,7 +692,7 @@ GeometryDeformation get_evaluated_grease_pencil_drawing_deformation(const Object
{
if (const GreasePencil *grease_pencil_eval = grease_pencil_component_eval->get()) {
Span<const bke::greasepencil::Layer *> layers_eval = grease_pencil_eval->layers();
if (layers_eval.size() != layers_orig.size()) {
if (layers_eval.size() == layers_orig.size()) {
const bke::greasepencil::Layer *layer_eval = layers_eval[layer_index];
const int drawing_index_eval = layer_eval->drawing_index_at(frame);
if (drawing_index_eval != -1) {

View File

@ -46,7 +46,7 @@
#include "BKE_displist.h"
#include "BKE_idtype.h"
#include "BKE_key.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_main.hh"
#include "BKE_object.hh"

View File

@ -14,7 +14,7 @@
#include "BKE_curve.hh"
#include "BKE_displist.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_modifier.hh"
#include "BKE_vfont.hh"

View File

@ -33,7 +33,7 @@
#include "BKE_geometry_set.hh"
#include "BKE_global.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
#include "BKE_main.hh"

View File

@ -35,7 +35,7 @@
#include "BKE_displist.h"
#include "BKE_geometry_set.hh"
#include "BKE_key.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_mball.h"
#include "BKE_mesh.hh"
#include "BKE_modifier.hh"

View File

@ -50,7 +50,7 @@
#include "BKE_effect.h"
#include "BKE_image.h"
#include "BKE_image_format.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_mesh.hh"

View File

@ -20,7 +20,7 @@
#include "BKE_customdata.hh"
#include "BKE_editmesh.hh"
#include "BKE_editmesh_cache.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_iterators.hh"
#include "BKE_mesh_wrapper.hh"

View File

@ -31,7 +31,7 @@
#include "BKE_fluid.h"
#include "BKE_global.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_modifier.hh"
#include "BKE_pointcache.h"

View File

@ -18,7 +18,7 @@
#include "BLT_translation.h"
#include "BKE_freestyle.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_linestyle.h"
/* Function declarations. */

View File

@ -13,7 +13,7 @@
#include "BKE_deform.h"
#include "BKE_geometry_fields.hh"
#include "BKE_geometry_set.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "FN_multi_function_builder.hh"

View File

@ -4,7 +4,7 @@
#include "BKE_geometry_set.hh"
#include "BKE_grease_pencil.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "DNA_grease_pencil_types.h"

View File

@ -12,7 +12,7 @@
#include "BKE_deform.h"
#include "BKE_geometry_fields.hh"
#include "BKE_geometry_set.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_mapping.hh"

View File

@ -5,7 +5,7 @@
#include "DNA_pointcloud_types.h"
#include "BKE_geometry_set.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_pointcloud.hh"
#include "attribute_access_intern.hh"

View File

@ -5,7 +5,7 @@
#include "DNA_volume_types.h"
#include "BKE_geometry_set.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_volume.hh"
namespace blender::bke {

View File

@ -14,7 +14,7 @@
#include "BKE_geometry_set_instances.hh"
#include "BKE_grease_pencil.hh"
#include "BKE_instances.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_wrapper.hh"
#include "BKE_modifier.hh"

View File

@ -45,7 +45,7 @@
#include "BKE_icons.h"
#include "BKE_idtype.h"
#include "BKE_image.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_main.hh"
#include "BKE_material.h"

View File

@ -35,7 +35,7 @@
#include "BKE_gpencil_legacy.h"
#include "BKE_gpencil_modifier_legacy.h"
#include "BKE_lattice.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_material.h"
#include "BKE_modifier.hh"

View File

@ -15,7 +15,7 @@
#include "BKE_grease_pencil.h"
#include "BKE_grease_pencil.hh"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_material.h"
#include "BKE_modifier.hh"
@ -1908,6 +1908,16 @@ blender::Span<blender::bke::greasepencil::TreeNode *> GreasePencil::nodes_for_wr
return this->root_group().nodes_for_write();
}
std::optional<int> GreasePencil::get_layer_index(
const blender::bke::greasepencil::Layer &layer) const
{
const int index = this->layers().first_index_try(&layer);
if (index == -1) {
return {};
}
return index;
}
const blender::bke::greasepencil::Layer *GreasePencil::get_active_layer() const
{
if (this->active_layer == nullptr) {
@ -2174,7 +2184,7 @@ blender::IndexMask GreasePencil::layer_selection_by_name(const blender::StringRe
}
if (node->is_layer()) {
const int64_t index = this->layers().first_index(&node->as_layer());
const int index = *this->get_layer_index(node->as_layer());
return blender::IndexMask::from_indices(Span{index}, memory);
}
else if (node->is_group()) {

View File

@ -10,7 +10,7 @@
#include "BKE_customdata.hh"
#include "BKE_grease_pencil.hh"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
using namespace blender::bke::greasepencil;

View File

@ -24,7 +24,7 @@
#include "BKE_global.h"
#include "BKE_idprop.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "CLG_log.h"

View File

@ -68,7 +68,7 @@
#include "BKE_idtype.h"
#include "BKE_image.h"
#include "BKE_image_format.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_node.hh"
#include "BKE_node_runtime.hh"

View File

@ -51,7 +51,7 @@
#include "BKE_idtype.h"
#include "BKE_ipo.h"
#include "BKE_key.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_main.hh"
#include "BKE_nla.h"

View File

@ -42,7 +42,7 @@
#include "BKE_idtype.h"
#include "BKE_key.h"
#include "BKE_lattice.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_main.hh"
#include "BKE_mesh.hh"

View File

@ -38,7 +38,7 @@
#include "BKE_displist.h"
#include "BKE_idtype.h"
#include "BKE_lattice.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_main.hh"
#include "BKE_modifier.hh"

View File

@ -26,7 +26,7 @@
#include "BKE_freestyle.h"
#include "BKE_idprop.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_node.hh"
#include "BKE_object.hh"

View File

@ -50,7 +50,7 @@
#include "BKE_idprop.h"
#include "BKE_idtype.h"
#include "BKE_key.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_override.hh"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"

View File

@ -28,7 +28,7 @@
#include "BKE_idtype.h"
#include "BKE_key.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_override.hh"
#include "BKE_lib_remap.hh"
#include "BKE_main.hh"

View File

@ -14,7 +14,7 @@
#include "BLI_utildefines.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_mesh.hh"
void BKE_id_eval_properties_copy(ID *id_cow, ID *id)

View File

@ -5,7 +5,7 @@
#include "DNA_ID.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_remap.hh"
#include "MEM_guardedalloc.h"

View File

@ -9,7 +9,7 @@
#include "BLI_string.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_main_namemap.hh"

View File

@ -34,7 +34,7 @@
#include "BKE_idtype.h"
#include "BKE_key.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_override.hh"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"

View File

@ -24,7 +24,7 @@
#include "BKE_collection.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_override.hh"
#include "BKE_main.hh"

View File

@ -18,7 +18,7 @@
#include "BKE_anim_data.h"
#include "BKE_idprop.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_main.hh"
#include "BKE_node.h"

View File

@ -21,7 +21,7 @@
#include "BKE_collection.h"
#include "BKE_curve.hh"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
#include "BKE_main.hh"

View File

@ -18,7 +18,7 @@
#include "BKE_context.hh"
#include "BKE_global.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_remap.hh"
#include "BKE_main.hh"
#include "BKE_mesh.hh"

View File

@ -23,7 +23,7 @@
#include "BKE_bpath.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_library.hh"
#include "BKE_main.hh"

View File

@ -27,7 +27,7 @@
#include "BKE_anim_data.h"
#include "BKE_icons.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_light.h"
#include "BKE_main.hh"
@ -56,7 +56,7 @@ static void light_init_data(ID *id)
*
* WARNING! This function will not handle ID user count!
*
* \param flag: Copying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more).
* \param flag: Copying options (see BKE_lib_id.hh's LIB_ID_COPY_... flags for more).
*/
static void light_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int flag)
{

View File

@ -18,7 +18,7 @@
#include "BKE_collection.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_report.h"
#include "BLT_translation.h"

View File

@ -19,7 +19,7 @@
#include "BKE_anim_data.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_lightprobe.h"
#include "BKE_main.hh"

View File

@ -30,7 +30,7 @@
#include "BKE_context.hh"
#include "BKE_freestyle.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_linestyle.h"
#include "BKE_main.hh"

View File

@ -27,7 +27,7 @@
#include "BKE_bpath.h"
#include "BKE_global.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
#include "BKE_main.hh"

View File

@ -15,7 +15,7 @@
#include "DNA_ID.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_main_idmap.hh" /* own include */

View File

@ -7,7 +7,7 @@
*/
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_main_namemap.hh"

View File

@ -13,7 +13,7 @@
#include "BKE_collection.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_library.hh"
#include "BKE_main.hh"

View File

@ -34,7 +34,7 @@
#include "BKE_anim_data.h"
#include "BKE_image.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_main.hh"
#include "BKE_mask.h"

View File

@ -55,7 +55,7 @@
#include "BKE_icons.h"
#include "BKE_idtype.h"
#include "BKE_image.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_main.hh"
#include "BKE_material.h"

View File

@ -46,7 +46,7 @@
#include "BKE_idtype.h"
#include "BKE_lattice.hh"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_material.h"
#include "BKE_mball.h"

View File

@ -31,7 +31,7 @@
#include "BKE_displist.h"
#include "BKE_global.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_mball_tessellate.h" /* own include */
#include "BKE_mesh.hh"
#include "BKE_object.hh"

View File

@ -50,7 +50,7 @@
#include "BKE_global.h"
#include "BKE_idtype.h"
#include "BKE_key.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_main.hh"
#include "BKE_material.h"
@ -137,6 +137,7 @@ static void mesh_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int
mesh_dst->runtime->bounds_cache = mesh_src->runtime->bounds_cache;
mesh_dst->runtime->vert_normals_cache = mesh_src->runtime->vert_normals_cache;
mesh_dst->runtime->face_normals_cache = mesh_src->runtime->face_normals_cache;
mesh_dst->runtime->corner_normals_cache = mesh_src->runtime->corner_normals_cache;
mesh_dst->runtime->loose_verts_cache = mesh_src->runtime->loose_verts_cache;
mesh_dst->runtime->verts_no_face_cache = mesh_src->runtime->verts_no_face_cache;
mesh_dst->runtime->loose_edges_cache = mesh_src->runtime->loose_edges_cache;

View File

@ -34,7 +34,7 @@
#include "BKE_geometry_set.hh"
#include "BKE_geometry_set_instances.hh"
#include "BKE_key.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_main.hh"
#include "BKE_material.h"

View File

@ -15,7 +15,7 @@
#include "DNA_object_types.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_mesh.hh"
#include "BKE_mesh_fair.hh"

View File

@ -16,7 +16,7 @@
#include "BKE_attribute.hh"
#include "BKE_deform.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_mesh.hh"
#include "BKE_mesh_mirror.hh"
@ -396,7 +396,7 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd,
if (ob->type == OB_MESH && CustomData_has_layer(&result->corner_data, CD_CUSTOMLOOPNORMAL) &&
result->faces_num > 0)
{
blender::Array<blender::float3> loop_normals(result_corner_verts.size());
blender::Array<blender::float3> corner_normals(result_corner_verts.size());
blender::short2 *clnors = static_cast<blender::short2 *>(CustomData_get_layer_for_write(
&result->corner_data, CD_CUSTOMLOOPNORMAL, result->corners_num));
blender::bke::mesh::CornerNormalSpaceArray lnors_spacearr;
@ -407,7 +407,7 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd,
invert_m4_m4(mtx_nor, mtx);
transpose_m4(mtx_nor);
/* calculate custom normals into loop_normals, then mirror first half into second half */
/* calculate custom normals into corner_normals, then mirror first half into second half */
const bke::AttributeAccessor attributes = result->attributes();
const VArraySpan sharp_edges = *attributes.lookup<bool>("sharp_edge", AttrDomain::Edge);
const VArraySpan sharp_faces = *attributes.lookup<bool>("sharp_face", AttrDomain::Face);
@ -423,7 +423,7 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd,
sharp_faces,
clnors,
&lnors_spacearr,
loop_normals);
corner_normals);
/* mirroring has to account for loops being reversed in faces in second half */
for (const int i : src_faces.index_range()) {
@ -436,12 +436,12 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd,
mirrorj += result_faces[mirror_i].size() - (j - src_face.start());
}
copy_v3_v3(loop_normals[mirrorj], loop_normals[j]);
mul_m4_v3(mtx_nor, loop_normals[mirrorj]);
copy_v3_v3(corner_normals[mirrorj], corner_normals[j]);
mul_m4_v3(mtx_nor, corner_normals[mirrorj]);
const int space_index = lnors_spacearr.corner_space_indices[mirrorj];
clnors[mirrorj] = blender::bke::mesh::corner_space_custom_normal_to_data(
lnors_spacearr.spaces[space_index], loop_normals[mirrorj]);
lnors_spacearr.spaces[space_index], corner_normals[mirrorj]);
}
}
}

View File

@ -28,7 +28,7 @@
#include "BKE_bvhutils.hh"
#include "BKE_customdata.hh"
#include "BKE_editmesh.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_mapping.hh"
#include "BKE_mesh_remesh_voxel.hh" /* own include */

View File

@ -20,7 +20,7 @@
#include "BKE_bvhutils.hh"
#include "BKE_customdata.hh"
#include "BKE_editmesh_cache.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_mapping.hh"
#include "BKE_mesh_runtime.hh"

View File

@ -61,7 +61,7 @@ struct BKEMeshToTangent {
mikk::float3 GetNormal(const uint face_num, const uint vert_num)
{
return mikk::float3(loop_normals[uint(faces[face_num].start()) + vert_num]);
return mikk::float3(corner_normals[uint(faces[face_num].start()) + vert_num]);
}
void SetTangentSpace(const uint face_num, const uint vert_num, mikk::float3 T, bool orientation)
@ -74,7 +74,7 @@ struct BKEMeshToTangent {
const int *corner_verts; /* faces vertices */
const float (*positions)[3]; /* vertices */
const float (*luvs)[2]; /* texture coordinates */
const float (*loop_normals)[3]; /* loops' normals */
const float (*corner_normals)[3]; /* loops' normals */
float (*tangents)[4]; /* output tangents */
int num_faces; /* number of polygons */
};
@ -83,7 +83,7 @@ void BKE_mesh_calc_loop_tangent_single_ex(const float (*vert_positions)[3],
const int /*numVerts*/,
const int *corner_verts,
float (*r_looptangent)[4],
const float (*loop_normals)[3],
const float (*corner_normals)[3],
const float (*loop_uvs)[2],
const int /*numLoops*/,
const blender::OffsetIndices<int> faces,
@ -95,7 +95,7 @@ void BKE_mesh_calc_loop_tangent_single_ex(const float (*vert_positions)[3],
mesh_to_tangent.corner_verts = corner_verts;
mesh_to_tangent.positions = vert_positions;
mesh_to_tangent.luvs = loop_uvs;
mesh_to_tangent.loop_normals = loop_normals;
mesh_to_tangent.corner_normals = corner_normals;
mesh_to_tangent.tangents = r_looptangent;
mesh_to_tangent.num_faces = int(faces.size());
@ -401,7 +401,7 @@ void BKE_mesh_calc_loop_tangent_ex(const float (*vert_positions)[3],
int tangent_names_len,
const float (*vert_normals)[3],
const float (*face_normals)[3],
const float (*loop_normals)[3],
const float (*corner_normals)[3],
const float (*vert_orco)[3],
/* result */
CustomData *loopdata_out,
@ -503,7 +503,7 @@ void BKE_mesh_calc_loop_tangent_ex(const float (*vert_positions)[3],
mesh2tangent->sharp_faces = sharp_faces;
/* NOTE: we assume we do have tessellated loop normals at this point
* (in case it is object-enabled), have to check this is valid. */
mesh2tangent->precomputedLoopNormals = loop_normals;
mesh2tangent->precomputedLoopNormals = corner_normals;
mesh2tangent->precomputedFaceNormals = face_normals;
mesh2tangent->orco = nullptr;

View File

@ -36,7 +36,7 @@
#include "BKE_DerivedMesh.hh"
#include "BKE_editmesh.hh"
#include "BKE_editmesh_cache.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_runtime.hh"
#include "BKE_mesh_wrapper.hh"

View File

@ -54,7 +54,7 @@
#include "BKE_gpencil_modifier_legacy.h"
#include "BKE_idtype.h"
#include "BKE_key.h"
#include "BKE_lib_id.h"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.h"
#include "BKE_mesh.hh"
#include "BKE_mesh_wrapper.hh"

Some files were not shown because too many files have changed in this diff Show More