Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use it #1

Open
guzuligo opened this issue Aug 20, 2020 · 1 comment
Open

How to use it #1

guzuligo opened this issue Aug 20, 2020 · 1 comment

Comments

@guzuligo
Copy link

I've tried adding this as a plug-in in blender but I don't know how it can be used. Or does it only work through the blender python console somehow?

@chosle12
Copy link

Using it through the Blender Python console as shown below does indeed produce an output.

import bpy

class MaterialNodesCompiler:
   #  Publicly released source code

# Select a material node tree, where 'Material' is the name of the destination material.
material = bpy.data.materials['Material']
node_tree = material.node_tree

# Instancing MaterialNodesComputer Classes
compiler = MaterialNodesCompiler(node_tree)

# Converting to GLSL Code
glsl_code = compiler.compile()

# Save the GLSL code as a file
with open("output.glsl", "w") as file:
    file.write(glsl_code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants