Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008867opensim[REGION] Script Functionspublic2021-02-14 00:572021-02-15 03:18
ReporterManni 
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusnewResolutionopen 
PlatformallOperating SystemallOperating System Versionall
Product Version0.9.1.0 
Target VersionFixed in Version 
Summary0008867: osDrawImagefromInventory
DescriptionI am not getting osDrawImagefromInventory to work.
The osDrawImage function of URL is too slow and cumbersome.
See article: https://forums.osgrid.org/viewtopic.php?f=5&t=6676&hilit=osDrawImagefromInventory [^]
What am I doing wrong?
Steps To Reproduce//OSSL_Stub.cs
public void osDrawImagefromInventory(string drawList, int width, int height, string texture)
{
m_OSSL_Functions.osDrawImagefromInventory(drawList, width, height, texture);
}

//OSSL_Api.cs
public string osDrawImagefromInventory(string drawList, int width, int height, string texture)
{
CheckThreatLevel();

drawList += "Image " + width + "," + height + "," + texture + "; ";
return drawList;
}

//IOSSL_Api.cs
string osDrawImagefromInventory(string drawList, int width, int height, string texture);


//OSSL
// Example of osDrawImagefromInventory
default
{
state_entry()
{
string CommandList = ""; // Storage for our drawing commands
CommandList = osMovePen( CommandList, 0, 0 ); // Upper left corner at <0,0>

// the first texture alphabetically inside the same prim's inventory
string texture = llGetInventoryName(INVENTORY_TEXTURE, 0);
CommandList = osDrawImagefromInventory( CommandList, 256, 100, texture ); // 256 pixels by 100 pixels

// Now draw the image
osSetDynamicTextureData( "", "vector", CommandList, "width:256,height:256", 1 );
}
}
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (Multiple Regions per Sim)
Physics EngineBulletSim
Script EngineYEngine
EnvironmentMono / Linux64
Mono Version6.x
ViewerSingularity
Attached Filespatch file icon 0001-osDrawInventoryImage-ossl-part.patch [^] (3,571 bytes) 2021-02-14 03:27 [Show Content]

- Relationships
related to 0008480new [FEATURE REQUEST] osDrawImage Improvement 

-  Notes
(0037567)
tampa (reporter)
2021-02-14 03:27
edited on: 2021-02-14 03:29

Because that's not how that works. The dynamic texture system retrieves the texture from the url, an item name is not a url. In order to do this properly one first needs to fetch the asset reference by item name, then still setting that up to parse into dynamic texture system would mean adding a way to parse straight asset data as Image directive for the parsing rules is handled as url still.

This is what the DynamicID parameter was supposed to do or at least something similar, but this has yet to be implemented. In order to do that some handling for asset image data would need to be added to the dynamic texture module, which might not be so easy(image handling is always complex subject).

You know there is llSetTexture, which can display a texture from inventory, if you still want to draw on that you can do so using the dynamic texture on a second prim using the Blend variant to make the texture of the prim underneath visible.

I added the ossl part as patch, it is a bit crude still and the texture manager part is still missing, but that part is rather complex so I don't feel like messing with it right now.

(0037573)
Manni (reporter)
2021-02-15 03:18

I did not know that it was so complicated because there is llSetTexture and I assumed that this could be easily adapted.
the blend variant was unknown to me until now.

- Issue History
Date Modified Username Field Change
2021-02-14 00:57 Manni New Issue
2021-02-14 03:27 tampa Note Added: 0037567
2021-02-14 03:27 tampa File Added: 0001-osDrawInventoryImage-ossl-part.patch
2021-02-14 03:29 tampa Note Edited: 0037567 View Revisions
2021-02-14 03:36 tampa Relationship added related to 0008480
2021-02-15 03:18 Manni Note Added: 0037573


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker