feat(web): support the full shader node add catalog
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

Extend the native editShaderNode ADD map, setShaderGraph allowlist and
blend-reader readback for the remaining 10 advertised node types; update
SceneIR and the catalog. Verified Noise Texture and Emission creation.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-11-14 07:38:30 +08:00
parent 9499664892
commit 71a8e8c95e
9 changed files with 61 additions and 19 deletions

View File

@@ -4951,6 +4951,16 @@ json scene_ir_from_blend(const ParsedBlend &blend,
node_type == "ShaderNodeBsdfPrincipled" ? "PRINCIPLED" :
node_type == "ShaderNodeTexImage" ? "IMAGE_TEXTURE" :
node_type == "ShaderNodeNormalMap" ? "NORMAL_MAP" :
node_type == "ShaderNodeBsdfDiffuse" ? "DIFFUSE" :
node_type == "ShaderNodeBsdfGlossy" ? "GLOSSY" :
node_type == "ShaderNodeEmission" ? "EMISSION" :
node_type == "ShaderNodeMixShader" ? "MIX_SHADER" :
node_type == "ShaderNodeAddShader" ? "ADD_SHADER" :
node_type == "ShaderNodeTexNoise" ? "NOISE" :
node_type == "ShaderNodeTexGradient" ? "GRADIENT" :
node_type == "ShaderNodeTexChecker" ? "CHECKER" :
node_type == "ShaderNodeFresnel" ? "FRESNEL" :
node_type == "ShaderNodeLayerWeight" ? "LAYER_WEIGHT" :
node_type == "NodeReroute" ? "REROUTE" :
node_type == "NodeFrame" ? "FRAME" :
node_type == "ShaderNodeDisplacement" ? "DISPLACEMENT" :

View File

@@ -15378,7 +15378,11 @@ bool web_engine_blend_main_edit_shader_node(WebBlendMainState *state,
type=="MAPPING"?SH_NODE_MAPPING:type=="TEX_COORD"?SH_NODE_TEX_COORD:type=="UV_MAP"?SH_NODE_UVMAP:
type=="SEPARATE_COLOR"?SH_NODE_SEPARATE_COLOR:type=="OBJECT_INFO"?SH_NODE_OBJECT_INFO:
type=="IMAGE_TEXTURE"?SH_NODE_TEX_IMAGE:
type=="NORMAL_MAP"?SH_NODE_NORMAL_MAP:type=="BUMP"?SH_NODE_BUMP:type=="PRINCIPLED"?SH_NODE_BSDF_PRINCIPLED:type=="OUTPUT"?SH_NODE_OUTPUT_MATERIAL:0;
type=="NORMAL_MAP"?SH_NODE_NORMAL_MAP:type=="BUMP"?SH_NODE_BUMP:type=="PRINCIPLED"?SH_NODE_BSDF_PRINCIPLED:type=="OUTPUT"?SH_NODE_OUTPUT_MATERIAL:
type=="DIFFUSE"?SH_NODE_BSDF_DIFFUSE:type=="GLOSSY"?SH_NODE_BSDF_GLOSSY:type=="EMISSION"?SH_NODE_EMISSION:
type=="MIX_SHADER"?SH_NODE_MIX_SHADER:type=="ADD_SHADER"?SH_NODE_ADD_SHADER:type=="NOISE"?SH_NODE_TEX_NOISE:
type=="GRADIENT"?SH_NODE_TEX_GRADIENT:type=="CHECKER"?SH_NODE_TEX_CHECKER:type=="FRESNEL"?SH_NODE_FRESNEL:
type=="LAYER_WEIGHT"?SH_NODE_LAYER_WEIGHT:0;
if (!code) {error="SHADER_NODE_UNSUPPORTED";return false;}
node=bke::node_add_static_node(nullptr, *tree,code);
if (!node) {error="SHADER_NODE_CREATE_FAILED";return false;}
@@ -15545,7 +15549,10 @@ bool web_engine_blend_main_set_shader_graph(WebBlendMainState *state,
spec.type != "MAPPING" && spec.type != "TEX_COORD" && spec.type != "UV_MAP" &&
spec.type != "SEPARATE_COLOR" && spec.type != "OBJECT_INFO" && spec.type != "BUMP" &&
spec.type != "PRINCIPLED" && spec.type != "IMAGE_TEXTURE" && spec.type != "NORMAL_MAP" &&
spec.type != "MATERIAL_OUTPUT") {
spec.type != "MATERIAL_OUTPUT" && spec.type != "DIFFUSE" && spec.type != "GLOSSY" &&
spec.type != "EMISSION" && spec.type != "MIX_SHADER" && spec.type != "ADD_SHADER" &&
spec.type != "NOISE" && spec.type != "GRADIENT" && spec.type != "CHECKER" &&
spec.type != "FRESNEL" && spec.type != "LAYER_WEIGHT") {
error = "SHADER_NODE_UNSUPPORTED: node type is outside the finite writable Shader subset";
return false;
}