9#define DNA_DEPRECATED_ALLOW
11#include <fmt/format.h>
80 "Modifier '%s' from Object '%s' is missing its Geometry Node Group, its "
81 "settings will be lost (reset to default).",
102 "Modifier '%s' from Object '%s' is using a missing linked Geometry Node Group, its "
103 "settings will be lost (reset to default) if the file is saved in this state.",
109 ntree.ensure_interface_cache();
116 const std::string inputs_path_prefix = fmt::format(
"modifiers[\"{}\"]",
122 if (!old_value_prop) {
148 const std::string old_value_path = fmt::format(
"[\"{}\"]", identifier);
149 const std::string new_value_path = fmt::format(
".properties.inputs.{}.value", identifier);
172 bool use_attribute =
false;
174 old_props, identifier +
"_use_attribute"))
177 if (use_attribute_prop->type ==
IDP_INT) {
178 use_attribute = bool(
IDP_int_get(use_attribute_prop));
180 else if (use_attribute_prop->type ==
IDP_BOOLEAN) {
190 old_props, identifier +
"_attribute_name",
IDP_STRING);
191 if (attribute_name) {
204 old_props, identifier +
"_attribute_name",
IDP_STRING);
205 if (!old_name_prop) {
226 node_tree.ensure_interface_cache();
236 std::string prev_identifier(socket.identifier);
238 if (all_identifiers.
contains(socket.identifier)) {
243 MEM_SAFE_DELETE(socket.identifier);
244 socket.identifier =
BLI_strdup(new_identifier.c_str());
246 identifier_map.
add(std::move(prev_identifier), socket.identifier);
248 all_identifiers.
add(socket.identifier);
254 if (!(
node.is_group_input() ||
node.is_group_output())) {
257 ListBaseT<bNodeSocket> sockets =
node.is_group_output() ?
node.inputs :
node.outputs;
259 if (identifier_map.
contains(socket.identifier)) {
294 constexpr eStripFlag flag_linear_modifiers = eStripFlag(1 << 23);
295 strip->flag &= ~flag_linear_modifiers;
311 if (strip->type == STRIP_TYPE_TEXT && strip->effectdata != nullptr) {
312 TextVars *data = static_cast<TextVars *>(strip->effectdata);
313 data->space_line = 1.0f;
329 if (strip->type == STRIP_TYPE_COMPOSITOR) {
330 seq::effect_ensure_initialized(strip);
347 if (strip->type == STRIP_TYPE_TEXT && strip->effectdata != nullptr) {
348 TextVars *data = static_cast<TextVars *>(strip->effectdata);
349 data->abs_space_line = 60.0f;
350 data->flag &= ~SEQ_TEXT_USE_ABSOLUTE_LINE_SPACING;
364 for (
Nurb *nu = cu.
nurb.first(); nu !=
nullptr; nu = nu->next) {
383 for (StripModifierData &smd : strip->modifiers) {
384 if ((smd.flag & STRIP_MODIFIER_FLAG_MUTE) == 0) {
385 smd.flag |= STRIP_MODIFIER_FLAG_SHOW_PREVIEW;
402 if (strip->type != STRIP_TYPE_SCENE || strip->scene == nullptr) {
419 bool has_image_input =
false;
420 bool has_image_output =
false;
428 has_image_input = has_image_input ||
STREQ(socket.socket_type,
"NodeSocketColor");
433 has_image_output = has_image_output ||
STREQ(socket.socket_type,
"NodeSocketColor");
441 if (has_image_input && has_image_output) {
473 if (node_tree ==
nullptr) {
506 object.mpath =
nullptr;
511 if (pose_bone.mpath) {
513 pose_bone.mpath =
nullptr;
537 if (strip->type == STRIP_TYPE_COLOR && strip->effectdata != nullptr) {
538 SolidColorVars *data = static_cast<SolidColorVars *>(strip->effectdata);
539 data->width = scene.r.xsch;
540 data->height = scene.r.ysch;
557 if (
brush.gpencil_settings !=
nullptr) {
567 data.vector[3] = 0.0f;
645 if (
brush.gpencil_settings !=
nullptr) {
647 brush.gpencil_settings->conversion_threshold = 0.001f;
654 if (materials.gp_style !=
nullptr) {
656 materials.gp_style->placement_count = 1;
657 materials.gp_style->placement_density = 10.0f;
658 materials.gp_style->placement_radius_spacing = 100.0f;
697 brush.mesh_automasking_settings = MEM_new<MeshAutomaskingSettings>(__func__);
699 brush.mesh_automasking_settings->boundary_edges_propagation_steps =
700 brush.automasking_boundary_edges_propagation_steps;
701 brush.mesh_automasking_settings->cavity_blur_steps =
brush.automasking_cavity_blur_steps;
702 brush.mesh_automasking_settings->cavity_factor =
brush.automasking_cavity_factor;
703 brush.mesh_automasking_settings->start_normal_falloff =
704 brush.automasking_start_normal_falloff;
705 brush.mesh_automasking_settings->start_normal_limit =
brush.automasking_start_normal_limit;
706 brush.mesh_automasking_settings->view_normal_falloff =
brush.automasking_view_normal_falloff;
707 brush.mesh_automasking_settings->view_normal_limit =
brush.automasking_view_normal_limit;
709 brush.automasking_cavity_curve);
710 brush.mesh_automasking_settings->cavity_curve_op =
nullptr;
716 if (materials.gp_style !=
nullptr) {
717 materials.gp_style->random_size_factor = 0.0f;
718 materials.gp_style->random_strength_factor = 0.0f;
719 materials.gp_style->random_rotation_factor = 0.0f;
720 materials.gp_style->random_hue_factor = 0.0f;
721 materials.gp_style->random_saturation_factor = 0.0f;
722 materials.gp_style->random_value_factor = 0.0f;
723 materials.gp_style->random_noise_scale = 1.0f;
752 node.storage = MEM_new<NodeShaderRaycast>(__func__);
779 switch (
node.type_legacy) {
808 if (scrubbing_region) {
823 if (
mesh.attributes().contains(
".uv_seam")) {
824 mesh.attributes_for_write().rename(
".uv_seam",
"uv_seam");
840 object.parent_bone_head_tail_factor = 1.0;
850 if (
brush.gpencil_settings !=
nullptr) {
851 brush.gpencil_settings->fill_gap_factor = 0.4f;
864 float default_col[4] = {0.5f, 0.5f, 0.5f, 1.0f};
874 wm.xr.session_settings.viewfinder_enabled =
false;
875 wm.xr.session_settings.viewfinder_crosshair_enabled =
true;
878 wm.xr.session_settings.viewfinder_scale = 1.0f;
880 wm.xr.session_settings.viewfinder_passepartout_overscan = 0.5f;
881 wm.xr.session_settings.viewfinder_passepartout_opacity = 0.5f;
Low-level operations for curves.
#define IDP_int_get(prop)
#define IDP_string_get(prop)
#define IDP_bool_get(prop)
#define MAIN_VERSION_FILE_ATLEAST(main, ver, subver)
#define FOREACH_NODETREE_END
#define FOREACH_NODETREE_BEGIN(bmain, _nodetree, _id)
#define SH_NODE_BSDF_PRINCIPLED
#define FN_NODE_RANDOM_VALUE
#define FN_NODE_INPUT_VECTOR
#define CMP_NODE_OUTPUT_FILE
#define STRNCPY_UTF8(dst, src)
ID and Library types, which are fundamental for SDNA.
#define ID_IS_LINKED(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
bool add(const Key &key, const Value &value)
const Value & lookup(const Key &key) const
bool contains(const Key &key) const
bool contains(const Key &key) const
constexpr StringRefNull()
constexpr StringRef drop_known_prefix(StringRef prefix) const
static constexpr int64_t not_found
constexpr int64_t find(char c, int64_t pos=0) const
#define storage(slot, qualifiers)
std::unique_ptr< IDProperty, IDPropertyDeleter > create(StringRef prop_name, int32_t value, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_INT, set its name and value.
std::unique_ptr< IDProperty, IDPropertyDeleter > create_group(StringRef prop_name, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_GROUP.
void free(struct bMotionPath *mpath)
T & get_item_as(bNodeTreeInterfaceItem &item)
void mesh_freestyle_marks_to_generic(Mesh &mesh)
void node_update_asset_metadata(bNodeTree &node_tree)
void foreach_strip(ListBaseT< Strip > *seqbase, ForEachFunc callback, void *user_data)
Editing * editing_get(const Scene *scene)
SequencerToolSettings * tool_settings_ensure(Scene *scene)
@ COMPOSIT_NODE_ASSET_STRIP_MODIFIER
static void sanitize_node_tree_interface_socket_identifiers(bNodeTree &node_tree)
CurveMapping * BKE_curvemapping_copy(const CurveMapping *cumap)
char * STRNCPY(char(&dst)[N], const char *src)
IDProperty * IDP_GetPropertyTypeFromGroup(const IDProperty *prop, StringRef name, char type) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
@ GP_MATERIAL_PLACEMENT_COUNT
bool IDP_AddToGroup(IDProperty *group, IDProperty *prop) ATTR_NONNULL()
IDProperty * IDP_CopyProperty(const IDProperty *prop) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
static void version_geometry_nodes_properties(FileData &fd, Main &bmain, Object &object, NodesModifierData &nmd)
IDProperty * IDP_GetPropertyFromGroup(const IDProperty *prop, StringRef name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BKE_lib_override_flag_subdata_local(ID &id)
static void do_version_file_output_use_file_extension_recursive(bNodeTree &node_tree, const Scene &scene)
char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
static void version_compositor_effect_initialized(Main &bmain)
const char * BKE_id_name(const ID &id)
static void fix_single_point_curves_custom_knots(Main *bmain)
void do_versions_after_linking_502(FileData *fd, Main *bmain)
static void version_scene_strip_view_layer_name(Main &bmain)
void blo_do_versions_502(FileData *fd, Library *lib, Main *bmain)
@ RGN_ALIGN_HIDE_WITH_PREV
void BKE_animdata_fix_paths(ID &id, StringRef prefix, StringRef old_infix, StringRef new_infix, bool verify_paths, const DriverMap &driver_map)
void version_node_output_socket_name(bNodeTree *ntree, const int node_type, const char *old_name, const char *new_name)
@ XR_VIEWFINDER_HAND_RIGHT
size_t void BLI_uniquename_cb(FunctionRef< bool(StringRefNull)> unique_check, const char *defname, char delim, char *name, size_t name_maxncpy) ATTR_NONNULL(2
void version_node_socket_identifier_set(bNodeSocket &socket, const StringRefNull identifier)
bool RNA_validate_identifier(const char *identifier, bool is_property, const char **r_error)
BMesh const char void * data
static void version_solid_color_width_height_defaults(Main &bmain)
char char size_t BLI_str_escape(char *__restrict dst, StringRef src, size_t dst_maxncpy) ATTR_NONNULL(1)
@ SEQ_PREVIEW_SHOW_COMPOSITION_GUIDES
static void enable_compositor_nodes_is_strip_modifier(Main &bmain)
DriverMap BKE_animdata_build_driver_target_map(Main &bmain)
static void version_clear_strip_linear_modifier_flag(Main &bmain)
void version_socket_identifier_suffixes_for_dynamic_types(const ListBaseT< bNodeSocket > &sockets, const char *separator, const std::optional< int > total)
static void version_text_strip_space_line(Main &bmain)
void BLO_reportf_wrap(BlendFileReadReport *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
@ SEQ_SNAP_TO_ALL_CHANNEL_STRIPS
void RNA_identifier_sanitize(char *identifier, bool is_property)
static void versioning_replace_legacy_compositor_switch_node(bNodeTree *node_tree)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
void IDP_FreeProperty(IDProperty *prop)
void version_node_input_socket_name(bNodeTree *ntree, const int node_type, const char *old_name, const char *new_name)
Map< ID *, Vector< DriverTarget * > > DriverMap
MINLINE void copy_v4_v4(float r[4], const float a[4])
ARegion * do_versions_add_region_if_not_found(ListBaseT< ARegion > *regionbase, int region_type, const char *, int link_after_region_type)
@ NODE_INTERFACE_SOCKET_OUTPUT
@ NODE_INTERFACE_SOCKET_LAYER_SELECTION
@ NODE_INTERFACE_SOCKET_INPUT
@ UNIFIED_PAINT_SIZE_DEPRECATED
@ UNIFIED_PAINT_COLOR_DEPRECATED
@ UNIFIED_PAINT_ALPHA_DEPRECATED
@ GP_BRUSH_FILL_INTERNAL_GAPS
ViewLayer * BKE_view_layer_default_render(const Scene *scene)
void version_node_socket_index_animdata(Main *bmain, const int node_tree_type, const int node_type, const int socket_index_orig, const int socket_index_offset, const int total_number_of_sockets)
@ MOTIONPATH_BAKE_CAMERA_SPACE
@ MOTIONPATH_BAKE_HAS_PATHS
bNodeTree * version_get_scene_compositor_node_tree(Main *bmain, Scene *scene)
static void version_text_strip_abs_space_line(Main &bmain)
@ SN_OVERLAY_SHOW_RENDER_REGION
static void version_strip_modifier_show_preview_flag(Main &bmain)
eRegion_Alignment alignment
ListBaseT< Strip > seqbase
BlendFileReadReport * reports
ListBaseT< wmWindowManager > wm
ListBaseT< bNodeTree > nodetrees
ListBaseT< Brush > brushes
ListBaseT< Material > materials
ListBaseT< Object > objects
ListBaseT< Curve > curves
ListBaseT< Scene > scenes
ListBaseT< bScreen > screens
float start_normal_falloff
struct CurveMapping * cavity_curve_op
float view_normal_falloff
int boundary_edges_propagation_steps
struct CurveMapping * cavity_curve
struct IDProperty * system_properties
struct bNodeTree * node_group
struct NodesModifierSettings settings_legacy
struct IDProperty * properties
struct UnifiedPaintSettings unified_paint_settings
struct MeshAutomaskingSettings * mesh_automasking_settings
struct FFMpegCodecData ffcodecdata
struct ToolSettings * toolsettings
ListBaseT< ARegion > regionbase
ListBaseT< SpaceLink > spacedata
DNA_DEPRECATED float automasking_view_normal_falloff
DNA_DEPRECATED float automasking_start_normal_falloff
DNA_DEPRECATED struct CurveMapping * automasking_cavity_curve_op
DNA_DEPRECATED struct CurveMapping * automasking_cavity_curve
DNA_DEPRECATED float automasking_cavity_factor
DNA_DEPRECATED float automasking_view_normal_limit
DNA_DEPRECATED int automasking_cavity_blur_steps
DNA_DEPRECATED int automasking_boundary_edges_propagation_steps
DNA_DEPRECATED int automasking_flags
DNA_DEPRECATED float automasking_start_normal_limit
float composition_guide_color[4]
eSpaceSeq_SequencerPreviewOverlay_Flag flag
ListBaseT< ARegion > regionbase
eSpaceNodeOverlay_Flag flag
struct SequencerPreviewOverlay preview_overlay
eUnifiedPaintSettingsFlags flag
NodeTreeInterfaceItemType item_type
struct CompositorNodeAssetTraits * compositor_node_asset_traits
bNodeTreeInterface tree_interface
ListBaseT< struct ScrArea > areabase