Skip to content

Instantly share code, notes, and snippets.

@zeffii
Created November 30, 2015 08:27
Show Gist options
  • Save zeffii/39f56a3debdd4b54b9b8 to your computer and use it in GitHub Desktop.
Save zeffii/39f56a3debdd4b54b9b8 to your computer and use it in GitHub Desktop.
import bpy
ng = bpy.data.materials['Material'].node_tree
mapping = ng.nodes['Mapping']
def list_props(node):
ignored = {'bl_icon', 'bl_static_type', 'type'}
for i in node.bl_rna.properties:
if i.identifier in ignored:
continue
if hasattr(i, 'default'):
name = i.identifier
setattr(node, name, i.default)
list_props(mapping)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment