Hi there!
I'm working on an AR project and need to recognize multiple patterns under the NFT mode of ARToolKit. And I need to modify some scripts to realise adding multiple "ARMarker"s as components of the GameObject which contains the "ARController" as well as to change the MarkerTag and NFTDataSetName corresponding to the file's name in the StreamingAssets folder.
So I tried these codes.
ARMarker myMarker;
myMarker = ARToolkitObject.AddComponent ();
myMarker.Tag = "Marker " + DropdownController.Machines [DropdownController.Index];
myMarker.NFTDataName = DropdownController.Machines [DropdownController.Index];
Inside that the `DropdownController.Machines [DropdownController.Index]` is the NFT file's name selected from a dropdown bar. The `ARToolkitObject` contains "ARController" script.
I called this script every time I select another element in dropdown bar (when the dropdown value changes). But every time I try to add the second component, the Unity crashes.
Some of the errors in the output log are here:
Application Specific Information:
abort() called
terminating with uncaught exception of type vision::Exception: ID already exists
I think the reason is the "ARMarkerEditor" changes all the "ARMarker" components' "MarkerTag" values in the same time, but once the "MarkerTag" is defined in the EditMode, it can not be changed during Runtime. But I'm not sure, anyone can help?
Thanks a lot!
↧