From a14ef8d6ccfdef87b8aecb2ddb2fefb8886fcb28 Mon Sep 17 00:00:00 2001 From: Ahmed Fathi Bekhit Date: Fri, 12 Jan 2018 14:44:32 -0500 Subject: [PATCH 1/9] Update README.md --- README.md | 54 ++++-------------------------------------------------- 1 file changed, 4 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 2b3a47d..310b75f 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ In other words, you **NO LONGER** have to ~screen record~/~screenshot~ to captur | [Compatibility](#compatibility) | Describes the `ARVideoKit` device and iOS compatibality | | [Example Project](#example-project) | Explains how to run the example project provided in this repository | | [Installation](#installation) | Describes the [Manual](#manual) option to install `ARVideoKit` | -| [Implementation](#implementation) | Lists the [steps needed](#implementation), [notes](#note), and [reference](#youre-all-set-) for more options | +| [Implementation](#implementation) | Lists the [steps needed](#implementation) for Objective-C & Swift, [notes](#note), and [reference](#youre-all-set-) for more options | | [Publishing to the App Store](#publishing-to-the-app-store) | Describes the steps **required** before submitting an application using `ARVideoKit` to the App Store. | |[![Donate](https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_donate_92x26.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ahmedfbekhit@gmail.com&item_name=Support+ARVideoKit+Developer&item_number=ARVideoKit+Framework+Donations&amount=0%2e00¤cy_code=USD) | [Donations](#donate) will support me to keep maintaining `ARVideoKit` ❀️| | [License](#license) | Describes `ARVideoKit` license | @@ -54,55 +54,9 @@ Or you may drag `ARVideoKit.xcodeproj` into your project and click the **+** but ![example embed framework](http://www.ahmedbekhit.com/embeddedBinary.png) ## Implementation ### Swift -1. `import ARVideoKit` in the application delegate `AppDelegate.swift` and a `UIViewController` with an `ARKit` scene. - -2. In the application delegate `AppDelegate.swift`, add this πŸ‘‡ in order to allow the framework access and identify the supported device orientations. **Recommended** if the application supports landscape orientations. -``` -func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { -return ViewAR.orientation -} -``` - -3. In the selected `UIViewController` class, create an optional type [`RecordAR`](https://github.com/AFathi/ARVideoKit/wiki/RecordAR) global variable. -``` -var recorder:RecordAR? -``` - -4. Initialize [`RecordAR`](https://github.com/AFathi/ARVideoKit/wiki/RecordAR) with [`ARSCNView`](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#init-arscenekitarscnview) or [`ARSKView`](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#init-arspritekitarskview). **Recommended** to initialize in `viewDidLoad()`. - -Initializing RecordAR with `ARSCNView` -``` -recorder = RecordAR(ARSceneKit: sceneView) -``` -Initializing RecordAR with `ARSKView` -``` -recorder = RecordAR(ARSpriteKit: SKSceneView) -``` - -5. Call the [`prepare()`](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#func-prepare_-configurationarconfiguration) method in `viewWillAppear(_ animated: Bool)` -``` -let configuration = ARWorldTrackingConfiguration() -recorder?.prepare(configuration) -``` - -6. Call the [`rest()`](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#func-rest) method in `viewWillDisappear(_ animated: Bool)` -``` -recorder?.rest() -``` - -7. Call the [`record()`](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#func-record) method in the proper method to start recording. -``` -@IBAction func startRecording(_ sender: UIButton) { -recorder?.record() -} -``` - -8. Call the [`stopAndExport()`](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#func-stopandexport_-finished-_-videopath-url-_-permissionstatusphauthorizationstatus-_-exportedbool---swiftvoid--nil) method in the proper method to stop recording. -``` -@IBAction func stopRecording(_ sender: UIButton) { -recorder?.stopAndExport() -} -``` +Check the `README` file of the `/Examples/Swift` folder. [Click here to check the implementation steps.](https://github.com/AFathi/ARVideoKit/tree/master/Examples/Swift) +### Objective-C +Check the `README` file of the `/Examples/Objective-C` folder. [Click here to check the implementation steps.](https://github.com/AFathi/ARVideoKit/tree/master/Examples/Objective-C) ### NOTE Make sure you add the usage description of the `camera`, `microphone`, and `photo library` in the app's `Info.plist`. From 85f1f00a913cba3f70b4a905152100cc91938f9a Mon Sep 17 00:00:00 2001 From: Ahmed Fathi Bekhit Date: Fri, 12 Jan 2018 14:45:11 -0500 Subject: [PATCH 2/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 310b75f..3f93a8c 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ In other words, you **NO LONGER** have to ~screen record~/~screenshot~ to captur | [Publishing to the App Store](#publishing-to-the-app-store) | Describes the steps **required** before submitting an application using `ARVideoKit` to the App Store. | |[![Donate](https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_donate_92x26.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ahmedfbekhit@gmail.com&item_name=Support+ARVideoKit+Developer&item_number=ARVideoKit+Framework+Donations&amount=0%2e00¤cy_code=USD) | [Donations](#donate) will support me to keep maintaining `ARVideoKit` ❀️| | [License](#license) | Describes `ARVideoKit` license | -| [AppCoda Tutorial](https://www.appcoda.com/record-arkit-video/) | Check out the detailed tutorial about implementing `ARVideoKit` with SpriteKit ☺️ | +| [AppCoda Tutorial](https://www.appcoda.com/record-arkit-video/) | Check out a detailed tutorial about implementing `ARVideoKit` with SpriteKit ☺️ | ## Preview |πŸ‘Ύ [Initialized with SpriteKit](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#init-arspritekitarskview)πŸ‘‡ ‍‍‍‍‍‍ ‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍|πŸš€ [Initialized with SceneKit](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#init-arscenekitarscnview) πŸ‘‡ ‍‍‍‍‍‍ ‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍| From f9cabf3ea4083d0c85f3075eff3e6a32a7f0fbda Mon Sep 17 00:00:00 2001 From: Ahmed Fathi Bekhit Date: Fri, 12 Jan 2018 14:47:37 -0500 Subject: [PATCH 3/9] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3f93a8c..94bb7d6 100644 --- a/README.md +++ b/README.md @@ -54,9 +54,9 @@ Or you may drag `ARVideoKit.xcodeproj` into your project and click the **+** but ![example embed framework](http://www.ahmedbekhit.com/embeddedBinary.png) ## Implementation ### Swift -Check the `README` file of the `/Examples/Swift` folder. [Click here to check the implementation steps.](https://github.com/AFathi/ARVideoKit/tree/master/Examples/Swift) +[Click here to check the Swift implementation steps.](https://github.com/AFathi/ARVideoKit/tree/master/Examples/Swift) ### Objective-C -Check the `README` file of the `/Examples/Objective-C` folder. [Click here to check the implementation steps.](https://github.com/AFathi/ARVideoKit/tree/master/Examples/Objective-C) +[Click here to check the Objective-C implementation steps.](https://github.com/AFathi/ARVideoKit/tree/master/Examples/Objective-C) ### NOTE Make sure you add the usage description of the `camera`, `microphone`, and `photo library` in the app's `Info.plist`. From c7ad4295a1f1213d9829bc4eff9bfbfd2afda594 Mon Sep 17 00:00:00 2001 From: Ahmed Fathi Bekhit Date: Fri, 12 Jan 2018 16:37:18 -0500 Subject: [PATCH 4/9] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 94bb7d6..dea1604 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ In other words, you **NO LONGER** have to ~screen record~/~screenshot~ to captur | [Implementation](#implementation) | Lists the [steps needed](#implementation) for Objective-C & Swift, [notes](#note), and [reference](#youre-all-set-) for more options | | [Publishing to the App Store](#publishing-to-the-app-store) | Describes the steps **required** before submitting an application using `ARVideoKit` to the App Store. | |[![Donate](https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_donate_92x26.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ahmedfbekhit@gmail.com&item_name=Support+ARVideoKit+Developer&item_number=ARVideoKit+Framework+Donations&amount=0%2e00¤cy_code=USD) | [Donations](#donate) will support me to keep maintaining `ARVideoKit` ❀️| +| [Contributions](#contributions) | Describes how you can contribute to this project | | [License](#license) | Describes `ARVideoKit` license | | [AppCoda Tutorial](https://www.appcoda.com/record-arkit-video/) | Check out a detailed tutorial about implementing `ARVideoKit` with SpriteKit ☺️ | @@ -106,6 +107,11 @@ Donations will support me to keep maintining **ARVideoKit Framework** ❀️ [![Donate](https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_donate_92x26.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ahmedfbekhit@gmail.com&item_name=Support+ARVideoKit+Developer&item_number=ARVideoKit+Framework+Donations&amount=0%2e00¤cy_code=USD) +## Contributions +If you have an idea for a new **ARVideoKit** feature/functionality and want to add it to this repository, feel free to fork the project and create a pull request! + +Also, feel free to create an issue if you have any suggestions or need any help ☺️ + ## [License](LICENSE) Copyright 2017 Ahmed Fathi Bekhit, www.ahmedbekhit.com, me@ahmedbekhit.com From 30087d53d33027023802c9fb17e870e4cbbf6fda Mon Sep 17 00:00:00 2001 From: Ahmed Fathi Bekhit Date: Sun, 14 Jan 2018 01:19:33 -0500 Subject: [PATCH 5/9] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dea1604..aa51298 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# ARVideoKit +![intro image](http://www.ahmedbekhit.com/tutorials/ARVideoKit_prev.png) + An iOS Framework that enables developers to capture videos πŸ“Ή, photos πŸŒ„, Live Photos πŸŽ‡, and GIFs πŸŽ† with ARKit content. In other words, you **NO LONGER** have to ~screen record~/~screenshot~ to capture videos πŸ“Ή and photos πŸŒ„ of your awesome ARKit apps! From 6aa443b3d96530b7816ccf646a12105b3b3daa48 Mon Sep 17 00:00:00 2001 From: Ahmed Fathi Bekhit Date: Sun, 14 Jan 2018 16:22:10 -0500 Subject: [PATCH 6/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aa51298..c0c3e77 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![intro image](http://www.ahmedbekhit.com/tutorials/ARVideoKit_prev.png) +![intro image](http://www.ahmedbekhit.com/tutorials/ARVideoKit_prev_1.png) An iOS Framework that enables developers to capture videos πŸ“Ή, photos πŸŒ„, Live Photos πŸŽ‡, and GIFs πŸŽ† with ARKit content. From 6d1624c7302673087fadcf6243a40577e8c59abe Mon Sep 17 00:00:00 2001 From: Ahmed Fathi Bekhit Date: Wed, 7 Feb 2018 18:46:44 -0500 Subject: [PATCH 7/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c0c3e77..88d7fb1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ In other words, you **NO LONGER** have to ~screen record~/~screenshot~ to captur | [Preview](#preview) | Displays 2 GIF images captured using the supported [`gif`](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#func-gifforduration-durationtimeinterval-exportbool-_-finished-_-statusbool-_-gifpath-url-_-permissionstatusphauthorizationstatus-_-exportedbool---swiftvoid--nil) method in `ARVideoKit`| | [Key Features](#key-features) | Lists the key features `ARVideoKit` offers | | [Compatibility](#compatibility) | Describes the `ARVideoKit` device and iOS compatibality | -| [Example Project](#example-project) | Explains how to run the example project provided in this repository | +| [Example Projects](#example-projects) | Explains how to run the example project provided in this repository | | [Installation](#installation) | Describes the [Manual](#manual) option to install `ARVideoKit` | | [Implementation](#implementation) | Lists the [steps needed](#implementation) for Objective-C & Swift, [notes](#note), and [reference](#youre-all-set-) for more options | | [Publishing to the App Store](#publishing-to-the-app-store) | Describes the steps **required** before submitting an application using `ARVideoKit` to the App Store. | From 71f2f27d11c703deb3f8e223302dcf2141270590 Mon Sep 17 00:00:00 2001 From: Ahmed Fathi Bekhit Date: Thu, 8 Feb 2018 17:28:48 -0500 Subject: [PATCH 8/9] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 88d7fb1..5213db4 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,10 @@ In other words, you **NO LONGER** have to ~screen record~/~screenshot~ to captur | [AppCoda Tutorial](https://www.appcoda.com/record-arkit-video/) | Check out a detailed tutorial about implementing `ARVideoKit` with SpriteKit ☺️ | ## Preview -|πŸ‘Ύ [Initialized with SpriteKit](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#init-arspritekitarskview)πŸ‘‡ ‍‍‍‍‍‍ ‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍|πŸš€ [Initialized with SceneKit](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#init-arscenekitarscnview) πŸ‘‡ ‍‍‍‍‍‍ ‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍ ‍‍ ‍‍‍‍‍‍ ‍‍| +|πŸ‘Ύ [Initialized with SpriteKit](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#init-arspritekitarskview)πŸ‘‡|πŸš€ [Initialized with SceneKit](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#init-arscenekitarscnview) πŸ‘‡| |--------------|--------------| - -![SpriteKit Preview](http://www.ahmedbekhit.com/SK_PREV.gif) ![SceneKit Preview](http://www.ahmedbekhit.com/SCN_PREVIEW.gif) +| ![SpriteKit Preview](http://www.ahmedbekhit.com/SK_PREV.gif) | ![SceneKit Preview](http://www.ahmedbekhit.com/SCN_PREVIEW.gif)| + ## Key Features βœ… Capture [Photos](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#func-photo---uiimage) from [`ARSCNView`](https://developer.apple.com/documentation/arkit/arscnview) and [`ARSKView`](https://developer.apple.com/documentation/arkit/arskview) From 105e8360e4c2212b66b931279ad309944b57cabe Mon Sep 17 00:00:00 2001 From: Alexyang Date: Thu, 15 Mar 2018 19:56:42 +0800 Subject: [PATCH 9/9] bug fix Video Recorded or Photo Doesn't Show ARKit Shadows --- ARVideoKit/Sources/RecordAR.swift | 13 +++++++++++++ .../View Controllers/SCNViewController.swift | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/ARVideoKit/Sources/RecordAR.swift b/ARVideoKit/Sources/RecordAR.swift index bc92f84..05a33f7 100644 --- a/ARVideoKit/Sources/RecordAR.swift +++ b/ARVideoKit/Sources/RecordAR.swift @@ -87,6 +87,17 @@ fileprivate var renderer:RenderAR! A boolean that enables or disables clearing cached media after exporting to Camera Roll. Default is `true`. */ @objc public var deleteCacheWhenExported:Bool = true + /** + A boolean that enables or disables using envronment light rendering. Default is `false`. + */ + @objc public var enableAdjsutEnvironmentLighting:Bool = false { + + didSet{ + if (renderEngine != nil) { + renderEngine.autoenablesDefaultLighting = enableAdjsutEnvironmentLighting + } + } + } //MARK: - Public initialization methods /** @@ -222,6 +233,8 @@ fileprivate var renderer:RenderAR! NotificationCenter.default.addObserver(self, selector: #selector(appWillEnterBackground), name: Notification.Name.UIApplicationWillResignActive, object: nil) } + + //MARK: - Public methods for capturing videos, photos, Live Photos, and GIFs diff --git a/Examples/Swift/ARVideoKit-Example/View Controllers/SCNViewController.swift b/Examples/Swift/ARVideoKit-Example/View Controllers/SCNViewController.swift index 7733aa7..5df41c5 100644 --- a/Examples/Swift/ARVideoKit-Example/View Controllers/SCNViewController.swift +++ b/Examples/Swift/ARVideoKit-Example/View Controllers/SCNViewController.swift @@ -36,6 +36,9 @@ class SCNViewController: UIViewController, ARSCNViewDelegate, RenderARDelegate, // Set the scene to the view sceneView.scene = scene sceneView.scene.rootNode.scale = SCNVector3(0.2, 0.2, 0.2) + // + sceneView.automaticallyUpdatesLighting = true + sceneView.autoenablesDefaultLighting = true // Initialize ARVideoKit recorder recorder = RecordAR(ARSceneKit: sceneView) @@ -54,6 +57,9 @@ class SCNViewController: UIViewController, ARSCNViewDelegate, RenderARDelegate, // Configure ARKit content mode. Default is .auto recorder?.contentMode = .aspectFill + //record or photo add environment light rendering, Default is false + recorder?.enableAdjsutEnvironmentLighting = true + // Set the UIViewController orientations recorder?.inputViewOrientations = [.landscapeLeft, .landscapeRight, .portrait] // Configure RecordAR to store media files in local app directory