C4DToA_python_wrapper

Wrapper class for the current API of Arnold for c4d

Class Presentation

Arnold

Arnold class is the main wrapper. You normally only have to deal with it.

Node

Node class represent a c4d.modules.graphview.GvNode inside an arnold shader network.

Connection

Connection class represent a connection inside an arnold shader network.

Message

Message wrap the current arnold API. Basic workflow set_data => send => get_data, You normally never have to deal with this class

Examples

Basic exemple for create an arnold material, a standard node link to the beauty and a user_data_rgb linked to the color of the standard.

import c4d
from arnold_wrapper.Arnold import Arnold

#define wrapper
arnold = Arnold()

#create arnold material
mat = c4d.BaseMaterial(arnold.ARNOLD_MATERIAL)
doc.InsertMaterial(mat)

#Define the mat where we gonna act after
arnold.set_mat(mat)

#create user_data_rgb
user_data_rgb = arnold.create_shader(arnold.ARNOLD_SHADER_GV, "user_data_rgb", 200, 200)
user_data_rgb.set_parameter("user_data_rgb.default", c4d.Vector(0.2,0.4,0.6))

#create our standard node
standard_node = arnold.create_shader(arnold.ARNOLD_SHADER_GV, "standard_surface", 600, 200)

#create connections
arnold.create_connection(user_data_rgb.get_node(), 0, standard_node.get_node(), "standard_surface.base_color")
arnold.connect_beauty(standard_node.get_node(), 0)

c4d.EventAdd()

Another exemple with more interactions with material can be found here add_mix_to_existant.py

Installation

To use it as a library simply copy arnold_wrapper folder into

Even if I suggest to use it as a library you are free to only include it into your project. For doing it in proper way I suggest you to read Best Practice For Imports from official support forum and then use py-localimport from Niklas Rosenstein

Compatibility

Tested and build on C4dToA 2.0+ and R17/R18