Beispiel #1
0
 def to_dict(self):
     result = {}
     result["innerConeAngle"] = from_union([from_float, from_none],
                                           self.inner_cone_angle)
     result["outerConeAngle"] = from_union([from_float, from_none],
                                           self.outer_cone_angle)
     return result
Beispiel #2
0
 def from_dict(obj):
     assert isinstance(obj, dict)
     inner_cone_angle = from_union([from_float, from_none],
                                   obj.get("innerConeAngle"))
     outer_cone_angle = from_union([from_float, from_none],
                                   obj.get("outerConeAngle"))
     return LightSpot(inner_cone_angle, outer_cone_angle)
Beispiel #3
0
 def from_dict(obj):
     assert isinstance(obj, dict)
     color = from_union([lambda x: from_list(from_float, x), from_none], obj.get("color"))
     intensity = from_union([from_float, from_none], obj.get("intensity"))
     spot = LightSpot.from_dict(obj.get("spot"))
     type = from_str(obj.get("type"))
     range = from_union([from_float, from_none], obj.get("range"))
     name = from_union([from_str, from_none], obj.get("name"))
     extensions = from_union([lambda x: from_dict(lambda x: from_dict(lambda x: x, x), x), from_none],
                             obj.get("extensions"))
     extras = obj.get("extras")
     return Light(color, intensity, spot, type, range, name, extensions, extras)
Beispiel #4
0
 def to_dict(self):
     result = {}
     result["color"] = from_union([lambda x: from_list(to_float, x), from_none], self.color)
     result["intensity"] = from_union([from_float, from_none], self.intensity)
     result["spot"] = from_union([lambda x: to_class(LightSpot, x), from_none], self.spot)
     result["type"] = from_str(self.type)
     result["range"] = from_union([from_float, from_none], self.range)
     result["name"] = from_union([from_str, from_none], self.name)
     result["extensions"] = from_union([lambda x: from_dict(lambda x: from_dict(lambda x: x, x), x), from_none],
                                       self.extensions)
     result["extras"] = self.extras
     return result