예제 #1
0
def panel_node_draw(layout, ntree, output_type):
    node = find_output_node(ntree, output_type)

    if node:
        input = find_node_input(node, 'Surface')
        layout.template_node_view(ntree, node, input)
        return True

    return False
예제 #2
0
파일: Unifier.py 프로젝트: TriVoxel/Unifier
def panel_node_draw(layout, ntree, output_type):
    node = find_output_node(ntree, output_type)

    if node:
        input = find_node_input(node, 'Surface')
        if input:
            layout.template_node_view(ntree, node, input)
        else:
            layout.label(text="Incompatible output node")
    else:
        layout.label(text="No output node")
    def draw(self, context):
        layout = self.layout

        world = context.world

        layout.prop(world, "use_nodes", icon='NODETREE')
        layout.separator()

        if world.use_nodes:
            ntree = world.node_tree
            node = find_output_node(ntree, 'OUTPUT_WORLD')

            if not node:
                layout.label(text="No output node")
            else:
                input = find_node_input(node, 'Surface')
                layout.template_node_view(ntree, node, input)
        else:
            layout.prop(world, "horizon_color", text="Color")
def panel_node_draw(layout, ntree, output_type):
    node = find_output_node(ntree, output_type)

    if node:
        def display_input(layout, ntree, node, input_name):
            input = find_node_input(node, input_name)
            layout.template_node_view(ntree, node, input)

        display_input(layout, ntree, node, 'Base Color')
        if output_type == 'OUTPUT_METALLIC':
            display_input(layout, ntree, node, 'Metallic')
        display_input(layout, ntree, node, 'Specular')
        display_input(layout, ntree, node, 'Roughness')
        display_input(layout, ntree, node, 'Emissive Color')
        display_input(layout, ntree, node, 'Transparency')
        display_input(layout, ntree, node, 'Normal')
        display_input(layout, ntree, node, 'Ambient Occlusion')
        return True

    return False