ImBuf: optimize IMB_transform #115653

Merged
Aras Pranckevicius merged 15 commits from aras_p/blender:imb_transform_opt into main 2023-12-14 15:10:41 +01:00
457 changed files with 1231 additions and 1125 deletions
Showing only changes of commit 8c8b4b30b9 - Show all commits

View File

@ -553,10 +553,10 @@ set(XR_OPENXR_SDK_HASH a2623ebab3d0b340bc16311b14f02075)
set(XR_OPENXR_SDK_HASH_TYPE MD5)
set(XR_OPENXR_SDK_FILE OpenXR-SDK-${XR_OPENXR_SDK_VERSION}.tar.gz)
set(WL_PROTOCOLS_VERSION 1.31)
set(WL_PROTOCOLS_FILE wayland-protocols-${WL_PROTOCOLS_VERSION}.tar.gz)
set(WL_PROTOCOLS_URI https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/${WL_PROTOCOLS_VERSION}/${WL_PROTOCOLS_FILE})
set(WL_PROTOCOLS_HASH a28ff59a56e2ebb746048b6ef8d931d6)
set(WL_PROTOCOLS_VERSION 1.32)
set(WL_PROTOCOLS_FILE wayland-protocols-${WL_PROTOCOLS_VERSION}.tar.xz)
set(WL_PROTOCOLS_URI https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/${WL_PROTOCOLS_VERSION}/downloads/${WL_PROTOCOLS_FILE})
set(WL_PROTOCOLS_HASH 00c2cedb0d2df714a0965a00c19385c6)
set(WL_PROTOCOLS_HASH_TYPE MD5)
set(WL_PROTOCOLS_HOMEPAGE https://gitlab.freedesktop.org/wayland/wayland-protocols)

View File

@ -12,8 +12,10 @@
# include <vulkan/vulkan_win32.h>
#elif defined(__APPLE__)
# include <MoltenVK/vk_mvk_moltenvk.h>
#else /* X11 */
# include <vulkan/vulkan_xlib.h>
#else /* X11/WAYLAND. */
# ifdef WITH_GHOST_X11
# include <vulkan/vulkan_xlib.h>
# endif
# ifdef WITH_GHOST_WAYLAND
# include <vulkan/vulkan_wayland.h>
# endif
@ -946,9 +948,11 @@ const char *GHOST_ContextVK::getPlatformSpecificSurfaceExtension() const
return VK_EXT_METAL_SURFACE_EXTENSION_NAME;
#else /* UNIX/Linux */
switch (m_platform) {
# ifdef WITH_GHOST_X11
case GHOST_kVulkanPlatformX11:
return VK_KHR_XLIB_SURFACE_EXTENSION_NAME;
break;
# endif
# ifdef WITH_GHOST_WAYLAND
case GHOST_kVulkanPlatformWayland:
return VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME;
@ -968,9 +972,11 @@ GHOST_TSuccess GHOST_ContextVK::initializeDrawingContext()
#else /* UNIX/Linux */
bool use_window_surface = false;
switch (m_platform) {
# ifdef WITH_GHOST_X11
case GHOST_kVulkanPlatformX11:
use_window_surface = (m_display != nullptr) && (m_window != (Window) nullptr);
break;
# endif
# ifdef WITH_GHOST_WAYLAND
case GHOST_kVulkanPlatformWayland:
use_window_surface = (m_wayland_display != nullptr) && (m_wayland_surface != nullptr);
@ -1061,6 +1067,7 @@ GHOST_TSuccess GHOST_ContextVK::initializeDrawingContext()
VK_CHECK(vkCreateMetalSurfaceEXT(instance, &info, nullptr, &m_surface));
#else
switch (m_platform) {
# ifdef WITH_GHOST_X11
case GHOST_kVulkanPlatformX11: {
VkXlibSurfaceCreateInfoKHR surface_create_info = {};
surface_create_info.sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR;
@ -1069,6 +1076,7 @@ GHOST_TSuccess GHOST_ContextVK::initializeDrawingContext()
VK_CHECK(vkCreateXlibSurfaceKHR(instance, &surface_create_info, nullptr, &m_surface));
break;
}
# endif
# ifdef WITH_GHOST_WAYLAND
case GHOST_kVulkanPlatformWayland: {
VkWaylandSurfaceCreateInfoKHR surface_create_info = {};

View File

@ -19,7 +19,12 @@
#elif defined(__APPLE__)
# include "GHOST_SystemCocoa.hh"
#else
# include "GHOST_SystemX11.hh"
# ifdef WITH_GHOST_X11
# include "GHOST_SystemX11.hh"
# else
# define Display void
# define Window void *
# endif
# ifdef WITH_GHOST_WAYLAND
# include "GHOST_SystemWayland.hh"
# else
@ -40,9 +45,11 @@
#endif
typedef enum {
#ifdef WITH_GHOST_X11
GHOST_kVulkanPlatformX11 = 0,
#endif
#ifdef WITH_GHOST_WAYLAND
GHOST_kVulkanPlatformWayland,
GHOST_kVulkanPlatformWayland = 1,
#endif
} GHOST_TVulkanPlatformType;

File diff suppressed because it is too large Load Diff

View File

@ -244,6 +244,13 @@ class GHOST_SystemWayland : public GHOST_System {
/* WAYLAND utility functions. */
/**
* Use this function instead of #GHOST_System::getMilliSeconds,
* passing in the time-stamp from WAYLAND input to get the event
* time-stamp with an offset applied to make it compatible with `getMilliSeconds`.
*/
uint64_t ms_from_input_time(const uint32_t timestamp_as_uint);
/**
* Push an event, with support for calling from a thread.
* NOTE: only needed for `USE_EVENT_BACKGROUND_THREAD`.

View File

@ -19,7 +19,7 @@ set(SRC
set(LIB
)
# This library is currently windows only, for the other platforms an empty target is created this
# This library is currently windows only, for the other platforms an empty target is created this
# way we don't have to clutter if(WIN32) ... endif() all over the place to use this library.
if(WIN32)
list(APPEND SRC

View File

@ -81,7 +81,8 @@ int urename(const char *oldname, const char *newname, const bool do_replace)
if (oldname_16 && newname_16) {
/* Closer to UNIX `rename` behavior, as it at least allows to replace an existing file.
* Return value logic is inverted however (returns non-zero on sucess, 0 on failure).
* Note that the operation will still fail if the 'newname' existing file is opened anywhere. */
* Note that the operation will still fail if the 'newname' existing file is opened anywhere.
*/
r = (MoveFileExW(oldname_16, newname_16, do_replace ? MOVEFILE_REPLACE_EXISTING : 0) == 0);
}

View File

@ -4632,7 +4632,7 @@ def km_grease_pencil_edit(params):
("grease_pencil.cyclical_set", {"type": 'F', "value": 'PRESS'}, {"properties": [("type", "CLOSE")]}),
("grease_pencil.cyclical_set", {"type": 'C', "value": 'PRESS',
"alt": True}, {"properties": [("type", "TOGGLE")]}),
("grease_pencil.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None),
# Active layer
@ -5403,9 +5403,8 @@ def km_sculpt(params):
{"properties": [("mode", 'TOGGLE')]}),
("sculpt.face_set_change_visibility", {"type": 'H', "value": 'PRESS'},
{"properties": [("mode", 'HIDE_ACTIVE')]}),
("sculpt.reveal_all", {"type": 'H', "value": 'PRESS', "alt": True},
{"properties": []}),
("paint.hide_show", {"type": 'H', "value": 'PRESS', "alt": True},
{"properties": [("action", "SHOW"), ("area", "ALL")]}),
("sculpt.face_set_edit", {"type": 'W', "value": 'PRESS', "ctrl": True},
{"properties": [("mode", 'GROW')]}),
("sculpt.face_set_edit", {"type": 'W', "value": 'PRESS', "ctrl": True, "alt": True},

View File

@ -3702,8 +3702,6 @@ def km_sculpt(params):
{"properties": [("mode", 'TOGGLE')]}),
("paint.hide_show", {"type": 'H', "value": 'PRESS', "ctrl": True},
{"properties": [("action", 'HIDE'), ("area", 'MASKED')]}),
("sculpt.reveal_all", {"type": 'H', "value": 'PRESS', "alt": True},
{"properties": []}),
("paint.hide_show", {"type": 'H', "value": 'PRESS', "alt": True},
{"properties": [("action", 'SHOW'), ("area", 'ALL')]}),
# Subdivision levels

View File

@ -273,6 +273,7 @@ class GPENCIL_MT_layer_active(Menu):
layout.operator("gpencil.layer_active", text=gpl.info, icon=icon).layer = i
i -= 1
class GREASE_PENCIL_MT_layer_active(Menu):
bl_label = "Change Active Layer"
@ -288,7 +289,7 @@ class GREASE_PENCIL_MT_layer_active(Menu):
layout.separator()
for i in range(len(obd.layers) - 1, -1, -1):
for i in range(len(obd.layers) - 1, -1, -1):
layer = obd.layers[i]
if layer == obd.layers.active:
icon = 'GREASEPENCIL'
@ -296,6 +297,7 @@ class GREASE_PENCIL_MT_layer_active(Menu):
icon = 'NONE'
layout.operator("grease_pencil.layer_active", text=layer.name, icon=icon).layer = i
class GPENCIL_MT_material_active(Menu):
bl_label = "Change Active Material"

View File

@ -99,8 +99,9 @@ class NLA_MT_editor_menus(Menu):
layout.menu("NLA_MT_select")
if st.show_markers:
layout.menu("NLA_MT_marker")
layout.menu("NLA_MT_edit")
layout.menu("NLA_MT_add")
layout.menu("NLA_MT_tracks")
layout.menu("NLA_MT_strips")
class NLA_MT_view(Menu):
@ -189,29 +190,68 @@ class NLA_MT_marker_select(Menu):
layout.operator("marker.select_leftright", text="After Current Frame").mode = 'RIGHT'
class NLA_MT_edit(Menu):
bl_label = "Edit"
class NLA_MT_add(Menu):
bl_label = "Add"
bl_translation_context = i18n_contexts.operator_default
def draw(self, _context):
layout = self.layout
layout.operator("nla.actionclip_add", text="Action")
layout.operator("nla.transition_add", text="Transition")
layout.operator("nla.soundclip_add", text="Sound")
layout.separator()
layout.operator("nla.selected_objects_add", text="Selected Objects")
class NLA_MT_tracks(Menu):
bl_label = "Track"
def draw(self, _context):
layout = self.layout
layout.operator("nla.tracks_add", text="Add").above_selected = False
layout.operator("nla.tracks_add", text="Add Above Selected").above_selected = True
layout.operator("nla.tracks_delete", text="Delete")
layout.separator()
layout.operator_menu_enum("anim.channels_move", "direction", text="Move")
layout.separator()
layout.operator("anim.channels_clean_empty")
class NLA_MT_strips(Menu):
bl_label = "Strip"
def draw(self, context):
layout = self.layout
scene = context.scene
layout.menu("NLA_MT_edit_transform", text="Transform")
layout.menu("NLA_MT_strips_transform", text="Transform")
layout.operator_menu_enum("nla.snap", "type", text="Snap")
layout.separator()
layout.operator("nla.bake", text="Bake Action")
layout.operator("nla.duplicate_move")
layout.operator("nla.duplicate_linked_move")
layout.operator("nla.split")
layout.operator("nla.delete")
layout.operator("nla.tracks_delete")
layout.operator("nla.split", text="Split")
layout.separator()
layout.operator("nla.duplicate", text="Duplicate").linked = False
layout.operator("nla.duplicate", text="Linked Duplicate").linked = True
layout.operator("nla.delete", text="Delete")
layout.separator()
layout.operator("nla.meta_add", text="Make Meta")
layout.operator("nla.meta_remove", text="Remove Meta")
layout.separator()
layout.operator("nla.mute_toggle")
layout.separator()
layout.operator("nla.bake", text="Bake Action")
layout.separator()
layout.operator("nla.apply_scale")
layout.operator("nla.clear_scale")
@ -221,17 +261,6 @@ class NLA_MT_edit(Menu):
layout.operator("nla.make_single_user")
layout.separator()
layout.operator("nla.swap")
layout.operator("nla.move_up")
layout.operator("nla.move_down")
# TODO: this really belongs more in a "channel" (or better, "track") menu
layout.separator()
layout.operator_menu_enum("anim.channels_move", "direction", text="Track Ordering...")
layout.operator("anim.channels_clean_empty")
layout.separator()
# TODO: names of these tools for 'tweak-mode' need changing?
if scene.is_nla_tweakmode:
layout.operator("nla.tweakmode_exit", text="Stop Editing Stashed Action").isolate_action = True
layout.operator("nla.tweakmode_exit", text="Stop Tweaking Strip Actions")
@ -243,30 +272,7 @@ class NLA_MT_edit(Menu):
text="Start Tweaking Strip Actions (Lower Stack)").use_upper_stack_evaluation = False
class NLA_MT_add(Menu):
bl_label = "Add"
bl_translation_context = i18n_contexts.operator_default
def draw(self, _context):
layout = self.layout
layout.operator("nla.actionclip_add")
layout.operator("nla.transition_add")
layout.operator("nla.soundclip_add")
layout.separator()
layout.operator("nla.meta_add")
layout.operator("nla.meta_remove")
layout.separator()
layout.operator("nla.tracks_add").above_selected = False
layout.operator("nla.tracks_add", text="Add Tracks Above Selected").above_selected = True
layout.separator()
layout.operator("nla.selected_objects_add")
class NLA_MT_edit_transform(Menu):
class NLA_MT_strips_transform(Menu):
bl_label = "Transform"
def draw(self, _context):
@ -276,6 +282,13 @@ class NLA_MT_edit_transform(Menu):
layout.operator("transform.transform", text="Extend").mode = 'TIME_EXTEND'
layout.operator("transform.transform", text="Scale").mode = 'TIME_SCALE'
layout.separator()
layout.operator("nla.swap", text="Swap")
layout.separator()
layout.operator("nla.move_up", text="Move Up")
layout.operator("nla.move_down", text="Move Down")
class NLA_MT_snap_pie(Menu):
bl_label = "Snap"
@ -365,14 +378,15 @@ class NLA_MT_channel_context_menu(Menu):
classes = (
NLA_HT_header,
NLA_MT_edit,
NLA_MT_editor_menus,
NLA_MT_view,
NLA_MT_select,
NLA_MT_marker,
NLA_MT_marker_select,
NLA_MT_add,
NLA_MT_edit_transform,
NLA_MT_tracks,
NLA_MT_strips,
NLA_MT_strips_transform,
NLA_MT_snap_pie,
NLA_MT_view_pie,
NLA_MT_context_menu,

View File

@ -3785,7 +3785,9 @@ class VIEW3D_MT_face_sets(Menu):
layout.operator("sculpt.face_set_invert_visibility", text="Invert Visible Face Sets")
props = layout.operator("sculpt.reveal_all", text="Show All Face Sets")
props = layout.operator("paint.hide_show", text="Show All Face Sets")
props.action = "SHOW"
props.area = "ALL"
layout.separator()
@ -5806,6 +5808,7 @@ class VIEW3D_MT_edit_gpencil_showhide(Menu):
layout.operator("gpencil.hide", text="Hide Active Layer").unselected = False
layout.operator("gpencil.hide", text="Hide Inactive Layers").unselected = True
class VIEW3D_MT_edit_greasepencil_showhide(Menu):
bl_label = "Show/Hide"
@ -6138,7 +6141,9 @@ class VIEW3D_MT_sculpt_face_sets_edit_pie(Menu):
pie.operator("sculpt.face_set_invert_visibility", text="Invert Visible")
props = pie.operator("sculpt.reveal_all", text="Show All")
props = pie.operator("paint.hide_show", text="Show All")
props.action = "SHOW"
props.area = "ALL"
class VIEW3D_MT_wpaint_vgroup_lock_pie(Menu):

View File

@ -679,8 +679,9 @@ class VIEW3D_PT_slots_vertex_groups(Panel):
def draw_header(self, context):
ob = context.object
groups = ob.vertex_groups
self.bl_label = (
iface_("%s") % (ob.vertex_groups.active.name) if ob.vertex_groups else
iface_("%s") % (groups.active.name) if groups and groups.active else
iface_("Vertex Groups")
)

View File

@ -14,7 +14,7 @@
#include "AS_asset_library.hh"
#include "AS_asset_representation.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_preferences.h"
#include "BLI_fileops.h"

View File

@ -10,7 +10,7 @@
#include "BKE_appdir.h"
#include "BKE_callbacks.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "DNA_asset_types.h"

View File

@ -51,7 +51,7 @@ struct PrevCache {
/**
* Stores the cached/baked data for simulation nodes in geometry nodes.
*/
struct NodeCache {
struct SimulationNodeCache {
CacheStatus cache_status = CacheStatus::Valid;
/** All cached frames. */
@ -71,7 +71,7 @@ struct NodeCache {
struct ModifierCache {
mutable std::mutex mutex;
Map<int, std::unique_ptr<NodeCache>> cache_by_id;
Map<int, std::unique_ptr<SimulationNodeCache>> simulation_cache_by_id;
};
/**

View File

@ -100,7 +100,7 @@ bool BKE_object_dupli_find_rgba_attribute(const struct Object *ob,
* \return true if the attribute was found; if not, r_value is also set to zero.
*/
bool BKE_view_layer_find_rgba_attribute(const struct Scene *scene,
const struct ViewLayer *layer,
const struct ViewLayer *layer,
const char *name,
float r_value[4]);

View File

@ -25,10 +25,6 @@
#include "BLI_compiler_attrs.h"
#include "BLI_sys_types.h"
#ifdef __cplusplus
extern "C" {
#endif
struct BLI_mempool;
struct BlendThumbnail;
struct GHash;
@ -42,14 +38,14 @@ struct UniqueName_Map;
/**
* Blender thumbnail, as written to the `.blend` file (width, height, and data as char RGBA).
*/
typedef struct BlendThumbnail {
struct BlendThumbnail {
int width, height;
/** Pixel data, RGBA (repeated): `sizeof(char[4]) * width * height`. */
char rect[0];
} BlendThumbnail;
};
/** Structs caching relations between data-blocks in a given Main. */
typedef struct MainIDRelationsEntryItem {
struct MainIDRelationsEntryItem {
struct MainIDRelationsEntryItem *next;
union {
@ -62,9 +58,9 @@ typedef struct MainIDRelationsEntryItem {
uint session_uuid;
int usage_flag; /* Using IDWALK_ enums, defined in BKE_lib_query.h */
} MainIDRelationsEntryItem;
};
typedef struct MainIDRelationsEntry {
struct MainIDRelationsEntry {
/* Linked list of IDs using that ID. */
struct MainIDRelationsEntryItem *from_ids;
/* Linked list of IDs used by that ID. */
@ -75,10 +71,10 @@ typedef struct MainIDRelationsEntry {
/* Runtime tags, users should ensure those are reset after usage. */
uint tags;
} MainIDRelationsEntry;
};
/** #MainIDRelationsEntry.tags */
typedef enum eMainIDRelationsEntryTags {
enum eMainIDRelationsEntryTags {
/* Generic tag marking the entry as to be processed. */
MAINIDRELATIONS_ENTRY_TAGS_DOIT = 1 << 0,
@ -102,9 +98,9 @@ typedef enum eMainIDRelationsEntryTags {
* handling. */
MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS = MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS_TO |
MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS_FROM,
} eMainIDRelationsEntryTags;
};
typedef struct MainIDRelations {
struct MainIDRelations {
/* Mapping from an ID pointer to all of its parents (IDs using it) and children (IDs it uses).
* Values are `MainIDRelationsEntry` pointers. */
struct GHash *relations_from_pointers;
@ -114,15 +110,15 @@ typedef struct MainIDRelations {
/* Private... */
struct BLI_mempool *entry_items_pool;
} MainIDRelations;
};
enum {
/* Those bmain relations include pointers/usages from editors. */
MAINIDRELATIONS_INCLUDE_UI = 1 << 0,
};
typedef struct Main {
struct Main *next, *prev;
struct Main {
Main *next, *prev;
/**
* The file-path of this blend file, an empty string indicates an unsaved file.
*
@ -187,7 +183,7 @@ typedef struct Main {
BlendThumbnail *blen_thumb;
struct Library *curlib;
Library *curlib;
ListBase scenes;
ListBase libraries;
ListBase objects;
@ -238,20 +234,20 @@ typedef struct Main {
* know when, who and how it was created.
* Used by code doing a lot of remapping etc. at once to speed things up.
*/
struct MainIDRelations *relations;
MainIDRelations *relations;
/** IDMap of IDs. Currently used when reading (expanding) libraries. */
struct IDNameLib_Map *id_map;
IDNameLib_Map *id_map;
/** Used for efficient calculations of unique names. */
struct UniqueName_Map *name_map;
UniqueName_Map *name_map;
/* Used for efficient calculations of unique names. Covers all names in current Main, including
* linked data ones. */
struct UniqueName_Map *name_map_global;
UniqueName_Map *name_map_global;
struct MainLock *lock;
} Main;
MainLock *lock;
};
/**
* Create a new Main data-base.
@ -259,22 +255,22 @@ typedef struct Main {
* \note Always generate a non-global Main, use #BKE_blender_globals_main_replace to put a newly
* created one in `G_MAIN`.
*/
struct Main *BKE_main_new(void);
void BKE_main_free(struct Main *mainvar);
Main *BKE_main_new(void);
void BKE_main_free(Main *mainvar);
/**
* Check whether given `bmain` is empty or contains some IDs.
*/
bool BKE_main_is_empty(struct Main *bmain);
bool BKE_main_is_empty(Main *bmain);
void BKE_main_lock(struct Main *bmain);
void BKE_main_unlock(struct Main *bmain);
void BKE_main_lock(Main *bmain);
void BKE_main_unlock(Main *bmain);
/** Generate the mappings between used IDs and their users, and vice-versa. */
void BKE_main_relations_create(struct Main *bmain, short flag);
void BKE_main_relations_free(struct Main *bmain);
void BKE_main_relations_create(Main *bmain, short flag);
void BKE_main_relations_free(Main *bmain);
/** Set or clear given `tag` in all relation entries of given `bmain`. */
void BKE_main_relations_tag_set(struct Main *bmain, eMainIDRelationsEntryTags tag, bool value);
void BKE_main_relations_tag_set(Main *bmain, eMainIDRelationsEntryTags tag, bool value);
/**
* Create a #GSet storing all IDs present in given \a bmain, by their pointers.
@ -282,7 +278,7 @@ void BKE_main_relations_tag_set(struct Main *bmain, eMainIDRelationsEntryTags ta
* \param gset: If not NULL, given GSet will be extended with IDs from given \a bmain,
* instead of creating a new one.
*/
struct GSet *BKE_main_gset_create(struct Main *bmain, struct GSet *gset);
GSet *BKE_main_gset_create(Main *bmain, GSet *gset);
/* Temporary runtime API to allow re-using local (already appended)
* IDs instead of appending a new copy again. */
@ -293,12 +289,11 @@ struct GSet *BKE_main_gset_create(struct Main *bmain, struct GSet *gset);
*
* This uses the information stored in `ID.library_weak_reference`.
*/
struct GHash *BKE_main_library_weak_reference_create(struct Main *bmain) ATTR_NONNULL();
GHash *BKE_main_library_weak_reference_create(Main *bmain) ATTR_NONNULL();
/**
* Destroy the data generated by #BKE_main_library_weak_reference_create.
*/
void BKE_main_library_weak_reference_destroy(struct GHash *library_weak_reference_mapping)
ATTR_NONNULL();
void BKE_main_library_weak_reference_destroy(GHash *library_weak_reference_mapping) ATTR_NONNULL();
/**
* Search for a local ID matching the given linked ID reference.
*
@ -308,10 +303,9 @@ void BKE_main_library_weak_reference_destroy(struct GHash *library_weak_referenc
* \param library_id_name: the full ID name, including the leading two chars encoding the ID
* type.
*/
struct ID *BKE_main_library_weak_reference_search_item(
struct GHash *library_weak_reference_mapping,
const char *library_filepath,
const char *library_id_name) ATTR_NONNULL();
ID *BKE_main_library_weak_reference_search_item(GHash *library_weak_reference_mapping,
const char *library_filepath,
const char *library_id_name) ATTR_NONNULL();
/**
* Add the given ID weak library reference to given local ID and the runtime mapping.
*
@ -321,10 +315,10 @@ struct ID *BKE_main_library_weak_reference_search_item(
* \param library_id_name: the full ID name, including the leading two chars encoding the ID type.
* \param new_id: New local ID matching given weak reference.
*/
void BKE_main_library_weak_reference_add_item(struct GHash *library_weak_reference_mapping,
void BKE_main_library_weak_reference_add_item(GHash *library_weak_reference_mapping,
const char *library_filepath,
const char *library_id_name,
struct ID *new_id) ATTR_NONNULL();
ID *new_id) ATTR_NONNULL();
/**
* Update the status of the given ID weak library reference in current local IDs and the runtime
* mapping.
@ -339,11 +333,11 @@ void BKE_main_library_weak_reference_add_item(struct GHash *library_weak_referen
* \param old_id: Existing local ID matching given weak reference.
* \param new_id: New local ID matching given weak reference.
*/
void BKE_main_library_weak_reference_update_item(struct GHash *library_weak_reference_mapping,
void BKE_main_library_weak_reference_update_item(GHash *library_weak_reference_mapping,
const char *library_filepath,
const char *library_id_name,
struct ID *old_id,
struct ID *new_id) ATTR_NONNULL();
ID *old_id,
ID *new_id) ATTR_NONNULL();
/**
* Remove the given ID weak library reference from the given local ID and the runtime mapping.
*
@ -353,18 +347,18 @@ void BKE_main_library_weak_reference_update_item(struct GHash *library_weak_refe
* \param library_id_name: the full ID name, including the leading two chars encoding the ID type.
* \param old_id: Existing local ID matching given weak reference.
*/
void BKE_main_library_weak_reference_remove_item(struct GHash *library_weak_reference_mapping,
void BKE_main_library_weak_reference_remove_item(GHash *library_weak_reference_mapping,
const char *library_filepath,
const char *library_id_name,
struct ID *old_id) ATTR_NONNULL();
ID *old_id) ATTR_NONNULL();
/* *** Generic utils to loop over whole Main database. *** */
#define FOREACH_MAIN_LISTBASE_ID_BEGIN(_lb, _id) \
{ \
ID *_id_next = (ID *)(_lb)->first; \
for ((_id) = _id_next; (_id) != NULL; (_id) = _id_next) { \
_id_next = (ID *)(_id)->next;
ID *_id_next = static_cast<ID *>((_lb)->first); \
for ((_id) = _id_next; (_id) != nullptr; (_id) = _id_next) { \
_id_next = static_cast<ID *>((_id)->next);
#define FOREACH_MAIN_LISTBASE_ID_END \
} \
@ -411,7 +405,7 @@ void BKE_main_library_weak_reference_remove_item(struct GHash *library_weak_refe
* \param img: ImBuf image to generate thumbnail data from.
* \return The generated .blend file raw thumbnail data.
*/
struct BlendThumbnail *BKE_main_thumbnail_from_imbuf(struct Main *bmain, struct ImBuf *img);
BlendThumbnail *BKE_main_thumbnail_from_imbuf(Main *bmain, ImBuf *img);
/**
* Generates an image from raw .blend file thumbnail \a data.
*
@ -419,16 +413,16 @@ struct BlendThumbnail *BKE_main_thumbnail_from_imbuf(struct Main *bmain, struct
* \param data: Raw .blend file thumbnail data.
* \return An ImBuf from given data, or NULL if invalid.
*/
struct ImBuf *BKE_main_thumbnail_to_imbuf(struct Main *bmain, struct BlendThumbnail *data);
ImBuf *BKE_main_thumbnail_to_imbuf(Main *bmain, BlendThumbnail *data);
/**
* Generates an empty (black) thumbnail for given Main.
*/
void BKE_main_thumbnail_create(struct Main *bmain);
void BKE_main_thumbnail_create(Main *bmain);
/**
* Return file-path of given \a main.
*/
const char *BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL();
const char *BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL();
/**
* Return file-path of global main #G_MAIN.
*
@ -440,7 +434,7 @@ const char *BKE_main_blendfile_path_from_global(void);
/**
* \return A pointer to the \a ListBase of given \a bmain for requested \a type ID type.
*/
struct ListBase *which_libbase(struct Main *bmain, short type);
ListBase *which_libbase(Main *bmain, short type);
//#define INDEX_ID_MAX 41
/**
@ -453,9 +447,9 @@ struct ListBase *which_libbase(struct Main *bmain, short type);
* \param lb: Array of lists #INDEX_ID_MAX in length.
*
* \note The order of each ID type #ListBase in the array is determined by the `INDEX_ID_<IDTYPE>`
* enum definitions in `DNA_ID.h`. See also the #FOREACH_MAIN_ID_BEGIN macro in `BKE_main.h`
* enum definitions in `DNA_ID.h`. See also the #FOREACH_MAIN_ID_BEGIN macro in `BKE_main.hh`
*/
int set_listbasepointers(struct Main *main, struct ListBase *lb[]);
int set_listbasepointers(Main *main, ListBase *lb[]);
#define MAIN_VERSION_FILE_ATLEAST(main, ver, subver) \
((main)->versionfile > (ver) || \
@ -483,7 +477,3 @@ int set_listbasepointers(struct Main *main, struct ListBase *lb[]);
/** Protect against buffer overflow vulnerability & negative sizes. */
#define BLEN_THUMB_MEMSIZE_IS_VALID(_x, _y) \
(((_x) > 0 && (_y) > 0) && ((uint64_t)(_x) * (uint64_t)(_y) < (SIZE_MAX / (sizeof(int) * 4))))
#ifdef __cplusplus
}
#endif

View File

@ -174,7 +174,7 @@ void BKE_paint_free(Paint *p);
* #id_us_plus(), rather than if we were copying between 2 existing scenes where a matching
* value should decrease the existing user count as with #paint_brush_set()
*/
void BKE_paint_copy(Paint *src, Paint *tar, int flag);
void BKE_paint_copy(const Paint *src, Paint *tar, int flag);
void BKE_paint_runtime_init(const ToolSettings *ts, Paint *paint);
@ -202,21 +202,21 @@ void BKE_paint_curve_clamp_endpoint_add_index(PaintCurve *pc, int add_index);
/**
* Return true when in vertex/weight/texture paint + face-select mode?
*/
bool BKE_paint_select_face_test(Object *ob);
bool BKE_paint_select_face_test(const Object *ob);
/**
* Return true when in vertex/weight paint + vertex-select mode?
*/
bool BKE_paint_select_vert_test(Object *ob);
bool BKE_paint_select_vert_test(const Object *ob);
/**
* used to check if selection is possible
* (when we don't care if its face or vert)
*/
bool BKE_paint_select_elem_test(Object *ob);
bool BKE_paint_select_elem_test(const Object *ob);
/**
* Checks if face/vertex hiding is always applied in the current mode.
* Returns true in vertex/weight paint.
*/
bool BKE_paint_always_hide_test(Object *ob);
bool BKE_paint_always_hide_test(const Object *ob);
/* Partial visibility. */
@ -228,7 +228,7 @@ bool paint_is_grid_face_hidden(const unsigned int *grid_hidden, int gridsize, in
/**
* Return true if all vertices in the face are visible, false otherwise.
*/
bool paint_is_bmesh_face_hidden(BMFace *f);
bool paint_is_bmesh_face_hidden(const BMFace *f);
/* Paint masks. */
@ -245,7 +245,7 @@ bool paint_calculate_rake_rotation(UnifiedPaintSettings *ups,
bool stroke_has_started);
void paint_update_brush_rake_rotation(UnifiedPaintSettings *ups, Brush *brush, float rotation);
void BKE_paint_stroke_get_average(Scene *scene, Object *ob, float stroke[3]);
void BKE_paint_stroke_get_average(const Scene *scene, const Object *ob, float stroke[3]);
/* Tool slot API. */

View File

@ -377,13 +377,8 @@ bool BKE_pbvh_node_fully_unmasked_get(PBVHNode *node);
void BKE_pbvh_mark_rebuild_pixels(PBVH *pbvh);
void BKE_pbvh_vert_tag_update_normal(PBVH *pbvh, PBVHVertRef vertex);
void BKE_pbvh_node_get_grids(PBVH *pbvh,
PBVHNode *node,
const int **grid_indices,
int *totgrid,
int *maxgrid,
int *gridsize,
CCGElem *const **r_griddata);
blender::Span<int> BKE_pbvh_node_get_grid_indices(const PBVHNode &node);
void BKE_pbvh_node_num_verts(const PBVH *pbvh,
const PBVHNode *node,
int *r_uniquevert,

View File

@ -422,7 +422,7 @@ set(SRC
BKE_light_linking.h
BKE_lightprobe.h
BKE_linestyle.h
BKE_main.h
BKE_main.hh
BKE_main_idmap.hh
BKE_main_namemap.hh
BKE_mask.h

View File

@ -47,7 +47,7 @@
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_object.hh"
#include "BKE_object_types.hh"
#include "BKE_preview_image.hh"

View File

@ -19,7 +19,7 @@
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_nla.h"
#include "BKE_node.h"
#include "BKE_report.h"

View File

@ -43,7 +43,7 @@
#include "BKE_global.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_nla.h"
#include "BKE_node.h"

View File

@ -45,7 +45,7 @@
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_object.hh"
#include "BKE_object_types.hh"
#include "BKE_scene.h"

View File

@ -7,7 +7,7 @@
#include "BKE_bake_geometry_nodes_modifier.hh"
#include "BKE_collection.h"
#include "BKE_curves.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "DNA_modifier_types.h"
#include "DNA_node_types.h"
@ -24,10 +24,10 @@
namespace blender::bke::bake {
void NodeCache::reset()
void SimulationNodeCache::reset()
{
std::destroy_at(this);
new (this) NodeCache();
new (this) SimulationNodeCache();
}
void scene_simulation_states_reset(Scene &scene)
{
@ -40,7 +40,7 @@ void scene_simulation_states_reset(Scene &scene)
if (!nmd->runtime->cache) {
continue;
}
for (auto item : nmd->runtime->cache->cache_by_id.items()) {
for (auto item : nmd->runtime->cache->simulation_cache_by_id.items()) {
item.value->reset();
}
}

View File

@ -33,7 +33,7 @@
#include "BKE_idprop.h"
#include "BKE_image.h"
#include "BKE_layer.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_node.h"
#include "BKE_report.h"
#include "BKE_scene.h"

View File

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

View File

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

View File

@ -47,7 +47,7 @@
#include "BKE_lib_override.hh"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_main_idmap.hh"
#include "BKE_main_namemap.hh"
#include "BKE_preferences.h"

View File

@ -42,7 +42,7 @@
#include "BKE_lib_override.hh"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_main_namemap.hh"
#include "BKE_material.h"
#include "BKE_object.hh"

View File

@ -60,7 +60,7 @@
#include "BKE_image.h"
#include "BKE_lib_id.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_node.h"
#include "BKE_report.h"
#include "BKE_vfont.hh"

View File

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

View File

@ -30,7 +30,7 @@
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_paint.hh"
#include "BKE_preview_image.hh"

View File

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

View File

@ -36,7 +36,7 @@
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_object.hh"
#include "BKE_scene.h"
#include "BKE_screen.hh"

View File

@ -28,7 +28,7 @@
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_object.hh"
#include "BKE_preview_image.hh"
#include "BKE_rigidbody.h"

View File

@ -34,7 +34,7 @@
#include "BKE_context.hh"
#include "BKE_layer.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_scene.h"
#include "BKE_screen.hh"
#include "BKE_sound.h"

View File

@ -9,7 +9,7 @@
#include "BKE_cryptomatte.h"
#include "BKE_cryptomatte.hh"
#include "BKE_image.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "DNA_layer_types.h"
#include "DNA_material_types.h"

View File

@ -48,7 +48,7 @@
#include "BKE_key.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_object.hh"
#include "BKE_object_types.hh"
#include "BKE_vfont.hh"

View File

@ -36,7 +36,7 @@
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_modifier.hh"
#include "BKE_object.hh"
#include "BKE_object_types.hh"

View File

@ -46,7 +46,7 @@
#include "BKE_customdata.hh"
#include "BKE_customdata_file.h"
#include "BKE_deform.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_mesh_mapping.hh"
#include "BKE_mesh_remap.hh"
#include "BKE_multires.hh"

View File

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

View File

@ -34,7 +34,7 @@
#include "BKE_gpencil_curve_legacy.h"
#include "BKE_gpencil_geom_legacy.h"
#include "BKE_gpencil_legacy.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_object.hh"

View File

@ -46,7 +46,7 @@
#include "BKE_gpencil_curve_legacy.h"
#include "BKE_gpencil_geom_legacy.h"
#include "BKE_gpencil_legacy.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_mesh.hh"
#include "BKE_object.hh"

View File

@ -47,7 +47,7 @@
#include "BKE_image.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_paint.hh"

View File

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

View File

@ -22,7 +22,7 @@
#include "DNA_node_types.h"
#include "DNA_scene_types.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_node.h"
#include "BKE_idtype.h"

View File

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

View File

@ -24,7 +24,7 @@
#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_image_partial_update.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "GPU_capabilities.h"
#include "GPU_state.h"

View File

@ -10,7 +10,7 @@
#include "BKE_idtype.h"
#include "BKE_image.h"
#include "BKE_image_partial_update.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "IMB_imbuf.h"
#include "IMB_moviecache.h"

View File

@ -31,7 +31,7 @@
#include "BKE_image.h"
#include "BKE_image_format.h"
#include "BKE_image_save.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_report.h"
#include "BKE_scene.h"

View File

@ -53,7 +53,7 @@
#include "BKE_key.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_nla.h"
#include "CLG_log.h"

View File

@ -43,7 +43,7 @@
#include "BKE_lattice.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_mesh.hh"
#include "BKE_scene.h"

View File

@ -40,7 +40,7 @@
#include "BKE_lattice.hh"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_modifier.hh"
#include "BKE_object.hh"
#include "BKE_object_types.hh"

View File

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

View File

@ -54,7 +54,7 @@
#include "BKE_lib_override.hh"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_main_namemap.hh"
#include "BKE_node.h"
#include "BKE_rigidbody.h"

View File

@ -31,7 +31,7 @@
#include "BKE_lib_id.h"
#include "BKE_lib_override.hh"
#include "BKE_lib_remap.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_main_namemap.hh"
#include "lib_intern.hh"

View File

@ -10,7 +10,7 @@
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_main_namemap.hh"
#include "DNA_ID.h"

View File

@ -38,7 +38,7 @@
#include "BKE_lib_override.hh"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_main_namemap.hh"
#include "BKE_node.hh"
#include "BKE_report.h"

View File

@ -26,7 +26,7 @@
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_override.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BLO_readfile.h"

View File

@ -20,7 +20,7 @@
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_node.h"
/* status */

View File

@ -24,7 +24,7 @@
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_mball.h"
#include "BKE_modifier.hh"

View File

@ -20,7 +20,7 @@
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_remap.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_mesh.hh"
#include "BKE_node.hh"
#include "BKE_object.hh"

View File

@ -26,7 +26,7 @@
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_main_namemap.hh"
#include "BKE_packedFile.h"

View File

@ -31,7 +31,7 @@
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_light.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_node.h"
#include "BKE_preview_image.hh"

View File

@ -22,7 +22,7 @@
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_lightprobe.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BLT_translation.h"

View File

@ -33,7 +33,7 @@
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_linestyle.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_node.hh"
#include "BKE_node_tree_update.hh"
#include "BKE_texture.h"

View File

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

View File

@ -16,7 +16,7 @@
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_main_idmap.hh" /* own include */
/** \file

View File

@ -8,7 +8,7 @@
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_main_namemap.hh"
#include "BLI_assert.h"

View File

@ -36,7 +36,7 @@
#include "BKE_image.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_mask.h"
#include "BKE_movieclip.h"
#include "BKE_tracking.h"

View File

@ -59,7 +59,7 @@
#include "BKE_image.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_mesh.hh"
#include "BKE_node.hh"

View File

@ -37,7 +37,7 @@
#include "BLT_translation.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_anim_data.h"
#include "BKE_curve.hh"

View File

@ -52,7 +52,7 @@
#include "BKE_key.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_mesh.hh"
#include "BKE_mesh_legacy_convert.hh"

View File

@ -38,7 +38,7 @@
#include "BKE_key.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_mball.h"
#include "BKE_mesh.hh"

View File

@ -35,7 +35,7 @@
#include "BKE_customdata.hh"
#include "BKE_global.h"
#include "BKE_idprop.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_legacy_convert.hh"
#include "BKE_modifier.hh"

View File

@ -64,7 +64,7 @@
#include "BKE_screen.hh"
/* may move these, only for BKE_modifier_path_relbase */
#include "BKE_main.h"
#include "BKE_main.hh"
/* end */
#include "DEG_depsgraph.hh"

View File

@ -52,7 +52,7 @@
#include "BKE_image.h" /* openanim */
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_movieclip.h"
#include "BKE_node.h"
#include "BKE_node_tree_update.hh"

View File

@ -35,7 +35,7 @@
#include "BKE_global.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_nla.h"
#include "BKE_sound.h"

View File

@ -63,7 +63,7 @@
#include "BKE_image_format.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_node.hh"
#include "BKE_node_runtime.hh"
#include "BKE_node_tree_anonymous_attributes.hh"

View File

@ -19,7 +19,7 @@
#include "BKE_anim_data.h"
#include "BKE_image.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_node.hh"
#include "BKE_node_runtime.hh"
#include "BKE_node_tree_anonymous_attributes.hh"

View File

@ -106,7 +106,7 @@
#include "BKE_light.h"
#include "BKE_lightprobe.h"
#include "BKE_linestyle.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_mball.h"
#include "BKE_mesh.hh"

View File

@ -49,7 +49,7 @@
#include "BKE_idprop.h"
#include "BKE_instances.hh"
#include "BKE_lattice.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_iterators.hh"
#include "BKE_mesh_runtime.hh"

View File

@ -30,7 +30,7 @@
#include "BKE_image.h"
#include "BKE_image_format.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_packedFile.h"
#include "BKE_report.h"
#include "BKE_sound.h"

View File

@ -51,7 +51,7 @@
#include "BKE_key.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_mesh.hh"
#include "BKE_mesh_mapping.hh"
@ -400,7 +400,7 @@ Paint *BKE_paint_get_active_from_paintmode(Scene *sce, ePaintMode mode)
return nullptr;
}
const EnumPropertyItem *BKE_paint_get_tool_enum_from_paintmode(ePaintMode mode)
const EnumPropertyItem *BKE_paint_get_tool_enum_from_paintmode(const ePaintMode mode)
{
switch (mode) {
case PAINT_MODE_SCULPT:
@ -430,7 +430,7 @@ const EnumPropertyItem *BKE_paint_get_tool_enum_from_paintmode(ePaintMode mode)
return nullptr;
}
const char *BKE_paint_get_tool_prop_id_from_paintmode(ePaintMode mode)
const char *BKE_paint_get_tool_prop_id_from_paintmode(const ePaintMode mode)
{
switch (mode) {
case PAINT_MODE_SCULPT:
@ -462,7 +462,7 @@ const char *BKE_paint_get_tool_prop_id_from_paintmode(ePaintMode mode)
return nullptr;
}
const char *BKE_paint_get_tool_enum_translation_context_from_paintmode(ePaintMode mode)
const char *BKE_paint_get_tool_enum_translation_context_from_paintmode(const ePaintMode mode)
{
switch (mode) {
case PAINT_MODE_SCULPT:
@ -1030,26 +1030,26 @@ bool BKE_palette_from_hash(Main *bmain, GHash *color_table, const char *name, co
return done;
}
bool BKE_paint_select_face_test(Object *ob)
bool BKE_paint_select_face_test(const Object *ob)
{
return ((ob != nullptr) && (ob->type == OB_MESH) && (ob->data != nullptr) &&
(((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_FACE_SEL) &&
(ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT)));
}
bool BKE_paint_select_vert_test(Object *ob)
bool BKE_paint_select_vert_test(const Object *ob)
{
return ((ob != nullptr) && (ob->type == OB_MESH) && (ob->data != nullptr) &&
(((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_VERT_SEL) &&
(ob->mode & OB_MODE_WEIGHT_PAINT || ob->mode & OB_MODE_VERTEX_PAINT));
}
bool BKE_paint_select_elem_test(Object *ob)
bool BKE_paint_select_elem_test(const Object *ob)
{
return (BKE_paint_select_vert_test(ob) || BKE_paint_select_face_test(ob));
}
bool BKE_paint_always_hide_test(Object *ob)
bool BKE_paint_always_hide_test(const Object *ob)
{
return ((ob != nullptr) && (ob->type == OB_MESH) && (ob->data != nullptr) &&
(ob->mode & OB_MODE_WEIGHT_PAINT || ob->mode & OB_MODE_VERTEX_PAINT));
@ -1072,7 +1072,7 @@ void BKE_paint_cavity_curve_preset(Paint *p, int preset)
BKE_curvemapping_changed(cumap, false);
}
eObjectMode BKE_paint_object_mode_from_paintmode(ePaintMode mode)
eObjectMode BKE_paint_object_mode_from_paintmode(const ePaintMode mode)
{
switch (mode) {
case PAINT_MODE_SCULPT:
@ -1218,7 +1218,7 @@ void BKE_paint_free(Paint *paint)
MEM_SAFE_FREE(paint->tool_slots);
}
void BKE_paint_copy(Paint *src, Paint *tar, const int flag)
void BKE_paint_copy(const Paint *src, Paint *tar, const int flag)
{
tar->brush = src->brush;
tar->cavity_curve = BKE_curvemapping_copy(src->cavity_curve);
@ -1235,9 +1235,9 @@ void BKE_paint_copy(Paint *src, Paint *tar, const int flag)
}
}
void BKE_paint_stroke_get_average(Scene *scene, Object *ob, float stroke[3])
void BKE_paint_stroke_get_average(const Scene *scene, const Object *ob, float stroke[3])
{
UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
const UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
if (ups->last_stroke_valid && ups->average_stroke_counter > 0) {
float fac = 1.0f / ups->average_stroke_counter;
mul_v3_v3fl(stroke, ups->average_stroke_accum, fac);
@ -1291,7 +1291,7 @@ bool paint_is_grid_face_hidden(const uint *grid_hidden, int gridsize, int x, int
BLI_BITMAP_TEST(grid_hidden, (y + 1) * gridsize + x));
}
bool paint_is_bmesh_face_hidden(BMFace *f)
bool paint_is_bmesh_face_hidden(const BMFace *f)
{
BMLoop *l_iter;
BMLoop *l_first;
@ -1315,7 +1315,7 @@ float paint_grid_paint_mask(const GridPaintMask *gpm, uint level, uint x, uint y
}
/* Threshold to move before updating the brush rotation, reduces jitter. */
static float paint_rake_rotation_spacing(UnifiedPaintSettings * /*ups*/, Brush *brush)
static float paint_rake_rotation_spacing(const UnifiedPaintSettings * /*ups*/, const Brush *brush)
{
return brush->sculpt_tool == SCULPT_TOOL_CLAY_STRIPS ? 1.0f : 20.0f;
}

View File

@ -18,7 +18,7 @@
#include "BKE_brush.hh"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_paint.hh"
/* -------------------------------------------------------------------- */

View File

@ -61,7 +61,7 @@
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_mesh.hh"
#include "BKE_mesh_legacy_convert.hh"

View File

@ -1662,27 +1662,19 @@ static void pbvh_faces_node_visibility_update(const Mesh &mesh, const Span<PBVHN
static void pbvh_grids_node_visibility_update(PBVH *pbvh, const Span<PBVHNode *> nodes)
{
using namespace blender;
CCGKey key = *BKE_pbvh_get_grid_key(pbvh);
const Span<const BLI_bitmap *> grid_hidden = pbvh->subdiv_ccg->grid_hidden;
threading::parallel_for(nodes.index_range(), 1, [&](const IndexRange range) {
for (PBVHNode *node : nodes.slice(range)) {
CCGElem *const *grids;
const int *grid_indices;
int totgrid, i;
BKE_pbvh_node_get_grids(pbvh, node, &grid_indices, &totgrid, nullptr, nullptr, &grids);
const Span<const BLI_bitmap *> grid_hidden = pbvh->subdiv_ccg->grid_hidden;
CCGKey key = *BKE_pbvh_get_grid_key(pbvh);
for (i = 0; i < totgrid; i++) {
int g = grid_indices[i], x, y;
const BLI_bitmap *gh = grid_hidden[g];
for (const int grid_index : BKE_pbvh_node_get_grid_indices(*node)) {
const BLI_bitmap *gh = grid_hidden[grid_index];
if (!gh) {
BKE_pbvh_node_fully_hidden_set(node, false);
return;
}
for (y = 0; y < key.grid_size; y++) {
for (x = 0; x < key.grid_size; x++) {
for (int y = 0; y < key.grid_size; y++) {
for (int x = 0; x < key.grid_size; x++) {
if (!BLI_BITMAP_TEST(gh, y * key.grid_size + x)) {
BKE_pbvh_node_fully_hidden_set(node, false);
return;
@ -2054,51 +2046,9 @@ int BKE_pbvh_node_num_unique_verts(const PBVH &pbvh, const PBVHNode &node)
return 0;
}
void BKE_pbvh_node_get_grids(PBVH *pbvh,
PBVHNode *node,
const int **r_grid_indices,
int *r_totgrid,
int *r_maxgrid,
int *r_gridsize,
CCGElem *const **r_griddata)
Span<int> BKE_pbvh_node_get_grid_indices(const PBVHNode &node)
{
switch (pbvh->header.type) {
case PBVH_GRIDS:
if (r_grid_indices) {
*r_grid_indices = node->prim_indices.data();
}
if (r_totgrid) {
*r_totgrid = node->prim_indices.size();
}
if (r_maxgrid) {
*r_maxgrid = pbvh->subdiv_ccg->grids.size();
}
if (r_gridsize) {
*r_gridsize = pbvh->gridkey.grid_size;
}
if (r_griddata) {
*r_griddata = pbvh->subdiv_ccg->grids.data();
}
break;
case PBVH_FACES:
case PBVH_BMESH:
if (r_grid_indices) {
*r_grid_indices = nullptr;
}
if (r_totgrid) {
*r_totgrid = 0;
}
if (r_maxgrid) {
*r_maxgrid = 0;
}
if (r_gridsize) {
*r_gridsize = 0;
}
if (r_griddata) {
*r_griddata = nullptr;
}
break;
}
return node.prim_indices;
}
void BKE_pbvh_node_get_BB(PBVHNode *node, float bb_min[3], float bb_max[3])
@ -3084,24 +3034,29 @@ void BKE_pbvh_node_color_buffer_free(PBVH *pbvh)
void pbvh_vertex_iter_init(PBVH *pbvh, PBVHNode *node, PBVHVertexIter *vi, int mode)
{
CCGElem *const *grids;
const int *grid_indices;
int totgrid, gridsize, uniq_verts, totvert;
vi->grid = nullptr;
vi->no = nullptr;
vi->fno = nullptr;
vi->vert_positions = {};
vi->vertex.i = 0LL;
BKE_pbvh_node_get_grids(pbvh, node, &grid_indices, &totgrid, nullptr, &gridsize, &grids);
int uniq_verts, totvert;
BKE_pbvh_node_num_verts(pbvh, node, &uniq_verts, &totvert);
vi->key = pbvh->gridkey;
vi->grids = grids;
vi->grid_indices = grid_indices;
vi->totgrid = (grids) ? totgrid : 1;
vi->gridsize = gridsize;
if (pbvh->header.type == PBVH_GRIDS) {
vi->key = pbvh->gridkey;
vi->grids = pbvh->subdiv_ccg->grids.data();
vi->grid_indices = node->prim_indices.data();
vi->totgrid = node->prim_indices.size();
vi->gridsize = pbvh->gridkey.grid_size;
}
else {
vi->key = {};
vi->grids = nullptr;
vi->grid_indices = nullptr;
vi->totgrid = 1;
vi->gridsize = 0;
}
if (mode == PBVH_ITER_ALL) {
vi->totvert = totvert;

View File

@ -52,7 +52,7 @@
#include "BKE_fluid.h"
#include "BKE_global.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_modifier.hh"
#include "BKE_object.hh"
#include "BKE_particle.h"

View File

@ -32,7 +32,7 @@
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_mesh_wrapper.hh"
#include "BKE_modifier.hh"
#include "BKE_object.hh"

View File

@ -40,7 +40,7 @@
#include "BKE_effect.h"
#include "BKE_global.h"
#include "BKE_layer.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_runtime.hh"
#include "BKE_object.hh"

View File

@ -76,7 +76,7 @@
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
#include "BKE_linestyle.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_mask.h"
#include "BKE_node.hh"
#include "BKE_node_runtime.hh"

View File

@ -45,7 +45,7 @@
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_packedFile.h"
#include "BKE_scene.h"
#include "BKE_sound.h"

View File

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

View File

@ -37,7 +37,7 @@
#include "BKE_bpath.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_node.h"
#include "BKE_text.h"

View File

@ -38,7 +38,7 @@
#include "IMB_imbuf.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_anim_data.h"
#include "BKE_colorband.h"

View File

@ -26,7 +26,7 @@
#include "BKE_context.hh"
#include "BKE_global.h"
#include "BKE_lib_override.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_undo_system.h"
#include "RNA_access.hh"

View File

@ -41,7 +41,7 @@
#include "BKE_global.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_object_types.hh"
#include "BKE_packedFile.h"
#include "BKE_vfont.hh"

View File

@ -37,7 +37,7 @@
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.hh"
#include "BKE_main.h"
#include "BKE_main.hh"
#include "BKE_modifier.hh"
#include "BKE_object.hh"
#include "BKE_object_types.hh"

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