22 #define DNA_DEPRECATED_ALLOW
60 return &socket_data->
value;
66 return socket_data->
value;
72 return socket_data->
value;
90 return (prop) ?
IDP_Float(prop) : default_value;
96 return (prop) ?
IDP_Int(prop) : default_value;
124 bool need_update =
false;
129 prevlink = link->
prev;
132 bNode *fromnode = link->fromnode;
134 bNode *tonode = link->tonode;
196 bool need_update =
false;
203 *roughness_value =
sqrtf(
max_ff(*roughness_value, 0.0f));
210 prevlink = link->
prev;
213 bNode *fromnode = link->fromnode;
215 bNode *tonode = link->tonode;
263 for (
int curve_index = 0; curve_index <
CM_TOT; curve_index++) {
266 for (
int i = 0; i < cm->
totpoint; i++) {
279 bool need_update =
false;
295 prevlink = link->
prev;
298 bNode *fromnode = link->fromnode;
299 bNode *tonode = link->tonode;
328 color_space =
tex->color_space;
332 color_space =
tex->color_space;
338 const int SHD_COLORSPACE_NONE = 0;
340 if (color_space == SHD_COLORSPACE_NONE) {
359 if (output_node ==
NULL) {
366 emission_node = link->fromnode;
371 if (emission_node ==
NULL) {
386 *energy = *strength_value;
389 *strength_value = 1.0f;
402 float energy, color[3];
405 if (
STREQ(engine,
"CYCLES")) {
434 bool need_update =
false;
483 bool need_update =
false;
505 if (link->fromsock == sockOutValue) {
535 bool need_update =
false;
542 if (link->fromsock == sockOutVector) {
543 switch (link->tosock->type) {
574 bool need_update =
false;
588 if (link->fromsock == sockOutVector) {
589 nodeAddLink(
ntree, normalizeNode, sockNormalizeOut, link->tonode, link->tosock);
613 if (link->fromsock == sockOutValue) {
640 bool need_update =
false;
655 if (link->fromsock == sockOutValue) {
656 nodeAddLink(
ntree, lengthNode, sockLengthValue, link->tonode, link->tosock);
703 switch (
node->custom1) {
726 bool need_update =
false;
731 if (
node->custom1 == -1) {
742 if (link->fromsock == sockOutVector) {
743 nodeAddLink(
ntree, normalizeNode, sockNormalizeOut, link->tonode, link->tosock);
767 if (link->fromsock == sockOutValue) {
831 char *old_fcurve_rna_path = fcurve->
rna_path;
843 char node_name_esc[
sizeof(
data->minimumNode->name) * 2];
848 char node_name_esc[
sizeof(
data->maximumNode->name) * 2];
853 if (fcurve->
rna_path != old_fcurve_rna_path) {
879 bool need_update =
false;
888 node->width = 140.0f;
902 maximumNode->
locx =
node->locx + (
node->width + 20.0f) * 2.0f;
913 if (link->fromsock == sockMappingResult) {
915 nodeAddLink(
ntree, maximumNode, sockMaximumResult, link->tonode, link->tosock);
941 nodeAddLink(
ntree, minimumNode, sockMinimumResult, maximumNode, sockMaximumA);
945 if (link->fromsock == sockMappingResult) {
946 nodeAddLink(
ntree, minimumNode, sockMinimumResult, link->tonode, link->tosock);
960 char node_name_esc[
sizeof(
node->name) * 2];
963 char *nodePath =
BLI_sprintfN(
"nodes[\"%s\"]", node_name_esc);
997 link->fromsock = link->fromsock->next;
1011 tex->dimensions = 3;
1045 strcpy(facOutput->
name,
"Distance");
1069 bool need_update =
false;
1093 if (sockVector->link) {
1095 sockVector->link->fromnode,
1096 sockVector->link->fromsock,
1102 if (sockScale->
link) {
1111 if (sockExponent->
link) {
1116 sockVoronoiExponent);
1121 subtractNode->
locx = voronoiNode->
locx + voronoiNode->
width + 20.0f;
1122 subtractNode->
locy = voronoiNode->
locy;
1126 if (link->fromnode ==
node) {
1127 nodeAddLink(
ntree, subtractNode, sockSubtractOutValue, link->tonode, link->tosock);
1138 nodeAddLink(
ntree, voronoiNode, sockDistanceF2, subtractNode, sockSubtractA);
1160 bool need_update =
false;
1166 if (
tex->coloring == 0) {
1168 if (link->fromsock == sockColor) {
1177 if (link->fromsock == sockDistance) {
1198 bool need_update =
false;
1213 if (link->fromsock == sockDistance) {
1241 bool need_update =
false;
1256 mulNode->
locy =
node->locy - 240.0f;
1264 nodeAddLink(
ntree, distortionInputNode, distortionInputSock, mulNode, mulSockA);
1269 else if (*distortion != 0.0f) {
1270 *distortion = *distortion * 0.5f;
1332 cscene,
"film_transparent",
false);
1454 if (aperture_size > 0.0f) {
1456 camera->dof.aperture_fstop = 1.0f / (2.0f * aperture_size);
1459 camera->dof.aperture_fstop = (camera->lens * 1e-3f) / (2.0f * aperture_size);
1467 camera->dof.aperture_fstop = 2.8f;
1468 camera->dof.aperture_blades = 0;
1469 camera->dof.aperture_rotation = 0.0f;
1470 camera->dof.aperture_ratio = 1.0f;
1561 bool use_optix =
false;
1562 bool use_denoising =
false;
1564 view_layer = view_layer->next) {
1567 use_denoising = use_denoising ||
1569 use_optix = use_optix ||
1575 const int DENOISER_AUTO = 0;
1592 if (!use_denoising) {
1594 view_layer = view_layer->next) {
void BKE_fcurves_id_cb(struct ID *id, ID_FCurve_Edit_Callback func, void *user_data)
struct IDProperty * IDP_GetPropertyTypeFromGroup(const struct IDProperty *prop, const char *name, const char type) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
struct IDProperty * IDP_GetProperties(struct ID *id, const bool create_if_needed) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool IDP_AddToGroup(struct IDProperty *group, struct IDProperty *prop) ATTR_NONNULL()
struct IDProperty * IDP_New(const char type, const IDPropertyTemplate *val, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
#define MAIN_VERSION_ATLEAST(main, ver, subver)
#define SH_NODE_BSDF_PRINCIPLED
struct bNode * ntreeShaderOutputNode(struct bNodeTree *ntree, int target)
#define SH_NODE_TEX_ENVIRONMENT
void nodeRemLink(struct bNodeTree *ntree, struct bNodeLink *link)
void ntreeUpdateTree(struct Main *main, struct bNodeTree *ntree)
#define FOREACH_NODETREE_END
struct bNodeLink * nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock)
struct bNodeSocket * nodeFindSocket(const struct bNode *node, eNodeSocketInOut in_out, const char *identifier)
#define SH_NODE_BSDF_ANISOTROPIC
#define FOREACH_NODETREE_BEGIN(bmain, _nodetree, _id)
#define SH_NODE_BSDF_GLASS
struct bNode * nodeAddStaticNode(const struct bContext *C, struct bNodeTree *ntree, int type)
#define SH_NODE_DISPLACEMENT
#define SH_NODE_TEX_MUSGRAVE
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
#define LISTBASE_FOREACH_BACKWARD_MUTABLE(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float max_ff(float a, float b)
void quat_to_eulO(float eul[3], const short order, const float quat[4])
void eulO_to_quat(float quat[4], const float eul[3], const short order)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void copy_v4_fl(float r[4], float f)
size_t size_t char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
#define STRNCPY(dst, src)
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, const size_t dst_maxncpy) ATTR_NONNULL()
bool BLI_str_endswith(const char *__restrict str, const char *__restrict end) ATTR_NONNULL()
external readfile function prototypes.
@ NODE_VECTOR_MATH_NORMALIZE
@ NODE_VECTOR_MATH_LENGTH
@ NODE_VECTOR_MATH_CROSS_PRODUCT
@ NODE_VECTOR_MATH_DOT_PRODUCT
@ NODE_VECTOR_MATH_ABSOLUTE
@ NODE_VECTOR_MATH_MAXIMUM
@ NODE_VECTOR_MATH_SUBTRACT
@ NODE_VECTOR_MATH_MINIMUM
@ SHD_WAVE_RINGS_DIRECTION_SPHERICAL
@ SHD_WAVE_BANDS_DIRECTION_DIAGONAL
@ SHD_SUBSURFACE_RANDOM_WALK
const char * IMB_colormanagement_role_colorspace_name_get(int role)
Read Guarded memory(de)allocation.
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky SH_NODE_TEX_NOISE
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy SH_NODE_BSDF_REFRACTION
Group RGB to Bright SH_NODE_CURVE_VEC
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise SH_NODE_TEX_WAVE
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave SH_NODE_TEX_VORONOI
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse SH_NODE_BSDF_GLOSSY
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add SH_NODE_AMBIENT_OCCLUSION
Group RGB to Bright Vector Camera SH_NODE_VECTOR_MATH
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume SH_NODE_TEX_IMAGE
Group RGB to Bright Vector Camera Vector Combine SH_NODE_OUTPUT_MATERIAL
ColorManagedColorspaceSettings colorspace_settings
bNodeSocketValueRGBA * color_socket
void(* MEM_freeN)(void *vmemh)
const char * RE_engine_id_CYCLES
struct bNodeTree * nodetree
struct IDProperty * id_properties
static int cycles_property_int(IDProperty *idprop, const char *name, int default_value)
static void update_musgrave_node_color_output(bNodeTree *ntree)
static void update_mapping_node_fcurve_rna_path_callback(ID *UNUSED(id), FCurve *fcurve, void *_data)
static bool cycles_property_boolean(IDProperty *idprop, const char *name, bool default_value)
static IDProperty * cycles_properties_from_ID(ID *id)
static void update_vector_math_node_average_operator(bNodeTree *ntree)
static IDProperty * cycles_properties_from_view_layer(ViewLayer *view_layer)
static void update_voronoi_node_f3_and_f4(bNodeTree *ntree)
static void light_emission_unify(Light *light, const char *engine)
static float * cycles_node_socket_rgba_value(bNodeSocket *socket)
static void update_voronoi_node_fac_output(bNodeTree *ntree)
static void ambient_occlusion_node_relink(bNodeTree *ntree)
static float cycles_property_float(IDProperty *idprop, const char *name, float default_value)
static void update_wave_node_directions_and_offset(bNodeTree *ntree)
static void light_emission_node_to_energy(Light *light, float *energy, float color[3])
static void displacement_node_insert(bNodeTree *ntree)
static bool node_has_roughness(bNode *node)
static void update_math_node_single_operand_operators(bNodeTree *ntree)
static void displacement_principled_nodes(bNode *node)
static void update_voronoi_node_dimensions(bNodeTree *ntree)
static void update_mapping_node_inputs_and_properties(bNodeTree *ntree)
void do_versions_after_linking_cycles(Main *bmain)
static void update_musgrave_node_dimensions(bNodeTree *ntree)
static void square_roughness_node_insert(bNodeTree *ntree)
static void update_vector_math_node_normalize_operator(bNodeTree *ntree)
static void update_vector_math_node_add_and_subtract_operators(bNodeTree *ntree)
static void vector_curve_node_remap(bNode *node)
static float * cycles_node_socket_float_value(bNodeSocket *socket)
static float * cycles_node_socket_vector_value(bNodeSocket *socket)
static void update_vector_math_node_operators_enum_mapping(bNodeTree *ntree)
static void cycles_property_boolean_set(IDProperty *idprop, const char *name, bool value)
static void image_node_colorspace(bNode *node)
void blo_do_versions_cycles(FileData *UNUSED(fd), Library *UNUSED(lib), Main *bmain)
static void update_vector_math_node_cross_product_operator(bNodeTree *ntree)
static void update_voronoi_node_square_distance(bNodeTree *ntree)
static void update_voronoi_node_coloring(bNodeTree *ntree)
static void cycles_property_int_set(IDProperty *idprop, const char *name, int value)
static void update_noise_and_wave_distortion(bNodeTree *ntree)
static void mapping_node_order_flip(bNode *node)
static void update_voronoi_node_crackle(bNodeTree *ntree)
static void update_noise_node_dimensions(bNodeTree *ntree)
static void update_vector_math_node_dot_product_operator(bNodeTree *ntree)
static bool socket_is_used(bNodeSocket *sock)