+ ss.sub.append(Statement("rotation", quat.angle*180/math.pi, *tuple(quat.axis)))
+
+ scale = i.matrix_world.to_scale()
+ ss.sub.append(Statement("scale", *tuple(scale)))
+
+ st.sub.append(ss)
+ scene_res.statements.append(st)
+
+ return scene_res
+
+ def export_sequence_resources(self, scene, resources):
+ from .datafile import Resource, Statement, Token
+
+ if scene.background_set:
+ wrapper_name = scene.name+".wrapper.scene"
+ if wrapper_name not in resources:
+ wrapper_res = Resource(wrapper_name, "scene")
+ wrapper_res.statements.append(Statement("type", Token("ordered")))
+ for s in scene.get_chain():
+ wrapper_res.statements.append(wrapper_res.create_reference_statement("scene", resources[s.name+".scene"]))
+
+ resources[wrapper_name] = wrapper_res
+
+ lights = []
+ s = scene
+ while s:
+ lights += s.lights
+ s = s.background_set
+
+ from .util import make_unique
+ lights = make_unique(lights)
+
+ from .export_light import LightExporter
+ light_exporter = LightExporter()
+ for l in lights:
+ light_name = l.name+".light"
+ if light_name not in resources:
+ resources[light_name] = light_exporter.export_light(l)
+
+ lighting_name = scene.name+".lightn"
+ if lighting_name not in resources:
+ lighting_res = Resource(lighting_name, "lighting")
+ for l in lights:
+ lighting_res.statements.append(lighting_res.create_reference_statement("light", resources[l.name+".light"]))
+
+ resources[lighting_name] = lighting_res
+
+ def export_sequence(self, scene, resources):
+ from .datafile import Resource, Statement
+ seq_res = Resource(scene.name+".seq", "sequence")
+
+ if scene.use_hdr:
+ seq_res.statements.append(Statement("hdr", True))
+
+ content = scene
+ if scene.background_set:
+ content = resources[scene.name+".wrapper.scene"]
+
+ ss = Statement("pass", "", "content")
+ ss.sub.append(Statement("depth_test", "lequal"))
+ ss.sub.append(seq_res.create_reference_statement("lighting", resources[scene.name+".lightn"]))
+ ss.sub.append(seq_res.create_reference_statement("scene", content))
+ seq_res.statements.append(ss)
+
+ if scene.use_hdr:
+ seq_res.statements.append(Statement("bloom"))
+ ss = Statement("colorcurve")
+ ss.sub.append(Statement("srgb"))
+ seq_res.statements.append(ss)
+ else:
+ # Add a colorcurve with linear response to convert into sRGB color space
+ ss = Statement("colorcurve")
+ ss.sub.append(Statement("brightness_response", 1.0))
+ ss.sub.append(Statement("srgb"))
+ seq_res.statements.append(ss)
+
+ return seq_res