MantisBT - opensim
View Issue Details
0007509opensim[REGION] Script Functionspublic2015-03-20 11:552015-04-20 22:36
Magnuz 
nebadon 
normalminoralways
closedfixed 
Intel Core i7Ubuntu12.04
master (dev code) 
 
0.8.2
Grid (1 Region per Sim)
BulletSim
Mono / Linux32
2.10
Firestorm 4.4.2 for OS X
0007509: llSetLinkPrimitiveParams can't set some prim parameters as small as the viewer can
The following properties differ in limits between script and viewer, and needs to be reset in script handling to allow the same settings as from viewer. The attached patches allow this. Thanks to FreakyTech for getting my attention to this.

hollow: 95% -> 99%
dimple diff: 0.05 -> 0.02
hole_size: 0.05 -> 0.01
advanced_cut diff: 0.05 -> 0.02
No tags attached.
related to 0007508closed nebadon llSetLinkPrimitiveParamsFast cannot set path cut as small as the viewer can do 
patch 0001-Allow-setting-dimple-diff-to-0.02-from-scripts.patch (1,372) 2015-03-20 11:55
http://opensimulator.org/mantis/file_download.php?file_id=4141&type=bug
patch 0001-Allow-setting-holesize-to-0.01-from-scripts.patch (1,388) 2015-03-20 11:56
http://opensimulator.org/mantis/file_download.php?file_id=4142&type=bug
patch 0001-Allow-setting-hollow-to-99-from-scripts.patch (3,199) 2015-03-20 11:56
http://opensimulator.org/mantis/file_download.php?file_id=4143&type=bug
patch 0001-Allow-setting-profilecut-diff-to-0.02-from-scripts.patch (1,359) 2015-03-20 11:56
http://opensimulator.org/mantis/file_download.php?file_id=4144&type=bug
Issue History
2015-03-20 11:55MagnuzNew Issue
2015-03-20 11:55MagnuzFile Added: 0001-Allow-setting-dimple-diff-to-0.02-from-scripts.patch
2015-03-20 11:55MagnuzRelationship addedrelated to 0007508
2015-03-20 11:56MagnuzFile Added: 0001-Allow-setting-holesize-to-0.01-from-scripts.patch
2015-03-20 11:56MagnuzFile Added: 0001-Allow-setting-hollow-to-99-from-scripts.patch
2015-03-20 11:56MagnuzFile Added: 0001-Allow-setting-profilecut-diff-to-0.02-from-scripts.patch
2015-03-20 12:00MagnuzNote Added: 0027907
2015-03-20 12:00MagnuzStatusnew => patch included
2015-03-21 08:39Robert AdamsNote Added: 0027919
2015-03-21 11:58MagnuzNote Added: 0027923
2015-03-22 08:22MagnuzNote Added: 0027933
2015-03-22 10:23Robert AdamsNote Added: 0027934
2015-03-22 10:25Robert AdamsNote Added: 0027935
2015-04-12 12:30nebadonNote Added: 0027996
2015-04-12 12:30nebadonStatuspatch included => resolved
2015-04-12 12:30nebadonResolutionopen => fixed
2015-04-12 12:30nebadonAssigned To => nebadon
2015-04-13 10:39MagnuzNote Added: 0027998
2015-04-13 10:39MagnuzStatusresolved => patch included
2015-04-20 14:04nebadonNote Added: 0028038
2015-04-20 14:04nebadonStatuspatch included => resolved
2015-04-20 22:36MagnuzNote Added: 0028039
2015-04-20 22:36MagnuzStatusresolved => closed

Notes
(0027907)
Magnuz   
2015-03-20 12:00   
Patches added to adjust limits, one per property. The patch for dimple also fixes an old error and adds clipping.
(0027919)
Robert Adams   
2015-03-21 08:39   
Good changes but could you change the constants to be parameters? Maybe an XEngine parameter like 'MinimumCutSize' or something appropriate. The problem originally came because there are constants scattered around the code.

Also, could you look at the Util.Clamp* functions. There are some Util functions for bounding and min/max'ing values that might be useful.
(0027923)
Magnuz   
2015-03-21 11:58   
Sorry, but since I neither have the time, skills or a long enough stick to poke deeper into the XEngine mess, and have no clue what an "XEngine parameter" is, the answer will have to be no on the first, and I see no use in wasting time on the second then.

Feel free to close this Mantis.
(0027933)
Magnuz   
2015-03-22 08:22   
I'd suggest taking these patches and FreakyTech's in Mantis 7508 as is, and do the parameterization and re-factoring of code separately and consistently over the entire LSL_Api.

I've started looking into parameterization, having submitted one patch for the 63 sleep constants in Mantis 7510, that'll probably need updating after merging Mantis 7508 and 7509 or revising to better programming practice.

I've inventoried the 69 constants I deem suitable for parameterization for limits and clamping, but need advice on where to stash the parameters for them and how to make them accessible to the API and tests where they are used. Sorry, but I'm no C++ programmer, so don't expect anything too fancy.
(0027934)
Robert Adams   
2015-03-22 10:23   
I will push the commits shortly. Thanks for improving OpenSimulator!

As to parameters, OpenSimulator uses Nini which parses the INI files. Since most of your variables are in LSL_Api.cs, check out the routine 'LoadConfig()'. You will see that 'm_ScriptEngine.ConfigSource' is a handle to the base configuration. The call to 'seConfigSource.Config["LL-Functions"]' gets a handle to the "[LL-Functions]" INI section. You can use "lslConfig.GetBoolean(name, default)", 'GetFloat', and 'GetInteger' to fetch the values from the INI files. The calls give a default if the named parameter is not in the init file.

I'd think that the sleep parameters should go in the INI "[LL-Functions]" section rather than the "[XEngine]" section because they relate to the language parameters and not the particular engine executing them.

The other alternative is table driven parameters like in 'OpenSim/Region/Physics/BulletSPlugin/BSParam.cs' but that would be larger changes to XEngine.
(0027935)
Robert Adams   
2015-03-22 10:25   
oops. It's IConfig.GetInt(name, default) and not IConfig.GetInteger(name, default).

I get used to auto complete. :)
(0027996)
nebadon   
2015-04-12 12:30   
applied in master git
(0027998)
Magnuz   
2015-04-13 10:39   
The fourth patch "0001-Allow-setting-profilecut-diff-to-0.02-from-scripts.patch" was never applied.
(0028038)
nebadon   
2015-04-20 14:04   
fourth patch has been applied to git master > http://opensimulator.org/viewgit/?a=commit&p=opensim&h=e855c8e7118823808f6af89f878f81858fbf35c6 [^]
(0028039)
Magnuz   
2015-04-20 22:36   
Verified code and function, so closing.