<div dir="ltr"><div>Hi,</div>
<div> </div>
<div>I'm working on realXtend platform (ModreX) and OpenSim-0.6.7, coding in IronPython 2.0.3.</div>
<div>I've got an image that i'de like to put as a texture of a prim.</div>
<div> </div>
<div>the code that i used is:</div>
<div> </div>
<div># the code that comes before what I've pasted next fetches an image attachment from an e-mail using: <br># image = part.get_payload(decode = True)</div>
<div> </div>
<div># now the code that tries to make it a texture:</div>
<div> asset.FullID = str(uuid.uuid1())<br> asset.Name = "DynamicImage" + str(Util.RandomClass.Next(1, 10000))<br> asset.Type = 0<br> asset.Description = "Mail image"<br> asset.Local = False<br>
asset.Temporary = False</div>
<div> </div>
<div># image is an 'str' type, but is actually an image. converting to byteArray type<br> byteArray = Array[Byte](tuple(Byte(ord(c)) for c in image))</div>
<div> asset.Data = byteArray</div>
<div> </div>
<div> self.MyWorld.CS.World.AssetService.Store(asset)<br> j2kdecoder.syncdecode(asset.FullID, asset.Data)<br> self.MyWorld.CS.World.AssetService.Store(asset)</div>
<div> </div>
<div># now the decoded image is stored. trying to present texture</div>
<div> id = str(asset.FullID)</div>
<div> </div>
<div># this next command doesn't work for me. i get white texture on all faces instead of my image<br> LSLObject.llSetTexture(self, id, -1)</div>
<div> </div>
<div>or if you'de like to see the code in pastebin: <a href="http://pastebin.org/52980">http://pastebin.org/52980</a></div>
<div> </div>
<div> </div>
<div>This doesn't work for me, as i get some white texture in the end.</div>
<div>I don't know what am I doing wrong.. :-(</div>
<div> </div>
<div>Thank you,</div>
<div> Matan</div></div>