1

I am not sure if this is even possible. I need to programmatically generate materials from lets say a metal glossy type to material of type diffuse or emission.

I need to create maybe 10 materials as it transitions from a start material through to the end material. Would this be possible just given the start and end types?

John
  • 43
  • 6
  • 1
    what is your end goal? You could create a single material with a number of shaders controlled by Mix Shader Nodes and animate/vary the Factors. – rob Aug 23 '18 at 11:07
  • @rob End goal is to create a list of materials which transition from start material to end material. I need to do this pro-grammatically. Also can't use shaders due to a limitation of trying to stick to the Nvidia MDL specification. I just want to know if its even possible to do this – John Aug 23 '18 at 11:10
  • Well it sounds possible, if the two materials are structured similarly, but there are no native built-in tools to do this, as far as I know. This is generally achieved with animations by keyframing properties – Duarte Farrajota Ramos Aug 23 '18 at 12:28
  • @rob Actually now that I am reading your comment again and again it makes sense and possible. What are the chances I can replicate this via python rather than the node editor? – John Aug 23 '18 at 12:33
  • You can certainly use Python to create nodes - as in this example https://blender.stackexchange.com/a/99003/29586 which generates nodes within a custom node group - so you can definitely create materials programatically. – Rich Sedman Aug 23 '18 at 14:33
  • @RichSedman Yes I understand this. But my problem is more specific to having materials transition from to another especially when they are composed of more inputs than the mix shader can handle – John Aug 23 '18 at 15:12
  • 1
    By ‘transition’, do you mean animatable? I took it to mean that you want to ‘generate’ multiple separate materials. So do you require a single material that can animate between multiple different shader types? While the Mix shader node can only mix between two inputs you can chain multiple mix shaders together. Some careful maths nodes could then allow you to effectively mix between, say, 10 or more sets of shader nodes as the input varies from 0.0 to 1.0. Is this the kind of thing you’re after? – Rich Sedman Aug 23 '18 at 15:33
  • @RichSedman not animatable. But your proposition might work I will look at it, I have an external application which dynamically creates a list of materials and later applies them. Its for static renders but done pro-grammatically – John Aug 23 '18 at 15:44

0 Answers0