UniCamEx is a virtual camera for MacOS that can display textures output from Unity.
You can use in macOS 12.3 and later because UniCamEx use Apple's Camera Extension with Core Media I/O.
This repository has the demo that send textures from Unity Editor.
Check a Unity scene.
UniCamEx can be installed with Unity Package Manager.
UniCamEx can be installed from npm or GitHub URL.
UniCamEx can be installed by adding following sections to your manifest file (Packages/manifest.json
).
To the scopedRegistries
section:
{
"name": "creativeikep",
"url": "https://registry.npmjs.com",
"scopes": [ "jp.ikep" ]
}
To the dependencies
section:
"jp.ikep.unicamex": "1.2.0"
Finally, the manifest file looks like below:
{
"scopedRegistries": [
{
"name": "creativeikep",
"url": "https://registry.npmjs.com",
"scopes": [ "jp.ikep" ]
}
],
"dependencies": {
"jp.ikep.unicamex": "1.2.0",
...
}
}
UniCamEx can be installed by adding below URL on the Unity Package Manager's window
https://github.com/creativeIKEP/UniCamEx.git?path=UniCamEx_Unity/Packages/UniCamEx#v1.2.0
or, adding below sentence to your manifest file(Packages/manifest.json
) dependencies
block. Example is below.
{
"dependencies": {
"jp.ikep.unicamex": "https://github.com/creativeIKEP/UniCamEx.git?path=UniCamEx_Unity/Packages/UniCamEx#v1.2.0",
...
}
}
You can send camera rendered images with adding a UniCamExSender
component to camera in your scenes.
If you want to send any video, you can do so by directly using the UniCamExPlugin
class.
Please refer to UniCamExSender
class for usage instructions.
Download UniCamExExtensionInstaller.zip
for auxiliary app of UniCamEx from release page and Open the zip file.
Move UniCamExExtensionInstaller.app
to ~/Applications
directory and run UniCamExExtensionInstaller.app
.
Push Install
button.
Allow using System Extension from the Mac setting if the dialog that blocked System Extension is displayed.
Then, you can select the camera named "UniCamEx" with any camera appication and can see textures output from Unity Editor!
You must enroll the Apple Developer Program membership for building the app used System Extension.
You must build UniCamEx project for embeding to your the Standalone App. So, you need to clone this repository.
Copy UniCamEx/UniCamEx_Unity/Packages/UniCamEx
directory to <Your Unity Project>/Packages
directory.
- Open
UniCamEx/UniCamEx/UniCamEx.xcodeproj
. - Change to your custom Bundle Identifier in
Extension
target and the name of the App Groups in theExtension
target. The name of the App Groups in theExtension
target must start with the Bundle Identifier in theExtension
target. Also, sign in with your Apple developer account.
- Change to your custom configuration in
UniCamEx/UniCamEx/UniCamExConfig.swift
. - Set
Build Configuration
toRelease
, and buildExtension
andUniCamExBundle
in targets.
- Replace from
<Your Unity Project>/Packages/UniCamEx/PostProcessData~/jp.ikep.UniCamEx.Extension.systemextension
to your built.systemextension
. - Replace from
<Your Unity Project>/Packages/UniCamEx/Plugins/macOS/UniCamExBundle.bundle
to your builtUniCamExBundle.bundle
. - Rewrite from
jp.ikep.UniCamEx.Extension.systemextension
to your built.systemextension
file name in<Your Unity Project>/Packages/UniCamEx/Scripts/Editor/MacXcodeProjPostProcess.cs
and<Your Unity Project>/Packages/UniCamEx/PostProcessData~/PostprocessBuild.py
.
You can send camera rendered images with adding a UniCamExSender
component to camera in your scenes.
Also, you can send textures using the UniCamExPlugin.Send
method.
Turn on "Create Xcode Project" on the Build Settings window.
Also, build from the "Clean Build..." button.
Exporting Xcode Project can does the necessary settings for Camera Extension with Core Media I/O. Necessary settings for Camera Extension with Core Media I/O is set with post process build of UniCamEx. Post process build of UniCamEx may not work if you did not build from the "Clean Build..." button.
Open exported .xcodeproj
file with Xcode and sign in with your Apple developer account.
You must enroll the Apple Developer Program membership for building the app used System Extension.
You can build an app after sign in with Apple developer account that enrolled Apple Developer Program membership.
Move built app from build directory to ~/Applications
directory and run your app.
Allow using System Extension from the Mac setting if the dialog that blocked System Extension is displayed.
Then, you can select virtual camera with any camera appication and can see textures output from your app made with Unity!
Copyright (c) 2023 IKEP
- UniCamEx implementation is inspired by article below and I referenced it. Thanks!