Created
October 29, 2015 18:51
-
-
Save zeffii/f767c4b242b71613b24c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import addon_utils | |
addon_utils.enable("octave_gradients") | |
# add material, or reuse existing one | |
mymat = bpy.data.materials.get('lazy_cube') | |
if not mymat: | |
mymat = bpy.data.materials.new('lazy_cube') | |
mymat.use_nodes = True | |
nodes = mymat.node_tree.nodes | |
if not 'ColorRamp' in nodes: | |
nodes.new(type="ShaderNodeValToRGB") | |
bpy.ops.scene.gradient_pusher() | |
external_octave = bpy.app.driver_namespace['external_octave'] | |
# force ramp theme, make a globally available function | |
ColorRamp = nodes['ColorRamp'] | |
external_octave(ColorRamp, '12') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment