instantreality forum
news: Welcome to the instantreality forums!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 26, 2018, 02:51:42 am


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Browser.createVrmlFromURL()  (Read 8840 times)
christoph
Newbie
*
Posts: 8


View Profile
« on: June 12, 2010, 03:53:47 pm »

Hi all (this is my first post in this forum)

I've got a script node, that is implemented with internal scripting in ECMAScript.

One of the tasks of the script node is to load and store config parameters from an external file.

Another script node triggers our script node from his initialize() method
to load the file.

The ECMAScript code
Browser.createVrmlFromURL(new MFString(Value), getScript, 'loadedLdf');
crashes the Browser.

where
    ..... Value is an SFString (input event), that contains the relative
          file path of the config file
    ..... getScript is an SFnode that points to the Script itself
    ..... loadedLdf is an MFNode input field of the script, that will store
          the loaded config parameters

The input file is OK, i.e.
    ..... the input file can be directly opened by Instant Player
          without error (though this makes no sense)
    ..... the mechanism works with other browsers

Can I somehow circumvent this problem? Is it a bug in instant player?

The code can be found in the SVN repository
svn co https://simulrr.svn.sourceforge.net/svnroot/simulrr simulrr
(the error is commented out, of course)

Thanks for help
Christoph
Logged
pdaehne
Administrator
Sr. Member
*****
Posts: 250


View Profile
« Reply #1 on: June 12, 2010, 05:40:30 pm »

Hello Christoph,

I'll have a look on your problem on monday, but my quick guess is that the "getScript" field produces the problem. I know that this is common practice in VRML to get a reference to "self", but by doing that you create a loop in the scene graph which the player might not handle correctly.

In X3D, this hack to get a reference to "self" is no longer necessary, because you can simply use JavaScript "this". So try to replace "getScript" with "this":

Code:
Browser.createVrmlFromURL(new MFString(Value), this, 'loadedLdf');

Hope that fixes your crash,

Patrick
Logged
christoph
Newbie
*
Posts: 8


View Profile
« Reply #2 on: June 12, 2010, 08:42:30 pm »

Hello Patrick

Thank you for your fast response.

Unfortunately it seems that this hint doesn't fix the crash.

Of course it will be some "silly" error that I made as newbie Wink,

but if you feel as to help me, you could have a look into the file FrameMain/Main_instant.x3d in the SVN repository

and search for the Script node DEF="SceneInterface", functions loadLdf() and loadedLdf().

I have uploaded now the version WITH the error (but using "this") to the SVN repository.

Explanation:
I have three main files, one for BS Contact, Octaga and Instant Player each, but most parts of the "Simulated Railroad Framework" are (shall be) browser independent.

Best regards
Christoph
Logged
pdaehne
Administrator
Sr. Member
*****
Posts: 250


View Profile
« Reply #3 on: June 14, 2010, 01:51:36 pm »

Hello Christoph,

your scene crashes with the official beta7 version, but it does work with the current dailybuild version. You can get it here:

http://ftp://ftp.igd.fraunhofer.de/outgoing/irbuild/Win32-i686/

Unfortunately, it crashes nevertheless when leaving the application, the scene looks different from Octaga and BS Contact, and I cannot navigate  Sad

Bye,

Patrick
Logged
christoph
Newbie
*
Posts: 8


View Profile
« Reply #4 on: June 14, 2010, 06:58:22 pm »

Hello Patrick

Thanks for the link.

I downloaded Instant_Player-Win32_NT-5.1-i686-2.0.0-b13430.5374.exe, but the installer told me that the checksum was wrong. I downloaded again, same result, tried to install with /NCRC command line option -> installation started but cancelled somewhere in the middle with "corrupted installer".

I gave up.

Commented the loading of the config file out in my scene (I need this function earliest in a few weeks, so it's no big issue for me).

Now my scene works with Instant Player. I do not see differences between the three players.

Regarding navigation: navigation works with the mouse, but not with the arrow keys. Reason: I have a KeySensor node in my scene to switch between the HUDs with the "1", "2", "3", ..... keys on the keyboard.

When I disable my KeySensor, the navigation with the arrow keys works.

Kind regards
Christoph
Logged
christoph
Newbie
*
Posts: 8


View Profile
« Reply #5 on: June 26, 2010, 08:18:29 pm »

Hi Patrick

I've tried again today and that's my current status.

 - I downloaded and installed the daily build without problems
 - Loading the configuration file with Browser.createVrmlFromUrl() works
   without crash  Smiley

Some additional notes:

  - when the file cannot be loaded (e.g. not existing), I'm used to get
    an empty MFNode, but Instant Player does not call the target method
    at all -> would it be possible to adapt this behaviour or would I have
    to implement a timer to supervise the loading of the file?
  - the issue with the KeySensor and the arrow keys for navigation
     still exists - do I have to find a work around or do you think there
     will be a solution?

Some final remark:
   My experience with Instant Player regarding responsiveness of the forum
   is hence a good experience :-)

Christoph
Logged
pdaehne
Administrator
Sr. Member
*****
Posts: 250


View Profile
« Reply #6 on: June 29, 2010, 03:46:22 pm »

Hello Christoph,

I've changed the behaviour of createVrmlFromUrl(), it sends an empty MFNode now when all Downloads fail. Please download the latest dailybuild (build nr >= b13486):

http://ftp://ftp.igd.fraunhofer.de/outgoing/irbuild/Win32-i686/

I do not think that we'll fix the KeyboardSensor soon. It's a mess (our implementation as well as the X3D spec).

Bye,

Patrick
Logged
christoph
Newbie
*
Posts: 8


View Profile
« Reply #7 on: July 03, 2010, 06:30:13 pm »

Thanks, it works fine.

OK, I will find a workaround on my side for the keyboard sensor issue.......
Logged
Peter_Pig
Newbie
*
Posts: 23


View Profile
« Reply #8 on: November 17, 2010, 07:23:54 pm »

Hi there.

I changed to the dailybuild 20586 after reading this topic, since I was experiencing similar issues with createVrmlFromURL().

But my specific problem persists :

I have got a php file returning valid VRML 2.0.

This file opens properly if I browse it directly with InstantPlayer.

When I try to inline it, using createVrmlFromURL() from within another world, the console throws following warning :

WARNING   ECMASpt    8: createVrmlFromURL - failed to load VRML code from URL "http://localhost/inline.php" (            Browser.createVrmlFromURL(request, root, 'addChildren');

... and the file does not load.

I wonder if I am doing something wrong, or if there's a little tweak in the createVrmlFromURL() method.

Hints will be much appreciated.

Peter


 
Logged
pdaehne
Administrator
Sr. Member
*****
Posts: 250


View Profile
« Reply #9 on: November 17, 2010, 10:17:29 pm »

Hello Peter,

sorry, there was yet another bug in createVrmlFromURL(). Please try the next dailybuild - should be available on thursday 6:00 AM CET on our FTP server.

Bye,

Patrick
Logged
Peter_Pig
Newbie
*
Posts: 23


View Profile
« Reply #10 on: November 18, 2010, 10:57:05 pm »

Hi Patrick!

downloaded 2.0.0 20624 (a bit later than 6:00 AM  Wink ) and createVrmlFromURL() was able to retreive the php generated file.

Thank you.

Peter



Logged
pdaehne
Administrator
Sr. Member
*****
Posts: 250


View Profile
« Reply #11 on: November 19, 2010, 11:47:58 am »

Great! Thanks for the feedback.
Logged
Peter_Pig
Newbie
*
Posts: 23


View Profile
« Reply #12 on: November 20, 2010, 11:22:59 am »

Hi again!

yet another question regarding createVrmlFromURL() :

Sometimes I let the PHP-Script idle arround for a while, waiting for events to happen before sending VRML code back to the client.

InstantPlayer seems to freeze while waiting for createVrmlFromURL().

Is it fetching synchronously?

If yes, can this behaviour be changed by some Browser-method?

Thanks in advance.

Peter


edit : attached example
« Last Edit: November 20, 2010, 12:15:15 pm by Peter_Pig » Logged
pdaehne
Administrator
Sr. Member
*****
Posts: 250


View Profile
« Reply #13 on: November 20, 2010, 12:46:08 pm »

Sorry, we do not yet support asynchronous downloads.
Logged
Peter_Pig
Newbie
*
Posts: 23


View Profile
« Reply #14 on: November 20, 2010, 01:54:47 pm »

Not a problem!

Thanks for your prompt reply.

Enjoy the weekend (a bit at least).

Peter
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.15 | SMF © 2011, Simple Machines