MantisBT - opensim
View Issue Details
0007009opensim[REGION] OpenSim Corepublic2014-02-14 07:572014-07-29 13:42
Garmin Kawaguichi 
Robert Adams 
normalmajoralways
closedfixed 
master (dev code) 
master (dev code) 
opensim_24354_ffd0da2_140214
Standalone (1 Region)
BulletSim
.NET / Windows32
None
FireStorm & Singularity
0007009: [VarRegion] load oar --displacement: legacy trees and grass are misplaced
In a VarRegion,
when using the console command load oar and the parameter --displacement, the objects are placed with the new offset except primitive trees and grass that are placed in the region {0-128, 0-128}. Their respective locations are complied with, but the offset was not added.
- Create a VarRegion 1280 x 1280 (5 x 5)
- Download the attached oar file which contains 676 objects including 336 primitive trees.
- On the console: load oar --displacement "<512, 512, 0>" ***path***\201414021331.oar
- If the problem is reproducible on your computer, you should find the 336 trees in the SW corner.
No tags attached.
? 201414021331.oar (236,491) 2014-02-14 07:57
http://opensimulator.org/mantis/file_download.php?file_id=3781&type=bug
Issue History
2014-02-14 07:57Garmin KawaguichiNew Issue
2014-02-14 07:57Garmin KawaguichiFile Added: 201414021331.oar
2014-02-14 08:10Robert AdamsAssigned To => Robert Adams
2014-02-14 08:10Robert AdamsStatusnew => assigned
2014-02-14 09:03Garmin KawaguichiNote Added: 0025186
2014-02-14 10:27Garmin KawaguichiNote Added: 0025187
2014-02-14 11:04Robert AdamsNote Added: 0025188
2014-02-14 12:50Garmin KawaguichiNote Added: 0025189
2014-02-15 19:55Robert AdamsNote Added: 0025207
2014-02-16 02:44Garmin KawaguichiNote Added: 0025212
2014-02-16 09:07Robert AdamsNote Added: 0025216
2014-02-16 09:07Robert AdamsStatusassigned => resolved
2014-02-16 09:07Robert AdamsFixed in Version => master (dev code)
2014-02-16 09:07Robert AdamsResolutionopen => fixed
2014-07-29 13:42chi11kenStatusresolved => closed

Notes
(0025186)
Garmin Kawaguichi   
2014-02-14 09:03   
After further tests, the issue is extented to the following console commands:
- rotate scene
- translate scene
- scale scene

and it concerns VarRegion and legacy regions.
(0025187)
Garmin Kawaguichi   
2014-02-14 10:27   
Oh man!!!! Trees have attachment point different from 0 ???

StdRegion (Sdb1) # translate scene 0 0 10
Object: Name:Cylinder AttachPoint:0
         ==>> PosAbs:<133.1279, 124.2376, 37.58902> PosAbsRoot:<133.1279, 124.23
76, 37.58902>
Object: Name:Tree2 AttachPoint:13
Object: Name:Cone AttachPoint:0
         ==>> PosAbs:<120.1557, 135.2008, 37.57781> PosAbsRoot:<120.1557, 135.20
08, 37.57781>
Object: Name:Tree3 AttachPoint:14
Object: Name:Tree1 AttachPoint:9
Object: Name:Sphere AttachPoint:0
         ==>> PosAbs:<135.1204, 134.0866, 37.59444> PosAbsRoot:<135.1204, 134.08
66, 37.59444>
(0025188)
Robert Adams   
2014-02-14 11:04   
The is exactly the problem and has been a bug in the --displacement parameter since it was first written. Why trees get away with storing their shape info in the AttachPoint variable is a different discussion.

The fix is to use a different test in --displacement for 'is this a real in-world object that should be displaced'. There is the routine SceneObjectGroup.IsAttachementFullCheck() which also checks the shape's PCode to see if it is a prim but that relies on other logic tracking its attachmentness. The other approach is to check the PCode to see if it is trees or grass and only rely on the AttachPoint setting if it is a prim.

I think there may be other places that fail for legacy trees.
(0025189)
Garmin Kawaguichi   
2014-02-14 12:50   
Visual C# said if (!sceneObject.IsAttachmentCheckFull) cannot be used.

I've tried with if (!sceneObject.IsAttachment) and the results seem correct.
---------------
OpenSim\Region\CoreModules\World\Archiver\ArchiveReadRequest.cs
Ln 486 in protected void LoadObjects(Scene scene, List<string> serialisedSceneObjects, List<SceneObjectGroup> sceneObjects)
replaced
                if (sceneObject.AttachmentPoint == 0)
by
                if (!sceneObject.IsAttachment)
---------------
OpenSim\Region\Application\OpenSim.cs
Ln 562 in private void HandleRotateScene(string module, string[] args)
replaced
                    if (sog.AttachmentPoint == 0)
by
                    if (!sog.IsAttachment)
---------
Ln 591 in private void HandleScaleScene(string module, string[] args)
replaced
                    if (sog.AttachmentPoint == 0)
by
                    if (!sog.IsAttachment)
---------
Ln 603 in private void HandleScaleScene(string module, string[] args)
replaced
                    if (sog.AttachmentPoint == 0)
by
                    if (!sog.IsAttachment)
---------
Ln 643 in private void HandleTranslateScene(string module, string[] args)
replaced
                    if (sog.AttachmentPoint == 0)
by
                    if (!sog.IsAttachment)
(0025207)
Robert Adams   
2014-02-15 19:55   
I followed your lead and changed both the 'load oar' and the scene commands to use the SOG.IsAttachment method. Is this fixed now?
(0025212)
Garmin Kawaguichi   
2014-02-16 02:44   
All seems OK now! Thank you for all your efforts to improve OpenSimulator!
(0025216)
Robert Adams   
2014-02-16 09:07   
Corrected check for attachment in archive loading and in scene manipulation console commands.