How I can Create a material, select it, create new nodes with this material and Animate them?
<p>i'm looking for a way to create a new Material and Select it, to create nodes in this Material and animate the values in those nodes.
This is the code that I actually have:</p>

<pre><code>mat = bpy.ops.material.new()
mat_nodes = bpy.data.materials['USDiscoMaterial'].node_tree.nodes
</code></pre>

<p>But actually, with this code Blender will rename the current material with "USDiscoMaterial", and creates a new one but not select it.
And if I want to create a node in this material?</p>