Post

Replies

Boosts

Views

Activity

Programatic use of Light Probes
When rendering a scene using environment lighting and the physically based lighting model, I have a need for an object to reflect another object. As I understand it, in this type of rendering, reflections are only based on the environment lighting and nothing else. As a solution I was intending to use a light probe placed between the object to be reflected and the reflecting object. My scene has been developed programatically and not through an XCode scene file. From Apple's WWDC 2016 presentation on SceneKit I could gather that light probes can be updated programatically through the use of the updateProbes method of the SCNRenderer class. I have the following code, where I am trying to initialize a light probe by using the updateProbes method:let sceneView = SCNView(frame: self.view.frame) self.view.addSubview(sceneView) let scene = SCNScene() sceneView.scene = scene let lightProbeNode = SCNNode() lightProbe = SCNLight() lightProbeNode.light = lightProbe lightProbe.type = .probe scene.rootNode.addChildNode(lightProbeNode) var initLightProbe = true func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) { if initLightProbe { initLightProbe = false let scnRenderer = SCNRenderer(device: sceneView.device, options: nil) scnRenderer.scene = scene scnRenderer.updateProbes([lightProbeNode], atTime: time) print ("Initializing light probe") } }I don't seem to get any light coming from this light probe. My question is simple, can the updateProbes method be used to initialize a lightProbe? If not, how can you initialize a light probe programatically?
1
0
1.2k
Mar ’22
Interface Builder doesn't honor Safe Area proportional alignment constraints
In Interface Builder, setting the constraints for a UI element (let's say a button) doesn't change if I make the aligment proportional to the Safe Area or proportional to the Superview. I have a button which I set its horizontal alignment to be:  I have another button which I set its horizontal alignment to be:  Both buttons end up being aligned horizontally: I would have expected the button aligned to the Safe Area to be shifted to the right as the Safe Area's leading edge is shifted to the right from the one of the Superview. I'm probably missing something but can't quite understand what is going on here. The problem is that heights and widths proportional to the Safe Area are honored, so the size of UI elements does change if you make them proportional to the Safe Area or to the Superview. So when you try to layout something with Safe Area proportional heights and widths, and also use Safe Area proportional horizontal and vertical placements, UI Elements don't line up for iPhones with a notch. They kind of lineup for devices like iPads and iPhones with no notch where the Safe Area is very close to the Superview area.
2
0
1.5k
Mar ’22
MIDI file generated by using MusicSequenceFileCreate has Sysex MIDI message (iOS 16.0.2)
I am using the MusicSequenceFileCreate method to generate a MIDI file from a beat-based MusicSequence. In iOS 16.0.2 devices, the file that is created has a Sysex MIDI message added (not by me) to the file at time 0: f0 2a 11 67 40 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 f7 Sysex messages are manufacturer dependent, a file with this Sysex message can't be read into apps like Nanostudio, Ableton, Zenbeats. It can be read by GarageBand. My app's deployment target is iOS 13.0. Has anybody else ran into this issue? Thanks
1
0
1.2k
Oct ’22
After update to XCode 15.3 can't run app on My Mac (Designed for iPad) - error: attach by pid 'xxxxx' failed -- attach failed
I can run it on the simulators, and directly on physical devices, but not on My Mac (Designed for iPad). The error is: error: attach by pid '33190' failed -- attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries, when the attach failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.) Checked the log and this is what I found: error 12:44:36.527139-0500 mdbulkimport could not make proxies from uuids in optimized path! Error Domain=NSOSStatusErrorDomain Code=-10814 "Unable to find this application extension record in the Launch Services database." UserInfo={_LSFunction=, _LSLine=679, NSDebugDescription=Unable to find this application extension record in the Launch Services database., SK=, IS=0} error 12:44:36.527174-0500 mdbulkimport Using expensive fallback path for obtaining plugin proxies from install notifications. This process should be entitled to use the LS database. default 12:44:36.529748-0500 debugserver [LaunchAttach] (32518) about to task_for_pid(32517) default 12:44:36.529778-0500 kernel macOSTaskPolicy: (com.apple.debugserver) may not get the task control port of (Piano Motifs) (pid: 32517): (Piano Motifs) is hardened, (Piano Motifs) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger(com.apple.debugserver) is not a declared read-only debugger error 12:44:36.529795-0500 debugserver error: [LaunchAttach] MachTask::TaskPortForProcessID task_for_pid(32517) failed: ::task_for_pid ( target_tport = 0x0203, pid = 32517, &task ) => err = 0x00000005 ((os/kern) failure) So the issue seems to be not finding the application's extension record in the Launch Services database. How is this problem solved?
3
0
2.7k
May ’24