artellapipe.utils.shader module¶
Module that contains utilities functions to work with Shaders
-
class
artellapipe.utils.shader.ShadingNetwork(shader_extension)¶ Bases:
objectClass that defines a shading network
-
classmethod
create_shader_node(node_type, as_type, name)¶ - Parameters
node_type –
as_type –
name –
- Returns
-
classmethod
get_shading_network(shader_node, prefix=None)¶ - Parameters
shader_node –
prefix –
- Returns
-
classmethod
load_network(shader_file_path, existing_material=None)¶ Loads given shader file and creates a proper shader :param shader_file_path: str, JSON shader file :param existing_material:
-
static
read(file_dir)¶ Reads shader info from given JSON file :param file_dir: str :return: dict
-
static
write(shader_dict, file_dir)¶ Writes given shader dict to the given JSON file :param shader_dict: dict :param file_dir: str
-
classmethod
write_network(shader_extension, shaders_path, shaders=None, icon_path=None, publish=False)¶ Writes shader network info to the given path :param shaders_path: str, path where we want to store the shader :param shaders: list<str>, list of shaders we want to store :param icon_path: str, icon we want to show in the shader viewer :return: list<str>, list of exported shaders
-
classmethod
-
artellapipe.utils.shader.load_all_scene_shaders(project, load=True, apply_shader=True)¶ Loops through all tag data scene nodes and loads all necessary shaders into the current scene If a specific shader is already loaded, that shader is skip :return: list<str>, list of loaded shaders
-
artellapipe.utils.shader.load_shader(project, shader_name)¶ Loads shader with given name in current DCC :param project: ArtellaProject :param shader_name: str