Beispiel #1
0
        public override void AbcSetup(AlembicStream abcStream,
                                      AbcAPI.aiObject abcObj,
                                      AbcAPI.aiSchema abcSchema)
        {
            base.AbcSetup(abcStream, abcObj, abcSchema);

            m_camera = GetOrAddComponent <Camera>();
        }
Beispiel #2
0
        public override void AbcSetup(AlembicStream abcStream,
                                      AbcAPI.aiObject abcObj,
                                      AbcAPI.aiSchema abcSchema)
        {
            base.AbcSetup(abcStream, abcObj, abcSchema);

            AbcAPI.aiPolyMeshGetSummary(abcSchema, ref m_summary);

            m_freshSetup = true;
        }
Beispiel #3
0
        public override void AbcSetup(AlembicStream abcStream,
                                      AbcAPI.aiObject abcObj,
                                      AbcAPI.aiSchema abcSchema)
        {
            base.AbcSetup(abcStream, abcObj, abcSchema);

            Light light = GetOrAddComponent <Light>();

            // Disable component for now
            light.enabled = false;
        }
        public virtual void AbcSetup(AlembicStream abcStream,
                                     AbcAPI.aiObject abcObj,
                                     AbcAPI.aiSchema abcSchema)
        {
            m_abcStream  = abcStream;
            m_abcObj     = abcObj;
            m_abcSchema  = abcSchema;
            m_thisHandle = GCHandle.Alloc(this);
            m_trans      = GetComponent <Transform>();

            IntPtr ptr = GCHandle.ToIntPtr(m_thisHandle);

            AbcAPI.aiSchemaSetConfigCallback(abcSchema, ConfigCallback, ptr);
            AbcAPI.aiSchemaSetSampleCallback(abcSchema, SampleCallback, ptr);
        }
Beispiel #5
0
        Mesh AddMeshComponents(AbcAPI.aiObject abc, GameObject gameObject)
        {
            Mesh mesh = null;

            MeshFilter meshFilter = gameObject.GetComponent <MeshFilter>();

            if (meshFilter == null || meshFilter.sharedMesh == null)
            {
                mesh = new Mesh();
                mesh.MarkDynamic();

                if (meshFilter == null)
                {
                    meshFilter = gameObject.AddComponent <MeshFilter>();
                }

                meshFilter.sharedMesh = mesh;

                MeshRenderer renderer = gameObject.GetComponent <MeshRenderer>();

                if (renderer == null)
                {
                    renderer = gameObject.AddComponent <MeshRenderer>();
                }

    #if UNITY_EDITOR
                Material material = UnityEngine.Object.Instantiate(AbcUtils.GetDefaultMaterial());
                material.name           = "Material_0";
                renderer.sharedMaterial = material;
    #endif
            }
            else
            {
                mesh = meshFilter.sharedMesh;
            }

            return(mesh);
        }