-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
visionOS / Vision Pro support #203
Comments
Could you try adding the visionOS platform to Klak.Ndi.Runtime.asmdef? |
Thank you for the reply! I changed it and I can build it now. But when I ran it on Xcode(using a simulator), I got these errors.
But I can build and run it on devices and simulators. |
Thank you for confirming that. It's helpful since I don't have an actual device. |
Hi! I fixed the error. There is no
PbxModifier.cs // #if UNITY_IOS
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using System.IO;
namespace Klak.Ndi.Editor
{
public class PbxModifier
{
[PostProcessBuild]
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
{
ModifyProjectFile(path);
ModifyPlistFile(path);
}
static void ModifyProjectFile(string basePath)
{
// Set visionOS project file path
var path = Path.Combine(basePath, "Unity-VisionOS.xcodeproj", "project.pbxproj");
if (!File.Exists(path))
{
throw new FileNotFoundException($"Xcode project file not found at path: {path}");
}
var proj = new PBXProject();
proj.ReadFromFile(path);
var target = proj.GetUnityFrameworkTargetGuid();
// Set visionOS lib file path
var libPath = "/Library/NDI\\ SDK\\ for\\ Apple/lib/visionOS";
proj.AddBuildProperty(target, "LIBRARY_SEARCH_PATHS", libPath);
proj.AddFrameworkToProject(target, "Accelerate.framework", false);
proj.AddFrameworkToProject(target, "VideoToolbox.framework", false);
// Set the libndi_visionos.a file name
proj.AddFrameworkToProject(target, "libndi_visionos.a", false);
proj.WriteToFile(path);
}
static void ModifyPlistFile(string basePath)
{
var path = Path.Combine(basePath, "Info.plist");
var plist = new PlistDocument();
plist.ReadFromFile(path);
var root = plist.root;
// Bonjour service list
{
var key = "NSBonjourServices";
if (root.values.ContainsKey(key))
root.values[key].AsArray().AddString("_ndi._tcp");
else
root.CreateArray(key).AddString("_ndi._tcp");
}
// LAN usage description
{
var key = "NSLocalNetworkUsageDescription";
var desc = "NDI requires device discovery capability " +
"on the networks you use.";
if (!root.values.ContainsKey(key)) root.SetString(key, desc);
}
plist.WriteToFile(path);
}
}
} // namespace Klak.Ndi.Editor
// #endif I just changed the project path like
Klak.Ndi.Runtime.asmdef
So add this script and select your render texture. SetRenderTextureDirty.cs using UnityEngine;
using Unity.PolySpatial;
public class SetRenderTextureDirty : MonoBehaviour
{
public RenderTexture texture;
void Update()
{
Unity.PolySpatial.PolySpatialObjectUtils.MarkDirty(texture);
}
} This is the process I built and made the app. p.s. I've made a Vision Pro app using this package. It is released on the Apple app store and you can download it for free until Aug 27. If you are interested, here is the link. Thank you. |
Thanks for giving the detailed information! I'll try it when the company device is available for testing. |
@gwangyu-lee Thanks for the experimentation and finding a solution! It is still failing for me, so I had a few quesitons:
|
Hi! @PRehker
Did you build your project with device SDK in Unity? I don't think NDI SDK works with iOS or visionOS simulator. And check that there is something in the project validation(Unity). Also, check that default command line tools are selected in |
@gwangyu-lee |
@gtk2k You have to install the NDI SDK from their website. You can get it here: https://ndi.video/for-developers/ndi-sdk/download/. After registering, you will recieve a mail with the download links. When you install the SDK, a new folder appears: "~/Library/NDI\ SDK\ for\ Apple/..." |
@PRehker |
@PRehker |
I'm having trouble building klakNDI in visionOS, but it works fine in iOS.
Unity Version: 2022.3.21f1
I got this error.
"CS0246: The type or namespace name 'Klak' could not be found”
The text was updated successfully, but these errors were encountered: