Пример #1
0
        /// <summary>
        /// Handles processing of 'raw' materials with no geometry attached
        /// </summary>
        private void Execute_Surface()
        {
            // create the render material from the asset
            var mat = RhinoBridgePlugIn.Instance.ShouldScaleMaterials
                ? RenderContentFactory.CreateMaterial(_asset, _doc, RhinoBridgePlugIn.FBX_UNIT_SYSTEM)
                : RenderContentFactory.CreateMaterial(_asset, _doc);

            // Add to the import queue
            AssetImportQueue.Instance.AddPackage(new MaterialImportPackage(mat, _doc));
        }
Пример #2
0
        /// <summary>
        /// Handles processing of 3d assets
        /// </summary>
        private void Execute_Prop()
        {
            // create data access endpoints
            var matAccess = new MaterialData(_doc);

            // create the render material for the asset
            var mat = RenderContentFactory.CreateMaterial(_asset, _doc, RhinoBridgePlugIn.FBX_UNIT_SYSTEM);

            // Add it to the document
            // TODO: This might also not be thread safe, although i never saw it crash
            matAccess.AddRenderMaterial(mat);

            // get all geometry infos
            var geoInfos = from geom in _asset.geometry select geom.ToGeometryInformation();

            // Add to the import queue
            AssetImportQueue.Instance.AddPackage(new AssetImportPackage(mat, geoInfos, _doc));
        }