Пример #1
0
def import_from_md(filename):
    '''create maya node tree from C::R data'''
    meta = MetaData(filename)
    facts = ChronoRender().getFactories()

    nodes = []
    for typename, elem in meta.getElementsDict().iteritems():
        for root in elem:
            nodes.append(_generate_node(root, typename, facts))

    return nodes
Пример #2
0
    def test_XML(self):
        infile_xml = './input/metadata/xml/0.xml'
        md = MetaData(infile_xml)

        elem = md.findAll('rendersettings')
        self.assertEqual(len(elem), 1)

        elem = md.findAll('renderobject')
        self.assertEqual(len(elem), 1)

        elem = md.findAll('renderpass')
        self.assertEqual(len(elem), 1)

        elem = md.findAll('geometry')
        self.assertEqual(len(elem), 1)

        elem = md.findAll('shader')
        self.assertEqual(len(elem), 1)
        for inst in elem:
            sdr = shader.Shader(**inst)
            self.assertEqual(sdr.getMember('Kd'), '666')

        elems = md.getElementsDict()
Пример #3
0
    def test_AddElem(self):
        md = MetaData('out.yml')
        md.addElement('test', {'gorb' : 'val'})

        elems = md.getElementsDict()
        self.assertTrue('test' in elems)