This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > VRML > November 2006 > Uninstanciated 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 |
Uninstanciated EXTERNPROTO
|
|
|
| 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.
Thanks in advance,
Olivier
--
Olivier Ligny
Créateur web free-lance / www.cyber-tamtam.net
| |
|
| could you post more complete code, that really demonstrates the problem?
| |
|
| simon avait énoncé :
> could you post more complete code, that really demonstrates the problem?
Here are the files : http://cjoint.com/?lmo6HYWQhz
To launch the test, clic on the box, and you should see blue gun shoots
at the left of the screen (PROTO from BlasterShoot.wrl).
If you uncomment lines 87=>93 in chasseur1.wrl, which explicitly set
the default fields values to the PROTO instance, the test will work,
but if these lines are removed, the default values (of
BlasterShoot.wrl) are'nt used and we don't see the gun shots.
Any idea ?
Note : I only use BlaxxunContact browser, and I have no other browsers
installed to test. My project will only use BlaxxunContact VRML browser
anyway.
Thanks :)
Olivier
--
Olivier Ligny
Créateur web free-lance / www.cyber-tamtam.net
| |
|
| >
> Note : I only use BlaxxunContact browser, and I have no other browsers
> installed to test. My project will only use BlaxxunContact VRML browser
> anyway.
>
hi, i tried the example, both with and without the commented lines, and
both produced the animated fire when the box was clicked, which i guess
means its a problem with your browser.
i used bsContact 7.004,
( bscontact split from blaxxuncontact a while back, unlike bscontact, i
don't think blaxxuncontact is being developed any more, so this is
unlikely to be fixed.)
your exposed fields in scripts work in both, because their original
developer decided to support them before the split, but the standard
specifically excludes them, so this won't work on VRML compliant
browsers, however X3D does support them so if you convert it to X3D it
should work on all X3D browsers. There is actually a good work-round
to get exposed fields in scripts in a compliant way, but this problem
with default values in blaxxuncontact protos is unknown to me, i should
imagine there is a work-round in some old VRML somewhere, but if you
are stuck on blaxxuncontact, you might just have to try different way
of doing it until you find one that works.
simon
| |
| Josip Almasi 2006-11-19, 7:36 pm |
| O.L. wrote:
>
> Note : I only use BlaxxunContact browser, and I have no other browsers
> installed to test. My project will only use BlaxxunContact VRML browser
> anyway.
Congratulations, you've just discovered that blaxxun sucks too,
especially regarding externprotos, and each end every url implementation.
Regards...
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|