This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > VRML > December 2006 > Re: Uninstantiated EXTERNPROTO
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: Uninstantiated EXTERNPROTO
|
|
| Braden McDaniel 2006-11-19, 7:36 pm |
| On Sat, 11 Nov 2006 12:42:10 +0100, O.L. wrote:
> Hello,
>
> I've seen a strange bug when working on my VRML scenes : the
> EXTERNPROTO default values was not used when I created a new instance
> of this PROTO.
>
> Exemple :
>
> # myProto.wrl
> PROTO Test [exposedField SFInt32 myField 666] { Script {...} }
>
> # myScene.wrl
> EXTERNPROTO Test [exposedField SFInt32 myField]
> ["http://website.com/myProto.wrl#Test"]
> Test {} # the PROTO is instanciated but 'myField' field is '0' and not
> '5' !! :-o
>
>
> Does somebody know how can that happen ?
> The PROTO is instanciated (a Script{} node inside is initialized()),
> but its exposedField values are not set to default values : they are
> null (empty SFString, 0 SFInt32, NULL sfnodes ...).
> I received no browser error.
The instance isn't going to have the default value you've specified in the
PROTO definition until the definition has loaded. If you read
myField_changed before then, you'll get the default value for the type; for
SFInt32, that's 0.
--
Braden McDaniel e-mail: <braden@endoframe.com>
<http://endoframe.com> Jabber: <braden@jabber.org>
| |
|
| Dans son message précédent, Braden McDaniel a écrit :
> On Sat, 11 Nov 2006 12:42:10 +0100, O.L. wrote:
>
>
> The instance isn't going to have the default value you've specified in the
> PROTO definition until the definition has loaded. If you read
> myField_changed before then, you'll get the default value for the type; for
> SFInt32, that's 0.
But I know the PROTO definition *is* loaded from the remote file,
because its Script{} prints data in the browser console and do its job.
The PROTO is working, but its fields are not initialized with the
correct values ... :-/
--
Olivier Ligny
Créateur web free-lance / www.cyber-tamtam.net
| |
| Braden McDaniel 2006-11-19, 7:36 pm |
| On Sat, 11 Nov 2006 20:27:22 +0100, O.L. wrote:
> Dans son message précédent, Braden McDaniel a écrit :
[snip]
[color=darkred]
>
> But I know the PROTO definition *is* loaded from the remote file,
> because its Script{} prints data in the browser console and do its job.
> The PROTO is working, but its fields are not initialized with the
> correct values ... :-/
Have you tried different viewers? If you posted a complete example, I
could probably tell you whether you're seeing a browser bug.
--
Braden McDaniel e-mail: <braden@endoframe.com>
<http://endoframe.com> Jabber: <braden@jabber.org>
| |
| Braden McDaniel 2006-11-19, 7:36 pm |
| On Sun, 12 Nov 2006 15:03:24 +0100, O.L. wrote:
> simon avait énoncé :
>
> Here are the files : http://cjoint.com/?lmo6HYWQhz
RAR?
Using a proprietary format like that is a good way to limit the help
you'll receive.
Good luck.
--
Braden McDaniel e-mail: <braden@endoframe.com>
<http://endoframe.com> Jabber: <braden@jabber.org>
| |
|
| Braden McDaniel a exposé le 12/11/2006 :
> On Sun, 12 Nov 2006 15:03:24 +0100, O.L. wrote:
>
>
> RAR?
>
> Using a proprietary format like that is a good way to limit the help
> you'll receive.
>
> Good luck.
Sorry I didn't know that RAR was a proprietary format.
I repost my archive in ZIP format : http://cjoint.com/?lnjueuP88J
I hope ZIP is a free format but I'm not sure.
Thanks
--
Olivier Ligny
Créateur web free-lance / www.cyber-tamtam.net
| |
| Braden McDaniel 2006-11-19, 7:36 pm |
| On Mon, 13 Nov 2006 09:23:54 +0100, O.L. wrote:
> Braden McDaniel a exposé le 12/11/2006 :
>
> Sorry I didn't know that RAR was a proprietary format.
> I repost my archive in ZIP format : http://cjoint.com/?lnjueuP88J
> I hope ZIP is a free format but I'm not sure.
This "test" has too many other issues for it to be useful test what you're
trying to test.
* When you write directly to the eventIns of nodes in a Script (rather
than emitting an event from the Script to be propagated with a ROUTE),
you must set directOutput to TRUE.
* Script nodes cannot have exposedFields.
I suggest you construct a much simpler test. There's no reason for the
test to be so complicated.
One thing I note is that your EXTERNPROTO is inside a PROTO definition.
While there *should* be no problem with that, you might experiment with
moving it outside the PROTO definition to see if you get different results.
--
Braden McDaniel e-mail: <braden@endoframe.com>
<http://endoframe.com> Jabber: <braden@jabber.org>
| |
| Josip Almasi 2006-11-19, 7:36 pm |
| Braden McDaniel wrote:
> * Script nodes cannot have exposedFields.
Thats blaxxun specific.
They turned a lot of fields to exposedFields, like IIRC
ElevationGrid.height etc.
Regards...
| |
|
| Josip Almasi avait écrit le 15/11/2006 :
> Braden McDaniel wrote:
>
> Thats blaxxun specific.
> They turned a lot of fields to exposedFields, like IIRC ElevationGrid.height
Out of curiosity, what's the difference ?
--
Olivier Ligny
Créateur web free-lance / www.cyber-tamtam.net
| |
| Joerg Scheurich aka MUFTI 2006-11-19, 7:36 pm |
| > > * Script nodes cannot have exposedFields.
> Thats blaxxun specific.
Thats VRML97 specific:
http://www.web3d.org/x3d/specificat...Ref.html#Script
| 6.40 Script
| ...
| With the exception of the url field, exposedFields are not allowed in
| Script nodes.
In X3D you can have the exposedField equivalents [in,out] fields
http://www.web3d.org/x3d/specificat...l#Nodereference
| 29.4.1 Script
|
| Script : X3DScriptNode {
| ...
| # And any number of:
| ...
| fieldType [in,out] fieldName
| ...
--
If you have a thread that uses Sleep with infinite delay, the
system will deadlock.
(from the MSDN Documentation)
| |
| Josip Almasi 2006-12-06, 7:36 pm |
| O.L. wrote:
>
> Out of curiosity, what's the difference ?
Lets me read heights, so i.e. my objects can follow the terrain.
Regards...
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|