| 53 | } |
| 54 | |
| 55 | Properties SceneObject::ToProperties(const ExtMeshCache &extMeshCache, |
| 56 | const bool useRealFileName) const { |
| 57 | Properties props; |
| 58 | |
| 59 | const std::string name = GetName(); |
| 60 | props.Set(Property("scene.objects." + name + ".material")(mat->GetName())); |
| 61 | const string fileName = useRealFileName ? |
| 62 | extMeshCache.GetRealFileName(mesh) : extMeshCache.GetSequenceFileName(mesh); |
| 63 | props.Set(Property("scene.objects." + name + ".ply")(fileName)); |
| 64 | props.Set(Property("scene.objects." + name + ".camerainvisible")(cameraInvisible)); |
| 65 | props.Set(Property("scene.objects." + name + ".id")(objID)); |
| 66 | |
| 67 | switch (mesh->GetType()) { |
| 68 | case TYPE_EXT_TRIANGLE: { |
| 69 | // I have to output the applied transformation |
| 70 | const ExtTriangleMesh *extMesh = (const ExtTriangleMesh *)mesh; |
| 71 | |
| 72 | Transform trans; |
| 73 | extMesh->GetLocal2World(0.f, trans); |
| 74 | |
| 75 | props.Set(Property("scene.objects." + name + ".appliedtransformation")(trans.m)); |
| 76 | break; |
| 77 | } |
| 78 | case TYPE_EXT_TRIANGLE_INSTANCE: { |
| 79 | // I have to output also the transformation |
| 80 | const ExtInstanceTriangleMesh *inst = (const ExtInstanceTriangleMesh *)mesh; |
| 81 | props.Set(Property("scene.objects." + name + ".transformation")(inst->GetTransformation().m)); |
| 82 | break; |
| 83 | } |
| 84 | case TYPE_EXT_TRIANGLE_MOTION: { |
| 85 | // I have to output also the motion blur key transformations |
| 86 | const ExtMotionTriangleMesh *mot = (const ExtMotionTriangleMesh *)mesh; |
| 87 | props.Set(mot->GetMotionSystem().ToProperties("scene.objects." + name, true)); |
| 88 | break; |
| 89 | } |
| 90 | default: |
| 91 | // Nothing to do |
| 92 | break; |
| 93 | } |
| 94 | |
| 95 | return props; |
| 96 | } |
nothing calls this directly
no test coverage detected