trigger.library.shading ======================= .. py:module:: trigger.library.shading .. autoapi-nested-parse:: Collection of shading related functions Functions --------- .. autoapisummary:: trigger.library.shading.assign_shader trigger.library.shading.collect_material_database trigger.library.shading.create_preview_shader trigger.library.shading.create_shading_engine trigger.library.shading.find_file_node trigger.library.shading.get_all_materials trigger.library.shading.get_file_nodes trigger.library.shading.get_shaders trigger.library.shading.get_shading_groups Module Contents --------------- .. py:function:: assign_shader(shader, mesh=None, shading_group=None) Assign given shader to all available shading groups of mesh. .. py:function:: collect_material_database() Collect all basic shader information from scene into a dictionary. Note that, this function ONLY collects the shader attribute values as it is. It does not collect any connected node information like ramp, file etc. .. py:function:: create_preview_shader(database, material_id, name=None, mesh=None) Create a preview shader based on the template on given database. Args: database: (dictionary) dictionary item collected with 'collect_material_database' function material_id: (string) key id which needs to exist in the provided dictionary. If not, default standardSurface will be used instead name: (string) Name of the new shader. Optional. If not provided _M template will be used mesh: (string) Mesh that will be assigned. The Shading groups will be preserved if there are multi sgs Returns: .. py:function:: create_shading_engine(mesh, name=None) Create a new shading engine and connect it to the given mesh. .. py:function:: find_file_node(plug) Find recursively the first file node connected to the plug. .. py:function:: get_all_materials() Return all materials IN USE. .. py:function:: get_file_nodes(mesh_transforms) Returns all file nodes connected to the given mesh transforms. .. py:function:: get_shaders(mesh) Return all shaders connected to the given mesh .. py:function:: get_shading_groups(mesh) Return all shading groups of the given mesh.