Beispiel #1
0
            public SkinnedMeshCapturer(usdiExporter exporter, ComponentCapturer parent, SkinnedMeshRenderer target)
                : base(exporter, parent, target.GetComponent <Transform>(), false)
            {
                m_usd    = usdi.usdiCreateMesh(ctx, parent.usd, CreateName(target));
                m_target = target;
                m_buffer = new MeshBuffer();

                if (m_target.GetComponent <Cloth>() != null)
                {
                    base.scale = false;
                }

                m_captureNormals    = exporter.m_captureMeshNormals;
                m_captureTangents   = exporter.m_captureMeshTangents;
                m_captureUVs        = exporter.m_captureMeshUVs;
                m_captureBones      = exporter.m_captureSkinnedMeshAs == SkinnedMeshCaptureMode.BoneAndWeights;
                m_captureEveryFrame = !m_captureBones;

                var conf = target.GetComponent <usdiMeshExportConfig>();

                if (conf != null)
                {
                    m_captureNormals           = conf.m_captureNormals;
                    m_captureTangents          = conf.m_captureTangents;
                    m_captureUVs               = conf.m_captureUVs;
                    m_captureEveryFrame        = conf.m_captureEveryFrame;
                    m_captureEveryFrameUV      = conf.m_captureEveryFrameUV;
                    m_captureEveryFrameIndices = conf.m_captureEveryFrameIndices;
                }
            }
Beispiel #2
0
 public CameraCapturer(usdiExporter exporter, ComponentCapturer parent, Camera target)
     : base(exporter, parent, target.GetComponent <Transform>(), false)
 {
     m_usd    = usdi.usdiCreateCamera(ctx, parent.usd, CreateName(target));
     m_target = target;
     //target.GetComponent<usdiCameraExportConfig>();
 }
Beispiel #3
0
            public ParticleCapturer(usdiExporter exporter, ComponentCapturer parent, ParticleSystem target)
                : base(exporter, parent, target.GetComponent <Transform>(), false)
            {
                m_usd    = usdi.usdiCreatePoints(ctx, parent.usd, CreateName(target));
                m_target = target;

                var config = target.GetComponent <usdiParticleExportConfig>();

                if (config != null)
                {
                    m_captureRotations = config.m_captureRotations;
                }
                if (m_captureRotations)
                {
                    m_attr_rotatrions = usdi.usdiPrimCreateAttribute(m_usd, "rotations", usdi.AttributeType.Float4Array);
                }
            }
Beispiel #4
0
            public TransformCapturer(usdiExporter exporter, ComponentCapturer parent, Transform target, bool create_usd_node = true)
                : base(exporter, parent)
            {
                m_target = target;
                if (create_usd_node)
                {
                    m_usd = usdi.usdiCreateXform(ctx, parent.usd, CreateName(target));
                }

                if (m_target.gameObject.isStatic)
                {
                    m_captureEveryFrame = false;
                }

                var config = target.GetComponent <usdiTransformExportConfig>();

                if (config)
                {
                    m_captureEveryFrame = config.m_captureEveryFrame;
                }
            }
Beispiel #5
0
            public MeshCapturer(usdiExporter exporter, ComponentCapturer parent, MeshRenderer target)
                : base(exporter, parent, target.GetComponent <Transform>(), false)
            {
                m_usd         = usdi.usdiCreateMesh(ctx, parent.usd, CreateName(target));
                m_target      = target;
                m_mesh_buffer = new MeshBuffer();

                m_captureNormals = exporter.m_captureMeshNormals;
                m_captureUVs     = exporter.m_captureMeshUVs;

                var conf = target.GetComponent <usdiMeshExportConfig>();

                if (conf != null)
                {
                    m_captureNormals           = conf.m_captureNormals;
                    m_captureUVs               = conf.m_captureUVs;
                    m_captureEveryFrame        = conf.m_captureEveryFrame;
                    m_captureEveryFrameUV      = conf.m_captureEveryFrameUV;
                    m_captureEveryFrameIndices = conf.m_captureEveryFrameIndices;
                }
            }
Beispiel #6
0
 public CustomCapturerHandler(usdiExporter exporter, ComponentCapturer parent, usdiCustomComponentCapturer target)
     : base(exporter, parent, target.GetComponent <Transform>(), false)
 {
     m_target = target;
 }
Beispiel #7
0
 public RootCapturer(usdiExporter exporter, usdi.Schema usd)
     : base(exporter, null)
 {
     m_usd = usd;
 }
Beispiel #8
0
            public abstract void Flush(double t);   // called from worker thread

            protected ComponentCapturer(usdiExporter exporter, ComponentCapturer parent)
            {
                m_exporter = exporter;
                m_parent   = parent;
            }