Jump to content

onSuccess not triggered


Recommended Posts

Hi everyone,

I'm writing a plugin for Wordpress that use Babylon JS and I got a little problem.
I try to load a mesh :

var obj = loader.addMeshTask("tortue", "", WPURLS.plugin_dir+'/models/turtle/', "turtle-lowpoly.obj");
obj.onSuccess = function(task){

The model is loaded (I see it in Firebug) but the onSuccess function is never triggered.
If I put the code as standalone it works well...

You can see here the problem : http://www.info-d-74.com/test-3d-object/

URL of the script is : http://www.info-d-74.com/wp-content/plugins/3d-objects/js/3d_object.js?ver=4.5.2

Any idea to fix it ? Thanks :)

Link to comment
Share on other sites

Thanks adam for your help.
I add these followinh lines :

obj.onError = function(error){	

loader.onTaskError = function(tasks) {
	console.log('Error loading: '+tasks.name);

The two error callbacks are triggered, but I don't know how to get the error message...

Where did you get "Unexpected token # in JSON at position 0" error ?

Link to comment
Share on other sites

It's so strange, I don't understand what is going wrong...

It try to change Wordpress theme but still the issue :/

The obj file is correctly loaded (see screenshot below). May be a problem with the charset and/or break lines ?


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...