All the capabilities must be set *before* the object is compiled or made live. After that, if you have set the correct capabilities, you can change what ever you want.
Cheers, Florin -----Original Message----- From: Discussion list for Java 3D API [mailto:[EMAIL PROTECTED] Behalf Of Madeti, Henu S. (UMR-Student) Sent: Dienstag, 14. Oktober 2003 01:18 To: [EMAIL PROTECTED] Subject: Re: [JAVA3D] appearance problem Michael I tried that too. getting the appearance, then getting the renderingattributes and changing them, but it doesnt allow me to apply the changed-renderingattributes to the appearance(which is of a live object). Here is the code. Please let me know where i am doing wrong Appearance a3; a3 = shape1.getAppearance(); a3.setCapability(Appearance.ALLOW_RENDERING_ATTRIBUTES_WRITE); a3.setCapability(Appearance.ALLOW_RENDERING_ATTRIBUTES_READ); a3.setCapability(shape1.ALLOW_APPEARANCE_READ); a3.setCapability(shape1.ALLOW_APPEARANCE_WRITE); r= a3.getRenderingAttributes(); r.setVisible(false); thanks Venu -----Original Message----- From: Michael Pfeiffer [mailto:[EMAIL PROTECTED] Sent: Mon 10/13/2003 7:31 PM To: [EMAIL PROTECTED] Cc: Subject: Re: [JAVA3D] appearance problem The capability bits don't modify the Appearance itself! They only say what can be modified after the object was compiled. To change the properties of your Appearance object, try the different get...() methods to access the Texture, Color, MaterialAttributes etc. (please refer http://java.sun.com/products/java- media/3D/forDevelopers/J3D_1_3_API/j3dapi/javax/media/j3d/Appearance.html for all methods which can be used for getting and setting the different values). On Mon, 13 Oct 2003 17:22:18 -0500, Madeti, Henu S. (UMR-Student) <[EMAIL PROTECTED]> wrote: > Michael. Thanks for replying-back. My goal is to modify the appearance of > a live object. But it gives me error saying > javax.media.j3d.RestrictedAccessException: Cannot modify capability bits > Is there any way i can do that?i.e Modify the appearance of a live > object. thanks > venu > > -----Original Message----- From: Michael Pfeiffer [mailto:[EMAIL PROTECTED] > ONLINE.DE] Sent: Mon 10/13/2003 6:44 PM To: [EMAIL PROTECTED] > Cc: Subject: Re: [JAVA3D] appearance problem > > > > In your example a3 is a reference to a Appearance object which belongs > to a > object which seems to be live. And it is exactly like the error message > says: you can't modify the capability bits of an object which is live. > > Appearance a3 = new Appearance(); > a3 = shape.getAppearance(); > > is a little bit senseles: You create a new Appearance a3 and overwrite > it > immediately afterwards. Modify the capability bits directly after the > creation of your new Appearance object and everything should work fine. > > On Tue, 14 Oct 2003 02:12:36 +0530, venu satya <[EMAIL PROTECTED]> > wrote: > > > Hi Java3D people > > I have a problem here. I a trying to change the appearance of a > shape3d > > object. > > when i set the appearance to a new appearance it works fine. but when > i > > try > > to get the old appearance and modify it, it gives me the error > > javax.media.j3d.RestrictedAccessException: Cannot modify capability > bits > > on > > a live or compiled object > > Any clue how i can overcome this. > > here is the code > > > > > > Appearance a3 = new Appearance(); > > a3 = shape.getAppearance(); > > > > a3.setCapability(Appearance.ALLOW_RENDERING_ATTRIBUTES_WRITE); > > a3.setCapability(Appearance.ALLOW_RENDERING_ATTRIBUTES_READ); > > a3.setCapability(shape1.ALLOW_APPEARANCE_READ); > > a3.setCapability(shape1.ALLOW_APPEARANCE_WRITE); > > r= new RenderingAttributes(); > > r.setVisible(false); > > a4.setRenderingAttributes(r); > > shape.setAppearance(a4); > > > > thanks > > venu > > > > _________________________________________________________________ > > Make glass paintings? Are you a good artist? > > http://server1.msn.co.in/features/general/diwali.asp Sell your Diwlai > > creations online. > > > > > =========================================================================== > > > > 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". > > > > > > -- > -- > Virtual Worlds Productions > Software Development Group > http://www.virtualworlds.de > > =========================================================================== > > > 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". > > > -- -- Virtual Worlds Productions Software Development Group http://www.virtualworlds.de =========================================================================== 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". =========================================================================== 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".