Support for Multiple Targets

All a learning curve, Jason - sure you’ll get there with it. Know everyone here will help out however we can :).

Thanks a lot James, really appreciate it. Seems like a nice community.

1 Like

So im still working on it. Im stuck at the root stage of this.

function myRepeatingFunction() {
var imageSeen1 = symbol.nodes.Track1.nodes.Script.getStatus();
var imageSeen2 = symbol.nodes.Track2.nodes.Script.getStatus();

}

Z.every(2000, myRepeatingFunction);

Any more help would be great.

Thanks all.
Jason

1 - First, the sub symbols are not added to the hierarchy, but loaded dynamically.

var trackingImageDisplayed = Z.Symbol(« symbol_1_name »);
symbol.nodes.trackingImagesGroup.push(trackingImageDisplayed);

2 - Then call your repeating function to check if the loaded symbol is seen or not:

var trackingImageFound = trackingImageDisplayed.nodes.code.getStatus();
     if (trackingImageFound ) { ... }

3 - If not, then you unload the current symbol, by clearing its parent group:

symbol.nodes.trackingImages.clear();

4 - Now, you can load the next one… ( goto 1 :grin: )

The whole process is not complicated, but for sure it’s easier is you are comfortable in JS.
May be you should try first to dynamically load then unload a symbol.

Jean.

1 Like

Just posted my code for my Multi Tracking Image.

Enjoy!!
Steve

Hey Steve this is great! Thank you! The page seems to not be loading correctly though. Having trouble downloading.

Sorry fixed link.

http://rentanerdcomputers.com/wp-content/uploads/ZapWorks/Multi%20Tracking%20Image.zpp

3 Likes

Thank you Steve for sharing! :grin::+1:

I was wondering if there’s any news about this implementation? Seems kind of crucial to a lot of experiences.

This thread has been super-helpful already, many thanks to everyone contributing!

Hi @polygongraphics,

While our API has supported multi-tracked experiences for quite a while (hence why experiences such as the one mentioned on this thread are possible), Studio does not currently have native support for creating these types of experiences. Whether it’s something we want to add to our roadmap, and how it would be achieved if it were, are still part of ongoing internal discussions.

As mentioned by George in his post above, the recommended method to link between multiple experiences is to use deep links. Using deep links you can launch a second experience from your first experience.

Once we have some more information to share on the matter, you can be sure we’ll share it with you all on this thread.

All the best,
Seb

P.S. I’ve moved your second question regarding recognising a target image’s size to a new topic, and we’ll be replying there shortly.

As a note to everyone, please remember to keep your comments directly related to the thread’s topic, as it avoids important discussion being lost in the midst of other separate requests/topics.

Thanks again everyone :slight_smile:.

2 Likes

Has something changed since the last posts on this thread? I’ve just started using ZapWorks Studio and want to implement multiple tracking images for a signage project for a zoo but I can’t seem to pull it off.

The @stevesanerd project doesn’t seem to work at all when previewed from Studio. I tried replicating his methodology as best I could understand it from reading the code, but without success.

I’ve also tried the method described by @jvouillon. The concept is sound, but it doesn’t work - not in the latest version of Studio at least.

As @jvouillon describes, I have created 2 subsymbols and am dynamically loading them into an empty group in the heirarchy. If these subsymbols don’t contain tracking images it works fine. As soon as the subsymbols do contain tracking images the project fails to work - no subsymbol ever gets loaded.

I understand as per the moderators comments that Zappar recommend the use of Deep Links, but that doesn’t serve the purpose of what I would like to achieve. Being able to scan multiple tracking images as you wander around a room/space really would be a killer feature for the likes of myself, who are creating AR experiences for signage. In this instance the work is for information boards at a zoo, but the same would apply to museums and other similar visitor attractions.

Many thanks for the help proffered so far in this thread, and thanks in advance for any further guidance provided.

1 Like

Actually, I should be more specific than that…

Even without the code to track whether subsymbols are seen or not, doing a .push() of a subsymbol with a tracking image to the empty group in the hierarchy will fail if there is another subsymbol in the project that also contains a tracking image. If it’s the only subsymbol with a tracking image then it works fine.

1 Like

Hi Dave,
Here it is a version of my app, with just the basic code necessary to work with 2 images. Check the ‘code’ node in both the main hierarchy and the symbols. From there, you can easily increase the number of tracking images. The other archive contains the 2 tracking images. Cheers.

Multi_Targets_Light.zpp (4.5 MB)
Archive.zip (113.1 KB)

3 Likes

Thanks for that. I had ironically just got multi image tracking to work just before you posted!

I managed to get it to work using Steve’s methodology after revisiting his code and deconstructing it again.

However, I think I prefer the implementation in the sample app you have uploaded. Having the tracking images in the subsymbols is really neat and avoids polluting the root hierarchy.

It also means you have direct interaction with the tracking image in the Studio GUI via the subsymbol, rather than having to flub it in the main project where you can’t drag in the trained target images.

I can’t see immediately what you have done differently to my initial attempt, so I’m not sure why my first try didn’t work.

Anyway, many thanks for the sample project and the informative comments in the sourcecode. It’s much appreciated!

3 Likes

Glad to hear you got it working.

Steve

1 Like

@stevesanerd Your code was an eye-opener as to what is possible with Studio, and has sparked loads of ideas for cool signage implementations we can offer to our customers.

Not to mention cool ideas for bringing Pokemon cards to life for my kids! :joy:

2 Likes

Really exciting to hear it’s sparked some inspiration - looking forward to seeing what you come up with!

1 Like

Sorry guys I haven’t read the whole thread, but wanted to add some details around this topic.

New versions of the Zappar app have better support for “round robin” detection of multiple target finders, so you do not need to reset the source attribute to get it to work.

To opt-in you’ll need to make sure you scene targets the version of Zappar when we made this the default - you can just add Z.RequiresVersion.v440; in one of your script nodes.

Then you can have multiple TargetFinders in the scene - if no targets are found it will loop through all of the ones that have tracking enabled, giving each one a few frames to find a target. When one is detected it will continue tracking with that one. When tracking is lost it will try to re-find it for a few frames before starting to loop through the different TargetFinders again.

This will give much better performance than loading the target file again each time you need to switch targets. However please note it doesn’t support tracking more than one target at once.

Internally the TargetFinder instances really represent separate tracking algorithms (eg zapcode vs image tracking) - for true multiple target image tracking with the best efficiency we’ll need to expose the ability to create a combined target file with multiple targets in it, that would be loaded into a single TargetFinder. That is on the future feature roadmap, but not in the near term I’m afraid.

5 Likes

Hi @jvouillon,
This is really cool! I’m playing with it a bit and added a video to the one target, it doesn’t seem to loop however with the usual:

Swimming_dolphin_mp4.on("finish",()=>{
   Swimming_dolphin_mp4.restart();
   Swimming_dolphin_mp4.start();

});

Tried the above code in the parent on seen and outside of it.

Do you know what could be causing this issue?

2 Likes

Never mind. The video is looping successfully it just doesn’t display sometimes. Not sure if it’s a processor issue?

Even if I don’t play the video, it appears in the experience for a while (a min or 2) and then disappears.
Does this experience not support videos?

2 Likes