public SkinnedMeshCapturer(AlembicExporter exp, ComponentCapturer parent, SkinnedMeshRenderer target)
                : base(exp, parent, target)
            {
                m_target = target;
                var mesh = target.sharedMesh;

                if (mesh == null)
                {
                    return;
                }

                m_abc  = parent.abc.NewPolyMesh(target.name);
                m_mbuf = new MeshBuffer();
                m_mbuf.SetupSubmeshes(m_abc, mesh, m_target.sharedMaterials);

                m_meshSrc = target.sharedMesh;
                m_cloth   = m_target.GetComponent <Cloth>();
                if (m_cloth != null)
                {
                    m_cbuf          = new ClothBuffer();
                    m_cbuf.rootBone = m_target.rootBone != null ? m_target.rootBone : m_target.GetComponent <Transform>();

                    var tc = m_parent as TransformCapturer;
                    if (tc != null)
                    {
                        tc.capturePosition = false;
                        tc.captureRotation = false;
                        tc.captureScale    = false;
                    }
                }
            }
 public CameraCapturer(AlembicExporter exp, ComponentCapturer parent, Camera target)
     : base(exp, parent, target)
 {
     m_abc    = parent.abc.NewCamera(target.name);
     m_target = target;
     m_params = target.GetComponent <AlembicCameraParams>();
 }
            public ParticleCapturer(AlembicExporter exp, ComponentCapturer parent, ParticleSystem target)
                : base(exp, parent, target)
            {
                m_abc    = parent.abc.NewPoints(target.name);
                m_target = target;

                m_prop_rotatrions = m_abc.NewProperty("rotation", aePropertyType.Float4Array);
            }
            public MeshCapturer(AlembicExporter exp, ComponentCapturer parent, MeshRenderer target)
                : base(exp, parent, target)
            {
                m_target = target;
                var mesh = m_target.GetComponent <MeshFilter>().sharedMesh;

                if (mesh == null)
                {
                    return;
                }

                m_abc  = parent.abc.NewPolyMesh(target.name);
                m_mbuf = new MeshBuffer();
                m_mbuf.SetupSubmeshes(m_abc, mesh, m_target.sharedMaterials);
            }
 public CustomCapturerHandler(AlembicExporter exp, ComponentCapturer parent, AlembicCustomComponentCapturer target)
     : base(exp, parent, target)
 {
     m_target = target;
 }
 public TransformCapturer(AlembicExporter exp, ComponentCapturer parent, Transform target)
     : base(exp, parent, target)
 {
     m_abc    = parent.abc.NewXform(target.name + " (" + target.GetInstanceID().ToString("X8") + ")");
     m_target = target;
 }
 public RootCapturer(AlembicExporter exp, aeObject abc)
     : base(exp, null, null)
 {
     m_abc = abc;
 }
 protected ComponentCapturer(AlembicExporter exp, ComponentCapturer p, Component c)
 {
     m_exporter = exp;
     m_parent   = p;
     m_obj      = c != null ? c.gameObject : null;
 }
            public void Capture(Mesh mesh, Cloth cloth, MeshBuffer mbuf, AlembicExporter exp)
            {
                if (mesh == null || cloth == null)
                {
                    return;
                }
                if (remap.Count != mesh.vertexCount)
                {
                    GenerateRemapIndices(mesh, mbuf);
                }

                // capture cloth points and normals
                vertices.Assign(cloth.vertices);
                if (numRemappedVertices != vertices.Count)
                {
                    Debug.LogWarning("numRemappedVertices != vertices.Count");
                    return;
                }

                if (exp.m_meshNormals)
                {
                    normals.Assign(cloth.normals);
                }
                else
                {
                    normals.Clear();
                }

                // apply root bone transform
                if (rootBone != null)
                {
                    var mat = Matrix4x4.TRS(rootBone.localPosition, rootBone.localRotation, Vector3.one);
                    aeApplyMatrixP(vertices, vertices.Count, ref mat);
                    aeApplyMatrixV(normals, normals.Count, ref mat);
                }

                // remap vertices and normals
                for (int vi = 0; vi < remap.Count; ++vi)
                {
                    mbuf.points[vi] = vertices[remap[vi]];
                }
                if (normals.Count > 0)
                {
                    mbuf.normals.ResizeDiscard(remap.Count);
                    for (int vi = 0; vi < remap.Count; ++vi)
                    {
                        mbuf.normals[vi] = normals[remap[vi]];
                    }
                }

                // capture other components
                if (exp.m_meshUV0)
                {
                    mbuf.uv0.LockList(ls => mesh.GetUVs(0, ls));
                }
                else
                {
                    mbuf.uv0.Clear();
                }

                if (exp.m_meshUV1)
                {
                    mbuf.uv1.LockList(ls => mesh.GetUVs(1, ls));
                }
                else
                {
                    mbuf.uv1.Clear();
                }

                if (exp.m_meshColors)
                {
                    mbuf.colors.LockList(ls => mesh.GetColors(ls));
                }
                else
                {
                    mbuf.colors.Clear();
                }
            }
 public void Capture(Mesh mesh, AlembicExporter exp)
 {
     Capture(mesh, exp.m_meshNormals, exp.m_meshUV0, exp.m_meshUV1, exp.m_meshColors);
 }