Hi Guys,
Unsure if we are doing something incorrect here, but we are seeing no data coming out of DataOutput nodes.
We are using:
api.scene.getData()
This is the set up inside the GH:
And this is the result:
Regards,
Jonas Blazinskas
Hi Guys,
Unsure if we are doing something incorrect here, but we are seeing no data coming out of DataOutput nodes.
We are using:
api.scene.getData()
This is the set up inside the GH:
And this is the result:
Regards,
Jonas Blazinskas
Could you post a link to your model? In case it’s private you can send a direct message.
I also tested on several browsers and could see the exported data without issues. @Jonas-Blazinskas could you let us know if you still experience the problem and give more details regarding your configuration (browser, device…)?
Google chrome, Windows. We are using direct embedding through a ticket and it’s all within a react framework. Here is the code below:
async componentDidMount() {
// container for the viewer
// here the reference works and the container is loaded correctly
let _container = this.containerSD.current;
// ShapeDiver Viewer constructor settings
// Refer to https://app.shapediver.com/api for details
let settings = {
container: _container,
showSceneMode: 1 // do not show the scene automatically
};
// construct an instance of the viewer
this.api = new window.SDVApp.ParametricViewer(settings);
// register a ShapeDiver CommPlugin
await this.api.plugins.registerCommPluginAsync({
// ticket of the model as shown on app.shapediver.com
ticket: '4085ce2c773691d2ec7806686ee30e7313b1e950cf38d130c1857c5581de553f95516b7337f449866b1cfa92b20f5c01f77b4ddf2fe0e672d58c60b39d1ad862c083d552e0c388be92d14ad12751a76dcb899e26b79c5398a236a82fbfd7c9fbdb86c0f15e4f56aa6d82530e1a13111f2bdc0210d8d1-5f9c3c01de9c8b569ee69a74d008de9b',
// URL of the ShapeDiver backend system used
modelViewUrl: this.props.modelViewUrl,
// runtime id to use for this CommPlugin (you might register several)
runtimeId: 'CommPlugin_1',
// the following setting tells the viewer to wait with loading of geometry
deferGeometryLoading: true
});
console.log('ShapeDiver CommPlugin successfully loaded');
// get parameters of the model
this.parameters = await this.api.parameters.get().data;
if (this.parameters) {
this.setParameters(this.parameters);
}
console.log('Available model parameters', this.parameters);
// Updating parameters
// this.api.parameters.updateAsync({ name: 'Width', value: 10 });
// optionally change parameter values before showing the scene
//await this.api.parameters.updateAsync([
// {name: INSERT_NAME_OF_PARAMETER, value: INSERT_VALUE},
// {id: INSERT_ID_OF_PARAMETER, value: INSERT_VALUE},
//]);
// console.log(this.api.scene.getDataAsync());
this.data2 = await this.api.scene.getData();
// refresh (load geometry), because the initial parameter update might not have changed any values
await this.api.plugins.refreshPluginAsync('CommPlugin_1');
// finally show the scene
await this.api.updateSettingAsync('scene.show', true);
}
Note that I have changed the ticket due to deleting the previous one but it is the same GH script with a same error.
The problem must be related to the fact that api.scene.getData()
is being called before api.plugins.refreshPluginAsync
. The latter makes sure that the scene parts provided by the plugin are loaded.
Yup that fixed it, thank you so much!