I think I've sorted out the problem with adding an image to a mesh
model.  I hadn't UV mapped it properly so I tried it with another
model and it worked.

I am trying to use the coi_tvscreen.py script from Chambers to work in
my test world with different images.  I am getting some very strange
results at the moment.

1) I imported a tv screen from google warehouse into my realxtend test
world.  I added the script coi_tvscreen.Screen in the Rex, Misc, Class
Name.  I was then able to select both images in the Rex, Materials
pull down menu.  I could see the script was working because the two
different image names were alternating in the menu box.  However, the
textured pattern on the tv screen stayed the same and didn't change.

2) Next I've imported a plain mesh rectanglular box and added the
coi_tvscreen.Screen script in the same way.  However this time I
didn't see any evidence of the script working as it did in the
previous example.  This time the image displayed as an image and not
as a texture and similarly didn't change at all.

As I think the coi_tvscreen.py script is a really useful script as it
uses a timer and it displays different images I'd really like to be
able to reproduce this effect.   Is there anything in the python
script which makes it difficult to use?  e.g. does it need a special
material script?  I'm not sure what self.SetRexTemporaryPrim(True)
means?


# realXtend - Chambers of Ikuturso

import rxactor
import rxavatar
import sys
import clr

import random
import math

class Screen(rxactor.Actor):
    def GetScriptClassName():
        return "coi_tvscreen.Screen"

    def EventCreated(self):
        super(self.__class__,self).EventCreated()
        self.PicIndex = 0

        self.SetRexTemporaryPrim(True)
        self.MyScreenTimer = self.CreateRexTimer(5,0)
        self.MyScreenTimer.onTimer += self.HandleScreenTimer
        self.MyScreenTimer.Start()

    def EventDestroyed(self):
        del self.MyScreenTimer
        self.MyScreenTimer = None
        super(self.__class__,self).EventDestroyed()

    def HandleScreenTimer(self):
        self.PicIndex += 1
        if(self.PicIndex > 2):
            self.PicIndex = 1

        if(self.PicIndex == 1):
            self.RexSetMaterialByName(1,"picture1")
        else:
            self.RexSetMaterialByName(1,"picture2")

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/realxtend
http://www.realxtend.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to