+ if scene.background_set or (scene.instances and scene.blended_instances):
+ scene_res.statements.append(Statement("type", Token("ordered")))
+ if scene.background_set:
+ scene_res.statements.append(scene_res.create_reference_statement("scene", resources[scene.background_set.name+".scene"]))
+
+ if scene.instances:
+ st = Statement("scene")
+ st.sub.append(Statement("type", Token("simple")))
+ self.add_instances(scene_res, st.sub, scene.instances, resources)
+ scene_res.statements.append(st)
+
+ if scene.blended_instances:
+ st = Statement("scene")
+ st.sub.append(Statement("type", Token("zsorted")))
+ self.add_instances(scene_res, st.sub, scene.blended_instances, resources)
+ scene_res.statements.append(st)
+ else:
+ scene_type = "zsorted" if scene.blended_instances else "simple"
+ scene_res.statements.append(Statement("type", Token(scene_type)))
+
+ self.add_instances(scene_res, scene_res.statements, scene.instances, resources)
+ self.add_instances(scene_res, scene_res.statements, scene.blended_instances, resources)