<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">My feeling is that you should explicitely convert the timein.getValue()+2.0 to an SFTime value...&nbsp;<div>As you wrote the code I think that it is trying to put directly an integer value into a SFTime slot... and I guess that this is not acceptable.</div><div><br></div><div>cheers,</div><div><br></div><div><br><div><div>On Apr 7, 2009, at 6:05 PM, Giorgos Papadakis wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div lang="EL" link="blue" vlink="purple"><div class="Section1"><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Hello, I am having some troubles with SAI (script called inside an x3d world).<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">My code has an input SFTime value, routed from an TouchSensor, and I want to use this to trigger an animation (startime=input and stoptime=input+2.5 seconds)<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">I am trying to do this at the following simple code:<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p>&nbsp;</o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 0, 192); ">timeoutstart</span><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New'; color: black; ">.setValue(</span><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 0, 192); ">timein</span><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New'; color: black; ">.getValue());</span><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><u><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New'; color: rgb(63, 127, 95); ">timeoutstop</span></u><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New'; color: rgb(63, 127, 95); ">.setValue(<u>timein</u>.getValue()+2.0);<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p>&nbsp;</o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">When viewing the world using the Xj3D browser, I am getting the following exception:<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p>&nbsp;</o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">System.out: Error: System.out: Error while sending event<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">System.out: java.lang.NullPointerException<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">System.out: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at Control3.readableFieldChanged(Control3.java:62)<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">System.out: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.web3d.vrml.scripting.sai.BaseField.fireEventNotification(BaseField.java:352)<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">System.out: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.web3d.vrml.scripting.sai.JavaSAIScriptWrapper.sendEvents(JavaSAIScriptWrapper.java:572)<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">System.out: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.web3d.vrml.renderer.common.nodes.scripting.BaseScript.processEvents(BaseScript.java:571)<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">System.out: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.xj3d.impl.core.eventmodel.DefaultScriptManager.processEvents(DefaultScriptManager.java:287)<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">System.out: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.xj3d.impl.core.eventmodel.DefaultEventModelEvaluator.evaluateRunning(DefaultEventModelEvaluator.java:936)<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">System.out: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.xj3d.impl.core.eventmodel.DefaultEventModelEvaluator.evaluate(DefaultEventModelEvaluator.java:605)<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">System.out: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.web3d.vrml.renderer.ogl.browser.PerFrameManager.clockTick(PerFrameManager.java:126)<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">System.out: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.web3d.vrml.renderer.ogl.browser.ApplicationFrameManager.updateSceneGraph(ApplicationFrameManager.java:89)<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">System.out: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.j3d.aviatrix3d.management.SingleThreadRenderManager.run(SingleThreadRenderManager.java:648)<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">System.out: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.lang.Thread.run(Unknown Source)<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">This happens only with SFTime variables, I have successfully changed &nbsp;an object’s position and orientation using similar code.<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">I appreciate any help you can give me.<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Thank you in advance,<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Giorgos.<o:p></o:p></span></div></div>_______________________________________________<br>X3D-Public mailing list<br><a href="mailto:X3D-Public@web3d.org" style="color: blue; text-decoration: underline; ">X3D-Public@web3d.org</a><br><a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" style="color: blue; text-decoration: underline; ">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br></div></span></blockquote></div><br></div></body></html>