Scripting for Audio capabilities

17 views
Skip to first unread message

richards christopher

unread,
Mar 21, 2011, 1:03:55 PM3/21/11
to Open Wonderland Scripting
Hi all,

Is it possible to control audio capability added to an object through
script. I need to control the playing of audio and the number of files
played at a time based on user inputs. I could not find much info
about scripting for the audio component. Is it possible? if not, is
there any other way i can do it? Thanks in advance


Regards,
Richards

Morris Ford

unread,
Mar 21, 2011, 2:11:14 PM3/21/11
to open-wonderl...@googlegroups.com
In order to control the audio capability via scripting, it will be necessary to put the scripting command structure into the audio capability module. A good example of how that all works is the npc module. Look in the NpcCell.java code. You will have to find the code in the audio capability cell code that performs the various functions that you want to perform and attach scripting commands to those.
Morris

richards christopher

unread,
Mar 22, 2011, 5:31:22 AM3/22/11
to Open Wonderland Scripting
Hi Morris
Thank you for the info. Basically i am trying to simulate the working
of an audio mixer using open wonderland. I have created the model and
made parent child relation to the body of the mixer and different
faders and knobs. i have brought the model inside wonderland. will i
be able to access the individual faders and knobs and add animation to
it seperately? i tried importing a single fader separately and tried
to add an animation by adding the following script.


fader.translateX=1.0

as mentioned in the bug example. but i could not get it right. i got
the following error while i tried to save the script.

22 Mar, 2011 2:47:55 PM
org.jdesktop.wonderland.modules.webdav.common.WebdavContentCollection
getChild
WARNING: In path scripts element scripts not found
Exception for contentWriteFile
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at properties.contentWriteFile(Unknown Source)
at properties.jSaveEditActionPerformed(Unknown Source)
at properties.access$000(Unknown Source)
at properties$1.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:
1995)
at javax.swing.AbstractButton
$Handler.actionPerformed(AbstractButton.java:2318)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:
387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:
242)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:
236)
at java.awt.Component.processMouseEvent(Component.java:6267)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6032)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:
4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:
4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:
269)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:
184)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:
174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.NullPointerException
at
org.jdesktop.wonderland.modules.scriptingComponent.client.ScriptingComponent.contentWriteFile(ScriptingComponent.java:
1127)
... 33 more

What should i be doing? Am i going wrong somewhere? please help. Thank
you

Regards,
Richards

On Mar 21, 11:11 pm, Morris Ford <morrishf...@gmail.com> wrote:
> In order to control the audio capability via scripting, it will be necessary
> to put the scripting command structure into the audio capability module. A
> good example of how that all works is the npc module. Look in the
> NpcCell.java code. You will have to find the code in the audio capability
> cell code that performs the various functions that you want to perform and
> attach scripting commands to those.
> Morris
>
> On Mon, Mar 21, 2011 at 1:03 PM, richards christopher <
>

richards christopher

unread,
Mar 22, 2011, 3:20:40 PM3/22/11
to Open Wonderland Scripting
Hi Morris ,

II got it right. i did not enable the user script checkbox. However i
have the other doubts. is it possible to add scripts for an object
which has a paren child relation seperately? ( seperate script for the
child) Or Should i bring both the objects seperately in to wonderland
and arrange it inside.(its too tedious to do that). is there any other
alternative? please help. Thanks

Richards

On Mar 22, 2:31 pm, richards christopher <richards.s...@gmail.com>

Morris Ford

unread,
Mar 22, 2011, 4:07:45 PM3/22/11
to open-wonderl...@googlegroups.com
If you want to animate objects separately they should be separate objects. An exception to this would be a model created in Maya or Blender that has multiple nodes and there are animations for the separate nodes created in that tool. This can get pretty complicated to create and to animate in OWL.
Morris
Reply all
Reply to author
Forward
0 new messages