Merge branch 'blender-v4.0-release' into main
This commit is contained in:
commit
bb8440e55b
|
@ -66,13 +66,14 @@ struct SocketType {
|
|||
LINK_TEXTURE_GENERATED = (1 << 4),
|
||||
LINK_TEXTURE_NORMAL = (1 << 5),
|
||||
LINK_TEXTURE_UV = (1 << 6),
|
||||
LINK_INCOMING = (1 << 7),
|
||||
LINK_NORMAL = (1 << 8),
|
||||
LINK_POSITION = (1 << 9),
|
||||
LINK_TANGENT = (1 << 10),
|
||||
LINK_OSL_INITIALIZER = (1 << 11),
|
||||
LINK_TEXTURE_INCOMING = (1 << 7),
|
||||
LINK_INCOMING = (1 << 8),
|
||||
LINK_NORMAL = (1 << 9),
|
||||
LINK_POSITION = (1 << 10),
|
||||
LINK_TANGENT = (1 << 11),
|
||||
LINK_OSL_INITIALIZER = (1 << 12),
|
||||
DEFAULT_LINK_MASK = (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7) | (1 << 8) | (1 << 9) |
|
||||
(1 << 10) | (1 << 11)
|
||||
(1 << 10) | (1 << 11) | (1 << 12)
|
||||
};
|
||||
|
||||
ustring name;
|
||||
|
|
|
@ -847,8 +847,9 @@ void ShaderGraph::default_inputs(bool do_osl)
|
|||
/* nodes can specify default texture coordinates, for now we give
|
||||
* everything the position by default, except for the sky texture */
|
||||
|
||||
ShaderNode *geom = NULL;
|
||||
ShaderNode *texco = NULL;
|
||||
GeometryNode *geom = NULL;
|
||||
TextureCoordinateNode *texco = NULL;
|
||||
VectorTransformNode *normal_transform = NULL;
|
||||
|
||||
foreach (ShaderNode *node, nodes) {
|
||||
foreach (ShaderInput *input, node->inputs) {
|
||||
|
@ -874,6 +875,20 @@ void ShaderGraph::default_inputs(bool do_osl)
|
|||
|
||||
connect(texco->output("UV"), input);
|
||||
}
|
||||
else if (input->flags() & SocketType::LINK_TEXTURE_INCOMING) {
|
||||
if (!geom) {
|
||||
geom = create_node<GeometryNode>();
|
||||
}
|
||||
if (!normal_transform) {
|
||||
normal_transform = create_node<VectorTransformNode>();
|
||||
normal_transform->set_transform_type(NODE_VECTOR_TRANSFORM_TYPE_NORMAL);
|
||||
normal_transform->set_convert_from(NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD);
|
||||
normal_transform->set_convert_to(NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT);
|
||||
connect(geom->output("Incoming"), normal_transform->input("Vector"));
|
||||
}
|
||||
|
||||
connect(normal_transform->output("Vector"), input);
|
||||
}
|
||||
else if (input->flags() & SocketType::LINK_INCOMING) {
|
||||
if (!geom) {
|
||||
geom = create_node<GeometryNode>();
|
||||
|
@ -912,6 +927,9 @@ void ShaderGraph::default_inputs(bool do_osl)
|
|||
if (texco) {
|
||||
add(texco);
|
||||
}
|
||||
if (normal_transform) {
|
||||
add(normal_transform);
|
||||
}
|
||||
}
|
||||
|
||||
void ShaderGraph::refine_bump_nodes()
|
||||
|
|
|
@ -1336,7 +1336,7 @@ NODE_DEFINE(IESLightNode)
|
|||
SOCKET_STRING(filename, "File Name", ustring());
|
||||
|
||||
SOCKET_IN_FLOAT(strength, "Strength", 1.0f);
|
||||
SOCKET_IN_POINT(vector, "Vector", zero_float3(), SocketType::LINK_TEXTURE_NORMAL);
|
||||
SOCKET_IN_POINT(vector, "Vector", zero_float3(), SocketType::LINK_TEXTURE_INCOMING);
|
||||
|
||||
SOCKET_OUT_FLOAT(fac, "Fac");
|
||||
|
||||
|
|
Loading…
Reference in New Issue