Blender Git Commit Log

Git Commits -> Revision c08151c

Revision c08151c by Jacques Lucke (master)
March 6, 2020, 11:33 (GMT)
Nodes: Support storing socket link limits in bNodeSocketType

Currently the link limit of sockets is stored in bNodeSocket->limit.
This allows for a lot of flexibility, but is also very redundant.
In every case I've had to deal with so far, it would have "more correct"
to set the link limit per socket type and not per socket. I did not enforce
this constraint yet, because the link limit is exposed in the Python API,
which I did not want to break here.

In the future it might even make sense to only support only three kinds of link limits:
a) no links, b) at most one link, c) an arbitrary number links links. The other link
limits usually don't work well with tools (e.g. which link should be removed when a new
one is connected?) and is not used in practice. However, that is for another day.

Eventually, I would like to get rid of bNodeSocket->limit completely and replace it
either with fixed link limits or a callback in bNodeSocketType.

This patch consists of three parts:

**1. Support defining link limit in socket type**
This introduces a new `nodeSocketLinkLimit` function that serves as an indirection to
hide where the link limit of a socket is defined.

**2. Define link limits for builtin sockets on socket type**
Data sockets: one input, many outputs
Virtual sockets: one input, one output
Undefined sockets: many inputs, many outputs (to avoid that links are removed when the type of the socket is not known)

**3. Remove `bNodeSocketTemplate->limit`**
This wasn't used anymore after the second commit. Removing it simplifies socket definitions
in hundreds of places and removes a lot of redundancy.

Differential Revision: https://developer.blender.org/D7038

Reviewers: brecht

Commit Details:

Full Hash: c08151c6fa4dec57b57ca8150a87aad9615683ed
Parent Commit: 98d562a
Lines Changed: +1211, -1493

198 Modified Paths:

/source/blender/blenkernel/BKE_node.h (+8, -1) (Diff)
/source/blender/blenkernel/intern/node.c (+16, -0) (Diff)
/source/blender/editors/space_node/node_relationships.c (+8, -4) (Diff)
/source/blender/editors/space_node/node_templates.c (+1, -1) (Diff)
/source/blender/makesdna/DNA_node_types.h (+2, -1) (Diff)
/source/blender/makesrna/intern/rna_nodetree.c (+3, -2) (Diff)
/source/blender/nodes/composite/nodes/node_composite_alphaOver.c (+6, -6) (Diff)
/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_blur.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_bokehblur.c (+6, -6) (Diff)
/source/blender/nodes/composite/nodes/node_composite_bokehimage.c (+2, -2) (Diff)
/source/blender/nodes/composite/nodes/node_composite_boxmask.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_brightness.c (+6, -6) (Diff)
/source/blender/nodes/composite/nodes/node_composite_channelMatte.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c (+6, -6) (Diff)
/source/blender/nodes/composite/nodes/node_composite_colorbalance.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_colorcorrection.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_colorMatte.c (+6, -6) (Diff)
/source/blender/nodes/composite/nodes/node_composite_colorSpill.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_composite.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_cornerpin.c (+9, -9) (Diff)
/source/blender/nodes/composite/nodes/node_composite_crop.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_curves.c (+13, -13) (Diff)
/source/blender/nodes/composite/nodes/node_composite_defocus.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_denoise.c (+5, -15) (Diff)
/source/blender/nodes/composite/nodes/node_composite_despeckle.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_diffMatte.c (+6, -6) (Diff)
/source/blender/nodes/composite/nodes/node_composite_dilate.c (+2, -2) (Diff)
/source/blender/nodes/composite/nodes/node_composite_directionalblur.c (+3, -3) (Diff)
/source/blender/nodes/composite/nodes/node_composite_displace.c (+7, -7) (Diff)
/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c (+6, -6) (Diff)
/source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_ellipsemask.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_filter.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_flip.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_gamma.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_glare.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_huecorrect.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c (+8, -8) (Diff)
/source/blender/nodes/composite/nodes/node_composite_idMask.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_image.c (+32, -32) (Diff)
/source/blender/nodes/composite/nodes/node_composite_inpaint.c (+2, -2) (Diff)
/source/blender/nodes/composite/nodes/node_composite_invert.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_keying.c (+9, -9) (Diff)
/source/blender/nodes/composite/nodes/node_composite_keyingscreen.c (+2, -2) (Diff)
/source/blender/nodes/composite/nodes/node_composite_lensdist.c (+6, -6) (Diff)
/source/blender/nodes/composite/nodes/node_composite_levels.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_mapRange.c (+8, -8) (Diff)
/source/blender/nodes/composite/nodes/node_composite_mapUV.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_mapValue.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_mask.c (+1, -1) (Diff)
/source/blender/nodes/composite/nodes/node_composite_math.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_mixrgb.c (+6, -6) (Diff)
/source/blender/nodes/composite/nodes/node_composite_movieclip.c (+7, -7) (Diff)
/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_normal.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_normalize.c (+2, -2) (Diff)
/source/blender/nodes/composite/nodes/node_composite_pixelate.c (+2, -2) (Diff)
/source/blender/nodes/composite/nodes/node_composite_planetrackdeform.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_premulkey.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_rgb.c (+2, -2) (Diff)
/source/blender/nodes/composite/nodes/node_composite_rotate.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_scale.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c (+14, -14) (Diff)
/source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c (+14, -14) (Diff)
/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c (+13, -13) (Diff)
/source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c (+13, -13) (Diff)
/source/blender/nodes/composite/nodes/node_composite_setalpha.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_splitViewer.c (+3, -3) (Diff)
/source/blender/nodes/composite/nodes/node_composite_stabilize2d.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_sunbeams.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_switch.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_switchview.c (+2, -2) (Diff)
/source/blender/nodes/composite/nodes/node_composite_texture.c (+6, -6) (Diff)
/source/blender/nodes/composite/nodes/node_composite_tonemap.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_trackpos.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_transform.c (+8, -8) (Diff)
/source/blender/nodes/composite/nodes/node_composite_translate.c (+6, -6) (Diff)
/source/blender/nodes/composite/nodes/node_composite_valToRgb.c (+9, -9) (Diff)
/source/blender/nodes/composite/nodes/node_composite_value.c (+2, -2) (Diff)
/source/blender/nodes/composite/nodes/node_composite_vecBlur.c (+5, -5) (Diff)
/source/blender/nodes/composite/nodes/node_composite_viewer.c (+4, -4) (Diff)
/source/blender/nodes/composite/nodes/node_composite_zcombine.c (+8, -8) (Diff)
/source/blender/nodes/intern/node_common.c (+2, -2) (Diff)
/source/blender/nodes/intern/node_socket.c (+8, -1) (Diff)
/source/blender/nodes/intern/node_util.c (+1, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_add_shader.c (+5, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_ambient_occlusion.c (+7, -17) (Diff)
/source/blender/nodes/shader/nodes/node_shader_attribute.c (+4, -4) (Diff)
/source/blender/nodes/shader/nodes/node_shader_background.c (+5, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bevel.c (+5, -15) (Diff)
/source/blender/nodes/shader/nodes/node_shader_blackbody.c (+4, -4) (Diff)
/source/blender/nodes/shader/nodes/node_shader_brightness.c (+6, -6) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c (+9, -29) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c (+6, -16) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c (+7, -17) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c (+6, -16) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_hair.c (+8, -18) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.c (+15, -16) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c (+23, -45) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c (+7, -17) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_toon.c (+7, -17) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c (+5, -15) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c (+4, -4) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c (+6, -16) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bump.c (+8, -8) (Diff)
/source/blender/nodes/shader/nodes/node_shader_camera.c (+4, -4) (Diff)
/source/blender/nodes/shader/nodes/node_shader_clamp.c (+6, -6) (Diff)
/source/blender/nodes/shader/nodes/node_shader_curves.c (+10, -10) (Diff)
/source/blender/nodes/shader/nodes/node_shader_displacement.c (+7, -17) (Diff)
/source/blender/nodes/shader/nodes/node_shader_eevee_specular.c (+11, -23) (Diff)
/source/blender/nodes/shader/nodes/node_shader_emission.c (+5, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_fresnel.c (+5, -15) (Diff)
/source/blender/nodes/shader/nodes/node_shader_gamma.c (+5, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_geometry.c (+10, -10) (Diff)
/source/blender/nodes/shader/nodes/node_shader_hair_info.c (+6, -6) (Diff)
/source/blender/nodes/shader/nodes/node_shader_holdout.c (+3, -3) (Diff)
/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c (+8, -8) (Diff)
/source/blender/nodes/shader/nodes/node_shader_ies_light.c (+5, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_invert.c (+4, -4) (Diff)
/source/blender/nodes/shader/nodes/node_shader_layer_weight.c (+6, -16) (Diff)
/source/blender/nodes/shader/nodes/node_shader_light_falloff.c (+7, -7) (Diff)
/source/blender/nodes/shader/nodes/node_shader_light_path.c (+14, -14) (Diff)
/source/blender/nodes/shader/nodes/node_shader_mapping.c (+7, -7) (Diff)
/source/blender/nodes/shader/nodes/node_shader_map_range.c (+9, -9) (Diff)
/source/blender/nodes/shader/nodes/node_shader_math.c (+5, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_mixRgb.c (+6, -6) (Diff)
/source/blender/nodes/shader/nodes/node_shader_mix_shader.c (+6, -6) (Diff)
/source/blender/nodes/shader/nodes/node_shader_normal.c (+5, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_normal_map.c (+5, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_object_info.c (+6, -6) (Diff)
/source/blender/nodes/shader/nodes/node_shader_output_aov.c (+3, -3) (Diff)
/source/blender/nodes/shader/nodes/node_shader_output_light.c (+2, -2) (Diff)
/source/blender/nodes/shader/nodes/node_shader_output_linestyle.c (+5, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_output_material.c (+3, -4) (Diff)
/source/blender/nodes/shader/nodes/node_shader_output_world.c (+3, -3) (Diff)
/source/blender/nodes/shader/nodes/node_shader_particle_info.c (+10, -10) (Diff)
/source/blender/nodes/shader/nodes/node_shader_rgb.c (+2, -2) (Diff)
/source/blender/nodes/shader/nodes/node_shader_sepcombHSV.c (+12, -12) (Diff)
/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c (+12, -12) (Diff)
/source/blender/nodes/shader/nodes/node_shader_sepcombXYZ.c (+12, -12) (Diff)
/source/blender/nodes/shader/nodes/node_shader_shaderToRgb.c (+5, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_squeeze.c (+5, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c (+9, -19) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tangent.c (+2, -2) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_brick.c (+5, -14) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_checker.c (+6, -8) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_coord.c (+8, -8) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_environment.c (+4, -14) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c (+4, -15) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_image.c (+4, -15) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_magic.c (+6, -17) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c (+10, -11) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_noise.c (+8, -19) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.c (+5, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_sky.c (+4, -14) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c (+10, -23) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_wave.c (+9, -20) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_white_noise.c (+6, -6) (Diff)
/source/blender/nodes/shader/nodes/node_shader_uvAlongStroke.c (+2, -2) (Diff)
/source/blender/nodes/shader/nodes/node_shader_uvmap.c (+2, -2) (Diff)
/source/blender/nodes/shader/nodes/node_shader_valToRgb.c (+7, -7) (Diff)
/source/blender/nodes/shader/nodes/node_shader_value.c (+2, -2) (Diff)
/source/blender/nodes/shader/nodes/node_shader_vector_displacement.c (+6, -16) (Diff)
/source/blender/nodes/shader/nodes/node_shader_vector_math.c (+6, -6) (Diff)
/source/blender/nodes/shader/nodes/node_shader_vector_rotate.c (+7, -8) (Diff)
/source/blender/nodes/shader/nodes/node_shader_vectTransform.c (+3, -4) (Diff)
/source/blender/nodes/shader/nodes/node_shader_vertex_color.c (+3, -3) (Diff)
/source/blender/nodes/shader/nodes/node_shader_volume_absorption.c (+5, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_volume_info.c (+5, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_volume_principled.c (+15, -15) (Diff)
/source/blender/nodes/shader/nodes/node_shader_volume_scatter.c (+6, -6) (Diff)
/source/blender/nodes/shader/nodes/node_shader_wavelength.c (+4, -4) (Diff)
/source/blender/nodes/shader/nodes/node_shader_wireframe.c (+4, -4) (Diff)
/source/blender/nodes/texture/nodes/node_texture_at.c (+5, -5) (Diff)
/source/blender/nodes/texture/nodes/node_texture_bricks.c (+10, -10) (Diff)
/source/blender/nodes/texture/nodes/node_texture_checker.c (+6, -6) (Diff)
/source/blender/nodes/texture/nodes/node_texture_compose.c (+7, -7) (Diff)
/source/blender/nodes/texture/nodes/node_texture_coord.c (+2, -2) (Diff)
/source/blender/nodes/texture/nodes/node_texture_curves.c (+5, -5) (Diff)
/source/blender/nodes/texture/nodes/node_texture_decompose.c (+7, -7) (Diff)
/source/blender/nodes/texture/nodes/node_texture_distance.c (+5, -5) (Diff)
/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c (+8, -8) (Diff)
/source/blender/nodes/texture/nodes/node_texture_image.c (+2, -2) (Diff)
/source/blender/nodes/texture/nodes/node_texture_invert.c (+4, -4) (Diff)
/source/blender/nodes/texture/nodes/node_texture_math.c (+6, -6) (Diff)
/source/blender/nodes/texture/nodes/node_texture_mixRgb.c (+6, -6) (Diff)
/source/blender/nodes/texture/nodes/node_texture_output.c (+3, -3) (Diff)
/source/blender/nodes/texture/nodes/node_texture_proc.c (+37, -37) (Diff)
/source/blender/nodes/texture/nodes/node_texture_rotate.c (+6, -6) (Diff)
/source/blender/nodes/texture/nodes/node_texture_scale.c (+5, -5) (Diff)
/source/blender/nodes/texture/nodes/node_texture_texture.c (+5, -5) (Diff)
/source/blender/nodes/texture/nodes/node_texture_translate.c (+5, -5) (Diff)
/source/blender/nodes/texture/nodes/node_texture_valToNor.c (+5, -5) (Diff)
/source/blender/nodes/texture/nodes/node_texture_valToRgb.c (+8, -8) (Diff)
/source/blender/nodes/texture/nodes/node_texture_viewer.c (+3, -3) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021