Skip to main content
15-Moonstone
February 17, 2022
Solved

Start functions AFTER model load from repository

  • February 17, 2022
  • 2 replies
  • 1483 views

Hello, 

I'm getting the pvz file for my AR experience from an HTTPS repository (experience service).

I want to execute the rest of the javascript functions I wrote into vuforia studio source code (e.g. metadata load, button customization through metadata ecc.) only AFTER the model load is complete.

How to perform this task? Any advice? many thanks

Best answer by whity

Did you try this:

$rootScope.$on('modelLoaded', function() {
$scope.yourFunctions();
});

2 replies

whity16-PearlAnswer
16-Pearl
February 18, 2022

Did you try this:

$rootScope.$on('modelLoaded', function() {
$scope.yourFunctions();
});

21-Topaz I
February 18, 2022

Hi @GianVal ,

when you load a file from repository (TWX or other) - this will not add the metadata to the download folder. 

At the current time when you import the data using the UI this will - allow to  select the option  in UI to add the meta data

 

2022-02-18_14-24-10.jpg

 

So far I know PTC dev planned to create an offline procedure which will allow to extract the metadata from pvz outside Studio but I have no information what this tool will be available. 

When a model is imported to Studio folder with the option allow metadata - in this case Studio will extract he data to a file >modelName>.json and will add this file to the model folder. Based on this json file we can use the metadata API or access it directly as json object.

 

For your case the workaround will be , to extract the json file for each model which is added to repository and to upload this json on the server. So that when you load a model from a repository you have then also to load the corresponding json file (which was previously extracted by Studio UI. I hope that soon we will be able to extract the model via offline tool in batch mode

==

my answer here is more related to the post