Previous topic

net

Next topic

parcel

This Page

objects

class pyogp.lib.base.objects.Object(LocalID=None, State=None, FullID=None, CRC=None, PCode=None, Material=None, ClickAction=None, Scale=None, ObjectData=None, ParentID=None, UpdateFlags=None, PathCurve=None, ProfileCurve=None, PathBegin=None, PathEnd=None, PathScaleX=None, PathScaleY=None, PathShearX=None, PathShearY=None, PathTwist=None, PathTwistBegin=None, PathRadiusOffset=None, PathTaperX=None, PathTaperY=None, PathRevolutions=None, PathSkew=None, ProfileBegin=None, ProfileEnd=None, ProfileHollow=None, TextureEntry=None, TextureAnim=None, NameValue=None, Data=None, Text=None, TextColor=None, MediaURL=None, PSBlock=None, ExtraParams=None, Sound=None, OwnerID=None, Gain=None, Flags=None, Radius=None, JointType=None, JointPivot=None, JointAxisOrAnchor=None, FootCollisionPlane=None, Position=None, Velocity=None, Acceleration=None, Rotation=None, AngularVelocity=None)

represents an Object

Initialize the Object class instance >>> object = Object()

Sample implementations: objects.py Tests: tests/test_objects.py

set up the object attributes

derez(agent, destination, destinationID, transactionID, GroupID, PacketCount=1, PacketNumber=0)
derez an object, specifying the destination
deselect(agent)
deselect an object
select(agent)
select an object
send_DerezObject(agent, AgentID, SessionID, GroupID, Destination, DestinationID, TransactionID, PacketCount, PacketNumber, ObjectLocalID)
send a DerezObject message to the host simulator
send_ObjectDescription(agent, AgentID, SessionID, LocalID_Description_map)

send on ObjectDescription message to the host simulator

expects LocalID_Description_map = {1:[LocalID, Description]}

send_ObjectDeselect(agent, AgentID, SessionID, ObjectLocalIDs)

send an ObjectDeselect message to the agent’s host simulator

expects a list of ObjectLocalIDs

send_ObjectName(agent, AgentID, SessionID, LocalID_Name_map)

send on ObjectName message to the host simulator

expects LocalID_Name_map = {1:[LocalID, Name]}

send_ObjectPermissions(agent, AgentID, SessionID, Field, Set, Mask, Override)
send an ObjectPermissions message to the host simulator
send_ObjectSelect(agent, AgentID, SessionID, ObjectLocalIDs)

send an ObjectSelect message to the agent’s host simulator

expects a list of ObjectLocalIDs

set_object_copy_mod_permissions(agent)
Set Next Owner Permissions to Copy/Mod This is a common permission set for attachements.
set_object_copy_only_permissions(agent)
Set Next Owner Permissions to Copy Only
set_object_copy_transfer_permissions(agent)
Set Next Owner Permissions to Copy/Transfer
set_object_description(agent, Description)
update the description of an objects
set_object_full_permissions(agent)
Set Next Owner Permissions Copy, Modify, Transfer This is also called ‘full permissions’.
set_object_mod_transfer_permissions(agent)
Set Next Owner Permissions to Mod/Transfer This is a common permission set for clothing.
set_object_name(agent, Name)
update the name of an object
set_object_transfer_only_permissions(agent)
Set Next Owner Permissions to Transfer Only This is the most restrictive set of permissions allowed.
take(agent)
take object into inventory
update_object_permissions(agent, Field, Set, Mask, Override=False)

update permissions for a list of objects

This will update a specific bit to a specific value.

class pyogp.lib.base.objects.ObjectManager(agent=None, region=None, settings=None, message_handler=None, events_handler=None)

is an Object Manager

Initialize the event queue client class >>> objects = ObjectManager()

Sample implementations: region.py Tests: tests/test_objects.py

set up the object manager

create_default_box(GroupID=00000000-0000-0000-0000-000000000000, relative_position=(1, 0, 0))
creates the default box, defaulting as 1m to the east, with an option GroupID to set the prim to
enable_callbacks()
enables the callback handlers for this ObjectManager
find_objects_by_name(Name)

searches the store for known objects by name

returns a list of all such known objects

find_objects_within_radius(radius)
returns objects nearby. returns a list of objects
get_avatar_from_store(LocalID=None, FullID=None)
searches the store and returns object if stored, None otherwise
get_object_from_store(LocalID=None, FullID=None)
searches the store and returns object if stored, None otherwise
kill_stored_avatar(ID)
removes a stored avatar (Object() instance) from our list
kill_stored_object(ID)
my_objects()
returns a list of known objects where the calling client is the owner
object_add(AgentID, SessionID, PCode, Material, AddFlags, PathCurve, ProfileCurve, PathBegin, PathEnd, PathScaleX, PathScaleY, PathShearX, PathShearY, PathTwist, PathTwistBegin, PathRadiusOffset, PathTaperX, PathTaperY, PathRevolutions, PathSkew, ProfileBegin, ProfileEnd, ProfileHollow, BypassRaycast, RayStart, RayEnd, RayTargetID, RayEndIsIntersection, Scale, Rotation, State, GroupID=00000000-0000-0000-0000-000000000000)

ObjectAdd - create new object in the world Simulator will assign ID and send message back to signal object actually created.

AddFlags (see also ObjectUpdate) 0x01 - use physics 0x02 - create selected

GroupID defaults to (No group active)

onKillObject(packet)
onObjectProperties(packet)
onObjectUpdate(packet)
populates an Object instance and adds it to the ObjectManager() store
onObjectUpdateCached(packet)
borrowing from libomv, we’ll request object data for all data coming in via ObjectUpdateCached
onObjectUpdateCompressed(packet)
handles an ObjectUpdateCompressed message from a simulator
process_multiple_object_updates(objects)
process a list of object updates
process_object_update(_object)
append to or replace an object in self.objects
remove_object_from_store(ID=None)
handles removing a stored object representation
request_object_update(AgentID, SessionID, ID_CacheMissType_list=None)

requests object updates from the simulator

accepts a list of (ID, CacheMissType)

send_RezScript(agent, prim, item_id=00000000-0000-0000-0000-000000000000, Enabled=True, GroupID=00000000-0000-0000-0000-000000000000, BaseMask=2147483647, OwnerMask=2147483647, GroupMask=0, EveryoneMask=0, NextOwnerMask=0, GroupOwned=False, Type=10, InvType=10, Flags=0, SaleType=0, SalePrice=0, Name='New Script', Description='Created by PyOGP', CreationDate=0, CRC=0)
sends a RezScript message to the sim, not providing a item_id will rez the default script otherwise the script with ItemID item_id will be rezzed to prim
store_avatar(_objectdata)
store a representation of an avatar (Object() instance) that has been transformed from data off the wire
store_object(_object)
store a representation of an object that has been transformed from data off the wire
update_multiple_objects_properties(object_list)
update the attributes of objects
update_object_properties(object_properties)

update the attributes of an object

If the object is known, we update the properties. If not, we create a new object

update_prim_properties(prim_properties)
handles an object update and updates or adds to internal representation