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

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

            AbcAPI.aiPolyMeshGetSummary(abcSchema, ref summary);

            m_FreshSetup = true;
        }
Example #3
0
        public override void AbcSetup(AbcAPI.aiObject abcObj, AbcAPI.aiSchema abcSchema)
        {
            base.AbcSetup(abcObj, abcSchema);

            Light light = GetOrAddComponent <Light>();

            // Disable component for now
            light.enabled = false;
        }
Example #4
0
        public virtual void AbcSetup(AbcAPI.aiObject abcObj,
                                     AbcAPI.aiSchema abcSchema)
        {
            m_AbcObj     = abcObj;
            m_AbcSchema  = abcSchema;
            m_ThisHandle = GCHandle.Alloc(this);

            IntPtr ptr = GCHandle.ToIntPtr(m_ThisHandle);

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

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

            bool hasMesh = meshFilter != null &&
                           meshFilter.sharedMesh != null &&
                           meshFilter.sharedMesh.name.IndexOf("dyn: ") == 0;

            if (!hasMesh)
            {
                mesh = new Mesh {
                    name = "dyn: " + gameObject.name
                };
                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);
        }