Code Monkey home page Code Monkey logo

unicamex's Introduction

UniCamEx

UniCamEx_demo

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.

Usage

Usage for Develop send textures from Unity Editor

This repository has the demo that send textures from Unity Editor.

Check a Unity scene.

1. Install

UniCamEx can be installed with Unity Package Manager.

UniCamEx can be installed from npm or GitHub URL.

Install from npm (Recommend)

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",
        ...
    }
}
Install from GitHub URL

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",
    ...
  }
}

2. Send textures from Unity Editor

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.

3. Install an Auxiliary app for UniCamEx

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.

4. Install UniCamEx Virtual Camera

Push Install button.

Allow using System Extension from the Mac setting if the dialog that blocked System Extension is displayed.

UniCamExInstallerDialog

UniCamExInstallerSecurityAllowDialog

Then, you can select the camera named "UniCamEx" with any camera appication and can see textures output from Unity Editor!

SendTextureFromUnityEditor

Usage for Build the Standalone App

You must enroll the Apple Developer Program membership for building the app used System Extension.

1. Clone this repository

You must build UniCamEx project for embeding to your the Standalone App. So, you need to clone this repository.

2. Copy UniCamEx's Unity Package to Your Unity Project

Copy UniCamEx/UniCamEx_Unity/Packages/UniCamEx directory to <Your Unity Project>/Packages directory.

3. Build UniCamEx Xcode Project with Your Custom Configuration.

  1. Open UniCamEx/UniCamEx/UniCamEx.xcodeproj.
  2. Change to your custom Bundle Identifier in Extension target and the name of the App Groups in the Extension target. The name of the App Groups in the Extension target must start with the Bundle Identifier in the Extension target. Also, sign in with your Apple developer account.
3-2
  1. Change to your custom configuration in UniCamEx/UniCamEx/UniCamExConfig.swift.
  2. Set Build Configuration to Release, and build Extension and UniCamExBundle in targets.
3-4

4. Integrate Your Custom Built Items to Unity.

  1. Replace from <Your Unity Project>/Packages/UniCamEx/PostProcessData~/jp.ikep.UniCamEx.Extension.systemextension to your built .systemextension.
  2. Replace from <Your Unity Project>/Packages/UniCamEx/Plugins/macOS/UniCamExBundle.bundle to your built UniCamExBundle.bundle.
  3. 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.

5. Coding for Send textures from Unity

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.

6. Export Xcode Project with Unity

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.

UnityBuildSettings

7. Build .app with Xcode

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.

8. Run the Built App

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.

BuildAppDialog

BuildAppSecurityAllowDialog

Then, you can select virtual camera with any camera appication and can see textures output from your app made with Unity!

SendTextureFromBuildApp

Author

IKEP

LICENSE

Copyright (c) 2023 IKEP

MIT

Others

unicamex's People

Contributors

creativeikep avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

unicamex's Issues

Want to Resolve an Issue That's Not Working Properly

スクリーンショット 2024-04-01 122510
Hello. I want to know the cause and how to resolve an issue that's not working properly. Here is the situation report and questions:

1- Uncertain if UniCamExExtension is installed correctly: I moved the UniCamExExtensionInstaller to the application folder and performed operations in the settings, then pressed the [Install] button, but there is no response. After this operation, [UniCamEx] became selectable as a camera option in the ZOOM, but is this state considered a successful installation? (See attached video)

2- No video displayed from Unity: While playing the sample project, I selected [UniCamEx] from the camera options in the ZOOM, but nothing is displayed. Is there something wrong with the settings or procedures? (See attached video)

3- Unity scene playback does not work and shows a warning (resolved by entering a command, but want to use it without entering commands): When playing the scene of the sample project, it displays "UniCamExBundle.bundle is damaged and cannot be opened" and does not work properly. This problem was resolved by entering the following commands in the terminal:
sudo spctl --master-disable
xattr -d com.apple.quarantine [/path/to/UniCamExBundle.bundle]
However, I want to use it without entering commands. (See attached image)

That's all for the questions. Thank you.

Video URL:
https://www.dropbox.com/scl/fi/ugtichfdwb2fa8t6h5kx4/2024-04-01-12.44.18-1.mov?rlkey=3y2din2ryp4n9x7aqxvjdiplr&dl=0

Install button of Virtual Camera is not working

On installing "UniCamExExtensionInstaller.zip" the Install button is not working on first click. On pressing again and again install button or after closing the the installer somehow it works but it doesn't ask for permissions on the first time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.