MRTK v2, how do you make an object dragged by the pointer, stay straight out from the controller? - mrtk

In the MRTK v2 HandInteractionExamples.unity, when you drag an object with the controller, it acts like it is connected to a fishing line, where pointing the controller in a different direction curves the pointer line, and the object doesn't stay in front of the controller.
The Cliff House in Microsoft's MR Home, has the type of action I am trying to duplicate. You click on an object with the controller and drag it around. The object lags a little bit as it lerps to the new position, but it ends up straight out from the controller. How do I duplicate that control in the examples they provide?
I have made adjustments in a new profile I created, and have modified the DefaultControllerPointer code directly, but to no avail. I am not finding anything in the forums that has helped.

This sounds a lot like https://github.com/microsoft/MixedRealityToolkit-Unity/issues/5203, which is something that the MRTK team also observed in some internal builds. Looking at HandInteractionExamples in the latest code in the mrtk_development branch (as of 8/8/2019), this should be addressed.
See if you can grab the latest code from mrtk_development - this should make its way into a new release in the near future.

Related

fabricjs 1.6.3: why active object is always shown on top

good demo of my problem: http://fabricjs.com/hovering
If you select any item, it is displayed on top.
In earlier versions (1.5.0 - 1.6.2) this problem does not exist.
Sorry for bad English.
If you dont want thie behaviour, you can set the preserveObjectStacking to true. Check the docs here: http://fabricjs.com/docs/fabric.Canvas.html
However, there is this one issue with background objects, so beware https://github.com/kangax/fabric.js/issues/3095
Hopefully, they'll push a fix soon otherwise your last resort would be going back to 1.6.2.
I believe that is meant as a convenience for the user. Although the object moves to the front while selected, as soon as it is deselected, it falls back to its original z-order.
You can test this out at the hovering demo you linked. Superimpose two objects and determine which is front of the other then select and deselect the object in the back. When you hover over them, the order should still be observed to be the same.

Need to use second window using Cocoa Bindings and Core Data in Swift

I have recently started experimenting with Xcode following the introduction of Swift. I have no background in Objective C, but I am making progress, especially with Cocoa Bindings and Core Data. I am playing around with an OSX application which has one xib and one window and is bound to a Core Data model. So far everything works just fine and I can populate a Table View with no issues.
My next step is to include a second window with another Table View bound to my Core Data model. I found this impossible to achieve because I couldn't access the AppDelegate when I tried to bind the second Table View to the Core Data model.
So I tried to create a second window in the MainMenu xib; now binding is possible but it seems to be very clumsy. Surely a second window demands its own xib and, if so, how on earth do I bind to the AppDelegate?
My goal is to use Coocoa Bindings as far as possible to eliminate "glue code", but all my research only reveals Objective C examples, some of which are very old, involve a huge amount of program code and are not at all relevant to Xcode v6.1.
I'm a newbie to Xcode, but so far I love it and would appreciate any advice or assistance.
The single-coordinator application template adds that "App Delegate" object to the MainMenu.Xib, and it's somewhat magically connected to the NSApplication object's delegate, in that the App Delegate object is created by the Nib loading process and attached to the NSApplication instance. It's fairly impossible to duplicate that object in another Nib. You can really create havoc trying to do so.
The simplest way to do what you want in any other Nib is to bind to the Application with a keypath beginning with "delegate." Voila, you have what you want.
Others will insist that the delegate object shouldn't own the core data stack, and you should move all that boilerplate code to some other place. Or, that each view controller should be passed the MOC pointer as a property (see comments below)... but that's not really relevant to this question.
YMMV, this answer is given from the Objective-C universe, but the language shouldn't matter.

iOS / xCode4: can I copy a ViewController complete with all functionality

This may be a silly question, so forgive me if it is but I'm not a Mac guy and this is my first shot at building a serious app.
I've built a ViewController to display a tableview and data, but my app is made up of several sections which do almost the same thing. Is there a way to copy it and all the settings so I can then just go and change the minor details without having to reproduce all of the subviews and wire everything up multiple times?
Or am I just being lazy ;-)
Cheers
The proper way to do this in Cocoa is to put all your "copyable" UI/controller assemblies into their own Nib/Xib files. This way, you load a new copy of the assembly each time. See this article for the quick and dirty.
This is essentially how NSDocument works (note the separate xib for your document, separate from MainMenu.xib) and even how the prototype view of an NSCollectionView is intended to work.
Once you have your fresh copy of the assembly, you copy your settings (state) into it. "How" depends on how you have your state stored. Keep it all in a convenient place with a convenient setter/getter at the top-level object (the controller that becomes the xib's File's Owner) and you should be able to say [newController setSettings:[originalController settings]];.

Xcode4: two entities with "required" relationship ... failing to be maintained by Core Data?

EDIT: might be fixed in latest Xcode 4.0.2 (just released) - I'm downloading this out now, and will re-edit once I've tested it.
Create two entities (call them "Manager" and "Employee", to stick with Apple's docs).
Create a relationship, "worksFor" from Manager (1) to Employee (many), and mark it as "not optional". (you'll probably need to create 2 relationships, mark 1 as inverse of other)
Hook up an interface using IB, according to Apple's original docs (NB: these don't work any more, but here's an almost exact recreation of the basic setup in Xcode4: http://rgprojection.blogspot.com/2011/04/xcode-4-and-core-data-macos-x.html) and use Bindings (as described in the linked post) to create/add/delete the objects.
Now try to save. ERROR: "worksFor is a required property".
In previous versions of Xcode, this worked as expected: you'd told Xcode that there was a bidirectional relationship, you told it that it was required, and so when it added the "Employee" to the "Manager", it automatically hooked-up the inverse.
Has anyone else worked out how to make Xcode4 do what it's supposed to? Is it an Xcode4 bug? I know that some of the CoreData support in Xcode4 has been deleted, with no replacement (yet), so I'm wondering if this has been deleted too?!
EDIT: here's another project, one I made from scratch, same problem. Although (xcode4 bug, definitely!) this time I created the Relationship in the "grid" editor view rather than the "tree graphical" view... and the generated source code for objects was different (should not be the case, obviously)
second project screenshot
EDIT2: StackOverflow was showing the screenshot above, but has now removed it, you'll have to click on the link. Sorry.
I haven't seen the problem you describe and I've created several data models under Xcode4. It appears to work just like it did in previous versions in that regard. I think you've got something else going on.
Xcode 4.0.2 seems to have fixed the problem - everything works as expected now, with no changes to code :)

Can I associate custom metadata with an ALAsset?

I'm building an iPhone app that, among other things, allows the user to take and store photographs associated with locations. I am currently using the ALAssetLibrary to allow the photographs to be stored in Photos and be accessible outside the app (on a computer for instance via the built-in mechanisms). There is not a lot of technical content out there for working with the ALAssetLibrary but from what there is I have managed to cobble together a working version of this. I have had to resort to storing a dictionary of photo URLS in my app and manually detecting if the photo still exists when displaying lists of them because there does not seem to be a way to add custom metadata to an ALAsset.
What I would really like to do is add two custom metadata fields to each asset to provide it with a title and a custom id value that I can use to filter on when enumerating the asset library.
As a secondary task, I'd like the user to be able to update the title metadata.
Can it be done? At this point, I really don't think it can because the API really doesn't seem to provide the necessary methods to get/set custom metadata. I'm hoping against all odds that there is some other aspect to the AssetLibrary framework that I have not yet discovered.
At a minimum, if someone can authoritatively say "NO" then at least others might find this breadcrumb on their own trail of hope and change tack more quickly!
And, having 0 reputation I can't tag it with AssetLibrary :( wow, this day is just going downhill. FML
I've been looking over the documentation and I dont think it is possible to tack on additional fields to the ALAsset object, well you can create your own object or extend theirs but that wont help you when your pulling back assets because you'll need to init yours and populate it then.
Look I know this falls short of a really good answer but I had to try.
The ALAsset class documentation describes a property - customMetadata. This is documented to be an NSDictionary of whatever custom tags you want. Currently, however, it is not implemented in the class (I've raised a bug on Apple's developer site to bring the issue up).

Resources