H3D.org Forum Index Programming Issues
Problem with nested prototypes in H3D trunk (r1943) | Register To Post |
| Threaded | Newest First | Previous Topic | Next Topic | Bottom |
| Poster | Thread |
|---|---|
| karlsvec | Posted on: 2012/7/25 2:01 |
Quite a regular ![]() ![]() Joined: 2008/7/1 From: Posts: 41 |
Problem with nested prototypes in H3D trunk (r1943) Hello,
In the latest H3D trunk, I am unable to load a prototype that is a composition of other ProtoInstances. Example: ProtoOne.x3d
<X3D>
ProtoTwo.x3d
<X3D>
WrapperProto.x3d (a composition of ProtoOne and ProtoTwo)
<X3D>
The test scene: test_WrapperProto.x3d
<X3D>
When I load the test scene in H3DLoad, I get the following error output:
Loading c:/Users/Karl Svec/Desktop/test_WrapperProto.x3d
I spent some time stepping through things with GDB. I set a breakpoint at line 887 in X3DSAX2Handlers.cpp, within the definition of X3DSAX2Handlers::protoEndElement():
if( localname_string == "ProtoDeclare" ) {
I can step through the program and see the proto_declarations list being built up with the declarations from the ExternProtoDeclares. However, when I set another breakpoint at line 935 of X3DSAX2Handlers.cpp, within the definition of X3DSAX2Handlers::handleProtoInstanceElement(), when it comes time to actually instantiate the ProtoInstances, the declarations are no longer in the proto_declarations list.
X3DPrototypeInstance* X3DSAX2Handlers::handleProtoInstanceElement( const Attributes &attrs ) {
Is it possible that the proto_declarations list is being destroyed prematurely, rather than being carried through to the actual ProtoInstance instantiations? I'd appreciate any help on the matter. Thanks, - Karl |
| karlsvec | Posted on: 2012/7/28 0:47 |
Quite a regular ![]() ![]() Joined: 2008/7/1 From: Posts: 41 |
Re: Problem with nested prototypes in H3D trunk (r1943) I posted a work-in-progress patch that addresses this issue. See http://www.h3dapi.org/modules/newbb/v ... php?topic_id=1853&forum=4.
|
| karlsvec | Posted on: 2012/8/15 20:20 |
Quite a regular ![]() ![]() Joined: 2008/7/1 From: Posts: 41 |
Re: Problem with nested prototypes in H3D trunk (r1943) Bumping this thread. Hopefully it will draw the attention of the SenseGraphics devs.
|
| karlsvec | Posted on: 2012/8/23 22:18 |
Quite a regular ![]() ![]() Joined: 2008/7/1 From: Posts: 41 |
Re: Problem with nested prototypes in H3D trunk (r1943) I tested these example scenes with the latest Xj3D 2.0 pre-release, and they work as I expected (albeit with some modifications required to make them X3D-compliant).
So, this is definitely a bug in H3D, related to the bug involving default field values in prototypes described in this thread. - Karl |
| Markus | Posted on: 2012/10/11 15:17 |
Webmaster ![]() ![]() Joined: 2006/3/27 From: SenseGraphics Posts: 1902 |
Re: Problem with nested prototypes in H3D trunk (r1943) This issue, and the other thread (http://www.h3dapi.org/modules/newbb/v ... php?topic_id=1853&forum=4) connected to bug report 0000296 should be fixed in H3DAPI trunk revision 2010.
If you have some other/a bigger example than the ones provided in these threads please update H3DAPI and test that the fix works. |
| karlsvec | Posted on: 2012/10/18 0:45 |
Quite a regular ![]() ![]() Joined: 2008/7/1 From: Posts: 41 |
Re: Problem with nested prototypes in H3D trunk (r1943) I have tested a handful of my more complex prototypes (that use nested ProtoInstances) with the latest H3DAPI trunk, and they are all working fine.
Thanks for getting this issue resolved quickly! |
| Threaded | Newest First | Previous Topic | Next Topic | Top |
| Register To Post | |



