Latest 1.0.8
Homepage https://github.com/eugenebokhan/AssetImportKit
License BSD 3-Clause
Platforms ios 10.3, osx 10.12
Authors

License

AssetImportKit is a cross platform library (macOS, iOS) that coverts the files supported by Assimp to SceneKit scenes.

Features

AssetImportKit allows you to import Assimp supported file formats directly in SceneKit at runtime.
The library supports:

  • Geometry
  • Materials (with color, embedded textures and external textures)
  • Cameras and
  • Skeletal animations.
  • Serialization to .scn format

Supported file formats

AssetImportKit supports the following file formats: 3DS, 3MF, COLLADA, FBX, GLTF, OBJ STL.
If you want to add support of all Assimp importers, please look at my assimp-for-ios build script.

Demos

This repository includes 2 small demos for macOS and iOS.

Requirements

  • Xcode 10 or later
  • Swift 4.2
  • iOS 11.3 or later
  • macOS 10.13 or later

Installation via CocoaPods

pod 'AssetImportKit'

Manual Installation

In order to install AssetImportKit manually please read the How-to-Install guide.

Usage

do {
  let assimpScene = try SCNScene.assimpScene(filePath: filePath,
                                              postProcessSteps: [.defaultQuality])
  if let modelScene = assimpScene.modelScene {
    modelScene.rootNode.childNodes.forEach {
      sceneView.scene?.rootNode.addChildNode($0)
    }
  }
} catch {
  print(error.localizedDescription)
}

Note for iOS builds: if you are developing an iOS application, set the Enable Bitcode under Build Settings->Build Options of your target to NO.

Author

Eugene Bokhan

iOS Software Engineer
Twitter Github LinkedIn

License

AssetImportKit’s license is based on 3-clause BSD-License.

Latest podspec

{
    "name": "AssetImportKit",
    "version": "1.0.8",
    "summary": "Swifty cross platform library (macOS, iOS) that converts Assimp supported models to SceneKit scenes.",
    "description": "AssetImportKit allows you to import Assimp supported file formats directly in SceneKit at runtime. The library supports: geometry, materials (with color, embedded textures and external textures), cameras, skeletal animations, serialization to .scn format.",
    "homepage": "https://github.com/eugenebokhan/AssetImportKit",
    "screenshots": [
        "https://github.com/eugenebokhan/AssetImportKit/raw/master/Media/AssetImportKit_Demonstration.png",
        "https://github.com/eugenebokhan/AssetImportKit/raw/master/SceneKitAssetImport/Media/SceneKitAssetImport_HowToUse.png"
    ],
    "license": {
        "type": "BSD 3-Clause",
        "file": "LICENSE"
    },
    "authors": {
        "Eugene Bokhan": "[email protected]"
    },
    "social_media_url": "http://twitter.com/eugenebokhan",
    "platforms": {
        "ios": "10.3",
        "osx": "10.12"
    },
    "swift_version": "4.2",
    "source": {
        "git": "https://github.com/eugenebokhan/AssetImportKit.git",
        "tag": "1.0.8"
    },
    "source_files": "AssetImportKit/**/*.{swift}",
    "preserve_paths": [
        "AssetImportKit/AssetImportKit/Dependencies/**/*",
        "AssetImportKit/AssetImportKit/module.modulemap"
    ],
    "ios": {
        "vendored_libraries": [
            "AssetImportKit/AssetImportKit/Dependencies/Assimp/lib/iOS/libassimp-iOS.a",
            "AssetImportKit/AssetImportKit/Dependencies/Assimp/lib/iOS/libIrrXML-iOS.a"
        ],
        "libraries": [
            "assimp-iOS",
            "IrrXML-iOS"
        ],
        "xcconfig": {
            "SWIFT_INCLUDE_PATHS": "$(PROJECT_DIR)/AssetImportKit/AssetImportKit/AssetImportKit/",
            "HEADER_SEARCH_PATHS": "$(PROJECT_DIR)/AssetImportKit/Dependencies/Assimp/include",
            "ENABLE_BITCODE": "NO",
            "OTHER_LDFLAGS": "-ObjC -all_load -lz -lstdc++"
        }
    },
    "osx": {
        "vendored_libraries": [
            "AssetImportKit/AssetImportKit/Dependencies/Assimp/lib/macOS/libassimp-macOS.a",
            "AssetImportKit/AssetImportKit/Dependencies/Assimp/lib/macOS/libIrrXML-macOS.a"
        ],
        "libraries": [
            "assimp-macOS",
            "IrrXML-macOS"
        ],
        "xcconfig": {
            "SWIFT_INCLUDE_PATHS": "$(PROJECT_DIR)/AssetImportKit/AssetImportKit/AssetImportKit/",
            "HEADER_SEARCH_PATHS": "$(PROJECT_DIR)/AssetImportKit/Dependencies/Assimp/include",
            "ENABLE_BITCODE": "NO",
            "OTHER_LDFLAGS": "-ObjC -all_load -lz -lstdc++",
            "EXPANDED_CODE_SIGN_IDENTITY": "-",
            "EXPANDED_CODE_SIGN_IDENTITY_NAME": "-"
        }
    }
}

Pin It on Pinterest

Share This