samplemediaurl.py script error

0 views
Skip to first unread message

pedro

unread,
Dec 10, 2009, 10:21:40 AM12/10/09
to realXtend
Hi all

when i use the samplemediaurl.py script from the tutorial pages in
taiga 0.0.2 with viewer 0.42
i get the following error in the opensim console

Region (MyTestRegion02) # HandleEvent_TouchStart exceptions.TypeError
rexSetTextureMediaURL() takes
exactly 3 arguments (2 given) <traceback object at 0x03E7F37C>

the script i used was:

import rxactor
import rxavatar
import sys
import clr

asm = clr.LoadAssemblyByName('OpenSim.Region.ScriptEngine.Shared')
Vector3 = asm.OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3

class MediaUrlPrim(rxactor.Actor):
def GetScriptClassName():
return "samplemediaurl.MediaUrlPrim"

def EventCreated(self):
super(self.__class__,self).EventCreated()
print "samplemediaurl.MediaUrl"
self.rexSetTextureMediaURL(self.rexGetPrimFreeData())

def SetNewMediaUrl(self,newurl):
self.rexSetTextureMediaURL(newurl)


class MediaUrlChanger(rxactor.Actor):
def GetScriptClassName():
return "samplemediaurl.MediaUrlChanger"

def EventCreated(self):
super(self.__class__,self).EventCreated()
print "samplemediaurl.MediaUrlChanger"
self.MyMediaUrlPrim = None
self.MyMediaUrl = ""
self.RefreshData()

def EventTouch(self,vAvatar):
self.RefreshData()

if(self.MyMediaUrlPrim != None):
self.MyMediaUrlPrim.SetNewMediaUrl(self.MyMediaUrl)
else:
print "Target prim for mediaurl change not found"


def RefreshData(self):
myfreedata = self.rexGetPrimFreeData()
paramlistlines = myfreedata.splitlines()

templocalid = self.GetPrimLocalIdFromUUID(paramlistlines[0])
self.MyMediaUrlPrim = self.MyWorld.GetActorByLocalID(str
(templocalid))
self.MyMediaUrl = paramlistlines[1]

Another thing i noticed - the UUID of the MediaUrlPrim changes every
time i log in again
but even changing that entry in the Data tab i get the same error
message as above

Next Question that came up - is there a limit for the parameters in
the Data tab ?

Mikko Pallari

unread,
Dec 11, 2009, 1:45:37 AM12/11/09
to realxtend
Hi,

it seems that there is a bug in that script. In class MediaUrlPrim in function EventCreated when using method rexSetTextureMediaURL it requires also a second argument. This argument is the refresh rate.

Current limitation at least in database for the free data field is 3000 characters.

Cheers,
Mikko

Toni Alatalo

unread,
Dec 11, 2009, 2:06:15 AM12/11/09
to real...@googlegroups.com
Mikko Pallari kirjoitti:
> it seems that there is a bug in that script. In class MediaUrlPrim in
> function EventCreated when using method rexSetTextureMediaURL it
> requires also a second argument. This argument is the refresh rate.

I think this has changed at some point - iirc when I originally wrote
that method it only took the URL. Refreshrate is of course very useful
but seems like something that would be nice as an optional argument with
a default value (defaulting to no refresh for static pages). Having
optional args with default values in py is nice, e.g.: def
setTextureMediaURL(url, refresh=False).

> Mikko

~Toni

Toni Alatalo

unread,
Dec 11, 2009, 2:17:25 AM12/11/09
to real...@googlegroups.com
Toni Alatalo kirjoitti:
> optional args with default values in py is nice, e.g.: def
> setTextureMediaURL(url, refresh=False).
>

eh, the impl of that in modrex is in c# though, so i guess allowing both
ways to call would be with an overload.

> ~Toni
>

same.

Carlos

unread,
Dec 14, 2009, 1:36:26 PM12/14/09
to realXtend
I have the same problem than Pedro, and i try to change the function
call to this: setTextureMediaURL(url, refresh=False), but now the
console message is: "rxmain,MainThread.run, EventCreated on actors:
exceptions.SystemError
Referencia a objeto no establecida como instancia de un objeto.
<traceback object at 0x01A99D27>". I think that the second argument is
Int32, but if you change for example: setTextureMediaURL(url, 1) the
error console is the same.
Regards,
Carlos

Mikko Pallari

unread,
Dec 15, 2009, 2:22:32 AM12/15/09
to realxtend
The second value needs to be refresh rate as int, not boolean.

I haven't encountered this error before, but it has been a while since I last tested it. Which version are you running?

Cheers,
Mikko

Carlos

unread,
Dec 15, 2009, 6:09:01 PM12/15/09
to realXtend
Mikko, the openSim server version is 0.6.5 over a RX server 0.5
Thanks
Carlos

On 15 dic, 08:22, Mikko Pallari <mikko.pall...@evocativi.com> wrote:
> The second value needs to be refresh rate as int, not boolean.
>
> I haven't encountered this error before, but it has been a while since I
> last tested it. Which version are you running?
>
> Cheers,
> Mikko
>
Reply all
Reply to author
Forward
0 new messages