Attributes: Integrate implicit sharing with the attribute API #107059
|
@ -108,7 +108,11 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(SYCL
|
||||||
|
|
||||||
IF(SYCL_FOUND)
|
IF(SYCL_FOUND)
|
||||||
SET(SYCL_INCLUDE_DIR ${SYCL_INCLUDE_DIR} ${SYCL_INCLUDE_DIR}/sycl)
|
SET(SYCL_INCLUDE_DIR ${SYCL_INCLUDE_DIR} ${SYCL_INCLUDE_DIR}/sycl)
|
||||||
SET(SYCL_LIBRARIES ${SYCL_LIBRARY})
|
IF(WIN32 AND SYCL_LIBRARY_DEBUG)
|
||||||
|
SET(SYCL_LIBRARIES optimized ${SYCL_LIBRARY} debug ${SYCL_LIBRARY_DEBUG})
|
||||||
|
ELSE()
|
||||||
|
SET(SYCL_LIBRARIES ${SYCL_LIBRARY})
|
||||||
|
ENDIF()
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(SYCL_SYCL_FOUND FALSE)
|
SET(SYCL_SYCL_FOUND FALSE)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
|
@ -450,6 +450,9 @@ void LightManager::device_update_tree(Device *,
|
||||||
* More benchmarking is needed to determine what number works best. */
|
* More benchmarking is needed to determine what number works best. */
|
||||||
LightTree light_tree(scene, dscene, progress, 8);
|
LightTree light_tree(scene, dscene, progress, 8);
|
||||||
LightTreeNode *root = light_tree.build(scene, dscene);
|
LightTreeNode *root = light_tree.build(scene, dscene);
|
||||||
|
if (progress.get_cancel()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* We want to create separate arrays corresponding to triangles and lights,
|
/* We want to create separate arrays corresponding to triangles and lights,
|
||||||
* which will be used to index back into the light tree for PDF calculations. */
|
* which will be used to index back into the light tree for PDF calculations. */
|
||||||
|
|
|
@ -900,12 +900,13 @@ GHOST_TSuccess GHOST_SystemCocoa::getButtons(GHOST_Buttons &buttons) const
|
||||||
|
|
||||||
GHOST_TCapabilityFlag GHOST_SystemCocoa::getCapabilities() const
|
GHOST_TCapabilityFlag GHOST_SystemCocoa::getCapabilities() const
|
||||||
{
|
{
|
||||||
return GHOST_TCapabilityFlag(GHOST_CAPABILITY_FLAG_ALL &
|
return GHOST_TCapabilityFlag(
|
||||||
~(
|
GHOST_CAPABILITY_FLAG_ALL &
|
||||||
/* Cocoa has no support for a primary selection clipboard. */
|
~(
|
||||||
GHOST_kCapabilityPrimaryClipboard |
|
/* Cocoa has no support for a primary selection clipboard. */
|
||||||
/* This Cocoa back-end has not yet implemented image copy/paste. */
|
GHOST_kCapabilityPrimaryClipboard |
|
||||||
GHOST_kCapabilityClipboardImages));
|
/* This Cocoa back-end has not yet implemented image copy/paste. */
|
||||||
|
GHOST_kCapabilityClipboardImages));
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark Event handlers
|
#pragma mark Event handlers
|
||||||
|
|
|
@ -1373,6 +1373,7 @@ url_manual_mapping = (
|
||||||
("bpy.ops.pose.visual_transform_apply*", "animation/armatures/posing/editing/apply.html#bpy-ops-pose-visual-transform-apply"),
|
("bpy.ops.pose.visual_transform_apply*", "animation/armatures/posing/editing/apply.html#bpy-ops-pose-visual-transform-apply"),
|
||||||
("bpy.ops.poselib.convert_old_poselib*", "animation/armatures/posing/editing/pose_library.html#bpy-ops-poselib-convert-old-poselib"),
|
("bpy.ops.poselib.convert_old_poselib*", "animation/armatures/posing/editing/pose_library.html#bpy-ops-poselib-convert-old-poselib"),
|
||||||
("bpy.ops.render.shutter_curve_preset*", "render/cycles/render_settings/motion_blur.html#bpy-ops-render-shutter-curve-preset"),
|
("bpy.ops.render.shutter_curve_preset*", "render/cycles/render_settings/motion_blur.html#bpy-ops-render-shutter-curve-preset"),
|
||||||
|
("bpy.ops.scene.view_layer_remove_aov*", "render/layers/passes.html#bpy-ops-scene-view-layer-remove-aov"),
|
||||||
("bpy.ops.sculpt_curves.select_random*", "sculpt_paint/curves_sculpting/introduction.html#bpy-ops-sculpt-curves-select-random"),
|
("bpy.ops.sculpt_curves.select_random*", "sculpt_paint/curves_sculpting/introduction.html#bpy-ops-sculpt-curves-select-random"),
|
||||||
("bpy.ops.sequencer.view_ghost_border*", "editors/video_sequencer/preview/sidebar.html#bpy-ops-sequencer-view-ghost-border"),
|
("bpy.ops.sequencer.view_ghost_border*", "editors/video_sequencer/preview/sidebar.html#bpy-ops-sequencer-view-ghost-border"),
|
||||||
("bpy.ops.ui.override_idtemplate_make*", "files/linked_libraries/library_overrides.html#bpy-ops-ui-override-idtemplate-make"),
|
("bpy.ops.ui.override_idtemplate_make*", "files/linked_libraries/library_overrides.html#bpy-ops-ui-override-idtemplate-make"),
|
||||||
|
@ -1774,9 +1775,11 @@ url_manual_mapping = (
|
||||||
("bpy.ops.outliner.collection_hide*", "editors/outliner/editing.html#bpy-ops-outliner-collection-hide"),
|
("bpy.ops.outliner.collection_hide*", "editors/outliner/editing.html#bpy-ops-outliner-collection-hide"),
|
||||||
("bpy.ops.outliner.collection_show*", "editors/outliner/editing.html#bpy-ops-outliner-collection-show"),
|
("bpy.ops.outliner.collection_show*", "editors/outliner/editing.html#bpy-ops-outliner-collection-show"),
|
||||||
("bpy.ops.paint.mask_lasso_gesture*", "sculpt_paint/sculpting/editing/mask.html#bpy-ops-paint-mask-lasso-gesture"),
|
("bpy.ops.paint.mask_lasso_gesture*", "sculpt_paint/sculpting/editing/mask.html#bpy-ops-paint-mask-lasso-gesture"),
|
||||||
|
("bpy.ops.paint.vert_select_linked*", "sculpt_paint/selection_visibility.html#bpy-ops-paint-vert-select-linked"),
|
||||||
("bpy.ops.poselib.apply_pose_asset*", "animation/armatures/posing/editing/pose_library.html#bpy-ops-poselib-apply-pose-asset"),
|
("bpy.ops.poselib.apply_pose_asset*", "animation/armatures/posing/editing/pose_library.html#bpy-ops-poselib-apply-pose-asset"),
|
||||||
("bpy.ops.poselib.blend_pose_asset*", "animation/armatures/posing/editing/pose_library.html#bpy-ops-poselib-blend-pose-asset"),
|
("bpy.ops.poselib.blend_pose_asset*", "animation/armatures/posing/editing/pose_library.html#bpy-ops-poselib-blend-pose-asset"),
|
||||||
("bpy.ops.rigidbody.mass_calculate*", "scene_layout/object/editing/rigid_body.html#bpy-ops-rigidbody-mass-calculate"),
|
("bpy.ops.rigidbody.mass_calculate*", "scene_layout/object/editing/rigid_body.html#bpy-ops-rigidbody-mass-calculate"),
|
||||||
|
("bpy.ops.scene.view_layer_add_aov*", "render/layers/passes.html#bpy-ops-scene-view-layer-add-aov"),
|
||||||
("bpy.ops.screen.spacedata_cleanup*", "advanced/operators.html#bpy-ops-screen-spacedata-cleanup"),
|
("bpy.ops.screen.spacedata_cleanup*", "advanced/operators.html#bpy-ops-screen-spacedata-cleanup"),
|
||||||
("bpy.ops.sculpt.detail_flood_fill*", "sculpt_paint/sculpting/tool_settings/dyntopo.html#bpy-ops-sculpt-detail-flood-fill"),
|
("bpy.ops.sculpt.detail_flood_fill*", "sculpt_paint/sculpting/tool_settings/dyntopo.html#bpy-ops-sculpt-detail-flood-fill"),
|
||||||
("bpy.ops.sculpt_curves.select_end*", "sculpt_paint/curves_sculpting/introduction.html#bpy-ops-sculpt-curves-select-end"),
|
("bpy.ops.sculpt_curves.select_end*", "sculpt_paint/curves_sculpting/introduction.html#bpy-ops-sculpt-curves-select-end"),
|
||||||
|
@ -1934,6 +1937,7 @@ url_manual_mapping = (
|
||||||
("bpy.ops.object.shape_key_remove*", "animation/shape_keys/shape_keys_panel.html#bpy-ops-object-shape-key-remove"),
|
("bpy.ops.object.shape_key_remove*", "animation/shape_keys/shape_keys_panel.html#bpy-ops-object-shape-key-remove"),
|
||||||
("bpy.ops.object.shape_key_retime*", "animation/shape_keys/shape_keys_panel.html#bpy-ops-object-shape-key-retime"),
|
("bpy.ops.object.shape_key_retime*", "animation/shape_keys/shape_keys_panel.html#bpy-ops-object-shape-key-retime"),
|
||||||
("bpy.ops.object.vertex_group_add*", "modeling/meshes/properties/vertex_groups/vertex_groups.html#bpy-ops-object-vertex-group-add"),
|
("bpy.ops.object.vertex_group_add*", "modeling/meshes/properties/vertex_groups/vertex_groups.html#bpy-ops-object-vertex-group-add"),
|
||||||
|
("bpy.ops.object.vertex_group_fix*", "sculpt_paint/weight_paint/editing.html#bpy-ops-object-vertex-group-fix"),
|
||||||
("bpy.ops.outliner.collection_new*", "editors/outliner/editing.html#bpy-ops-outliner-collection-new"),
|
("bpy.ops.outliner.collection_new*", "editors/outliner/editing.html#bpy-ops-outliner-collection-new"),
|
||||||
("bpy.ops.outliner.show_hierarchy*", "editors/outliner/editing.html#bpy-ops-outliner-show-hierarchy"),
|
("bpy.ops.outliner.show_hierarchy*", "editors/outliner/editing.html#bpy-ops-outliner-show-hierarchy"),
|
||||||
("bpy.ops.outliner.show_one_level*", "editors/outliner/editing.html#bpy-ops-outliner-show-one-level"),
|
("bpy.ops.outliner.show_one_level*", "editors/outliner/editing.html#bpy-ops-outliner-show-one-level"),
|
||||||
|
@ -2083,7 +2087,6 @@ url_manual_mapping = (
|
||||||
("bpy.ops.screen.region_quadview*", "editors/3dview/navigate/views.html#bpy-ops-screen-region-quadview"),
|
("bpy.ops.screen.region_quadview*", "editors/3dview/navigate/views.html#bpy-ops-screen-region-quadview"),
|
||||||
("bpy.ops.screen.screenshot_area*", "interface/window_system/topbar.html#bpy-ops-screen-screenshot-area"),
|
("bpy.ops.screen.screenshot_area*", "interface/window_system/topbar.html#bpy-ops-screen-screenshot-area"),
|
||||||
("bpy.ops.screen.workspace_cycle*", "interface/window_system/workspaces.html#bpy-ops-screen-workspace-cycle"),
|
("bpy.ops.screen.workspace_cycle*", "interface/window_system/workspaces.html#bpy-ops-screen-workspace-cycle"),
|
||||||
("bpy.ops.sequencer.change_scene*", "video_editing/edit/montage/editing.html#bpy-ops-sequencer-change-scene"),
|
|
||||||
("bpy.ops.sequencer.offset_clear*", "video_editing/edit/montage/editing.html#bpy-ops-sequencer-offset-clear"),
|
("bpy.ops.sequencer.offset_clear*", "video_editing/edit/montage/editing.html#bpy-ops-sequencer-offset-clear"),
|
||||||
("bpy.ops.spreadsheet.toggle_pin*", "editors/spreadsheet.html#bpy-ops-spreadsheet-toggle-pin"),
|
("bpy.ops.spreadsheet.toggle_pin*", "editors/spreadsheet.html#bpy-ops-spreadsheet-toggle-pin"),
|
||||||
("bpy.ops.uv.follow_active_quads*", "modeling/meshes/editing/uv.html#bpy-ops-uv-follow-active-quads"),
|
("bpy.ops.uv.follow_active_quads*", "modeling/meshes/editing/uv.html#bpy-ops-uv-follow-active-quads"),
|
||||||
|
|
|
@ -464,18 +464,27 @@ struct ID *BKE_id_copy_for_use_in_bmain(struct Main *bmain, const struct ID *id)
|
||||||
* Does a mere memory swap over the whole IDs data (including type-specific memory).
|
* Does a mere memory swap over the whole IDs data (including type-specific memory).
|
||||||
* \note Most internal ID data itself is not swapped (only IDProperties are).
|
* \note Most internal ID data itself is not swapped (only IDProperties are).
|
||||||
*
|
*
|
||||||
* \param bmain: May be NULL, in which case there will be no remapping of internal pointers to
|
* \param bmain: May be NULL, in which case there is no guarantee that internal remapping of ID
|
||||||
* itself.
|
* pointers to themselves will be complete (reguarding depsgraph and/or runtime data updates).
|
||||||
|
* \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.h.
|
||||||
*/
|
*/
|
||||||
void BKE_lib_id_swap(struct Main *bmain, struct ID *id_a, struct ID *id_b);
|
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);
|
||||||
/**
|
/**
|
||||||
* Does a mere memory swap over the whole IDs data (including type-specific memory).
|
* Does a mere memory swap over the whole IDs data (including type-specific memory).
|
||||||
* \note All internal ID data itself is also swapped.
|
* \note All internal ID data itself is also swapped.
|
||||||
*
|
*
|
||||||
* \param bmain: May be NULL, in which case there will be no remapping of internal pointers to
|
* For parameters description, see #BKE_lib_id_swap above.
|
||||||
* itself.
|
|
||||||
*/
|
*/
|
||||||
void BKE_lib_id_swap_full(struct Main *bmain, struct ID *id_a, struct ID *id_b);
|
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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sort given \a id into given \a lb list, using case-insensitive comparison of the id names.
|
* Sort given \a id into given \a lb list, using case-insensitive comparison of the id names.
|
||||||
|
|
|
@ -88,6 +88,23 @@ struct WorkSpaceLayout *BKE_workspace_layout_iter_circular(
|
||||||
void BKE_workspace_tool_remove(struct WorkSpace *workspace, struct bToolRef *tref)
|
void BKE_workspace_tool_remove(struct WorkSpace *workspace, struct bToolRef *tref)
|
||||||
ATTR_NONNULL(1, 2);
|
ATTR_NONNULL(1, 2);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replace tools ID's, intended for use in versioning code.
|
||||||
|
* \param space_type: The space-type to match #bToolRef::space_type.
|
||||||
|
* \param mode: The space-type to match #bToolRef::mode.
|
||||||
|
* \param idname_prefix_skip: Ignore when NULL, otherwise only operate
|
||||||
|
* on tools that have this text as the #bToolRef::idname prefix, which is skipped before
|
||||||
|
* the replacement runs. This avoids having to duplicate a common prefix in the replacement text.
|
||||||
|
* \param replace_table: An array of (source, destination) pairs.
|
||||||
|
* \param replace_table_num: The number of items in `replace_table`.
|
||||||
|
*/
|
||||||
|
void BKE_workspace_tool_id_replace_table(struct WorkSpace *workspace,
|
||||||
|
const int space_type,
|
||||||
|
const int mode,
|
||||||
|
const char *idname_prefix_skip,
|
||||||
|
const char *replace_table[][2],
|
||||||
|
int replace_table_num) ATTR_NONNULL(1, 5);
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
|
|
|
@ -416,7 +416,7 @@ static int brush_undo_preserve_cb(LibraryIDLinkCallbackData *cb_data)
|
||||||
static void brush_undo_preserve(BlendLibReader *reader, ID *id_new, ID *id_old)
|
static void brush_undo_preserve(BlendLibReader *reader, ID *id_new, ID *id_old)
|
||||||
{
|
{
|
||||||
/* Whole Brush is preserved across undo-steps. */
|
/* Whole Brush is preserved across undo-steps. */
|
||||||
BKE_lib_id_swap(nullptr, id_new, id_old);
|
BKE_lib_id_swap(nullptr, id_new, id_old, false, 0);
|
||||||
|
|
||||||
/* `id_new` now has content from `id_old`, we need to ensure those old ID pointers are valid.
|
/* `id_new` now has content from `id_old`, we need to ensure those old ID pointers are valid.
|
||||||
* NOTE: Since we want to re-use all old pointers here, code is much simpler than for Scene. */
|
* NOTE: Since we want to re-use all old pointers here, code is much simpler than for Scene. */
|
||||||
|
|
|
@ -765,14 +765,38 @@ ID *BKE_id_copy_for_use_in_bmain(Main *bmain, const ID *id)
|
||||||
return newid;
|
return newid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void id_embedded_swap(ID **embedded_id_a,
|
||||||
|
ID **embedded_id_b,
|
||||||
|
const bool do_full_id,
|
||||||
|
struct IDRemapper *remapper_id_a,
|
||||||
|
struct IDRemapper *remapper_id_b);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does a mere memory swap over the whole IDs data (including type-specific memory).
|
* Does a mere memory swap over the whole IDs data (including type-specific memory).
|
||||||
* \note Most internal ID data itself is not swapped (only IDProperties are).
|
* \note Most internal ID data itself is not swapped (only IDProperties are).
|
||||||
*/
|
*/
|
||||||
static void id_swap(Main *bmain, ID *id_a, ID *id_b, const bool do_full_id)
|
static void id_swap(Main *bmain,
|
||||||
|
ID *id_a,
|
||||||
|
ID *id_b,
|
||||||
|
const bool do_full_id,
|
||||||
|
const bool do_self_remap,
|
||||||
|
struct IDRemapper *input_remapper_id_a,
|
||||||
|
struct IDRemapper *input_remapper_id_b,
|
||||||
|
const int self_remap_flags)
|
||||||
{
|
{
|
||||||
BLI_assert(GS(id_a->name) == GS(id_b->name));
|
BLI_assert(GS(id_a->name) == GS(id_b->name));
|
||||||
|
|
||||||
|
struct IDRemapper *remapper_id_a = input_remapper_id_a;
|
||||||
|
struct IDRemapper *remapper_id_b = input_remapper_id_b;
|
||||||
|
if (do_self_remap) {
|
||||||
|
if (remapper_id_a == NULL) {
|
||||||
|
remapper_id_a = BKE_id_remapper_create();
|
||||||
|
}
|
||||||
|
if (remapper_id_b == NULL) {
|
||||||
|
remapper_id_b = BKE_id_remapper_create();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const IDTypeInfo *id_type = BKE_idtype_get_info_from_id(id_a);
|
const IDTypeInfo *id_type = BKE_idtype_get_info_from_id(id_a);
|
||||||
BLI_assert(id_type != NULL);
|
BLI_assert(id_type != NULL);
|
||||||
const size_t id_struct_size = id_type->struct_size;
|
const size_t id_struct_size = id_type->struct_size;
|
||||||
|
@ -799,21 +823,87 @@ static void id_swap(Main *bmain, ID *id_a, ID *id_b, const bool do_full_id)
|
||||||
id_b->recalc = id_a_back.recalc;
|
id_b->recalc = id_a_back.recalc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bmain != NULL) {
|
id_embedded_swap((ID **)BKE_ntree_ptr_from_id(id_a),
|
||||||
/* Swap will have broken internal references to itself, restore them. */
|
(ID **)BKE_ntree_ptr_from_id(id_b),
|
||||||
BKE_libblock_relink_ex(bmain, id_a, id_b, id_a, ID_REMAP_SKIP_NEVER_NULL_USAGE);
|
do_full_id,
|
||||||
BKE_libblock_relink_ex(bmain, id_b, id_a, id_b, ID_REMAP_SKIP_NEVER_NULL_USAGE);
|
remapper_id_a,
|
||||||
|
remapper_id_b);
|
||||||
|
if (GS(id_a->name) == ID_SCE) {
|
||||||
|
Scene *scene_a = (Scene *)id_a;
|
||||||
|
Scene *scene_b = (Scene *)id_b;
|
||||||
|
id_embedded_swap((ID **)&scene_a->master_collection,
|
||||||
|
(ID **)&scene_b->master_collection,
|
||||||
|
do_full_id,
|
||||||
|
remapper_id_a,
|
||||||
|
remapper_id_b);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (remapper_id_a != NULL) {
|
||||||
|
BKE_id_remapper_add(remapper_id_a, id_b, id_a);
|
||||||
|
}
|
||||||
|
if (remapper_id_b != NULL) {
|
||||||
|
BKE_id_remapper_add(remapper_id_b, id_a, id_b);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Finalize remapping of internal referrences to self broken by swapping, if requested. */
|
||||||
|
if (do_self_remap) {
|
||||||
|
LinkNode ids = {.next = NULL, .link = id_a};
|
||||||
|
BKE_libblock_relink_multiple(
|
||||||
|
bmain, &ids, ID_REMAP_TYPE_REMAP, remapper_id_a, self_remap_flags);
|
||||||
|
ids.link = id_b;
|
||||||
|
BKE_libblock_relink_multiple(
|
||||||
|
bmain, &ids, ID_REMAP_TYPE_REMAP, remapper_id_b, self_remap_flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (input_remapper_id_a == NULL && remapper_id_a != NULL) {
|
||||||
|
BKE_id_remapper_free(remapper_id_a);
|
||||||
|
}
|
||||||
|
if (input_remapper_id_b == NULL && remapper_id_b != NULL) {
|
||||||
|
BKE_id_remapper_free(remapper_id_b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BKE_lib_id_swap(Main *bmain, ID *id_a, ID *id_b)
|
/* Conceptually, embedded IDs are part of their owner's data. However, some parts of the code
|
||||||
|
* (like e.g. the depsgraph) may treat them as independant IDs, so swapping them here and
|
||||||
|
* switching their pointers in the owner IDs allows to help not break cached relationships and
|
||||||
|
* such (by preserving the pointer values). */
|
||||||
|
static void id_embedded_swap(ID **embedded_id_a,
|
||||||
|
ID **embedded_id_b,
|
||||||
|
const bool do_full_id,
|
||||||
|
struct IDRemapper *remapper_id_a,
|
||||||
|
struct IDRemapper *remapper_id_b)
|
||||||
{
|
{
|
||||||
id_swap(bmain, id_a, id_b, false);
|
if (embedded_id_a != NULL && *embedded_id_a != NULL) {
|
||||||
|
BLI_assert(embedded_id_b != NULL && *embedded_id_b != NULL);
|
||||||
|
|
||||||
|
/* Do not remap internal references to itself here, since embedded IDs pointers also need to be
|
||||||
|
* potentially remapped in owner ID's data, which will also handle embedded IDs data. */
|
||||||
|
id_swap(
|
||||||
|
NULL, *embedded_id_a, *embedded_id_b, do_full_id, false, remapper_id_a, remapper_id_b, 0);
|
||||||
|
/* Manual 'remap' of owning embedded pointer in owner ID. */
|
||||||
|
SWAP(ID *, *embedded_id_a, *embedded_id_b);
|
||||||
|
|
||||||
|
/* Restore internal pointers to the swapped embedded IDs in their owners' data. This also
|
||||||
|
* includes the potential self-references inside the embedded IDs themselves. */
|
||||||
|
if (remapper_id_a != NULL) {
|
||||||
|
BKE_id_remapper_add(remapper_id_a, *embedded_id_b, *embedded_id_a);
|
||||||
|
}
|
||||||
|
if (remapper_id_b != NULL) {
|
||||||
|
BKE_id_remapper_add(remapper_id_b, *embedded_id_a, *embedded_id_b);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BKE_lib_id_swap_full(Main *bmain, ID *id_a, ID *id_b)
|
void BKE_lib_id_swap(
|
||||||
|
Main *bmain, ID *id_a, ID *id_b, const bool do_self_remap, const int self_remap_flags)
|
||||||
{
|
{
|
||||||
id_swap(bmain, id_a, id_b, true);
|
id_swap(bmain, id_a, id_b, false, do_self_remap, NULL, NULL, 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)
|
||||||
|
{
|
||||||
|
id_swap(bmain, id_a, id_b, true, do_self_remap, NULL, NULL, self_remap_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool id_single_user(bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop)
|
bool id_single_user(bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop)
|
||||||
|
|
|
@ -3784,7 +3784,7 @@ void BKE_lib_override_library_main_unused_cleanup(Main *bmain)
|
||||||
|
|
||||||
static void lib_override_id_swap(Main *bmain, ID *id_local, ID *id_temp)
|
static void lib_override_id_swap(Main *bmain, ID *id_local, ID *id_temp)
|
||||||
{
|
{
|
||||||
BKE_lib_id_swap(bmain, id_local, id_temp);
|
BKE_lib_id_swap(bmain, id_local, id_temp, true, 0);
|
||||||
/* We need to keep these tags from temp ID into orig one.
|
/* We need to keep these tags from temp ID into orig one.
|
||||||
* ID swap does not swap most of ID data itself. */
|
* ID swap does not swap most of ID data itself. */
|
||||||
id_local->tag |= (id_temp->tag & LIB_TAG_LIB_OVERRIDE_NEED_RESYNC);
|
id_local->tag |= (id_temp->tag & LIB_TAG_LIB_OVERRIDE_NEED_RESYNC);
|
||||||
|
|
|
@ -130,7 +130,7 @@ static void palette_undo_preserve(BlendLibReader * /*reader*/, ID *id_new, ID *i
|
||||||
/* NOTE: We do not care about potential internal references to self here, Palette has none. */
|
/* NOTE: We do not care about potential internal references to self here, Palette has none. */
|
||||||
/* NOTE: We do not swap IDProperties, as dealing with potential ID pointers in those would be
|
/* NOTE: We do not swap IDProperties, as dealing with potential ID pointers in those would be
|
||||||
* fairly delicate. */
|
* fairly delicate. */
|
||||||
BKE_lib_id_swap(nullptr, id_new, id_old);
|
BKE_lib_id_swap(nullptr, id_new, id_old, false, 0);
|
||||||
std::swap(id_new->properties, id_old->properties);
|
std::swap(id_new->properties, id_old->properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -511,6 +511,32 @@ void BKE_workspace_tool_remove(struct WorkSpace *workspace, struct bToolRef *tre
|
||||||
MEM_freeN(tref);
|
MEM_freeN(tref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BKE_workspace_tool_id_replace_table(struct WorkSpace *workspace,
|
||||||
|
const int space_type,
|
||||||
|
const int mode,
|
||||||
|
const char *idname_prefix_skip,
|
||||||
|
const char *replace_table[][2],
|
||||||
|
int replace_table_num)
|
||||||
|
{
|
||||||
|
const size_t idname_prefix_len = idname_prefix_skip ? strlen(idname_prefix_skip) : 0;
|
||||||
|
const size_t idname_suffix_len = sizeof(((bToolRef *)nullptr)->idname) - idname_prefix_len;
|
||||||
|
|
||||||
|
LISTBASE_FOREACH (bToolRef *, tref, &workspace->tools) {
|
||||||
|
if (!(tref->space_type == space_type && tref->mode == mode)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
char *idname_suffix = tref->idname;
|
||||||
|
if (idname_prefix_skip) {
|
||||||
|
if (!STRPREFIX(idname_suffix, idname_prefix_skip)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
idname_suffix += idname_prefix_len;
|
||||||
|
}
|
||||||
|
BLI_str_replace_table_exact(
|
||||||
|
idname_suffix, idname_suffix_len, replace_table, replace_table_num);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool BKE_workspace_owner_id_check(const WorkSpace *workspace, const char *owner_id)
|
bool BKE_workspace_owner_id_check(const WorkSpace *workspace, const char *owner_id)
|
||||||
{
|
{
|
||||||
if ((*owner_id == '\0') || ((workspace->flags & WORKSPACE_USE_FILTER_BY_ORIGIN) == 0)) {
|
if ((*owner_id == '\0') || ((workspace->flags & WORKSPACE_USE_FILTER_BY_ORIGIN) == 0)) {
|
||||||
|
|
|
@ -72,6 +72,7 @@
|
||||||
#include "BKE_lib_id.h"
|
#include "BKE_lib_id.h"
|
||||||
#include "BKE_lib_override.h"
|
#include "BKE_lib_override.h"
|
||||||
#include "BKE_lib_query.h"
|
#include "BKE_lib_query.h"
|
||||||
|
#include "BKE_lib_remap.h"
|
||||||
#include "BKE_main.h" /* for Main */
|
#include "BKE_main.h" /* for Main */
|
||||||
#include "BKE_main_idmap.h"
|
#include "BKE_main_idmap.h"
|
||||||
#include "BKE_material.h"
|
#include "BKE_material.h"
|
||||||
|
@ -3095,10 +3096,17 @@ static void read_libblock_undo_restore_at_old_address(FileData *fd, Main *main,
|
||||||
BLI_remlink(old_lb, id_old);
|
BLI_remlink(old_lb, id_old);
|
||||||
BLI_remlink(new_lb, id);
|
BLI_remlink(new_lb, id);
|
||||||
|
|
||||||
/* We do not need any remapping from this call here, since no ID pointer is valid in the data
|
/* We do need remapping of internal pointers to the ID itself here.
|
||||||
* currently (they are all pointing to old addresses, and need to go through `lib_link`
|
*
|
||||||
* process). So we can pass nullptr for the Main pointer parameter. */
|
* Passing a NULL BMain means that not all potential runtime data (like collections' parent
|
||||||
BKE_lib_id_swap_full(nullptr, id, id_old);
|
* pointers etc.) will be up-to-date. However, this should not be a problem here, since these
|
||||||
|
* data are re-generated later in fileread process anyway.. */
|
||||||
|
BKE_lib_id_swap_full(nullptr,
|
||||||
|
id,
|
||||||
|
id_old,
|
||||||
|
true,
|
||||||
|
ID_REMAP_SKIP_NEVER_NULL_USAGE | ID_REMAP_SKIP_UPDATE_TAGGING |
|
||||||
|
ID_REMAP_SKIP_USER_REFCOUNT);
|
||||||
|
|
||||||
/* Special temporary usage of this pointer, necessary for the `undo_preserve` call after
|
/* Special temporary usage of this pointer, necessary for the `undo_preserve` call after
|
||||||
* lib-linking to restore some data that should never be affected by undo, e.g. the 3D cursor of
|
* lib-linking to restore some data that should never be affected by undo, e.g. the 3D cursor of
|
||||||
|
@ -3126,10 +3134,8 @@ static bool read_libblock_undo_restore(
|
||||||
else if (id_type->flags & IDTYPE_FLAGS_NO_MEMFILE_UNDO) {
|
else if (id_type->flags & IDTYPE_FLAGS_NO_MEMFILE_UNDO) {
|
||||||
/* Skip reading any 'no undo' datablocks (typically UI-like ones), existing ones are kept.
|
/* Skip reading any 'no undo' datablocks (typically UI-like ones), existing ones are kept.
|
||||||
* See `setup_app_data` for details. */
|
* See `setup_app_data` for details. */
|
||||||
CLOG_INFO(&LOG_UNDO,
|
CLOG_INFO(
|
||||||
2,
|
&LOG_UNDO, 2, "UNDO: skip restore datablock %s, 'NO_MEMFILE_UNDO' type of ID", id->name);
|
||||||
"UNDO: skip restore datablock %s, 'NO_MEMFILE_UNDO' type of ID",
|
|
||||||
id->name);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (bhead->code == ID_LINK_PLACEHOLDER) {
|
else if (bhead->code == ID_LINK_PLACEHOLDER) {
|
||||||
|
|
|
@ -67,6 +67,7 @@
|
||||||
#include "BKE_modifier.h"
|
#include "BKE_modifier.h"
|
||||||
#include "BKE_node.h"
|
#include "BKE_node.h"
|
||||||
#include "BKE_screen.h"
|
#include "BKE_screen.h"
|
||||||
|
#include "BKE_workspace.h"
|
||||||
|
|
||||||
#include "RNA_access.h"
|
#include "RNA_access.h"
|
||||||
#include "RNA_enum_types.h"
|
#include "RNA_enum_types.h"
|
||||||
|
@ -4280,6 +4281,29 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Replace old hard coded names with brush names, see: #106057. */
|
||||||
|
const char *tool_replace_table[][2] = {
|
||||||
|
{"selection_paint", "Paint Selection"},
|
||||||
|
{"add", "Add"},
|
||||||
|
{"delete", "Delete"},
|
||||||
|
{"density", "Density"},
|
||||||
|
{"comb", "Comb"},
|
||||||
|
{"snake_hook", "Snake Hook"},
|
||||||
|
{"grow_shrink", "Grow / Shrink"},
|
||||||
|
{"pinch", "Pinch"},
|
||||||
|
{"puff", "Puff"},
|
||||||
|
{"smooth", "Comb"},
|
||||||
|
{"slide", "Slide"},
|
||||||
|
};
|
||||||
|
LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspaces) {
|
||||||
|
BKE_workspace_tool_id_replace_table(workspace,
|
||||||
|
SPACE_VIEW3D,
|
||||||
|
CTX_MODE_SCULPT_CURVES,
|
||||||
|
"builtin_brush.",
|
||||||
|
tool_replace_table,
|
||||||
|
ARRAY_SIZE(tool_replace_table));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,8 +42,9 @@ int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
|
||||||
effects->blit_texel_size[0] = 1.0f / (float)blitsize[0];
|
effects->blit_texel_size[0] = 1.0f / (float)blitsize[0];
|
||||||
effects->blit_texel_size[1] = 1.0f / (float)blitsize[1];
|
effects->blit_texel_size[1] = 1.0f / (float)blitsize[1];
|
||||||
|
|
||||||
effects->bloom_blit = DRW_texture_pool_query_2d(
|
eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT;
|
||||||
blitsize[0], blitsize[1], GPU_R11F_G11F_B10F, &draw_engine_eevee_type);
|
effects->bloom_blit = DRW_texture_pool_query_2d_ex(
|
||||||
|
blitsize[0], blitsize[1], GPU_R11F_G11F_B10F, usage, &draw_engine_eevee_type);
|
||||||
|
|
||||||
GPU_framebuffer_ensure_config(
|
GPU_framebuffer_ensure_config(
|
||||||
&fbl->bloom_blit_fb, {GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(effects->bloom_blit)});
|
&fbl->bloom_blit_fb, {GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(effects->bloom_blit)});
|
||||||
|
@ -83,8 +84,11 @@ int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
|
||||||
effects->downsamp_texel_size[i][0] = 1.0f / (float)texsize[0];
|
effects->downsamp_texel_size[i][0] = 1.0f / (float)texsize[0];
|
||||||
effects->downsamp_texel_size[i][1] = 1.0f / (float)texsize[1];
|
effects->downsamp_texel_size[i][1] = 1.0f / (float)texsize[1];
|
||||||
|
|
||||||
effects->bloom_downsample[i] = DRW_texture_pool_query_2d(
|
eGPUTextureUsage downsample_usage = GPU_TEXTURE_USAGE_SHADER_READ |
|
||||||
texsize[0], texsize[1], GPU_R11F_G11F_B10F, &draw_engine_eevee_type);
|
GPU_TEXTURE_USAGE_ATTACHMENT |
|
||||||
|
GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW;
|
||||||
|
effects->bloom_downsample[i] = DRW_texture_pool_query_2d_ex(
|
||||||
|
texsize[0], texsize[1], GPU_R11F_G11F_B10F, downsample_usage, &draw_engine_eevee_type);
|
||||||
GPU_framebuffer_ensure_config(
|
GPU_framebuffer_ensure_config(
|
||||||
&fbl->bloom_down_fb[i],
|
&fbl->bloom_down_fb[i],
|
||||||
{GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(effects->bloom_downsample[i])});
|
{GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(effects->bloom_downsample[i])});
|
||||||
|
@ -99,8 +103,12 @@ int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
|
||||||
texsize[0] = MAX2(texsize[0], 2);
|
texsize[0] = MAX2(texsize[0], 2);
|
||||||
texsize[1] = MAX2(texsize[1], 2);
|
texsize[1] = MAX2(texsize[1], 2);
|
||||||
|
|
||||||
effects->bloom_upsample[i] = DRW_texture_pool_query_2d(
|
eGPUTextureUsage upsample_usage = GPU_TEXTURE_USAGE_SHADER_READ |
|
||||||
texsize[0], texsize[1], GPU_R11F_G11F_B10F, &draw_engine_eevee_type);
|
GPU_TEXTURE_USAGE_ATTACHMENT |
|
||||||
|
GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW;
|
||||||
|
|
||||||
|
effects->bloom_upsample[i] = DRW_texture_pool_query_2d_ex(
|
||||||
|
texsize[0], texsize[1], GPU_R11F_G11F_B10F, upsample_usage, &draw_engine_eevee_type);
|
||||||
GPU_framebuffer_ensure_config(
|
GPU_framebuffer_ensure_config(
|
||||||
&fbl->bloom_accum_fb[i],
|
&fbl->bloom_accum_fb[i],
|
||||||
{GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(effects->bloom_upsample[i])});
|
{GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(effects->bloom_upsample[i])});
|
||||||
|
|
|
@ -576,7 +576,8 @@ static void dof_reduce_pass_init(EEVEE_FramebufferList *fbl,
|
||||||
DRW_shgroup_call_procedural_triangles(grp, NULL, 1);
|
DRW_shgroup_call_procedural_triangles(grp, NULL, 1);
|
||||||
|
|
||||||
void *owner = (void *)&EEVEE_depth_of_field_init;
|
void *owner = (void *)&EEVEE_depth_of_field_init;
|
||||||
eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT;
|
eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT |
|
||||||
|
GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW;
|
||||||
fx->dof_downsample_tx = DRW_texture_pool_query_2d_ex(
|
fx->dof_downsample_tx = DRW_texture_pool_query_2d_ex(
|
||||||
UNPACK2(quater_res), COLOR_FORMAT, usage, owner);
|
UNPACK2(quater_res), COLOR_FORMAT, usage, owner);
|
||||||
|
|
||||||
|
|
|
@ -118,8 +118,13 @@ void EEVEE_effects_init(EEVEE_ViewLayerData *sldata,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DRW_texture_ensure_2d(
|
eGPUTextureUsage usage = GPU_TEXTURE_USAGE_ATTACHMENT | GPU_TEXTURE_USAGE_SHADER_READ |
|
||||||
&txl->maxzbuffer, UNPACK2(effects->hiz_size), GPU_DEPTH_COMPONENT24, DRW_TEX_MIPMAP);
|
GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW;
|
||||||
|
DRW_texture_ensure_2d_ex(&txl->maxzbuffer,
|
||||||
|
UNPACK2(effects->hiz_size),
|
||||||
|
GPU_DEPTH_COMPONENT24,
|
||||||
|
usage,
|
||||||
|
DRW_TEX_MIPMAP);
|
||||||
GPU_framebuffer_ensure_config(&fbl->maxzbuffer_fb,
|
GPU_framebuffer_ensure_config(&fbl->maxzbuffer_fb,
|
||||||
{
|
{
|
||||||
GPU_ATTACHMENT_TEXTURE(txl->maxzbuffer),
|
GPU_ATTACHMENT_TEXTURE(txl->maxzbuffer),
|
||||||
|
@ -146,10 +151,13 @@ void EEVEE_effects_init(EEVEE_ViewLayerData *sldata,
|
||||||
* Used for SSReflections & SSRefractions.
|
* Used for SSReflections & SSRefractions.
|
||||||
*/
|
*/
|
||||||
if ((effects->enabled_effects & EFFECT_RADIANCE_BUFFER) != 0) {
|
if ((effects->enabled_effects & EFFECT_RADIANCE_BUFFER) != 0) {
|
||||||
DRW_texture_ensure_2d(&txl->filtered_radiance,
|
eGPUTextureUsage usage = GPU_TEXTURE_USAGE_ATTACHMENT | GPU_TEXTURE_USAGE_SHADER_READ |
|
||||||
UNPACK2(effects->hiz_size),
|
GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW;
|
||||||
GPU_R11F_G11F_B10F,
|
DRW_texture_ensure_2d_ex(&txl->filtered_radiance,
|
||||||
DRW_TEX_FILTER | DRW_TEX_MIPMAP);
|
UNPACK2(effects->hiz_size),
|
||||||
|
GPU_R11F_G11F_B10F,
|
||||||
|
usage,
|
||||||
|
DRW_TEX_FILTER | DRW_TEX_MIPMAP);
|
||||||
|
|
||||||
GPU_framebuffer_ensure_config(&fbl->radiance_filtered_fb,
|
GPU_framebuffer_ensure_config(&fbl->radiance_filtered_fb,
|
||||||
{
|
{
|
||||||
|
@ -166,8 +174,9 @@ void EEVEE_effects_init(EEVEE_ViewLayerData *sldata,
|
||||||
* Normal buffer for deferred passes.
|
* Normal buffer for deferred passes.
|
||||||
*/
|
*/
|
||||||
if ((effects->enabled_effects & EFFECT_NORMAL_BUFFER) != 0) {
|
if ((effects->enabled_effects & EFFECT_NORMAL_BUFFER) != 0) {
|
||||||
effects->ssr_normal_input = DRW_texture_pool_query_2d(
|
eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT;
|
||||||
size_fs[0], size_fs[1], GPU_RG16, &draw_engine_eevee_type);
|
effects->ssr_normal_input = DRW_texture_pool_query_2d_ex(
|
||||||
|
size_fs[0], size_fs[1], GPU_RG16, usage, &draw_engine_eevee_type);
|
||||||
|
|
||||||
GPU_framebuffer_texture_attach(fbl->main_fb, effects->ssr_normal_input, 1, 0);
|
GPU_framebuffer_texture_attach(fbl->main_fb, effects->ssr_normal_input, 1, 0);
|
||||||
}
|
}
|
||||||
|
@ -179,8 +188,9 @@ void EEVEE_effects_init(EEVEE_ViewLayerData *sldata,
|
||||||
* Motion vector buffer for correct TAA / motion blur.
|
* Motion vector buffer for correct TAA / motion blur.
|
||||||
*/
|
*/
|
||||||
if ((effects->enabled_effects & EFFECT_VELOCITY_BUFFER) != 0) {
|
if ((effects->enabled_effects & EFFECT_VELOCITY_BUFFER) != 0) {
|
||||||
effects->velocity_tx = DRW_texture_pool_query_2d(
|
eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT;
|
||||||
size_fs[0], size_fs[1], GPU_RGBA16, &draw_engine_eevee_type);
|
effects->velocity_tx = DRW_texture_pool_query_2d_ex(
|
||||||
|
size_fs[0], size_fs[1], GPU_RGBA16, usage, &draw_engine_eevee_type);
|
||||||
|
|
||||||
GPU_framebuffer_ensure_config(&fbl->velocity_fb,
|
GPU_framebuffer_ensure_config(&fbl->velocity_fb,
|
||||||
{
|
{
|
||||||
|
|
|
@ -101,22 +101,28 @@ static void planar_pool_ensure_alloc(EEVEE_Data *vedata, int num_planar_ref)
|
||||||
|
|
||||||
/* We need an Array texture so allocate it ourself */
|
/* We need an Array texture so allocate it ourself */
|
||||||
if (!txl->planar_pool) {
|
if (!txl->planar_pool) {
|
||||||
|
eGPUTextureUsage planar_usage = GPU_TEXTURE_USAGE_ATTACHMENT | GPU_TEXTURE_USAGE_SHADER_READ |
|
||||||
|
GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW;
|
||||||
|
eGPUTextureUsage planar_usage_depth = GPU_TEXTURE_USAGE_ATTACHMENT |
|
||||||
|
GPU_TEXTURE_USAGE_SHADER_READ;
|
||||||
if (num_planar_ref > 0) {
|
if (num_planar_ref > 0) {
|
||||||
txl->planar_pool = DRW_texture_create_2d_array(width,
|
txl->planar_pool = DRW_texture_create_2d_array_ex(width,
|
||||||
height,
|
height,
|
||||||
num_planar_ref,
|
num_planar_ref,
|
||||||
GPU_R11F_G11F_B10F,
|
GPU_R11F_G11F_B10F,
|
||||||
DRW_TEX_FILTER | DRW_TEX_MIPMAP,
|
planar_usage,
|
||||||
NULL);
|
DRW_TEX_FILTER | DRW_TEX_MIPMAP,
|
||||||
txl->planar_depth = DRW_texture_create_2d_array(
|
NULL);
|
||||||
width, height, num_planar_ref, GPU_DEPTH_COMPONENT24, 0, NULL);
|
txl->planar_depth = DRW_texture_create_2d_array_ex(
|
||||||
|
width, height, num_planar_ref, GPU_DEPTH_COMPONENT24, planar_usage_depth, 0, NULL);
|
||||||
}
|
}
|
||||||
else if (num_planar_ref == 0) {
|
else if (num_planar_ref == 0) {
|
||||||
/* Makes Opengl Happy : Create a placeholder texture that will never be sampled but still
|
/* Makes Opengl Happy : Create a placeholder texture that will never be sampled but still
|
||||||
* bound to shader. */
|
* bound to shader. */
|
||||||
txl->planar_pool = DRW_texture_create_2d_array(
|
txl->planar_pool = DRW_texture_create_2d_array_ex(
|
||||||
1, 1, 1, GPU_RGBA8, DRW_TEX_FILTER | DRW_TEX_MIPMAP, NULL);
|
1, 1, 1, GPU_RGBA8, planar_usage, DRW_TEX_FILTER | DRW_TEX_MIPMAP, NULL);
|
||||||
txl->planar_depth = DRW_texture_create_2d_array(1, 1, 1, GPU_DEPTH_COMPONENT24, 0, NULL);
|
txl->planar_depth = DRW_texture_create_2d_array_ex(
|
||||||
|
1, 1, 1, GPU_DEPTH_COMPONENT24, planar_usage_depth, 0, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -182,8 +188,10 @@ void EEVEE_lightprobes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
|
||||||
|
|
||||||
/* Placeholder planar pool: used when rendering planar reflections (avoid dependency loop). */
|
/* Placeholder planar pool: used when rendering planar reflections (avoid dependency loop). */
|
||||||
if (!e_data.planar_pool_placeholder) {
|
if (!e_data.planar_pool_placeholder) {
|
||||||
e_data.planar_pool_placeholder = DRW_texture_create_2d_array(
|
eGPUTextureUsage planar_usage = GPU_TEXTURE_USAGE_ATTACHMENT | GPU_TEXTURE_USAGE_SHADER_READ |
|
||||||
1, 1, 1, GPU_RGBA8, DRW_TEX_FILTER, NULL);
|
GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW;
|
||||||
|
e_data.planar_pool_placeholder = DRW_texture_create_2d_array_ex(
|
||||||
|
1, 1, 1, GPU_RGBA8, planar_usage, DRW_TEX_FILTER, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -197,8 +197,9 @@ static void eevee_init_util_texture(void)
|
||||||
texels_layer += 64 * 64;
|
texels_layer += 64 * 64;
|
||||||
}
|
}
|
||||||
|
|
||||||
e_data.util_tex = DRW_texture_create_2d_array(
|
eGPUTextureUsage util_usage = GPU_TEXTURE_USAGE_ATTACHMENT | GPU_TEXTURE_USAGE_SHADER_READ;
|
||||||
64, 64, layers, GPU_RGBA16F, DRW_TEX_FILTER | DRW_TEX_WRAP, (float *)texels);
|
e_data.util_tex = DRW_texture_create_2d_array_ex(
|
||||||
|
64, 64, layers, GPU_RGBA16F, util_usage, DRW_TEX_FILTER | DRW_TEX_WRAP, (float *)texels);
|
||||||
|
|
||||||
MEM_freeN(texels);
|
MEM_freeN(texels);
|
||||||
#if RUNTIME_LUT_CREATION
|
#if RUNTIME_LUT_CREATION
|
||||||
|
|
|
@ -36,8 +36,10 @@ int EEVEE_occlusion_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
|
||||||
const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
|
const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
|
||||||
|
|
||||||
if (!e_data.dummy_horizon_tx) {
|
if (!e_data.dummy_horizon_tx) {
|
||||||
|
eGPUTextureUsage usage = GPU_TEXTURE_USAGE_ATTACHMENT | GPU_TEXTURE_USAGE_SHADER_READ;
|
||||||
const float pixel[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
const float pixel[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||||
e_data.dummy_horizon_tx = DRW_texture_create_2d(1, 1, GPU_RGBA8, DRW_TEX_WRAP, pixel);
|
e_data.dummy_horizon_tx = DRW_texture_create_2d_ex(
|
||||||
|
1, 1, GPU_RGBA8, usage, DRW_TEX_WRAP, pixel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scene_eval->eevee.flag & SCE_EEVEE_GTAO_ENABLED ||
|
if (scene_eval->eevee.flag & SCE_EEVEE_GTAO_ENABLED ||
|
||||||
|
@ -61,8 +63,9 @@ int EEVEE_occlusion_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
|
||||||
|
|
||||||
common_data->ao_bounce_fac = (scene_eval->eevee.flag & SCE_EEVEE_GTAO_BOUNCE) ? 1.0f : 0.0f;
|
common_data->ao_bounce_fac = (scene_eval->eevee.flag & SCE_EEVEE_GTAO_BOUNCE) ? 1.0f : 0.0f;
|
||||||
|
|
||||||
effects->gtao_horizons_renderpass = DRW_texture_pool_query_2d(
|
eGPUTextureUsage usage = GPU_TEXTURE_USAGE_ATTACHMENT | GPU_TEXTURE_USAGE_SHADER_READ;
|
||||||
UNPACK2(effects->hiz_size), GPU_RGBA8, &draw_engine_eevee_type);
|
effects->gtao_horizons_renderpass = DRW_texture_pool_query_2d_ex(
|
||||||
|
UNPACK2(effects->hiz_size), GPU_RGBA8, usage, &draw_engine_eevee_type);
|
||||||
GPU_framebuffer_ensure_config(
|
GPU_framebuffer_ensure_config(
|
||||||
&fbl->gtao_fb,
|
&fbl->gtao_fb,
|
||||||
{GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(effects->gtao_horizons_renderpass)});
|
{GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(effects->gtao_horizons_renderpass)});
|
||||||
|
|
|
@ -72,13 +72,17 @@ int EEVEE_screen_raytrace_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
|
||||||
common_data->ssr_uv_scale[1] = size_fs[1] / ((float)tracing_res[1] * divisor);
|
common_data->ssr_uv_scale[1] = size_fs[1] / ((float)tracing_res[1] * divisor);
|
||||||
|
|
||||||
/* MRT for the shading pass in order to output needed data for the SSR pass. */
|
/* MRT for the shading pass in order to output needed data for the SSR pass. */
|
||||||
effects->ssr_specrough_input = DRW_texture_pool_query_2d(UNPACK2(size_fs), format, owner);
|
eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT;
|
||||||
|
effects->ssr_specrough_input = DRW_texture_pool_query_2d_ex(
|
||||||
|
UNPACK2(size_fs), format, usage, owner);
|
||||||
|
|
||||||
GPU_framebuffer_texture_attach(fbl->main_fb, effects->ssr_specrough_input, 2, 0);
|
GPU_framebuffer_texture_attach(fbl->main_fb, effects->ssr_specrough_input, 2, 0);
|
||||||
|
|
||||||
/* Ray-tracing output. */
|
/* Ray-tracing output. */
|
||||||
effects->ssr_hit_output = DRW_texture_pool_query_2d(UNPACK2(tracing_res), GPU_RGBA16F, owner);
|
effects->ssr_hit_output = DRW_texture_pool_query_2d_ex(
|
||||||
effects->ssr_hit_depth = DRW_texture_pool_query_2d(UNPACK2(tracing_res), GPU_R16F, owner);
|
UNPACK2(tracing_res), GPU_RGBA16F, usage, owner);
|
||||||
|
effects->ssr_hit_depth = DRW_texture_pool_query_2d_ex(
|
||||||
|
UNPACK2(tracing_res), GPU_R16F, usage, owner);
|
||||||
|
|
||||||
GPU_framebuffer_ensure_config(&fbl->screen_tracing_fb,
|
GPU_framebuffer_ensure_config(&fbl->screen_tracing_fb,
|
||||||
{
|
{
|
||||||
|
|
|
@ -213,22 +213,26 @@ void EEVEE_shadows_update(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
|
||||||
linfo->cache_num_cascade_layer = linfo->num_cascade_layer;
|
linfo->cache_num_cascade_layer = linfo->num_cascade_layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
eGPUTextureUsage shadow_usage = GPU_TEXTURE_USAGE_ATTACHMENT | GPU_TEXTURE_USAGE_SHADER_READ;
|
||||||
if (!sldata->shadow_cube_pool) {
|
if (!sldata->shadow_cube_pool) {
|
||||||
sldata->shadow_cube_pool = DRW_texture_create_2d_array(linfo->shadow_cube_size,
|
sldata->shadow_cube_pool = DRW_texture_create_2d_array_ex(linfo->shadow_cube_size,
|
||||||
linfo->shadow_cube_size,
|
linfo->shadow_cube_size,
|
||||||
max_ii(1, linfo->num_cube_layer * 6),
|
max_ii(1, linfo->num_cube_layer * 6),
|
||||||
shadow_pool_format,
|
shadow_pool_format,
|
||||||
DRW_TEX_FILTER | DRW_TEX_COMPARE,
|
shadow_usage,
|
||||||
NULL);
|
DRW_TEX_FILTER | DRW_TEX_COMPARE,
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sldata->shadow_cascade_pool) {
|
if (!sldata->shadow_cascade_pool) {
|
||||||
sldata->shadow_cascade_pool = DRW_texture_create_2d_array(linfo->shadow_cascade_size,
|
sldata->shadow_cascade_pool = DRW_texture_create_2d_array_ex(
|
||||||
linfo->shadow_cascade_size,
|
linfo->shadow_cascade_size,
|
||||||
max_ii(1, linfo->num_cascade_layer),
|
linfo->shadow_cascade_size,
|
||||||
shadow_pool_format,
|
max_ii(1, linfo->num_cascade_layer),
|
||||||
DRW_TEX_FILTER | DRW_TEX_COMPARE,
|
shadow_pool_format,
|
||||||
NULL);
|
shadow_usage,
|
||||||
|
DRW_TEX_FILTER | DRW_TEX_COMPARE,
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sldata->shadow_fb == NULL) {
|
if (sldata->shadow_fb == NULL) {
|
||||||
|
|
|
@ -36,16 +36,18 @@ void EEVEE_subsurface_draw_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
|
||||||
* as the depth buffer we are sampling from. This could be avoided if the stencil is
|
* as the depth buffer we are sampling from. This could be avoided if the stencil is
|
||||||
* a separate texture but that needs OpenGL 4.4 or ARB_texture_stencil8.
|
* a separate texture but that needs OpenGL 4.4 or ARB_texture_stencil8.
|
||||||
* OR OpenGL 4.3 / ARB_ES3_compatibility if using a render-buffer instead. */
|
* OR OpenGL 4.3 / ARB_ES3_compatibility if using a render-buffer instead. */
|
||||||
effects->sss_stencil = DRW_texture_pool_query_2d(
|
eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT;
|
||||||
fs_size[0], fs_size[1], GPU_DEPTH24_STENCIL8, &draw_engine_eevee_type);
|
|
||||||
effects->sss_blur = DRW_texture_pool_query_2d(
|
effects->sss_stencil = DRW_texture_pool_query_2d_ex(
|
||||||
fs_size[0], fs_size[1], GPU_R11F_G11F_B10F, &draw_engine_eevee_type);
|
fs_size[0], fs_size[1], GPU_DEPTH24_STENCIL8, usage, &draw_engine_eevee_type);
|
||||||
effects->sss_irradiance = DRW_texture_pool_query_2d(
|
effects->sss_blur = DRW_texture_pool_query_2d_ex(
|
||||||
fs_size[0], fs_size[1], GPU_R11F_G11F_B10F, &draw_engine_eevee_type);
|
fs_size[0], fs_size[1], GPU_R11F_G11F_B10F, usage, &draw_engine_eevee_type);
|
||||||
effects->sss_radius = DRW_texture_pool_query_2d(
|
effects->sss_irradiance = DRW_texture_pool_query_2d_ex(
|
||||||
fs_size[0], fs_size[1], GPU_R16F, &draw_engine_eevee_type);
|
fs_size[0], fs_size[1], GPU_R11F_G11F_B10F, usage, &draw_engine_eevee_type);
|
||||||
effects->sss_albedo = DRW_texture_pool_query_2d(
|
effects->sss_radius = DRW_texture_pool_query_2d_ex(
|
||||||
fs_size[0], fs_size[1], GPU_R11F_G11F_B10F, &draw_engine_eevee_type);
|
fs_size[0], fs_size[1], GPU_R16F, usage, &draw_engine_eevee_type);
|
||||||
|
effects->sss_albedo = DRW_texture_pool_query_2d_ex(
|
||||||
|
fs_size[0], fs_size[1], GPU_R11F_G11F_B10F, usage, &draw_engine_eevee_type);
|
||||||
|
|
||||||
GPUTexture *stencil_tex = effects->sss_stencil;
|
GPUTexture *stencil_tex = effects->sss_stencil;
|
||||||
|
|
||||||
|
|
|
@ -192,8 +192,11 @@ void EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
|
||||||
if (!e_data.dummy_scatter) {
|
if (!e_data.dummy_scatter) {
|
||||||
const float scatter[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
const float scatter[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||||
const float transmit[4] = {1.0f, 1.0f, 1.0f, 1.0f};
|
const float transmit[4] = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||||
e_data.dummy_scatter = DRW_texture_create_3d(1, 1, 1, GPU_RGBA8, DRW_TEX_WRAP, scatter);
|
eGPUTextureUsage dummy_usage = GPU_TEXTURE_USAGE_ATTACHMENT | GPU_TEXTURE_USAGE_SHADER_READ;
|
||||||
e_data.dummy_transmit = DRW_texture_create_3d(1, 1, 1, GPU_RGBA8, DRW_TEX_WRAP, transmit);
|
e_data.dummy_scatter = DRW_texture_create_3d_ex(
|
||||||
|
1, 1, 1, GPU_RGBA8, dummy_usage, DRW_TEX_WRAP, scatter);
|
||||||
|
e_data.dummy_transmit = DRW_texture_create_3d_ex(
|
||||||
|
1, 1, 1, GPU_RGBA8, dummy_usage, DRW_TEX_WRAP, transmit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -424,31 +427,54 @@ void EEVEE_volumes_draw_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
|
||||||
if (txl->volume_prop_scattering == NULL) {
|
if (txl->volume_prop_scattering == NULL) {
|
||||||
/* Volume properties: We evaluate all volumetric objects
|
/* Volume properties: We evaluate all volumetric objects
|
||||||
* and store their final properties into each froxel */
|
* and store their final properties into each froxel */
|
||||||
txl->volume_prop_scattering = DRW_texture_create_3d(
|
eGPUTextureUsage usage = GPU_TEXTURE_USAGE_ATTACHMENT | GPU_TEXTURE_USAGE_SHADER_READ;
|
||||||
tex_size[0], tex_size[1], tex_size[2], GPU_R11F_G11F_B10F, DRW_TEX_FILTER, NULL);
|
txl->volume_prop_scattering = DRW_texture_create_3d_ex(
|
||||||
txl->volume_prop_extinction = DRW_texture_create_3d(
|
tex_size[0], tex_size[1], tex_size[2], GPU_R11F_G11F_B10F, usage, DRW_TEX_FILTER, NULL);
|
||||||
tex_size[0], tex_size[1], tex_size[2], GPU_R11F_G11F_B10F, DRW_TEX_FILTER, NULL);
|
txl->volume_prop_extinction = DRW_texture_create_3d_ex(
|
||||||
txl->volume_prop_emission = DRW_texture_create_3d(
|
tex_size[0], tex_size[1], tex_size[2], GPU_R11F_G11F_B10F, usage, DRW_TEX_FILTER, NULL);
|
||||||
tex_size[0], tex_size[1], tex_size[2], GPU_R11F_G11F_B10F, DRW_TEX_FILTER, NULL);
|
txl->volume_prop_emission = DRW_texture_create_3d_ex(
|
||||||
txl->volume_prop_phase = DRW_texture_create_3d(
|
tex_size[0], tex_size[1], tex_size[2], GPU_R11F_G11F_B10F, usage, DRW_TEX_FILTER, NULL);
|
||||||
tex_size[0], tex_size[1], tex_size[2], GPU_RG16F, DRW_TEX_FILTER, NULL);
|
txl->volume_prop_phase = DRW_texture_create_3d_ex(
|
||||||
|
tex_size[0], tex_size[1], tex_size[2], GPU_RG16F, usage, DRW_TEX_FILTER, NULL);
|
||||||
|
|
||||||
/* Volume scattering: We compute for each froxel the
|
/* Volume scattering: We compute for each froxel the
|
||||||
* Scattered light towards the view. We also resolve temporal
|
* Scattered light towards the view. We also resolve temporal
|
||||||
* super sampling during this stage. */
|
* super sampling during this stage. */
|
||||||
txl->volume_scatter = DRW_texture_create_3d(
|
eGPUTextureUsage usage_write = GPU_TEXTURE_USAGE_ATTACHMENT | GPU_TEXTURE_USAGE_SHADER_READ |
|
||||||
tex_size[0], tex_size[1], tex_size[2], GPU_R11F_G11F_B10F, DRW_TEX_FILTER, NULL);
|
GPU_TEXTURE_USAGE_SHADER_WRITE;
|
||||||
txl->volume_transmit = DRW_texture_create_3d(
|
txl->volume_scatter = DRW_texture_create_3d_ex(tex_size[0],
|
||||||
tex_size[0], tex_size[1], tex_size[2], GPU_R11F_G11F_B10F, DRW_TEX_FILTER, NULL);
|
tex_size[1],
|
||||||
|
tex_size[2],
|
||||||
|
GPU_R11F_G11F_B10F,
|
||||||
|
usage_write,
|
||||||
|
DRW_TEX_FILTER,
|
||||||
|
NULL);
|
||||||
|
txl->volume_transmit = DRW_texture_create_3d_ex(tex_size[0],
|
||||||
|
tex_size[1],
|
||||||
|
tex_size[2],
|
||||||
|
GPU_R11F_G11F_B10F,
|
||||||
|
usage_write,
|
||||||
|
DRW_TEX_FILTER,
|
||||||
|
NULL);
|
||||||
|
|
||||||
/* Final integration: We compute for each froxel the
|
/* Final integration: We compute for each froxel the
|
||||||
* amount of scattered light and extinction coef at this
|
* amount of scattered light and extinction coef at this
|
||||||
* given depth. We use these textures as double buffer
|
* given depth. We use these textures as double buffer
|
||||||
* for the volumetric history. */
|
* for the volumetric history. */
|
||||||
txl->volume_scatter_history = DRW_texture_create_3d(
|
txl->volume_scatter_history = DRW_texture_create_3d_ex(tex_size[0],
|
||||||
tex_size[0], tex_size[1], tex_size[2], GPU_R11F_G11F_B10F, DRW_TEX_FILTER, NULL);
|
tex_size[1],
|
||||||
txl->volume_transmit_history = DRW_texture_create_3d(
|
tex_size[2],
|
||||||
tex_size[0], tex_size[1], tex_size[2], GPU_R11F_G11F_B10F, DRW_TEX_FILTER, NULL);
|
GPU_R11F_G11F_B10F,
|
||||||
|
usage_write,
|
||||||
|
DRW_TEX_FILTER,
|
||||||
|
NULL);
|
||||||
|
txl->volume_transmit_history = DRW_texture_create_3d_ex(tex_size[0],
|
||||||
|
tex_size[1],
|
||||||
|
tex_size[2],
|
||||||
|
GPU_R11F_G11F_B10F,
|
||||||
|
usage_write,
|
||||||
|
DRW_TEX_FILTER,
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
GPU_framebuffer_ensure_config(&fbl->volumetric_fb,
|
GPU_framebuffer_ensure_config(&fbl->volumetric_fb,
|
||||||
|
|
|
@ -746,7 +746,8 @@ static int dyntopo_detail_size_edit_invoke(bContext *C, wmOperator *op, const wm
|
||||||
ss->draw_faded_cursor = true;
|
ss->draw_faded_cursor = true;
|
||||||
|
|
||||||
const char *status_str = TIP_(
|
const char *status_str = TIP_(
|
||||||
"Move the mouse to change the dyntopo detail size. LMB: confirm size, ESC/RMB: cancel, SHIFT: precision mode, CTRL: sample detail size");
|
"Move the mouse to change the dyntopo detail size. LMB: confirm size, ESC/RMB: cancel, "
|
||||||
|
"SHIFT: precision mode, CTRL: sample detail size");
|
||||||
ED_workspace_status_text(C, status_str);
|
ED_workspace_status_text(C, status_str);
|
||||||
|
|
||||||
return OPERATOR_RUNNING_MODAL;
|
return OPERATOR_RUNNING_MODAL;
|
||||||
|
|
|
@ -470,7 +470,15 @@ void SCULPT_OT_color_filter(wmOperatorType *ot)
|
||||||
|
|
||||||
RNA_def_enum(ot->srna, "type", prop_color_filter_types, COLOR_FILTER_FILL, "Filter Type", "");
|
RNA_def_enum(ot->srna, "type", prop_color_filter_types, COLOR_FILTER_FILL, "Filter Type", "");
|
||||||
|
|
||||||
PropertyRNA *prop = RNA_def_float_color(
|
PropertyRNA *prop = RNA_def_float_color(ot->srna,
|
||||||
ot->srna, "fill_color", 3, fill_filter_default_color, 0.0f, FLT_MAX, "Fill Color", "", 0.0f, 1.0f);
|
"fill_color",
|
||||||
|
3,
|
||||||
|
fill_filter_default_color,
|
||||||
|
0.0f,
|
||||||
|
FLT_MAX,
|
||||||
|
"Fill Color",
|
||||||
|
"",
|
||||||
|
0.0f,
|
||||||
|
1.0f);
|
||||||
RNA_def_property_subtype(prop, PROP_COLOR_GAMMA);
|
RNA_def_property_subtype(prop, PROP_COLOR_GAMMA);
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,7 +239,7 @@ static void gpu_material_sky_texture_build(GPUMaterial *mat)
|
||||||
mat->sky_builder->current_layer,
|
mat->sky_builder->current_layer,
|
||||||
1,
|
1,
|
||||||
GPU_RGBA32F,
|
GPU_RGBA32F,
|
||||||
GPU_TEXTURE_USAGE_GENERAL,
|
GPU_TEXTURE_USAGE_SHADER_READ,
|
||||||
(float *)mat->sky_builder->pixels);
|
(float *)mat->sky_builder->pixels);
|
||||||
|
|
||||||
MEM_freeN(mat->sky_builder);
|
MEM_freeN(mat->sky_builder);
|
||||||
|
|
|
@ -290,13 +290,14 @@ typedef struct bPoseChannel {
|
||||||
char _pad[2];
|
char _pad[2];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Matrix result of location/rotation/scale components & constraints.
|
* Matrix result of location/rotation/scale components, and evaluation of
|
||||||
|
* animation data and constraints.
|
||||||
|
*
|
||||||
* This is the dynamic component of `pose_mat` (without #Bone.arm_mat).
|
* This is the dynamic component of `pose_mat` (without #Bone.arm_mat).
|
||||||
*/
|
*/
|
||||||
float chan_mat[4][4];
|
float chan_mat[4][4];
|
||||||
/**
|
/**
|
||||||
* Constraints accumulate here. in the end, `pose_mat = bone->arm_mat * chan_mat`
|
* Channel matrix in the armature object space, i.e. `pose_mat = bone->arm_mat * chan_mat`.
|
||||||
* this matrix is object space.
|
|
||||||
*/
|
*/
|
||||||
float pose_mat[4][4];
|
float pose_mat[4][4];
|
||||||
/** For display, pose_mat with bone length applied. */
|
/** For display, pose_mat with bone length applied. */
|
||||||
|
|
|
@ -91,19 +91,45 @@ static const EnumPropertyItem rna_enum_brush_texture_slot_map_texture_mode_items
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* clang-format off */
|
|
||||||
/* Note: we don't actually turn these into a single enum bit-mask property,
|
/* Note: we don't actually turn these into a single enum bit-mask property,
|
||||||
* instead we construct individual boolean properties. */
|
* instead we construct individual boolean properties. */
|
||||||
const EnumPropertyItem rna_enum_brush_automasking_flag_items[] = {
|
const EnumPropertyItem rna_enum_brush_automasking_flag_items[] = {
|
||||||
{BRUSH_AUTOMASKING_TOPOLOGY, "use_automasking_topology", 0,"Topology", "Affect only vertices connected to the active vertex under the brush"},
|
{BRUSH_AUTOMASKING_TOPOLOGY,
|
||||||
{BRUSH_AUTOMASKING_FACE_SETS, "use_automasking_face_sets", 0,"Face Sets", "Affect only vertices that share Face Sets with the active vertex"},
|
"use_automasking_topology",
|
||||||
{BRUSH_AUTOMASKING_BOUNDARY_EDGES, "use_automasking_boundary_edges", 0,"Mesh Boundary Auto-Masking", "Do not affect non manifold boundary edges"},
|
0,
|
||||||
{BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS, "use_automasking_boundary_face_sets", 0,"Face Sets Boundary Automasking", "Do not affect vertices that belong to a Face Set boundary"},
|
"Topology",
|
||||||
{BRUSH_AUTOMASKING_CAVITY_NORMAL, "use_automasking_cavity", 0,"Cavity Mask", "Do not affect vertices on peaks, based on the surface curvature"},
|
"Affect only vertices connected to the active vertex under the brush"},
|
||||||
{BRUSH_AUTOMASKING_CAVITY_INVERTED, "use_automasking_cavity_inverted", 0,"Inverted Cavity Mask", "Do not affect vertices within crevices, based on the surface curvature"},
|
{BRUSH_AUTOMASKING_FACE_SETS,
|
||||||
{BRUSH_AUTOMASKING_CAVITY_USE_CURVE, "use_automasking_custom_cavity_curve", 0,"Custom Cavity Curve", "Use custom curve"},
|
"use_automasking_face_sets",
|
||||||
{0, NULL, 0, NULL, NULL}
|
0,
|
||||||
};
|
"Face Sets",
|
||||||
|
"Affect only vertices that share Face Sets with the active vertex"},
|
||||||
|
{BRUSH_AUTOMASKING_BOUNDARY_EDGES,
|
||||||
|
"use_automasking_boundary_edges",
|
||||||
|
0,
|
||||||
|
"Mesh Boundary Auto-Masking",
|
||||||
|
"Do not affect non manifold boundary edges"},
|
||||||
|
{BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS,
|
||||||
|
"use_automasking_boundary_face_sets",
|
||||||
|
0,
|
||||||
|
"Face Sets Boundary Automasking",
|
||||||
|
"Do not affect vertices that belong to a Face Set boundary"},
|
||||||
|
{BRUSH_AUTOMASKING_CAVITY_NORMAL,
|
||||||
|
"use_automasking_cavity",
|
||||||
|
0,
|
||||||
|
"Cavity Mask",
|
||||||
|
"Do not affect vertices on peaks, based on the surface curvature"},
|
||||||
|
{BRUSH_AUTOMASKING_CAVITY_INVERTED,
|
||||||
|
"use_automasking_cavity_inverted",
|
||||||
|
0,
|
||||||
|
"Inverted Cavity Mask",
|
||||||
|
"Do not affect vertices within crevices, based on the surface curvature"},
|
||||||
|
{BRUSH_AUTOMASKING_CAVITY_USE_CURVE,
|
||||||
|
"use_automasking_custom_cavity_curve",
|
||||||
|
0,
|
||||||
|
"Custom Cavity Curve",
|
||||||
|
"Use custom curve"},
|
||||||
|
{0, NULL, 0, NULL, NULL}};
|
||||||
|
|
||||||
const EnumPropertyItem rna_enum_brush_sculpt_tool_items[] = {
|
const EnumPropertyItem rna_enum_brush_sculpt_tool_items[] = {
|
||||||
{SCULPT_TOOL_DRAW, "DRAW", ICON_BRUSH_SCULPT_DRAW, "Draw", ""},
|
{SCULPT_TOOL_DRAW, "DRAW", ICON_BRUSH_SCULPT_DRAW, "Draw", ""},
|
||||||
|
@ -120,7 +146,11 @@ const EnumPropertyItem rna_enum_brush_sculpt_tool_items[] = {
|
||||||
{SCULPT_TOOL_FLATTEN, "FLATTEN", ICON_BRUSH_FLATTEN, "Flatten", ""},
|
{SCULPT_TOOL_FLATTEN, "FLATTEN", ICON_BRUSH_FLATTEN, "Flatten", ""},
|
||||||
{SCULPT_TOOL_FILL, "FILL", ICON_BRUSH_FILL, "Fill", ""},
|
{SCULPT_TOOL_FILL, "FILL", ICON_BRUSH_FILL, "Fill", ""},
|
||||||
{SCULPT_TOOL_SCRAPE, "SCRAPE", ICON_BRUSH_SCRAPE, "Scrape", ""},
|
{SCULPT_TOOL_SCRAPE, "SCRAPE", ICON_BRUSH_SCRAPE, "Scrape", ""},
|
||||||
{SCULPT_TOOL_MULTIPLANE_SCRAPE, "MULTIPLANE_SCRAPE", ICON_BRUSH_SCRAPE, "Multi-plane Scrape", ""},
|
{SCULPT_TOOL_MULTIPLANE_SCRAPE,
|
||||||
|
"MULTIPLANE_SCRAPE",
|
||||||
|
ICON_BRUSH_SCRAPE,
|
||||||
|
"Multi-plane Scrape",
|
||||||
|
""},
|
||||||
{SCULPT_TOOL_PINCH, "PINCH", ICON_BRUSH_PINCH, "Pinch", ""},
|
{SCULPT_TOOL_PINCH, "PINCH", ICON_BRUSH_PINCH, "Pinch", ""},
|
||||||
RNA_ENUM_ITEM_SEPR,
|
RNA_ENUM_ITEM_SEPR,
|
||||||
{SCULPT_TOOL_GRAB, "GRAB", ICON_BRUSH_GRAB, "Grab", ""},
|
{SCULPT_TOOL_GRAB, "GRAB", ICON_BRUSH_GRAB, "Grab", ""},
|
||||||
|
@ -137,13 +167,20 @@ const EnumPropertyItem rna_enum_brush_sculpt_tool_items[] = {
|
||||||
{SCULPT_TOOL_SIMPLIFY, "SIMPLIFY", ICON_BRUSH_DATA, "Simplify", ""},
|
{SCULPT_TOOL_SIMPLIFY, "SIMPLIFY", ICON_BRUSH_DATA, "Simplify", ""},
|
||||||
{SCULPT_TOOL_MASK, "MASK", ICON_BRUSH_MASK, "Mask", ""},
|
{SCULPT_TOOL_MASK, "MASK", ICON_BRUSH_MASK, "Mask", ""},
|
||||||
{SCULPT_TOOL_DRAW_FACE_SETS, "DRAW_FACE_SETS", ICON_BRUSH_MASK, "Draw Face Sets", ""},
|
{SCULPT_TOOL_DRAW_FACE_SETS, "DRAW_FACE_SETS", ICON_BRUSH_MASK, "Draw Face Sets", ""},
|
||||||
{SCULPT_TOOL_DISPLACEMENT_ERASER, "DISPLACEMENT_ERASER", ICON_BRUSH_SCULPT_DRAW, "Multires Displacement Eraser", ""},
|
{SCULPT_TOOL_DISPLACEMENT_ERASER,
|
||||||
{SCULPT_TOOL_DISPLACEMENT_SMEAR, "DISPLACEMENT_SMEAR", ICON_BRUSH_SCULPT_DRAW, "Multires Displacement Smear", ""},
|
"DISPLACEMENT_ERASER",
|
||||||
|
ICON_BRUSH_SCULPT_DRAW,
|
||||||
|
"Multires Displacement Eraser",
|
||||||
|
""},
|
||||||
|
{SCULPT_TOOL_DISPLACEMENT_SMEAR,
|
||||||
|
"DISPLACEMENT_SMEAR",
|
||||||
|
ICON_BRUSH_SCULPT_DRAW,
|
||||||
|
"Multires Displacement Smear",
|
||||||
|
""},
|
||||||
{SCULPT_TOOL_PAINT, "PAINT", ICON_BRUSH_SCULPT_DRAW, "Paint", ""},
|
{SCULPT_TOOL_PAINT, "PAINT", ICON_BRUSH_SCULPT_DRAW, "Paint", ""},
|
||||||
{SCULPT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_SCULPT_DRAW, "Smear", ""},
|
{SCULPT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_SCULPT_DRAW, "Smear", ""},
|
||||||
{0, NULL, 0, NULL, NULL},
|
{0, NULL, 0, NULL, NULL},
|
||||||
};
|
};
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
const EnumPropertyItem rna_enum_brush_uv_sculpt_tool_items[] = {
|
const EnumPropertyItem rna_enum_brush_uv_sculpt_tool_items[] = {
|
||||||
{UV_SCULPT_TOOL_GRAB, "GRAB", 0, "Grab", "Grab UVs"},
|
{UV_SCULPT_TOOL_GRAB, "GRAB", 0, "Grab", "Grab UVs"},
|
||||||
|
@ -260,24 +297,30 @@ const EnumPropertyItem rna_enum_brush_gpencil_weight_types_items[] = {
|
||||||
{0, NULL, 0, NULL, NULL},
|
{0, NULL, 0, NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
/* clang-format off */
|
|
||||||
const EnumPropertyItem rna_enum_brush_curves_sculpt_tool_items[] = {
|
const EnumPropertyItem rna_enum_brush_curves_sculpt_tool_items[] = {
|
||||||
{CURVES_SCULPT_TOOL_SELECTION_PAINT, "SELECTION_PAINT", ICON_BRUSH_PAINT_SELECT, "Paint Selection", ""},
|
{CURVES_SCULPT_TOOL_SELECTION_PAINT,
|
||||||
|
"SELECTION_PAINT",
|
||||||
|
ICON_BRUSH_PAINT_SELECT,
|
||||||
|
"Paint Selection",
|
||||||
|
""},
|
||||||
RNA_ENUM_ITEM_SEPR,
|
RNA_ENUM_ITEM_SEPR,
|
||||||
{CURVES_SCULPT_TOOL_ADD, "ADD", ICON_BRUSH_CURVES_ADD, "Add Curves", ""},
|
{CURVES_SCULPT_TOOL_ADD, "ADD", ICON_BRUSH_CURVES_ADD, "Add", ""},
|
||||||
{CURVES_SCULPT_TOOL_DELETE, "DELETE", ICON_BRUSH_CURVES_DELETE, "Delete Curves", ""},
|
{CURVES_SCULPT_TOOL_DELETE, "DELETE", ICON_BRUSH_CURVES_DELETE, "Delete", ""},
|
||||||
{CURVES_SCULPT_TOOL_DENSITY, "DENSITY", ICON_BRUSH_CURVES_DENSITY, "Density Curves", ""},
|
{CURVES_SCULPT_TOOL_DENSITY, "DENSITY", ICON_BRUSH_CURVES_DENSITY, "Density", ""},
|
||||||
RNA_ENUM_ITEM_SEPR,
|
RNA_ENUM_ITEM_SEPR,
|
||||||
{CURVES_SCULPT_TOOL_COMB, "COMB", ICON_BRUSH_CURVES_COMB, "Comb Curves", ""},
|
{CURVES_SCULPT_TOOL_COMB, "COMB", ICON_BRUSH_CURVES_COMB, "Comb", ""},
|
||||||
{CURVES_SCULPT_TOOL_SNAKE_HOOK, "SNAKE_HOOK", ICON_BRUSH_CURVES_SNAKE_HOOK, "Curves Snake Hook", ""},
|
{CURVES_SCULPT_TOOL_SNAKE_HOOK, "SNAKE_HOOK", ICON_BRUSH_CURVES_SNAKE_HOOK, "Snake Hook", ""},
|
||||||
{CURVES_SCULPT_TOOL_GROW_SHRINK, "GROW_SHRINK", ICON_BRUSH_CURVES_GROW_SHRINK, "Grow / Shrink Curves", ""},
|
{CURVES_SCULPT_TOOL_GROW_SHRINK,
|
||||||
{CURVES_SCULPT_TOOL_PINCH, "PINCH", ICON_BRUSH_CURVES_PINCH, "Pinch Curves", ""},
|
"GROW_SHRINK",
|
||||||
{CURVES_SCULPT_TOOL_PUFF, "PUFF", ICON_BRUSH_CURVES_PUFF, "Puff Curves", ""},
|
ICON_BRUSH_CURVES_GROW_SHRINK,
|
||||||
{CURVES_SCULPT_TOOL_SMOOTH, "SMOOTH", ICON_BRUSH_CURVES_SMOOTH, "Smooth Curves", ""},
|
"Grow / Shrink",
|
||||||
{CURVES_SCULPT_TOOL_SLIDE, "SLIDE", ICON_BRUSH_CURVES_SLIDE, "Slide Curves", ""},
|
""},
|
||||||
|
{CURVES_SCULPT_TOOL_PINCH, "PINCH", ICON_BRUSH_CURVES_PINCH, "Pinch", ""},
|
||||||
|
{CURVES_SCULPT_TOOL_PUFF, "PUFF", ICON_BRUSH_CURVES_PUFF, "Puff", ""},
|
||||||
|
{CURVES_SCULPT_TOOL_SMOOTH, "SMOOTH", ICON_BRUSH_CURVES_SMOOTH, "Smooth", ""},
|
||||||
|
{CURVES_SCULPT_TOOL_SLIDE, "SLIDE", ICON_BRUSH_CURVES_SLIDE, "Slide", ""},
|
||||||
{0, NULL, 0, NULL, NULL},
|
{0, NULL, 0, NULL, NULL},
|
||||||
};
|
};
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
#ifndef RNA_RUNTIME
|
#ifndef RNA_RUNTIME
|
||||||
static EnumPropertyItem rna_enum_gpencil_brush_eraser_modes_items[] = {
|
static EnumPropertyItem rna_enum_gpencil_brush_eraser_modes_items[] = {
|
||||||
|
|
|
@ -1134,7 +1134,10 @@ static void rna_def_pose_channel(BlenderRNA *brna)
|
||||||
RNA_def_property_float_sdna(prop, NULL, "chan_mat");
|
RNA_def_property_float_sdna(prop, NULL, "chan_mat");
|
||||||
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
|
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
|
||||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
RNA_def_property_ui_text(prop, "Channel Matrix", "4x4 matrix, before constraints");
|
RNA_def_property_ui_text(prop,
|
||||||
|
"Channel Matrix",
|
||||||
|
"4x4 matrix of the bone's location/rotation/scale channels (including "
|
||||||
|
"animation and drivers) and the effect of bone constraints");
|
||||||
|
|
||||||
/* writable because it touches loc/scale/rot directly */
|
/* writable because it touches loc/scale/rot directly */
|
||||||
prop = RNA_def_property(srna, "matrix_basis", PROP_FLOAT, PROP_MATRIX);
|
prop = RNA_def_property(srna, "matrix_basis", PROP_FLOAT, PROP_MATRIX);
|
||||||
|
@ -1156,7 +1159,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
|
||||||
RNA_def_property_ui_text(
|
RNA_def_property_ui_text(
|
||||||
prop,
|
prop,
|
||||||
"Pose Matrix",
|
"Pose Matrix",
|
||||||
"Final 4x4 matrix after constraints and drivers are applied (object space)");
|
"Final 4x4 matrix after constraints and drivers are applied, in the armature object space");
|
||||||
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
|
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
|
||||||
|
|
||||||
/* Head/Tail Coordinates (in Pose Space) - Automatically calculated... */
|
/* Head/Tail Coordinates (in Pose Space) - Automatically calculated... */
|
||||||
|
|
|
@ -723,7 +723,7 @@ static const char *toolsystem_default_tool(const bToolKey *tkey)
|
||||||
case CTX_MODE_VERTEX_GPENCIL:
|
case CTX_MODE_VERTEX_GPENCIL:
|
||||||
return "builtin_brush.Draw";
|
return "builtin_brush.Draw";
|
||||||
case CTX_MODE_SCULPT_CURVES:
|
case CTX_MODE_SCULPT_CURVES:
|
||||||
return "builtin_brush.density";
|
return "builtin_brush.Density";
|
||||||
/* end temporary hack. */
|
/* end temporary hack. */
|
||||||
|
|
||||||
case CTX_MODE_PARTICLE:
|
case CTX_MODE_PARTICLE:
|
||||||
|
|
Loading…
Reference in New Issue