-
Notifications
You must be signed in to change notification settings - Fork 1
/
RVEffect.py
38 lines (27 loc) · 1.04 KB
/
RVEffect.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from RVObject import *
import xml.etree.ElementTree as xmltree
import uuid
import util
class RVEffect(RVObject):
def __init__(self,xmlelement=None):
self.UUID = str(uuid.uuid4())
self.displayName = ''
self.effectVariables = list()
if xmlelement is None:
return
self.deserializexml(xmlelement)
def deserializexml(self, xmlelement):
self.UUID = xmlelement.get('UUID')
self.displayName = xmlelement.get('displayName')
xml_array = xmlelement.find("./array[@rvXMLIvarName='effectVariables']")
for cxml in xml_array:
self.effectVariables.append(util.createobject(cxml))
def serializexml(self):
xmlelement =xmltree.Element('RVEffect')
xmlelement.set('UUID', self.UUID)
xmlelement.set('displayName', self.displayName)
xml_array = self.createarray('effectVariables')
for ceffect in self.effectVariables:
xml_array.append(ceffect.serializexml())
xmlelement.append(xml_array)
return xmlelement