Page 1 of 1

Using the node editor via Python

Posted: Sat Jun 08, 2019 12:39 am
by kedz
Hello,

I noticed there's no official Python SDK for Octane so I'm having a little trouble accessing some things. Basically, I've managed to create a diffuse material and add some image inputs, but now I need to actually use the node editor and create some nodes to adjust the images a little before connecting to the material input.
Is it possible to access the node editor, add & edit nodes via Python?

Thanks in advance! :)

Re: Using the node editor via Python

Posted: Sat Jun 08, 2019 1:03 am
by aoktar
There's not any different way as using nodes in node editor. They will be shown when you create any nodes by default ways. There's some scripts in this topic for creating the octane nodes. Ids is visible by dropping any parameters or nodes to python editor.
viewtopic.php?f=87&t=56039

Re: Using the node editor via Python

Posted: Sat Jun 08, 2019 1:28 am
by kedz
aoktar wrote:There's not any different way as using nodes in node editor. They will be shown when you create any nodes by default ways. There's some scripts in this topic for creating the octane nodes. Ids is visible by dropping any parameters or nodes to python editor.
viewtopic.php?f=87&t=56039
Hi!

I've went through each code of this thread a couple times and couldn't find any code that utilizes the node editor. I'm not quite sure how to load the node group (node setup) of a material into a variable, and then insert nodes via that variable.

Thanks for your time :)

Re: Using the node editor via Python

Posted: Sat Jun 08, 2019 1:49 am
by aoktar
Again, there's not any special command or functioning for node editor. Node editor will display what you do with material editor.
What are you trying to obtain?

Re: Using the node editor via Python

Posted: Sat Jun 08, 2019 1:59 am
by kedz
aoktar wrote:Again, there's not any special command or functioning for node editor. Node editor will display what you do with material editor.
What are you trying to obtain?
I have 4 textures (Diffuse, Normal & Metallic & Roughness) and a material name. I wanna create a material with PBR setup through node editor with python. and it's important that's via node editor because I want to add more nodes later between the textures and the material input.

Re: Using the node editor via Python

Posted: Sat Jun 08, 2019 10:02 pm
by TonyBoy
Might be easier to stitch the changes together in a video editor.

Re: Using the node editor via Python

Posted: Sun Jun 09, 2019 1:47 pm
by kedz
TonyBoy wrote:Might be easier to stitch the changes together in a video editor.
This is something I can't and rather not do via video editing. I've made a custom file format with an exporter for an external program, that contains mesh, material & image data inside it. I've made a c4d plugin that reads the file and creates the mesh and now I'm working on the materials. Unfortunately, just plugging the images into the file input is not enough, I really need to create a certain node setup for those materials, and since we're talking over 300 models, doing this by hand is not what I'm looking for.

Re: Using the node editor via Python

Posted: Sun Jun 09, 2019 3:02 pm
by aoktar
I believe I cannot explain it well!
You don't need to try any special ways about node editor. Node editor is a transparent interface to display native storage and connection of material+texture setups of C4D system. Not like a xpresso interface. You only need to know how to connect and create nodes in C4D way.