cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

How can I take a picture using application events from a 3D Eyewear Experience

fbdsilva
8-Gravel

How can I take a picture using application events from a 3D Eyewear Experience

Hello Everyone,

 

I am developing an experience for hololens 2 where I need to take a picture using a voice command and the way I would like to do that is using the application events because I am using those for others functions.

In that way, I am trying to write a function and call it from the application event but no success so far.

 

Any idea on that?

 

Many thanks,

Felipe Duarte

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @fbdsilva , 

Is it possible for you to share the project, and maybe then i can look into it what's wrong or may be understand more clearly what you want to achieve 

 

Also, as you mentioned, the issue is how to write the function to take the photo, you can use the below code

twx.app.fn.triggerWidgetService('camera-1', 'takePicture');

 

I Hope this helps, thanks 

 

BR,

Mohit 

View solution in original post

7 REPLIES 7

Hello @fbdsilva ,

 

As far I can understand from this, you want to use application event to take picture and at the same time want to call a function 

For this, you can do the below bindings: 

MK_10166888_0-1653053054311.png

Write the required function and call it as the way shown below :

MK_10166888_1-1653053185010.png

Attaching a sample project for the same, let me know if this is what you were looking for 

Best Regards,

Mohit Kabra

Hi Mohit,

 

Thanks for sending this but my issue is not how to write a function and call it from an application event, I am doing that for many others functions, the issue is how to write the function to take the photo because as you sent others type of functions works fine but a take picture event is not triggered from the application event.

 

Any ideas?

 

Thanks again,

Felipe Duarte

Hi @fbdsilva , 

Is it possible for you to share the project, and maybe then i can look into it what's wrong or may be understand more clearly what you want to achieve 

 

Also, as you mentioned, the issue is how to write the function to take the photo, you can use the below code

twx.app.fn.triggerWidgetService('camera-1', 'takePicture');

 

I Hope this helps, thanks 

 

BR,

Mohit 

Hi Mohit,

 

Unfortunatelly I cannot share the project because there are customer CAD data on that. On the other hand I created a new one just to test the code you sent and it works there. I was using a different way to trigger the service.

Now I will fix my main project.

Also, just for people that can arrive on this topic with the same issue, I am attaching the project where it is working.

 

Many thanks Mohit!

Hi @fbdsilva , Glad to know it worked for you ! 😊

 

Best Regards,

Mohit

Hello @fbdsilva@Mohit_Kabra27,

 

I wanted to ask you, In my vuforia platform, application event is not showing. What should I do? Here I attach file please check this. Do you have any idea about this or anyone knows please tell me.

It is because you are not connected to any Thingworx server. 

Top Tags