[Opensim-dev] Best approach for Vanilla Opensim region module to create and manipulate scene objects.
Justin Clark-Casey
jjustincc at googlemail.com
Tue Feb 1 00:43:56 UTC 2011
On 31/01/11 14:33, Gould, Simon wrote:
> Hi All,
>
> I am new to Opensim development and was hoping I could “pick your brains” about how to best go about creating a region
> module, using the Vanilla Opensim c# API, that will create and manipulate objects within a scene.
API is rather strong at this point, but the internals have been stable for quite some time. However, this isn't
guaranteed to be the case in the future.
>
> I have taken a look at the documentation and also seen the Python Modrex visualisation of a Software project from source
> control. Unfortunately I am not very familiar with the Opensim API or Python and we want to avoid complicating the
> project by adding in extensions.
>
> What we have is a simple region module based on the Hello world example (I couldn’t get the updated mechanism to work).
>
> Where I am struggling is with the loading and copying of the objects. What we want is to have a set of persistent
> defined objects stored somewhere, then to create a number of these in the scene e.g. ObjA, ObjB and ObjC are stored
> somewhere, we create 3 objAs and 2 objBs and connect them together using ObjCs.
The technique I usually use is to place ObjA, ObjB and ObjC in another prim's inventory. Then I rez them by retrieving
them by name, with code like the following.
SceneObjectPart part;
Scene scene;
Vector3 rezPos;
TaskInventoryItem item = part.Inventory.GetInventoryItems(objAName)[0];
SceneObjectGroup so = part.Inventory.GetRezReadySceneObject(item);
scene.AddNewSceneObject(so, true, rezPos, so.Rotation, Vector3.Zero);
If you need to link then programatically that's another issue. There is some test code in
OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkTests.cs that should prove useful.
--
Justin Clark-Casey (justincc)
http://justincc.org/blog
http://twitter.com/justincc
More information about the Opensim-dev
mailing list