A. Murat Tanyer wrote:
Dear all,
I am trying to access to a Shape3D object which is already attached to
a BranchGroup (I first clone the node and try to access the object in
this cloned BG). The code and scenegraphs are attached. During run
time, I am getting the exception:
Exception caught: Index: 0, Size: 0
I can see print out 2 but I cannot see print out 3. So there is
something wrong in the line:
Node tgt = ((BranchGroup)cN).getChild(0);
Can someone give me a hint?
Please send us a complete test case to investigate. One way to deal with
deadlock/hang
is to exam. the stack trace when it happens by pressing Ctrl-Break
(assume you are using Windows).
If the deadlock is in Java3D threads we're happy to fix that.
Thanks.
- Kelvin
----------
Java 3D Team
Sun Microsystems Inc.
------------------------------------------------------------------------
//MY CODE
BranchGroup BG_Column = new BranchGroup();
BG_Column.setCapability(BranchGroup.ALLOW_DETACH);
TransformGroup T_TGR = new TransformGroup(rotateX_s);
TransformGroup T_TGT = new TransformGroup(translate1);
T_TGT.addChild(T_TGR);
BG_Column.addChild(T_TGT);
System.out.println("ch: " + BG_Column.numChildren()); // returns: 1
System.out.println("1");
Node cN = BG_Column.cloneNode(true);
System.out.println("2");
Node tgt = ((BranchGroup)cN).getChild(0);
System.out.println("3");
Node tgr = ((TransformGroup)tgt).getChild(0);
System.out.println("4");
Node part2 = ((TransformGroup)tgr).getChild(0);
System.out.println("5");
objTransp.setCapability(TransparencyAttributes.ALLOW_VALUE_WRITE);
System.out.println("6");
objTransp.setTransparencyMode(TransparencyAttributes.BLENDED);
System.out.println("7");
objTransp.setTransparency(0.5f);
System.out.println("8");
Appearance app2 = ((BoxDef)part2).getAppearance();
app2.setTransparencyAttributes(objTransp);
System.out.println("9");
((BoxDef)(part2)).setAppearance(app2);
System.out.println("10");
------------------------------------------------------------------------
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".