9#define DNA_DEPRECATED_ALLOW
14#define DNA_GENFILE_VERSIONING_MACROS
28#undef DNA_GENFILE_VERSIONING_MACROS
66 bool any_valid_tweakmode_left =
false;
77 any_valid_tweakmode_left =
true;
87 if (any_valid_tweakmode_left) {
115 for (const int i : range) {
116 radii[i] *= bke::greasepencil::LEGACY_RADIUS_CONVERSION_FACTOR;
132 if (roughness_socket ==
nullptr) {
140 bNode *roughness_from_node =
nullptr;
145 if (link->tosock == roughness_socket) {
146 roughness_link = link;
147 roughness_from_node = link->fromnode;
148 roughness_from_socket = link->fromsock;
152 if (roughness_link !=
nullptr) {
159 clamp_node->
locy_legacy = node->locy_legacy - 300.0f;
162 *clamp_node,
SOCK_IN,
"Value");
173 *ntree, *roughness_from_node, *roughness_from_socket, *clamp_node, *clamp_socket_value);
175 *ntree, *clamp_node, *clamp_socket_out, *node, *roughness_socket);
178 *roughness = std::clamp(*roughness, 0.0f, 1.0f);
198 data->normalize =
false;
201 node->storage =
data;
204 bNode *detail_from_node =
nullptr;
208 bNode *roughness_from_node =
nullptr;
212 bNode *lacunarity_from_node =
nullptr;
217 if (link->tonode == node) {
218 if (
STREQ(link->tosock->identifier,
"Detail")) {
220 detail_from_node = link->fromnode;
221 detail_from_socket = link->fromsock;
223 if (
STREQ(link->tosock->identifier,
"Roughness")) {
224 roughness_link = link;
225 roughness_from_node = link->fromnode;
226 roughness_from_socket = link->fromsock;
228 if (
STREQ(link->tosock->identifier,
"Lacunarity")) {
229 lacunarity_link = link;
230 lacunarity_from_node = link->fromnode;
231 lacunarity_from_socket = link->fromsock;
236 uint8_t noise_type = (
static_cast<NodeTexNoise *
>(node->storage))->type;
237 float locy_offset = 0.0f;
241 fac_socket->
label[0] =
'\0';
246 if (detail_link !=
nullptr) {
247 locy_offset -= 80.0f;
255 min_node->
locy_legacy = node->locy_legacy - 320.0f;
265 sub1_node->
locy_legacy = node->locy_legacy - 360.0f;
276 *ntree, *detail_from_node, *detail_from_socket, *sub1_node, *sub1_socket_A);
281 locy_offset -= 40.0f;
289 greater_node->
locy_legacy = node->locy_legacy - 400.0f;
301 *ntree, *detail_from_node, *detail_from_socket, *greater_node, *greater_socket_A);
303 *ntree, *greater_node, *greater_socket_out, *sub1_node, *sub1_socket_B);
312 clamp_node->
locy_legacy = node->locy_legacy + 40.0f;
315 *clamp_node,
SOCK_IN,
"Value");
344 sub2_node->
locy_legacy = node->locy_legacy + 120.0f;
356 add_node->locx_legacy = node->locx_legacy;
357 add_node->locy_legacy = node->locy_legacy + 160.0f;
369 if (link->fromsock == fac_socket) {
371 *ntree, *
add_node, *add_socket_out, *link->tonode, *link->tosock);
377 *ntree, *mul_node, *mul_socket_out, *
add_node, *add_socket_A);
379 *ntree, *detail_from_node, *detail_from_socket, *sub2_node, *sub2_socket_B);
381 *ntree, *sub2_node, *sub2_socket_out, *
add_node, *add_socket_B);
385 if (link->fromsock == fac_socket) {
387 *ntree, *mul_node, *mul_socket_out, *link->tonode, *link->tosock);
395 *ntree, *detail_from_node, *detail_from_socket, *clamp_node, *clamp_socket_value);
397 *ntree, *clamp_node, *clamp_socket_out, *mul_node, *mul_socket_B);
426 add_node->locx_legacy = node->locx_legacy;
427 add_node->locy_legacy = node->locy_legacy + 80.0f;
439 if (link->fromsock == fac_socket) {
441 *ntree, *
add_node, *add_socket_out, *link->tonode, *link->tosock);
447 *ntree, *mul_node, *mul_socket_out, *
add_node, *add_socket_A);
451 if (link->fromsock == fac_socket) {
453 *ntree, *mul_node, *mul_socket_out, *link->tonode, *link->tosock);
474 *roughness = std::fmaxf(*roughness, 1e-5f);
475 *lacunarity = std::fmaxf(*lacunarity, 1e-5f);
477 if (roughness_link !=
nullptr) {
485 max1_node->
locy_legacy = node->locy_legacy - 400.0f + locy_offset;
495 mul_node->
locy_legacy = node->locy_legacy - 360.0f + locy_offset;
505 pow_node->
locy_legacy = node->locy_legacy - 320.0f + locy_offset;
517 *ntree, *roughness_from_node, *roughness_from_socket, *max1_node, *max1_socket_A);
522 if (lacunarity_link !=
nullptr) {
529 max2_node->
locy_legacy = node->locy_legacy - 440.0f + locy_offset;
542 *ntree, *lacunarity_from_node, *lacunarity_from_socket, *max2_node, *max2_socket_A);
544 *ntree, *max2_node, *max2_socket_out, *pow_node, *pow_socket_A);
546 *ntree, *max2_node, *max2_socket_out, *node, *lacunarity_socket);
549 else if ((lacunarity_link !=
nullptr) && (roughness_link ==
nullptr)) {
557 max2_node->
locy_legacy = node->locy_legacy - 360.0f + locy_offset;
567 pow_node->
locy_legacy = node->locy_legacy - 320.0f + locy_offset;
579 *ntree, *lacunarity_from_node, *lacunarity_from_socket, *max2_node, *max2_socket_A);
585 *roughness = std::pow(*lacunarity, -(*roughness));
605 node->storage =
nullptr;
609 viewer_node->
locx_legacy = node->locx_legacy + node->width + viewer_node->
width / 4.0f;
622 ListBase sockets,
const char *separator,
const std::optional<int> total = std::nullopt)
626 if (socket->is_available()) {
627 if (
char *
pos = strstr(socket->identifier, separator)) {
631 if (total.has_value()) {
633 if (index == *total) {
642 BLI_strncat(socket->identifier,
"_deprecated",
sizeof(socket->identifier));
650 switch (node->type_legacy) {
698 copy_v3_v3(new_value->value_euler, old_value->value);
702 if (link->tosock != &socket) {
706 !link->fromnode->is_reroute())
711 if (
STREQ(link->fromnode->idname,
"FunctionNodeEulerToRotation")) {
716 convert->parent = node.
parent;
719 link->tonode = convert;
736 if (link->fromsock != &socket) {
743 if (
STREQ(link->tonode->idname,
"FunctionNodeRotationToEuler"))
748 convert->parent = node.
parent;
751 link->fromnode = convert;
766 "GeometryNodeInstanceOnPoints",
767 "GeometryNodeRotateInstances",
768 "GeometryNodeTransform"))
774 "GeometryNodeDistributePointsOnFaces",
775 "GeometryNodeObjectInfo",
776 "GeometryNodeInputInstanceRotation"))
790 out_links_per_socket.
add(link->fromsock, link);
806 absolute_value->
locx_legacy = node->locx_legacy + 100;
807 absolute_value->
locy_legacy = node->locy_legacy - 50;
814 link->fromnode = absolute_value;
879 bool transparent_shadows =
true;
881 transparent_shadows = material->blend_shadow !=
MA_BS_SOLID;
885 cmat,
"use_transparent_shadow",
true);
904 if (!DNA_struct_member_exists(fd->
filesdna,
"SceneEEVEE",
"int",
"volumetric_ray_depth")) {
911 if (!DNA_struct_member_exists(fd->
filesdna,
"Material",
"char",
"surface_render_method")) {
913 mat->surface_render_method = (mat->blend_method ==
MA_BM_BLEND) ?
922 const ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
935 if (!DNA_struct_member_exists(fd->
filesdna,
"SceneEEVEE",
"float",
"gtao_thickness")) {
938 scene->eevee.gtao_thickness = default_eevee.gtao_thickness;
943 if (!DNA_struct_member_exists(fd->
filesdna,
"LightProbe",
"float",
"data_display_size")) {
965 if (!DNA_struct_member_exists(fd->
filesdna,
"Material",
"char",
"displacement_method")) {
973 material->displacement_method = displacement_method;
981 bone->color.custom.solid[3] = 255;
982 bone->color.custom.select[3] = 255;
983 bone->color.custom.active[3] = 255;
987 ebone->color.custom.solid[3] = 255;
988 ebone->color.custom.select[3] = 255;
989 ebone->color.custom.active[3] = 255;
994 if (obj->pose ==
nullptr) {
998 pchan->color.custom.solid[3] = 255;
999 pchan->color.custom.select[3] = 255;
1000 pchan->color.custom.active[3] = 255;
1006 if (!DNA_struct_member_exists(
1007 fd->
filesdna,
"SceneEEVEE",
"RaytraceEEVEE",
"ray_tracing_options"))
1014 scene->eevee.ray_tracing_options.screen_trace_quality = 0.25f;
1015 scene->eevee.ray_tracing_options.screen_trace_thickness = 0.2f;
1016 scene->eevee.ray_tracing_options.trace_max_roughness = 0.5f;
1017 scene->eevee.ray_tracing_options.resolution_scale = 2;
1081 keying_data.edge_kernel_radius =
max_ii(keying_data.edge_kernel_radius - 1, 0);
1091 Sculpt *sculpt = scene->toolsettings->sculpt;
1092 if (sculpt !=
nullptr) {
1103 int input_sample_values[9];
1106 input_sample_values[1] = ts->
sculpt !=
nullptr ?
1113 input_sample_values[3] = ts->
gp_paint !=
nullptr ?
1126 input_sample_values[7] = ts->
vpaint !=
nullptr ?
1129 input_sample_values[8] = ts->
wpaint !=
nullptr ?
1133 int unified_value = 1;
1134 for (
int i = 0;
i < 9;
i++) {
1135 if (input_sample_values[
i] != 1) {
1136 if (unified_value == 1) {
1137 unified_value = input_sample_values[
i];
1149 ts->unified_paint_settings.input_samples = unified_value;
1152 brush->input_samples = 1;
1158 if (scene->ed !=
nullptr) {
1179 md->persistent_uid = uid++;
1188 if (brush->gpencil_settings && (brush->gpencil_settings->sculpt_flag &
BRUSH_DIR_IN) != 0) {
AnimData * BKE_animdata_from_id(const ID *id)
Low-level operations for grease pencil.
#define FOREACH_MAIN_ID_END
#define MAIN_VERSION_FILE_ATLEAST(main, ver, subver)
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
void BKE_nla_tweakmode_exit(OwnedAnimData owned_adt)
#define FOREACH_NODETREE_END
#define FOREACH_NODETREE_BEGIN(bmain, _nodetree, _id)
#define SH_NODE_TEX_NOISE
#define GEO_NODE_OBJECT_INFO
#define GEO_NODE_STORE_NAMED_ATTRIBUTE
#define FN_NODE_ROTATE_ROTATION
#define GEO_NODE_SAMPLE_NEAREST_SURFACE
#define GEO_NODE_EVALUATE_AT_INDEX
#define GEO_NODE_ATTRIBUTE_STATISTIC
#define GEO_NODE_INPUT_NAMED_ATTRIBUTE
#define GEO_NODE_EVALUATE_ON_DOMAIN
#define GEO_NODE_ACCUMULATE_FIELD
#define GEO_NODE_SAMPLE_CURVE
#define SH_NODE_TEX_MUSGRAVE_DEPRECATED
#define CMP_NODE_PIXELATE
#define GEO_NODE_SAMPLE_UV_SURFACE
#define GEO_NODE_CAPTURE_ATTRIBUTE
#define CMP_NODE_SPLITVIEWER__DEPRECATED
#define GEO_NODE_BLUR_ATTRIBUTE
#define GEO_NODE_SAMPLE_INDEX
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
#define LISTBASE_FOREACH_BACKWARD_MUTABLE(type, var, list)
MINLINE int max_ii(int a, int b)
MINLINE void copy_v3_v3(float r[3], const float a[3])
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
char char size_t char * BLI_strncat(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define STRNCPY_UTF8(dst, src)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define DNA_struct_default_get(struct_name)
blenloader genfile private function prototypes
@ MA_BL_TRANSPARENT_SHADOW
@ MA_SURFACE_METHOD_DEFERRED
@ MA_SURFACE_METHOD_FORWARD
@ ME_NO_OVERLAPPING_TOPOLOGY
@ NODE_VECTOR_MATH_ABSOLUTE
@ CMP_NODE_INTERPOLATION_ANISOTROPIC
@ SHD_NOISE_RIDGED_MULTIFRACTAL
@ SHD_NOISE_HETERO_TERRAIN
@ RAYTRACE_EEVEE_USE_DENOISE
@ RAYTRACE_EEVEE_DENOISE_BILATERAL
@ RAYTRACE_EEVEE_DENOISE_SPATIAL
@ RAYTRACE_EEVEE_DENOISE_TEMPORAL
@ RGN_ALIGN_HIDE_WITH_PREV
@ RGN_TYPE_ASSET_SHELF_HEADER
@ SEQ_TRANSFORM_FILTER_AUTO
@ SEQ_TRANSFORM_FILTER_BILINEAR
BMesh const char void * data
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
Span< Value > lookup(const Key &key) const
void add(const Key &key, const Value &value)
constexpr IndexRange index_range() const
constexpr bool is_empty() const
constexpr const char * data() const
MutableSpan< float > radii_for_write()
void * MEM_callocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)
static void ANIM_armature_foreach_bone(ListBase *bones, CB callback)
bNodeSocket * node_find_socket(bNode &node, eNodeSocketInOut in_out, StringRef identifier)
bNode * node_add_node(const bContext *C, bNodeTree &ntree, StringRef idname, std::optional< int > unique_identifier=std::nullopt)
void node_remove_link(bNodeTree *ntree, bNodeLink &link)
bNode * node_add_static_node(const bContext *C, bNodeTree &ntree, int type)
bNodeLink & node_add_link(bNodeTree &ntree, bNode &fromnode, bNodeSocket &fromsock, bNode &tonode, bNodeSocket &tosock)
bNodeSocket * node_add_static_socket(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out, int type, int subtype, StringRefNull identifier, StringRefNull name)
void foreach_strip(ListBase *seqbase, ForEachFunc callback, void *user_data)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
float wrap(float value, float max, float min)
const char * RE_engine_id_BLENDER_EEVEE_NEXT
const char * RE_engine_id_BLENDER_EEVEE
float automasking_view_normal_limit
float automasking_start_normal_limit
float automasking_start_normal_falloff
float automasking_view_normal_falloff
int num_input_samples_deprecated
int automasking_boundary_edges_propagation_steps
StripTransform * transform
bNodeTreeInterface tree_interface
static bNode * add_node(bNodeTree *ntree, const int type, const blender::float2 loc)
static void versioning_nodes_dynamic_sockets_2(bNodeTree &ntree)
static bool strip_filter_bilinear_to_auto(Strip *strip, void *)
static void versioning_replace_musgrave_texture_node(bNodeTree *ntree)
static void version_nla_tweakmode_incomplete(Main *bmain)
static void version_socket_identifier_suffixes_for_dynamic_types(ListBase sockets, const char *separator, const std::optional< int > total=std::nullopt)
static void versioning_fix_socket_subtype_idnames(bNodeTree *ntree)
void do_versions_after_linking_410(FileData *, Main *bmain)
static void fix_geometry_nodes_object_info_scale(bNodeTree &ntree)
static void change_input_socket_to_rotation_type(bNodeTree &ntree, bNode &node, bNodeSocket &socket)
static void versioning_update_noise_texture_node(bNodeTree *ntree)
static void versioning_replace_splitviewer(bNodeTree *ntree)
static void change_output_socket_to_rotation_type(bNodeTree &ntree, bNode &node, bNodeSocket &socket)
static void version_geometry_nodes_use_rotation_socket(bNodeTree &ntree)
static void versioning_nodes_dynamic_sockets(bNodeTree &ntree)
void blo_do_versions_410(FileData *fd, Library *, Main *bmain)
static void versioning_grease_pencil_stroke_radii_scaling(GreasePencil *grease_pencil)
bool all_scenes_use(Main *bmain, const blender::Span< const char * > engines)
float * version_cycles_node_socket_float_value(bNodeSocket *socket)
IDProperty * version_cycles_properties_from_ID(ID *id)
int version_cycles_property_int(IDProperty *idprop, const char *name, int default_value)
void version_node_input_socket_name(bNodeTree *ntree, const int node_type, const char *old_name, const char *new_name)
void version_node_socket_name(bNodeTree *ntree, const int node_type, const char *old_name, const char *new_name)
StringRef legacy_socket_idname_to_socket_type(StringRef idname)
bool version_cycles_property_boolean(IDProperty *idprop, const char *name, bool default_value)
void version_socket_update_is_used(bNodeTree *ntree)