9#define DNA_DEPRECATED_ALLOW
14#define DNA_GENFILE_VERSIONING_MACROS
28#undef DNA_GENFILE_VERSIONING_MACROS
65 bool any_valid_tweakmode_left =
false;
76 any_valid_tweakmode_left =
true;
86 if (any_valid_tweakmode_left) {
114 for (const int i : range) {
115 radii[i] *= bke::greasepencil::LEGACY_RADIUS_CONVERSION_FACTOR;
131 if (roughness_socket ==
nullptr) {
139 bNode *roughness_from_node =
nullptr;
144 if (link->tosock == roughness_socket) {
145 roughness_link = link;
146 roughness_from_node = link->fromnode;
147 roughness_from_socket = link->fromsock;
151 if (roughness_link !=
nullptr) {
158 clamp_node->
locy_legacy = node->locy_legacy - 300.0f;
161 *clamp_node,
SOCK_IN,
"Value");
172 *ntree, *roughness_from_node, *roughness_from_socket, *clamp_node, *clamp_socket_value);
174 *ntree, *clamp_node, *clamp_socket_out, *node, *roughness_socket);
177 *roughness = std::clamp(*roughness, 0.0f, 1.0f);
192 STRNCPY(node->idname,
"ShaderNodeTexNoise");
197 data->normalize =
false;
200 node->storage =
data;
203 bNode *detail_from_node =
nullptr;
207 bNode *roughness_from_node =
nullptr;
211 bNode *lacunarity_from_node =
nullptr;
216 if (link->tonode == node) {
217 if (
STREQ(link->tosock->identifier,
"Detail")) {
219 detail_from_node = link->fromnode;
220 detail_from_socket = link->fromsock;
222 if (
STREQ(link->tosock->identifier,
"Roughness")) {
223 roughness_link = link;
224 roughness_from_node = link->fromnode;
225 roughness_from_socket = link->fromsock;
227 if (
STREQ(link->tosock->identifier,
"Lacunarity")) {
228 lacunarity_link = link;
229 lacunarity_from_node = link->fromnode;
230 lacunarity_from_socket = link->fromsock;
235 uint8_t noise_type = (
static_cast<NodeTexNoise *
>(node->storage))->type;
236 float locy_offset = 0.0f;
240 fac_socket->
label[0] =
'\0';
245 if (detail_link !=
nullptr) {
246 locy_offset -= 80.0f;
254 min_node->
locy_legacy = node->locy_legacy - 320.0f;
264 sub1_node->
locy_legacy = node->locy_legacy - 360.0f;
275 *ntree, *detail_from_node, *detail_from_socket, *sub1_node, *sub1_socket_A);
280 locy_offset -= 40.0f;
288 greater_node->
locy_legacy = node->locy_legacy - 400.0f;
300 *ntree, *detail_from_node, *detail_from_socket, *greater_node, *greater_socket_A);
302 *ntree, *greater_node, *greater_socket_out, *sub1_node, *sub1_socket_B);
311 clamp_node->
locy_legacy = node->locy_legacy + 40.0f;
314 *clamp_node,
SOCK_IN,
"Value");
343 sub2_node->
locy_legacy = node->locy_legacy + 120.0f;
355 add_node->locx_legacy = node->locx_legacy;
356 add_node->locy_legacy = node->locy_legacy + 160.0f;
368 if (link->fromsock == fac_socket) {
370 *ntree, *
add_node, *add_socket_out, *link->tonode, *link->tosock);
376 *ntree, *mul_node, *mul_socket_out, *
add_node, *add_socket_A);
378 *ntree, *detail_from_node, *detail_from_socket, *sub2_node, *sub2_socket_B);
380 *ntree, *sub2_node, *sub2_socket_out, *
add_node, *add_socket_B);
384 if (link->fromsock == fac_socket) {
386 *ntree, *mul_node, *mul_socket_out, *link->tonode, *link->tosock);
394 *ntree, *detail_from_node, *detail_from_socket, *clamp_node, *clamp_socket_value);
396 *ntree, *clamp_node, *clamp_socket_out, *mul_node, *mul_socket_B);
425 add_node->locx_legacy = node->locx_legacy;
426 add_node->locy_legacy = node->locy_legacy + 80.0f;
438 if (link->fromsock == fac_socket) {
440 *ntree, *
add_node, *add_socket_out, *link->tonode, *link->tosock);
446 *ntree, *mul_node, *mul_socket_out, *
add_node, *add_socket_A);
450 if (link->fromsock == fac_socket) {
452 *ntree, *mul_node, *mul_socket_out, *link->tonode, *link->tosock);
473 *roughness = std::fmaxf(*roughness, 1e-5f);
474 *lacunarity = std::fmaxf(*lacunarity, 1e-5f);
476 if (roughness_link !=
nullptr) {
484 max1_node->
locy_legacy = node->locy_legacy - 400.0f + locy_offset;
494 mul_node->
locy_legacy = node->locy_legacy - 360.0f + locy_offset;
504 pow_node->
locy_legacy = node->locy_legacy - 320.0f + locy_offset;
516 *ntree, *roughness_from_node, *roughness_from_socket, *max1_node, *max1_socket_A);
521 if (lacunarity_link !=
nullptr) {
528 max2_node->
locy_legacy = node->locy_legacy - 440.0f + locy_offset;
541 *ntree, *lacunarity_from_node, *lacunarity_from_socket, *max2_node, *max2_socket_A);
543 *ntree, *max2_node, *max2_socket_out, *pow_node, *pow_socket_A);
545 *ntree, *max2_node, *max2_socket_out, *node, *lacunarity_socket);
548 else if ((lacunarity_link !=
nullptr) && (roughness_link ==
nullptr)) {
556 max2_node->
locy_legacy = node->locy_legacy - 360.0f + locy_offset;
566 pow_node->
locy_legacy = node->locy_legacy - 320.0f + locy_offset;
578 *ntree, *lacunarity_from_node, *lacunarity_from_socket, *max2_node, *max2_socket_A);
584 *roughness = std::pow(*lacunarity, -(*roughness));
601 STRNCPY(node->idname,
"CompositorNodeSplit");
604 node->storage =
nullptr;
608 viewer_node->
locx_legacy = node->locx_legacy + node->width + viewer_node->
width / 4.0f;
621 ListBase sockets,
const char *separator,
const std::optional<int> total = std::nullopt)
625 if (socket->is_available()) {
626 if (
char *
pos = strstr(socket->identifier, separator)) {
630 if (total.has_value()) {
632 if (index == *total) {
641 BLI_strncat(socket->identifier,
"_deprecated",
sizeof(socket->identifier));
649 switch (node->type_legacy) {
697 copy_v3_v3(new_value->value_euler, old_value->value);
701 if (link->tosock != &socket) {
705 !link->fromnode->is_reroute())
710 if (
STREQ(link->fromnode->idname,
"FunctionNodeEulerToRotation")) {
715 convert->parent = node.
parent;
718 link->tonode = convert;
735 if (link->fromsock != &socket) {
742 if (
STREQ(link->tonode->idname,
"FunctionNodeRotationToEuler"))
747 convert->parent = node.
parent;
750 link->fromnode = convert;
765 "GeometryNodeInstanceOnPoints",
766 "GeometryNodeRotateInstances",
767 "GeometryNodeTransform"))
773 "GeometryNodeDistributePointsOnFaces",
774 "GeometryNodeObjectInfo",
775 "GeometryNodeInputInstanceRotation"))
789 out_links_per_socket.
add(link->fromsock, link);
805 absolute_value->
locx_legacy = node->locx_legacy + 100;
806 absolute_value->
locy_legacy = node->locy_legacy - 50;
813 link->fromnode = absolute_value;
878 bool transparent_shadows =
true;
880 transparent_shadows = material->blend_shadow !=
MA_BS_SOLID;
884 cmat,
"use_transparent_shadow",
true);
903 if (!DNA_struct_member_exists(fd->
filesdna,
"SceneEEVEE",
"int",
"volumetric_ray_depth")) {
910 if (!DNA_struct_member_exists(fd->
filesdna,
"Material",
"char",
"surface_render_method")) {
912 mat->surface_render_method = (mat->blend_method ==
MA_BM_BLEND) ?
921 const ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
934 if (!DNA_struct_member_exists(fd->
filesdna,
"SceneEEVEE",
"float",
"gtao_thickness")) {
938 scene->eevee.gtao_focus = default_eevee.
gtao_focus;
942 if (!DNA_struct_member_exists(fd->
filesdna,
"LightProbe",
"float",
"data_display_size")) {
964 if (!DNA_struct_member_exists(fd->
filesdna,
"Material",
"char",
"displacement_method")) {
972 material->displacement_method = displacement_method;
980 bone->color.custom.solid[3] = 255;
981 bone->color.custom.select[3] = 255;
982 bone->color.custom.active[3] = 255;
986 ebone->color.custom.solid[3] = 255;
987 ebone->color.custom.select[3] = 255;
988 ebone->color.custom.active[3] = 255;
993 if (obj->pose ==
nullptr) {
997 pchan->color.custom.solid[3] = 255;
998 pchan->color.custom.select[3] = 255;
999 pchan->color.custom.active[3] = 255;
1005 if (!DNA_struct_member_exists(
1006 fd->
filesdna,
"SceneEEVEE",
"RaytraceEEVEE",
"ray_tracing_options"))
1013 scene->eevee.ray_tracing_options.screen_trace_quality = 0.25f;
1014 scene->eevee.ray_tracing_options.screen_trace_thickness = 0.2f;
1015 scene->eevee.ray_tracing_options.trace_max_roughness = 0.5f;
1016 scene->eevee.ray_tracing_options.resolution_scale = 2;
1080 keying_data.edge_kernel_radius =
max_ii(keying_data.edge_kernel_radius - 1, 0);
1090 Sculpt *sculpt = scene->toolsettings->sculpt;
1091 if (sculpt !=
nullptr) {
1102 int input_sample_values[9];
1105 input_sample_values[1] = ts->
sculpt !=
nullptr ?
1112 input_sample_values[3] = ts->
gp_paint !=
nullptr ?
1125 input_sample_values[7] = ts->
vpaint !=
nullptr ?
1128 input_sample_values[8] = ts->
wpaint !=
nullptr ?
1132 int unified_value = 1;
1133 for (
int i = 0;
i < 9;
i++) {
1134 if (input_sample_values[
i] != 1) {
1135 if (unified_value == 1) {
1136 unified_value = input_sample_values[
i];
1151 brush->input_samples = 1;
1157 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
char * STRNCPY(char(&dst)[N], const char *src)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define DNA_struct_default_get(struct_name)
blenloader genfile private function prototypes
@ MA_SURFACE_METHOD_DEFERRED
@ MA_SURFACE_METHOD_FORWARD
@ MA_BL_TRANSPARENT_SHADOW
@ ME_NO_OVERLAPPING_TOPOLOGY
@ NODE_VECTOR_MATH_ABSOLUTE
@ CMP_NODE_MAP_UV_FILTERING_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_TYPE_ASSET_SHELF_HEADER
@ RGN_ALIGN_HIDE_WITH_PREV
@ 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)
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 for_each_callback(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)