You need to also cast the block to the correct block type in typescript to be sure the texture property is present as well as the value in the other cases.
What about color, vector and float blocks, how do I access and modify them?
I tried this:
let blockInShader = cloneMat.getInputBlockByPredicate((b) => b.name === matchedBlockName);
let colorBlock = blockInShader as BABYLON.Color4;
Second line complains:
Conversion of type ‘InputBlock’ to type ‘Color4’ may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to ‘unknown’ first.
Type ‘InputBlock’ is missing the following properties from type ‘Color4’: r, g, b, a, and 24 more
Then I add as suggested: let colorBlock = blockInShader as unknown as BABYLON.Color4;
But I don’t think it is correct. Later I set the color via: