(node_VRAY, nodeMAT_RED, parameter_VRAY, material_RED, nodeRSM_RED)
Copy parameters from VRAY material to RED nodes

    :param node_VRAY - VRAY node with material parameters
    :param nodeMAT_RED - RED node with material parameters
    :param parameter_VRAY - current parameter (string) from dictionary to copy data from
    :param material_RED
    :param nodeRSM_RED
Copy parameters from VRAY material to RED nodes
Copy parameters from VRAY material to RED nodes
def copyParameters(node_VRAY, nodeMAT_RED, parameter_VRAY, material_RED, nodeRSM_RED):
    '''
    Copy parameters from VRAY material to RED nodes

    :param node_VRAY - VRAY node with material parameters
    :param nodeMAT_RED - RED node with material parameters
    :param parameter_VRAY - current parameter (string) from dictionary to copy data from
    :param material_RED
    :param nodeRSM_RED
    '''

    # Check if parameter exist in shaderParametersList
    if checkParameterInList(parameter_VRAY):
        # Get VRAY shader parameter (object)
        parameter_VRAY = node_VRAY.parmTuple(parameter_VRAY)
        # Get parameter value for VRAY
        parameterValue_VRAY = parameter_VRAY.eval()
        # Get corresponding RED parameter
        parameter_RED = returnParameterRED(parameter_VRAY.name())

        # Set RED shader parameter
        # Process textured parameters
        if checkIfTexture(parameter_VRAY.name()):  # Check if current parameter is textured

            # Get string texture path from tuple and fix slashes
            parameterValue_VRAY = parameterValue_VRAY[0].replace('\\', '/')

            # Process bump and displacement
            if checkIfBump(parameter_VRAY.name()):  # Check if current parameter is a bump
                # Check if texture name exists
                if parameterValue_VRAY != '':
                    # Create and connect  bump node
                    bump_RED = material_RED.createNode('redshift::BumpMap')
                    nodeRSM_RED.setNamedInput('Bump Map', bump_RED, 'out')
                    bump_RED.parm('scale').set(scaleBump)
                    # Create and connect texture node
                    texture_RED = material_RED.createNode('redshift::TextureSampler')
                    texture_RED.setName(parameter_VRAY.name())
                    bump_RED.setNamedInput('input', texture_RED, 'outColor')
                    textureName = parameterValue_VRAY # Set texture name
                    texture_RED.parm('tex0').set(textureName)
                    # Create and connect displacement node
                    disp_RED = material_RED.createNode('redshift::Displacement')
                    nodeRSM_RED.setNamedInput('Displacement', disp_RED, 'out')
                    disp_RED.setNamedInput('texMap', texture_RED, 'outColor')
                    disp_RED.parm('scale').set(scaleBump)

            # Process other textures
            else:
                # Check if texture name exists
                if parameterValue_VRAY != '':
                    textureName = parameterValue_VRAY # Set texture name
                    texture_RED = material_RED.createNode('redshift::TextureSampler')
                    texture_RED.setName(parameter_VRAY.name())
                    nodeMAT_RED.setNamedInput(parameter_RED, texture_RED, 'outColor')
                    texture_RED.parm('tex0').set(textureName)

        # Process other parameters
        else:
            if parameter_VRAY.name() == 'opacity_factor':  # Invert opacity (to map refraction weight)
                nodeMAT_RED.parmTuple(parameter_RED).set(tuple([1.0 - parameterValue_VRAY[0]]))
            else:
                nodeMAT_RED.parmTuple(parameter_RED).set(parameterValue_VRAY)

        # Layout redshift material nodes in Network View
        material_RED.layoutChildren()
def copyParameters ( node_VRAY , nodeMAT_RED , parameter_VRAY , material_RED , nodeRSM_RED ) : # Check if parameter exist in shaderParametersList if checkParameterInList ( parameter_VRAY ) : # Get VRAY shader parameter (object) parameter_VRAY = node_VRAY . parmTuple ( parameter_VRAY ) # Get parameter value for VRAY parameterValue_VRAY = parameter_VRAY . eval ( ) # Get corresponding RED parameter parameter_RED = returnParameterRED ( parameter_VRAY . name ( ) ) # Set RED shader parameter # Process textured parameters if checkIfTexture ( parameter_VRAY . name ( ) ) : # Check if current parameter is textured # Get string texture path from tuple and fix slashes parameterValue_VRAY = parameterValue_VRAY [ 0 ] . replace ( '\\' , '/' ) # Process bump and displacement if checkIfBump ( parameter_VRAY . name ( ) ) : # Check if current parameter is a bump # Check if texture name exists if parameterValue_VRAY != '' : # Create and connect  bump node bump_RED = material_RED . createNode ( 'redshift::BumpMap' ) nodeRSM_RED . setNamedInput ( 'Bump Map' , bump_RED , 'out' ) bump_RED . parm ( 'scale' ) . set ( scaleBump ) # Create and connect texture node texture_RED = material_RED . createNode ( 'redshift::TextureSampler' ) texture_RED . setName ( parameter_VRAY . name ( ) ) bump_RED . setNamedInput ( 'input' , texture_RED , 'outColor' ) textureName = parameterValue_VRAY # Set texture name texture_RED . parm ( 'tex0' ) . set ( textureName ) # Create and connect displacement node disp_RED = material_RED . createNode ( 'redshift::Displacement' ) nodeRSM_RED . setNamedInput ( 'Displacement' , disp_RED , 'out' ) disp_RED . setNamedInput ( 'texMap' , texture_RED , 'outColor' ) disp_RED . parm ( 'scale' ) . set ( scaleBump ) # Process other textures else : # Check if texture name exists if parameterValue_VRAY != '' : textureName = parameterValue_VRAY # Set texture name texture_RED = material_RED . createNode ( 'redshift::TextureSampler' ) texture_RED . setName ( parameter_VRAY . name ( ) ) nodeMAT_RED . setNamedInput ( parameter_RED , texture_RED , 'outColor' ) texture_RED . parm ( 'tex0' ) . set ( textureName ) # Process other parameters else : if parameter_VRAY . name ( ) == 'opacity_factor' : # Invert opacity (to map refraction weight) nodeMAT_RED . parmTuple ( parameter_RED ) . set ( tuple ( [ 1.0 - parameterValue_VRAY [ 0 ] ] ) ) else : nodeMAT_RED . parmTuple ( parameter_RED ) . set ( parameterValue_VRAY ) # Layout redshift material nodes in Network View material_RED . layoutChildren ( )