8 #define DNA_DEPRECATED_ALLOW
49 return &socket_data->
value;
55 return socket_data->
value;
61 return socket_data->
value;
85 return (prop) ?
IDP_Float(prop) : default_value;
91 return (prop) ?
IDP_Int(prop) : default_value;
119 bool need_update =
false;
124 prevlink = link->
prev;
127 bNode *fromnode = link->fromnode;
129 bNode *tonode = link->tonode;
191 bool need_update =
false;
198 *roughness_value =
sqrtf(
max_ff(*roughness_value, 0.0f));
205 prevlink = link->
prev;
208 bNode *fromnode = link->fromnode;
210 bNode *tonode = link->tonode;
258 for (
int curve_index = 0; curve_index <
CM_TOT; curve_index++) {
261 for (
int i = 0; i < cm->
totpoint; i++) {
274 bool need_update =
false;
290 prevlink = link->
prev;
293 bNode *fromnode = link->fromnode;
294 bNode *tonode = link->tonode;
323 color_space =
tex->color_space;
327 color_space =
tex->color_space;
333 enum { SHD_COLORSPACE_NONE = 0 };
335 if (color_space == SHD_COLORSPACE_NONE) {
354 if (output_node ==
NULL) {
361 emission_node = link->fromnode;
366 if (emission_node ==
NULL) {
381 *energy = *strength_value;
384 *strength_value = 1.0f;
397 float energy,
color[3];
400 if (
STREQ(engine,
"CYCLES")) {
429 bool need_update =
false;
478 bool need_update =
false;
500 if (link->fromsock == sockOutValue) {
530 bool need_update =
false;
537 if (link->fromsock == sockOutVector) {
538 switch (link->tosock->type) {
569 bool need_update =
false;
583 if (link->fromsock == sockOutVector) {
584 nodeAddLink(
ntree, normalizeNode, sockNormalizeOut, link->tonode, link->tosock);
608 if (link->fromsock == sockOutValue) {
635 bool need_update =
false;
650 if (link->fromsock == sockOutValue) {
651 nodeAddLink(
ntree, lengthNode, sockLengthValue, link->tonode, link->tosock);
698 switch (
node->custom1) {
721 bool need_update =
false;
726 if (
node->custom1 == -1) {
737 if (link->fromsock == sockOutVector) {
738 nodeAddLink(
ntree, normalizeNode, sockNormalizeOut, link->tonode, link->tosock);
762 if (link->fromsock == sockOutValue) {
826 char *old_fcurve_rna_path = fcurve->
rna_path;
838 char node_name_esc[
sizeof(
data->minimumNode->name) * 2];
843 char node_name_esc[
sizeof(
data->maximumNode->name) * 2];
848 if (fcurve->
rna_path != old_fcurve_rna_path) {
874 bool need_update =
false;
883 node->width = 140.0f;
897 maximumNode->
locx =
node->locx + (
node->width + 20.0f) * 2.0f;
908 if (link->fromsock == sockMappingResult) {
910 nodeAddLink(
ntree, maximumNode, sockMaximumResult, link->tonode, link->tosock);
936 nodeAddLink(
ntree, minimumNode, sockMinimumResult, maximumNode, sockMaximumA);
940 if (link->fromsock == sockMappingResult) {
941 nodeAddLink(
ntree, minimumNode, sockMinimumResult, link->tonode, link->tosock);
955 char node_name_esc[
sizeof(
node->name) * 2];
958 char *nodePath =
BLI_sprintfN(
"nodes[\"%s\"]", node_name_esc);
992 link->fromsock = link->fromsock->next;
1006 tex->dimensions = 3;
1040 strcpy(facOutput->
name,
"Distance");
1064 bool need_update =
false;
1088 if (sockVector->link) {
1090 sockVector->link->fromnode,
1091 sockVector->link->fromsock,
1097 if (sockScale->
link) {
1106 if (sockExponent->
link) {
1111 sockVoronoiExponent);
1116 subtractNode->
locx = voronoiNode->
locx + voronoiNode->
width + 20.0f;
1117 subtractNode->
locy = voronoiNode->
locy;
1121 if (link->fromnode ==
node) {
1122 nodeAddLink(
ntree, subtractNode, sockSubtractOutValue, link->tonode, link->tosock);
1133 nodeAddLink(
ntree, voronoiNode, sockDistanceF2, subtractNode, sockSubtractA);
1155 bool need_update =
false;
1161 if (
tex->coloring == 0) {
1163 if (link->fromsock == sockColor) {
1172 if (link->fromsock == sockDistance) {
1193 bool need_update =
false;
1208 if (link->fromsock == sockDistance) {
1236 bool need_update =
false;
1251 mulNode->
locy =
node->locy - 240.0f;
1259 nodeAddLink(
ntree, distortionInputNode, distortionInputSock, mulNode, mulSockA);
1264 else if (*distortion != 0.0f) {
1265 *distortion = *distortion * 0.5f;
1327 cscene,
"film_transparent",
false);
1456 if (aperture_size > 0.0f) {
1458 camera->dof.aperture_fstop = 1.0f / (2.0f * aperture_size);
1461 camera->dof.aperture_fstop = (
camera->lens * 1e-3f) / (2.0f * aperture_size);
1469 camera->dof.aperture_fstop = 2.8f;
1470 camera->dof.aperture_blades = 0;
1471 camera->dof.aperture_rotation = 0.0f;
1472 camera->dof.aperture_ratio = 1.0f;
1563 bool use_optix =
false;
1564 bool use_denoising =
false;
1566 view_layer = view_layer->next) {
1569 use_denoising = use_denoising ||
1571 use_optix = use_optix ||
1590 if (!use_denoising) {
1592 view_layer = view_layer->next) {
1625 if (object->type ==
OB_LAMP) {
1631 object->visibility_flag |= flag;
void BKE_fcurves_id_cb(struct ID *id, ID_FCurve_Edit_Callback func, void *user_data)
struct IDProperty * IDP_GetProperties(struct ID *id, bool create_if_needed) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
struct IDProperty * IDP_New(char type, const IDPropertyTemplate *val, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
struct IDProperty * IDP_GetPropertyTypeFromGroup(const struct IDProperty *prop, const char *name, char type) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool IDP_AddToGroup(struct IDProperty *group, struct IDProperty *prop) ATTR_NONNULL()
#define MAIN_VERSION_ATLEAST(main, ver, subver)
#define SH_NODE_BSDF_PRINCIPLED
#define SH_NODE_TEX_ENVIRONMENT
void nodeRemLink(struct bNodeTree *ntree, struct bNodeLink *link)
#define SH_NODE_AMBIENT_OCCLUSION
#define SH_NODE_OUTPUT_MATERIAL
#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 SH_NODE_BSDF_GLOSSY
#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_BSDF_REFRACTION
#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], short order, const float quat[4])
void eulO_to_quat(float quat[4], const float eul[3], 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)
bool BLI_str_endswith(const char *__restrict str, const char *__restrict end) ATTR_NONNULL()
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) 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_SUBSURFACE_RANDOM_WALK
@ SHD_WAVE_BANDS_DIRECTION_DIAGONAL
@ SHD_WAVE_RINGS_DIRECTION_SPHERICAL
const char * IMB_colormanagement_role_colorspace_name_get(int role)
Read Guarded memory(de)allocation.
struct bNode * ntreeShaderOutputNode(struct bNodeTree *ntree, int target)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color SH_NODE_CURVE_VEC
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise SH_NODE_TEX_VORONOI
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum SH_NODE_VECTOR_MATH
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture SH_NODE_TEX_NOISE
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between camera
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block SH_NODE_TEX_IMAGE
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise SH_NODE_TEX_WAVE
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
@ DENOISER_OPENIMAGEDENOISE
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
bNodeSocketValueRGBA * color_socket
void(* MEM_freeN)(void *vmemh)
const char * RE_engine_id_CYCLES
struct bNodeTree * nodetree
struct IDProperty * id_properties
void version_socket_update_is_used(bNodeTree *ntree)
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_visibility_properties_from_ID(ID *id)
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 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 bool node_has_roughness(const bNode *node)
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)